@semcore/core 16.6.1 → 16.6.2-prerelease.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/.cache/esbuild_plugin_semcore_resolver/src_LastInteractionType.ts_contents +47 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_LastInteractionType.ts_hash_sum +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_LastInteractionType.ts_imp_deps +0 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_LastInteractionType.ts_last_use +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_core-types_Component.ts_contents +49 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_core-types_Component.ts_hash_sum +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_core-types_Component.ts_imp_deps +0 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_core-types_Component.ts_last_use +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_core-types_symbols.ts_contents +9 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_core-types_symbols.ts_hash_sum +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_core-types_symbols.ts_imp_deps +0 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_core-types_symbols.ts_last_use +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_coreFactory.tsx_contents +374 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_coreFactory.tsx_hash_sum +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_coreFactory.tsx_imp_deps +0 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_coreFactory.tsx_last_use +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_Children.tsx_contents +110 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_Children.tsx_hash_sum +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_Children.tsx_imp_deps +0 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_Children.tsx_last_use +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_Root.tsx_contents +69 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_Root.tsx_hash_sum +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_Root.tsx_imp_deps +0 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_Root.tsx_last_use +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_dataName.tsx_contents +11 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_dataName.tsx_hash_sum +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_dataName.tsx_imp_deps +0 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_dataName.tsx_last_use +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_enhance.tsx_contents +14 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_enhance.tsx_hash_sum +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_enhance.tsx_imp_deps +0 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_enhance.tsx_last_use +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_functionDefaultProps.tsx_contents +28 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_functionDefaultProps.tsx_hash_sum +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_functionDefaultProps.tsx_imp_deps +0 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_functionDefaultProps.tsx_last_use +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_i18n.tsx_contents +19 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_i18n.tsx_hash_sum +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_i18n.tsx_imp_deps +0 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_i18n.tsx_last_use +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_inheritedName.tsx_contents +14 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_inheritedName.tsx_hash_sum +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_inheritedName.tsx_imp_deps +0 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_inheritedName.tsx_last_use +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_staticChildren.tsx_contents +122 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_staticChildren.tsx_hash_sum +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_staticChildren.tsx_imp_deps +0 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_staticChildren.tsx_last_use +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_style.tsx_contents +50 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_style.tsx_hash_sum +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_style.tsx_imp_deps +0 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_style.tsx_last_use +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_uncontrolledProps.tsx_contents +123 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_uncontrolledProps.tsx_hash_sum +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_uncontrolledProps.tsx_imp_deps +0 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_uncontrolledProps.tsx_last_use +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_index.ts_contents +8 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_index.ts_hash_sum +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_index.ts_imp_deps +0 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_index.ts_last_use +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_register.tsx_contents +27 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_register.tsx_hash_sum +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_register.tsx_imp_deps +0 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_register.tsx_last_use +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_styled_index.tsx_contents +3 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_styled_index.tsx_hash_sum +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_styled_index.tsx_imp_deps +0 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_styled_index.tsx_last_use +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_styled_reshadow-core.ts_contents +236 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_styled_reshadow-core.ts_hash_sum +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_styled_reshadow-core.ts_imp_deps +0 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_styled_reshadow-core.ts_last_use +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_styled_sstyled.tsx_contents +143 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_styled_sstyled.tsx_hash_sum +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_styled_sstyled.tsx_imp_deps +0 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_styled_sstyled.tsx_last_use +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_utils_assignProps.ts_contents +83 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_utils_assignProps.ts_hash_sum +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_utils_assignProps.ts_imp_deps +0 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_utils_assignProps.ts_last_use +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_utils_canUseDOM.ts_contents +3 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_utils_canUseDOM.ts_hash_sum +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_utils_canUseDOM.ts_imp_deps +0 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_utils_canUseDOM.ts_last_use +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_utils_capitalizeFirstLetter.ts_contents +3 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_utils_capitalizeFirstLetter.ts_hash_sum +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_utils_capitalizeFirstLetter.ts_imp_deps +0 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_utils_capitalizeFirstLetter.ts_last_use +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_utils_enhances_WithI18n.tsx_contents +26 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_utils_enhances_WithI18n.tsx_hash_sum +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_utils_enhances_WithI18n.tsx_imp_deps +0 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_utils_enhances_WithI18n.tsx_last_use +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_utils_enhances_i18nEnhance.tsx_contents +91 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_utils_enhances_i18nEnhance.tsx_hash_sum +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_utils_enhances_i18nEnhance.tsx_imp_deps +0 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_utils_enhances_i18nEnhance.tsx_last_use +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_utils_logger.ts_contents +30 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_utils_logger.ts_hash_sum +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_utils_logger.ts_imp_deps +0 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_utils_logger.ts_last_use +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_utils_pick.ts_contents +12 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_utils_pick.ts_hash_sum +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_utils_pick.ts_imp_deps +0 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_utils_pick.ts_last_use +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_utils_ref.ts_contents +70 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_utils_ref.ts_hash_sum +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_utils_ref.ts_imp_deps +0 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_utils_ref.ts_last_use +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_utils_use_useEnhancedEffect.ts_contents +4 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_utils_use_useEnhancedEffect.ts_hash_sum +1 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_utils_use_useEnhancedEffect.ts_imp_deps +0 -0
- package/.cache/esbuild_plugin_semcore_resolver/src_utils_use_useEnhancedEffect.ts_last_use +1 -0
- package/CHANGELOG.md +6 -0
- package/lib/utils/injectStyle.js +1 -1
- package/lib/utils/injectStyle.mjs +1 -1
- package/lib/utils/use/useColorResolver.js +3 -1
- package/lib/utils/use/useColorResolver.js.map +1 -1
- package/lib/utils/use/useColorResolver.mjs +3 -1
- package/lib/utils/use/useColorResolver.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
+
import canUseDOM from './utils/canUseDOM';
|
|
5
|
+
var LastInteractionType = /*#__PURE__*/function () {
|
|
6
|
+
function LastInteractionType() {
|
|
7
|
+
_classCallCheck(this, LastInteractionType);
|
|
8
|
+
_defineProperty(this, "lastFocusSource", 'none');
|
|
9
|
+
this.handleKeyDown = this.handleKeyDown.bind(this);
|
|
10
|
+
this.handleMouseDown = this.handleMouseDown.bind(this);
|
|
11
|
+
if (canUseDOM()) {
|
|
12
|
+
document.addEventListener('mousedown', this.handleMouseDown, {
|
|
13
|
+
capture: true
|
|
14
|
+
});
|
|
15
|
+
document.addEventListener('keydown', this.handleKeyDown, {
|
|
16
|
+
capture: true
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return _createClass(LastInteractionType, [{
|
|
21
|
+
key: "type",
|
|
22
|
+
get: function get() {
|
|
23
|
+
return this.lastFocusSource;
|
|
24
|
+
}
|
|
25
|
+
}, {
|
|
26
|
+
key: "isKeyboard",
|
|
27
|
+
value: function isKeyboard() {
|
|
28
|
+
return this.lastFocusSource === 'keyboard';
|
|
29
|
+
}
|
|
30
|
+
}, {
|
|
31
|
+
key: "isMouse",
|
|
32
|
+
value: function isMouse() {
|
|
33
|
+
return this.lastFocusSource === 'mouse';
|
|
34
|
+
}
|
|
35
|
+
}, {
|
|
36
|
+
key: "handleMouseDown",
|
|
37
|
+
value: function handleMouseDown() {
|
|
38
|
+
this.lastFocusSource = 'mouse';
|
|
39
|
+
}
|
|
40
|
+
}, {
|
|
41
|
+
key: "handleKeyDown",
|
|
42
|
+
value: function handleKeyDown() {
|
|
43
|
+
this.lastFocusSource = 'keyboard';
|
|
44
|
+
}
|
|
45
|
+
}]);
|
|
46
|
+
}();
|
|
47
|
+
export var lastInteraction = new LastInteractionType();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
82ce00d70329f80ea8eb538c829f12ed
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1779370328805
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _callSuper from "@babel/runtime/helpers/callSuper";
|
|
4
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
6
|
+
import { PureComponent } from 'react';
|
|
7
|
+
|
|
8
|
+
/** @deprecated */
|
|
9
|
+
|
|
10
|
+
var Root = undefined;
|
|
11
|
+
export { Root };
|
|
12
|
+
export var Component = /*#__PURE__*/function (_PureComponent) {
|
|
13
|
+
function Component() {
|
|
14
|
+
var _this;
|
|
15
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
16
|
+
args[_key] = arguments[_key];
|
|
17
|
+
}
|
|
18
|
+
_classCallCheck(this, Component);
|
|
19
|
+
_this = _callSuper(this, Component, [].concat(args));
|
|
20
|
+
_defineProperty(_this, "Root", undefined);
|
|
21
|
+
_defineProperty(_this, "isControlled", false);
|
|
22
|
+
return _this;
|
|
23
|
+
}
|
|
24
|
+
_inherits(Component, _PureComponent);
|
|
25
|
+
return _createClass(Component, [{
|
|
26
|
+
key: "uncontrolledProps",
|
|
27
|
+
value: function uncontrolledProps() {
|
|
28
|
+
// @ts-ignore. This is a default value. Should be defined in related classes.
|
|
29
|
+
return {};
|
|
30
|
+
}
|
|
31
|
+
}, {
|
|
32
|
+
key: "handlers",
|
|
33
|
+
get: function get() {
|
|
34
|
+
// @ts-ignore. The body will be generated in factory
|
|
35
|
+
return {};
|
|
36
|
+
}
|
|
37
|
+
}, {
|
|
38
|
+
key: "asProps",
|
|
39
|
+
get: function get() {
|
|
40
|
+
return {};
|
|
41
|
+
}
|
|
42
|
+
}]);
|
|
43
|
+
}(PureComponent);
|
|
44
|
+
|
|
45
|
+
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
46
|
+
export var Intergalactic;
|
|
47
|
+
export var wrapIntergalacticComponent = function wrapIntergalacticComponent(wrapper) {
|
|
48
|
+
return wrapper;
|
|
49
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
f21d20f58ee0e7a41b8775a0d00a2170
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1779370328805
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export var CORE_COMPONENT = Symbol('CORE_COMPONENT');
|
|
2
|
+
export var CORE_INSTANCE = Symbol('CORE_INSTANCE');
|
|
3
|
+
export var CORE_AS_PROPS = Symbol('CORE_AS_PROPS');
|
|
4
|
+
export var CORE_INIT = Symbol('CORE_INIT');
|
|
5
|
+
export var CONTEXT_COMPONENT = Symbol('CONTEXT_COMPONENT');
|
|
6
|
+
export var CREATE_COMPONENT = Symbol('CREATE_COMPONENT');
|
|
7
|
+
export var PARENT_COMPONENTS = Symbol('PARENT_COMPONENTS');
|
|
8
|
+
export var CHILDREN_COMPONENT = Symbol('CHILDREN_COMPONENT');
|
|
9
|
+
export var INHERITED_NAME = Symbol('INHERITED_NAME');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
08732fdf3ec8c47aefc3daad23bb5671
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1779370328805
|
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
3
|
+
import _readOnlyError from "@babel/runtime/helpers/readOnlyError";
|
|
4
|
+
import _createForOfIteratorHelper from "@babel/runtime/helpers/createForOfIteratorHelper";
|
|
5
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
6
|
+
import _superPropGet from "@babel/runtime/helpers/superPropGet";
|
|
7
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
8
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
9
|
+
import _callSuper from "@babel/runtime/helpers/callSuper";
|
|
10
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
11
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
12
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
13
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
14
|
+
var _excluded = ["forwardRef"],
|
|
15
|
+
_excluded2 = ["forwardRef", "__WRAPPER_PROPS_BIND__"],
|
|
16
|
+
_excluded3 = ["ref"];
|
|
17
|
+
import hoistNonReactStatics from 'hoist-non-react-statics';
|
|
18
|
+
import React from 'react';
|
|
19
|
+
import { Component } from './core-types/Component';
|
|
20
|
+
import { CONTEXT_COMPONENT, CORE_AS_PROPS, CORE_COMPONENT, CORE_INIT, CORE_INSTANCE, CREATE_COMPONENT, PARENT_COMPONENTS } from './core-types/symbols';
|
|
21
|
+
import childrenEnhancement from './enhancement/Children';
|
|
22
|
+
import dataNameEnhancement from './enhancement/dataName';
|
|
23
|
+
import enhanceEnhancement from './enhancement/enhance';
|
|
24
|
+
import functionDefaultPropsEnhancement from './enhancement/functionDefaultProps';
|
|
25
|
+
import i18nAppLocaleEnhance from './enhancement/i18n';
|
|
26
|
+
import inheritedNameEnhancement from './enhancement/inheritedName';
|
|
27
|
+
import rootEnhancement from './enhancement/Root';
|
|
28
|
+
import staticChildrenEnhancement, { getterMethodNameByDisplayName, ROOT_COMPONENT, STATIC_COMPONENT } from './enhancement/staticChildren';
|
|
29
|
+
import styleEnhancement from './enhancement/style';
|
|
30
|
+
import uncontrolledPropsEnhancement from './enhancement/uncontrolledProps';
|
|
31
|
+
import _assignProps from './utils/assignProps';
|
|
32
|
+
import { useForkRef } from './utils/ref';
|
|
33
|
+
import useEnhancedEffect from './utils/use/useEnhancedEffect';
|
|
34
|
+
function isEmptyObject(obj) {
|
|
35
|
+
return Object.getOwnPropertyNames(obj).length === 0 && Object.getOwnPropertySymbols &&
|
|
36
|
+
// For IE 11
|
|
37
|
+
Object.getOwnPropertySymbols(obj).length === 0 && Object.getPrototypeOf(obj) === Object.prototype;
|
|
38
|
+
}
|
|
39
|
+
function createGetField(enhancements, Component, isFunction) {
|
|
40
|
+
return function getField(key) {
|
|
41
|
+
return enhancements.filter(function (enhancement) {
|
|
42
|
+
if (!enhancement.condition) {
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
return enhancement.condition(Component, isFunction);
|
|
46
|
+
}).reduce(function (acc, item) {
|
|
47
|
+
if (item[key]) {
|
|
48
|
+
acc.push(item[key]);
|
|
49
|
+
}
|
|
50
|
+
return acc;
|
|
51
|
+
}, []);
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function createForwardWrapper(Component, wrapperProps, statics, isFunction) {
|
|
55
|
+
var RootComponent = Component[ROOT_COMPONENT];
|
|
56
|
+
var getterMethodName = getterMethodNameByDisplayName(Component === null || Component === void 0 ? void 0 : Component.displayName);
|
|
57
|
+
var getterMethod = RootComponent !== null && RootComponent !== void 0 && RootComponent.prototype ? RootComponent.prototype[getterMethodName] : undefined;
|
|
58
|
+
var useGetterIndex = (getterMethod === null || getterMethod === void 0 ? void 0 : getterMethod.length) >= 2;
|
|
59
|
+
function WrapperForwardRefWithBind(_ref, ref) {
|
|
60
|
+
var _ref$forwardRef = _ref.forwardRef,
|
|
61
|
+
forwardRef = _ref$forwardRef === void 0 ? null : _ref$forwardRef,
|
|
62
|
+
other = _objectWithoutProperties(_ref, _excluded);
|
|
63
|
+
return /*#__PURE__*/React.createElement(BindingWrapper, _extends({}, other, {
|
|
64
|
+
forwardRef: useForkRef(ref, forwardRef)
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
function WrapperForwardRef(_ref2, ref) {
|
|
68
|
+
var _ref2$forwardRef = _ref2.forwardRef,
|
|
69
|
+
forwardRef = _ref2$forwardRef === void 0 ? null : _ref2$forwardRef,
|
|
70
|
+
__WRAPPER_PROPS_BIND__ = _ref2.__WRAPPER_PROPS_BIND__,
|
|
71
|
+
other = _objectWithoutProperties(_ref2, _excluded2);
|
|
72
|
+
var _reduce = (__WRAPPER_PROPS_BIND__ || wrapperProps).reduce(function (acc, enhancement) {
|
|
73
|
+
return enhancement(acc, WrapperComponent, isFunction);
|
|
74
|
+
}, other),
|
|
75
|
+
_reduce$ref = _reduce.ref,
|
|
76
|
+
enhancementRef = _reduce$ref === void 0 ? null : _reduce$ref,
|
|
77
|
+
props = _objectWithoutProperties(_reduce, _excluded3);
|
|
78
|
+
return /*#__PURE__*/React.createElement(Component, _extends({}, props, {
|
|
79
|
+
forwardRef: useForkRef(enhancementRef, ref, forwardRef)
|
|
80
|
+
}));
|
|
81
|
+
}
|
|
82
|
+
var BindingWrapper = /*#__PURE__*/function (_React$Component) {
|
|
83
|
+
function BindingWrapper() {
|
|
84
|
+
var _this;
|
|
85
|
+
_classCallCheck(this, BindingWrapper);
|
|
86
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
87
|
+
args[_key] = arguments[_key];
|
|
88
|
+
}
|
|
89
|
+
_this = _callSuper(this, BindingWrapper, [].concat(args));
|
|
90
|
+
_defineProperty(_this, "index", -1);
|
|
91
|
+
return _this;
|
|
92
|
+
}
|
|
93
|
+
_inherits(BindingWrapper, _React$Component);
|
|
94
|
+
return _createClass(BindingWrapper, [{
|
|
95
|
+
key: "render",
|
|
96
|
+
value: function render() {
|
|
97
|
+
var _this2 = this;
|
|
98
|
+
return /*#__PURE__*/React.createElement(WrapperForwardRef, _extends({}, this.props, {
|
|
99
|
+
__WRAPPER_PROPS_BIND__: wrapperProps.map(function (fn) {
|
|
100
|
+
return fn.bind(_this2);
|
|
101
|
+
})
|
|
102
|
+
}));
|
|
103
|
+
}
|
|
104
|
+
}]);
|
|
105
|
+
}(React.Component);
|
|
106
|
+
var WrapperComponent = /*#__PURE__*/React.forwardRef(useGetterIndex ? WrapperForwardRefWithBind : WrapperForwardRef);
|
|
107
|
+
hoistNonReactStatics(WrapperComponent, Component);
|
|
108
|
+
WrapperComponent.displayName = Component.displayName;
|
|
109
|
+
// TODO: defaultProps is only empty
|
|
110
|
+
WrapperComponent.defaultProps = Component.defaultProps;
|
|
111
|
+
// STATIC
|
|
112
|
+
statics.forEach(function (enhancement) {
|
|
113
|
+
return Object.assign(WrapperComponent, enhancement(WrapperComponent, Component, isFunction));
|
|
114
|
+
});
|
|
115
|
+
return WrapperComponent;
|
|
116
|
+
}
|
|
117
|
+
function wrapClass(OriginComponent, enhancements, Context) {
|
|
118
|
+
var getField = createGetField(enhancements, OriginComponent, false);
|
|
119
|
+
var inits = getField('init');
|
|
120
|
+
var props = getField('asProps');
|
|
121
|
+
var renders = getField('render');
|
|
122
|
+
var statics = getField('static');
|
|
123
|
+
var wrapperProps = getField('wrapperProps');
|
|
124
|
+
var contexts = getField('context');
|
|
125
|
+
var Component = /*#__PURE__*/function (_OriginComponent2) {
|
|
126
|
+
function Component(props, context) {
|
|
127
|
+
var _this3;
|
|
128
|
+
_classCallCheck(this, Component);
|
|
129
|
+
_this3 = _callSuper(this, Component, [props, context]);
|
|
130
|
+
// INITS
|
|
131
|
+
_defineProperty(_this3, CORE_AS_PROPS, null);
|
|
132
|
+
_defineProperty(_this3, CORE_INSTANCE, WrapperComponent);
|
|
133
|
+
_defineProperty(_this3, CORE_INIT, false);
|
|
134
|
+
inits.forEach(function (enhancement) {
|
|
135
|
+
return enhancement.call(_this3, props, WrapperComponent, false);
|
|
136
|
+
});
|
|
137
|
+
_this3[CORE_INIT] = true;
|
|
138
|
+
return _this3;
|
|
139
|
+
}
|
|
140
|
+
_inherits(Component, _OriginComponent2);
|
|
141
|
+
return _createClass(Component, [{
|
|
142
|
+
key: "asProps",
|
|
143
|
+
get: function get() {
|
|
144
|
+
var _this4 = this;
|
|
145
|
+
// TODO if not production
|
|
146
|
+
if (!this[CORE_INIT]) {
|
|
147
|
+
throw new Error('Can not call asProps in constructor');
|
|
148
|
+
}
|
|
149
|
+
if (!this[CORE_AS_PROPS]) {
|
|
150
|
+
// PROPS
|
|
151
|
+
this[CORE_AS_PROPS] = props.reduce(function (acc, enhancement) {
|
|
152
|
+
return enhancement.call(_this4, acc, WrapperComponent, false);
|
|
153
|
+
}, this.props);
|
|
154
|
+
if (this[CORE_AS_PROPS] !== null) {
|
|
155
|
+
var prefixesMap = new Map();
|
|
156
|
+
Object.entries(this[CORE_AS_PROPS]).forEach(function (_ref3) {
|
|
157
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
|
158
|
+
key = _ref4[0],
|
|
159
|
+
value = _ref4[1];
|
|
160
|
+
var _key$split = key.split(':'),
|
|
161
|
+
_key$split2 = _slicedToArray(_key$split, 2),
|
|
162
|
+
prefix = _key$split2[0],
|
|
163
|
+
propertyKey = _key$split2[1];
|
|
164
|
+
if (prefix !== 'use' && propertyKey) {
|
|
165
|
+
var _prefixesMap$get;
|
|
166
|
+
var obj = (_prefixesMap$get = prefixesMap.get(prefix)) !== null && _prefixesMap$get !== void 0 ? _prefixesMap$get : {};
|
|
167
|
+
obj[propertyKey] = value;
|
|
168
|
+
prefixesMap.set(prefix, obj);
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
var _iterator = _createForOfIteratorHelper(prefixesMap.entries()),
|
|
172
|
+
_step;
|
|
173
|
+
try {
|
|
174
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
175
|
+
var _step$value = _slicedToArray(_step.value, 2),
|
|
176
|
+
key = _step$value[0],
|
|
177
|
+
value = _step$value[1];
|
|
178
|
+
Object.defineProperty(this[CORE_AS_PROPS], "".concat(key, "Props"), {
|
|
179
|
+
value: value
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
} catch (err) {
|
|
183
|
+
_iterator.e(err);
|
|
184
|
+
} finally {
|
|
185
|
+
_iterator.f();
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return this[CORE_AS_PROPS];
|
|
190
|
+
}
|
|
191
|
+
}, {
|
|
192
|
+
key: "setContext",
|
|
193
|
+
value: function setContext() {
|
|
194
|
+
var _this5 = this;
|
|
195
|
+
var contextProps = _superPropGet(Component, "setContext", this, 1) ? _superPropGet(Component, "setContext", this, 3)([]) : {};
|
|
196
|
+
// CONTEXT
|
|
197
|
+
return contexts.reduce(function (acc, enhancement) {
|
|
198
|
+
return enhancement.call(_this5, acc, WrapperComponent, false);
|
|
199
|
+
}, contextProps);
|
|
200
|
+
}
|
|
201
|
+
}, {
|
|
202
|
+
key: "render",
|
|
203
|
+
value: function render() {
|
|
204
|
+
var _this6 = this;
|
|
205
|
+
this[CORE_AS_PROPS] = null;
|
|
206
|
+
// TODO if not production
|
|
207
|
+
if (!_superPropGet(Component, "render", this, 1)) {
|
|
208
|
+
throw new Error('Component `render` method is not defined');
|
|
209
|
+
}
|
|
210
|
+
var asProps = this.asProps;
|
|
211
|
+
var ctx = this.setContext();
|
|
212
|
+
// RENDER
|
|
213
|
+
var render = renders.reduce(function (acc, enhancement) {
|
|
214
|
+
return enhancement.call(_this6, acc, asProps, WrapperComponent, false);
|
|
215
|
+
}, _superPropGet(Component, "render", this, 3)([]));
|
|
216
|
+
if (!WrapperComponent[STATIC_COMPONENT] && !isEmptyObject(ctx)) {
|
|
217
|
+
return /*#__PURE__*/React.createElement(Context.Provider, {
|
|
218
|
+
value: _objectSpread(_objectSpread({}, asProps), ctx)
|
|
219
|
+
}, render);
|
|
220
|
+
} else {
|
|
221
|
+
return render;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}]);
|
|
225
|
+
}(OriginComponent);
|
|
226
|
+
var WrapperComponent = createForwardWrapper(Component, wrapperProps, statics, false);
|
|
227
|
+
return WrapperComponent;
|
|
228
|
+
}
|
|
229
|
+
function wrapFunction(OriginComponent, enhancements, Context) {
|
|
230
|
+
var getField = createGetField(enhancements, OriginComponent, true);
|
|
231
|
+
var inits = getField('init');
|
|
232
|
+
var props = getField('asProps');
|
|
233
|
+
var renders = getField('render');
|
|
234
|
+
var statics = getField('static');
|
|
235
|
+
var wrapperProps = getField('wrapperProps');
|
|
236
|
+
var contexts = getField('context');
|
|
237
|
+
var Component = /*#__PURE__*/React.memo(function FunctionMemoComponent(other) {
|
|
238
|
+
var selfRef = React.useRef({});
|
|
239
|
+
var firstRender = React.useRef(true);
|
|
240
|
+
useEnhancedEffect(function () {
|
|
241
|
+
firstRender.current = false;
|
|
242
|
+
}, []);
|
|
243
|
+
if (firstRender.current) {
|
|
244
|
+
// INITS
|
|
245
|
+
inits.forEach(function (enhancement) {
|
|
246
|
+
return enhancement.call(selfRef.current, other, WrapperComponent, true);
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
// PROPS
|
|
250
|
+
var asProps = props.reduce(function (acc, enhancement) {
|
|
251
|
+
return enhancement.call(selfRef.current, acc, WrapperComponent, true);
|
|
252
|
+
}, other);
|
|
253
|
+
// CONTEXT
|
|
254
|
+
var ctx = contexts.reduce(function (acc, enhancement) {
|
|
255
|
+
return enhancement.call(selfRef.current, acc, WrapperComponent, true);
|
|
256
|
+
}, {});
|
|
257
|
+
|
|
258
|
+
// RENDER
|
|
259
|
+
var render = renders.reduce(function (acc, enhancement) {
|
|
260
|
+
return enhancement.call(selfRef.current, acc, asProps, WrapperComponent, true);
|
|
261
|
+
}, /*#__PURE__*/React.createElement(OriginComponent, asProps));
|
|
262
|
+
if (!WrapperComponent[STATIC_COMPONENT] && !isEmptyObject(ctx)) {
|
|
263
|
+
return /*#__PURE__*/React.createElement(Context.Provider, {
|
|
264
|
+
value: _objectSpread(_objectSpread({}, asProps), ctx)
|
|
265
|
+
}, render);
|
|
266
|
+
} else {
|
|
267
|
+
return render;
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
Object.assign(Component, OriginComponent);
|
|
271
|
+
var WrapperComponent = createForwardWrapper(Component, wrapperProps, statics, true);
|
|
272
|
+
return WrapperComponent;
|
|
273
|
+
}
|
|
274
|
+
function wrapCore(OriginComponent, enhancements, Context) {
|
|
275
|
+
var Component = function Component(_ref5) {
|
|
276
|
+
var Root = _ref5.Root;
|
|
277
|
+
var defaultProps = OriginComponent.defaultProps || {};
|
|
278
|
+
return /*#__PURE__*/React.createElement(Root, _extends({}, defaultProps, {
|
|
279
|
+
render: OriginComponent
|
|
280
|
+
}));
|
|
281
|
+
};
|
|
282
|
+
hoistNonReactStatics(Component, OriginComponent);
|
|
283
|
+
Component.displayName = OriginComponent.displayName;
|
|
284
|
+
return wrapFunction(Component, enhancements, Context);
|
|
285
|
+
}
|
|
286
|
+
function createComposeComponent(OriginComponent, Context, enhancements) {
|
|
287
|
+
if (React.PureComponent.isPrototypeOf(OriginComponent) || React.Component.isPrototypeOf(OriginComponent)) {
|
|
288
|
+
if (OriginComponent.prototype instanceof Component) {
|
|
289
|
+
return wrapClass(OriginComponent, enhancements, Context);
|
|
290
|
+
} else {
|
|
291
|
+
throw new Error('Must inherit from our component');
|
|
292
|
+
}
|
|
293
|
+
} else if (typeof OriginComponent === 'function') {
|
|
294
|
+
return wrapFunction(OriginComponent, enhancements, Context);
|
|
295
|
+
} else if (OriginComponent[CORE_COMPONENT]) {
|
|
296
|
+
return wrapCore(OriginComponent, enhancements, Context);
|
|
297
|
+
} else {
|
|
298
|
+
throw new Error('Must be a React component');
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
export function assignProps(p1, p2) {
|
|
302
|
+
return _assignProps(p2, p1);
|
|
303
|
+
}
|
|
304
|
+
function createComponent(OriginComponent) {
|
|
305
|
+
var childComponents = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
306
|
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
307
|
+
var _options$context = options.context,
|
|
308
|
+
context = _options$context === void 0 ? /*#__PURE__*/React.createContext({}) : _options$context,
|
|
309
|
+
_options$parent = options.parent,
|
|
310
|
+
parent = _options$parent === void 0 ? [] : _options$parent,
|
|
311
|
+
_options$enhancements = options.enhancements,
|
|
312
|
+
enhancements = _options$enhancements === void 0 ? [] : _options$enhancements;
|
|
313
|
+
var parents = Array.isArray(parent) ? parent : [parent];
|
|
314
|
+
if (parents.length) {
|
|
315
|
+
var wholeFamily = parents.reduce(function (acc, parent) {
|
|
316
|
+
if (parent[PARENT_COMPONENTS]) {
|
|
317
|
+
acc = [].concat(_toConsumableArray(parent[PARENT_COMPONENTS]), _toConsumableArray(acc));
|
|
318
|
+
}
|
|
319
|
+
return acc;
|
|
320
|
+
}, parents);
|
|
321
|
+
// @ts-ignore
|
|
322
|
+
OriginComponent[PARENT_COMPONENTS] = wholeFamily;
|
|
323
|
+
parents = wholeFamily;
|
|
324
|
+
}
|
|
325
|
+
// @ts-ignore
|
|
326
|
+
if (OriginComponent[CORE_COMPONENT]) {
|
|
327
|
+
parents.push(OriginComponent);
|
|
328
|
+
}
|
|
329
|
+
var Component = createComposeComponent(OriginComponent, context, [].concat(_toConsumableArray(enhancements.map(function (f) {
|
|
330
|
+
return f(context, parents, createComponent, childComponents);
|
|
331
|
+
})), [i18nAppLocaleEnhance(), childrenEnhancement(context, parents),
|
|
332
|
+
// root must be under the children
|
|
333
|
+
rootEnhancement(), uncontrolledPropsEnhancement(), staticChildrenEnhancement(childComponents, createComponent, {
|
|
334
|
+
context: context,
|
|
335
|
+
parent: parent,
|
|
336
|
+
enhancements: enhancements
|
|
337
|
+
}),
|
|
338
|
+
// functionDefaultProps must be under the staticChild
|
|
339
|
+
functionDefaultPropsEnhancement(),
|
|
340
|
+
// inheritedName must be under the staticChild
|
|
341
|
+
inheritedNameEnhancement(),
|
|
342
|
+
// dataName must be under the staticChild
|
|
343
|
+
dataNameEnhancement(),
|
|
344
|
+
// enhanceEnhancement must be under the functionDefaultPropsEnhancement
|
|
345
|
+
enhanceEnhancement(), styleEnhancement(childComponents, context)]));
|
|
346
|
+
Component[CONTEXT_COMPONENT] = context;
|
|
347
|
+
Component._______childrenComponents = childComponents;
|
|
348
|
+
Component[CREATE_COMPONENT] = function () {
|
|
349
|
+
var _OriginComponent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : OriginComponent;
|
|
350
|
+
var _childComponents = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : childComponents;
|
|
351
|
+
var _options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : options;
|
|
352
|
+
return createComponent(_OriginComponent, _childComponents, _options);
|
|
353
|
+
};
|
|
354
|
+
Component.newInstance = function () {
|
|
355
|
+
var _OriginComponent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : OriginComponent;
|
|
356
|
+
var _childComponents = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : childComponents;
|
|
357
|
+
var _options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : options;
|
|
358
|
+
return createComponent(_OriginComponent, _childComponents, _options);
|
|
359
|
+
};
|
|
360
|
+
Component[CORE_COMPONENT] = true;
|
|
361
|
+
return Component;
|
|
362
|
+
}
|
|
363
|
+
function createBaseComponent(OriginComponent) {
|
|
364
|
+
var _OriginComponent$disp;
|
|
365
|
+
var Component = /*#__PURE__*/React.forwardRef(OriginComponent);
|
|
366
|
+
Component.displayName = (_OriginComponent$disp = OriginComponent.displayName) !== null && _OriginComponent$disp !== void 0 ? _OriginComponent$disp : '';
|
|
367
|
+
// @ts-ignore
|
|
368
|
+
Component.defaultProps = {
|
|
369
|
+
'data-ui-name': OriginComponent.displayName
|
|
370
|
+
};
|
|
371
|
+
Component[CORE_COMPONENT] = true;
|
|
372
|
+
return Component;
|
|
373
|
+
}
|
|
374
|
+
export { createComponent, createBaseComponent };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
09848346d1a5105ef3794692d491fe50
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1779370328805
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
4
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
5
|
+
var _excluded = ["handlers", "getters"],
|
|
6
|
+
_excluded2 = ["handlers"];
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { CONTEXT_COMPONENT, CHILDREN_COMPONENT } from '../core-types/symbols';
|
|
9
|
+
var CHILDREN_SELF = Symbol('CHILDREN_SELF');
|
|
10
|
+
var GETTER_REG = /^get[\w]+Props$/;
|
|
11
|
+
function splitPropsAndGetters(props) {
|
|
12
|
+
return Object.entries(props).reduce(function (acc, _ref) {
|
|
13
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
14
|
+
key = _ref2[0],
|
|
15
|
+
value = _ref2[1];
|
|
16
|
+
if (GETTER_REG.exec(key) === null) {
|
|
17
|
+
acc.props[key] = value;
|
|
18
|
+
} else {
|
|
19
|
+
acc.getters[key] = value;
|
|
20
|
+
}
|
|
21
|
+
return acc;
|
|
22
|
+
}, {
|
|
23
|
+
props: {},
|
|
24
|
+
getters: {}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function getterToArray(getter) {
|
|
28
|
+
if (!Array.isArray(getter)) {
|
|
29
|
+
return typeof getter === 'function' ? [getter] : [];
|
|
30
|
+
}
|
|
31
|
+
return getter;
|
|
32
|
+
}
|
|
33
|
+
function mergeObjects() {
|
|
34
|
+
var a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
35
|
+
var b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
36
|
+
var core = _objectSpread(_objectSpread({}, a), b);
|
|
37
|
+
return Object.keys(core).reduce(function (acc, key) {
|
|
38
|
+
a[key] = getterToArray(a[key]);
|
|
39
|
+
b[key] = getterToArray(b[key]);
|
|
40
|
+
acc[key] = [].concat(_toConsumableArray(a[key]), _toConsumableArray(b[key]));
|
|
41
|
+
return acc;
|
|
42
|
+
}, {});
|
|
43
|
+
}
|
|
44
|
+
function assignGettersChain(getters) {
|
|
45
|
+
return function () {
|
|
46
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
47
|
+
return getters.reduce(function (acc, getter) {
|
|
48
|
+
return getter(acc);
|
|
49
|
+
}, props);
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function createChildren(Context, contexts) {
|
|
53
|
+
var _Children = function Children() {
|
|
54
|
+
var children = _Children.origin;
|
|
55
|
+
if (typeof children === 'function') {
|
|
56
|
+
var _reduce = [].concat(_toConsumableArray(contexts), [Context]).reduce(function (acc, ctx) {
|
|
57
|
+
var _ref3 = React.useContext(ctx),
|
|
58
|
+
handlers = _ref3.handlers,
|
|
59
|
+
propsAndGetters = _objectWithoutProperties(_ref3, _excluded2);
|
|
60
|
+
var _splitPropsAndGetters = splitPropsAndGetters(propsAndGetters),
|
|
61
|
+
props = _splitPropsAndGetters.props,
|
|
62
|
+
getters = _splitPropsAndGetters.getters;
|
|
63
|
+
return Object.assign({}, acc, _objectSpread({
|
|
64
|
+
handlers: Object.assign({}, acc.handlers, handlers),
|
|
65
|
+
getters: mergeObjects(acc.getters, getters)
|
|
66
|
+
}, props));
|
|
67
|
+
}, _Children.props),
|
|
68
|
+
_reduce$handlers = _reduce.handlers,
|
|
69
|
+
handlers = _reduce$handlers === void 0 ? {} : _reduce$handlers,
|
|
70
|
+
_reduce$getters = _reduce.getters,
|
|
71
|
+
getters = _reduce$getters === void 0 ? {} : _reduce$getters,
|
|
72
|
+
props = _objectWithoutProperties(_reduce, _excluded);
|
|
73
|
+
var mergedGetters = Object.entries(getters).reduce(function (acc, _ref4) {
|
|
74
|
+
var _ref5 = _slicedToArray(_ref4, 2),
|
|
75
|
+
key = _ref5[0],
|
|
76
|
+
value = _ref5[1];
|
|
77
|
+
acc[key] = assignGettersChain(value);
|
|
78
|
+
return acc;
|
|
79
|
+
}, {});
|
|
80
|
+
return children(_objectSpread(_objectSpread({}, props), mergedGetters), handlers);
|
|
81
|
+
} else if (children === undefined) {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
return children;
|
|
85
|
+
};
|
|
86
|
+
_Children.origin = null;
|
|
87
|
+
_Children.props = {};
|
|
88
|
+
_Children[CHILDREN_COMPONENT] = true;
|
|
89
|
+
return _Children;
|
|
90
|
+
}
|
|
91
|
+
function Enhancement(Context, parent) {
|
|
92
|
+
return {
|
|
93
|
+
init: function init() {
|
|
94
|
+
var contexts = (Array.isArray(parent) ? parent : [parent]).map(function (component) {
|
|
95
|
+
return component[CONTEXT_COMPONENT];
|
|
96
|
+
}).filter(Boolean);
|
|
97
|
+
this[CHILDREN_SELF] = createChildren(Context, contexts);
|
|
98
|
+
},
|
|
99
|
+
asProps: function asProps(props) {
|
|
100
|
+
// TODO: learn the reason what it was used for (by lsroman)
|
|
101
|
+
// this[CHILDREN_SELF].origin = _Children ? _Children.origin : children;
|
|
102
|
+
this[CHILDREN_SELF].origin = props.children;
|
|
103
|
+
this[CHILDREN_SELF].props = props;
|
|
104
|
+
return _objectSpread(_objectSpread({}, props), {}, {
|
|
105
|
+
Children: this[CHILDREN_SELF]
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
export default Enhancement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
8cfc76dc72aa7ad0e3c89a85f64cd74e
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1779370328820
|