@bpmn-io/properties-panel 3.29.1 → 3.30.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.
package/dist/index.js CHANGED
@@ -257,6 +257,19 @@ const EventContext = preact.createContext({
257
257
  eventBus: null
258
258
  });
259
259
 
260
+ /**
261
+ * @typedef { {
262
+ * parserDialect?: import('@bpmn-io/feel-editor').ParserDialect,
263
+ * builtins?: import('@bpmn-io/feel-editor').Variable[],
264
+ * dialect?: import('@bpmn-io/feel-editor').Dialect
265
+ * } } FeelLanguageContextType
266
+ */
267
+
268
+ /**
269
+ * @type {import('preact').Context<FeelLanguageContextType>}
270
+ */
271
+ const FeelLanguageContext = preact.createContext({});
272
+
260
273
  const LayoutContext = preact.createContext({
261
274
  layout: {},
262
275
  setLayout: () => {},
@@ -1757,11 +1770,17 @@ const FeelEditor = compat.forwardRef((props, ref) => {
1757
1770
  popupOpen,
1758
1771
  disabled,
1759
1772
  tooltipContainer,
1760
- variables
1773
+ variables,
1774
+ feelLanguageContext
1761
1775
  } = props;
1762
1776
  const inputRef = hooks.useRef();
1763
1777
  const [editor, setEditor] = hooks.useState();
1764
1778
  const [localValue, setLocalValue] = hooks.useState(value || '');
1779
+ const {
1780
+ builtins,
1781
+ dialect,
1782
+ parserDialect
1783
+ } = feelLanguageContext || {};
1765
1784
  useBufferedFocus(editor, ref);
1766
1785
  const handleInput = useStaticCallback(newValue => {
1767
1786
  onInput(newValue);
@@ -1793,7 +1812,10 @@ const FeelEditor = compat.forwardRef((props, ref) => {
1793
1812
  placeholder: placeholder,
1794
1813
  tooltipContainer: tooltipContainer,
1795
1814
  value: localValue,
1796
- variables: variables,
1815
+ variables,
1816
+ builtins,
1817
+ dialect,
1818
+ parserDialect,
1797
1819
  extensions: [...(enableGutters ? [view.lineNumbers()] : []), view.EditorView.lineWrapping],
1798
1820
  contentAttributes
1799
1821
  });
@@ -2215,6 +2237,7 @@ function FeelTextfield(props) {
2215
2237
  const containerRef = hooks.useRef();
2216
2238
  const feelActive = minDash.isString(localValue) && localValue.startsWith('=') || feel === 'required';
2217
2239
  const feelOnlyValue = minDash.isString(localValue) && localValue.startsWith('=') ? localValue.substring(1) : localValue;
2240
+ const feelLanguageContext = hooks.useContext(FeelLanguageContext);
2218
2241
  const [focus, _setFocus] = hooks.useState(undefined);
2219
2242
  const {
2220
2243
  eventBus
@@ -2293,7 +2316,8 @@ function FeelTextfield(props) {
2293
2316
  tooltipContainer,
2294
2317
  type,
2295
2318
  value: feelOnlyValue,
2296
- variables
2319
+ variables,
2320
+ feelLanguageContext
2297
2321
  });
2298
2322
  if (isOpen) {
2299
2323
  eventBus.once('propertiesPanelPopup.close', () => {
@@ -2399,6 +2423,7 @@ function FeelTextfield(props) {
2399
2423
  placeholder: placeholder,
2400
2424
  value: feelOnlyValue,
2401
2425
  variables: variables,
2426
+ feelLanguageContext: feelLanguageContext,
2402
2427
  ref: editorRef,
2403
2428
  tooltipContainer: tooltipContainer
2404
2429
  }) : jsxRuntime.jsx(OptionalComponent, {
@@ -4111,7 +4136,8 @@ function FeelPopup$1(props) {
4111
4136
  singleLine,
4112
4137
  sourceElement,
4113
4138
  tooltipContainer,
4114
- eventBus
4139
+ eventBus,
4140
+ feelLanguageContext
4115
4141
  } = props;
4116
4142
  const editorRef = hooks.useRef();
4117
4143
  const popupRef = hooks.useRef();
@@ -4181,6 +4207,7 @@ function FeelPopup$1(props) {
4181
4207
  onInput: onInput,
4182
4208
  value: value,
4183
4209
  variables: variables,
4210
+ feelLanguageContext: feelLanguageContext,
4184
4211
  ref: editorRef,
4185
4212
  tooltipContainer: tooltipContainer
4186
4213
  }), type === 'feelers' && jsxRuntime.jsx(TemplatingEditor, {
@@ -4416,6 +4443,7 @@ exports.ExternalLinkIcon = ExternalLinkIcon;
4416
4443
  exports.FeelCheckboxEntry = FeelCheckboxEntry;
4417
4444
  exports.FeelEntry = FeelEntry;
4418
4445
  exports.FeelIcon = FeelIcon$1;
4446
+ exports.FeelLanguageContext = FeelLanguageContext;
4419
4447
  exports.FeelNumberEntry = FeelNumberEntry;
4420
4448
  exports.FeelPopupModule = index;
4421
4449
  exports.FeelTemplatingEntry = FeelTemplatingEntry;