@semcore/core 2.21.0-prerelease.4 → 2.22.0-prerelease.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/lib/cjs/index.js +6 -426
  3. package/lib/cjs/index.js.map +1 -1
  4. package/lib/es6/index.js +2 -355
  5. package/lib/es6/index.js.map +1 -1
  6. package/lib/types/index.d.ts +2 -40
  7. package/package.json +2 -6
  8. package/lib/cjs/Component.js +0 -58
  9. package/lib/cjs/Component.js.map +0 -1
  10. package/lib/cjs/enhancement/Children.js +0 -121
  11. package/lib/cjs/enhancement/Children.js.map +0 -1
  12. package/lib/cjs/enhancement/Root.js +0 -78
  13. package/lib/cjs/enhancement/Root.js.map +0 -1
  14. package/lib/cjs/enhancement/bindHandler.js +0 -54
  15. package/lib/cjs/enhancement/bindHandler.js.map +0 -1
  16. package/lib/cjs/enhancement/dataName.js +0 -20
  17. package/lib/cjs/enhancement/dataName.js.map +0 -1
  18. package/lib/cjs/enhancement/enhance.js +0 -22
  19. package/lib/cjs/enhancement/enhance.js.map +0 -1
  20. package/lib/cjs/enhancement/functionDefaultProps.js +0 -36
  21. package/lib/cjs/enhancement/functionDefaultProps.js.map +0 -1
  22. package/lib/cjs/enhancement/hoistProps.js +0 -102
  23. package/lib/cjs/enhancement/hoistProps.js.map +0 -1
  24. package/lib/cjs/enhancement/i18n.js +0 -28
  25. package/lib/cjs/enhancement/i18n.js.map +0 -1
  26. package/lib/cjs/enhancement/inheritedName.js +0 -24
  27. package/lib/cjs/enhancement/inheritedName.js.map +0 -1
  28. package/lib/cjs/enhancement/staticChildren.js +0 -141
  29. package/lib/cjs/enhancement/staticChildren.js.map +0 -1
  30. package/lib/cjs/enhancement/style.js +0 -60
  31. package/lib/cjs/enhancement/style.js.map +0 -1
  32. package/lib/cjs/enhancement/uncontrolledProps.js +0 -135
  33. package/lib/cjs/enhancement/uncontrolledProps.js.map +0 -1
  34. package/lib/cjs/register.js +0 -37
  35. package/lib/cjs/register.js.map +0 -1
  36. package/lib/cjs/reshadow.d.js +0 -2
  37. package/lib/cjs/reshadow.d.js.map +0 -1
  38. package/lib/cjs/styled/index.js +0 -54
  39. package/lib/cjs/styled/index.js.map +0 -1
  40. package/lib/cjs/styled/sstyled.js +0 -150
  41. package/lib/cjs/styled/sstyled.js.map +0 -1
  42. package/lib/es6/Component.js +0 -50
  43. package/lib/es6/Component.js.map +0 -1
  44. package/lib/es6/enhancement/Children.js +0 -112
  45. package/lib/es6/enhancement/Children.js.map +0 -1
  46. package/lib/es6/enhancement/Root.js +0 -72
  47. package/lib/es6/enhancement/Root.js.map +0 -1
  48. package/lib/es6/enhancement/bindHandler.js +0 -47
  49. package/lib/es6/enhancement/bindHandler.js.map +0 -1
  50. package/lib/es6/enhancement/dataName.js +0 -12
  51. package/lib/es6/enhancement/dataName.js.map +0 -1
  52. package/lib/es6/enhancement/enhance.js +0 -15
  53. package/lib/es6/enhancement/enhance.js.map +0 -1
  54. package/lib/es6/enhancement/functionDefaultProps.js +0 -29
  55. package/lib/es6/enhancement/functionDefaultProps.js.map +0 -1
  56. package/lib/es6/enhancement/hoistProps.js +0 -90
  57. package/lib/es6/enhancement/hoistProps.js.map +0 -1
  58. package/lib/es6/enhancement/i18n.js +0 -21
  59. package/lib/es6/enhancement/i18n.js.map +0 -1
  60. package/lib/es6/enhancement/inheritedName.js +0 -15
  61. package/lib/es6/enhancement/inheritedName.js.map +0 -1
  62. package/lib/es6/enhancement/staticChildren.js +0 -126
  63. package/lib/es6/enhancement/staticChildren.js.map +0 -1
  64. package/lib/es6/enhancement/style.js +0 -52
  65. package/lib/es6/enhancement/style.js.map +0 -1
  66. package/lib/es6/enhancement/uncontrolledProps.js +0 -125
  67. package/lib/es6/enhancement/uncontrolledProps.js.map +0 -1
  68. package/lib/es6/register.js +0 -29
  69. package/lib/es6/register.js.map +0 -1
  70. package/lib/es6/reshadow.d.js +0 -2
  71. package/lib/es6/reshadow.d.js.map +0 -1
  72. package/lib/es6/styled/index.js +0 -10
  73. package/lib/es6/styled/index.js.map +0 -1
  74. package/lib/es6/styled/sstyled.js +0 -143
  75. package/lib/es6/styled/sstyled.js.map +0 -1
  76. package/lib/types/Component.d.ts +0 -152
  77. package/lib/types/enhancement/Children.d.ts +0 -6
  78. package/lib/types/enhancement/Root.d.ts +0 -6
  79. package/lib/types/enhancement/bindHandler.d.ts +0 -5
  80. package/lib/types/enhancement/dataName.d.ts +0 -4
  81. package/lib/types/enhancement/enhance.d.ts +0 -5
  82. package/lib/types/enhancement/functionDefaultProps.d.ts +0 -8
  83. package/lib/types/enhancement/hoistProps.d.ts +0 -10
  84. package/lib/types/enhancement/i18n.d.ts +0 -4
  85. package/lib/types/enhancement/inheritedName.d.ts +0 -8
  86. package/lib/types/enhancement/staticChildren.d.ts +0 -13
  87. package/lib/types/enhancement/style.d.ts +0 -9
  88. package/lib/types/enhancement/uncontrolledProps.d.ts +0 -7
  89. package/lib/types/register.d.ts +0 -8
  90. package/lib/types/styled/index.d.ts +0 -14
  91. package/lib/types/styled/sstyled.d.ts +0 -17
@@ -1,143 +0,0 @@
1
- import _objectSpread from "@babel/runtime/helpers/objectSpread2";
2
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
- import _cn from 'classnames';
4
- import { ReactNode } from 'react';
5
- /** @ts-ignore */
6
- import { getStyles as reshadowGetStyles } from '@reshadow/core';
7
- var RESHADOW_ID = '__reshadow__';
8
- var isSSR = !(typeof window !== 'undefined' && window.document && window.document.createElement);
9
- var serverMap = reshadowGetStyles().map;
10
- var getStyles = function getStyles() {
11
- return {
12
- map: serverMap,
13
- get css() {
14
- var serverStyles = '';
15
- for (var id in serverMap) {
16
- serverStyles += "<style type='text/css' id='".concat(id, "'>").concat(serverMap[id], "</style>");
17
- }
18
- return serverStyles;
19
- }
20
- };
21
- };
22
- function insert(code, hash) {
23
- var id = 'reshadow-'.concat(hash);
24
- if (isSSR) {
25
- serverMap[id] = code;
26
- return;
27
- }
28
- var container = document.getElementById(RESHADOW_ID);
29
- if (!container) {
30
- container = document.createElement('object');
31
- container.id = RESHADOW_ID;
32
- if (document.head) {
33
- document.head.appendChild(container);
34
- } else {
35
- document.addEventListener('DOMContentLoaded', function () {
36
- document.head.appendChild(container);
37
- });
38
- }
39
- }
40
- var css = document.getElementById(id);
41
- if (!css) {
42
- css = document.createElement('style');
43
- css.id = id;
44
- // @ts-ignore
45
- css.type = 'text/css';
46
- container.appendChild(css);
47
- }
48
- css.innerHTML = code;
49
- }
50
- function merge() {
51
- var s1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
52
- var s2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
53
- return Object.entries(s2).reduce(function (acc, _ref) {
54
- var _ref2 = _slicedToArray(_ref, 2),
55
- key = _ref2[0],
56
- value = _ref2[1];
57
- if (key.startsWith('@') || key.startsWith('--')) {
58
- acc[key] = value;
59
- } else {
60
- acc[key] = _cn(acc[key], value);
61
- }
62
- return acc;
63
- }, Object.assign({}, s1));
64
- }
65
- function getClassAndVars(styles, name, props) {
66
- function getPropValue(key, props) {
67
- var _props;
68
- return (_props = props["use:".concat(key)]) !== null && _props !== void 0 ? _props : props[key];
69
- }
70
- return Object.entries(styles).reduce(function (acc, _ref3) {
71
- var _ref4 = _slicedToArray(_ref3, 2),
72
- key = _ref4[0],
73
- value = _ref4[1];
74
- if (key.startsWith('--')) {
75
- // @ts-ignore
76
- acc[1][value] = getPropValue(key.substring(2), props);
77
- } else if (name === key) {
78
- // @ts-ignore
79
- acc[0][value] = true;
80
- } else {
81
- var _key$split = key.split('='),
82
- _key$split2 = _slicedToArray(_key$split, 2),
83
- mod = _key$split2[0],
84
- modValue = _key$split2[1];
85
- var propValue = getPropValue(mod, props);
86
- if (modValue === undefined) {
87
- // @ts-ignore
88
- acc[0][value] = Boolean(propValue !== null && propValue !== void 0 ? propValue : false);
89
- } else {
90
- // @ts-ignore
91
- // biome-ignore lint/suspicious/noDoubleEquals:
92
- acc[0][value] = propValue == modValue;
93
- }
94
- }
95
- return acc;
96
- }, [{}, {}]);
97
- }
98
- function reshadowToShadow(obj) {
99
- return Object.entries(obj).reduce(function (style, _ref5) {
100
- var _ref6 = _slicedToArray(_ref5, 2),
101
- name = _ref6[0],
102
- value = _ref6[1];
103
- var n = name;
104
- if (name.startsWith('__')) {
105
- n = name.replace(/^__/, '');
106
- } else if (name.startsWith('_')) {
107
- n = name.replace(/^_/, '').replace('_', '=');
108
- }
109
- style[n] = value;
110
- return style;
111
- }, {});
112
- }
113
- function sstyled() {
114
- var styles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
115
- // @ts-ignore
116
- return {
117
- cn: function cn(name, props) {
118
- var _getClassAndVars = getClassAndVars(reshadowToShadow(styles), name, props),
119
- _getClassAndVars2 = _slicedToArray(_getClassAndVars, 2),
120
- classes = _getClassAndVars2[0],
121
- style = _getClassAndVars2[1];
122
- var extraProps = {};
123
- if (Object.keys(classes).length) {
124
- // @ts-ignore
125
- extraProps.className = _cn(props.className, classes);
126
- }
127
- if (Object.keys(style).length) {
128
- // @ts-ignore
129
- extraProps.style = Object.assign(style, props.style);
130
- }
131
- return _objectSpread(_objectSpread({}, props), extraProps);
132
- }
133
- };
134
- }
135
- sstyled.css = function (css) {
136
- throw new Error('Enable babel plugin');
137
- };
138
- sstyled.insert = insert;
139
- sstyled.merge = merge;
140
- sstyled.getStyles = getStyles;
141
- sstyled.SHADOW_STYLES = Symbol('SHADOW_STYLES');
142
- export { sstyled };
143
- //# sourceMappingURL=sstyled.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sstyled.js","names":["cn","ReactNode","getStyles","reshadowGetStyles","RESHADOW_ID","isSSR","window","document","createElement","serverMap","map","css","serverStyles","id","concat","insert","code","hash","container","getElementById","head","appendChild","addEventListener","type","innerHTML","merge","s1","arguments","length","undefined","s2","Object","entries","reduce","acc","_ref","_ref2","_slicedToArray","key","value","startsWith","assign","getClassAndVars","styles","name","props","getPropValue","_props","_ref3","_ref4","substring","_key$split","split","_key$split2","mod","modValue","propValue","Boolean","reshadowToShadow","obj","style","_ref5","_ref6","n","replace","sstyled","_getClassAndVars","_getClassAndVars2","classes","extraProps","keys","className","_objectSpread","Error","SHADOW_STYLES","Symbol"],"sources":["../../../src/styled/sstyled.tsx"],"sourcesContent":["import cn from 'classnames';\nimport { ReactNode } from 'react';\n/** @ts-ignore */\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: any, hash: any) {\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 as any);\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: any, [key, value]: any) => {\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: any, name: any, props: any) {\n function getPropValue(key: any, props: any) {\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 // biome-ignore lint/suspicious/noDoubleEquals:\n acc[0][value] = propValue == modValue;\n }\n }\n return acc;\n },\n [{}, {}],\n );\n}\n\nfunction reshadowToShadow(obj: any) {\n return Object.entries(obj).reduce((style: any, [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(styles = {}): ((ReactNode: any) => 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: any): { [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"],"mappings":";;AAAA,OAAOA,GAAE,MAAM,YAAY;AAC3B,SAASC,SAAS,QAAQ,OAAO;AACjC;AACA,SAASC,SAAS,IAAIC,iBAAiB,QAAQ,gBAAgB;AAE/D,IAAMC,WAAW,GAAG,cAAc;AAElC,IAAMC,KAAK,GAAG,EAAE,OAAOC,MAAM,KAAK,WAAW,IAAIA,MAAM,CAACC,QAAQ,IAAID,MAAM,CAACC,QAAQ,CAACC,aAAa,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,IAAI,CAACV,KAAK,CAAC,CAAChC,MAAM,EAAE;QAC7B;QACAyC,UAAU,CAACT,KAAK,GAAG7B,MAAM,CAACU,MAAM,CAACmB,KAAK,EAAEf,KAAK,CAACe,KAAK,CAAC;MACtD;MACA,OAAAY,aAAA,CAAAA,aAAA,KACK3B,KAAK,GACLwB,UAAU;IAEjB;EACF,CAAC;AACH;AAEAJ,OAAO,CAACtD,GAAG,GAAG,UAAUA,GAAQ,EAA6B;EAC3D,MAAM,IAAI8D,KAAK,CAAC,qBAAqB,CAAC;AACxC,CAAC;AACDR,OAAO,CAAClD,MAAM,GAAGA,MAAM;AACvBkD,OAAO,CAACxC,KAAK,GAAGA,KAAK;AACrBwC,OAAO,CAAC/D,SAAS,GAAGA,SAAS;AAC7B+D,OAAO,CAACS,aAAa,GAAGC,MAAM,CAAC,eAAe,CAAC;AAE/C,SAASV,OAAO"}
@@ -1,152 +0,0 @@
1
- import React, { AllHTMLAttributes, ForwardRefExoticComponent, PureComponent, ReactNode, RefObject } from 'react';
2
- import { IStyledProps } from './styled';
3
- /** @deprecated */
4
- type KnownKeys<T> = {
5
- [K in keyof T]: string extends K ? never : number extends K ? never : K;
6
- } extends {
7
- [_ in keyof T]: infer U;
8
- } ? U : never;
9
- /** @deprecated */
10
- export type HandlersType<UCProps> = {
11
- [K in keyof UCProps]?: <T = unknown>(arg: T) => void;
12
- };
13
- /** @deprecated */
14
- export type ChildrenType<Props = {}, Ctx = {}, UCProps = {}> = ((props: Props & Ctx, handlers: HandlersType<UCProps>) => ReactNode) | ReactNode;
15
- /** @deprecated */
16
- export type RootComponentHandler = (...args: any[]) => void | false;
17
- /** @deprecated */
18
- export interface IRootComponentHandlers {
19
- [key: string]: RootComponentHandler;
20
- }
21
- /** @deprecated */
22
- export interface IRootComponentProps<Props = {}, Ctx = {}> {
23
- forwardRef?: RefObject<any>;
24
- Children?: any;
25
- children?: ChildrenType<Props, Ctx>;
26
- styles?: IStyledProps['styles'];
27
- 'data-ui-name'?: string;
28
- }
29
- /** @deprecated */
30
- export type IComponentProps<Props = {}, Ctx = {}> = Props & IRootComponentProps<Props, Ctx>;
31
- /** @deprecated */
32
- export type IFunctionProps<Props = {}, Ctx = {}> = IComponentProps<Props, Ctx> & Omit<AllHTMLAttributes<any>, keyof IComponentProps<Props, Ctx>> & {
33
- Root?: Root;
34
- };
35
- /** @deprecated */
36
- export type PropsWithRenderFnChildren<Props = {}, Ctx = {}, UCProps = {}> = Omit<Pick<Props, KnownKeys<Props>>, 'children'> & {
37
- children?: ChildrenType<Props, Ctx, UCProps>;
38
- [key: string]: unknown;
39
- };
40
- /** @deprecated */
41
- export type CProps<Props, Ctx = {}, UCProps = {}> = Props & {
42
- children?: ((props: Props & Ctx, handlers: UCProps) => React.ReactNode) | React.ReactNode;
43
- };
44
- /** @deprecated */
45
- export type ReturnEl = React.ReactElement | null;
46
- export interface IRootNodeProps {
47
- render: React.ElementType | string;
48
- tag?: React.ElementType | string;
49
- [key: string]: any;
50
- }
51
- type Root = ForwardRefExoticComponent<IRootNodeProps>;
52
- /**
53
- * @deprecated since version ^1.8.0
54
- */
55
- export type PropGetter<T extends (...args: any) => any> = <P>(props?: P) => ReturnType<T> & P;
56
- /**
57
- * @deprecated since version ^1.8.0
58
- */
59
- /** @deprecated */
60
- export type PropGetterReturn<T extends (...args: any) => any> = Partial<ReturnType<T>>;
61
- /** @deprecated */
62
- export type PropGetterFn = <T extends {}>(props?: T) => T & {
63
- [key: string]: unknown;
64
- };
65
- /** @deprecated */
66
- export type Merge<Props, HTMLProps> = Props & Omit<HTMLProps, keyof Props>;
67
- /** @deprecated */
68
- export type MergeGetters<G1 extends (...args: any) => any, G2 extends (...args: any) => any> = <P>(props?: P) => Merge<ReturnType<G1>, ReturnType<G2>> & P;
69
- declare const Root: Root;
70
- export { Root };
71
- /** @deprecated */
72
- declare abstract class RootComponent<Props = {}, Context = {}, State = {}, Enhance = {}> extends PureComponent<Props, State> {
73
- get handlers(): Readonly<IRootComponentHandlers>;
74
- get asProps(): Readonly<Merge<Props & IRootComponentProps<Props, Context> & Enhance, React.AllHTMLAttributes<any>>>;
75
- Root: Root;
76
- isControlled: boolean;
77
- }
78
- export declare const Component: typeof RootComponent;
79
- /** @deprecated */
80
- export type Component<Props = {}, Context = {}, State = {}, Handlers extends IRootComponentHandlers = IRootComponentHandlers> = React.ComponentClass<Props, State> & {
81
- isControlled: boolean;
82
- handlers: Readonly<Handlers>;
83
- asProps: Readonly<Merge<Props & IRootComponentProps<Props, Context>, AllHTMLAttributes<any>>>;
84
- Root: Root;
85
- };
86
- export declare namespace Intergalactic {
87
- type ReactFCProps<C extends React.FC> = C extends React.FC<infer Props> ? Omit<Props, 'tag'> : {};
88
- type ReactComponentProps<C extends React.ComponentClass> = C extends React.ComponentClass<infer Props> ? Omit<Props, 'tag'> : never;
89
- type ReactFCLike = (props: any) => any;
90
- type ReactFCLikeProps<C extends ReactFCLike> = C extends (props: infer Props) => any ? Props : {};
91
- type ComponentChildren<Props, Context, RenderingResult = InternalTypings.ReturnResult, AdditionalContext extends any[] = never[]> = ((props: MergeProps<Context, Props>, ...args: AdditionalContext) => RenderingResult) | InternalTypings.ReturnResult;
92
- type ComponentBasicProps<Tag extends InternalTypings.ComponentTag> = {
93
- ref?: React.Ref<InternalTypings.ComponentHtmlElement<Tag> | null>;
94
- /** @private DO NOT USE IT. Low-level api that prevents specified props from being applied as DOM attribute. */
95
- __excludeProps?: string[];
96
- };
97
- type MergeProps<HighPriorityProps, LowPriorityProps> = {
98
- [K in keyof LowPriorityProps]: K extends keyof HighPriorityProps ? HighPriorityProps[K] : LowPriorityProps[K];
99
- } & HighPriorityProps;
100
- /** @private */
101
- export namespace InternalTypings {
102
- export type EfficientOmit<Type, Keys> = {
103
- [Property in keyof Type as Exclude<Property, Keys>]: Type[Property];
104
- };
105
- export type ComponentPropsNesting<Tag extends InternalTypings.ComponentTag> = Omit<MergeProps<Tag extends React.FC ? ReactFCProps<Tag> : Tag extends React.ComponentClass ? ReactComponentProps<Tag> : Tag extends ReactFCLike ? ReactFCLikeProps<Tag> : Tag extends keyof JSX.IntrinsicElements ? JSX.IntrinsicElements[Tag] : {}, Tag extends {
106
- __nestedProps: infer NestedProps;
107
- } ? NestedProps : {}>, 'children' | 'tag'>;
108
- export type ReturnResult = React.ReactElement | React.ReactNode | React.ReactNode[] | string | null;
109
- export type ComponentTag = keyof JSX.IntrinsicElements | React.ComponentClass | React.FC | ReactFCLike;
110
- export type ComponentProps<Tag extends ComponentTag, BaseTag extends ComponentTag | never, Props, Context = never, AdditionalContext extends any[] = never[]> = {
111
- tag?: Tag;
112
- children?: ComponentChildren<EfficientOmit<Props, 'children'> & {
113
- children: React.ReactNode;
114
- }, Context, ReturnResult, AdditionalContext>;
115
- } & ComponentBasicProps<Tag> & MergeProps<EfficientOmit<Props, 'tag' | 'children'>, MergeProps<ComponentPropsNesting<Tag>, ComponentPropsNesting<BaseTag>>>;
116
- export type PropsRenderingResultComponentProps<Tag extends ComponentTag, Props, Context = {}, AdditionalContext extends any[] = never[]> = {
117
- tag?: Tag;
118
- children?: ComponentChildren<EfficientOmit<Props, 'children'> & {
119
- children: React.ReactNode;
120
- }, Context, Partial<EfficientOmit<MergeProps<Props, ComponentPropsNesting<Tag>>, 'children' | 'tag' | 'ref'> & {
121
- children?: React.ReactNode;
122
- }>, AdditionalContext>;
123
- } & ComponentBasicProps<Tag> & MergeProps<EfficientOmit<Props, 'tag' | 'children'>, ComponentPropsNesting<Tag>>;
124
- export type ComponentRenderingResults = React.ReactElement;
125
- export type ComponentAdditive<BaseTag extends ComponentTag, Tag extends ComponentTag, Props = {}, Context = {}, AdditionalContext = {}> = {
126
- __nestedProps: ComponentPropsNesting<BaseTag>;
127
- __tag: Tag;
128
- __props: Props;
129
- __context: Context;
130
- __additionalContext: AdditionalContext;
131
- };
132
- export type InferJsxIntrinsicElement<T extends React.DetailedHTMLProps<any, any>> = T extends React.DetailedHTMLProps<infer _, infer Element> ? Element : HTMLElement;
133
- type InferElementFromRef<T> = T extends React.Ref<infer Element> ? Element : never;
134
- type InferRefElementFromProps<T> = 'ref' extends keyof T ? InferElementFromRef<T['ref']> : HTMLElement;
135
- export type ComponentHtmlElement<Tag extends ComponentTag> = Tag extends keyof JSX.IntrinsicElements ? InferJsxIntrinsicElement<JSX.IntrinsicElements[Tag]> : Tag extends {
136
- __nestedProps: infer NestedProps;
137
- } ? InferRefElementFromProps<NestedProps> : HTMLElement;
138
- export type UntypeRefAndTag<Props> = Intergalactic.InternalTypings.EfficientOmit<Props, 'ref' | 'tag'> & {
139
- ref: React.Ref<any>;
140
- tag: Intergalactic.InternalTypings.ComponentTag;
141
- };
142
- export {};
143
- }
144
- export type Component<BaseTag extends InternalTypings.ComponentTag = never, BaseProps = {}, Context = {}, AdditionalContext extends any[] = never[]> = (<Tag extends InternalTypings.ComponentTag = BaseTag, Props extends BaseProps = BaseProps>(props: InternalTypings.ComponentProps<Tag, BaseTag, Props, Context, AdditionalContext>) => InternalTypings.ComponentRenderingResults) & InternalTypings.ComponentAdditive<BaseTag, Tag, BaseProps, Context, AdditionalContext>;
145
- export type Tag = InternalTypings.ComponentTag;
146
- export type DomProps<Tag extends keyof JSX.IntrinsicElements> = InternalTypings.InferJsxIntrinsicElement<JSX.IntrinsicElements[Tag]>;
147
- export {};
148
- }
149
- export declare const wrapIntergalacticComponent: <Component_1 extends Intergalactic.Component<any, any, any, any>, PropsExtending = {}>(wrapper: (props: Intergalactic.InternalTypings.EfficientOmit<Intergalactic.InternalTypings.ComponentPropsNesting<Component_1>, "ref" | "tag"> & {
150
- ref: React.Ref<any>;
151
- tag: Intergalactic.InternalTypings.ComponentTag;
152
- } & PropsExtending) => React.ReactNode) => Intergalactic.Component<Component_1["__tag"], Component_1["__props"] & Component_1["__nestedProps"] & PropsExtending, Component_1["__context"], Component_1["__additionalContext"]>;
@@ -1,6 +0,0 @@
1
- export declare const CHILDREN_COMPONENT: unique symbol;
2
- declare function Enhancement(this: any, Context: any, parent: any): {
3
- init: (this: any) => void;
4
- asProps: (this: any, props: any) => any;
5
- };
6
- export default Enhancement;
@@ -1,6 +0,0 @@
1
- declare function Enhancement(): {
2
- init: (this: any) => void;
3
- asProps: (this: any, props: any, WrapperComponent: any, isFunction: boolean) => any;
4
- render: (this: any, render: any, props: any) => any;
5
- };
6
- export default Enhancement;
@@ -1,5 +0,0 @@
1
- declare function Enhancement(): {
2
- condition: (Component: any, isFunction: boolean) => boolean;
3
- init: (this: any) => void;
4
- };
5
- export default Enhancement;
@@ -1,4 +0,0 @@
1
- declare function Enhancement(): {
2
- wrapperProps: (props: any, WrapperComponent: any) => any;
3
- };
4
- export default Enhancement;
@@ -1,5 +0,0 @@
1
- declare function Enhancement(): {
2
- condition: (Component: any) => boolean;
3
- wrapperProps: (props: any, WrapperComponent: any) => any;
4
- };
5
- export default Enhancement;
@@ -1,8 +0,0 @@
1
- declare function Enhancement(): {
2
- condition: (Component: any) => boolean;
3
- static: (WrapperComponent: any) => {
4
- defaultProps: {};
5
- };
6
- wrapperProps: (props: any) => any;
7
- };
8
- export default Enhancement;
@@ -1,10 +0,0 @@
1
- export declare const HOIST_CONTEXT: unique symbol;
2
- /** @deprecated Doesn't work in ssr and sometimes breakes rulles of hooks. We should never use it. */
3
- declare function Enhancement(childComponents: any, Context: any): {
4
- condition: (Component: any) => boolean;
5
- init: (this: any, props: any, WrapperComponent: any, isFunction: boolean) => void;
6
- context: (this: any, context: any) => any;
7
- asProps: (this: any, props: any) => any;
8
- wrapperProps: (props: any, WrapperComponent: any) => any;
9
- };
10
- export default Enhancement;
@@ -1,4 +0,0 @@
1
- declare function i18nAppLocaleEnhance(): {
2
- wrapperProps: (props: any) => any;
3
- };
4
- export default i18nAppLocaleEnhance;
@@ -1,8 +0,0 @@
1
- export declare const INHERITED_NAME: unique symbol;
2
- declare function Enhancement(): {
3
- condition: (Component: any) => boolean;
4
- static: (WrapperComponent: any) => {
5
- [INHERITED_NAME]: any[];
6
- };
7
- };
8
- export default Enhancement;
@@ -1,13 +0,0 @@
1
- export declare function getterMethodName(name: string): string;
2
- export declare function getterMethodNameByDisplayName(displayName?: string): string;
3
- export declare const STATIC_COMPONENT: unique symbol;
4
- export declare const ROOT_COMPONENT: unique symbol;
5
- declare function Enhancement(childComponents: any, createComponent: any, options: any): {
6
- condition: (Component: any) => boolean;
7
- init: (this: any, props: any, WrapperComponent: any) => void;
8
- static: (WrapperComponent: any, Component: any) => any;
9
- context: (context: any) => any;
10
- wrapperProps: (this: any, props: any, WrapperComponent: any) => any;
11
- render: (this: any, render: any) => any;
12
- };
13
- export default Enhancement;
@@ -1,9 +0,0 @@
1
- export declare const STYLES_CONTEXT: unique symbol;
2
- declare function Enhancement(childComponents: any, Context: any): {
3
- condition: (Component: any) => boolean;
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;
8
- };
9
- export default Enhancement;
@@ -1,7 +0,0 @@
1
- declare function Enhancement(): {
2
- condition: (Component: any) => boolean;
3
- init: (this: any) => void;
4
- context: (this: any, context: any) => any;
5
- asProps: (this: any, props: any) => any;
6
- };
7
- export default Enhancement;
@@ -1,8 +0,0 @@
1
- declare class Register {
2
- data: any;
3
- get<D>(name: string, defaultValue?: D): D;
4
- set<D>(name: string, value: D): D;
5
- }
6
- export { Register };
7
- declare const _default: Register;
8
- export default _default;
@@ -1,14 +0,0 @@
1
- import { UnknownProperties } from '..';
2
- export type StyledProps = {
3
- styles?: React.DetailedHTMLProps<React.StyleHTMLAttributes<HTMLStyleElement>, HTMLStyleElement>;
4
- };
5
- /** @deprecated */
6
- export interface IStyledProps extends StyledProps, UnknownProperties {
7
- }
8
- /** @ts-ignore */
9
- export { default as styled } from '@reshadow/core';
10
- /** @ts-ignore */
11
- export { use, css } from '@reshadow/core';
12
- /** @ts-ignore */
13
- export * from '@reshadow/core';
14
- export * from './sstyled';
@@ -1,17 +0,0 @@
1
- import { ReactNode } from 'react';
2
- declare function sstyled(styles?: {}): ((ReactNode: any) => ReactNode) & {
3
- cn(name: string, props: any): any;
4
- };
5
- declare namespace sstyled {
6
- var css: (css: any) => {
7
- [key: string]: string;
8
- };
9
- var insert: (code: any, hash: any) => void;
10
- var merge: (s1?: {}, s2?: {}) => any;
11
- var getStyles: () => {
12
- map: any;
13
- readonly css: string;
14
- };
15
- var SHADOW_STYLES: symbol;
16
- }
17
- export { sstyled };