@semcore/core 2.0.0-beta.0 → 2.0.0-beta.1

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.
Files changed (60) hide show
  1. package/lib/cjs/Component.js +1 -1
  2. package/lib/cjs/Component.js.map +1 -1
  3. package/lib/cjs/enhancement/Children.js +7 -7
  4. package/lib/cjs/enhancement/Children.js.map +1 -1
  5. package/lib/cjs/enhancement/Root.js.map +1 -1
  6. package/lib/cjs/enhancement/bindHandler.js.map +1 -1
  7. package/lib/cjs/enhancement/dataName.js.map +1 -1
  8. package/lib/cjs/enhancement/enhance.js.map +1 -1
  9. package/lib/cjs/enhancement/functionDefaultProps.js.map +1 -1
  10. package/lib/cjs/enhancement/hoistProps.js.map +1 -1
  11. package/lib/cjs/enhancement/i18n.js.map +1 -1
  12. package/lib/cjs/enhancement/inheritedName.js.map +1 -1
  13. package/lib/cjs/enhancement/staticChildren.js +1 -1
  14. package/lib/cjs/enhancement/staticChildren.js.map +1 -1
  15. package/lib/cjs/enhancement/style.js.map +1 -1
  16. package/lib/cjs/enhancement/uncontrolledProps.js.map +1 -1
  17. package/lib/cjs/index.js.map +1 -1
  18. package/lib/cjs/register.js.map +1 -1
  19. package/lib/cjs/reshadow.d.js +2 -0
  20. package/lib/cjs/reshadow.d.js.map +1 -0
  21. package/lib/cjs/styled/index.js.map +1 -1
  22. package/lib/cjs/styled/sstyled.js +2 -0
  23. package/lib/cjs/styled/sstyled.js.map +1 -1
  24. package/lib/es6/Component.js +1 -1
  25. package/lib/es6/Component.js.map +1 -1
  26. package/lib/es6/enhancement/Children.js +7 -7
  27. package/lib/es6/enhancement/Children.js.map +1 -1
  28. package/lib/es6/enhancement/Root.js.map +1 -1
  29. package/lib/es6/enhancement/bindHandler.js.map +1 -1
  30. package/lib/es6/enhancement/dataName.js.map +1 -1
  31. package/lib/es6/enhancement/enhance.js.map +1 -1
  32. package/lib/es6/enhancement/functionDefaultProps.js.map +1 -1
  33. package/lib/es6/enhancement/hoistProps.js.map +1 -1
  34. package/lib/es6/enhancement/i18n.js.map +1 -1
  35. package/lib/es6/enhancement/inheritedName.js.map +1 -1
  36. package/lib/es6/enhancement/staticChildren.js +1 -1
  37. package/lib/es6/enhancement/staticChildren.js.map +1 -1
  38. package/lib/es6/enhancement/style.js.map +1 -1
  39. package/lib/es6/enhancement/uncontrolledProps.js.map +1 -1
  40. package/lib/es6/index.js.map +1 -1
  41. package/lib/es6/register.js.map +1 -1
  42. package/lib/es6/reshadow.d.js +2 -0
  43. package/lib/es6/reshadow.d.js.map +1 -0
  44. package/lib/es6/styled/index.js +3 -0
  45. package/lib/es6/styled/index.js.map +1 -1
  46. package/lib/es6/styled/sstyled.js +1 -0
  47. package/lib/es6/styled/sstyled.js.map +1 -1
  48. package/lib/types/Component.d.ts +38 -30
  49. package/lib/types/enhancement/Children.d.ts +3 -3
  50. package/lib/types/enhancement/Root.d.ts +3 -3
  51. package/lib/types/enhancement/bindHandler.d.ts +2 -2
  52. package/lib/types/enhancement/hoistProps.d.ts +3 -3
  53. package/lib/types/enhancement/staticChildren.d.ts +5 -5
  54. package/lib/types/enhancement/style.d.ts +4 -16
  55. package/lib/types/enhancement/uncontrolledProps.d.ts +3 -3
  56. package/lib/types/index.d.ts +6 -6
  57. package/lib/types/register.d.ts +3 -3
  58. package/lib/types/styled/index.d.ts +4 -1
  59. package/lib/types/styled/sstyled.d.ts +1 -1
  60. package/package.json +3 -2
@@ -1,13 +1,13 @@
1
- export declare function getterMethodName(name: any): string;
1
+ export declare function getterMethodName(name: string): string;
2
2
  export declare function getterMethodNameByDisplayName(displayName?: string): string;
3
3
  export declare const STATIC_COMPONENT: unique symbol;
4
4
  export declare const ROOT_COMPONENT: unique symbol;
5
5
  declare function Enhancement(childComponents: any, createComponent: any, options: any): {
6
6
  condition: (Component: any) => boolean;
7
- init: (props: any, WrapperComponent: any) => void;
8
- static: (WrapperComponent: any, Component: any) => {};
7
+ init: (this: any, props: any, WrapperComponent: any) => void;
8
+ static: (WrapperComponent: any, Component: any) => any;
9
9
  context: (context: any) => any;
10
- wrapperProps: (props: any, WrapperComponent: any) => any;
11
- render: (render: any) => any;
10
+ wrapperProps: (this: any, props: any, WrapperComponent: any) => any;
11
+ render: (this: any, render: any) => any;
12
12
  };
13
13
  export default Enhancement;
@@ -1,21 +1,9 @@
1
1
  export declare const STYLES_CONTEXT: unique symbol;
2
2
  declare function Enhancement(childComponents: any, Context: any): {
3
3
  condition: (Component: any) => boolean;
4
- init: (props: any, WrapperComponent: any) => void;
5
- context: (context: any) => any;
6
- asProps: ({ _styles, styles, ...props }: {
7
- [x: string]: any;
8
- _styles: any;
9
- styles: any;
10
- }) => {
11
- styles: any;
12
- };
13
- wrapperProps: ({ styles, ...props }: {
14
- [x: string]: any;
15
- styles: any;
16
- }) => {
17
- _styles: any;
18
- styles: any;
19
- };
4
+ init: (this: any, props: any, WrapperComponent: any) => void;
5
+ context: (this: any, context: any) => any;
6
+ asProps: (this: any, { _styles, styles, ...props }: any) => any;
7
+ wrapperProps: (this: any, { styles, ...props }: any) => any;
20
8
  };
21
9
  export default Enhancement;
@@ -1,7 +1,7 @@
1
1
  declare function Enhancement(): {
2
2
  condition: (Component: any) => boolean;
3
- init: () => void;
4
- context: (context: any) => any;
5
- asProps: (props: any) => any;
3
+ init: (this: any) => void;
4
+ context: (this: any, context: any) => any;
5
+ asProps: (this: any, props: any) => any;
6
6
  };
7
7
  export default Enhancement;
@@ -8,10 +8,10 @@ declare const CORE_COMPONENT: unique symbol;
8
8
  declare const CORE_INSTANCE: unique symbol;
9
9
  declare const CONTEXT_COMPONENT: unique symbol;
10
10
  declare const CREATE_COMPONENT: unique symbol;
11
- export declare type PropsAndRef<T, Ctx, UCProps> = PropsWithRenderFnChildren<T, Ctx, UCProps> & RefAttributes<unknown>;
12
- export declare type ForwardRefComponent<T, Ctx, UCProps> = ForwardRefExoticComponent<PropsAndRef<T, Ctx, UCProps>>;
13
- declare type ComponentOrProps<T, Context, UCProps> = T extends [infer ParentProps, infer ChildProps] ? ComponentType<ParentProps, ChildProps, Context, UCProps> : ForwardRefComponent<T, Context, UCProps>;
14
- export declare type ComponentType<ComponentProps, ChildComponentProps = {}, ContextType = {}, UCProps = {}, FNType = null> = (FNType extends null ? ForwardRefComponent<ComponentProps, ContextType, UCProps> : FNType & {
11
+ export type PropsAndRef<T, Ctx, UCProps> = PropsWithRenderFnChildren<T, Ctx, UCProps> & RefAttributes<unknown>;
12
+ export type ForwardRefComponent<T, Ctx, UCProps> = ForwardRefExoticComponent<PropsAndRef<T, Ctx, UCProps>>;
13
+ type ComponentOrProps<T, Context, UCProps> = T extends [infer ParentProps, infer ChildProps] ? ComponentType<ParentProps, ChildProps, Context, UCProps> : ForwardRefComponent<T, Context, UCProps>;
14
+ export type ComponentType<ComponentProps, ChildComponentProps = {}, ContextType = {}, UCProps = {}, FNType = null> = (FNType extends null ? ForwardRefComponent<ComponentProps, ContextType, UCProps> : FNType & {
15
15
  displayName: string;
16
16
  }) & {
17
17
  [K in keyof ChildComponentProps]: ComponentOrProps<ChildComponentProps[K], ContextType, UCProps>;
@@ -23,7 +23,7 @@ interface ClassWithUncontrolledProps<Props> {
23
23
  uncontrolledProps(): unknown;
24
24
  }
25
25
  declare function assignProps(p1: any, p2: any): any;
26
- declare function createComponent<ComponentProps, ChildComponentProps = {}, ContextType = {}, FNType = null>(OriginComponent: any, childComponents?: {}, options?: {
26
+ declare function createComponent<ComponentProps, ChildComponentProps = {}, ContextType = {}, FNType = null>(OriginComponent: any, childComponents?: any, options?: {
27
27
  context?: React.Context<ContextType>;
28
28
  parent?: ComponentType<unknown> | ComponentType<unknown>[];
29
29
  enhancements?: [any];
@@ -31,7 +31,7 @@ declare function createComponent<ComponentProps, ChildComponentProps = {}, Conte
31
31
  [key: string]: (arg: unknown) => void;
32
32
  }, FNType>;
33
33
  declare function createBaseComponent<ComponentProps>(OriginComponent: any): ComponentType<ComponentProps>;
34
- export declare type UnknownProperties = {
34
+ export type UnknownProperties = {
35
35
  [key: string]: unknown;
36
36
  };
37
37
  export * from './Component';
@@ -1,7 +1,7 @@
1
1
  declare class Register {
2
- data: {};
3
- get<D>(name: any, defaultValue?: D): D;
4
- set<D>(name: any, value: D): D;
2
+ data: any;
3
+ get<D>(name: string, defaultValue?: D): D;
4
+ set<D>(name: string, value: D): D;
5
5
  }
6
6
  export { Register };
7
7
  declare const _default: Register;
@@ -1,11 +1,14 @@
1
1
  import { UnknownProperties } from '..';
2
- export declare type StyledProps = {
2
+ export type StyledProps = {
3
3
  styles?: React.DetailedHTMLProps<React.StyleHTMLAttributes<HTMLStyleElement>, HTMLStyleElement>;
4
4
  };
5
5
  /** @deprecated */
6
6
  export interface IStyledProps extends StyledProps, UnknownProperties {
7
7
  }
8
+ /** @ts-ignore */
8
9
  export { default as styled } from '@reshadow/core';
10
+ /** @ts-ignore */
9
11
  export { use, css } from '@reshadow/core';
12
+ /** @ts-ignore */
10
13
  export * from '@reshadow/core';
11
14
  export * from './sstyled';
@@ -7,7 +7,7 @@ declare namespace sstyled {
7
7
  [key: string]: string;
8
8
  };
9
9
  var insert: (code: any, hash: any) => void;
10
- var merge: (s1?: {}, s2?: {}) => {};
10
+ var merge: (s1?: {}, s2?: {}) => any;
11
11
  var getStyles: () => {
12
12
  map: any;
13
13
  readonly css: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/core",
3
3
  "description": "Semrush Core Component",
4
- "version": "2.0.0-beta.0",
4
+ "version": "2.0.0-beta.1",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -10,7 +10,7 @@
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@reshadow/core": "0.0.1-alpha.74",
13
- "@semcore/utils": "4.0.0-beta.0",
13
+ "@semcore/utils": "4.0.0-beta.1",
14
14
  "classnames": "2.2.6",
15
15
  "hoist-non-react-statics": "3.3.2"
16
16
  },
@@ -25,6 +25,7 @@
25
25
  },
26
26
  "devDependencies": {
27
27
  "@types/react": "18.0.21",
28
+ "@types/classnames": "2.2.6",
28
29
  "@semcore/testing-utils": "1.0.0"
29
30
  },
30
31
  "scripts": {