@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.esm.js CHANGED
@@ -236,6 +236,19 @@ const EventContext = createContext({
236
236
  eventBus: null
237
237
  });
238
238
 
239
+ /**
240
+ * @typedef { {
241
+ * parserDialect?: import('@bpmn-io/feel-editor').ParserDialect,
242
+ * builtins?: import('@bpmn-io/feel-editor').Variable[],
243
+ * dialect?: import('@bpmn-io/feel-editor').Dialect
244
+ * } } FeelLanguageContextType
245
+ */
246
+
247
+ /**
248
+ * @type {import('preact').Context<FeelLanguageContextType>}
249
+ */
250
+ const FeelLanguageContext = createContext({});
251
+
239
252
  const LayoutContext = createContext({
240
253
  layout: {},
241
254
  setLayout: () => {},
@@ -1736,11 +1749,17 @@ const FeelEditor = forwardRef((props, ref) => {
1736
1749
  popupOpen,
1737
1750
  disabled,
1738
1751
  tooltipContainer,
1739
- variables
1752
+ variables,
1753
+ feelLanguageContext
1740
1754
  } = props;
1741
1755
  const inputRef = useRef();
1742
1756
  const [editor, setEditor] = useState();
1743
1757
  const [localValue, setLocalValue] = useState(value || '');
1758
+ const {
1759
+ builtins,
1760
+ dialect,
1761
+ parserDialect
1762
+ } = feelLanguageContext || {};
1744
1763
  useBufferedFocus(editor, ref);
1745
1764
  const handleInput = useStaticCallback(newValue => {
1746
1765
  onInput(newValue);
@@ -1772,7 +1791,10 @@ const FeelEditor = forwardRef((props, ref) => {
1772
1791
  placeholder: placeholder,
1773
1792
  tooltipContainer: tooltipContainer,
1774
1793
  value: localValue,
1775
- variables: variables,
1794
+ variables,
1795
+ builtins,
1796
+ dialect,
1797
+ parserDialect,
1776
1798
  extensions: [...(enableGutters ? [lineNumbers()] : []), EditorView.lineWrapping],
1777
1799
  contentAttributes
1778
1800
  });
@@ -2194,6 +2216,7 @@ function FeelTextfield(props) {
2194
2216
  const containerRef = useRef();
2195
2217
  const feelActive = isString(localValue) && localValue.startsWith('=') || feel === 'required';
2196
2218
  const feelOnlyValue = isString(localValue) && localValue.startsWith('=') ? localValue.substring(1) : localValue;
2219
+ const feelLanguageContext = useContext(FeelLanguageContext);
2197
2220
  const [focus, _setFocus] = useState(undefined);
2198
2221
  const {
2199
2222
  eventBus
@@ -2272,7 +2295,8 @@ function FeelTextfield(props) {
2272
2295
  tooltipContainer,
2273
2296
  type,
2274
2297
  value: feelOnlyValue,
2275
- variables
2298
+ variables,
2299
+ feelLanguageContext
2276
2300
  });
2277
2301
  if (isOpen) {
2278
2302
  eventBus.once('propertiesPanelPopup.close', () => {
@@ -2378,6 +2402,7 @@ function FeelTextfield(props) {
2378
2402
  placeholder: placeholder,
2379
2403
  value: feelOnlyValue,
2380
2404
  variables: variables,
2405
+ feelLanguageContext: feelLanguageContext,
2381
2406
  ref: editorRef,
2382
2407
  tooltipContainer: tooltipContainer
2383
2408
  }) : jsx(OptionalComponent, {
@@ -4090,7 +4115,8 @@ function FeelPopup$1(props) {
4090
4115
  singleLine,
4091
4116
  sourceElement,
4092
4117
  tooltipContainer,
4093
- eventBus
4118
+ eventBus,
4119
+ feelLanguageContext
4094
4120
  } = props;
4095
4121
  const editorRef = useRef();
4096
4122
  const popupRef = useRef();
@@ -4160,6 +4186,7 @@ function FeelPopup$1(props) {
4160
4186
  onInput: onInput,
4161
4187
  value: value,
4162
4188
  variables: variables,
4189
+ feelLanguageContext: feelLanguageContext,
4163
4190
  ref: editorRef,
4164
4191
  tooltipContainer: tooltipContainer
4165
4192
  }), type === 'feelers' && jsx(TemplatingEditor, {
@@ -4378,5 +4405,5 @@ var index = {
4378
4405
  feelPopupRenderer: ['type', FeelPopupRenderer]
4379
4406
  };
4380
4407
 
4381
- export { ArrowIcon, CheckboxEntry, CloseIcon, CollapsibleEntry, CreateIcon, index$1 as DebounceInputModule, DeleteIcon, DescriptionContext, Description as DescriptionEntry, DragIcon, DropdownButton, ErrorsContext, EventContext, ExternalLinkIcon, FeelCheckboxEntry, FeelEntry, FeelIcon$1 as FeelIcon, FeelNumberEntry, index as FeelPopupModule, FeelTemplatingEntry, FeelTextAreaEntry, FeelToggleSwitchEntry, Group, Header, HeaderButton, LaunchIcon, LayoutContext, List as ListEntry, ListGroup, ListItem, NumberFieldEntry, OpenPopupIcon, Placeholder, PropertiesPanel, LayoutContext as PropertiesPanelContext, SelectEntry, Simple as SimpleEntry, TemplatingEntry, TextAreaEntry, TextfieldEntry as TextFieldEntry, ToggleSwitchEntry, TooltipContext, TooltipWrapper as TooltipEntry, isEdited$8 as isCheckboxEntryEdited, isEdited$5 as isFeelEntryEdited, isEdited$6 as isNumberFieldEntryEdited, isEdited$3 as isSelectEntryEdited, isEdited$2 as isSimpleEntryEdited, isEdited$4 as isTemplatingEntryEdited, isEdited$1 as isTextAreaEntryEdited, isEdited as isTextFieldEntryEdited, isEdited$7 as isToggleSwitchEntryEdited, useDebounce, useDescriptionContext, useElementVisible, useError, useErrors, useEvent, useKeyFactory, useLayoutState, usePrevious, useShowEntryEvent, useStaticCallback, useStickyIntersectionObserver, useTooltipContext };
4408
+ export { ArrowIcon, CheckboxEntry, CloseIcon, CollapsibleEntry, CreateIcon, index$1 as DebounceInputModule, DeleteIcon, DescriptionContext, Description as DescriptionEntry, DragIcon, DropdownButton, ErrorsContext, EventContext, ExternalLinkIcon, FeelCheckboxEntry, FeelEntry, FeelIcon$1 as FeelIcon, FeelLanguageContext, FeelNumberEntry, index as FeelPopupModule, FeelTemplatingEntry, FeelTextAreaEntry, FeelToggleSwitchEntry, Group, Header, HeaderButton, LaunchIcon, LayoutContext, List as ListEntry, ListGroup, ListItem, NumberFieldEntry, OpenPopupIcon, Placeholder, PropertiesPanel, LayoutContext as PropertiesPanelContext, SelectEntry, Simple as SimpleEntry, TemplatingEntry, TextAreaEntry, TextfieldEntry as TextFieldEntry, ToggleSwitchEntry, TooltipContext, TooltipWrapper as TooltipEntry, isEdited$8 as isCheckboxEntryEdited, isEdited$5 as isFeelEntryEdited, isEdited$6 as isNumberFieldEntryEdited, isEdited$3 as isSelectEntryEdited, isEdited$2 as isSimpleEntryEdited, isEdited$4 as isTemplatingEntryEdited, isEdited$1 as isTextAreaEntryEdited, isEdited as isTextFieldEntryEdited, isEdited$7 as isToggleSwitchEntryEdited, useDebounce, useDescriptionContext, useElementVisible, useError, useErrors, useEvent, useKeyFactory, useLayoutState, usePrevious, useShowEntryEvent, useStaticCallback, useStickyIntersectionObserver, useTooltipContext };
4382
4409
  //# sourceMappingURL=index.esm.js.map