@uniformdev/context-ui 20.8.1 → 20.8.2-alpha.15

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.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as _emotion_react_types_jsx_namespace from '@emotion/react/types/jsx-namespace';
2
2
  import * as _emotion_react from '@emotion/react';
3
- import { DimensionDefinition, Test, ManifestGetResponse } from '@uniformdev/context/api';
4
- import { DimensionMatch, EnrichmentData, VariantMatchCriteria } from '@uniformdev/context';
3
+ import { DimensionDefinition, Test, ManifestGetResponse, Quirk, QuirkGetResponse } from '@uniformdev/context/api';
4
+ import { DimensionMatch, QuirkMatch, EnrichmentData, VariantMatchCriteria } from '@uniformdev/context';
5
5
  import { InputComboBoxProps, InputComboBoxOption } from '@uniformdev/design-system';
6
6
  export * from '@uniformdev/design-system';
7
7
  import React, { ComponentType, ReactElement } from 'react';
@@ -36,15 +36,21 @@ interface AbTestSelectorProps {
36
36
  declare const AbTestSelector: ({ value, setValue, contextConfig, loading }: AbTestSelectorProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
37
37
 
38
38
  type CriteriaOperatorMenuProps = {
39
- value: DimensionMatch['op'];
40
- onChange: (newValue: DimensionMatch['op']) => void;
39
+ value: DimensionMatch['op'] | QuirkMatch['op'];
40
+ onChange: (newValue: DimensionMatch['op'] | QuirkMatch['op']) => void;
41
+ rhsType?: ResolvedDimensionDefinition['category'] | 'QUIRK';
41
42
  } & Omit<InputComboBoxProps<InputComboBoxOption, false>, 'value' | 'options' | 'onChange'>;
42
43
  declare const contextCriteriaMenuOperators: Array<{
43
44
  name: string;
44
45
  description?: string;
45
46
  value: DimensionMatch['op'];
46
47
  }>;
47
- declare function CriteriaOperatorMenu({ onChange, value, ...props }: CriteriaOperatorMenuProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
48
+ declare const enrichmentCriteriaMenuOperators: Array<{
49
+ name: string;
50
+ description?: string;
51
+ value: DimensionMatch['op'];
52
+ }>;
53
+ declare function CriteriaOperatorMenu({ onChange, value, rhsType, ...props }: CriteriaOperatorMenuProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
48
54
 
49
55
  interface UseContextDataResult {
50
56
  result: ManifestGetResponse | null;
@@ -85,16 +91,21 @@ type CriteriaMatchMenuProps = {
85
91
  } & Omit<InputComboBoxProps<InputComboBoxOption, false>, 'value' | 'options' | 'onChange' | 'inputValue' | 'value' | 'onInputChange'>;
86
92
  declare function CriteriaMatchMenu({ onChange, criteriaMatch, dimensions, errorMessage, ...props }: CriteriaMatchMenuProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
87
93
 
94
+ type DimensionMenuOption = InputComboBoxOption & {
95
+ original?: ResolvedDimensionDefinition | Quirk;
96
+ };
97
+
88
98
  type DimensionMenuProps = {
89
- value?: ResolvedDimensionDefinition;
99
+ value?: ResolvedDimensionDefinition | Quirk;
90
100
  dimensions: ResolvedDimensionDefinition[];
101
+ quirks?: QuirkGetResponse['quirks'];
91
102
  errorMessage?: string;
92
- onChange: (newValue: ResolvedDimensionDefinition) => void;
93
- } & Omit<InputComboBoxProps<InputComboBoxOption, false>, 'value' | 'options' | 'onChange'>;
94
- declare function DimensionMenu({ onChange, value, dimensions, errorMessage, ...props }: DimensionMenuProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
103
+ onChange: (newValue: ResolvedDimensionDefinition | Quirk | undefined) => void;
104
+ } & Omit<InputComboBoxProps<DimensionMenuOption, false>, 'value' | 'options' | 'onChange'>;
105
+ declare function DimensionMenu({ onChange, value, dimensions, errorMessage, quirks, ...props }: DimensionMenuProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
95
106
 
96
107
  type DimensionValueProps = {
97
- displayName: string;
108
+ displayName: string | undefined;
98
109
  };
99
110
  declare function DimensionValue({ displayName }: DimensionValueProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
100
111
 
@@ -118,6 +129,7 @@ interface PersonalizationCriteriaStaticProps {
118
129
  value: VariantMatchCriteria | null | undefined;
119
130
  setValue: (value: VariantMatchCriteria | null) => void;
120
131
  dimensions: DimensionsData;
132
+ quirks?: QuirkGetResponse['quirks'];
121
133
  displayTitle?: boolean;
122
134
  onMenuOpen?: () => void;
123
135
  onMenuClose?: () => void;
@@ -169,4 +181,4 @@ declare const validateContextConfig: (contextConfig?: ContextConfig) => Promise<
169
181
  result?: ManifestGetResponse;
170
182
  }>;
171
183
 
172
- export { type AbTestListProps, AbTestSelector, type AbTestSelectorProps, type ContextConfig, ContextData, type ContextDataProps, CriteriaMatchMenu, type CriteriaMatchMenuProps, CriteriaOperatorMenu, type CriteriaOperatorMenuProps, type DataContextErrorProps, DimensionMenu, type DimensionMenuProps, DimensionValue, type DimensionValueProps, type DimensionsData, EditLink, type EditLinkProps, EnrichmentTag, type EnrichmentTagProps, PersonalizationCriteria, type PersonalizationCriteriaProps, PersonalizationCriteriaStatic, type PersonalizationCriteriaStaticProps, ProjectUIVersion, type ResolvedDimensionDefinition, type UseContextDataResult, type UseDimensionsResult, type UseValidateContextConfigResult, addAbTestLink, addEnrichmentLink, contextCriteriaMenuOperators, convertErrorsToObj, isEnrichmentTagData, isPersonalizationCriteriaData, opHasRhs, useContextConfig, useContextData, useDimensions, useDimensionsDataContext, useManifest, useValidateContextConfig, validateContextConfig };
184
+ export { type AbTestListProps, AbTestSelector, type AbTestSelectorProps, type ContextConfig, ContextData, type ContextDataProps, CriteriaMatchMenu, type CriteriaMatchMenuProps, CriteriaOperatorMenu, type CriteriaOperatorMenuProps, type DataContextErrorProps, DimensionMenu, type DimensionMenuProps, DimensionValue, type DimensionValueProps, type DimensionsData, EditLink, type EditLinkProps, EnrichmentTag, type EnrichmentTagProps, PersonalizationCriteria, type PersonalizationCriteriaProps, PersonalizationCriteriaStatic, type PersonalizationCriteriaStaticProps, ProjectUIVersion, type ResolvedDimensionDefinition, type UseContextDataResult, type UseDimensionsResult, type UseValidateContextConfigResult, addAbTestLink, addEnrichmentLink, contextCriteriaMenuOperators, convertErrorsToObj, enrichmentCriteriaMenuOperators, isEnrichmentTagData, isPersonalizationCriteriaData, opHasRhs, useContextConfig, useContextData, useDimensions, useDimensionsDataContext, useManifest, useValidateContextConfig, validateContextConfig };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as _emotion_react_types_jsx_namespace from '@emotion/react/types/jsx-namespace';
2
2
  import * as _emotion_react from '@emotion/react';
3
- import { DimensionDefinition, Test, ManifestGetResponse } from '@uniformdev/context/api';
4
- import { DimensionMatch, EnrichmentData, VariantMatchCriteria } from '@uniformdev/context';
3
+ import { DimensionDefinition, Test, ManifestGetResponse, Quirk, QuirkGetResponse } from '@uniformdev/context/api';
4
+ import { DimensionMatch, QuirkMatch, EnrichmentData, VariantMatchCriteria } from '@uniformdev/context';
5
5
  import { InputComboBoxProps, InputComboBoxOption } from '@uniformdev/design-system';
6
6
  export * from '@uniformdev/design-system';
7
7
  import React, { ComponentType, ReactElement } from 'react';
@@ -36,15 +36,21 @@ interface AbTestSelectorProps {
36
36
  declare const AbTestSelector: ({ value, setValue, contextConfig, loading }: AbTestSelectorProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
37
37
 
38
38
  type CriteriaOperatorMenuProps = {
39
- value: DimensionMatch['op'];
40
- onChange: (newValue: DimensionMatch['op']) => void;
39
+ value: DimensionMatch['op'] | QuirkMatch['op'];
40
+ onChange: (newValue: DimensionMatch['op'] | QuirkMatch['op']) => void;
41
+ rhsType?: ResolvedDimensionDefinition['category'] | 'QUIRK';
41
42
  } & Omit<InputComboBoxProps<InputComboBoxOption, false>, 'value' | 'options' | 'onChange'>;
42
43
  declare const contextCriteriaMenuOperators: Array<{
43
44
  name: string;
44
45
  description?: string;
45
46
  value: DimensionMatch['op'];
46
47
  }>;
47
- declare function CriteriaOperatorMenu({ onChange, value, ...props }: CriteriaOperatorMenuProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
48
+ declare const enrichmentCriteriaMenuOperators: Array<{
49
+ name: string;
50
+ description?: string;
51
+ value: DimensionMatch['op'];
52
+ }>;
53
+ declare function CriteriaOperatorMenu({ onChange, value, rhsType, ...props }: CriteriaOperatorMenuProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
48
54
 
49
55
  interface UseContextDataResult {
50
56
  result: ManifestGetResponse | null;
@@ -85,16 +91,21 @@ type CriteriaMatchMenuProps = {
85
91
  } & Omit<InputComboBoxProps<InputComboBoxOption, false>, 'value' | 'options' | 'onChange' | 'inputValue' | 'value' | 'onInputChange'>;
86
92
  declare function CriteriaMatchMenu({ onChange, criteriaMatch, dimensions, errorMessage, ...props }: CriteriaMatchMenuProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
87
93
 
94
+ type DimensionMenuOption = InputComboBoxOption & {
95
+ original?: ResolvedDimensionDefinition | Quirk;
96
+ };
97
+
88
98
  type DimensionMenuProps = {
89
- value?: ResolvedDimensionDefinition;
99
+ value?: ResolvedDimensionDefinition | Quirk;
90
100
  dimensions: ResolvedDimensionDefinition[];
101
+ quirks?: QuirkGetResponse['quirks'];
91
102
  errorMessage?: string;
92
- onChange: (newValue: ResolvedDimensionDefinition) => void;
93
- } & Omit<InputComboBoxProps<InputComboBoxOption, false>, 'value' | 'options' | 'onChange'>;
94
- declare function DimensionMenu({ onChange, value, dimensions, errorMessage, ...props }: DimensionMenuProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
103
+ onChange: (newValue: ResolvedDimensionDefinition | Quirk | undefined) => void;
104
+ } & Omit<InputComboBoxProps<DimensionMenuOption, false>, 'value' | 'options' | 'onChange'>;
105
+ declare function DimensionMenu({ onChange, value, dimensions, errorMessage, quirks, ...props }: DimensionMenuProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
95
106
 
96
107
  type DimensionValueProps = {
97
- displayName: string;
108
+ displayName: string | undefined;
98
109
  };
99
110
  declare function DimensionValue({ displayName }: DimensionValueProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
100
111
 
@@ -118,6 +129,7 @@ interface PersonalizationCriteriaStaticProps {
118
129
  value: VariantMatchCriteria | null | undefined;
119
130
  setValue: (value: VariantMatchCriteria | null) => void;
120
131
  dimensions: DimensionsData;
132
+ quirks?: QuirkGetResponse['quirks'];
121
133
  displayTitle?: boolean;
122
134
  onMenuOpen?: () => void;
123
135
  onMenuClose?: () => void;
@@ -169,4 +181,4 @@ declare const validateContextConfig: (contextConfig?: ContextConfig) => Promise<
169
181
  result?: ManifestGetResponse;
170
182
  }>;
171
183
 
172
- export { type AbTestListProps, AbTestSelector, type AbTestSelectorProps, type ContextConfig, ContextData, type ContextDataProps, CriteriaMatchMenu, type CriteriaMatchMenuProps, CriteriaOperatorMenu, type CriteriaOperatorMenuProps, type DataContextErrorProps, DimensionMenu, type DimensionMenuProps, DimensionValue, type DimensionValueProps, type DimensionsData, EditLink, type EditLinkProps, EnrichmentTag, type EnrichmentTagProps, PersonalizationCriteria, type PersonalizationCriteriaProps, PersonalizationCriteriaStatic, type PersonalizationCriteriaStaticProps, ProjectUIVersion, type ResolvedDimensionDefinition, type UseContextDataResult, type UseDimensionsResult, type UseValidateContextConfigResult, addAbTestLink, addEnrichmentLink, contextCriteriaMenuOperators, convertErrorsToObj, isEnrichmentTagData, isPersonalizationCriteriaData, opHasRhs, useContextConfig, useContextData, useDimensions, useDimensionsDataContext, useManifest, useValidateContextConfig, validateContextConfig };
184
+ export { type AbTestListProps, AbTestSelector, type AbTestSelectorProps, type ContextConfig, ContextData, type ContextDataProps, CriteriaMatchMenu, type CriteriaMatchMenuProps, CriteriaOperatorMenu, type CriteriaOperatorMenuProps, type DataContextErrorProps, DimensionMenu, type DimensionMenuProps, DimensionValue, type DimensionValueProps, type DimensionsData, EditLink, type EditLinkProps, EnrichmentTag, type EnrichmentTagProps, PersonalizationCriteria, type PersonalizationCriteriaProps, PersonalizationCriteriaStatic, type PersonalizationCriteriaStaticProps, ProjectUIVersion, type ResolvedDimensionDefinition, type UseContextDataResult, type UseDimensionsResult, type UseValidateContextConfigResult, addAbTestLink, addEnrichmentLink, contextCriteriaMenuOperators, convertErrorsToObj, enrichmentCriteriaMenuOperators, isEnrichmentTagData, isPersonalizationCriteriaData, opHasRhs, useContextConfig, useContextData, useDimensions, useDimensionsDataContext, useManifest, useValidateContextConfig, validateContextConfig };