@semcore/core 16.6.1 → 16.6.2-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 (120) hide show
  1. package/.cache/esbuild_plugin_semcore_resolver/src_LastInteractionType.ts_contents +47 -0
  2. package/.cache/esbuild_plugin_semcore_resolver/src_LastInteractionType.ts_hash_sum +1 -0
  3. package/.cache/esbuild_plugin_semcore_resolver/src_LastInteractionType.ts_imp_deps +0 -0
  4. package/.cache/esbuild_plugin_semcore_resolver/src_LastInteractionType.ts_last_use +1 -0
  5. package/.cache/esbuild_plugin_semcore_resolver/src_core-types_Component.ts_contents +49 -0
  6. package/.cache/esbuild_plugin_semcore_resolver/src_core-types_Component.ts_hash_sum +1 -0
  7. package/.cache/esbuild_plugin_semcore_resolver/src_core-types_Component.ts_imp_deps +0 -0
  8. package/.cache/esbuild_plugin_semcore_resolver/src_core-types_Component.ts_last_use +1 -0
  9. package/.cache/esbuild_plugin_semcore_resolver/src_core-types_symbols.ts_contents +9 -0
  10. package/.cache/esbuild_plugin_semcore_resolver/src_core-types_symbols.ts_hash_sum +1 -0
  11. package/.cache/esbuild_plugin_semcore_resolver/src_core-types_symbols.ts_imp_deps +0 -0
  12. package/.cache/esbuild_plugin_semcore_resolver/src_core-types_symbols.ts_last_use +1 -0
  13. package/.cache/esbuild_plugin_semcore_resolver/src_coreFactory.tsx_contents +374 -0
  14. package/.cache/esbuild_plugin_semcore_resolver/src_coreFactory.tsx_hash_sum +1 -0
  15. package/.cache/esbuild_plugin_semcore_resolver/src_coreFactory.tsx_imp_deps +0 -0
  16. package/.cache/esbuild_plugin_semcore_resolver/src_coreFactory.tsx_last_use +1 -0
  17. package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_Children.tsx_contents +110 -0
  18. package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_Children.tsx_hash_sum +1 -0
  19. package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_Children.tsx_imp_deps +0 -0
  20. package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_Children.tsx_last_use +1 -0
  21. package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_Root.tsx_contents +69 -0
  22. package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_Root.tsx_hash_sum +1 -0
  23. package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_Root.tsx_imp_deps +0 -0
  24. package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_Root.tsx_last_use +1 -0
  25. package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_dataName.tsx_contents +11 -0
  26. package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_dataName.tsx_hash_sum +1 -0
  27. package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_dataName.tsx_imp_deps +0 -0
  28. package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_dataName.tsx_last_use +1 -0
  29. package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_enhance.tsx_contents +14 -0
  30. package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_enhance.tsx_hash_sum +1 -0
  31. package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_enhance.tsx_imp_deps +0 -0
  32. package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_enhance.tsx_last_use +1 -0
  33. package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_functionDefaultProps.tsx_contents +28 -0
  34. package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_functionDefaultProps.tsx_hash_sum +1 -0
  35. package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_functionDefaultProps.tsx_imp_deps +0 -0
  36. package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_functionDefaultProps.tsx_last_use +1 -0
  37. package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_i18n.tsx_contents +19 -0
  38. package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_i18n.tsx_hash_sum +1 -0
  39. package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_i18n.tsx_imp_deps +0 -0
  40. package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_i18n.tsx_last_use +1 -0
  41. package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_inheritedName.tsx_contents +14 -0
  42. package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_inheritedName.tsx_hash_sum +1 -0
  43. package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_inheritedName.tsx_imp_deps +0 -0
  44. package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_inheritedName.tsx_last_use +1 -0
  45. package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_staticChildren.tsx_contents +122 -0
  46. package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_staticChildren.tsx_hash_sum +1 -0
  47. package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_staticChildren.tsx_imp_deps +0 -0
  48. package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_staticChildren.tsx_last_use +1 -0
  49. package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_style.tsx_contents +50 -0
  50. package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_style.tsx_hash_sum +1 -0
  51. package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_style.tsx_imp_deps +0 -0
  52. package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_style.tsx_last_use +1 -0
  53. package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_uncontrolledProps.tsx_contents +123 -0
  54. package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_uncontrolledProps.tsx_hash_sum +1 -0
  55. package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_uncontrolledProps.tsx_imp_deps +0 -0
  56. package/.cache/esbuild_plugin_semcore_resolver/src_enhancement_uncontrolledProps.tsx_last_use +1 -0
  57. package/.cache/esbuild_plugin_semcore_resolver/src_index.ts_contents +8 -0
  58. package/.cache/esbuild_plugin_semcore_resolver/src_index.ts_hash_sum +1 -0
  59. package/.cache/esbuild_plugin_semcore_resolver/src_index.ts_imp_deps +0 -0
  60. package/.cache/esbuild_plugin_semcore_resolver/src_index.ts_last_use +1 -0
  61. package/.cache/esbuild_plugin_semcore_resolver/src_register.tsx_contents +27 -0
  62. package/.cache/esbuild_plugin_semcore_resolver/src_register.tsx_hash_sum +1 -0
  63. package/.cache/esbuild_plugin_semcore_resolver/src_register.tsx_imp_deps +0 -0
  64. package/.cache/esbuild_plugin_semcore_resolver/src_register.tsx_last_use +1 -0
  65. package/.cache/esbuild_plugin_semcore_resolver/src_styled_index.tsx_contents +3 -0
  66. package/.cache/esbuild_plugin_semcore_resolver/src_styled_index.tsx_hash_sum +1 -0
  67. package/.cache/esbuild_plugin_semcore_resolver/src_styled_index.tsx_imp_deps +0 -0
  68. package/.cache/esbuild_plugin_semcore_resolver/src_styled_index.tsx_last_use +1 -0
  69. package/.cache/esbuild_plugin_semcore_resolver/src_styled_reshadow-core.ts_contents +236 -0
  70. package/.cache/esbuild_plugin_semcore_resolver/src_styled_reshadow-core.ts_hash_sum +1 -0
  71. package/.cache/esbuild_plugin_semcore_resolver/src_styled_reshadow-core.ts_imp_deps +0 -0
  72. package/.cache/esbuild_plugin_semcore_resolver/src_styled_reshadow-core.ts_last_use +1 -0
  73. package/.cache/esbuild_plugin_semcore_resolver/src_styled_sstyled.tsx_contents +143 -0
  74. package/.cache/esbuild_plugin_semcore_resolver/src_styled_sstyled.tsx_hash_sum +1 -0
  75. package/.cache/esbuild_plugin_semcore_resolver/src_styled_sstyled.tsx_imp_deps +0 -0
  76. package/.cache/esbuild_plugin_semcore_resolver/src_styled_sstyled.tsx_last_use +1 -0
  77. package/.cache/esbuild_plugin_semcore_resolver/src_utils_assignProps.ts_contents +83 -0
  78. package/.cache/esbuild_plugin_semcore_resolver/src_utils_assignProps.ts_hash_sum +1 -0
  79. package/.cache/esbuild_plugin_semcore_resolver/src_utils_assignProps.ts_imp_deps +0 -0
  80. package/.cache/esbuild_plugin_semcore_resolver/src_utils_assignProps.ts_last_use +1 -0
  81. package/.cache/esbuild_plugin_semcore_resolver/src_utils_canUseDOM.ts_contents +3 -0
  82. package/.cache/esbuild_plugin_semcore_resolver/src_utils_canUseDOM.ts_hash_sum +1 -0
  83. package/.cache/esbuild_plugin_semcore_resolver/src_utils_canUseDOM.ts_imp_deps +0 -0
  84. package/.cache/esbuild_plugin_semcore_resolver/src_utils_canUseDOM.ts_last_use +1 -0
  85. package/.cache/esbuild_plugin_semcore_resolver/src_utils_capitalizeFirstLetter.ts_contents +3 -0
  86. package/.cache/esbuild_plugin_semcore_resolver/src_utils_capitalizeFirstLetter.ts_hash_sum +1 -0
  87. package/.cache/esbuild_plugin_semcore_resolver/src_utils_capitalizeFirstLetter.ts_imp_deps +0 -0
  88. package/.cache/esbuild_plugin_semcore_resolver/src_utils_capitalizeFirstLetter.ts_last_use +1 -0
  89. package/.cache/esbuild_plugin_semcore_resolver/src_utils_enhances_WithI18n.tsx_contents +26 -0
  90. package/.cache/esbuild_plugin_semcore_resolver/src_utils_enhances_WithI18n.tsx_hash_sum +1 -0
  91. package/.cache/esbuild_plugin_semcore_resolver/src_utils_enhances_WithI18n.tsx_imp_deps +0 -0
  92. package/.cache/esbuild_plugin_semcore_resolver/src_utils_enhances_WithI18n.tsx_last_use +1 -0
  93. package/.cache/esbuild_plugin_semcore_resolver/src_utils_enhances_i18nEnhance.tsx_contents +91 -0
  94. package/.cache/esbuild_plugin_semcore_resolver/src_utils_enhances_i18nEnhance.tsx_hash_sum +1 -0
  95. package/.cache/esbuild_plugin_semcore_resolver/src_utils_enhances_i18nEnhance.tsx_imp_deps +0 -0
  96. package/.cache/esbuild_plugin_semcore_resolver/src_utils_enhances_i18nEnhance.tsx_last_use +1 -0
  97. package/.cache/esbuild_plugin_semcore_resolver/src_utils_logger.ts_contents +30 -0
  98. package/.cache/esbuild_plugin_semcore_resolver/src_utils_logger.ts_hash_sum +1 -0
  99. package/.cache/esbuild_plugin_semcore_resolver/src_utils_logger.ts_imp_deps +0 -0
  100. package/.cache/esbuild_plugin_semcore_resolver/src_utils_logger.ts_last_use +1 -0
  101. package/.cache/esbuild_plugin_semcore_resolver/src_utils_pick.ts_contents +12 -0
  102. package/.cache/esbuild_plugin_semcore_resolver/src_utils_pick.ts_hash_sum +1 -0
  103. package/.cache/esbuild_plugin_semcore_resolver/src_utils_pick.ts_imp_deps +0 -0
  104. package/.cache/esbuild_plugin_semcore_resolver/src_utils_pick.ts_last_use +1 -0
  105. package/.cache/esbuild_plugin_semcore_resolver/src_utils_ref.ts_contents +70 -0
  106. package/.cache/esbuild_plugin_semcore_resolver/src_utils_ref.ts_hash_sum +1 -0
  107. package/.cache/esbuild_plugin_semcore_resolver/src_utils_ref.ts_imp_deps +0 -0
  108. package/.cache/esbuild_plugin_semcore_resolver/src_utils_ref.ts_last_use +1 -0
  109. package/.cache/esbuild_plugin_semcore_resolver/src_utils_use_useEnhancedEffect.ts_contents +4 -0
  110. package/.cache/esbuild_plugin_semcore_resolver/src_utils_use_useEnhancedEffect.ts_hash_sum +1 -0
  111. package/.cache/esbuild_plugin_semcore_resolver/src_utils_use_useEnhancedEffect.ts_imp_deps +0 -0
  112. package/.cache/esbuild_plugin_semcore_resolver/src_utils_use_useEnhancedEffect.ts_last_use +1 -0
  113. package/CHANGELOG.md +6 -0
  114. package/lib/utils/injectStyle.js +1 -1
  115. package/lib/utils/injectStyle.mjs +1 -1
  116. package/lib/utils/use/useColorResolver.js +3 -1
  117. package/lib/utils/use/useColorResolver.js.map +1 -1
  118. package/lib/utils/use/useColorResolver.mjs +3 -1
  119. package/lib/utils/use/useColorResolver.mjs.map +1 -1
  120. package/package.json +1 -1
@@ -0,0 +1,236 @@
1
+ import _typeof from "@babel/runtime/helpers/typeof";
2
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
+ /**
4
+ * This is source form @reshadow/core@0.0.1
5
+ * Put it here, because we can't use the version from the package in ESM builds.
6
+ * The package is not update for 3 years and we have plans to remove them. So, this tmp copy version is acceptable
7
+ */
8
+ // @ts-nocheck
9
+ var _Symbol = function _Symbol(key) {
10
+ return typeof Symbol !== 'undefined' ? Symbol(key) : key;
11
+ };
12
+ var KEYS = {
13
+ __id__: _Symbol('__id__'),
14
+ __store__: _Symbol('__store__'),
15
+ __prev__: _Symbol('__prev__'),
16
+ __use__: _Symbol('__use__'),
17
+ __elements__: '__elements__',
18
+ __style__: '$$style',
19
+ __styles__: 'styles',
20
+ __css__: '__css__',
21
+ __hash__: '__hash__',
22
+ /**
23
+ * This prop is needed for the interop between different component frameworks
24
+ */
25
+ __classProp__: 'className'
26
+ };
27
+ var index = 0;
28
+ var use = function use(obj) {
29
+ var result = {};
30
+ result[KEYS.__use__] = obj;
31
+ return result;
32
+ };
33
+ var create = function create(args) {
34
+ var len = args.length;
35
+ var newStyle = {};
36
+ var id = '';
37
+ var vars = null;
38
+ var uses = null;
39
+ for (var i = 0; i < len; i++) {
40
+ var _style = args[i];
41
+ if (!_style) continue;
42
+ if (!_style[KEYS.__id__]) {
43
+ _style[KEYS.__id__] = ++index;
44
+ _style[KEYS.__store__] = _defineProperty({}, '_' + _style[KEYS.__id__], _style);
45
+ }
46
+ id += '_' + _style[KEYS.__id__];
47
+ if (_style[KEYS.__style__]) {
48
+ vars = Object.assign(vars || {}, _style[KEYS.__style__]);
49
+ }
50
+ if (_style[KEYS.__use__]) {
51
+ uses = Object.assign(uses || {}, _style[KEYS.__use__]);
52
+ }
53
+ if (_style[KEYS.__store__][id]) {
54
+ newStyle = _style[KEYS.__store__][id];
55
+ continue;
56
+ }
57
+ newStyle = Object.create(newStyle);
58
+ for (var key in _style) {
59
+ if (key in KEYS) continue;
60
+ newStyle[key] = appendClassName(_style[key], newStyle[key]);
61
+ }
62
+ _style[KEYS.__store__][id] = newStyle;
63
+ newStyle[KEYS.__id__] = index;
64
+ newStyle[KEYS.__store__] = _defineProperty({}, '_' + _style[KEYS.__id__], newStyle);
65
+ }
66
+ if (vars || use) {
67
+ newStyle = Object.create(newStyle);
68
+ newStyle[KEYS.__style__] = vars;
69
+ newStyle[KEYS.__use__] = uses;
70
+ }
71
+ return newStyle;
72
+ };
73
+ var isSSR = !(typeof window !== 'undefined' && window.document && window.document.createElement);
74
+ var serverMap = {};
75
+ var getStyles = function getStyles() {
76
+ return {
77
+ map: serverMap,
78
+ get css() {
79
+ var serverStyles = '';
80
+ for (var id in serverMap) {
81
+ serverStyles += "<style type=\"text/css\" id=\"".concat(id, "\">").concat(serverMap[id], "</style>");
82
+ }
83
+ return serverStyles;
84
+ }
85
+ };
86
+ };
87
+ var clearStyles = function clearStyles() {
88
+ serverStyles = '';
89
+ };
90
+ var RESHADOW_ID = '__reshadow__';
91
+ var appendChildToDocumentHead = function appendChildToDocumentHead(element) {
92
+ return document.head.appendChild(element);
93
+ };
94
+ var css = function css(code, hash) {
95
+ var id = "reshadow-".concat(hash);
96
+ if (isSSR) {
97
+ serverMap[id] = code;
98
+ return;
99
+ }
100
+ var container = document.getElementById(RESHADOW_ID);
101
+ if (!container) {
102
+ container = document.createElement('object');
103
+ container.id = RESHADOW_ID;
104
+ if (document.head) {
105
+ appendChildToDocumentHead(container);
106
+ } else {
107
+ document.addEventListener('DOMContentLoaded', function () {
108
+ appendChildToDocumentHead(container);
109
+ });
110
+ }
111
+ }
112
+ var css = document.getElementById(id);
113
+ if (!css) {
114
+ css = document.createElement('style');
115
+ css.id = id;
116
+ css.type = 'text/css';
117
+ container.appendChild(css);
118
+ }
119
+ css.innerHTML = code;
120
+ };
121
+ var styles = {};
122
+ var style;
123
+ var stack = [];
124
+ var _styled = function styled(elem) {
125
+ var curr = stack.pop() || [];
126
+ styles = curr[0] || styles;
127
+ style = curr[1] || style;
128
+ _styled[KEYS.__styles__] = styles;
129
+ _styled[KEYS.__style__] = style;
130
+ return elem;
131
+ };
132
+ _styled[KEYS.__styles__] = styles;
133
+ var set = function set(args, newStyle) {
134
+ var newStyles = create(args);
135
+ stack.push([styles, style]);
136
+ styles = newStyles;
137
+ style = newStyle;
138
+ if (styles[KEYS.__style__]) {
139
+ style = style ? Object.assign({}, style, styles[KEYS.__style__]) : styles[KEYS.__style__];
140
+ }
141
+ _styled[KEYS.__styles__] = styles;
142
+ _styled[KEYS.__style__] = style;
143
+ };
144
+ var USE_PREFIX = 'use--';
145
+ var ELEMENT_PREFIX = '__';
146
+ var MOD_PREFIX = '_';
147
+ var MOD_SEPARATOR = '_';
148
+ var parseElement = function parseElement(name) {
149
+ return name.replace(ELEMENT_PREFIX, '');
150
+ };
151
+ var parseAttribute = function parseAttribute(name) {
152
+ return name.replace(MOD_PREFIX, '').split(MOD_SEPARATOR);
153
+ };
154
+ var appendClassName = function appendClassName(className) {
155
+ var cn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
156
+ if (className) {
157
+ cn += (cn ? ' ' : '') + className;
158
+ }
159
+ return cn;
160
+ };
161
+ var appendElement = function appendElement(styles, key) {
162
+ var cn = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
163
+ return appendClassName(styles[ELEMENT_PREFIX + key], cn);
164
+ };
165
+ var appendModifier = function appendModifier(styles, key, value) {
166
+ var cn = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
167
+ // isFalsy
168
+ if (value === undefined || value === null || value === false || value === '') return cn;
169
+ cn = appendClassName(styles[MOD_PREFIX + key], cn);
170
+
171
+ // value should be only primitive
172
+ if (typeof value === 'boolean' || _typeof(value) === 'object' || typeof value === 'function') return cn;
173
+ cn = appendClassName(styles[MOD_SEPARATOR + key + MOD_SEPARATOR + value], cn);
174
+ return cn;
175
+ };
176
+ function map(element) {
177
+ var currStyles = _styled[KEYS.__styles__];
178
+ var nextProps = {};
179
+ var cn = appendElement(currStyles, element);
180
+ var vars = null;
181
+ var uses = currStyles[KEYS.__use__] || {};
182
+ var len = arguments.length;
183
+ var useProps;
184
+ for (var i = len - 1; i > 0; i--) {
185
+ // eslint-disable-next-line prefer-rest-params
186
+ var currProps = arguments[i];
187
+ if (!currProps) continue;
188
+ useProps = useProps || currProps[KEYS.__use__];
189
+ if (!vars && KEYS.__style__ in currProps) {
190
+ vars = _styled[KEYS.__style__];
191
+ }
192
+ for (var key in currProps) {
193
+ if (key === KEYS.__use__ || key === KEYS.__style__ || key in nextProps) {
194
+ continue;
195
+ }
196
+ var value = currProps[key];
197
+ cn = appendModifier(currStyles, key, value, cn);
198
+ var valueType = _typeof(value);
199
+ if (valueType === 'string' || valueType === 'boolean' || valueType === 'number') {
200
+ var useKey = key + '_' + value;
201
+ if (key + '_' + true in uses || useKey in uses) {
202
+ cn = appendModifier(currStyles, USE_PREFIX + key, value, cn);
203
+ if (uses[useKey]) {
204
+ continue;
205
+ }
206
+ }
207
+ }
208
+ nextProps[key] = value;
209
+ }
210
+ }
211
+ if (useProps) {
212
+ for (var _key in useProps) {
213
+ var _value = useProps[_key];
214
+ cn = appendModifier(currStyles, USE_PREFIX + _key, _value, cn);
215
+ }
216
+ }
217
+ cn = appendClassName(nextProps[KEYS.__classProp__], cn);
218
+ if (cn) nextProps[KEYS.__classProp__] = cn;
219
+ if (vars) {
220
+ nextProps.style = typeof style === 'string' ? vars + (nextProps.style || '') : Object.assign({}, vars, nextProps.style || {});
221
+ }
222
+ return nextProps;
223
+ }
224
+ export { _styled as styled, use, css, create, set, map,
225
+ // '__css__': css,
226
+ // '__extract__': () => ({
227
+ // [KEYS.__styles__]: styled[[KEYS.__styles__]],
228
+ // [KEYS.__style__]: styled[[KEYS.__style__]],
229
+ // }),
230
+
231
+ // ssr
232
+ getStyles, clearStyles,
233
+ // utils
234
+ appendModifier, appendElement, appendClassName, parseAttribute, parseElement,
235
+ // constants
236
+ MOD_SEPARATOR, MOD_PREFIX, ELEMENT_PREFIX, USE_PREFIX, KEYS, RESHADOW_ID };
@@ -0,0 +1 @@
1
+ 50b300cb0e6b8801aca02fbc2f43fdb7
@@ -0,0 +1,143 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
+ import _cn from 'classnames';
3
+ /** @ts-ignore */
4
+ import { getStyles as reshadowGetStyles } from './reshadow-core';
5
+ var RESHADOW_ID = '__reshadow__';
6
+ var isSSR = !(typeof window !== 'undefined' && window.document && window.document.createElement);
7
+ var serverMap = reshadowGetStyles().map;
8
+ var getStyles = function getStyles() {
9
+ return {
10
+ map: serverMap,
11
+ get css() {
12
+ var serverStyles = '';
13
+ for (var id in serverMap) {
14
+ serverStyles += "<style type='text/css' id='".concat(id, "'>").concat(serverMap[id], "</style>");
15
+ }
16
+ return serverStyles;
17
+ }
18
+ };
19
+ };
20
+ function insert(code, hash) {
21
+ var id = 'reshadow-'.concat(hash);
22
+ if (isSSR) {
23
+ serverMap[id] = code;
24
+ return;
25
+ }
26
+ var container = document.getElementById(RESHADOW_ID);
27
+ if (!container) {
28
+ container = document.createElement('object');
29
+ container.id = RESHADOW_ID;
30
+ if (document.head) {
31
+ document.head.appendChild(container);
32
+ } else {
33
+ document.addEventListener('DOMContentLoaded', function () {
34
+ document.head.appendChild(container);
35
+ });
36
+ }
37
+ }
38
+ var css = document.getElementById(id);
39
+ if (!css) {
40
+ css = document.createElement('style');
41
+ css.id = id;
42
+ // @ts-ignore
43
+ css.type = 'text/css';
44
+ container.appendChild(css);
45
+ }
46
+ css.innerHTML = code;
47
+ }
48
+ function merge() {
49
+ var s1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
50
+ var s2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
51
+ return Object.entries(s2).reduce(function (acc, _ref) {
52
+ var _ref2 = _slicedToArray(_ref, 2),
53
+ key = _ref2[0],
54
+ value = _ref2[1];
55
+ if (key.startsWith('@') || key.startsWith('--')) {
56
+ acc[key] = value;
57
+ } else {
58
+ acc[key] = _cn(acc[key], value);
59
+ }
60
+ return acc;
61
+ }, Object.assign({}, s1));
62
+ }
63
+ function getClassAndVars(styles, name, props) {
64
+ function getPropValue(key, props) {
65
+ var _props;
66
+ return (_props = props["use:".concat(key)]) !== null && _props !== void 0 ? _props : props[key];
67
+ }
68
+ return Object.entries(styles).reduce(function (acc, _ref3) {
69
+ var _ref4 = _slicedToArray(_ref3, 2),
70
+ key = _ref4[0],
71
+ value = _ref4[1];
72
+ if (key.startsWith('--')) {
73
+ // @ts-ignore
74
+ acc[1][value] = getPropValue(key.substring(2), props);
75
+ } else if (name === key) {
76
+ // @ts-ignore
77
+ acc[0][value] = true;
78
+ } else {
79
+ var _key$split = key.split('='),
80
+ _key$split2 = _slicedToArray(_key$split, 2),
81
+ mod = _key$split2[0],
82
+ modValue = _key$split2[1];
83
+ var propValue = getPropValue(mod, props);
84
+ if (modValue === undefined) {
85
+ // @ts-ignore
86
+ acc[0][value] = Boolean(propValue !== null && propValue !== void 0 ? propValue : false);
87
+ } else {
88
+ // @ts-ignore
89
+
90
+ acc[0][value] = propValue == modValue;
91
+ }
92
+ }
93
+ return acc;
94
+ }, [{}, {}]);
95
+ }
96
+ var reshadowMap = new WeakMap();
97
+ function reshadowToShadow(obj) {
98
+ if (reshadowMap.has(obj)) {
99
+ return reshadowMap.get(obj);
100
+ }
101
+ var shadowStyle = Object.entries(obj).reduce(function (style, _ref5) {
102
+ var _ref6 = _slicedToArray(_ref5, 2),
103
+ name = _ref6[0],
104
+ value = _ref6[1];
105
+ var n = name;
106
+ if (name.startsWith('__')) {
107
+ n = name.replace(/^__/, '');
108
+ } else if (name.startsWith('_')) {
109
+ n = name.replace(/^_/, '').replace('_', '=');
110
+ }
111
+ style[n] = value;
112
+ return style;
113
+ }, {});
114
+ reshadowMap.set(obj, shadowStyle);
115
+ return shadowStyle;
116
+ }
117
+ function sstyled() {
118
+ var styles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
119
+ // @ts-ignore
120
+ return {
121
+ cn: function cn(name, props) {
122
+ var _getClassAndVars = getClassAndVars(reshadowToShadow(styles), name, props),
123
+ _getClassAndVars2 = _slicedToArray(_getClassAndVars, 2),
124
+ classes = _getClassAndVars2[0],
125
+ style = _getClassAndVars2[1];
126
+ if (Object.keys(classes).length) {
127
+ props.className = _cn(props.className, classes);
128
+ }
129
+ if (Object.keys(style).length) {
130
+ props.style = Object.assign(style, props.style);
131
+ }
132
+ return props;
133
+ }
134
+ };
135
+ }
136
+ sstyled.css = function (_css) {
137
+ throw new Error('Enable babel plugin');
138
+ };
139
+ sstyled.insert = insert;
140
+ sstyled.merge = merge;
141
+ sstyled.getStyles = getStyles;
142
+ sstyled.SHADOW_STYLES = Symbol('SHADOW_STYLES');
143
+ export { sstyled };
@@ -0,0 +1 @@
1
+ 52c5c59a08205200549a79b1e701bf56
@@ -0,0 +1,83 @@
1
+ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
2
+ import cn from 'classnames';
3
+ import { forkRef } from './ref';
4
+ import { sstyled } from '../styled/index';
5
+ export function callAllEventHandlers() {
6
+ for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {
7
+ fns[_key] = arguments[_key];
8
+ }
9
+ return function () {
10
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
11
+ args[_key2] = arguments[_key2];
12
+ }
13
+ return !fns.some(function (fn) {
14
+ var result;
15
+ if (fn) {
16
+ result = fn.apply(void 0, args);
17
+ }
18
+ return typeof result === 'boolean' && !result;
19
+ });
20
+ };
21
+ }
22
+ export function assignHandlers(props, source) {
23
+ return Object.keys(source).reduce(function (proxySource, propName) {
24
+ if (typeof source[propName] === 'function' && propName.startsWith('on')) {
25
+ proxySource[propName] = callAllEventHandlers(props[propName], source[propName]);
26
+ }
27
+ return proxySource;
28
+ }, {});
29
+ }
30
+ function assignHandlersInner(props, source) {
31
+ return Object.keys(source).reduce(function (proxySource, propName) {
32
+ if (propName !== 'ref' && propName.startsWith('on')) {
33
+ if (typeof source[propName] === 'function' && typeof props[propName] === 'function') {
34
+ proxySource[propName] = callAllEventHandlers(props[propName], source[propName]);
35
+ } else if (typeof source[propName] === 'function') {
36
+ proxySource[propName] = source[propName];
37
+ } else if (typeof props[propName] === 'function') {
38
+ proxySource[propName] = props[propName];
39
+ }
40
+ }
41
+ return proxySource;
42
+ }, {});
43
+ }
44
+ export default function assignProps() {
45
+ var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
46
+ var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
47
+ // @ts-ignore
48
+ if (props === source) return props;
49
+ var newProps = _objectSpread(_objectSpread(_objectSpread({}, source), props), assignHandlersInner(props, source));
50
+ for (var _key3 in source) {
51
+ if (_key3.startsWith('use:')) {
52
+ var originalKey = _key3.slice('use:'.length);
53
+ newProps[originalKey] = source[_key3];
54
+ }
55
+ }
56
+ for (var _key4 in props) {
57
+ if (_key4.startsWith('use:')) {
58
+ var _originalKey = _key4.slice('use:'.length);
59
+ newProps[_originalKey] = props[_key4];
60
+ }
61
+ }
62
+
63
+ // because react set getter for ref
64
+ var sourceDescriptorRef = Object.getOwnPropertyDescriptor(source, 'ref');
65
+ var propsDescriptorRef = Object.getOwnPropertyDescriptor(props, 'ref');
66
+ if (sourceDescriptorRef !== null && sourceDescriptorRef !== void 0 && sourceDescriptorRef.configurable && propsDescriptorRef !== null && propsDescriptorRef !== void 0 && propsDescriptorRef.configurable) {
67
+ newProps.ref = forkRef(source.ref, props.ref);
68
+ }
69
+ if (props.forwardRef) {
70
+ newProps.ref = forkRef(newProps.ref, props.forwardRef);
71
+ newProps.forwardRef = newProps.ref;
72
+ }
73
+ if (source.style && props.style) {
74
+ newProps.style = _objectSpread(_objectSpread({}, source.style), props.style);
75
+ }
76
+ if (source.className) {
77
+ newProps.className = cn(props.className, source.className);
78
+ }
79
+ if (source.styles && props.styles) {
80
+ newProps.styles = sstyled.merge(source.styles, props.styles);
81
+ }
82
+ return newProps;
83
+ }
@@ -0,0 +1 @@
1
+ 33fde77e749b51ff7c902c01eb00f89b
@@ -0,0 +1,3 @@
1
+ export default function () {
2
+ return !!(typeof window !== 'undefined' && window.document && window.document.createElement);
3
+ }
@@ -0,0 +1 @@
1
+ 2ece09f1a8c108447dd396c1253b638d
@@ -0,0 +1,3 @@
1
+ export default function capitalizeFirstLetter(input) {
2
+ return input.charAt(0).toUpperCase() + input.slice(1);
3
+ }
@@ -0,0 +1 @@
1
+ dfa37f168dfd548716ff86a0d4774c9d
@@ -0,0 +1,26 @@
1
+ import { createIntl, createIntlCache } from '@formatjs/intl';
2
+ import React, { createContext } from 'react';
3
+ import { useAsyncI18nMessages } from './i18nEnhance';
4
+ export var Context = /*#__PURE__*/createContext(undefined);
5
+ var I18nProvider = Context.Provider,
6
+ I18nConsumer = Context.Consumer;
7
+ var messagesCache = createIntlCache();
8
+ var useI18n = function useI18n(dictionary) {
9
+ var _React$useContext;
10
+ var locale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'en';
11
+ var fallbackDictionary = arguments.length > 2 ? arguments[2] : undefined;
12
+ var lang = (_React$useContext = React.useContext(Context)) !== null && _React$useContext !== void 0 ? _React$useContext : locale;
13
+ var resolvedDictionary = useAsyncI18nMessages(dictionary, lang, fallbackDictionary);
14
+ var intl = React.useMemo(function () {
15
+ return createIntl({
16
+ locale: lang,
17
+ messages: resolvedDictionary
18
+ }, messagesCache);
19
+ }, [resolvedDictionary, lang]);
20
+ return React.useCallback(function (messageId, variables) {
21
+ return intl.formatMessage({
22
+ id: messageId !== null && messageId !== void 0 ? messageId : ''
23
+ }, variables);
24
+ }, [intl]);
25
+ };
26
+ export { useI18n, I18nProvider, I18nConsumer };
@@ -0,0 +1 @@
1
+ b2045b494405b013b90aac0df8dee41a
@@ -0,0 +1,91 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import _typeof from "@babel/runtime/helpers/typeof";
3
+ import _regenerator from "@babel/runtime/helpers/regenerator";
4
+ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
5
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
6
+ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
7
+ import React from 'react';
8
+ import { useI18n } from './WithI18n';
9
+ export var useAsyncI18nMessages = function useAsyncI18nMessages(primaryContainer, locale, fallbackContainer) {
10
+ var _store$locale;
11
+ var container = React.useMemo(function () {
12
+ if (!fallbackContainer) return primaryContainer;
13
+ if (!primaryContainer) return fallbackContainer;
14
+ if (primaryContainer === fallbackContainer) return primaryContainer;
15
+ var container = {};
16
+ var _loop = function _loop(_locale) {
17
+ if (typeof primaryContainer[_locale] === 'function' || typeof fallbackContainer[_locale] === 'function') {
18
+ container[_locale] = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
19
+ var _yield$Promise$all, _yield$Promise$all2, primary, fallback;
20
+ return _regenerator().w(function (_context) {
21
+ while (1) switch (_context.n) {
22
+ case 0:
23
+ _context.n = 1;
24
+ return Promise.all([primaryContainer[_locale], fallbackContainer[_locale]]);
25
+ case 1:
26
+ _yield$Promise$all = _context.v;
27
+ _yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 2);
28
+ primary = _yield$Promise$all2[0];
29
+ fallback = _yield$Promise$all2[1];
30
+ return _context.a(2, _objectSpread(_objectSpread({}, primary), fallback));
31
+ }
32
+ }, _callee);
33
+ }));
34
+ } else {
35
+ var _primaryContainer$_lo, _fallbackContainer$_l;
36
+ container[_locale] = _objectSpread(_objectSpread({}, (_primaryContainer$_lo = primaryContainer[_locale]) !== null && _primaryContainer$_lo !== void 0 ? _primaryContainer$_lo : {}), (_fallbackContainer$_l = fallbackContainer[_locale]) !== null && _fallbackContainer$_l !== void 0 ? _fallbackContainer$_l : {});
37
+ }
38
+ };
39
+ for (var _locale in primaryContainer) {
40
+ _loop(_locale);
41
+ }
42
+ return container;
43
+ }, [primaryContainer, fallbackContainer]);
44
+ var initStore = React.useMemo(function () {
45
+ var store = {};
46
+ for (var _locale2 in container) {
47
+ if (_typeof(container[_locale2]) === 'object') {
48
+ store[_locale2] = container[_locale2];
49
+ }
50
+ }
51
+ return store;
52
+ }, [container]);
53
+ var _React$useState = React.useState(initStore),
54
+ _React$useState2 = _slicedToArray(_React$useState, 2),
55
+ store = _React$useState2[0],
56
+ setStore = _React$useState2[1];
57
+ var lastLoadedLocaleRef = React.useRef(null);
58
+ if (store[locale]) lastLoadedLocaleRef.current = locale;
59
+ var fallbackMessages = React.useMemo(function () {
60
+ return Object.values(store)[0];
61
+ }, [store]);
62
+ var loadingLocaleRef = React.useRef(null);
63
+ React.useEffect(function () {
64
+ loadingLocaleRef.current = locale;
65
+ var asyncMessages = container[locale];
66
+ if (typeof asyncMessages === 'function') {
67
+ asyncMessages().then(function (module) {
68
+ if (loadingLocaleRef.current !== locale) return;
69
+ var messages = module;
70
+ if ('default' in module && _typeof(module["default"]) === 'object') messages = module["default"];
71
+ setStore(function (store) {
72
+ return _objectSpread(_objectSpread({}, store), {}, _defineProperty({}, locale, messages));
73
+ });
74
+ })["catch"](function (err) {
75
+ // eslint-disable-next-line no-console
76
+ console.error(err);
77
+ });
78
+ }
79
+ }, [container, locale]);
80
+ return (_store$locale = store[locale]) !== null && _store$locale !== void 0 ? _store$locale : fallbackMessages;
81
+ };
82
+ export default (function (container) {
83
+ return function (props) {
84
+ var i18n = props.i18n,
85
+ locale = props.locale;
86
+ var getI18nText = useI18n(i18n, locale, container);
87
+ return _objectSpread(_objectSpread({}, props), {}, {
88
+ getI18nText: getI18nText
89
+ });
90
+ };
91
+ });
@@ -0,0 +1 @@
1
+ f7e63a244e5772d450af9e587c18a24a