@process.co/ui 0.0.6 → 0.0.7

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.
@@ -1,2 +1,2 @@
1
1
  import 'react';
2
- export { I as Input, j as InputProps, N as NestedFieldProvider, e as NestedFieldProviderProps, S as Select, l as SelectOption, k as SelectProps, m as SelectRenderProps, h as TemplateFieldChangeEvent, T as TemplateFieldContextValue, g as TemplateFieldFocusContext, c as TemplateFieldProvider, d as TemplateFieldProviderProps, f as TemplateFieldValidationError, b as useFieldPath, a as useIsInTemplateFieldProvider, u as useTemplateFieldContext } from '../../index-C1wa8N9L.cjs';
2
+ export { l as InferConfig, j as InferredTypesContext, I as InferredTypesContextValue, n as Input, o as InputProps, N as NestedFieldProvider, e as NestedFieldProviderProps, O as OPERATORS_BY_TYPE, S as Select, r as SelectOption, q as SelectProps, s as SelectRenderProps, h as TemplateFieldChangeEvent, T as TemplateFieldContextValue, g as TemplateFieldFocusContext, c as TemplateFieldProvider, d as TemplateFieldProviderProps, f as TemplateFieldValidationError, m as getOperatorsForType, p as parseInferSyntax, b as useFieldPath, k as useInferredTypes, a as useIsInTemplateFieldProvider, u as useTemplateFieldContext } from '../../index-_mVyhd0I.cjs';
@@ -1,2 +1,2 @@
1
1
  import 'react';
2
- export { I as Input, j as InputProps, N as NestedFieldProvider, e as NestedFieldProviderProps, S as Select, l as SelectOption, k as SelectProps, m as SelectRenderProps, h as TemplateFieldChangeEvent, T as TemplateFieldContextValue, g as TemplateFieldFocusContext, c as TemplateFieldProvider, d as TemplateFieldProviderProps, f as TemplateFieldValidationError, b as useFieldPath, a as useIsInTemplateFieldProvider, u as useTemplateFieldContext } from '../../index-C1wa8N9L.js';
2
+ export { l as InferConfig, j as InferredTypesContext, I as InferredTypesContextValue, n as Input, o as InputProps, N as NestedFieldProvider, e as NestedFieldProviderProps, O as OPERATORS_BY_TYPE, S as Select, r as SelectOption, q as SelectProps, s as SelectRenderProps, h as TemplateFieldChangeEvent, T as TemplateFieldContextValue, g as TemplateFieldFocusContext, c as TemplateFieldProvider, d as TemplateFieldProviderProps, f as TemplateFieldValidationError, m as getOperatorsForType, p as parseInferSyntax, b as useFieldPath, k as useInferredTypes, a as useIsInTemplateFieldProvider, u as useTemplateFieldContext } from '../../index-_mVyhd0I.js';
@@ -89,7 +89,8 @@ function _unsupported_iterable_to_array(o, minLen) {
89
89
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
90
90
  }
91
91
  import * as React3 from 'react';
92
- // src/components/fields/Input.tsx
92
+ import { createContext, useContext } from 'react';
93
+ // src/components/fields/index.tsx
93
94
  // ../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
94
95
  function r(e) {
95
96
  var t, f, n = "";
@@ -4966,5 +4967,120 @@ function NestedFieldProvider(param) {
4966
4967
  var children = param.children;
4967
4968
  return /* @__PURE__ */ React.createElement(React.Fragment, null, children);
4968
4969
  }
4969
- export { Input, NestedFieldProvider, Select, TemplateFieldProvider, useFieldPath, useIsInTemplateFieldProvider, useTemplateFieldContext }; //# sourceMappingURL=index.js.map
4970
+ var InferredTypesContext = createContext(null);
4971
+ function useInferredTypes() {
4972
+ return useContext(InferredTypesContext);
4973
+ }
4974
+ function parseInferSyntax(expectedType) {
4975
+ var _match_;
4976
+ if (!expectedType || !expectedType.startsWith("$infer<")) {
4977
+ return {
4978
+ mode: "normal"
4979
+ };
4980
+ }
4981
+ var match = expectedType.match(/^\$infer<(.+)>$/);
4982
+ if (!match) {
4983
+ return {
4984
+ mode: "normal"
4985
+ };
4986
+ }
4987
+ var content = ((_match_ = match[1]) === null || _match_ === void 0 ? void 0 : _match_.trim()) || "";
4988
+ if (!content.includes("|") && /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(content)) {
4989
+ return {
4990
+ mode: "subscribe",
4991
+ subscribeToField: content
4992
+ };
4993
+ }
4994
+ var allowedTypes = content.split("|").map(function(t) {
4995
+ return t.trim();
4996
+ }).filter(Boolean);
4997
+ return {
4998
+ mode: "publish",
4999
+ allowedTypes: allowedTypes
5000
+ };
5001
+ }
5002
+ var OPERATORS_BY_TYPE = {
5003
+ string: [
5004
+ {
5005
+ value: "==",
5006
+ label: "equals (==)"
5007
+ },
5008
+ {
5009
+ value: "!=",
5010
+ label: "not equals (!=)"
5011
+ },
5012
+ {
5013
+ value: "contains",
5014
+ label: "contains"
5015
+ },
5016
+ {
5017
+ value: "startsWith",
5018
+ label: "starts with"
5019
+ },
5020
+ {
5021
+ value: "endsWith",
5022
+ label: "ends with"
5023
+ }
5024
+ ],
5025
+ number: [
5026
+ {
5027
+ value: "==",
5028
+ label: "equals (==)"
5029
+ },
5030
+ {
5031
+ value: "!=",
5032
+ label: "not equals (!=)"
5033
+ },
5034
+ {
5035
+ value: "<",
5036
+ label: "less than (<)"
5037
+ },
5038
+ {
5039
+ value: ">",
5040
+ label: "greater than (>)"
5041
+ },
5042
+ {
5043
+ value: "<=",
5044
+ label: "less than or equal (<=)"
5045
+ },
5046
+ {
5047
+ value: ">=",
5048
+ label: "greater than or equal (>=)"
5049
+ }
5050
+ ],
5051
+ boolean: [
5052
+ {
5053
+ value: "==",
5054
+ label: "equals (==)"
5055
+ },
5056
+ {
5057
+ value: "!=",
5058
+ label: "not equals (!=)"
5059
+ }
5060
+ ],
5061
+ any: [
5062
+ {
5063
+ value: "==",
5064
+ label: "equals (==)"
5065
+ },
5066
+ {
5067
+ value: "!=",
5068
+ label: "not equals (!=)"
5069
+ }
5070
+ ]
5071
+ };
5072
+ function getOperatorsForType(type) {
5073
+ var _OPERATORS_BY_TYPE_type, _ref;
5074
+ return (_ref = (_OPERATORS_BY_TYPE_type = OPERATORS_BY_TYPE[type]) !== null && _OPERATORS_BY_TYPE_type !== void 0 ? _OPERATORS_BY_TYPE_type : OPERATORS_BY_TYPE.any) !== null && _ref !== void 0 ? _ref : [
5075
+ {
5076
+ value: "==",
5077
+ label: "equals (==)"
5078
+ },
5079
+ {
5080
+ value: "!=",
5081
+ label: "not equals (!=)"
5082
+ }
5083
+ ];
5084
+ }
5085
+ export { InferredTypesContext, Input, NestedFieldProvider, OPERATORS_BY_TYPE, Select, TemplateFieldProvider, getOperatorsForType, parseInferSyntax, useFieldPath, useInferredTypes, useIsInTemplateFieldProvider, useTemplateFieldContext }; //# sourceMappingURL=index.js.map
4970
5086
  //# sourceMappingURL=index.js.map