@commercetools-uikit/utils 14.0.0 → 15.1.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.
@@ -10,7 +10,6 @@ var isPropValid = require('@emotion/is-prop-valid');
10
10
  var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
11
11
  var warning$2 = require('warning');
12
12
  var _trimInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/trim');
13
- var _forEachInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/for-each');
14
13
 
15
14
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
16
15
 
@@ -21,7 +20,6 @@ var isPropValid__default = /*#__PURE__*/_interopDefault(isPropValid);
21
20
  var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
22
21
  var warning__default = /*#__PURE__*/_interopDefault(warning$2);
23
22
  var _trimInstanceProperty__default = /*#__PURE__*/_interopDefault(_trimInstanceProperty);
24
- var _forEachInstanceProperty__default = /*#__PURE__*/_interopDefault(_forEachInstanceProperty);
25
23
 
26
24
  var regexpData$1 = /^data-/;
27
25
  function filterDataAttributes(obj) {
@@ -181,22 +179,6 @@ var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.do
181
179
  var SafeHTMLElement = canUseDOM ? window.HTMLElement : {};
182
180
  var SafeHTMLElement$1 = SafeHTMLElement;
183
181
 
184
- function addStaticFields(Component, fields) {
185
- var _context;
186
-
187
- _forEachInstanceProperty__default["default"](_context = _Object$entries__default["default"](fields)).call(_context, function (_ref) {
188
- var _ref2 = _slicedToArray(_ref, 2),
189
- key = _ref2[0],
190
- value = _ref2[1];
191
-
192
- // eslint-disable-next-line no-param-reassign
193
- // @ts-expect-error
194
- Component[key] = value;
195
- });
196
-
197
- return Component;
198
- }
199
-
200
182
  // To avoid getting the following error, we type the entire function.
201
183
  // "Assertions require every name in the call target to be declared with an explicit type annotation."
202
184
  // See https://github.com/microsoft/TypeScript/pull/33622#issuecomment-575301357
@@ -224,10 +206,9 @@ var warning = function warning(condition, message) {
224
206
  var warning$1 = warning;
225
207
 
226
208
  // NOTE: This string will be replaced on build time with the package version.
227
- var version = "14.0.0";
209
+ var version = "15.1.0";
228
210
 
229
211
  exports.SafeHTMLElement = SafeHTMLElement$1;
230
- exports.addStaticFields = addStaticFields;
231
212
  exports.canUseDOM = canUseDOM;
232
213
  exports.createSequentialId = createSequentialId;
233
214
  exports.filterAriaAttributes = filterAriaAttributes;
@@ -10,7 +10,6 @@ var isPropValid = require('@emotion/is-prop-valid');
10
10
  var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
11
11
  require('warning');
12
12
  var _trimInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/trim');
13
- var _forEachInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/for-each');
14
13
 
15
14
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
16
15
 
@@ -20,7 +19,6 @@ var _Object$entries__default = /*#__PURE__*/_interopDefault(_Object$entries);
20
19
  var isPropValid__default = /*#__PURE__*/_interopDefault(isPropValid);
21
20
  var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
22
21
  var _trimInstanceProperty__default = /*#__PURE__*/_interopDefault(_trimInstanceProperty);
23
- var _forEachInstanceProperty__default = /*#__PURE__*/_interopDefault(_forEachInstanceProperty);
24
22
 
25
23
  var regexpData$1 = /^data-/;
26
24
  function filterDataAttributes(obj) {
@@ -176,22 +174,6 @@ var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.do
176
174
  var SafeHTMLElement = canUseDOM ? window.HTMLElement : {};
177
175
  var SafeHTMLElement$1 = SafeHTMLElement;
178
176
 
179
- function addStaticFields(Component, fields) {
180
- var _context;
181
-
182
- _forEachInstanceProperty__default["default"](_context = _Object$entries__default["default"](fields)).call(_context, function (_ref) {
183
- var _ref2 = _slicedToArray(_ref, 2),
184
- key = _ref2[0],
185
- value = _ref2[1];
186
-
187
- // eslint-disable-next-line no-param-reassign
188
- // @ts-expect-error
189
- Component[key] = value;
190
- });
191
-
192
- return Component;
193
- }
194
-
195
177
  // To avoid getting the following error, we type the entire function.
196
178
  // Strip out error messages for production
197
179
  // > Not providing an inline default argument for message as the result is smaller
@@ -205,10 +187,9 @@ var warning = function warning(condition, message) {
205
187
  var warning$1 = warning;
206
188
 
207
189
  // NOTE: This string will be replaced on build time with the package version.
208
- var version = "14.0.0";
190
+ var version = "15.1.0";
209
191
 
210
192
  exports.SafeHTMLElement = SafeHTMLElement$1;
211
- exports.addStaticFields = addStaticFields;
212
193
  exports.canUseDOM = canUseDOM;
213
194
  exports.createSequentialId = createSequentialId;
214
195
  exports.filterAriaAttributes = filterAriaAttributes;
@@ -6,7 +6,6 @@ import isPropValid from '@emotion/is-prop-valid';
6
6
  import _concatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/concat';
7
7
  import warning$2 from 'warning';
8
8
  import _trimInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/trim';
9
- import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/for-each';
10
9
 
11
10
  var regexpData$1 = /^data-/;
12
11
  function filterDataAttributes(obj) {
@@ -166,22 +165,6 @@ var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.do
166
165
  var SafeHTMLElement = canUseDOM ? window.HTMLElement : {};
167
166
  var SafeHTMLElement$1 = SafeHTMLElement;
168
167
 
169
- function addStaticFields(Component, fields) {
170
- var _context;
171
-
172
- _forEachInstanceProperty(_context = _Object$entries(fields)).call(_context, function (_ref) {
173
- var _ref2 = _slicedToArray(_ref, 2),
174
- key = _ref2[0],
175
- value = _ref2[1];
176
-
177
- // eslint-disable-next-line no-param-reassign
178
- // @ts-expect-error
179
- Component[key] = value;
180
- });
181
-
182
- return Component;
183
- }
184
-
185
168
  // To avoid getting the following error, we type the entire function.
186
169
  // "Assertions require every name in the call target to be declared with an explicit type annotation."
187
170
  // See https://github.com/microsoft/TypeScript/pull/33622#issuecomment-575301357
@@ -209,6 +192,6 @@ var warning = function warning(condition, message) {
209
192
  var warning$1 = warning;
210
193
 
211
194
  // NOTE: This string will be replaced on build time with the package version.
212
- var version = "14.0.0";
195
+ var version = "15.1.0";
213
196
 
214
- export { SafeHTMLElement$1 as SafeHTMLElement, addStaticFields, canUseDOM, createSequentialId, filterAriaAttributes, filterDataAttributes, filterInvalidAttributes, getFieldId$1 as getFieldId, isNumberish, parseTime$1 as parseTime, version, warnDeprecatedComponent, warnDeprecatedProp, warning$1 as warning };
197
+ export { SafeHTMLElement$1 as SafeHTMLElement, canUseDOM, createSequentialId, filterAriaAttributes, filterDataAttributes, filterInvalidAttributes, getFieldId$1 as getFieldId, isNumberish, parseTime$1 as parseTime, version, warnDeprecatedComponent, warnDeprecatedProp, warning$1 as warning };
@@ -9,6 +9,5 @@ export { default as getFieldId } from './get-field-id';
9
9
  export { default as parseTime } from './parse-time';
10
10
  export { canUseDOM } from './helpers/exenv';
11
11
  export { default as SafeHTMLElement } from './helpers/safeHTMLElement';
12
- export { default as addStaticFields } from './add-static-fields';
13
12
  export { default as warning } from './warning';
14
13
  export { default as version } from './version';
@@ -4,5 +4,5 @@ declare type ParsedTime = {
4
4
  seconds: number;
5
5
  milliseconds: number;
6
6
  };
7
- declare const parseTime: (rawTime?: string | undefined) => ParsedTime | null;
7
+ declare const parseTime: (rawTime?: string) => ParsedTime | null;
8
8
  export default parseTime;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@commercetools-uikit/utils",
3
3
  "description": "A collection of utilities shared across the other packages.",
4
- "version": "14.0.0",
4
+ "version": "15.1.0",
5
5
  "bugs": "https://github.com/commercetools/ui-kit/issues",
6
6
  "repository": {
7
7
  "type": "git",
@@ -21,7 +21,7 @@
21
21
  "dependencies": {
22
22
  "@babel/runtime": "^7.17.2",
23
23
  "@babel/runtime-corejs3": "^7.17.2",
24
- "@emotion/is-prop-valid": "1.1.2",
24
+ "@emotion/is-prop-valid": "1.1.3",
25
25
  "@types/warning": "^3.0.0",
26
26
  "warning": "4.0.3"
27
27
  }
@@ -1,4 +0,0 @@
1
- import type { FC } from 'react';
2
- declare type TStaticFields = Record<string, unknown>;
3
- export default function addStaticFields<TProps extends {}, TFields extends TStaticFields>(Component: FC<TProps>, fields: TFields): FC<TProps> & TFields;
4
- export {};