@semcore/core 16.0.0-prerelease.2 → 16.0.0-prerelease.4

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 (35) hide show
  1. package/lib/esm/LastInteractionType.mjs +42 -0
  2. package/lib/esm/core-types/Component.mjs +40 -0
  3. package/lib/esm/core-types/symbols.mjs +12 -0
  4. package/lib/esm/coreFactory.mjs +235 -0
  5. package/lib/esm/enhancement/Children.mjs +72 -0
  6. package/lib/esm/enhancement/Root.mjs +43 -0
  7. package/lib/esm/enhancement/bindHandler.mjs +44 -0
  8. package/lib/esm/enhancement/dataName.mjs +13 -0
  9. package/lib/esm/enhancement/enhance.mjs +16 -0
  10. package/lib/esm/enhancement/functionDefaultProps.mjs +19 -0
  11. package/lib/esm/enhancement/hoistProps.mjs +58 -0
  12. package/lib/esm/enhancement/i18n.mjs +18 -0
  13. package/lib/esm/enhancement/inheritedName.mjs +16 -0
  14. package/lib/esm/enhancement/staticChildren.mjs +78 -0
  15. package/lib/esm/enhancement/style.mjs +38 -0
  16. package/lib/esm/enhancement/uncontrolledProps.mjs +88 -0
  17. package/lib/esm/index.mjs +23 -0
  18. package/lib/esm/register.mjs +24 -0
  19. package/lib/esm/styled/reshadow-core.mjs +16 -0
  20. package/lib/esm/styled/sstyled.mjs +78 -0
  21. package/lib/esm/utils/assignProps.mjs +42 -0
  22. package/lib/esm/utils/canUseDOM.mjs +6 -0
  23. package/lib/esm/utils/capitalizeFirstLetter.mjs +6 -0
  24. package/lib/esm/utils/enhances/WithI18n.mjs +48 -0
  25. package/lib/esm/utils/logger.mjs +27 -0
  26. package/lib/esm/utils/pick.mjs +10 -0
  27. package/lib/esm/utils/ref.mjs +34 -0
  28. package/lib/esm/utils/use/useEnhancedEffect.mjs +6 -0
  29. package/package.json +1 -2
  30. package/vite.config.ts +15 -0
  31. package/lib/esm/_virtual/_commonjsHelpers.mjs +0 -6
  32. package/lib/esm/_virtual/index.mjs +0 -4
  33. package/lib/esm/_virtual/index2.mjs +0 -4
  34. package/lib/esm/_virtual/react-is.development.mjs +0 -4
  35. package/lib/esm/_virtual/react-is.production.min.mjs +0 -4
@@ -0,0 +1,42 @@
1
+ import t from "@babel/runtime/helpers/esm/classCallCheck";
2
+ import n from "@babel/runtime/helpers/esm/createClass";
3
+ import s from "@babel/runtime/helpers/esm/defineProperty";
4
+ import u from "./utils/canUseDOM.mjs";
5
+ var a = /* @__PURE__ */ function() {
6
+ function o() {
7
+ t(this, o), s(this, "lastFocusSource", "none"), this.handleKeyDown = this.handleKeyDown.bind(this), this.handleMouseDown = this.handleMouseDown.bind(this), u() && (document.addEventListener("mousedown", this.handleMouseDown, {
8
+ capture: !0
9
+ }), document.addEventListener("keydown", this.handleKeyDown, {
10
+ capture: !0
11
+ }));
12
+ }
13
+ return n(o, [{
14
+ key: "type",
15
+ get: function() {
16
+ return this.lastFocusSource;
17
+ }
18
+ }, {
19
+ key: "isKeyboard",
20
+ value: function() {
21
+ return this.lastFocusSource === "keyboard";
22
+ }
23
+ }, {
24
+ key: "isMouse",
25
+ value: function() {
26
+ return this.lastFocusSource === "mouse";
27
+ }
28
+ }, {
29
+ key: "handleMouseDown",
30
+ value: function() {
31
+ this.lastFocusSource = "mouse";
32
+ }
33
+ }, {
34
+ key: "handleKeyDown",
35
+ value: function() {
36
+ this.lastFocusSource = "keyboard";
37
+ }
38
+ }]), o;
39
+ }(), d = new a();
40
+ export {
41
+ d as lastInteraction
42
+ };
@@ -0,0 +1,40 @@
1
+ import c from "@babel/runtime/helpers/esm/classCallCheck";
2
+ import l from "@babel/runtime/helpers/esm/createClass";
3
+ import p from "@babel/runtime/helpers/esm/assertThisInitialized";
4
+ import f from "@babel/runtime/helpers/esm/inherits";
5
+ import u from "@babel/runtime/helpers/esm/createSuper";
6
+ import m from "@babel/runtime/helpers/esm/defineProperty";
7
+ import { PureComponent as g } from "react";
8
+ var _ = void 0, v = /* @__PURE__ */ function(o) {
9
+ f(t, o);
10
+ var r = u(t);
11
+ function t() {
12
+ for (var n, a = arguments.length, i = new Array(a), e = 0; e < a; e++)
13
+ i[e] = arguments[e];
14
+ return c(this, t), n = r.call.apply(r, [this].concat(i)), m(p(n), "Root", void 0), m(p(n), "isControlled", !1), n;
15
+ }
16
+ return l(t, [{
17
+ key: "handlers",
18
+ get: function() {
19
+ return {};
20
+ }
21
+ }, {
22
+ key: "asProps",
23
+ get: function() {
24
+ return {};
25
+ }
26
+ }]), t;
27
+ }(g), w = v, s;
28
+ (function(o) {
29
+ var r;
30
+ r || (r = o.InternalTypings || (o.InternalTypings = {}));
31
+ })(s || (s = {}));
32
+ var P = function(r) {
33
+ return r;
34
+ };
35
+ export {
36
+ w as Component,
37
+ s as Intergalactic,
38
+ _ as Root,
39
+ P as wrapIntergalacticComponent
40
+ };
@@ -0,0 +1,12 @@
1
+ var E = Symbol("CORE_COMPONENT"), N = Symbol("CORE_INSTANCE"), O = Symbol("CORE_AS_PROPS"), C = Symbol("CORE_INIT"), T = Symbol("CONTEXT_COMPONENT"), _ = Symbol("CREATE_COMPONENT"), R = Symbol("PARENT_COMPONENTS"), S = Symbol("CHILDREN_COMPONENT"), P = Symbol("INHERITED_NAME");
2
+ export {
3
+ S as CHILDREN_COMPONENT,
4
+ T as CONTEXT_COMPONENT,
5
+ O as CORE_AS_PROPS,
6
+ E as CORE_COMPONENT,
7
+ C as CORE_INIT,
8
+ N as CORE_INSTANCE,
9
+ _ as CREATE_COMPONENT,
10
+ P as INHERITED_NAME,
11
+ R as PARENT_COMPONENTS
12
+ };
@@ -0,0 +1,235 @@
1
+ import S from "@babel/runtime/helpers/esm/toConsumableArray";
2
+ import g from "@babel/runtime/helpers/esm/objectSpread2";
3
+ import C from "@babel/runtime/helpers/esm/get";
4
+ import x from "@babel/runtime/helpers/esm/getPrototypeOf";
5
+ import j from "@babel/runtime/helpers/esm/classCallCheck";
6
+ import F from "@babel/runtime/helpers/esm/createClass";
7
+ import N from "@babel/runtime/helpers/esm/assertThisInitialized";
8
+ import D from "@babel/runtime/helpers/esm/inherits";
9
+ import k from "@babel/runtime/helpers/esm/createSuper";
10
+ import O from "@babel/runtime/helpers/esm/defineProperty";
11
+ import $ from "@babel/runtime/helpers/esm/extends";
12
+ import W from "@babel/runtime/helpers/esm/objectWithoutProperties";
13
+ import p from "react";
14
+ import G from "hoist-non-react-statics";
15
+ import { useForkRef as I } from "./utils/ref.mjs";
16
+ import Q from "./utils/use/useEnhancedEffect.mjs";
17
+ import U from "./utils/assignProps.mjs";
18
+ import { Component as V } from "./core-types/Component.mjs";
19
+ import Y from "./enhancement/Children.mjs";
20
+ import Z from "./enhancement/Root.mjs";
21
+ import rr from "./enhancement/uncontrolledProps.mjs";
22
+ import er from "./enhancement/functionDefaultProps.mjs";
23
+ import tr, { ROOT_COMPONENT as nr, getterMethodNameByDisplayName as or, STATIC_COMPONENT as z } from "./enhancement/staticChildren.mjs";
24
+ import ar from "./enhancement/inheritedName.mjs";
25
+ import sr from "./enhancement/hoistProps.mjs";
26
+ import ur from "./enhancement/dataName.mjs";
27
+ import ir from "./enhancement/enhance.mjs";
28
+ import fr from "./enhancement/style.mjs";
29
+ import cr from "./enhancement/bindHandler.mjs";
30
+ import pr from "./enhancement/i18n.mjs";
31
+ import { PARENT_COMPONENTS as b, CORE_COMPONENT as T, CONTEXT_COMPONENT as mr, CREATE_COMPONENT as lr, CORE_AS_PROPS as w, CORE_INSTANCE as dr, CORE_INIT as M } from "./core-types/symbols.mjs";
32
+ var vr = ["forwardRef"], hr = ["forwardRef", "__WRAPPER_PROPS_BIND__"], _r = ["ref"];
33
+ function L(r) {
34
+ return Object.getOwnPropertyNames(r).length === 0 && Object.getOwnPropertySymbols && // For IE 11
35
+ Object.getOwnPropertySymbols(r).length === 0 && Object.getPrototypeOf(r) === Object.prototype;
36
+ }
37
+ function X(r, e, c) {
38
+ return function(u) {
39
+ return r.filter(function(d) {
40
+ return d.condition ? d.condition(e, c) : !0;
41
+ }).reduce(function(d, m) {
42
+ return m[u] && d.push(m[u]), d;
43
+ }, []);
44
+ };
45
+ }
46
+ function q(r, e, c, o) {
47
+ var u = r[nr], d = or(r == null ? void 0 : r.displayName), m = u != null && u.prototype ? u.prototype[d] : void 0, P = (m == null ? void 0 : m.length) >= 2;
48
+ function y(s, v) {
49
+ var n = s.forwardRef, l = n === void 0 ? null : n, i = W(s, vr);
50
+ return /* @__PURE__ */ p.createElement(E, $({}, i, {
51
+ forwardRef: I(v, l)
52
+ }));
53
+ }
54
+ function _(s, v) {
55
+ var n = s.forwardRef, l = n === void 0 ? null : n, i = s.__WRAPPER_PROPS_BIND__, a = W(s, hr), f = (i || e).reduce(function(J, K) {
56
+ return K(J, t, o);
57
+ }, a), h = f.ref, R = h === void 0 ? null : h, A = W(f, _r);
58
+ return /* @__PURE__ */ p.createElement(r, $({}, A, {
59
+ forwardRef: I(R, v, l)
60
+ }));
61
+ }
62
+ var E = /* @__PURE__ */ function(s) {
63
+ D(n, s);
64
+ var v = k(n);
65
+ function n() {
66
+ var l;
67
+ j(this, n);
68
+ for (var i = arguments.length, a = new Array(i), f = 0; f < i; f++)
69
+ a[f] = arguments[f];
70
+ return l = v.call.apply(v, [this].concat(a)), O(N(l), "index", -1), l;
71
+ }
72
+ return F(n, [{
73
+ key: "render",
74
+ value: function() {
75
+ var i = this;
76
+ return /* @__PURE__ */ p.createElement(_, $({}, this.props, {
77
+ __WRAPPER_PROPS_BIND__: e.map(function(a) {
78
+ return a.bind(i);
79
+ })
80
+ }));
81
+ }
82
+ }]), n;
83
+ }(p.Component), t = /* @__PURE__ */ p.forwardRef(P ? y : _);
84
+ return G(t, r), t.displayName = r.displayName, t.defaultProps = r.defaultProps, c.forEach(function(s) {
85
+ return Object.assign(t, s(t, r, o));
86
+ }), t;
87
+ }
88
+ function Pr(r, e, c) {
89
+ var o = X(e, r, !1), u = o("init"), d = o("asProps"), m = o("render"), P = o("static"), y = o("wrapperProps"), _ = o("context"), E = /* @__PURE__ */ function(s) {
90
+ D(n, s);
91
+ var v = k(n);
92
+ function n(l, i) {
93
+ var a;
94
+ return j(this, n), a = v.call(this, l, i), O(N(a), w, null), O(N(a), dr, t), O(N(a), M, !1), u.forEach(function(f) {
95
+ return f.call(N(a), l, t, !1);
96
+ }), a[M] = !0, a;
97
+ }
98
+ return F(n, [{
99
+ key: "asProps",
100
+ get: function() {
101
+ var i = this;
102
+ if (!this[M])
103
+ throw new Error("Can not call asProps in constructor");
104
+ return this[w] || (this[w] = d.reduce(function(a, f) {
105
+ return f.call(i, a, t, !1);
106
+ }, this.props)), this[w];
107
+ }
108
+ }, {
109
+ key: "setContext",
110
+ value: function() {
111
+ var i = this, a = C(x(n.prototype), "setContext", this) ? C(x(n.prototype), "setContext", this).call(this) : {};
112
+ return _.reduce(function(f, h) {
113
+ return h.call(i, f, t, !1);
114
+ }, a);
115
+ }
116
+ }, {
117
+ key: "render",
118
+ value: function() {
119
+ var i = this;
120
+ if (this[w] = null, !C(x(n.prototype), "render", this))
121
+ throw new Error("Component `render` method is not defined");
122
+ var a = this.asProps, f = this.setContext(), h = m.reduce(function(R, A) {
123
+ return A.call(i, R, a, t, !1);
124
+ }, C(x(n.prototype), "render", this).call(this));
125
+ return !t[z] && !L(f) ? /* @__PURE__ */ p.createElement(c.Provider, {
126
+ value: g(g({}, a), f)
127
+ }, h) : h;
128
+ }
129
+ }]), n;
130
+ }(r), t = q(E, y, P, !1);
131
+ return t;
132
+ }
133
+ function H(r, e, c) {
134
+ var o = X(e, r, !0), u = o("init"), d = o("asProps"), m = o("render"), P = o("static"), y = o("wrapperProps"), _ = o("context"), E = /* @__PURE__ */ p.memo(function(v) {
135
+ var n = p.useRef({}), l = p.useRef(!0);
136
+ Q(function() {
137
+ l.current = !1;
138
+ }, []), l.current && u.forEach(function(h) {
139
+ return h.call(n.current, v, t, !0);
140
+ });
141
+ var i = d.reduce(function(h, R) {
142
+ return R.call(n.current, h, t, !0);
143
+ }, v), a = _.reduce(function(h, R) {
144
+ return R.call(n.current, h, t, !0);
145
+ }, {}), f = m.reduce(function(h, R) {
146
+ return R.call(n.current, h, i, t, !0);
147
+ }, /* @__PURE__ */ p.createElement(r, i));
148
+ return !t[z] && !L(a) ? /* @__PURE__ */ p.createElement(c.Provider, {
149
+ value: g(g({}, i), a)
150
+ }, f) : f;
151
+ });
152
+ Object.assign(E, r);
153
+ var t = q(E, y, P, !0);
154
+ return t;
155
+ }
156
+ function Er(r, e, c) {
157
+ var o = function(d) {
158
+ var m = d.Root, P = r.defaultProps || {};
159
+ return /* @__PURE__ */ p.createElement(m, $({}, P, {
160
+ render: r
161
+ }));
162
+ };
163
+ return G(o, r), o.displayName = r.displayName, H(o, e, c);
164
+ }
165
+ function Rr(r, e, c) {
166
+ if (p.PureComponent.isPrototypeOf(r) || p.Component.isPrototypeOf(r)) {
167
+ if (r.prototype instanceof V)
168
+ return Pr(r, c, e);
169
+ throw new Error("Must inherit from our component");
170
+ } else {
171
+ if (typeof r == "function")
172
+ return H(r, c, e);
173
+ if (r[T])
174
+ return Er(r, c, e);
175
+ throw new Error("Must be a React component");
176
+ }
177
+ }
178
+ function Yr(r, e) {
179
+ return U(e, r);
180
+ }
181
+ function B(r) {
182
+ var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, c = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, o = c.context, u = o === void 0 ? /* @__PURE__ */ p.createContext({}) : o, d = c.parent, m = d === void 0 ? [] : d, P = c.enhancements, y = P === void 0 ? [] : P, _ = Array.isArray(m) ? m : [m];
183
+ if (_.length) {
184
+ var E = _.reduce(function(s, v) {
185
+ return v[b] && (s = [].concat(S(v[b]), S(s))), s;
186
+ }, _);
187
+ r[b] = E, _ = E;
188
+ }
189
+ r[T] && _.push(r);
190
+ var t = Rr(r, u, [].concat(S(y.map(function(s) {
191
+ return s(u, _, B, e);
192
+ })), [
193
+ pr(),
194
+ cr(),
195
+ Y(u, _),
196
+ // root must be under the children
197
+ Z(),
198
+ rr(),
199
+ tr(e, B, {
200
+ context: u,
201
+ parent: m,
202
+ enhancements: y
203
+ }),
204
+ // functionDefaultProps must be under the staticChild
205
+ er(),
206
+ // inheritedName must be under the staticChild
207
+ ar(),
208
+ // dataName must be under the staticChild
209
+ ur(),
210
+ // enhanceEnhancement must be under the functionDefaultPropsEnhancement
211
+ ir(),
212
+ fr(e, u),
213
+ // must be the last one so any properties can be raised
214
+ sr(e, u)
215
+ ]));
216
+ return t[mr] = u, t._______childrenComponents = e, t[lr] = function() {
217
+ var s = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : r, v = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : e, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : c;
218
+ return B(s, v, n);
219
+ }, t[T] = !0, t;
220
+ }
221
+ function Zr(r) {
222
+ var e = null;
223
+ if (!p.PureComponent.isPrototypeOf(r) && !p.Component.isPrototypeOf(r) && typeof r == "function")
224
+ e = /* @__PURE__ */ p.forwardRef(r), e.displayName = r.displayName, e.defaultProps = g({
225
+ "data-ui-name": r.displayName
226
+ }, r.defaultProps), e[T] = !0;
227
+ else
228
+ throw new Error("createBaseComponent accepts only functional component");
229
+ return e;
230
+ }
231
+ export {
232
+ Yr as assignProps,
233
+ Zr as createBaseComponent,
234
+ B as createComponent
235
+ };
@@ -0,0 +1,72 @@
1
+ import h from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
+ import d from "@babel/runtime/helpers/esm/toConsumableArray";
3
+ import i from "@babel/runtime/helpers/esm/objectSpread2";
4
+ import E from "@babel/runtime/helpers/esm/slicedToArray";
5
+ import P from "react";
6
+ import { CONTEXT_COMPONENT as T, CHILDREN_COMPONENT as y } from "../core-types/symbols.mjs";
7
+ var x = ["handlers", "getters"], G = ["handlers"], f = Symbol("CHILDREN_SELF"), R = /^get[\w]+Props$/;
8
+ function L(e) {
9
+ return Object.entries(e).reduce(function(t, o) {
10
+ var n = E(o, 2), r = n[0], s = n[1];
11
+ return R.exec(r) === null ? t.props[r] = s : t.getters[r] = s, t;
12
+ }, {
13
+ props: {},
14
+ getters: {}
15
+ });
16
+ }
17
+ function C(e) {
18
+ return Array.isArray(e) ? e : typeof e == "function" ? [e] : [];
19
+ }
20
+ function S() {
21
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, o = i(i({}, e), t);
22
+ return Object.keys(o).reduce(function(n, r) {
23
+ return e[r] = C(e[r]), t[r] = C(t[r]), n[r] = [].concat(d(e[r]), d(t[r])), n;
24
+ }, {});
25
+ }
26
+ function D(e) {
27
+ return function() {
28
+ var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
29
+ return e.reduce(function(o, n) {
30
+ return n(o);
31
+ }, t);
32
+ };
33
+ }
34
+ function H(e, t) {
35
+ var o = function n() {
36
+ var r = n.origin;
37
+ if (typeof r == "function") {
38
+ var s = [].concat(d(t), [e]).reduce(function(u, l) {
39
+ var a = P.useContext(l), p = a.handlers, c = h(a, G), v = L(c), j = v.props, N = v.getters;
40
+ return Object.assign({}, u, i({
41
+ handlers: Object.assign({}, u.handlers, p),
42
+ getters: S(u.getters, N)
43
+ }, j));
44
+ }, n.props), m = s.handlers, b = m === void 0 ? {} : m, g = s.getters, O = g === void 0 ? {} : g, _ = h(s, x), A = Object.entries(O).reduce(function(u, l) {
45
+ var a = E(l, 2), p = a[0], c = a[1];
46
+ return u[p] = D(c), u;
47
+ }, {});
48
+ return r(i(i({}, _), A), b);
49
+ } else if (r === void 0)
50
+ return null;
51
+ return r;
52
+ };
53
+ return o.origin = null, o.props = {}, o[y] = !0, o;
54
+ }
55
+ function X(e, t) {
56
+ return {
57
+ init: function() {
58
+ var n = (Array.isArray(t) ? t : [t]).map(function(r) {
59
+ return r[T];
60
+ }).filter(Boolean);
61
+ this[f] = H(e, n);
62
+ },
63
+ asProps: function(n) {
64
+ return this[f].origin = n.children, this[f].props = n, i(i({}, n), {}, {
65
+ Children: this[f]
66
+ });
67
+ }
68
+ };
69
+ }
70
+ export {
71
+ X as default
72
+ };
@@ -0,0 +1,43 @@
1
+ import n from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import E from "@babel/runtime/helpers/esm/slicedToArray";
3
+ import m from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
+ import t from "react";
5
+ import P from "../utils/assignProps.mjs";
6
+ import { useForkRef as y } from "../utils/ref.mjs";
7
+ var C = ["render"], b = ["Root", "styles", "children", "Children", "forwardRef"];
8
+ function j() {
9
+ var e = /* @__PURE__ */ t.forwardRef(function(r, a) {
10
+ var i = r.render, R = m(r, C), o = e.props;
11
+ o.Root, o.styles, o.children;
12
+ var d = o.Children, f = o.forwardRef, h = f === void 0 ? null : f, v = m(o, b), w = Object.entries(v).reduce(function(u, _) {
13
+ var s = E(_, 2), g = s[0], l = s[1];
14
+ return l !== void 0 && (u[g] = l), u;
15
+ }, {}), p = {};
16
+ typeof d.origin < "u" && (p.children = /* @__PURE__ */ t.createElement(d, null));
17
+ var c = P(n(n({}, w), {}, {
18
+ ref: y(h, a)
19
+ }), n(n({}, p), R));
20
+ if (!i)
21
+ throw new Error("`render` prop of Root is not provided");
22
+ return i === t.Fragment ? /* @__PURE__ */ t.createElement(t.Fragment, null, c.children) : /* @__PURE__ */ t.createElement(i, c);
23
+ });
24
+ return e.props = {}, e;
25
+ }
26
+ function A() {
27
+ return {
28
+ init: function() {
29
+ this.Root = j();
30
+ },
31
+ asProps: function(r, a, i) {
32
+ return i ? n(n({}, r), {}, {
33
+ Root: this.Root
34
+ }) : r;
35
+ },
36
+ render: function(r, a) {
37
+ return this.Root.props = a, r;
38
+ }
39
+ };
40
+ }
41
+ export {
42
+ A as default
43
+ };
@@ -0,0 +1,44 @@
1
+ function f(t, r) {
2
+ if (t.length !== r.length) return !1;
3
+ for (var n = 0; n < t.length; n++)
4
+ if (t[n] !== r[n]) return !1;
5
+ return !0;
6
+ }
7
+ function e(t) {
8
+ return function() {
9
+ for (var r = arguments.length, n = new Array(r), i = 0; i < r; i++)
10
+ n[i] = arguments[i];
11
+ var a = [];
12
+ if (e.hasher.has(t)) {
13
+ a = e.hasher.get(t);
14
+ var u = a.find(function(o) {
15
+ return f(o.deps, n);
16
+ });
17
+ if (u) return u.fn;
18
+ }
19
+ var h = t.apply(void 0, n).bind(t);
20
+ return a.push({
21
+ deps: n,
22
+ fn: h
23
+ }), e.hasher.set(t, a), h;
24
+ };
25
+ }
26
+ e.hasher = /* @__PURE__ */ new WeakMap();
27
+ function s() {
28
+ return {
29
+ condition: function(r, n) {
30
+ return !n;
31
+ },
32
+ init: function() {
33
+ var r = this;
34
+ Object.keys(this).filter(function(n) {
35
+ return n.startsWith("bindHandler");
36
+ }).forEach(function(n) {
37
+ r[n] = e(r[n].bind(r));
38
+ });
39
+ }
40
+ };
41
+ }
42
+ export {
43
+ s as default
44
+ };
@@ -0,0 +1,13 @@
1
+ import a from "@babel/runtime/helpers/esm/objectSpread2";
2
+ function t() {
3
+ return {
4
+ wrapperProps: function(r, e) {
5
+ return a({
6
+ "data-ui-name": e.displayName
7
+ }, r);
8
+ }
9
+ };
10
+ }
11
+ export {
12
+ t as default
13
+ };
@@ -0,0 +1,16 @@
1
+ function c() {
2
+ return {
3
+ condition: function(e) {
4
+ var n;
5
+ return !!(!((n = e.enhance) === null || n === void 0) && n.length);
6
+ },
7
+ wrapperProps: function(e, n) {
8
+ return n.enhance.reduce(function(r, t) {
9
+ return t(r);
10
+ }, e);
11
+ }
12
+ };
13
+ }
14
+ export {
15
+ c as default
16
+ };
@@ -0,0 +1,19 @@
1
+ function n() {
2
+ var e = {};
3
+ return {
4
+ condition: function(t) {
5
+ return t.defaultProps ? typeof t.defaultProps == "function" ? !0 : !!Object.keys(t.defaultProps).length : !1;
6
+ },
7
+ static: function(t) {
8
+ return e = t.defaultProps, {
9
+ defaultProps: {}
10
+ };
11
+ },
12
+ wrapperProps: function(t) {
13
+ return typeof e == "function" ? Object.assign({}, e(t), t) : Object.assign({}, e, t);
14
+ }
15
+ };
16
+ }
17
+ export {
18
+ n as default
19
+ };
@@ -0,0 +1,58 @@
1
+ import _ from "@babel/runtime/helpers/esm/slicedToArray";
2
+ import E from "@babel/runtime/helpers/esm/defineProperty";
3
+ import d from "@babel/runtime/helpers/esm/objectSpread2";
4
+ import O from "@babel/runtime/helpers/esm/toConsumableArray";
5
+ import S from "react";
6
+ import P from "../utils/assignProps.mjs";
7
+ import H from "../utils/use/useEnhancedEffect.mjs";
8
+ import I from "../utils/pick.mjs";
9
+ var h = Symbol("HOIST_CONTEXT"), p = Symbol("HOIST_SELF"), T = Symbol("HOIST_SET");
10
+ function y(l) {
11
+ return Object.values(l).reduce(function(e, r) {
12
+ return Array.isArray(r) ? (e.push(r[0]), e.push.apply(e, O(y(r[1])))) : e.push(r), e;
13
+ }, []);
14
+ }
15
+ function w(l, e) {
16
+ return {
17
+ condition: function(t) {
18
+ return [t].concat(O(y(l))).some(function(s) {
19
+ var o;
20
+ return !!(!((o = s.hoistProps) === null || o === void 0) && o.length);
21
+ });
22
+ },
23
+ init: function(t, s, o) {
24
+ var n = this;
25
+ o ? this[p] = S.useState({}) : this[p] = [{}, function(i) {
26
+ n[p][0] = i, n.forceUpdate();
27
+ }], this[T] = function(i) {
28
+ n[p][1](i);
29
+ };
30
+ },
31
+ context: function(t) {
32
+ return d(d({}, t), {}, E({}, h, this[T]));
33
+ },
34
+ asProps: function(t) {
35
+ return P(this[p][0], t);
36
+ },
37
+ wrapperProps: function(t, s) {
38
+ var o;
39
+ if ((o = s.hoistProps) !== null && o !== void 0 && o.length) {
40
+ var n = S.useContext(e), i = s.hoistProps.reduce(function(u, c) {
41
+ var a = c.split(":"), f = _(a, 2), m = f[0], b = f[1];
42
+ return u[m] = b || m, u;
43
+ }, {}), v = Object.entries(I(t, Object.keys(i))).reduce(function(u, c) {
44
+ var a = _(c, 2), f = a[0], m = a[1];
45
+ return u[i[f]] = m, u;
46
+ }, {});
47
+ H(function() {
48
+ n[h] && n[h](v);
49
+ }, Object.values(v));
50
+ }
51
+ return t;
52
+ }
53
+ };
54
+ }
55
+ export {
56
+ h as HOIST_CONTEXT,
57
+ w as default
58
+ };
@@ -0,0 +1,18 @@
1
+ import t from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import c from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
+ import l from "react";
4
+ import { Context as n } from "../utils/enhances/WithI18n.mjs";
5
+ var i = ["locale"];
6
+ function x() {
7
+ return {
8
+ wrapperProps: function(o) {
9
+ var e = o.locale, a = c(o, i), r = l.useContext(n);
10
+ return !e && !r ? o : t(t({}, a), {}, {
11
+ locale: e ?? r
12
+ });
13
+ }
14
+ };
15
+ }
16
+ export {
17
+ x as default
18
+ };
@@ -0,0 +1,16 @@
1
+ import r from "@babel/runtime/helpers/esm/defineProperty";
2
+ import n from "@babel/runtime/helpers/esm/toConsumableArray";
3
+ import { INHERITED_NAME as o } from "../core-types/symbols.mjs";
4
+ function m() {
5
+ return {
6
+ condition: function(t) {
7
+ return !!t.displayName;
8
+ },
9
+ static: function(t) {
10
+ return r({}, o, n(new Set([].concat(n(t[o] || []), [t.displayName]))));
11
+ }
12
+ };
13
+ }
14
+ export {
15
+ m as default
16
+ };
@@ -0,0 +1,78 @@
1
+ import v from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import E from "@babel/runtime/helpers/esm/toConsumableArray";
3
+ import N from "@babel/runtime/helpers/esm/slicedToArray";
4
+ import x from "react";
5
+ import M from "../utils/assignProps.mjs";
6
+ import y from "../utils/pick.mjs";
7
+ import b from "../utils/logger.mjs";
8
+ function P(i, s) {
9
+ return Object.defineProperties(i, Object.keys(s).reduce(function(n, c) {
10
+ return n[c] = Object.getOwnPropertyDescriptor(s, c), n;
11
+ }, {}));
12
+ }
13
+ function O(i) {
14
+ return "get".concat(i, "Props");
15
+ }
16
+ function p() {
17
+ var i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", s = i.split("."), n = s.slice(-(s.length - 1)).join("");
18
+ return O(n);
19
+ }
20
+ function T(i, s) {
21
+ return Object.entries(i).reduce(function(n, c) {
22
+ var d = N(c, 2), t = d[0], e = d[1];
23
+ return Array.isArray(e) && n.push.apply(n, E(T(e[1], t))), t = s ? "".concat(s).concat(t) : t, n.push(O(t)), n;
24
+ }, []);
25
+ }
26
+ var l = Symbol("STATIC_COMPONENT"), g = Symbol("ROOT_COMPONENT"), S = Symbol("SELF_GETTER_METHOD");
27
+ function C(i, s, n) {
28
+ var c = T(i);
29
+ return {
30
+ condition: function(t) {
31
+ return !!(t[l] || Object.keys(i).length);
32
+ },
33
+ init: function(t, e) {
34
+ var u = this, a = y(this, c);
35
+ this[S] = function() {
36
+ var o = p(e.displayName);
37
+ b.warn(!0, "Getter `".concat(o, "` can't be fired as it is a getter of static component"), t["data-ui-name"] || e.displayName);
38
+ }, P(this, c.reduce(function(o, f) {
39
+ var r = a[f];
40
+ return r && (o[f] = function() {
41
+ var h = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, m = r.call(u, h, o[f].index);
42
+ return M(h, m);
43
+ }, o[f].index = -1, o[f].cache = /* @__PURE__ */ new Set()), o;
44
+ }, {}));
45
+ },
46
+ static: function(t, e) {
47
+ if (Object.keys(i).length && !t.displayName)
48
+ throw new Error('"displayName" is not defined');
49
+ return Object.entries(i).reduce(function(u, a) {
50
+ var o = N(a, 2), f = o[0], r = o[1], h = {};
51
+ Array.isArray(r) && (h = r[1], r = r[0]);
52
+ var m = r[l], _ = r.displayName;
53
+ return r.displayName = "".concat(t.displayName, ".").concat(f), r[l] = !0, r[g] = e[g] || e, u[f] = s(r, h, n), r.displayName = _, r[l] = m, u;
54
+ }, {});
55
+ },
56
+ context: function(t) {
57
+ return v(v({}, t), y(this, c));
58
+ },
59
+ wrapperProps: function(t, e) {
60
+ if (!e[l]) return t;
61
+ var u = x.useContext(n.context), a = u[p(e.displayName)];
62
+ return a ? (a.cache.has(this) || (a.cache.add(this), a.index++, this && (this.index = a.index)), this && (a.index = this.index), a(t)) : t;
63
+ },
64
+ render: function(t) {
65
+ var e = this;
66
+ return c.forEach(function(u) {
67
+ e[u] !== void 0 && (e[u].index = -1, e[u].cache.clear());
68
+ }), t;
69
+ }
70
+ };
71
+ }
72
+ export {
73
+ g as ROOT_COMPONENT,
74
+ l as STATIC_COMPONENT,
75
+ C as default,
76
+ O as getterMethodName,
77
+ p as getterMethodNameByDisplayName
78
+ };
@@ -0,0 +1,38 @@
1
+ import i from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
+ import a from "@babel/runtime/helpers/esm/defineProperty";
3
+ import s from "@babel/runtime/helpers/esm/objectSpread2";
4
+ import f from "react";
5
+ import { STATIC_COMPONENT as m } from "./staticChildren.mjs";
6
+ import { sstyled as p } from "../styled/sstyled.mjs";
7
+ var S = ["_styles", "styles"], T = ["styles"], n = Symbol("STYLES_CONTEXT"), r = Symbol("STYLES_SELF");
8
+ function x(l, y) {
9
+ return {
10
+ condition: function(t) {
11
+ return !!(t.style || t[m]);
12
+ },
13
+ init: function(t, e) {
14
+ t.styles && (this[r] = t.styles), e.style && (this[r] = p.merge(e.style, t._styles));
15
+ },
16
+ context: function(t) {
17
+ return !this[r] || !Object.keys(l).length ? t : s(s({}, t), {}, a({}, n, this[r]));
18
+ },
19
+ asProps: function(t) {
20
+ t._styles, t.styles;
21
+ var e = i(t, S);
22
+ return s(s({}, e), {}, {
23
+ styles: this[r]
24
+ });
25
+ },
26
+ wrapperProps: function(t) {
27
+ var e = t.styles, c = i(t, T), u = f.useContext(y);
28
+ return s(s({}, c), {}, {
29
+ _styles: e,
30
+ styles: u[n]
31
+ });
32
+ }
33
+ };
34
+ }
35
+ export {
36
+ n as STYLES_CONTEXT,
37
+ x as default
38
+ };
@@ -0,0 +1,88 @@
1
+ import v from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import y from "@babel/runtime/helpers/esm/slicedToArray";
3
+ import K from "@babel/runtime/helpers/esm/toArray";
4
+ import L from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
+ import O from "@babel/runtime/helpers/esm/toPropertyKey";
6
+ import S from "@babel/runtime/helpers/esm/toConsumableArray";
7
+ import b from "@babel/runtime/helpers/esm/defineProperty";
8
+ import { callAllEventHandlers as T } from "../utils/assignProps.mjs";
9
+ import _ from "../utils/capitalizeFirstLetter.mjs";
10
+ function U(r, t) {
11
+ return Object.defineProperties(r, Object.keys(t).reduce(function(n, o) {
12
+ return n[o] = Object.getOwnPropertyDescriptor(t, o), n;
13
+ }, {}));
14
+ }
15
+ function W(r) {
16
+ return "default".concat(_(r));
17
+ }
18
+ function q(r) {
19
+ return r === "value" && (r = ""), r === "checked" && (r = ""), "on".concat(_(r), "Change");
20
+ }
21
+ function x(r) {
22
+ return r !== void 0;
23
+ }
24
+ function G(r, t, n, o, s, u) {
25
+ function e() {
26
+ return x(n) ? n : t in r.state ? r.state[t] : o;
27
+ }
28
+ return [e(), function(i) {
29
+ var f = e();
30
+ if (f === i) return !1;
31
+ x(n) || r.setState(b({}, t, i));
32
+ for (var a = arguments.length, h = new Array(a > 1 ? a - 1 : 0), l = 1; l < a; l++)
33
+ h[l - 1] = arguments[l];
34
+ return T.apply(void 0, [s].concat(S(u))).apply(void 0, [i].concat(h));
35
+ }];
36
+ }
37
+ function I(r, t, n) {
38
+ var o = {}, s = Object.keys(t).reduce(function(u, e) {
39
+ var i, f = q(e), a = W(e), h = u[a], l = u[e], D = u[f], E = L(u, [a, e, f].map(O));
40
+ h === void 0 && console.warn(a, 'must be installed in "defaultProps"');
41
+ var d = t[e], g = [];
42
+ if (Array.isArray(d)) {
43
+ var z = d, A = K(z);
44
+ d = A[0], g = A.slice(1);
45
+ }
46
+ d = d || function(c) {
47
+ return c;
48
+ };
49
+ var B = n(e, l, h, D, g), j = y(B, 2), F = j[0], w = j[1];
50
+ return o[e] = w, v(v({}, E), {}, (i = {}, b(i, e, F), b(i, f, function(c) {
51
+ for (var P = arguments.length, m = new Array(P > 1 ? P - 1 : 0), p = 1; p < P; p++)
52
+ m[p - 1] = arguments[p];
53
+ var H = [d.apply(void 0, [c].concat(m))].concat(m);
54
+ return c != null && c.target && H.push(c), w.apply(void 0, S(H));
55
+ }), i));
56
+ }, r);
57
+ return [s, o];
58
+ }
59
+ function C(r, t, n) {
60
+ return I(t, n, G.bind(void 0, r));
61
+ }
62
+ function k() {
63
+ return {
64
+ condition: function(t) {
65
+ return !!t.prototype.uncontrolledProps;
66
+ },
67
+ init: function() {
68
+ this.state = this.state || {}, U(this, {
69
+ get handlers() {
70
+ var t = C(this, this.props, this.uncontrolledProps()), n = y(t, 2), o = n[1];
71
+ return o;
72
+ }
73
+ });
74
+ },
75
+ context: function(t) {
76
+ return v(v({}, t), {}, {
77
+ handlers: this.handlers
78
+ });
79
+ },
80
+ asProps: function(t) {
81
+ var n = C(this, t, this.uncontrolledProps()), o = y(n, 1), s = o[0];
82
+ return s;
83
+ }
84
+ };
85
+ }
86
+ export {
87
+ k as default
88
+ };
@@ -0,0 +1,23 @@
1
+ import { assignProps as e, createBaseComponent as r, createComponent as a } from "./coreFactory.mjs";
2
+ import { Component as p, Intergalactic as C, Root as E, wrapIntergalacticComponent as N } from "./core-types/Component.mjs";
3
+ import { CHILDREN_COMPONENT as s, CONTEXT_COMPONENT as O, CORE_INSTANCE as T, CREATE_COMPONENT as c, INHERITED_NAME as f } from "./core-types/symbols.mjs";
4
+ import { default as x } from "./register.mjs";
5
+ import { lastInteraction as l } from "./LastInteractionType.mjs";
6
+ import { sstyled as _ } from "./styled/sstyled.mjs";
7
+ export {
8
+ s as CHILDREN_COMPONENT,
9
+ O as CONTEXT_COMPONENT,
10
+ T as CORE_INSTANCE,
11
+ c as CREATE_COMPONENT,
12
+ p as Component,
13
+ f as INHERITED_NAME,
14
+ C as Intergalactic,
15
+ E as Root,
16
+ e as assignProps,
17
+ r as createBaseComponent,
18
+ a as createComponent,
19
+ l as lastInteraction,
20
+ x as register,
21
+ _ as sstyled,
22
+ N as wrapIntergalacticComponent
23
+ };
@@ -0,0 +1,24 @@
1
+ import s from "@babel/runtime/helpers/esm/classCallCheck";
2
+ import a from "@babel/runtime/helpers/esm/createClass";
3
+ import n from "@babel/runtime/helpers/esm/defineProperty";
4
+ var o = /* @__PURE__ */ function() {
5
+ function e() {
6
+ s(this, e), n(this, "data", {});
7
+ }
8
+ return a(e, [{
9
+ key: "get",
10
+ value: function(t, r) {
11
+ return t in this.data ? this.data[t] : this.set(t, r);
12
+ }
13
+ }, {
14
+ key: "set",
15
+ value: function(t, r) {
16
+ return this.data[t] = r, this.data[t];
17
+ }
18
+ }]), e;
19
+ }();
20
+ const h = new o();
21
+ export {
22
+ o as Register,
23
+ h as default
24
+ };
@@ -0,0 +1,16 @@
1
+ import "@babel/runtime/helpers/esm/typeof";
2
+ import "@babel/runtime/helpers/esm/defineProperty";
3
+ var t = {}, n = function() {
4
+ return {
5
+ map: t,
6
+ get css() {
7
+ var e = "";
8
+ for (var r in t)
9
+ e += '<style type="text/css" id="'.concat(r, '">').concat(t[r], "</style>");
10
+ return e;
11
+ }
12
+ };
13
+ };
14
+ export {
15
+ n as getStyles
16
+ };
@@ -0,0 +1,78 @@
1
+ import g from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import l from "@babel/runtime/helpers/esm/slicedToArray";
3
+ import _ from "classnames";
4
+ import { getStyles as b } from "./reshadow-core.mjs";
5
+ var y = "__reshadow__", w = !(typeof window < "u" && window.document && window.document.createElement), m = b().map, E = function() {
6
+ return {
7
+ map: m,
8
+ get css() {
9
+ var i = "";
10
+ for (var n in m)
11
+ i += "<style type='text/css' id='".concat(n, "'>").concat(m[n], "</style>");
12
+ return i;
13
+ }
14
+ };
15
+ };
16
+ function O(a, i) {
17
+ var n = "reshadow-".concat(i);
18
+ if (w) {
19
+ m[n] = a;
20
+ return;
21
+ }
22
+ var t = document.getElementById(y);
23
+ t || (t = document.createElement("object"), t.id = y, document.head ? document.head.appendChild(t) : document.addEventListener("DOMContentLoaded", function() {
24
+ document.head.appendChild(t);
25
+ }));
26
+ var e = document.getElementById(n);
27
+ e || (e = document.createElement("style"), e.id = n, e.type = "text/css", t.appendChild(e)), e.innerHTML = a;
28
+ }
29
+ function p() {
30
+ var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
31
+ return Object.entries(i).reduce(function(n, t) {
32
+ var e = l(t, 2), s = e[0], r = e[1];
33
+ return s.startsWith("@") || s.startsWith("--") ? n[s] = r : n[s] = _(n[s], r), n;
34
+ }, Object.assign({}, a));
35
+ }
36
+ function j(a, i, n) {
37
+ function t(e, s) {
38
+ var r;
39
+ return (r = s["use:".concat(e)]) !== null && r !== void 0 ? r : s[e];
40
+ }
41
+ return Object.entries(a).reduce(function(e, s) {
42
+ var r = l(s, 2), u = r[0], o = r[1];
43
+ if (u.startsWith("--"))
44
+ e[1][o] = t(u.substring(2), n);
45
+ else if (i === u)
46
+ e[0][o] = !0;
47
+ else {
48
+ var h = u.split("="), f = l(h, 2), S = f[0], v = f[1], c = t(S, n);
49
+ v === void 0 ? e[0][o] = !!(c ?? !1) : e[0][o] = c == v;
50
+ }
51
+ return e;
52
+ }, [{}, {}]);
53
+ }
54
+ function W(a) {
55
+ return Object.entries(a).reduce(function(i, n) {
56
+ var t = l(n, 2), e = t[0], s = t[1], r = e;
57
+ return e.startsWith("__") ? r = e.replace(/^__/, "") : e.startsWith("_") && (r = e.replace(/^_/, "").replace("_", "=")), i[r] = s, i;
58
+ }, {});
59
+ }
60
+ function d() {
61
+ var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
62
+ return {
63
+ cn: function(n, t) {
64
+ var e = j(W(a), n, t), s = l(e, 2), r = s[0], u = s[1], o = {};
65
+ return Object.keys(r).length && (o.className = _(t.className, r)), Object.keys(u).length && (o.style = Object.assign(u, t.style)), g(g({}, t), o);
66
+ }
67
+ };
68
+ }
69
+ d.css = function(a) {
70
+ throw new Error("Enable babel plugin");
71
+ };
72
+ d.insert = O;
73
+ d.merge = p;
74
+ d.getStyles = E;
75
+ d.SHADOW_STYLES = Symbol("SHADOW_STYLES");
76
+ export {
77
+ d as sstyled
78
+ };
@@ -0,0 +1,42 @@
1
+ import i from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import c from "classnames";
3
+ import { forkRef as o } from "./ref.mjs";
4
+ import { sstyled as g } from "../styled/sstyled.mjs";
5
+ function v() {
6
+ for (var t = arguments.length, r = new Array(t), e = 0; e < t; e++)
7
+ r[e] = arguments[e];
8
+ return function() {
9
+ for (var n = arguments.length, l = new Array(n), s = 0; s < n; s++)
10
+ l[s] = arguments[s];
11
+ return !r.some(function(a) {
12
+ var f;
13
+ return a && (f = a.apply(void 0, l)), typeof f == "boolean" && !f;
14
+ });
15
+ };
16
+ }
17
+ function d(t, r) {
18
+ return Object.keys(r).reduce(function(e, n) {
19
+ return n !== "ref" && n.startsWith("on") && (typeof r[n] == "function" && typeof t[n] == "function" ? e[n] = v(t[n], r[n]) : typeof r[n] == "function" ? e[n] = r[n] : typeof t[n] == "function" && (e[n] = t[n])), e;
20
+ }, {});
21
+ }
22
+ function b() {
23
+ var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
24
+ if (t === r) return t;
25
+ var e = i(i(i({}, r), t), d(t, r));
26
+ for (var n in r)
27
+ if (n.startsWith("use:")) {
28
+ var l = n.slice(4);
29
+ e[l] = r[n];
30
+ }
31
+ for (var s in t)
32
+ if (s.startsWith("use:")) {
33
+ var a = s.slice(4);
34
+ e[a] = t[s];
35
+ }
36
+ var f = Object.getOwnPropertyDescriptor(r, "ref"), u = Object.getOwnPropertyDescriptor(t, "ref");
37
+ return f != null && f.configurable && u !== null && u !== void 0 && u.configurable && (e.ref = o(r.ref, t.ref)), t.forwardRef && (e.ref = o(e.ref, t.forwardRef), e.forwardRef = e.ref), r.style && t.style && (e.style = i(i({}, r.style), t.style)), r.className && (e.className = c(t.className, r.className)), r.styles && t.styles && (e.styles = g.merge(r.styles, t.styles)), e;
38
+ }
39
+ export {
40
+ v as callAllEventHandlers,
41
+ b as default
42
+ };
@@ -0,0 +1,6 @@
1
+ function e() {
2
+ return !!(typeof window < "u" && window.document && window.document.createElement);
3
+ }
4
+ export {
5
+ e as default
6
+ };
@@ -0,0 +1,6 @@
1
+ function t(e) {
2
+ return e.charAt(0).toUpperCase() + e.slice(1);
3
+ }
4
+ export {
5
+ t as default
6
+ };
@@ -0,0 +1,48 @@
1
+ import d from "@babel/runtime/helpers/esm/classCallCheck";
2
+ import g from "@babel/runtime/helpers/esm/createClass";
3
+ import s from "@babel/runtime/helpers/esm/assertThisInitialized";
4
+ import C from "@babel/runtime/helpers/esm/inherits";
5
+ import T from "@babel/runtime/helpers/esm/createSuper";
6
+ import c from "@babel/runtime/helpers/esm/defineProperty";
7
+ import { createContext as _, Component as I } from "react";
8
+ import { createIntlCache as P } from "@formatjs/intl";
9
+ var p = /* @__PURE__ */ _(void 0);
10
+ p.Provider;
11
+ p.Consumer;
12
+ P();
13
+ function y(e, o) {
14
+ return function(r) {
15
+ var t = e[o];
16
+ return t ? t[r] : e.en[r];
17
+ };
18
+ }
19
+ var u = /* @__PURE__ */ function(e) {
20
+ C(r, e);
21
+ var o = T(r);
22
+ function r() {
23
+ var t;
24
+ d(this, r);
25
+ for (var n = arguments.length, i = new Array(n), a = 0; a < n; a++)
26
+ i[a] = arguments[a];
27
+ return t = o.call.apply(o, [this].concat(i)), c(s(t), "context", void 0), c(s(t), "getText", function(f, l) {
28
+ var m = t.props, h = m.locale, v = m.getText, x = t.context;
29
+ return v(f, l || h || x);
30
+ }), t;
31
+ }
32
+ return g(r, [{
33
+ key: "render",
34
+ value: function() {
35
+ var n = this.props, i = n.children;
36
+ return i({
37
+ getText: this.getText
38
+ });
39
+ }
40
+ }]), r;
41
+ }(I);
42
+ c(u, "contextType", p);
43
+ c(u, "defaultProps", {
44
+ getText: y
45
+ });
46
+ export {
47
+ p as Context
48
+ };
@@ -0,0 +1,27 @@
1
+ import c from "@babel/runtime/helpers/esm/classCallCheck";
2
+ import i from "@babel/runtime/helpers/esm/createClass";
3
+ import a from "@babel/runtime/helpers/esm/defineProperty";
4
+ var s = process.env.NODE_ENV !== "production", l = /* @__PURE__ */ function() {
5
+ function n(t) {
6
+ c(this, n), a(this, "logger", void 0), this.logger = t || {
7
+ warn: function() {
8
+ }
9
+ };
10
+ }
11
+ return i(n, [{
12
+ key: "console",
13
+ value: function(o, r, e) {
14
+ this.logger[o](e ? "[".concat(e, "]: ").concat(r) : r);
15
+ }
16
+ }, {
17
+ key: "warn",
18
+ value: function(o, r, e) {
19
+ s && o && this.console("warn", r, e);
20
+ }
21
+ }]), n;
22
+ }();
23
+ const h = new l(console);
24
+ export {
25
+ l as Logger,
26
+ h as default
27
+ };
@@ -0,0 +1,10 @@
1
+ function l(a, i) {
2
+ for (var n = {}, e = i.length, t = -1; ++t < e; ) {
3
+ var r = i[t];
4
+ r in a && (n[r] = a[r]);
5
+ }
6
+ return n;
7
+ }
8
+ export {
9
+ l as default
10
+ };
@@ -0,0 +1,34 @@
1
+ import i from "@babel/runtime/helpers/esm/toConsumableArray";
2
+ import "@babel/runtime/helpers/esm/slicedToArray";
3
+ import f from "react";
4
+ import "react-dom";
5
+ function a(n, r) {
6
+ typeof n == "function" ? n(r) : n != null && n.hasOwnProperty("current") && (n.current = r);
7
+ }
8
+ function p() {
9
+ for (var n = arguments.length, r = new Array(n), t = 0; t < n; t++)
10
+ r[t] = arguments[t];
11
+ return f.useCallback(function(u) {
12
+ var o = i(new Set(r));
13
+ o.forEach(function(e) {
14
+ return a(e, u);
15
+ });
16
+ }, r);
17
+ }
18
+ function g() {
19
+ for (var n = arguments.length, r = new Array(n), t = 0; t < n; t++)
20
+ r[t] = arguments[t];
21
+ return r.every(function(u) {
22
+ return u == null;
23
+ }) ? null : function(u) {
24
+ var o = i(new Set(r));
25
+ o.forEach(function(e) {
26
+ return a(e, u);
27
+ });
28
+ };
29
+ }
30
+ export {
31
+ g as forkRef,
32
+ a as setRef,
33
+ p as useForkRef
34
+ };
@@ -0,0 +1,6 @@
1
+ import e from "react";
2
+ import f from "../canUseDOM.mjs";
3
+ var c = f() ? e.useLayoutEffect : e.useEffect;
4
+ export {
5
+ c as default
6
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/core",
3
3
  "description": "Semrush Core Component",
4
- "version": "16.0.0-prerelease.2",
4
+ "version": "16.0.0-prerelease.4",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -267,7 +267,6 @@
267
267
  },
268
268
  "dependencies": {
269
269
  "@formatjs/intl": "3.0.4",
270
- "@reshadow/core": "0.0.1-alpha.74",
271
270
  "classnames": "2.2.6",
272
271
  "hoist-non-react-statics": "3.3.2",
273
272
  "@phytonmk/nano-css": "5.3.7",
package/vite.config.ts CHANGED
@@ -9,6 +9,21 @@ export default mergeConfig(
9
9
  lib: {
10
10
  entry: './src/index.ts',
11
11
  },
12
+ rollupOptions: {
13
+ external: [
14
+ 'react',
15
+ 'react-dom',
16
+ 'react/jsx-runtime',
17
+ /@babel\/runtime\/*/,
18
+ /@semcore\/*/,
19
+
20
+ '@formatjs/intl',
21
+ 'classnames',
22
+ 'hoist-non-react-statics',
23
+ '@phytonmk/nano-css',
24
+ 'csstype',
25
+ ],
26
+ },
12
27
  },
13
28
  }),
14
29
  );
@@ -1,6 +0,0 @@
1
- function e(t) {
2
- return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
3
- }
4
- export {
5
- e as getDefaultExportFromCjs
6
- };
@@ -1,4 +0,0 @@
1
- var e = { exports: {} };
2
- export {
3
- e as __module
4
- };
@@ -1,4 +0,0 @@
1
- var s = { exports: {} };
2
- export {
3
- s as __module
4
- };
@@ -1,4 +0,0 @@
1
- var e = {};
2
- export {
3
- e as __exports
4
- };
@@ -1,4 +0,0 @@
1
- var r = {};
2
- export {
3
- r as __exports
4
- };