@semcore/core 17.0.0-prerelease.36 → 17.0.0-prerelease.39
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 +1 -1
- package/lib/core-types/symbols.mjs +9 -9
- package/lib/coreFactory.mjs +3 -3
- package/lib/enhancement/Children.mjs +1 -1
- package/lib/enhancement/enhance.mjs +1 -2
- package/lib/enhancement/staticChildren.mjs +3 -3
- package/lib/enhancement/style.mjs +2 -2
- package/lib/enhancement/uncontrolledProps.mjs +1 -1
- package/lib/esm/core-types/symbols.mjs +9 -9
- package/lib/esm/coreFactory.mjs +3 -3
- package/lib/esm/enhancement/Children.mjs +1 -1
- package/lib/esm/enhancement/enhance.mjs +1 -2
- package/lib/esm/enhancement/staticChildren.mjs +3 -3
- package/lib/esm/enhancement/style.mjs +2 -2
- package/lib/esm/enhancement/uncontrolledProps.mjs +1 -1
- package/lib/esm/styled/sstyled.mjs +1 -1
- package/lib/esm/utils/assignProps.mjs +1 -1
- package/lib/esm/utils/ref.mjs +1 -1
- package/lib/styled/sstyled.mjs +1 -1
- package/lib/utils/assignProps.mjs +1 -1
- package/lib/utils/ref.mjs +1 -1
- package/package.json +1 -1
- package/vite.config.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
const CORE_COMPONENT = Symbol("CORE_COMPONENT");
|
|
2
|
-
const CORE_INSTANCE = Symbol("CORE_INSTANCE");
|
|
3
|
-
const CORE_AS_PROPS = Symbol("CORE_AS_PROPS");
|
|
4
|
-
const CORE_INIT = Symbol("CORE_INIT");
|
|
5
|
-
const CONTEXT_COMPONENT = Symbol("CONTEXT_COMPONENT");
|
|
6
|
-
const CREATE_COMPONENT = Symbol("CREATE_COMPONENT");
|
|
7
|
-
const PARENT_COMPONENTS = Symbol("PARENT_COMPONENTS");
|
|
8
|
-
const CHILDREN_COMPONENT = Symbol("CHILDREN_COMPONENT");
|
|
9
|
-
const INHERITED_NAME = Symbol("INHERITED_NAME");
|
|
1
|
+
const CORE_COMPONENT = /* @__PURE__ */ Symbol("CORE_COMPONENT");
|
|
2
|
+
const CORE_INSTANCE = /* @__PURE__ */ Symbol("CORE_INSTANCE");
|
|
3
|
+
const CORE_AS_PROPS = /* @__PURE__ */ Symbol("CORE_AS_PROPS");
|
|
4
|
+
const CORE_INIT = /* @__PURE__ */ Symbol("CORE_INIT");
|
|
5
|
+
const CONTEXT_COMPONENT = /* @__PURE__ */ Symbol("CONTEXT_COMPONENT");
|
|
6
|
+
const CREATE_COMPONENT = /* @__PURE__ */ Symbol("CREATE_COMPONENT");
|
|
7
|
+
const PARENT_COMPONENTS = /* @__PURE__ */ Symbol("PARENT_COMPONENTS");
|
|
8
|
+
const CHILDREN_COMPONENT = /* @__PURE__ */ Symbol("CHILDREN_COMPONENT");
|
|
9
|
+
const INHERITED_NAME = /* @__PURE__ */ Symbol("INHERITED_NAME");
|
|
10
10
|
export {
|
|
11
11
|
CHILDREN_COMPONENT,
|
|
12
12
|
CONTEXT_COMPONENT,
|
package/lib/coreFactory.mjs
CHANGED
|
@@ -38,9 +38,9 @@ function createGetField(enhancements, Component2, isFunction) {
|
|
|
38
38
|
}
|
|
39
39
|
function createForwardWrapper(Component2, wrapperProps, statics, isFunction) {
|
|
40
40
|
const RootComponent = Component2[ROOT_COMPONENT];
|
|
41
|
-
const getterMethodName = getterMethodNameByDisplayName(Component2
|
|
42
|
-
const getterMethod =
|
|
43
|
-
const useGetterIndex =
|
|
41
|
+
const getterMethodName = getterMethodNameByDisplayName(Component2?.displayName);
|
|
42
|
+
const getterMethod = RootComponent?.prototype ? RootComponent.prototype[getterMethodName] : void 0;
|
|
43
|
+
const useGetterIndex = getterMethod?.length >= 2;
|
|
44
44
|
function WrapperForwardRefWithBind({
|
|
45
45
|
forwardRef = null,
|
|
46
46
|
...other
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { CHILDREN_COMPONENT, CONTEXT_COMPONENT } from "../core-types/symbols.mjs";
|
|
3
|
-
const CHILDREN_SELF = Symbol("CHILDREN_SELF");
|
|
3
|
+
const CHILDREN_SELF = /* @__PURE__ */ Symbol("CHILDREN_SELF");
|
|
4
4
|
const GETTER_REG = /^get[\w]+Props$/;
|
|
5
5
|
function splitPropsAndGetters(props) {
|
|
6
6
|
return Object.entries(props).reduce((acc, [key, value]) => {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
function Enhancement() {
|
|
2
2
|
return {
|
|
3
3
|
condition: function(Component) {
|
|
4
|
-
|
|
5
|
-
return Boolean((_a = Component.enhance) == null ? void 0 : _a.length);
|
|
4
|
+
return Boolean(Component.enhance?.length);
|
|
6
5
|
},
|
|
7
6
|
wrapperProps: function(props, WrapperComponent) {
|
|
8
7
|
return WrapperComponent.enhance.reduce((acc, enhance) => enhance(acc), props);
|
|
@@ -26,9 +26,9 @@ function flatGetterMethodNames(childComponents, parentName) {
|
|
|
26
26
|
return acc;
|
|
27
27
|
}, []);
|
|
28
28
|
}
|
|
29
|
-
const STATIC_COMPONENT = Symbol("STATIC_COMPONENT");
|
|
30
|
-
const ROOT_COMPONENT = Symbol("ROOT_COMPONENT");
|
|
31
|
-
const SELF_GETTER_METHOD = Symbol("SELF_GETTER_METHOD");
|
|
29
|
+
const STATIC_COMPONENT = /* @__PURE__ */ Symbol("STATIC_COMPONENT");
|
|
30
|
+
const ROOT_COMPONENT = /* @__PURE__ */ Symbol("ROOT_COMPONENT");
|
|
31
|
+
const SELF_GETTER_METHOD = /* @__PURE__ */ Symbol("SELF_GETTER_METHOD");
|
|
32
32
|
function Enhancement(childComponents, createComponent, options) {
|
|
33
33
|
const getterMethodNames = flatGetterMethodNames(childComponents);
|
|
34
34
|
return {
|
|
@@ -2,8 +2,8 @@ import React from "react";
|
|
|
2
2
|
import { STATIC_COMPONENT } from "./staticChildren.mjs";
|
|
3
3
|
import "../styled/index.mjs";
|
|
4
4
|
import { sstyled } from "../styled/sstyled.mjs";
|
|
5
|
-
const STYLES_CONTEXT = Symbol("STYLES_CONTEXT");
|
|
6
|
-
const STYLES_SELF = Symbol("STYLES_SELF");
|
|
5
|
+
const STYLES_CONTEXT = /* @__PURE__ */ Symbol("STYLES_CONTEXT");
|
|
6
|
+
const STYLES_SELF = /* @__PURE__ */ Symbol("STYLES_SELF");
|
|
7
7
|
function Enhancement(childComponents, Context) {
|
|
8
8
|
return {
|
|
9
9
|
condition: function(Component) {
|
|
@@ -55,7 +55,7 @@ function uncontrolledUniversal(props, config, uncontrolledProp2) {
|
|
|
55
55
|
[propName]: value,
|
|
56
56
|
[handlerName]: (eventOrValue, ...args) => {
|
|
57
57
|
const result2 = [setter(eventOrValue, ...args), ...args];
|
|
58
|
-
if (eventOrValue
|
|
58
|
+
if (eventOrValue?.target) {
|
|
59
59
|
result2.push(eventOrValue);
|
|
60
60
|
}
|
|
61
61
|
return handler(...result2);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
const CORE_COMPONENT = Symbol("CORE_COMPONENT");
|
|
2
|
-
const CORE_INSTANCE = Symbol("CORE_INSTANCE");
|
|
3
|
-
const CORE_AS_PROPS = Symbol("CORE_AS_PROPS");
|
|
4
|
-
const CORE_INIT = Symbol("CORE_INIT");
|
|
5
|
-
const CONTEXT_COMPONENT = Symbol("CONTEXT_COMPONENT");
|
|
6
|
-
const CREATE_COMPONENT = Symbol("CREATE_COMPONENT");
|
|
7
|
-
const PARENT_COMPONENTS = Symbol("PARENT_COMPONENTS");
|
|
8
|
-
const CHILDREN_COMPONENT = Symbol("CHILDREN_COMPONENT");
|
|
9
|
-
const INHERITED_NAME = Symbol("INHERITED_NAME");
|
|
1
|
+
const CORE_COMPONENT = /* @__PURE__ */ Symbol("CORE_COMPONENT");
|
|
2
|
+
const CORE_INSTANCE = /* @__PURE__ */ Symbol("CORE_INSTANCE");
|
|
3
|
+
const CORE_AS_PROPS = /* @__PURE__ */ Symbol("CORE_AS_PROPS");
|
|
4
|
+
const CORE_INIT = /* @__PURE__ */ Symbol("CORE_INIT");
|
|
5
|
+
const CONTEXT_COMPONENT = /* @__PURE__ */ Symbol("CONTEXT_COMPONENT");
|
|
6
|
+
const CREATE_COMPONENT = /* @__PURE__ */ Symbol("CREATE_COMPONENT");
|
|
7
|
+
const PARENT_COMPONENTS = /* @__PURE__ */ Symbol("PARENT_COMPONENTS");
|
|
8
|
+
const CHILDREN_COMPONENT = /* @__PURE__ */ Symbol("CHILDREN_COMPONENT");
|
|
9
|
+
const INHERITED_NAME = /* @__PURE__ */ Symbol("INHERITED_NAME");
|
|
10
10
|
export {
|
|
11
11
|
CHILDREN_COMPONENT,
|
|
12
12
|
CONTEXT_COMPONENT,
|
package/lib/esm/coreFactory.mjs
CHANGED
|
@@ -38,9 +38,9 @@ function createGetField(enhancements, Component2, isFunction) {
|
|
|
38
38
|
}
|
|
39
39
|
function createForwardWrapper(Component2, wrapperProps, statics, isFunction) {
|
|
40
40
|
const RootComponent = Component2[ROOT_COMPONENT];
|
|
41
|
-
const getterMethodName = getterMethodNameByDisplayName(Component2
|
|
42
|
-
const getterMethod =
|
|
43
|
-
const useGetterIndex =
|
|
41
|
+
const getterMethodName = getterMethodNameByDisplayName(Component2?.displayName);
|
|
42
|
+
const getterMethod = RootComponent?.prototype ? RootComponent.prototype[getterMethodName] : void 0;
|
|
43
|
+
const useGetterIndex = getterMethod?.length >= 2;
|
|
44
44
|
function WrapperForwardRefWithBind({
|
|
45
45
|
forwardRef = null,
|
|
46
46
|
...other
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { CHILDREN_COMPONENT, CONTEXT_COMPONENT } from "../core-types/symbols.mjs";
|
|
3
|
-
const CHILDREN_SELF = Symbol("CHILDREN_SELF");
|
|
3
|
+
const CHILDREN_SELF = /* @__PURE__ */ Symbol("CHILDREN_SELF");
|
|
4
4
|
const GETTER_REG = /^get[\w]+Props$/;
|
|
5
5
|
function splitPropsAndGetters(props) {
|
|
6
6
|
return Object.entries(props).reduce((acc, [key, value]) => {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
function Enhancement() {
|
|
2
2
|
return {
|
|
3
3
|
condition: function(Component) {
|
|
4
|
-
|
|
5
|
-
return Boolean((_a = Component.enhance) == null ? void 0 : _a.length);
|
|
4
|
+
return Boolean(Component.enhance?.length);
|
|
6
5
|
},
|
|
7
6
|
wrapperProps: function(props, WrapperComponent) {
|
|
8
7
|
return WrapperComponent.enhance.reduce((acc, enhance) => enhance(acc), props);
|
|
@@ -26,9 +26,9 @@ function flatGetterMethodNames(childComponents, parentName) {
|
|
|
26
26
|
return acc;
|
|
27
27
|
}, []);
|
|
28
28
|
}
|
|
29
|
-
const STATIC_COMPONENT = Symbol("STATIC_COMPONENT");
|
|
30
|
-
const ROOT_COMPONENT = Symbol("ROOT_COMPONENT");
|
|
31
|
-
const SELF_GETTER_METHOD = Symbol("SELF_GETTER_METHOD");
|
|
29
|
+
const STATIC_COMPONENT = /* @__PURE__ */ Symbol("STATIC_COMPONENT");
|
|
30
|
+
const ROOT_COMPONENT = /* @__PURE__ */ Symbol("ROOT_COMPONENT");
|
|
31
|
+
const SELF_GETTER_METHOD = /* @__PURE__ */ Symbol("SELF_GETTER_METHOD");
|
|
32
32
|
function Enhancement(childComponents, createComponent, options) {
|
|
33
33
|
const getterMethodNames = flatGetterMethodNames(childComponents);
|
|
34
34
|
return {
|
|
@@ -2,8 +2,8 @@ import React from "react";
|
|
|
2
2
|
import { STATIC_COMPONENT } from "./staticChildren.mjs";
|
|
3
3
|
import "../styled/index.mjs";
|
|
4
4
|
import { sstyled } from "../styled/sstyled.mjs";
|
|
5
|
-
const STYLES_CONTEXT = Symbol("STYLES_CONTEXT");
|
|
6
|
-
const STYLES_SELF = Symbol("STYLES_SELF");
|
|
5
|
+
const STYLES_CONTEXT = /* @__PURE__ */ Symbol("STYLES_CONTEXT");
|
|
6
|
+
const STYLES_SELF = /* @__PURE__ */ Symbol("STYLES_SELF");
|
|
7
7
|
function Enhancement(childComponents, Context) {
|
|
8
8
|
return {
|
|
9
9
|
condition: function(Component) {
|
|
@@ -55,7 +55,7 @@ function uncontrolledUniversal(props, config, uncontrolledProp2) {
|
|
|
55
55
|
[propName]: value,
|
|
56
56
|
[handlerName]: (eventOrValue, ...args) => {
|
|
57
57
|
const result2 = [setter(eventOrValue, ...args), ...args];
|
|
58
|
-
if (eventOrValue
|
|
58
|
+
if (eventOrValue?.target) {
|
|
59
59
|
result2.push(eventOrValue);
|
|
60
60
|
}
|
|
61
61
|
return handler(...result2);
|
|
@@ -109,7 +109,7 @@ sstyled.css = function(_css) {
|
|
|
109
109
|
sstyled.insert = insert;
|
|
110
110
|
sstyled.merge = merge;
|
|
111
111
|
sstyled.getStyles = getStyles;
|
|
112
|
-
sstyled.SHADOW_STYLES = Symbol("SHADOW_STYLES");
|
|
112
|
+
sstyled.SHADOW_STYLES = /* @__PURE__ */ Symbol("SHADOW_STYLES");
|
|
113
113
|
export {
|
|
114
114
|
sstyled
|
|
115
115
|
};
|
|
@@ -54,7 +54,7 @@ function assignProps(props = {}, source = {}) {
|
|
|
54
54
|
}
|
|
55
55
|
const sourceDescriptorRef = Object.getOwnPropertyDescriptor(source, "ref");
|
|
56
56
|
const propsDescriptorRef = Object.getOwnPropertyDescriptor(props, "ref");
|
|
57
|
-
if (
|
|
57
|
+
if (sourceDescriptorRef?.configurable && propsDescriptorRef?.configurable) {
|
|
58
58
|
newProps.ref = forkRef(source.ref, props.ref);
|
|
59
59
|
}
|
|
60
60
|
if (props.forwardRef) {
|
package/lib/esm/utils/ref.mjs
CHANGED
package/lib/styled/sstyled.mjs
CHANGED
|
@@ -109,7 +109,7 @@ sstyled.css = function(_css) {
|
|
|
109
109
|
sstyled.insert = insert;
|
|
110
110
|
sstyled.merge = merge;
|
|
111
111
|
sstyled.getStyles = getStyles;
|
|
112
|
-
sstyled.SHADOW_STYLES = Symbol("SHADOW_STYLES");
|
|
112
|
+
sstyled.SHADOW_STYLES = /* @__PURE__ */ Symbol("SHADOW_STYLES");
|
|
113
113
|
export {
|
|
114
114
|
sstyled
|
|
115
115
|
};
|
|
@@ -54,7 +54,7 @@ function assignProps(props = {}, source = {}) {
|
|
|
54
54
|
}
|
|
55
55
|
const sourceDescriptorRef = Object.getOwnPropertyDescriptor(source, "ref");
|
|
56
56
|
const propsDescriptorRef = Object.getOwnPropertyDescriptor(props, "ref");
|
|
57
|
-
if (
|
|
57
|
+
if (sourceDescriptorRef?.configurable && propsDescriptorRef?.configurable) {
|
|
58
58
|
newProps.ref = forkRef(source.ref, props.ref);
|
|
59
59
|
}
|
|
60
60
|
if (props.forwardRef) {
|
package/lib/utils/ref.mjs
CHANGED
package/package.json
CHANGED