@semcore/core 1.13.17 → 1.13.18
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/CHANGELOG.md +2 -2
- package/lib/cjs/Component.js +2 -8
- package/lib/cjs/Component.js.map +1 -1
- package/lib/cjs/enhancement/Children.js +5 -12
- package/lib/cjs/enhancement/Children.js.map +1 -1
- package/lib/cjs/enhancement/Root.js +4 -8
- package/lib/cjs/enhancement/Root.js.map +1 -1
- package/lib/cjs/enhancement/dataName.js +2 -6
- package/lib/cjs/enhancement/dataName.js.map +1 -1
- package/lib/cjs/enhancement/hoistProps.js +6 -5
- package/lib/cjs/enhancement/hoistProps.js.map +1 -1
- package/lib/cjs/enhancement/staticChildren.js +5 -6
- package/lib/cjs/enhancement/staticChildren.js.map +1 -1
- package/lib/cjs/enhancement/style.js +5 -8
- package/lib/cjs/enhancement/style.js.map +1 -1
- package/lib/cjs/enhancement/uncontrolledProps.js +9 -13
- package/lib/cjs/enhancement/uncontrolledProps.js.map +1 -1
- package/lib/cjs/index.js +11 -22
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/styled/index.js +1 -5
- package/lib/cjs/styled/sstyled.js +3 -6
- package/lib/cjs/styled/sstyled.js.map +1 -1
- package/lib/es6/Component.js +1 -7
- package/lib/es6/Component.js.map +1 -1
- package/lib/es6/enhancement/Children.js +1 -6
- package/lib/es6/enhancement/Children.js.map +1 -1
- package/lib/es6/enhancement/Root.js +1 -6
- package/lib/es6/enhancement/Root.js.map +1 -1
- package/lib/es6/enhancement/dataName.js +1 -5
- package/lib/es6/enhancement/dataName.js.map +1 -1
- package/lib/es6/enhancement/hoistProps.js +1 -5
- package/lib/es6/enhancement/hoistProps.js.map +1 -1
- package/lib/es6/enhancement/staticChildren.js +1 -6
- package/lib/es6/enhancement/staticChildren.js.map +1 -1
- package/lib/es6/enhancement/style.js +1 -5
- package/lib/es6/enhancement/style.js.map +1 -1
- package/lib/es6/enhancement/uncontrolledProps.js +2 -10
- package/lib/es6/enhancement/uncontrolledProps.js.map +1 -1
- package/lib/es6/index.js +3 -11
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/styled/sstyled.js +1 -5
- package/lib/es6/styled/sstyled.js.map +1 -1
- package/package.json +1 -1
package/lib/cjs/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
@@ -57,8 +57,12 @@ Object.defineProperty(exports, "register", {
|
|
|
57
57
|
|
|
58
58
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
59
59
|
|
|
60
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
61
|
+
|
|
60
62
|
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
61
63
|
|
|
64
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
65
|
+
|
|
62
66
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
63
67
|
|
|
64
68
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
@@ -67,9 +71,7 @@ var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
|
67
71
|
|
|
68
72
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
69
73
|
|
|
70
|
-
var
|
|
71
|
-
|
|
72
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
74
|
+
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
73
75
|
|
|
74
76
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
75
77
|
|
|
@@ -153,19 +155,6 @@ Object.keys(_styled).forEach(function (key) {
|
|
|
153
155
|
var _excluded = ["forwardRef"],
|
|
154
156
|
_excluded2 = ["forwardRef", "__WRAPPER_PROPS_BIND__"],
|
|
155
157
|
_excluded3 = ["ref"];
|
|
156
|
-
|
|
157
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
158
|
-
|
|
159
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
160
|
-
|
|
161
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
162
|
-
|
|
163
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
164
|
-
|
|
165
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
166
|
-
|
|
167
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
168
|
-
|
|
169
158
|
var CORE_COMPONENT = Symbol('CORE_COMPONENT');
|
|
170
159
|
exports.CORE_COMPONENT = CORE_COMPONENT;
|
|
171
160
|
var CORE_INSTANCE = Symbol('CORE_INSTANCE');
|
|
@@ -237,7 +226,7 @@ function createForwardWrapper(Component, wrapperProps, statics, isFunction) {
|
|
|
237
226
|
var BindingWrapper = /*#__PURE__*/function (_React$Component) {
|
|
238
227
|
(0, _inherits2["default"])(BindingWrapper, _React$Component);
|
|
239
228
|
|
|
240
|
-
var _super =
|
|
229
|
+
var _super = (0, _createSuper2["default"])(BindingWrapper);
|
|
241
230
|
|
|
242
231
|
function BindingWrapper() {
|
|
243
232
|
var _this;
|
|
@@ -293,7 +282,7 @@ function wrapClass(OriginComponent, enhancements, Context) {
|
|
|
293
282
|
var Component = /*#__PURE__*/function (_OriginComponent2) {
|
|
294
283
|
(0, _inherits2["default"])(Component, _OriginComponent2);
|
|
295
284
|
|
|
296
|
-
var _super2 =
|
|
285
|
+
var _super2 = (0, _createSuper2["default"])(Component);
|
|
297
286
|
|
|
298
287
|
function Component(props, context) {
|
|
299
288
|
var _this3;
|
|
@@ -361,7 +350,7 @@ function wrapClass(OriginComponent, enhancements, Context) {
|
|
|
361
350
|
|
|
362
351
|
if (!WrapperComponent[_staticChildren.STATIC_COMPONENT] && !isEmptyObject(ctx)) {
|
|
363
352
|
return /*#__PURE__*/_react["default"].createElement(Context.Provider, {
|
|
364
|
-
value:
|
|
353
|
+
value: (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, asProps), ctx)
|
|
365
354
|
}, render);
|
|
366
355
|
} else {
|
|
367
356
|
return render;
|
|
@@ -413,7 +402,7 @@ function wrapFunction(OriginComponent, enhancements, Context) {
|
|
|
413
402
|
|
|
414
403
|
if (!WrapperComponent[_staticChildren.STATIC_COMPONENT] && !isEmptyObject(ctx)) {
|
|
415
404
|
return /*#__PURE__*/_react["default"].createElement(Context.Provider, {
|
|
416
|
-
value:
|
|
405
|
+
value: (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, asProps), ctx)
|
|
417
406
|
}, render);
|
|
418
407
|
} else {
|
|
419
408
|
return render;
|
|
@@ -521,7 +510,7 @@ function createBaseComponent(OriginComponent) {
|
|
|
521
510
|
if (!_react["default"].PureComponent.isPrototypeOf(OriginComponent) && !_react["default"].Component.isPrototypeOf(OriginComponent) && typeof OriginComponent === 'function') {
|
|
522
511
|
Component = /*#__PURE__*/_react["default"].forwardRef(OriginComponent);
|
|
523
512
|
Component.displayName = OriginComponent.displayName;
|
|
524
|
-
Component.defaultProps =
|
|
513
|
+
Component.defaultProps = (0, _objectSpread2["default"])({
|
|
525
514
|
'data-ui-name': OriginComponent.displayName
|
|
526
515
|
}, OriginComponent.defaultProps);
|
|
527
516
|
Component[CORE_COMPONENT] = true;
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["CORE_COMPONENT","Symbol","CORE_INSTANCE","CORE_AS_PROPS","CORE_INIT","CONTEXT_COMPONENT","CREATE_COMPONENT","PARENT_COMPONENTS","isEmptyObject","obj","Object","getOwnPropertyNames","length","getOwnPropertySymbols","getPrototypeOf","prototype","createGetField","enhancements","Component","isFunction","getField","key","filter","enhancement","condition","reduce","acc","item","push","createForwardWrapper","wrapperProps","statics","RootComponent","ROOT_COMPONENT","getterMethodName","getterMethodNameByDisplayName","displayName","getterMethod","undefined","useGetterIndex","WrapperForwardRefWithBind","ref","forwardRef","other","useForkRef","WrapperForwardRef","__WRAPPER_PROPS_BIND__","WrapperComponent","enhancementRef","props","BindingWrapper","map","fn","bind","React","hoistNonReactStatics","defaultProps","forEach","assign","wrapClass","OriginComponent","Context","inits","renders","contexts","context","call","Error","contextProps","asProps","ctx","setContext","render","STATIC_COMPONENT","wrapFunction","memo","FunctionMemoComponent","selfRef","useRef","firstRender","useEnhancedEffect","current","wrapCore","Root","createComposeComponent","PureComponent","isPrototypeOf","assignProps","p1","p2","_assignProps","createComponent","childComponents","options","createContext","parent","parents","Array","isArray","wholeFamily","f","bindHandlerEnhancement","childrenEnhancement","rootEnhancement","uncontrolledPropsEnhancement","staticChildrenEnhancement","functionDefaultPropsEnhancement","inheritedNameEnhancement","dataNameEnhancement","enhanceEnhancement","styleEnhancement","hoistPropsEnhancement","_OriginComponent","_childComponents","_options","createBaseComponent"],"sources":["../../src/index.tsx"],"sourcesContent":["import React, { ForwardRefExoticComponent, RefAttributes, useRef } from 'react';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\n// @ts-ignore\nimport { useForkRef } from '@semcore/utils/lib/ref';\n// @ts-ignore\nimport useEnhancedEffect from '@semcore/utils/lib/use/useEnhancedEffect';\n// @ts-ignore\nimport _assignProps from '@semcore/utils/lib/assignProps';\n\nimport { Component, PropsWithRenderFnChildren } from './Component';\nimport register from './register';\n\nimport childrenEnhancement, { CHILDREN_COMPONENT } from './enhancement/Children';\nimport rootEnhancement from './enhancement/Root';\nimport uncontrolledPropsEnhancement from './enhancement/uncontrolledProps';\nimport functionDefaultPropsEnhancement from './enhancement/functionDefaultProps';\nimport staticChildrenEnhancement, {\n STATIC_COMPONENT,\n ROOT_COMPONENT,\n getterMethodNameByDisplayName,\n} from './enhancement/staticChildren';\nimport inheritedNameEnhancement, { INHERITED_NAME } from './enhancement/inheritedName';\nimport hoistPropsEnhancement from './enhancement/hoistProps';\nimport dataNameEnhancement from './enhancement/dataName';\nimport enhanceEnhancement from './enhancement/enhance';\nimport styleEnhancement from './enhancement/style';\nimport bindHandlerEnhancement from './enhancement/bindHandler';\n\nconst CORE_COMPONENT = Symbol('CORE_COMPONENT');\nconst CORE_INSTANCE = Symbol('CORE_INSTANCE');\nconst CORE_AS_PROPS = Symbol('CORE_AS_PROPS');\nconst CORE_INIT = Symbol('CORE_INIT');\nconst CONTEXT_COMPONENT = Symbol('CONTEXT_COMPONENT');\nconst CREATE_COMPONENT = Symbol('CREATE_COMPONENT');\nconst PARENT_COMPONENTS = Symbol('PARENT_COMPONENTS');\n\nfunction isEmptyObject(obj) {\n return (\n Object.getOwnPropertyNames(obj).length === 0 &&\n Object.getOwnPropertySymbols && // For IE 11\n Object.getOwnPropertySymbols(obj).length === 0 &&\n Object.getPrototypeOf(obj) === Object.prototype\n );\n}\n\nfunction createGetField(enhancements, Component, isFunction) {\n return function getField(key) {\n return enhancements\n .filter((enhancement) => {\n if (!enhancement.condition) {\n return true;\n }\n return enhancement.condition(Component, isFunction);\n })\n .reduce((acc, item) => {\n if (item[key]) {\n acc.push(item[key]);\n }\n return acc;\n }, []);\n };\n}\n\nfunction createForwardWrapper(Component, wrapperProps, statics, isFunction) {\n const RootComponent = Component[ROOT_COMPONENT];\n const getterMethodName = getterMethodNameByDisplayName(Component?.displayName);\n const getterMethod = RootComponent?.prototype\n ? RootComponent.prototype[getterMethodName]\n : undefined;\n const useGetterIndex = getterMethod?.length >= 2;\n\n function WrapperForwardRefWithBind({ forwardRef = null, ...other }, ref) {\n return <BindingWrapper {...other} forwardRef={useForkRef(ref, forwardRef)} />;\n }\n\n function WrapperForwardRef({ forwardRef = null, __WRAPPER_PROPS_BIND__, ...other }, ref) {\n const { ref: enhancementRef = null, ...props } = (\n __WRAPPER_PROPS_BIND__ || wrapperProps\n ).reduce((acc, enhancement) => enhancement(acc, WrapperComponent, isFunction), other);\n return <Component {...props} forwardRef={useForkRef(enhancementRef, ref, forwardRef)} />;\n }\n\n class BindingWrapper extends React.Component<any> {\n index = -1;\n render() {\n return (\n <WrapperForwardRef\n {...this.props}\n __WRAPPER_PROPS_BIND__={wrapperProps.map((fn) => fn.bind(this))}\n />\n );\n }\n }\n\n const WrapperComponent = React.forwardRef(\n useGetterIndex ? WrapperForwardRefWithBind : WrapperForwardRef,\n );\n\n hoistNonReactStatics(WrapperComponent, Component);\n\n WrapperComponent.displayName = Component.displayName;\n // TODO: defaultProps is only empty\n WrapperComponent.defaultProps = Component.defaultProps;\n // STATIC\n statics.forEach((enhancement) =>\n Object.assign(WrapperComponent, enhancement(WrapperComponent, Component, isFunction)),\n );\n\n return WrapperComponent;\n}\n\nfunction wrapClass(OriginComponent, enhancements, Context) {\n const getField = createGetField(enhancements, OriginComponent, false);\n\n const inits = getField('init');\n const props = getField('asProps');\n const renders = getField('render');\n const statics = getField('static');\n const wrapperProps = getField('wrapperProps');\n const contexts = getField('context');\n\n class Component extends OriginComponent {\n [CORE_AS_PROPS] = null;\n [CORE_INSTANCE] = WrapperComponent;\n [CORE_INIT] = false;\n\n constructor(props, context) {\n super(props, context);\n // INITS\n inits.forEach((enhancement) => enhancement.call(this, props, WrapperComponent, false));\n this[CORE_INIT] = true;\n }\n\n get asProps() {\n // TODO if not production\n if (!this[CORE_INIT]) {\n throw new Error('Can not call asProps in constructor');\n }\n if (!this[CORE_AS_PROPS]) {\n // PROPS\n this[CORE_AS_PROPS] = props.reduce(\n (acc, enhancement) => enhancement.call(this, acc, WrapperComponent, false),\n this.props,\n );\n }\n return this[CORE_AS_PROPS];\n }\n\n setContext() {\n const contextProps = super.setContext ? super.setContext() : {};\n // CONTEXT\n return contexts.reduce(\n (acc, enhancement) => enhancement.call(this, acc, WrapperComponent, false),\n contextProps,\n );\n }\n\n render() {\n this[CORE_AS_PROPS] = null;\n // TODO if not production\n if (!super.render) {\n throw new Error('Component `render` method is not defined');\n }\n const asProps = this.asProps;\n const ctx = this.setContext();\n // RENDER\n const render = renders.reduce(\n (acc, enhancement) => enhancement.call(this, acc, asProps, WrapperComponent, false),\n super.render(),\n );\n if (!WrapperComponent[STATIC_COMPONENT] && !isEmptyObject(ctx)) {\n return <Context.Provider value={{ ...asProps, ...ctx }}>{render}</Context.Provider>;\n } else {\n return render;\n }\n }\n }\n\n const WrapperComponent = createForwardWrapper(Component, wrapperProps, statics, false);\n return WrapperComponent;\n}\n\nfunction wrapFunction(OriginComponent, enhancements, Context) {\n const getField = createGetField(enhancements, OriginComponent, true);\n\n const inits = getField('init');\n const props = getField('asProps');\n const renders = getField('render');\n const statics = getField('static');\n const wrapperProps = getField('wrapperProps');\n const contexts = getField('context');\n\n const Component = React.memo(function FunctionMemoComponent(other) {\n const selfRef = useRef({});\n const firstRender = useRef(true);\n useEnhancedEffect(() => {\n firstRender.current = false;\n }, []);\n if (firstRender.current) {\n // INITS\n inits.forEach((enhancement) =>\n enhancement.call(selfRef.current, other, WrapperComponent, true),\n );\n }\n // PROPS\n const asProps = props.reduce(\n (acc, enhancement) => enhancement.call(selfRef.current, acc, WrapperComponent, true),\n other,\n );\n // CONTEXT\n const ctx = contexts.reduce(\n (acc, enhancement) => enhancement.call(selfRef.current, acc, WrapperComponent, true),\n {},\n );\n\n // RENDER\n const render = renders.reduce(\n (acc, enhancement) => enhancement.call(selfRef.current, acc, asProps, WrapperComponent, true),\n <OriginComponent {...asProps} />,\n );\n\n if (!WrapperComponent[STATIC_COMPONENT] && !isEmptyObject(ctx)) {\n return <Context.Provider value={{ ...asProps, ...ctx }}>{render}</Context.Provider>;\n } else {\n return render;\n }\n });\n Object.assign(Component, OriginComponent);\n const WrapperComponent = createForwardWrapper(Component, wrapperProps, statics, true);\n return WrapperComponent;\n}\n\nfunction wrapCore(OriginComponent, enhancements, Context) {\n const Component = function ({ Root }) {\n return <Root render={OriginComponent} />;\n };\n hoistNonReactStatics(Component, OriginComponent);\n Component.displayName = OriginComponent.displayName;\n Component.defaultProps = OriginComponent.defaultProps;\n return wrapFunction(Component, enhancements, Context);\n}\n\nfunction createComposeComponent(OriginComponent, Context, enhancements): any {\n if (\n React.PureComponent.isPrototypeOf(OriginComponent) ||\n React.Component.isPrototypeOf(OriginComponent)\n ) {\n if (OriginComponent.prototype instanceof Component) {\n return wrapClass(OriginComponent, enhancements, Context);\n } else {\n throw new Error('Must inherit from our component');\n }\n } else if (typeof OriginComponent === 'function') {\n return wrapFunction(OriginComponent, enhancements, Context);\n } else if (OriginComponent[CORE_COMPONENT]) {\n return wrapCore(OriginComponent, enhancements, Context);\n } else {\n throw new Error('Must be a React component');\n }\n}\n\nexport type PropsAndRef<T, Ctx, UCProps> = PropsWithRenderFnChildren<T, Ctx, UCProps> &\n RefAttributes<unknown>;\nexport type ForwardRefComponent<T, Ctx, UCProps> = ForwardRefExoticComponent<\n PropsAndRef<T, Ctx, UCProps>\n>;\ntype ComponentOrProps<T, Context, UCProps> = T extends [infer ParentProps, infer ChildProps]\n ? ComponentType<ParentProps, ChildProps, Context, UCProps>\n : ForwardRefComponent<T, Context, UCProps>;\n\nexport type ComponentType<\n ComponentProps,\n ChildComponentProps = {},\n ContextType = {},\n UCProps = {},\n FNType = null,\n> = (FNType extends null\n ? ForwardRefComponent<ComponentProps, ContextType, UCProps>\n : FNType & { displayName: string }) & {\n [K in keyof ChildComponentProps]: ComponentOrProps<ChildComponentProps[K], ContextType, UCProps>;\n} & {\n [CORE_COMPONENT]: boolean;\n [CREATE_COMPONENT]: () => ComponentType<\n ComponentProps,\n ChildComponentProps,\n ContextType,\n UCProps\n >;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ninterface ClassWithUncontrolledProps<Props> {\n uncontrolledProps(): unknown;\n}\n\nfunction assignProps(p1, p2) {\n return _assignProps(p2, p1);\n}\n\nfunction createComponent<ComponentProps, ChildComponentProps = {}, ContextType = {}, FNType = null>(\n OriginComponent,\n childComponents = {},\n options: {\n context?: React.Context<ContextType>;\n parent?: ComponentType<unknown> | ComponentType<unknown>[];\n enhancements?: [any];\n } = {},\n): ComponentType<\n ComponentProps extends Component<infer Props> ? Props : ComponentProps,\n ChildComponentProps,\n ContextType,\n ComponentProps extends ClassWithUncontrolledProps<any>\n ? ReturnType<ComponentProps['uncontrolledProps']>\n : { [key: string]: (arg: unknown) => void },\n FNType\n> {\n const {\n context = React.createContext<ContextType>({} as ContextType),\n parent = [],\n enhancements = [],\n } = options;\n let parents = Array.isArray(parent) ? parent : [parent];\n if (parents.length) {\n const wholeFamily = parents.reduce((acc, parent) => {\n if (parent[PARENT_COMPONENTS]) {\n acc = [...parent[PARENT_COMPONENTS], ...acc];\n }\n return acc;\n }, parents);\n OriginComponent[PARENT_COMPONENTS] = wholeFamily;\n parents = wholeFamily;\n }\n if (OriginComponent[CORE_COMPONENT]) {\n parents.push(OriginComponent);\n }\n const Component = createComposeComponent(OriginComponent, context, [\n // @ts-ignore\n ...enhancements.map((f) => f(context, parents, createComponent, childComponents)),\n bindHandlerEnhancement(),\n childrenEnhancement(context, parents),\n // root must be under the children\n rootEnhancement(),\n uncontrolledPropsEnhancement(),\n staticChildrenEnhancement(childComponents, createComponent, {\n context,\n parent,\n enhancements,\n }),\n // functionDefaultProps must be under the staticChild\n functionDefaultPropsEnhancement(),\n // inheritedName must be under the staticChild\n inheritedNameEnhancement(),\n // dataName must be under the staticChild\n dataNameEnhancement(),\n // enhanceEnhancement must be under the functionDefaultPropsEnhancement\n enhanceEnhancement(),\n styleEnhancement(childComponents, context),\n // must be the last one so any properties can be raised\n hoistPropsEnhancement(childComponents, context),\n ]);\n Component[CONTEXT_COMPONENT] = context;\n Component[CREATE_COMPONENT] = function (\n _OriginComponent = OriginComponent,\n _childComponents = childComponents,\n _options = options,\n ) {\n return createComponent(_OriginComponent, _childComponents, _options);\n };\n Component[CORE_COMPONENT] = true;\n return Component;\n}\n\nfunction createBaseComponent<ComponentProps>(OriginComponent): ComponentType<ComponentProps> {\n let Component = null;\n if (\n !React.PureComponent.isPrototypeOf(OriginComponent) &&\n !React.Component.isPrototypeOf(OriginComponent) &&\n typeof OriginComponent === 'function'\n ) {\n Component = React.forwardRef(OriginComponent);\n Component.displayName = OriginComponent.displayName;\n Component.defaultProps = {\n 'data-ui-name': OriginComponent.displayName,\n ...OriginComponent.defaultProps,\n };\n Component[CORE_COMPONENT] = true;\n } else {\n throw new Error('createBaseComponent accepts only functional component');\n }\n return Component;\n}\n\nexport * from './Component';\nexport * from './styled';\nexport * from './register';\nexport {\n createBaseComponent,\n register,\n CREATE_COMPONENT,\n CORE_INSTANCE,\n CONTEXT_COMPONENT,\n CHILDREN_COMPONENT,\n INHERITED_NAME,\n CORE_COMPONENT,\n STATIC_COMPONENT,\n ROOT_COMPONENT,\n assignProps,\n};\nexport default createComponent;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AA+XA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AA9XA;;AAgYA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AA9XA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AA+WA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;;;;;;;;;;;;;;AA7WA,IAAMA,cAAc,GAAGC,MAAM,CAAC,gBAAD,CAA7B;;AACA,IAAMC,aAAa,GAAGD,MAAM,CA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AACD;;eAkBcyE,e"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["CORE_COMPONENT","Symbol","CORE_INSTANCE","CORE_AS_PROPS","CORE_INIT","CONTEXT_COMPONENT","CREATE_COMPONENT","PARENT_COMPONENTS","isEmptyObject","obj","Object","getOwnPropertyNames","length","getOwnPropertySymbols","getPrototypeOf","prototype","createGetField","enhancements","Component","isFunction","getField","key","filter","enhancement","condition","reduce","acc","item","push","createForwardWrapper","wrapperProps","statics","RootComponent","ROOT_COMPONENT","getterMethodName","getterMethodNameByDisplayName","displayName","getterMethod","undefined","useGetterIndex","WrapperForwardRefWithBind","ref","forwardRef","other","useForkRef","WrapperForwardRef","__WRAPPER_PROPS_BIND__","WrapperComponent","enhancementRef","props","BindingWrapper","map","fn","bind","React","hoistNonReactStatics","defaultProps","forEach","assign","wrapClass","OriginComponent","Context","inits","renders","contexts","context","call","Error","contextProps","asProps","ctx","setContext","render","STATIC_COMPONENT","wrapFunction","memo","FunctionMemoComponent","selfRef","useRef","firstRender","useEnhancedEffect","current","wrapCore","Root","createComposeComponent","PureComponent","isPrototypeOf","assignProps","p1","p2","_assignProps","createComponent","childComponents","options","createContext","parent","parents","Array","isArray","wholeFamily","f","bindHandlerEnhancement","childrenEnhancement","rootEnhancement","uncontrolledPropsEnhancement","staticChildrenEnhancement","functionDefaultPropsEnhancement","inheritedNameEnhancement","dataNameEnhancement","enhanceEnhancement","styleEnhancement","hoistPropsEnhancement","_OriginComponent","_childComponents","_options","createBaseComponent"],"sources":["../../src/index.tsx"],"sourcesContent":["import React, { ForwardRefExoticComponent, RefAttributes, useRef } from 'react';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\n// @ts-ignore\nimport { useForkRef } from '@semcore/utils/lib/ref';\n// @ts-ignore\nimport useEnhancedEffect from '@semcore/utils/lib/use/useEnhancedEffect';\n// @ts-ignore\nimport _assignProps from '@semcore/utils/lib/assignProps';\n\nimport { Component, PropsWithRenderFnChildren } from './Component';\nimport register from './register';\n\nimport childrenEnhancement, { CHILDREN_COMPONENT } from './enhancement/Children';\nimport rootEnhancement from './enhancement/Root';\nimport uncontrolledPropsEnhancement from './enhancement/uncontrolledProps';\nimport functionDefaultPropsEnhancement from './enhancement/functionDefaultProps';\nimport staticChildrenEnhancement, {\n STATIC_COMPONENT,\n ROOT_COMPONENT,\n getterMethodNameByDisplayName,\n} from './enhancement/staticChildren';\nimport inheritedNameEnhancement, { INHERITED_NAME } from './enhancement/inheritedName';\nimport hoistPropsEnhancement from './enhancement/hoistProps';\nimport dataNameEnhancement from './enhancement/dataName';\nimport enhanceEnhancement from './enhancement/enhance';\nimport styleEnhancement from './enhancement/style';\nimport bindHandlerEnhancement from './enhancement/bindHandler';\n\nconst CORE_COMPONENT = Symbol('CORE_COMPONENT');\nconst CORE_INSTANCE = Symbol('CORE_INSTANCE');\nconst CORE_AS_PROPS = Symbol('CORE_AS_PROPS');\nconst CORE_INIT = Symbol('CORE_INIT');\nconst CONTEXT_COMPONENT = Symbol('CONTEXT_COMPONENT');\nconst CREATE_COMPONENT = Symbol('CREATE_COMPONENT');\nconst PARENT_COMPONENTS = Symbol('PARENT_COMPONENTS');\n\nfunction isEmptyObject(obj) {\n return (\n Object.getOwnPropertyNames(obj).length === 0 &&\n Object.getOwnPropertySymbols && // For IE 11\n Object.getOwnPropertySymbols(obj).length === 0 &&\n Object.getPrototypeOf(obj) === Object.prototype\n );\n}\n\nfunction createGetField(enhancements, Component, isFunction) {\n return function getField(key) {\n return enhancements\n .filter((enhancement) => {\n if (!enhancement.condition) {\n return true;\n }\n return enhancement.condition(Component, isFunction);\n })\n .reduce((acc, item) => {\n if (item[key]) {\n acc.push(item[key]);\n }\n return acc;\n }, []);\n };\n}\n\nfunction createForwardWrapper(Component, wrapperProps, statics, isFunction) {\n const RootComponent = Component[ROOT_COMPONENT];\n const getterMethodName = getterMethodNameByDisplayName(Component?.displayName);\n const getterMethod = RootComponent?.prototype\n ? RootComponent.prototype[getterMethodName]\n : undefined;\n const useGetterIndex = getterMethod?.length >= 2;\n\n function WrapperForwardRefWithBind({ forwardRef = null, ...other }, ref) {\n return <BindingWrapper {...other} forwardRef={useForkRef(ref, forwardRef)} />;\n }\n\n function WrapperForwardRef({ forwardRef = null, __WRAPPER_PROPS_BIND__, ...other }, ref) {\n const { ref: enhancementRef = null, ...props } = (\n __WRAPPER_PROPS_BIND__ || wrapperProps\n ).reduce((acc, enhancement) => enhancement(acc, WrapperComponent, isFunction), other);\n return <Component {...props} forwardRef={useForkRef(enhancementRef, ref, forwardRef)} />;\n }\n\n class BindingWrapper extends React.Component<any> {\n index = -1;\n render() {\n return (\n <WrapperForwardRef\n {...this.props}\n __WRAPPER_PROPS_BIND__={wrapperProps.map((fn) => fn.bind(this))}\n />\n );\n }\n }\n\n const WrapperComponent = React.forwardRef(\n useGetterIndex ? WrapperForwardRefWithBind : WrapperForwardRef,\n );\n\n hoistNonReactStatics(WrapperComponent, Component);\n\n WrapperComponent.displayName = Component.displayName;\n // TODO: defaultProps is only empty\n WrapperComponent.defaultProps = Component.defaultProps;\n // STATIC\n statics.forEach((enhancement) =>\n Object.assign(WrapperComponent, enhancement(WrapperComponent, Component, isFunction)),\n );\n\n return WrapperComponent;\n}\n\nfunction wrapClass(OriginComponent, enhancements, Context) {\n const getField = createGetField(enhancements, OriginComponent, false);\n\n const inits = getField('init');\n const props = getField('asProps');\n const renders = getField('render');\n const statics = getField('static');\n const wrapperProps = getField('wrapperProps');\n const contexts = getField('context');\n\n class Component extends OriginComponent {\n [CORE_AS_PROPS] = null;\n [CORE_INSTANCE] = WrapperComponent;\n [CORE_INIT] = false;\n\n constructor(props, context) {\n super(props, context);\n // INITS\n inits.forEach((enhancement) => enhancement.call(this, props, WrapperComponent, false));\n this[CORE_INIT] = true;\n }\n\n get asProps() {\n // TODO if not production\n if (!this[CORE_INIT]) {\n throw new Error('Can not call asProps in constructor');\n }\n if (!this[CORE_AS_PROPS]) {\n // PROPS\n this[CORE_AS_PROPS] = props.reduce(\n (acc, enhancement) => enhancement.call(this, acc, WrapperComponent, false),\n this.props,\n );\n }\n return this[CORE_AS_PROPS];\n }\n\n setContext() {\n const contextProps = super.setContext ? super.setContext() : {};\n // CONTEXT\n return contexts.reduce(\n (acc, enhancement) => enhancement.call(this, acc, WrapperComponent, false),\n contextProps,\n );\n }\n\n render() {\n this[CORE_AS_PROPS] = null;\n // TODO if not production\n if (!super.render) {\n throw new Error('Component `render` method is not defined');\n }\n const asProps = this.asProps;\n const ctx = this.setContext();\n // RENDER\n const render = renders.reduce(\n (acc, enhancement) => enhancement.call(this, acc, asProps, WrapperComponent, false),\n super.render(),\n );\n if (!WrapperComponent[STATIC_COMPONENT] && !isEmptyObject(ctx)) {\n return <Context.Provider value={{ ...asProps, ...ctx }}>{render}</Context.Provider>;\n } else {\n return render;\n }\n }\n }\n\n const WrapperComponent = createForwardWrapper(Component, wrapperProps, statics, false);\n return WrapperComponent;\n}\n\nfunction wrapFunction(OriginComponent, enhancements, Context) {\n const getField = createGetField(enhancements, OriginComponent, true);\n\n const inits = getField('init');\n const props = getField('asProps');\n const renders = getField('render');\n const statics = getField('static');\n const wrapperProps = getField('wrapperProps');\n const contexts = getField('context');\n\n const Component = React.memo(function FunctionMemoComponent(other) {\n const selfRef = useRef({});\n const firstRender = useRef(true);\n useEnhancedEffect(() => {\n firstRender.current = false;\n }, []);\n if (firstRender.current) {\n // INITS\n inits.forEach((enhancement) =>\n enhancement.call(selfRef.current, other, WrapperComponent, true),\n );\n }\n // PROPS\n const asProps = props.reduce(\n (acc, enhancement) => enhancement.call(selfRef.current, acc, WrapperComponent, true),\n other,\n );\n // CONTEXT\n const ctx = contexts.reduce(\n (acc, enhancement) => enhancement.call(selfRef.current, acc, WrapperComponent, true),\n {},\n );\n\n // RENDER\n const render = renders.reduce(\n (acc, enhancement) => enhancement.call(selfRef.current, acc, asProps, WrapperComponent, true),\n <OriginComponent {...asProps} />,\n );\n\n if (!WrapperComponent[STATIC_COMPONENT] && !isEmptyObject(ctx)) {\n return <Context.Provider value={{ ...asProps, ...ctx }}>{render}</Context.Provider>;\n } else {\n return render;\n }\n });\n Object.assign(Component, OriginComponent);\n const WrapperComponent = createForwardWrapper(Component, wrapperProps, statics, true);\n return WrapperComponent;\n}\n\nfunction wrapCore(OriginComponent, enhancements, Context) {\n const Component = function ({ Root }) {\n return <Root render={OriginComponent} />;\n };\n hoistNonReactStatics(Component, OriginComponent);\n Component.displayName = OriginComponent.displayName;\n Component.defaultProps = OriginComponent.defaultProps;\n return wrapFunction(Component, enhancements, Context);\n}\n\nfunction createComposeComponent(OriginComponent, Context, enhancements): any {\n if (\n React.PureComponent.isPrototypeOf(OriginComponent) ||\n React.Component.isPrototypeOf(OriginComponent)\n ) {\n if (OriginComponent.prototype instanceof Component) {\n return wrapClass(OriginComponent, enhancements, Context);\n } else {\n throw new Error('Must inherit from our component');\n }\n } else if (typeof OriginComponent === 'function') {\n return wrapFunction(OriginComponent, enhancements, Context);\n } else if (OriginComponent[CORE_COMPONENT]) {\n return wrapCore(OriginComponent, enhancements, Context);\n } else {\n throw new Error('Must be a React component');\n }\n}\n\nexport type PropsAndRef<T, Ctx, UCProps> = PropsWithRenderFnChildren<T, Ctx, UCProps> &\n RefAttributes<unknown>;\nexport type ForwardRefComponent<T, Ctx, UCProps> = ForwardRefExoticComponent<\n PropsAndRef<T, Ctx, UCProps>\n>;\ntype ComponentOrProps<T, Context, UCProps> = T extends [infer ParentProps, infer ChildProps]\n ? ComponentType<ParentProps, ChildProps, Context, UCProps>\n : ForwardRefComponent<T, Context, UCProps>;\n\nexport type ComponentType<\n ComponentProps,\n ChildComponentProps = {},\n ContextType = {},\n UCProps = {},\n FNType = null,\n> = (FNType extends null\n ? ForwardRefComponent<ComponentProps, ContextType, UCProps>\n : FNType & { displayName: string }) & {\n [K in keyof ChildComponentProps]: ComponentOrProps<ChildComponentProps[K], ContextType, UCProps>;\n} & {\n [CORE_COMPONENT]: boolean;\n [CREATE_COMPONENT]: () => ComponentType<\n ComponentProps,\n ChildComponentProps,\n ContextType,\n UCProps\n >;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ninterface ClassWithUncontrolledProps<Props> {\n uncontrolledProps(): unknown;\n}\n\nfunction assignProps(p1, p2) {\n return _assignProps(p2, p1);\n}\n\nfunction createComponent<ComponentProps, ChildComponentProps = {}, ContextType = {}, FNType = null>(\n OriginComponent,\n childComponents = {},\n options: {\n context?: React.Context<ContextType>;\n parent?: ComponentType<unknown> | ComponentType<unknown>[];\n enhancements?: [any];\n } = {},\n): ComponentType<\n ComponentProps extends Component<infer Props> ? Props : ComponentProps,\n ChildComponentProps,\n ContextType,\n ComponentProps extends ClassWithUncontrolledProps<any>\n ? ReturnType<ComponentProps['uncontrolledProps']>\n : { [key: string]: (arg: unknown) => void },\n FNType\n> {\n const {\n context = React.createContext<ContextType>({} as ContextType),\n parent = [],\n enhancements = [],\n } = options;\n let parents = Array.isArray(parent) ? parent : [parent];\n if (parents.length) {\n const wholeFamily = parents.reduce((acc, parent) => {\n if (parent[PARENT_COMPONENTS]) {\n acc = [...parent[PARENT_COMPONENTS], ...acc];\n }\n return acc;\n }, parents);\n OriginComponent[PARENT_COMPONENTS] = wholeFamily;\n parents = wholeFamily;\n }\n if (OriginComponent[CORE_COMPONENT]) {\n parents.push(OriginComponent);\n }\n const Component = createComposeComponent(OriginComponent, context, [\n // @ts-ignore\n ...enhancements.map((f) => f(context, parents, createComponent, childComponents)),\n bindHandlerEnhancement(),\n childrenEnhancement(context, parents),\n // root must be under the children\n rootEnhancement(),\n uncontrolledPropsEnhancement(),\n staticChildrenEnhancement(childComponents, createComponent, {\n context,\n parent,\n enhancements,\n }),\n // functionDefaultProps must be under the staticChild\n functionDefaultPropsEnhancement(),\n // inheritedName must be under the staticChild\n inheritedNameEnhancement(),\n // dataName must be under the staticChild\n dataNameEnhancement(),\n // enhanceEnhancement must be under the functionDefaultPropsEnhancement\n enhanceEnhancement(),\n styleEnhancement(childComponents, context),\n // must be the last one so any properties can be raised\n hoistPropsEnhancement(childComponents, context),\n ]);\n Component[CONTEXT_COMPONENT] = context;\n Component[CREATE_COMPONENT] = function (\n _OriginComponent = OriginComponent,\n _childComponents = childComponents,\n _options = options,\n ) {\n return createComponent(_OriginComponent, _childComponents, _options);\n };\n Component[CORE_COMPONENT] = true;\n return Component;\n}\n\nfunction createBaseComponent<ComponentProps>(OriginComponent): ComponentType<ComponentProps> {\n let Component = null;\n if (\n !React.PureComponent.isPrototypeOf(OriginComponent) &&\n !React.Component.isPrototypeOf(OriginComponent) &&\n typeof OriginComponent === 'function'\n ) {\n Component = React.forwardRef(OriginComponent);\n Component.displayName = OriginComponent.displayName;\n Component.defaultProps = {\n 'data-ui-name': OriginComponent.displayName,\n ...OriginComponent.defaultProps,\n };\n Component[CORE_COMPONENT] = true;\n } else {\n throw new Error('createBaseComponent accepts only functional component');\n }\n return Component;\n}\n\nexport * from './Component';\nexport * from './styled';\nexport * from './register';\nexport {\n createBaseComponent,\n register,\n CREATE_COMPONENT,\n CORE_INSTANCE,\n CONTEXT_COMPONENT,\n CHILDREN_COMPONENT,\n INHERITED_NAME,\n CORE_COMPONENT,\n STATIC_COMPONENT,\n ROOT_COMPONENT,\n assignProps,\n};\nexport default createComponent;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AA+XA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AA9XA;;AAgYA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AA9XA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AA+WA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AA7WA,IAAMA,cAAc,GAAGC,MAAM,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ImE,KAAJ,CAAU,uDAAV,CAAN;EACD;;EACD,OAAOjD,SAAP;AACD;;eAkBcyE,e"}
|
package/lib/cjs/styled/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -56,8 +56,4 @@ Object.keys(_sstyled).forEach(function (key) {
|
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
58
|
});
|
|
59
|
-
|
|
60
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
61
|
-
|
|
62
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
63
59
|
//# sourceMappingURL=index.js.map
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.sstyled = sstyled;
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
11
|
|
|
12
12
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
13
|
|
|
@@ -17,10 +17,7 @@ var _react = require("react");
|
|
|
17
17
|
|
|
18
18
|
var _core = require("@reshadow/core");
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
23
|
-
|
|
20
|
+
/* eslint-disable */
|
|
24
21
|
var RESHADOW_ID = '__reshadow__';
|
|
25
22
|
var isSSR = !(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
26
23
|
var serverMap = (0, _core.getStyles)().map;
|
|
@@ -176,7 +173,7 @@ function sstyled() {
|
|
|
176
173
|
extraProps.style = Object.assign(style, props.style);
|
|
177
174
|
}
|
|
178
175
|
|
|
179
|
-
return
|
|
176
|
+
return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, props), extraProps);
|
|
180
177
|
}
|
|
181
178
|
};
|
|
182
179
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sstyled.js","names":["RESHADOW_ID","isSSR","window","document","createElement","serverMap","reshadowGetStyles","map","getStyles","css","serverStyles","id","insert","code","hash","concat","container","getElementById","head","appendChild","addEventListener","type","innerHTML","merge","s1","s2","Object","entries","reduce","acc","key","value","startsWith","cn","assign","getClassAndVars","styles","name","props","getPropValue","substring","split","mod","modValue","propValue","undefined","Boolean","reshadowToShadow","obj","style","n","replace","sstyled","classes","extraProps","keys","length","className","Error","SHADOW_STYLES","Symbol"],"sources":["../../../src/styled/sstyled.tsx"],"sourcesContent":["/* eslint-disable */\nimport cn from 'classnames';\nimport { ReactNode } from 'react';\nimport { getStyles as reshadowGetStyles } from '@reshadow/core';\n\nconst RESHADOW_ID = '__reshadow__';\n\nconst isSSR = !(typeof window !== 'undefined' && window.document && window.document.createElement);\n\nconst serverMap = reshadowGetStyles().map;\n\nconst getStyles = () => ({\n map: serverMap,\n get css() {\n let serverStyles = '';\n for (const id in serverMap) {\n serverStyles += `<style type='text/css' id='${id}'>${serverMap[id]}</style>`;\n }\n return serverStyles;\n },\n});\n\nfunction insert(code, hash) {\n const id = 'reshadow-'.concat(hash);\n\n if (isSSR) {\n serverMap[id] = code;\n return;\n }\n\n let container = document.getElementById(RESHADOW_ID);\n\n if (!container) {\n container = document.createElement('object');\n container.id = RESHADOW_ID;\n\n if (document.head) {\n document.head.appendChild(container);\n } else {\n document.addEventListener('DOMContentLoaded', function () {\n document.head.appendChild(container);\n });\n }\n }\n\n let css = document.getElementById(id);\n\n if (!css) {\n css = document.createElement('style');\n css.id = id;\n // @ts-ignore\n css.type = 'text/css';\n container.appendChild(css);\n }\n\n css.innerHTML = code;\n}\n\nfunction merge(s1 = {}, s2 = {}) {\n return Object.entries(s2).reduce((acc, [key, value]) => {\n if (key.startsWith('@') || key.startsWith('--')) {\n acc[key] = value;\n } else {\n acc[key] = cn(acc[key], value);\n }\n return acc;\n }, Object.assign({}, s1));\n}\n\nfunction getClassAndVars(styles, name, props) {\n function getPropValue(key, props) {\n return props[`use:${key}`] ?? props[key];\n }\n\n return Object.entries(styles).reduce(\n (acc, [key, value]) => {\n if (key.startsWith('--')) {\n // @ts-ignore\n acc[1][value] = getPropValue(key.substring(2), props);\n } else if (name === key) {\n // @ts-ignore\n acc[0][value] = true;\n } else {\n const [mod, modValue] = key.split('=');\n const propValue = getPropValue(mod, props);\n if (modValue === undefined) {\n // @ts-ignore\n acc[0][value] = Boolean(propValue ?? false);\n } else {\n // @ts-ignore\n acc[0][value] = propValue == modValue;\n }\n }\n return acc;\n },\n [{}, {}],\n );\n}\n\nfunction reshadowToShadow(obj) {\n return Object.entries(obj).reduce((style, [name, value]) => {\n let n = name;\n if (name.startsWith('__')) {\n n = name.replace(/^__/, '');\n } else if (name.startsWith('_')) {\n n = name.replace(/^_/, '').replace('_', '=');\n }\n style[n] = value;\n return style;\n }, {});\n}\n\nfunction sstyled(\n styles = {},\n): ((ReactNode) => ReactNode) & {\n cn(name: string, props: any): any;\n} {\n // @ts-ignore\n return {\n cn(name, props) {\n const [classes, style] = getClassAndVars(reshadowToShadow(styles), name, props);\n const extraProps = {};\n\n if (Object.keys(classes).length) {\n // @ts-ignore\n extraProps.className = cn(props.className, classes);\n }\n\n if (Object.keys(style).length) {\n // @ts-ignore\n extraProps.style = Object.assign(style, props.style);\n }\n return {\n ...props,\n ...extraProps,\n };\n },\n };\n}\n\nsstyled.css = function (css): { [key: string]: string } {\n throw new Error('Enable babel plugin');\n};\nsstyled.insert = insert;\nsstyled.merge = merge;\nsstyled.getStyles = getStyles;\nsstyled.SHADOW_STYLES = Symbol('SHADOW_STYLES');\n\nexport { sstyled };\n/* eslint-enable */\n"],"mappings":";;;;;;;;;;;;;AACA;;AACA;;AACA
|
|
1
|
+
{"version":3,"file":"sstyled.js","names":["RESHADOW_ID","isSSR","window","document","createElement","serverMap","reshadowGetStyles","map","getStyles","css","serverStyles","id","insert","code","hash","concat","container","getElementById","head","appendChild","addEventListener","type","innerHTML","merge","s1","s2","Object","entries","reduce","acc","key","value","startsWith","cn","assign","getClassAndVars","styles","name","props","getPropValue","substring","split","mod","modValue","propValue","undefined","Boolean","reshadowToShadow","obj","style","n","replace","sstyled","classes","extraProps","keys","length","className","Error","SHADOW_STYLES","Symbol"],"sources":["../../../src/styled/sstyled.tsx"],"sourcesContent":["/* eslint-disable */\nimport cn from 'classnames';\nimport { ReactNode } from 'react';\nimport { getStyles as reshadowGetStyles } from '@reshadow/core';\n\nconst RESHADOW_ID = '__reshadow__';\n\nconst isSSR = !(typeof window !== 'undefined' && window.document && window.document.createElement);\n\nconst serverMap = reshadowGetStyles().map;\n\nconst getStyles = () => ({\n map: serverMap,\n get css() {\n let serverStyles = '';\n for (const id in serverMap) {\n serverStyles += `<style type='text/css' id='${id}'>${serverMap[id]}</style>`;\n }\n return serverStyles;\n },\n});\n\nfunction insert(code, hash) {\n const id = 'reshadow-'.concat(hash);\n\n if (isSSR) {\n serverMap[id] = code;\n return;\n }\n\n let container = document.getElementById(RESHADOW_ID);\n\n if (!container) {\n container = document.createElement('object');\n container.id = RESHADOW_ID;\n\n if (document.head) {\n document.head.appendChild(container);\n } else {\n document.addEventListener('DOMContentLoaded', function () {\n document.head.appendChild(container);\n });\n }\n }\n\n let css = document.getElementById(id);\n\n if (!css) {\n css = document.createElement('style');\n css.id = id;\n // @ts-ignore\n css.type = 'text/css';\n container.appendChild(css);\n }\n\n css.innerHTML = code;\n}\n\nfunction merge(s1 = {}, s2 = {}) {\n return Object.entries(s2).reduce((acc, [key, value]) => {\n if (key.startsWith('@') || key.startsWith('--')) {\n acc[key] = value;\n } else {\n acc[key] = cn(acc[key], value);\n }\n return acc;\n }, Object.assign({}, s1));\n}\n\nfunction getClassAndVars(styles, name, props) {\n function getPropValue(key, props) {\n return props[`use:${key}`] ?? props[key];\n }\n\n return Object.entries(styles).reduce(\n (acc, [key, value]) => {\n if (key.startsWith('--')) {\n // @ts-ignore\n acc[1][value] = getPropValue(key.substring(2), props);\n } else if (name === key) {\n // @ts-ignore\n acc[0][value] = true;\n } else {\n const [mod, modValue] = key.split('=');\n const propValue = getPropValue(mod, props);\n if (modValue === undefined) {\n // @ts-ignore\n acc[0][value] = Boolean(propValue ?? false);\n } else {\n // @ts-ignore\n acc[0][value] = propValue == modValue;\n }\n }\n return acc;\n },\n [{}, {}],\n );\n}\n\nfunction reshadowToShadow(obj) {\n return Object.entries(obj).reduce((style, [name, value]) => {\n let n = name;\n if (name.startsWith('__')) {\n n = name.replace(/^__/, '');\n } else if (name.startsWith('_')) {\n n = name.replace(/^_/, '').replace('_', '=');\n }\n style[n] = value;\n return style;\n }, {});\n}\n\nfunction sstyled(\n styles = {},\n): ((ReactNode) => ReactNode) & {\n cn(name: string, props: any): any;\n} {\n // @ts-ignore\n return {\n cn(name, props) {\n const [classes, style] = getClassAndVars(reshadowToShadow(styles), name, props);\n const extraProps = {};\n\n if (Object.keys(classes).length) {\n // @ts-ignore\n extraProps.className = cn(props.className, classes);\n }\n\n if (Object.keys(style).length) {\n // @ts-ignore\n extraProps.style = Object.assign(style, props.style);\n }\n return {\n ...props,\n ...extraProps,\n };\n },\n };\n}\n\nsstyled.css = function (css): { [key: string]: string } {\n throw new Error('Enable babel plugin');\n};\nsstyled.insert = insert;\nsstyled.merge = merge;\nsstyled.getStyles = getStyles;\nsstyled.SHADOW_STYLES = Symbol('SHADOW_STYLES');\n\nexport { sstyled };\n/* eslint-enable */\n"],"mappings":";;;;;;;;;;;;;AACA;;AACA;;AACA;;AAHA;AAKA,IAAMA,WAAW,GAAG,cAApB;AAEA,IAAMC,KAAK,GAAG,EAAE,OAAOC,MAAP,KAAkB,WAAlB,IAAiCA,MAAM,CAACC,QAAxC,IAAoDD,MAAM,CAACC,QAAP,CAAgBC,aAAtE,CAAd;AAEA,IAAMC,SAAS,GAAG,IAAAC,eAAA,IAAoBC,GAAtC;;AAEA,IAAMC,SAAS,GAAG,SAAZA,SAAY;EAAA,OAAO;IACvBD,GAAG,EAAEF,SADkB;;IAEvB,IAAII,GAAJ,GAAU;MACR,IAAIC,YAAY,GAAG,EAAnB;;MACA,KAAK,IAAMC,EAAX,IAAiBN,SAAjB,EAA4B;QAC1BK,YAAY,yCAAkCC,EAAlC,eAAyCN,SAAS,CAACM,EAAD,CAAlD,aAAZ;MACD;;MACD,OAAOD,YAAP;IACD;;EARsB,CAAP;AAAA,CAAlB;;AAWA,SAASE,MAAT,CAAgBC,IAAhB,EAAsBC,IAAtB,EAA4B;EAC1B,IAAMH,EAAE,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C/B;QACAF,UAAU,CAACG,SAAX,GAAuB,IAAAxB,sBAAA,EAAGK,KAAK,CAACmB,SAAT,EAAoBJ,OAApB,CAAvB;MACD;;MAED,IAAI3B,MAAM,CAAC6B,IAAP,CAAYN,KAAZ,EAAmBO,MAAvB,EAA+B;QAC7B;QACAF,UAAU,CAACL,KAAX,GAAmBvB,MAAM,CAACQ,MAAP,CAAce,KAAd,EAAqBX,KAAK,CAACW,KAA3B,CAAnB;MACD;;MACD,yEACKX,KADL,GAEKgB,UAFL;IAID;EAlBI,CAAP;AAoBD;;AAEDF,OAAO,CAAC3C,GAAR,GAAc,UAAUA,GAAV,EAA0C;EACtD,MAAM,IAAIiD,KAAJ,CAAU,qBAAV,CAAN;AACD,CAFD;;AAGAN,OAAO,CAACxC,MAAR,GAAiBA,MAAjB;AACAwC,OAAO,CAAC7B,KAAR,GAAgBA,KAAhB;AACA6B,OAAO,CAAC5C,SAAR,GAAoBA,SAApB;AACA4C,OAAO,CAACO,aAAR,GAAwBC,MAAM,CAAC,eAAD,CAA9B;AAGA"}
|
package/lib/es6/Component.js
CHANGED
|
@@ -2,14 +2,8 @@ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
3
|
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
4
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
|
-
import
|
|
6
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
|
+
import _createSuper from "@babel/runtime/helpers/createSuper";
|
|
7
6
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
|
|
9
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
-
|
|
11
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
|
-
|
|
13
7
|
import { PureComponent } from 'react';
|
|
14
8
|
|
|
15
9
|
var RootComponent = /*#__PURE__*/function (_PureComponent) {
|
package/lib/es6/Component.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","names":["PureComponent","RootComponent","Component"],"sources":["../../src/Component.tsx"],"sourcesContent":["import React, {\n AllHTMLAttributes,\n ForwardRefExoticComponent,\n PureComponent,\n ReactNode,\n RefObject,\n} from 'react';\nimport { IStyledProps } from './styled';\n\ntype KnownKeys<T> = {\n [K in keyof T]: string extends K ? never : number extends K ? never : K;\n} extends { [_ in keyof T]: infer U }\n ? U\n : never;\n\nexport type HandlersType<UCProps> = { [K in keyof UCProps]?: <T = unknown>(arg: T) => void };\nexport type ChildrenType<Props = {}, Ctx = {}, UCProps = {}> =\n | ((props: Props & Ctx, handlers: HandlersType<UCProps>) => ReactNode)\n | ReactNode;\n\nexport type RootComponentHandler = (...args: any[]) => void | false;\n\nexport interface IRootComponentHandlers {\n [key: string]: RootComponentHandler;\n}\n\nexport interface IRootComponentProps<Props = {}, Ctx = {}> {\n forwardRef?: RefObject<any>;\n Children?: any;\n children?: ChildrenType<Props, Ctx>;\n styles?: IStyledProps['styles'];\n}\n\nexport type IComponentProps<Props = {}, Ctx = {}> = Props & IRootComponentProps<Props, Ctx>;\n\nexport type IFunctionProps<Props = {}, Ctx = {}> = IComponentProps<Props, Ctx> &\n Omit<AllHTMLAttributes<any>, keyof IComponentProps<Props, Ctx>> & { Root?: Root };\n\nexport type PropsWithRenderFnChildren<Props = {}, Ctx = {}, UCProps = {}> = Omit<\n Pick<Props, KnownKeys<Props>>,\n 'children'\n> & {\n children?: ChildrenType<Props, Ctx, UCProps>;\n [key: string]: unknown;\n};\n\nexport type CProps<Props, Ctx = {}, UCProps = {}> = Props & {\n children?: ((props: Props & Ctx, handlers: UCProps) => React.ReactNode) | React.ReactNode;\n};\nexport type ReturnEl = React.ReactElement | null;\n\nexport interface IRootNodeProps {\n render: React.ElementType | string;\n tag?: React.ElementType | string;\n\n [key: string]: any;\n}\n\ntype Root = ForwardRefExoticComponent<IRootNodeProps>;\n\n/**\n * @deprecated since version ^1.8.0\n */\nexport type PropGetter<T extends (...args: any) => any> = <P>(props?: P) => ReturnType<T> & P;\n/**\n * @deprecated since version ^1.8.0\n */\nexport type PropGetterReturn<T extends (...args: any) => any> = Partial<ReturnType<T>>;\nexport type PropGetterFn = <T extends {}>(props?: T) => T & { [key: string]: unknown };\nexport type Merge<Props, HTMLProps> = Props & Omit<HTMLProps, keyof Props>;\nexport type MergeGetters<G1 extends (...args: any) => any, G2 extends (...args: any) => any> = <P>(\n props?: P,\n) => Merge<ReturnType<G1>, ReturnType<G2>> & P;\n\ndeclare const Root: Root;\n\nexport { Root };\n\nabstract class RootComponent<Props = {}, Context = {}, State = {}> extends PureComponent<\n Props & IRootComponentProps<Props, Context>,\n State\n> {\n get handlers(): Readonly<IRootComponentHandlers> {\n return {};\n }\n\n get asProps() {\n return {} as Readonly<\n Merge<Props & IRootComponentProps<Props, Context>, AllHTMLAttributes<any>>\n >;\n }\n\n Root: Root;\n}\n\nexport const Component = RootComponent;\nexport type Component<\n Props = {},\n Context = {},\n State = {},\n Handlers extends IRootComponentHandlers = IRootComponentHandlers,\n> = React.ComponentClass<Props, State> & {\n handlers: Readonly<Handlers>;\n\n asProps: Readonly<Merge<Props & IRootComponentProps<Props, Context>, AllHTMLAttributes<any>>>;\n\n Root: Root;\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Component.js","names":["PureComponent","RootComponent","Component"],"sources":["../../src/Component.tsx"],"sourcesContent":["import React, {\n AllHTMLAttributes,\n ForwardRefExoticComponent,\n PureComponent,\n ReactNode,\n RefObject,\n} from 'react';\nimport { IStyledProps } from './styled';\n\ntype KnownKeys<T> = {\n [K in keyof T]: string extends K ? never : number extends K ? never : K;\n} extends { [_ in keyof T]: infer U }\n ? U\n : never;\n\nexport type HandlersType<UCProps> = { [K in keyof UCProps]?: <T = unknown>(arg: T) => void };\nexport type ChildrenType<Props = {}, Ctx = {}, UCProps = {}> =\n | ((props: Props & Ctx, handlers: HandlersType<UCProps>) => ReactNode)\n | ReactNode;\n\nexport type RootComponentHandler = (...args: any[]) => void | false;\n\nexport interface IRootComponentHandlers {\n [key: string]: RootComponentHandler;\n}\n\nexport interface IRootComponentProps<Props = {}, Ctx = {}> {\n forwardRef?: RefObject<any>;\n Children?: any;\n children?: ChildrenType<Props, Ctx>;\n styles?: IStyledProps['styles'];\n}\n\nexport type IComponentProps<Props = {}, Ctx = {}> = Props & IRootComponentProps<Props, Ctx>;\n\nexport type IFunctionProps<Props = {}, Ctx = {}> = IComponentProps<Props, Ctx> &\n Omit<AllHTMLAttributes<any>, keyof IComponentProps<Props, Ctx>> & { Root?: Root };\n\nexport type PropsWithRenderFnChildren<Props = {}, Ctx = {}, UCProps = {}> = Omit<\n Pick<Props, KnownKeys<Props>>,\n 'children'\n> & {\n children?: ChildrenType<Props, Ctx, UCProps>;\n [key: string]: unknown;\n};\n\nexport type CProps<Props, Ctx = {}, UCProps = {}> = Props & {\n children?: ((props: Props & Ctx, handlers: UCProps) => React.ReactNode) | React.ReactNode;\n};\nexport type ReturnEl = React.ReactElement | null;\n\nexport interface IRootNodeProps {\n render: React.ElementType | string;\n tag?: React.ElementType | string;\n\n [key: string]: any;\n}\n\ntype Root = ForwardRefExoticComponent<IRootNodeProps>;\n\n/**\n * @deprecated since version ^1.8.0\n */\nexport type PropGetter<T extends (...args: any) => any> = <P>(props?: P) => ReturnType<T> & P;\n/**\n * @deprecated since version ^1.8.0\n */\nexport type PropGetterReturn<T extends (...args: any) => any> = Partial<ReturnType<T>>;\nexport type PropGetterFn = <T extends {}>(props?: T) => T & { [key: string]: unknown };\nexport type Merge<Props, HTMLProps> = Props & Omit<HTMLProps, keyof Props>;\nexport type MergeGetters<G1 extends (...args: any) => any, G2 extends (...args: any) => any> = <P>(\n props?: P,\n) => Merge<ReturnType<G1>, ReturnType<G2>> & P;\n\ndeclare const Root: Root;\n\nexport { Root };\n\nabstract class RootComponent<Props = {}, Context = {}, State = {}> extends PureComponent<\n Props & IRootComponentProps<Props, Context>,\n State\n> {\n get handlers(): Readonly<IRootComponentHandlers> {\n return {};\n }\n\n get asProps() {\n return {} as Readonly<\n Merge<Props & IRootComponentProps<Props, Context>, AllHTMLAttributes<any>>\n >;\n }\n\n Root: Root;\n}\n\nexport const Component = RootComponent;\nexport type Component<\n Props = {},\n Context = {},\n State = {},\n Handlers extends IRootComponentHandlers = IRootComponentHandlers,\n> = React.ComponentClass<Props, State> & {\n handlers: Readonly<Handlers>;\n\n asProps: Readonly<Merge<Props & IRootComponentProps<Props, Context>, AllHTMLAttributes<any>>>;\n\n Root: Root;\n};\n"],"mappings":";;;;;;AAAA,SAGEA,aAHF,QAMO,OANP;;IA8EeC,a;;;;;;;;;;;;;;;;;;;;;;;SAIb,eAAiD;MAC/C,OAAO,EAAP;IACD;;;SAED,eAAc;MACZ,OAAO,EAAP;IAGD;;;;EAZwED,a;;AAiB3E,OAAO,IAAME,SAAS,GAAGD,aAAlB"}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
2
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
|
-
import
|
|
3
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
4
4
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
5
5
|
var _excluded = ["handlers", "getters"],
|
|
6
6
|
_excluded2 = ["handlers"];
|
|
7
|
-
|
|
8
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9
|
-
|
|
10
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11
|
-
|
|
12
7
|
import { useContext } from 'react';
|
|
13
8
|
import { CONTEXT_COMPONENT } from '../index';
|
|
14
9
|
export var CHILDREN_COMPONENT = Symbol('CHILDREN_COMPONENT');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Children.js","names":["useContext","CONTEXT_COMPONENT","CHILDREN_COMPONENT","Symbol","CHILDREN_SELF","GETTER_REG","splitPropsAndGetters","props","Object","entries","reduce","acc","key","value","exec","getters","getterToArray","getter","Array","isArray","mergeObjects","a","b","core","keys","assignGettersChain","createChildren","Context","contexts","Children","children","origin","ctx","handlers","propsAndGetters","assign","mergedGetters","undefined","Enhancement","parent","init","map","component","filter","Boolean","asProps"],"sources":["../../../src/enhancement/Children.tsx"],"sourcesContent":["import { useContext } from 'react';\nimport { CONTEXT_COMPONENT } from '../index';\n\nexport const CHILDREN_COMPONENT = Symbol('CHILDREN_COMPONENT');\nconst CHILDREN_SELF = Symbol('CHILDREN_SELF');\n\nconst GETTER_REG = /^get[\\w]+Props$/;\n\nfunction splitPropsAndGetters(props) {\n return Object.entries(props).reduce(\n (acc, [key, value]) => {\n if (GETTER_REG.exec(key) === null) {\n acc.props[key] = value;\n } else {\n acc.getters[key] = value;\n }\n return acc;\n },\n { props: {}, getters: {} },\n );\n}\n\nfunction getterToArray(getter) {\n if (!Array.isArray(getter)) {\n return typeof getter === 'function' ? [getter] : [];\n }\n return getter;\n}\n\nfunction mergeObjects(a = {}, b = {}) {\n const core = { ...a, ...b };\n return Object.keys(core).reduce((acc, key) => {\n a[key] = getterToArray(a[key]);\n b[key] = getterToArray(b[key]);\n acc[key] = [...a[key], ...b[key]];\n return acc;\n }, {});\n}\n\nfunction assignGettersChain(getters: Array<Function>) {\n return function (props = {}) {\n return getters.reduce((acc, getter) => {\n return getter(acc);\n }, props);\n };\n}\n\nfunction createChildren(Context, contexts) {\n const Children = function () {\n const children = Children.origin;\n if (typeof children === 'function') {\n const {\n handlers = {},\n getters = {},\n ...props\n } = [...contexts, Context].reduce((acc, ctx) => {\n const { handlers, ...propsAndGetters } = useContext(ctx);\n const { props, getters } = splitPropsAndGetters(propsAndGetters);\n return Object.assign({}, acc, {\n handlers: Object.assign({}, acc.handlers, handlers),\n getters: mergeObjects(acc.getters, getters),\n ...props,\n });\n }, Children.props);\n\n const mergedGetters = Object.entries(getters).reduce((acc, [key, value]) => {\n acc[key] = assignGettersChain(value as []);\n return acc;\n }, {});\n\n return children({ ...props, ...mergedGetters }, handlers);\n } else if (children === undefined) {\n return null;\n }\n return children;\n };\n Children.origin = null;\n Children.props = {};\n Children[CHILDREN_COMPONENT] = true;\n return Children;\n}\n\nfunction Enhancement(Context, parent) {\n return {\n init: function () {\n const contexts = (Array.isArray(parent) ? parent : [parent])\n .map((component) => component[CONTEXT_COMPONENT])\n .filter(Boolean);\n this[CHILDREN_SELF] = createChildren(Context, contexts);\n },\n asProps: function (props) {\n // TODO: learn the reason what it was used for (by lsroman)\n // this[CHILDREN_SELF].origin = _Children ? _Children.origin : children;\n this[CHILDREN_SELF].origin = props.children;\n this[CHILDREN_SELF].props = props;\n return {\n ...props,\n Children: this[CHILDREN_SELF],\n };\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Children.js","names":["useContext","CONTEXT_COMPONENT","CHILDREN_COMPONENT","Symbol","CHILDREN_SELF","GETTER_REG","splitPropsAndGetters","props","Object","entries","reduce","acc","key","value","exec","getters","getterToArray","getter","Array","isArray","mergeObjects","a","b","core","keys","assignGettersChain","createChildren","Context","contexts","Children","children","origin","ctx","handlers","propsAndGetters","assign","mergedGetters","undefined","Enhancement","parent","init","map","component","filter","Boolean","asProps"],"sources":["../../../src/enhancement/Children.tsx"],"sourcesContent":["import { useContext } from 'react';\nimport { CONTEXT_COMPONENT } from '../index';\n\nexport const CHILDREN_COMPONENT = Symbol('CHILDREN_COMPONENT');\nconst CHILDREN_SELF = Symbol('CHILDREN_SELF');\n\nconst GETTER_REG = /^get[\\w]+Props$/;\n\nfunction splitPropsAndGetters(props) {\n return Object.entries(props).reduce(\n (acc, [key, value]) => {\n if (GETTER_REG.exec(key) === null) {\n acc.props[key] = value;\n } else {\n acc.getters[key] = value;\n }\n return acc;\n },\n { props: {}, getters: {} },\n );\n}\n\nfunction getterToArray(getter) {\n if (!Array.isArray(getter)) {\n return typeof getter === 'function' ? [getter] : [];\n }\n return getter;\n}\n\nfunction mergeObjects(a = {}, b = {}) {\n const core = { ...a, ...b };\n return Object.keys(core).reduce((acc, key) => {\n a[key] = getterToArray(a[key]);\n b[key] = getterToArray(b[key]);\n acc[key] = [...a[key], ...b[key]];\n return acc;\n }, {});\n}\n\nfunction assignGettersChain(getters: Array<Function>) {\n return function (props = {}) {\n return getters.reduce((acc, getter) => {\n return getter(acc);\n }, props);\n };\n}\n\nfunction createChildren(Context, contexts) {\n const Children = function () {\n const children = Children.origin;\n if (typeof children === 'function') {\n const {\n handlers = {},\n getters = {},\n ...props\n } = [...contexts, Context].reduce((acc, ctx) => {\n const { handlers, ...propsAndGetters } = useContext(ctx);\n const { props, getters } = splitPropsAndGetters(propsAndGetters);\n return Object.assign({}, acc, {\n handlers: Object.assign({}, acc.handlers, handlers),\n getters: mergeObjects(acc.getters, getters),\n ...props,\n });\n }, Children.props);\n\n const mergedGetters = Object.entries(getters).reduce((acc, [key, value]) => {\n acc[key] = assignGettersChain(value as []);\n return acc;\n }, {});\n\n return children({ ...props, ...mergedGetters }, handlers);\n } else if (children === undefined) {\n return null;\n }\n return children;\n };\n Children.origin = null;\n Children.props = {};\n Children[CHILDREN_COMPONENT] = true;\n return Children;\n}\n\nfunction Enhancement(Context, parent) {\n return {\n init: function () {\n const contexts = (Array.isArray(parent) ? parent : [parent])\n .map((component) => component[CONTEXT_COMPONENT])\n .filter(Boolean);\n this[CHILDREN_SELF] = createChildren(Context, contexts);\n },\n asProps: function (props) {\n // TODO: learn the reason what it was used for (by lsroman)\n // this[CHILDREN_SELF].origin = _Children ? _Children.origin : children;\n this[CHILDREN_SELF].origin = props.children;\n this[CHILDREN_SELF].props = props;\n return {\n ...props,\n Children: this[CHILDREN_SELF],\n };\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;AAAA,SAASA,UAAT,QAA2B,OAA3B;AACA,SAASC,iBAAT,QAAkC,UAAlC;AAEA,OAAO,IAAMC,kBAAkB,GAAGC,MAAM,CAAC,oBAAD,CAAjC;AACP,IAAMC,aAAa,GAAGD,MAAM,CAAC,eAAD,CAA5B;AAEA,IAAME,UAAU,GAAG,iBAAnB;;AAEA,SAASC,oBAAT,CAA8BC,KAA9B,EAAqC;EACnC,OAAOC,MAAM,CAACC,OAAP,CAAeF,KAAf,EAAsBG,MAAtB,CACL,UAACC,GAAD,QAAuB;IAAA;IAAA,IAAhBC,GAAgB;IAAA,IAAXC,KAAW;;IACrB,IAAIR,UAAU,CAACS,IAAX,CAAgBF,GAAhB,MAAyB,IAA7B,EAAmC;MACjCD,GAAG,CAACJ,KAAJ,CAAUK,GAAV,IAAiBC,KAAjB;IACD,CAFD,MAEO;MACLF,GAAG,CAACI,OAAJ,CAAYH,GAAZ,IAAmBC,KAAnB;IACD;;IACD,OAAOF,GAAP;EACD,CARI,EASL;IAAEJ,KAAK,EAAE,E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CA3BD;;EA4BAD,QAAQ,CAACE,MAAT,GAAkB,IAAlB;EACAF,QAAQ,CAACtB,KAAT,GAAiB,EAAjB;EACAsB,QAAQ,CAAC3B,kBAAD,CAAR,GAA+B,IAA/B;EACA,OAAO2B,QAAP;AACD;;AAED,SAASS,WAAT,CAAqBX,OAArB,EAA8BY,MAA9B,EAAsC;EACpC,OAAO;IACLC,IAAI,EAAE,gBAAY;MAChB,IAAMZ,QAAQ,GAAG,CAACV,KAAK,CAACC,OAAN,CAAcoB,MAAd,IAAwBA,MAAxB,GAAiC,CAACA,MAAD,CAAlC,EACdE,GADc,CACV,UAACC,SAAD;QAAA,OAAeA,SAAS,CAACzC,iBAAD,CAAxB;MAAA,CADU,EAEd0C,MAFc,CAEPC,OAFO,CAAjB;MAGA,KAAKxC,aAAL,IAAsBsB,cAAc,CAACC,OAAD,EAAUC,QAAV,CAApC;IACD,CANI;IAOLiB,OAAO,EAAE,iBAAUtC,KAAV,EAAiB;MACxB;MACA;MACA,KAAKH,aAAL,EAAoB2B,MAApB,GAA6BxB,KAAK,CAACuB,QAAnC;MACA,KAAK1B,aAAL,EAAoBG,KAApB,GAA4BA,KAA5B;MACA,uCACKA,KADL;QAEEsB,QAAQ,EAAE,KAAKzB,aAAL;MAFZ;IAID;EAhBI,CAAP;AAkBD;;AAED,eAAekC,WAAf"}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
4
|
var _excluded = ["render"],
|
|
5
5
|
_excluded2 = ["Root", "styles", "children", "Children", "forwardRef"];
|
|
6
|
-
|
|
7
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8
|
-
|
|
9
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10
|
-
|
|
11
6
|
import React from 'react'; // @ts-ignore
|
|
12
7
|
|
|
13
8
|
import assignProps from '@semcore/utils/lib/assignProps'; // @ts-ignore
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Root.js","names":["React","assignProps","useForkRef","createRootRender","Root","forwardRef","ref","Tag","render","source","props","_Root","styles","children","Children","clearProps","Object","entries","reduce","name","value","undefined","child","origin","other","Error","Enhancement","init","asProps","WrapperComponent","isFunction"],"sources":["../../../src/enhancement/Root.tsx"],"sourcesContent":["import React from 'react';\n// @ts-ignore\nimport assignProps from '@semcore/utils/lib/assignProps';\n// @ts-ignore\nimport { useForkRef } from '@semcore/utils/lib/ref';\n\nfunction createRootRender() {\n // @ts-ignore\n const Root = React.forwardRef(function ({ render: Tag, ...source }, ref) {\n const {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n Root: _Root,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n styles,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n children,\n Children,\n forwardRef = null,\n ...props\n // @ts-ignore\n } = Root.props;\n\n const clearProps = Object.entries(props).reduce((props, [name, value]) => {\n if (value !== undefined) {\n props[name] = value;\n }\n return props;\n }, {});\n\n const child = {};\n // TODO: need to find better check solution (by lsroman)\n if (typeof Children.origin !== 'undefined') {\n // @ts-ignore\n child.children = <Children />;\n }\n\n const other = assignProps(\n {\n ...clearProps,\n ref: useForkRef(forwardRef, ref),\n },\n {\n ...child,\n ...source,\n },\n );\n if (!Tag) {\n throw new Error('`render` prop of Root is not provided');\n }\n return <Tag {...other} />;\n });\n // @ts-ignore\n Root.props = {};\n return Root;\n}\n\nfunction Enhancement() {\n return {\n init: function () {\n this.Root = createRootRender();\n },\n asProps: function (props, WrapperComponent, isFunction) {\n if (isFunction) {\n return {\n ...props,\n Root: this.Root,\n };\n }\n return props;\n },\n render: function (render, props) {\n this.Root.props = props;\n return render;\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Root.js","names":["React","assignProps","useForkRef","createRootRender","Root","forwardRef","ref","Tag","render","source","props","_Root","styles","children","Children","clearProps","Object","entries","reduce","name","value","undefined","child","origin","other","Error","Enhancement","init","asProps","WrapperComponent","isFunction"],"sources":["../../../src/enhancement/Root.tsx"],"sourcesContent":["import React from 'react';\n// @ts-ignore\nimport assignProps from '@semcore/utils/lib/assignProps';\n// @ts-ignore\nimport { useForkRef } from '@semcore/utils/lib/ref';\n\nfunction createRootRender() {\n // @ts-ignore\n const Root = React.forwardRef(function ({ render: Tag, ...source }, ref) {\n const {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n Root: _Root,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n styles,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n children,\n Children,\n forwardRef = null,\n ...props\n // @ts-ignore\n } = Root.props;\n\n const clearProps = Object.entries(props).reduce((props, [name, value]) => {\n if (value !== undefined) {\n props[name] = value;\n }\n return props;\n }, {});\n\n const child = {};\n // TODO: need to find better check solution (by lsroman)\n if (typeof Children.origin !== 'undefined') {\n // @ts-ignore\n child.children = <Children />;\n }\n\n const other = assignProps(\n {\n ...clearProps,\n ref: useForkRef(forwardRef, ref),\n },\n {\n ...child,\n ...source,\n },\n );\n if (!Tag) {\n throw new Error('`render` prop of Root is not provided');\n }\n return <Tag {...other} />;\n });\n // @ts-ignore\n Root.props = {};\n return Root;\n}\n\nfunction Enhancement() {\n return {\n init: function () {\n this.Root = createRootRender();\n },\n asProps: function (props, WrapperComponent, isFunction) {\n if (isFunction) {\n return {\n ...props,\n Root: this.Root,\n };\n }\n return props;\n },\n render: function (render, props) {\n this.Root.props = props;\n return render;\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB,C,CACA;;AACA,OAAOC,WAAP,MAAwB,gCAAxB,C,CACA;;AACA,SAASC,UAAT,QAA2B,wBAA3B;;AAEA,SAASC,gBAAT,GAA4B;EAC1B;EACA,IAAMC,IAAI,gBAAGJ,KAAK,CAACK,UAAN,CAAiB,gBAAsCC,GAAtC,EAA2C;IAAA,IAAvBC,GAAuB,QAA/BC,MAA+B;IAAA,IAAfC,MAAe;;IACvE,kBAWIL,IAAI,CAACM,KAXT;IAAA,IAEQC,KAFR,eAEEP,IAFF;IAAA,IAIEQ,MAJF,eAIEA,MAJF;IAAA,IAMEC,QANF,eAMEA,QANF;IAAA,IAOEC,QAPF,eAOEA,QAPF;IAAA,wCAQET,UARF;IAAA,IAQEA,UARF,sCAQe,IARf;IAAA,IASKK,KATL;;IAaA,IAAMK,UAAU,GAAGC,MAAM,CAACC,OAAP,CAAeP,KAAf,EAAsBQ,MAAtB,CAA6B,UAACR,KAAD,SAA0B;MAAA;MAAA,IAAjBS,IAAiB;MAAA,IAAXC,KAAW;;MACxE,IAAIA,KAAK,KAAKC,SAAd,EAAyB;QACvBX,KAAK,CAACS,IAAD,CAAL,GAAcC,KAAd;MACD;;MACD,OAAOV,KAAP;IACD,CALkB,EAKhB,EALgB,CAAnB;IAOA,IAAMY,KAAK,GAAG,EAAd,CArBuE,CAsBvE;;IACA,IAAI,OAAOR,QAAQ,CAACS,MAAhB,KAA2B,WAA/B,EAA4C;MAC1C;MACAD,KAAK,CAACT,QAAN,gBAAiB,oBAAC,QAAD,OAAjB;IACD;;IAED,IAAMW,KAAK,GAAGvB,WAAW,iCAElBc,UAFkB;MAGrBT,GAAG,EAAEJ,UAAU,CAACG,UAAD,EAAaC,GAAb;IAHM,oCAMlBgB,KANkB,GAOlBb,MAPkB,EAAzB;;IAUA,IAAI,CAACF,GAAL,EAAU;MACR,MAAM,IAAIkB,KAAJ,CAAU,uCAAV,CAAN;IACD;;IACD,oBAAO,oBAAC,GAAD,EAASD,KAAT,CAAP;EACD,CA1CY,CAAb,CAF0B,CA6C1B;;EACApB,IAAI,CAACM,KAAL,GAAa,EAAb;EACA,OAAON,IAAP;AACD;;AAED,SAASsB,WAAT,GAAuB;EACrB,OAAO;IACLC,IAAI,EAAE,gBAAY;MAChB,KAAKvB,IAAL,GAAYD,gBAAgB,EAA5B;IACD,CAHI;IAILyB,OAAO,EAAE,iBAAUlB,KAAV,EAAiBmB,gBAAjB,EAAmCC,UAAnC,EAA+C;MACtD,IAAIA,UAAJ,EAAgB;QACd,uCACKpB,KADL;UAEEN,IAAI,EAAE,KAAKA;QAFb;MAID;;MACD,OAAOM,KAAP;IACD,CAZI;IAaLF,MAAM,EAAE,gBAAUA,OAAV,EAAkBE,KAAlB,EAAyB;MAC/B,KAAKN,IAAL,CAAUM,KAAV,GAAkBA,KAAlB;MACA,OAAOF,OAAP;IACD;EAhBI,CAAP;AAkBD;;AAED,eAAekB,WAAf"}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
|
|
5
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
6
2
|
|
|
7
3
|
function Enhancement() {
|
|
8
4
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataName.js","names":["Enhancement","wrapperProps","props","WrapperComponent","displayName"],"sources":["../../../src/enhancement/dataName.tsx"],"sourcesContent":["function Enhancement() {\n return {\n wrapperProps: function (props, WrapperComponent) {\n return {\n 'data-ui-name': WrapperComponent.displayName,\n ...props,\n };\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"dataName.js","names":["Enhancement","wrapperProps","props","WrapperComponent","displayName"],"sources":["../../../src/enhancement/dataName.tsx"],"sourcesContent":["function Enhancement() {\n return {\n wrapperProps: function (props, WrapperComponent) {\n return {\n 'data-ui-name': WrapperComponent.displayName,\n ...props,\n };\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;AAAA,SAASA,WAAT,GAAuB;EACrB,OAAO;IACLC,YAAY,EAAE,sBAAUC,KAAV,EAAiBC,gBAAjB,EAAmC;MAC/C;QACE,gBAAgBA,gBAAgB,CAACC;MADnC,GAEKF,KAFL;IAID;EANI,CAAP;AAQD;;AAED,eAAeF,WAAf"}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
3
4
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
4
|
-
|
|
5
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
|
-
|
|
7
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8
|
-
|
|
9
5
|
import { useContext, useState } from 'react'; // @ts-ignore
|
|
10
6
|
|
|
11
7
|
import assignProps from '@semcore/utils/lib/assignProps'; // @ts-ignore
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hoistProps.js","names":["useContext","useState","assignProps","useEnhancedEffect","pick","HOIST_CONTEXT","Symbol","HOIST_SELF","HOIST_SET","flatChildComponent","childComponents","Object","values","reduce","acc","Component","Array","isArray","push","Enhancement","Context","condition","some","Boolean","hoistProps","length","init","props","WrapperComponent","isFunction","obj","forceUpdate","context","asProps","wrapperProps","renameProps","propName","split","name","rename","entries","keys","value"],"sources":["../../../src/enhancement/hoistProps.tsx"],"sourcesContent":["import { useContext, useState } from 'react';\n// @ts-ignore\nimport assignProps from '@semcore/utils/lib/assignProps';\n// @ts-ignore\nimport useEnhancedEffect from '@semcore/utils/lib/use/useEnhancedEffect';\n// @ts-ignore\nimport pick from '@semcore/utils/lib/pick';\n\nexport const HOIST_CONTEXT = Symbol('HOIST_CONTEXT');\nconst HOIST_SELF = Symbol('HOIST_SELF');\nconst HOIST_SET = Symbol('HOIST_SET');\n\nfunction flatChildComponent(childComponents) {\n return Object.values(childComponents).reduce<unknown[]>((acc, Component) => {\n if (Array.isArray(Component)) {\n acc = [...acc, Component[0], ...flatChildComponent(Component[1])];\n } else {\n acc.push(Component);\n }\n return acc;\n }, []);\n}\n\nfunction Enhancement(childComponents, Context) {\n return {\n condition: function (Component) {\n return [Component, ...flatChildComponent(childComponents)].some((Component) =>\n Boolean(Component.hoistProps && Component.hoistProps.length),\n );\n },\n init: function (props, WrapperComponent, isFunction) {\n if (isFunction) {\n // TODO: might breake rules of hooks (by lsroman)\n this[HOIST_SELF] = useState({});\n } else {\n this[HOIST_SELF] = [\n {},\n (obj) => {\n this[HOIST_SELF][0] = obj;\n this.forceUpdate();\n },\n ];\n }\n // For optimization render\n this[HOIST_SET] = (obj) => {\n this[HOIST_SELF][1](obj);\n };\n },\n context: function (context) {\n // TODO: need to optimizte container initialization (by lsroman)\n // WrapperComponent.hoistProps\n return {\n ...context,\n [HOIST_CONTEXT]: this[HOIST_SET],\n };\n },\n asProps: function (props) {\n // TODO: need to check for no props overwriting (by lsroman)\n return assignProps(this[HOIST_SELF][0], props);\n },\n wrapperProps: function (props, WrapperComponent) {\n if (WrapperComponent.hoistProps && WrapperComponent.hoistProps.length) {\n const context = useContext(Context);\n const renameProps = WrapperComponent.hoistProps.reduce((acc, propName) => {\n const [name, rename] = propName.split(':');\n acc[name] = rename || name;\n return acc;\n }, {});\n const hoistProps = Object.entries(pick(props, Object.keys(renameProps))).reduce(\n (acc, [name, value]) => {\n acc[renameProps[name]] = value;\n return acc;\n },\n {},\n );\n\n useEnhancedEffect(() => {\n if (context[HOIST_CONTEXT]) {\n context[HOIST_CONTEXT](hoistProps);\n }\n }, Object.values(hoistProps));\n }\n return props;\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"hoistProps.js","names":["useContext","useState","assignProps","useEnhancedEffect","pick","HOIST_CONTEXT","Symbol","HOIST_SELF","HOIST_SET","flatChildComponent","childComponents","Object","values","reduce","acc","Component","Array","isArray","push","Enhancement","Context","condition","some","Boolean","hoistProps","length","init","props","WrapperComponent","isFunction","obj","forceUpdate","context","asProps","wrapperProps","renameProps","propName","split","name","rename","entries","keys","value"],"sources":["../../../src/enhancement/hoistProps.tsx"],"sourcesContent":["import { useContext, useState } from 'react';\n// @ts-ignore\nimport assignProps from '@semcore/utils/lib/assignProps';\n// @ts-ignore\nimport useEnhancedEffect from '@semcore/utils/lib/use/useEnhancedEffect';\n// @ts-ignore\nimport pick from '@semcore/utils/lib/pick';\n\nexport const HOIST_CONTEXT = Symbol('HOIST_CONTEXT');\nconst HOIST_SELF = Symbol('HOIST_SELF');\nconst HOIST_SET = Symbol('HOIST_SET');\n\nfunction flatChildComponent(childComponents) {\n return Object.values(childComponents).reduce<unknown[]>((acc, Component) => {\n if (Array.isArray(Component)) {\n acc = [...acc, Component[0], ...flatChildComponent(Component[1])];\n } else {\n acc.push(Component);\n }\n return acc;\n }, []);\n}\n\nfunction Enhancement(childComponents, Context) {\n return {\n condition: function (Component) {\n return [Component, ...flatChildComponent(childComponents)].some((Component) =>\n Boolean(Component.hoistProps && Component.hoistProps.length),\n );\n },\n init: function (props, WrapperComponent, isFunction) {\n if (isFunction) {\n // TODO: might breake rules of hooks (by lsroman)\n this[HOIST_SELF] = useState({});\n } else {\n this[HOIST_SELF] = [\n {},\n (obj) => {\n this[HOIST_SELF][0] = obj;\n this.forceUpdate();\n },\n ];\n }\n // For optimization render\n this[HOIST_SET] = (obj) => {\n this[HOIST_SELF][1](obj);\n };\n },\n context: function (context) {\n // TODO: need to optimizte container initialization (by lsroman)\n // WrapperComponent.hoistProps\n return {\n ...context,\n [HOIST_CONTEXT]: this[HOIST_SET],\n };\n },\n asProps: function (props) {\n // TODO: need to check for no props overwriting (by lsroman)\n return assignProps(this[HOIST_SELF][0], props);\n },\n wrapperProps: function (props, WrapperComponent) {\n if (WrapperComponent.hoistProps && WrapperComponent.hoistProps.length) {\n const context = useContext(Context);\n const renameProps = WrapperComponent.hoistProps.reduce((acc, propName) => {\n const [name, rename] = propName.split(':');\n acc[name] = rename || name;\n return acc;\n }, {});\n const hoistProps = Object.entries(pick(props, Object.keys(renameProps))).reduce(\n (acc, [name, value]) => {\n acc[renameProps[name]] = value;\n return acc;\n },\n {},\n );\n\n useEnhancedEffect(() => {\n if (context[HOIST_CONTEXT]) {\n context[HOIST_CONTEXT](hoistProps);\n }\n }, Object.values(hoistProps));\n }\n return props;\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;AAAA,SAASA,UAAT,EAAqBC,QAArB,QAAqC,OAArC,C,CACA;;AACA,OAAOC,WAAP,MAAwB,gCAAxB,C,CACA;;AACA,OAAOC,iBAAP,MAA8B,0CAA9B,C,CACA;;AACA,OAAOC,IAAP,MAAiB,yBAAjB;AAEA,OAAO,IAAMC,aAAa,GAAGC,MAAM,CAAC,eAAD,CAA5B;AACP,IAAMC,UAAU,GAAGD,MAAM,CAAC,YAAD,CAAzB;AACA,IAAME,SAAS,GAAGF,MAAM,CAAC,WAAD,CAAxB;;AAEA,SAASG,kBAAT,CAA4BC,eAA5B,EAA6C;EAC3C,OAAOC,MAAM,CAACC,MAAP,CAAcF,eAAd,EAA+BG,MAA/B,CAAiD,UAACC,GAAD,EAAMC,SAAN,EAAoB;IAC1E,IAAIC,KAAK,CAACC,OAAN,CAAcF,SAAd,CAAJ,EAA8B;MAC5BD,GAAG,gCAAOA,GAAP,IAAYC,SAAS,CAAC,CAAD,CAArB,sBAA6BN,kBAAkB,CAACM,SAAS,CAAC,CAAD,CAAV,CAA/C,EAAH;IACD,CAFD,MAEO;MACLD,GAAG,CAACI,IAAJ,CAASH,SAAT;IACD;;IACD,OAAOD,GAAP;EACD,CAPM,EAOJ,EAPI,CAAP;AAQD;;AAED,SAASK,WAAT,CAAqBT,eAArB,EAAsCU,OAAtC,EAA+C;EAC7C,OAAO;IACLC,SAAS,EAAE,mBAAUN,SAAV,EAAqB;MAC9B,OAAO,CAACA,SAAD,4BAAeN,kBAAkB,CAACC,eAAD,CAAjC,GAAoDY,IAApD,CAAyD,UAACP,SAAD;QAAA,OAC9DQ,OAAO,CAACR,SAAS,CAACS,UAAV,IAAwBT,SAAS,CAACS,UAAV,CAAqBC,MAA9C,CADu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AACwB,IAAD,CAAH,GAAYC,MAAM,IAAID,IAAtB;UACA,OAAOxB,GAAP;QACD,CAJmB,EAIjB,EAJiB,CAApB;QAKA,IAAMU,UAAU,GAAGb,MAAM,CAAC6B,OAAP,CAAepC,IAAI,CAACuB,KAAD,EAAQhB,MAAM,CAAC8B,IAAP,CAAYN,WAAZ,CAAR,CAAnB,EAAsDtB,MAAtD,CACjB,UAACC,GAAD,QAAwB;UAAA;UAAA,IAAjBwB,IAAiB;UAAA,IAAXI,KAAW;;UACtB5B,GAAG,CAACqB,WAAW,CAACG,IAAD,CAAZ,CAAH,GAAyBI,KAAzB;UACA,OAAO5B,GAAP;QACD,CAJgB,EAKjB,EALiB,CAAnB;QAQAX,iBAAiB,CAAC,YAAM;UACtB,IAAI6B,OAAO,CAAC3B,aAAD,CAAX,EAA4B;YAC1B2B,OAAO,CAAC3B,aAAD,CAAP,CAAuBmB,UAAvB;UACD;QACF,CAJgB,EAIdb,MAAM,CAACC,MAAP,CAAcY,UAAd,CAJc,CAAjB;MAKD;;MACD,OAAOG,KAAP;IACD;EA3DI,CAAP;AA6DD;;AAED,eAAeR,WAAf"}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
2
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
|
-
|
|
5
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
|
-
|
|
7
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8
|
-
|
|
9
4
|
import { useContext } from 'react'; // @ts-ignore
|
|
10
5
|
|
|
11
6
|
import assignProps from '@semcore/utils/lib/assignProps'; // @ts-ignore
|