@cloudscape-design/components-themeable 3.0.837 → 3.0.839

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,3 +1,3 @@
1
1
  {
2
- "commit": "6539f159bef97c6dbcbae818577643ccea0c3756"
2
+ "commit": "4e0727270315277c1d40bd8976c05dee29343840"
3
3
  }
@@ -1,4 +1,4 @@
1
1
  export var PACKAGE_SOURCE = "components";
2
- export var PACKAGE_VERSION = "3.0.0 (6539f159)";
2
+ export var PACKAGE_VERSION = "3.0.0 (4e072727)";
3
3
  export var THEME = "open-source-visual-refresh";
4
4
  export var ALWAYS_VISUAL_REFRESH = true;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "PACKAGE_SOURCE": "components",
3
- "PACKAGE_VERSION": "3.0.0 (6539f159)",
3
+ "PACKAGE_VERSION": "3.0.0 (4e072727)",
4
4
  "THEME": "default",
5
5
  "ALWAYS_VISUAL_REFRESH": false
6
6
  }
@@ -56,19 +56,19 @@ export function ValueInput(props) {
56
56
  }
57
57
  return React.createElement(ValueInputAuto, Object.assign({}, props));
58
58
  }
59
- function ValueInputAuto({ property, operator, value, onChangeValue, asyncProps, filteringOptions, onLoadItems, i18nStrings, }) {
60
- var _a, _b;
59
+ function ValueInputAuto({ property, operator, value: unknownValue, onChangeValue, asyncProps, filteringOptions, onLoadItems, i18nStrings, }) {
60
+ var _a;
61
+ const value = (unknownValue !== null && unknownValue !== void 0 ? unknownValue : '') + '';
61
62
  const valueOptions = property
62
63
  ? filteringOptions
63
64
  .filter(option => { var _a; return ((_a = option.property) === null || _a === void 0 ? void 0 : _a.propertyKey) === property.propertyKey; })
64
65
  .map(({ label, value }) => ({ label, value }))
65
66
  : [];
66
- const valueFilter = typeof value === 'string' ? value : '';
67
- const valueAutosuggestHandlers = useLoadItems(onLoadItems, '', property === null || property === void 0 ? void 0 : property.externalProperty, valueFilter, operator);
67
+ const valueAutosuggestHandlers = useLoadItems(onLoadItems, '', property === null || property === void 0 ? void 0 : property.externalProperty, value, operator);
68
68
  const asyncValueAutosuggestProps = (property === null || property === void 0 ? void 0 : property.propertyKey)
69
69
  ? Object.assign(Object.assign({}, valueAutosuggestHandlers), asyncProps) : { empty: asyncProps.empty };
70
70
  const [matchedOption] = valueOptions.filter(option => option.value === value);
71
- return (React.createElement(InternalAutosuggest, Object.assign({ enteredTextLabel: i18nStrings.enteredTextLabel, value: (_b = (_a = matchedOption === null || matchedOption === void 0 ? void 0 : matchedOption.label) !== null && _a !== void 0 ? _a : value) !== null && _b !== void 0 ? _b : '', clearAriaLabel: i18nStrings.clearAriaLabel, onChange: e => onChangeValue(e.detail.value), disabled: !operator, options: valueOptions }, asyncValueAutosuggestProps, { virtualScroll: true })));
71
+ return (React.createElement(InternalAutosuggest, Object.assign({ enteredTextLabel: i18nStrings.enteredTextLabel, value: (_a = matchedOption === null || matchedOption === void 0 ? void 0 : matchedOption.label) !== null && _a !== void 0 ? _a : value, clearAriaLabel: i18nStrings.clearAriaLabel, onChange: e => onChangeValue(e.detail.value), disabled: !operator, options: valueOptions }, asyncValueAutosuggestProps, { virtualScroll: true })));
72
72
  }
73
73
  function ValueInputEnum({ property, operator, value: unknownValue, onChangeValue, asyncProps, filteringOptions, onLoadItems, }) {
74
74
  const valueOptions = filteringOptions
@@ -1 +1 @@
1
- {"version":3,"file":"token-editor-inputs.js","sourceRoot":"","sources":["../../../src/property-filter/token-editor-inputs.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,mBAAmB,MAAM,4BAA4B,CAAC;AAG7D,OAAO,mBAAmB,MAAM,4BAA4B,CAAC;AAE7D,OAAO,cAAc,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAC9E,OAAO,EAAuB,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAS7E,O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AY,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;IAC/F,MAAM,eAAe,GAAG,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACpF,OAAO,CACL,6BAAK,SAAS,EAAE,MAAM,CAAC,kCAAkC,CAAC;QACxD,6BAAK,SAAS,EAAE,MAAM,CAAC,wCAAwC,CAAC;YAC9D,oBAAC,mBAAmB,kBAClB,aAAa,EAAC,MAAM,EACpB,eAAe,EAAE,eAAe,EAChC,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EACxE,OAAO,EAAE,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,IACjG,0BAA0B,IAC9B,YAAY,EAAE,IAAI,EAClB,UAAU,EAAE,IAAI,EAChB,QAAQ,EAAE,IAAI,IACd,CACE,CACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React from 'react';\n\nimport InternalAutosuggest from '../autosuggest/internal.js';\nimport { DropdownStatusProps } from '../internal/components/dropdown-status/interfaces.js';\nimport { NonCancelableEventHandler } from '../internal/events/index.js';\nimport InternalMultiselect from '../multiselect/internal.js';\nimport { SelectProps } from '../select/interfaces.js';\nimport InternalSelect from '../select/internal.js';\nimport { getAllowedOperators, getPropertySuggestions } from './controller.js';\nimport { I18nStringsInternal, operatorToDescription } from './i18n-utils.js';\nimport {\n ComparisonOperator,\n GroupText,\n InternalFilteringOption,\n InternalFilteringProperty,\n InternalFreeTextFiltering,\n LoadItemsDetail,\n} from './interfaces.js';\nimport { useLoadItems } from './use-load-items.js';\n\nimport styles from './styles.css.js';\n\ninterface PropertyInputProps {\n asyncProps: null | DropdownStatusProps;\n customGroupsText: readonly GroupText[];\n freeTextFiltering: InternalFreeTextFiltering;\n filteringProperties: readonly InternalFilteringProperty[];\n i18nStrings: I18nStringsInternal;\n onChangePropertyKey: (propertyKey: undefined | string) => void;\n onLoadItems?: NonCancelableEventHandler<LoadItemsDetail>;\n property: null | InternalFilteringProperty;\n}\n\nexport function PropertyInput({\n property,\n onChangePropertyKey,\n asyncProps,\n filteringProperties,\n onLoadItems,\n customGroupsText,\n i18nStrings,\n freeTextFiltering,\n}: PropertyInputProps) {\n const propertySelectHandlers = useLoadItems(onLoadItems);\n const asyncPropertySelectProps = asyncProps ? { ...asyncProps, ...propertySelectHandlers } : {};\n const propertyOptions: (SelectProps.Option | SelectProps.OptionGroup)[] = getPropertySuggestions(\n filteringProperties,\n customGroupsText,\n i18nStrings,\n ({ propertyKey, propertyLabel }) => ({\n value: propertyKey,\n label: propertyLabel,\n dontCloseOnSelect: true,\n })\n );\n\n const allPropertiesOption = {\n label: i18nStrings.allPropertiesLabel,\n value: undefined,\n };\n if (!freeTextFiltering.disabled) {\n propertyOptions.unshift(allPropertiesOption);\n }\n return (\n <InternalSelect\n options={propertyOptions}\n selectedOption={\n property\n ? {\n value: property.propertyKey ?? undefined,\n label: property.propertyLabel,\n }\n : allPropertiesOption\n }\n onChange={e => onChangePropertyKey(e.detail.selectedOption.value)}\n {...asyncPropertySelectProps}\n />\n );\n}\n\ninterface OperatorInputProps {\n i18nStrings: I18nStringsInternal;\n onChangeOperator: (operator: ComparisonOperator) => void;\n operator: undefined | ComparisonOperator;\n property: null | InternalFilteringProperty;\n freeTextFiltering: InternalFreeTextFiltering;\n triggerVariant: 'option' | 'label';\n}\n\nexport function OperatorInput({\n property,\n operator,\n onChangeOperator,\n i18nStrings,\n freeTextFiltering,\n triggerVariant,\n}: OperatorInputProps) {\n const operatorOptions = (property ? getAllowedOperators(property) : freeTextFiltering.operators).map(operator => ({\n value: operator,\n label: operator,\n description: operatorToDescription(operator, i18nStrings),\n }));\n return (\n <InternalSelect\n options={operatorOptions}\n triggerVariant={triggerVariant}\n selectedOption={\n operator\n ? {\n value: operator,\n label: operator,\n description: operatorToDescription(operator, i18nStrings),\n }\n : null\n }\n onChange={e => onChangeOperator(e.detail.selectedOption.value as ComparisonOperator)}\n />\n );\n}\n\ninterface ValueInputProps {\n asyncProps: DropdownStatusProps;\n filteringOptions: readonly InternalFilteringOption[];\n i18nStrings: I18nStringsInternal;\n onChangeValue: (value: unknown) => void;\n onLoadItems?: NonCancelableEventHandler<LoadItemsDetail>;\n operator: undefined | ComparisonOperator;\n property: null | InternalFilteringProperty;\n value: unknown;\n}\n\nexport function ValueInput(props: ValueInputProps) {\n const { property, operator, value, onChangeValue } = props;\n const OperatorForm = property?.propertyKey && operator && property?.getValueFormRenderer(operator);\n\n if (OperatorForm) {\n return <OperatorForm value={value} onChange={onChangeValue} operator={operator} />;\n }\n if (property && operator && property.getTokenType(operator) === 'enum') {\n return <ValueInputEnum {...props} property={property} operator={operator} />;\n }\n return <ValueInputAuto {...props} />;\n}\n\nfunction ValueInputAuto({\n property,\n operator,\n value,\n onChangeValue,\n asyncProps,\n filteringOptions,\n onLoadItems,\n i18nStrings,\n}: ValueInputProps) {\n const valueOptions = property\n ? filteringOptions\n .filter(option => option.property?.propertyKey === property.propertyKey)\n .map(({ label, value }) => ({ label, value }))\n : [];\n\n const valueFilter = typeof value === 'string' ? value : '';\n const valueAutosuggestHandlers = useLoadItems(onLoadItems, '', property?.externalProperty, valueFilter, operator);\n const asyncValueAutosuggestProps = property?.propertyKey\n ? { ...valueAutosuggestHandlers, ...asyncProps }\n : { empty: asyncProps.empty };\n const [matchedOption] = valueOptions.filter(option => option.value === value);\n\n return (\n <InternalAutosuggest\n enteredTextLabel={i18nStrings.enteredTextLabel}\n value={matchedOption?.label ?? value ?? ''}\n clearAriaLabel={i18nStrings.clearAriaLabel}\n onChange={e => onChangeValue(e.detail.value)}\n disabled={!operator}\n options={valueOptions}\n {...asyncValueAutosuggestProps}\n virtualScroll={true}\n />\n );\n}\n\ninterface ValueInputPropsEnum extends ValueInputProps {\n property: InternalFilteringProperty;\n operator: ComparisonOperator;\n}\n\nfunction ValueInputEnum({\n property,\n operator,\n value: unknownValue,\n onChangeValue,\n asyncProps,\n filteringOptions,\n onLoadItems,\n}: ValueInputPropsEnum) {\n const valueOptions = filteringOptions\n .filter(option => option.property?.propertyKey === property.propertyKey)\n .map(({ label, value }) => ({ label, value }));\n const valueAutosuggestHandlers = useLoadItems(onLoadItems, '', property.externalProperty, undefined, operator);\n const asyncValueAutosuggestProps = { statusType: 'finished' as const, ...valueAutosuggestHandlers, ...asyncProps };\n const value = !unknownValue ? [] : Array.isArray(unknownValue) ? unknownValue : [unknownValue];\n const selectedOptions = valueOptions.filter(option => value.includes(option.value));\n return (\n <div className={styles['token-editor-multiselect-wrapper']}>\n <div className={styles['token-editor-multiselect-wrapper-inner']}>\n <InternalMultiselect\n filteringType=\"auto\"\n selectedOptions={selectedOptions}\n onChange={e => onChangeValue(e.detail.selectedOptions.map(o => o.value))}\n options={valueOptions.length > 0 ? [{ options: valueOptions, label: property.groupValuesLabel }] : []}\n {...asyncValueAutosuggestProps}\n inlineTokens={true}\n hideTokens={true}\n keepOpen={true}\n />\n </div>\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"token-editor-inputs.js","sourceRoot":"","sources":["../../../src/property-filter/token-editor-inputs.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,mBAAmB,MAAM,4BAA4B,CAAC;AAG7D,OAAO,mBAAmB,MAAM,4BAA4B,CAAC;AAE7D,OAAO,cAAc,MAAM,uBAAuB,CAA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AAU,CAAE,CAAC;IACnH,MAAM,KAAK,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;IAC/F,MAAM,eAAe,GAAG,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACpF,OAAO,CACL,6BAAK,SAAS,EAAE,MAAM,CAAC,kCAAkC,CAAC;QACxD,6BAAK,SAAS,EAAE,MAAM,CAAC,wCAAwC,CAAC;YAC9D,oBAAC,mBAAmB,kBAClB,aAAa,EAAC,MAAM,EACpB,eAAe,EAAE,eAAe,EAChC,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EACxE,OAAO,EAAE,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,IACjG,0BAA0B,IAC9B,YAAY,EAAE,IAAI,EAClB,UAAU,EAAE,IAAI,EAChB,QAAQ,EAAE,IAAI,IACd,CACE,CACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React from 'react';\n\nimport InternalAutosuggest from '../autosuggest/internal.js';\nimport { DropdownStatusProps } from '../internal/components/dropdown-status/interfaces.js';\nimport { NonCancelableEventHandler } from '../internal/events/index.js';\nimport InternalMultiselect from '../multiselect/internal.js';\nimport { SelectProps } from '../select/interfaces.js';\nimport InternalSelect from '../select/internal.js';\nimport { getAllowedOperators, getPropertySuggestions } from './controller.js';\nimport { I18nStringsInternal, operatorToDescription } from './i18n-utils.js';\nimport {\n ComparisonOperator,\n GroupText,\n InternalFilteringOption,\n InternalFilteringProperty,\n InternalFreeTextFiltering,\n LoadItemsDetail,\n} from './interfaces.js';\nimport { useLoadItems } from './use-load-items.js';\n\nimport styles from './styles.css.js';\n\ninterface PropertyInputProps {\n asyncProps: null | DropdownStatusProps;\n customGroupsText: readonly GroupText[];\n freeTextFiltering: InternalFreeTextFiltering;\n filteringProperties: readonly InternalFilteringProperty[];\n i18nStrings: I18nStringsInternal;\n onChangePropertyKey: (propertyKey: undefined | string) => void;\n onLoadItems?: NonCancelableEventHandler<LoadItemsDetail>;\n property: null | InternalFilteringProperty;\n}\n\nexport function PropertyInput({\n property,\n onChangePropertyKey,\n asyncProps,\n filteringProperties,\n onLoadItems,\n customGroupsText,\n i18nStrings,\n freeTextFiltering,\n}: PropertyInputProps) {\n const propertySelectHandlers = useLoadItems(onLoadItems);\n const asyncPropertySelectProps = asyncProps ? { ...asyncProps, ...propertySelectHandlers } : {};\n const propertyOptions: (SelectProps.Option | SelectProps.OptionGroup)[] = getPropertySuggestions(\n filteringProperties,\n customGroupsText,\n i18nStrings,\n ({ propertyKey, propertyLabel }) => ({\n value: propertyKey,\n label: propertyLabel,\n dontCloseOnSelect: true,\n })\n );\n\n const allPropertiesOption = {\n label: i18nStrings.allPropertiesLabel,\n value: undefined,\n };\n if (!freeTextFiltering.disabled) {\n propertyOptions.unshift(allPropertiesOption);\n }\n return (\n <InternalSelect\n options={propertyOptions}\n selectedOption={\n property\n ? {\n value: property.propertyKey ?? undefined,\n label: property.propertyLabel,\n }\n : allPropertiesOption\n }\n onChange={e => onChangePropertyKey(e.detail.selectedOption.value)}\n {...asyncPropertySelectProps}\n />\n );\n}\n\ninterface OperatorInputProps {\n i18nStrings: I18nStringsInternal;\n onChangeOperator: (operator: ComparisonOperator) => void;\n operator: undefined | ComparisonOperator;\n property: null | InternalFilteringProperty;\n freeTextFiltering: InternalFreeTextFiltering;\n triggerVariant: 'option' | 'label';\n}\n\nexport function OperatorInput({\n property,\n operator,\n onChangeOperator,\n i18nStrings,\n freeTextFiltering,\n triggerVariant,\n}: OperatorInputProps) {\n const operatorOptions = (property ? getAllowedOperators(property) : freeTextFiltering.operators).map(operator => ({\n value: operator,\n label: operator,\n description: operatorToDescription(operator, i18nStrings),\n }));\n return (\n <InternalSelect\n options={operatorOptions}\n triggerVariant={triggerVariant}\n selectedOption={\n operator\n ? {\n value: operator,\n label: operator,\n description: operatorToDescription(operator, i18nStrings),\n }\n : null\n }\n onChange={e => onChangeOperator(e.detail.selectedOption.value as ComparisonOperator)}\n />\n );\n}\n\ninterface ValueInputProps {\n asyncProps: DropdownStatusProps;\n filteringOptions: readonly InternalFilteringOption[];\n i18nStrings: I18nStringsInternal;\n onChangeValue: (value: unknown) => void;\n onLoadItems?: NonCancelableEventHandler<LoadItemsDetail>;\n operator: undefined | ComparisonOperator;\n property: null | InternalFilteringProperty;\n value: unknown;\n}\n\nexport function ValueInput(props: ValueInputProps) {\n const { property, operator, value, onChangeValue } = props;\n const OperatorForm = property?.propertyKey && operator && property?.getValueFormRenderer(operator);\n\n if (OperatorForm) {\n return <OperatorForm value={value} onChange={onChangeValue} operator={operator} />;\n }\n if (property && operator && property.getTokenType(operator) === 'enum') {\n return <ValueInputEnum {...props} property={property} operator={operator} />;\n }\n return <ValueInputAuto {...props} />;\n}\n\nfunction ValueInputAuto({\n property,\n operator,\n value: unknownValue,\n onChangeValue,\n asyncProps,\n filteringOptions,\n onLoadItems,\n i18nStrings,\n}: ValueInputProps) {\n const value = (unknownValue ?? '') + '';\n const valueOptions = property\n ? filteringOptions\n .filter(option => option.property?.propertyKey === property.propertyKey)\n .map(({ label, value }) => ({ label, value }))\n : [];\n\n const valueAutosuggestHandlers = useLoadItems(onLoadItems, '', property?.externalProperty, value, operator);\n const asyncValueAutosuggestProps = property?.propertyKey\n ? { ...valueAutosuggestHandlers, ...asyncProps }\n : { empty: asyncProps.empty };\n const [matchedOption] = valueOptions.filter(option => option.value === value);\n\n return (\n <InternalAutosuggest\n enteredTextLabel={i18nStrings.enteredTextLabel}\n value={matchedOption?.label ?? value}\n clearAriaLabel={i18nStrings.clearAriaLabel}\n onChange={e => onChangeValue(e.detail.value)}\n disabled={!operator}\n options={valueOptions}\n {...asyncValueAutosuggestProps}\n virtualScroll={true}\n />\n );\n}\n\ninterface ValueInputPropsEnum extends ValueInputProps {\n property: InternalFilteringProperty;\n operator: ComparisonOperator;\n}\n\nfunction ValueInputEnum({\n property,\n operator,\n value: unknownValue,\n onChangeValue,\n asyncProps,\n filteringOptions,\n onLoadItems,\n}: ValueInputPropsEnum) {\n const valueOptions = filteringOptions\n .filter(option => option.property?.propertyKey === property.propertyKey)\n .map(({ label, value }) => ({ label, value }));\n const valueAutosuggestHandlers = useLoadItems(onLoadItems, '', property.externalProperty, undefined, operator);\n const asyncValueAutosuggestProps = { statusType: 'finished' as const, ...valueAutosuggestHandlers, ...asyncProps };\n const value = !unknownValue ? [] : Array.isArray(unknownValue) ? unknownValue : [unknownValue];\n const selectedOptions = valueOptions.filter(option => value.includes(option.value));\n return (\n <div className={styles['token-editor-multiselect-wrapper']}>\n <div className={styles['token-editor-multiselect-wrapper-inner']}>\n <InternalMultiselect\n filteringType=\"auto\"\n selectedOptions={selectedOptions}\n onChange={e => onChangeValue(e.detail.selectedOptions.map(o => o.value))}\n options={valueOptions.length > 0 ? [{ options: valueOptions, label: property.groupValuesLabel }] : []}\n {...asyncValueAutosuggestProps}\n inlineTokens={true}\n hideTokens={true}\n keepOpen={true}\n />\n </div>\n </div>\n );\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudscape-design/components-themeable",
3
- "version": "3.0.837",
3
+ "version": "3.0.839",
4
4
  "files": [
5
5
  "lib"
6
6
  ],