@react-hive/honey-style 5.3.0 → 6.0.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.
- package/dist/constants.d.ts +2 -0
- package/dist/index.cjs +7 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.dev.cjs +192 -188
- package/dist/index.dev.cjs.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +1 -1
- package/dist/mount-style.d.ts +0 -9
- package/dist/styled.d.ts +1 -5
- package/package.json +16 -16
package/dist/index.dev.cjs
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/******/ "use strict";
|
|
3
3
|
/******/ var __webpack_modules__ = ({
|
|
4
4
|
|
|
5
|
-
/***/ "./node_modules/.pnpm/react@19.2.
|
|
5
|
+
/***/ "./node_modules/.pnpm/react@19.2.6/node_modules/react/cjs/react-jsx-runtime.development.js"
|
|
6
6
|
/*!*************************************************************************************************!*\
|
|
7
|
-
!*** ./node_modules/.pnpm/react@19.2.
|
|
7
|
+
!*** ./node_modules/.pnpm/react@19.2.6/node_modules/react/cjs/react-jsx-runtime.development.js ***!
|
|
8
8
|
\*************************************************************************************************/
|
|
9
9
|
(__unused_webpack_module, exports, __webpack_require__) {
|
|
10
10
|
|
|
@@ -364,9 +364,9 @@
|
|
|
364
364
|
|
|
365
365
|
/***/ },
|
|
366
366
|
|
|
367
|
-
/***/ "./node_modules/.pnpm/react@19.2.
|
|
367
|
+
/***/ "./node_modules/.pnpm/react@19.2.6/node_modules/react/jsx-runtime.js"
|
|
368
368
|
/*!***************************************************************************!*\
|
|
369
|
-
!*** ./node_modules/.pnpm/react@19.2.
|
|
369
|
+
!*** ./node_modules/.pnpm/react@19.2.6/node_modules/react/jsx-runtime.js ***!
|
|
370
370
|
\***************************************************************************/
|
|
371
371
|
(module, __unused_webpack_exports, __webpack_require__) {
|
|
372
372
|
|
|
@@ -374,7 +374,7 @@
|
|
|
374
374
|
|
|
375
375
|
if (false) // removed by dead control flow
|
|
376
376
|
{} else {
|
|
377
|
-
module.exports = __webpack_require__(/*! ./cjs/react-jsx-runtime.development.js */ "./node_modules/.pnpm/react@19.2.
|
|
377
|
+
module.exports = __webpack_require__(/*! ./cjs/react-jsx-runtime.development.js */ "./node_modules/.pnpm/react@19.2.6/node_modules/react/cjs/react-jsx-runtime.development.js");
|
|
378
378
|
}
|
|
379
379
|
|
|
380
380
|
|
|
@@ -392,6 +392,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
392
392
|
/* harmony export */ HONEY_GLOBAL_STYLE_ATTR: () => (/* binding */ HONEY_GLOBAL_STYLE_ATTR),
|
|
393
393
|
/* harmony export */ HONEY_STYLED_COMPONENT_ID_PROP: () => (/* binding */ HONEY_STYLED_COMPONENT_ID_PROP),
|
|
394
394
|
/* harmony export */ HONEY_STYLE_ATTR: () => (/* binding */ HONEY_STYLE_ATTR),
|
|
395
|
+
/* harmony export */ HONEY_STYLE_PRIORITY_ATTR: () => (/* binding */ HONEY_STYLE_PRIORITY_ATTR),
|
|
396
|
+
/* harmony export */ HONEY_STYLE_REGISTRY_SYMBOL: () => (/* binding */ HONEY_STYLE_REGISTRY_SYMBOL),
|
|
395
397
|
/* harmony export */ VALID_DOM_ELEMENT_ATTRS: () => (/* binding */ VALID_DOM_ELEMENT_ATTRS),
|
|
396
398
|
/* harmony export */ __DEV__: () => (/* binding */ __DEV__)
|
|
397
399
|
/* harmony export */ });
|
|
@@ -401,9 +403,11 @@ if (__DEV__) {
|
|
|
401
403
|
console.info('[@react-hive/honey-style]: You are running in development mode. ' +
|
|
402
404
|
'This build is not optimized for production and may include extra checks or logs.');
|
|
403
405
|
}
|
|
406
|
+
const HONEY_STYLE_REGISTRY_SYMBOL = Symbol.for('honey-style-registry');
|
|
404
407
|
const HONEY_STYLED_COMPONENT_ID_PROP = '$$ComponentId';
|
|
405
408
|
const HONEY_GLOBAL_STYLE_ATTR = 'data-honey-global-style';
|
|
406
409
|
const HONEY_STYLE_ATTR = 'data-honey-style';
|
|
410
|
+
const HONEY_STYLE_PRIORITY_ATTR = 'data-priority';
|
|
407
411
|
const HONEY_BREAKPOINTS = ['xs', 'sm', 'md', 'lg', 'xl'];
|
|
408
412
|
const VALID_HTML_ATTRS = new Set([
|
|
409
413
|
// Standard Attributes
|
|
@@ -725,7 +729,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
725
729
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
726
730
|
/* harmony export */ mediaQuery: () => (/* binding */ mediaQuery)
|
|
727
731
|
/* harmony export */ });
|
|
728
|
-
/* harmony import */ var _react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-hive/honey-utils */ "./node_modules/.pnpm/@react-hive+honey-utils@
|
|
732
|
+
/* harmony import */ var _react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-hive/honey-utils */ "./node_modules/.pnpm/@react-hive+honey-utils@4.0.0/node_modules/@react-hive/honey-utils/dist/index.mjs");
|
|
729
733
|
|
|
730
734
|
/**
|
|
731
735
|
* Constructs a complete `@media` query string from an array of media rule objects.
|
|
@@ -783,7 +787,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
783
787
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
784
788
|
/* harmony export */ compileCss: () => (/* binding */ compileCss)
|
|
785
789
|
/* harmony export */ });
|
|
786
|
-
/* harmony import */ var _react_hive_honey_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-hive/honey-css */ "./node_modules/.pnpm/@react-hive+honey-css@1.17.
|
|
790
|
+
/* harmony import */ var _react_hive_honey_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-hive/honey-css */ "./node_modules/.pnpm/@react-hive+honey-css@1.17.1/node_modules/@react-hive/honey-css/dist/index.mjs");
|
|
787
791
|
/* harmony import */ var _flatten_css_rules__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./flatten-css-rules */ "./src/css/flatten-css-rules.ts");
|
|
788
792
|
|
|
789
793
|
|
|
@@ -937,10 +941,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
937
941
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
938
942
|
/* harmony export */ createMediaAtRuleTransformer: () => (/* binding */ createMediaAtRuleTransformer)
|
|
939
943
|
/* harmony export */ });
|
|
940
|
-
/* harmony import */ var
|
|
941
|
-
/* harmony import */ var
|
|
942
|
-
/* harmony import */ var
|
|
943
|
-
/* harmony import */ var
|
|
944
|
+
/* harmony import */ var _at_rules__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./at-rules */ "./src/css/at-rules/index.ts");
|
|
945
|
+
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants */ "./src/constants.ts");
|
|
946
|
+
/* harmony import */ var _create_at_rule_transformer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./create-at-rule-transformer */ "./src/css/create-at-rule-transformer.ts");
|
|
947
|
+
/* harmony import */ var _unwrap_params__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./unwrap-params */ "./src/css/unwrap-params.ts");
|
|
944
948
|
|
|
945
949
|
|
|
946
950
|
|
|
@@ -955,11 +959,11 @@ const parseBreakpointRule = (raw) => {
|
|
|
955
959
|
direction: (direction ?? 'up'),
|
|
956
960
|
};
|
|
957
961
|
};
|
|
958
|
-
const createMediaAtRuleTransformer = ({ theme }) => (0,
|
|
962
|
+
const createMediaAtRuleTransformer = ({ theme }) => (0,_create_at_rule_transformer__WEBPACK_IMPORTED_MODULE_2__.createAtRuleTransformer)('honey-media', (node) => {
|
|
959
963
|
if (!theme?.breakpoints) {
|
|
960
964
|
return [];
|
|
961
965
|
}
|
|
962
|
-
const rawParams = (0,
|
|
966
|
+
const rawParams = (0,_unwrap_params__WEBPACK_IMPORTED_MODULE_3__.unwrapParams)(node.params);
|
|
963
967
|
if (!rawParams) {
|
|
964
968
|
return [];
|
|
965
969
|
}
|
|
@@ -977,7 +981,7 @@ const createMediaAtRuleTransformer = ({ theme }) => (0,_create_at_rule_transform
|
|
|
977
981
|
continue;
|
|
978
982
|
}
|
|
979
983
|
if (!isBreakpointToken(token)) {
|
|
980
|
-
if (
|
|
984
|
+
if (_constants__WEBPACK_IMPORTED_MODULE_1__.__DEV__) {
|
|
981
985
|
console.warn(`[@react-hive/honey-style]: Unknown @honey-media token: "${token}".`);
|
|
982
986
|
}
|
|
983
987
|
continue;
|
|
@@ -987,7 +991,7 @@ const createMediaAtRuleTransformer = ({ theme }) => (0,_create_at_rule_transform
|
|
|
987
991
|
? theme.breakpoints[breakpointRule.key]
|
|
988
992
|
: null;
|
|
989
993
|
if (!breakpointPx) {
|
|
990
|
-
if (
|
|
994
|
+
if (_constants__WEBPACK_IMPORTED_MODULE_1__.__DEV__) {
|
|
991
995
|
console.warn(`[@react-hive/honey-style]: Unknown breakpoint "${breakpointRule.key}" in @honey-media.`);
|
|
992
996
|
}
|
|
993
997
|
continue;
|
|
@@ -1030,7 +1034,7 @@ const createMediaAtRuleTransformer = ({ theme }) => (0,_create_at_rule_transform
|
|
|
1030
1034
|
if (!finalRules.length) {
|
|
1031
1035
|
return [];
|
|
1032
1036
|
}
|
|
1033
|
-
const fullMedia = (0,
|
|
1037
|
+
const fullMedia = (0,_at_rules__WEBPACK_IMPORTED_MODULE_0__.mediaQuery)(finalRules);
|
|
1034
1038
|
return [
|
|
1035
1039
|
{
|
|
1036
1040
|
type: 'atRule',
|
|
@@ -1054,7 +1058,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1054
1058
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1055
1059
|
/* harmony export */ createSpacingTransformer: () => (/* binding */ createSpacingTransformer)
|
|
1056
1060
|
/* harmony export */ });
|
|
1057
|
-
/* harmony import */ var _react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-hive/honey-utils */ "./node_modules/.pnpm/@react-hive+honey-utils@
|
|
1061
|
+
/* harmony import */ var _react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-hive/honey-utils */ "./node_modules/.pnpm/@react-hive+honey-utils@4.0.0/node_modules/@react-hive/honey-utils/dist/index.mjs");
|
|
1058
1062
|
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constants */ "./src/css/constants.ts");
|
|
1059
1063
|
/* harmony import */ var _resolve_spacing_value__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./resolve-spacing-value */ "./src/css/resolve-spacing-value.ts");
|
|
1060
1064
|
|
|
@@ -1112,7 +1116,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1112
1116
|
/* harmony export */ createCssRule: () => (/* binding */ createCssRule),
|
|
1113
1117
|
/* harmony export */ css: () => (/* binding */ css)
|
|
1114
1118
|
/* harmony export */ });
|
|
1115
|
-
/* harmony import */ var _react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-hive/honey-utils */ "./node_modules/.pnpm/@react-hive+honey-utils@
|
|
1119
|
+
/* harmony import */ var _react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-hive/honey-utils */ "./node_modules/.pnpm/@react-hive+honey-utils@4.0.0/node_modules/@react-hive/honey-utils/dist/index.mjs");
|
|
1116
1120
|
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants */ "./src/constants.ts");
|
|
1117
1121
|
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils */ "./src/utils.ts");
|
|
1118
1122
|
|
|
@@ -1157,7 +1161,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1157
1161
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1158
1162
|
/* harmony export */ flattenCssRules: () => (/* binding */ flattenCssRules)
|
|
1159
1163
|
/* harmony export */ });
|
|
1160
|
-
/* harmony import */ var _react_hive_honey_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-hive/honey-css */ "./node_modules/.pnpm/@react-hive+honey-css@1.17.
|
|
1164
|
+
/* harmony import */ var _react_hive_honey_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-hive/honey-css */ "./node_modules/.pnpm/@react-hive+honey-css@1.17.1/node_modules/@react-hive/honey-css/dist/index.mjs");
|
|
1161
1165
|
|
|
1162
1166
|
const SELECTOR_CONTEXT_AT_RULES = {
|
|
1163
1167
|
media: true,
|
|
@@ -1262,7 +1266,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1262
1266
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1263
1267
|
/* harmony export */ processCss: () => (/* binding */ processCss)
|
|
1264
1268
|
/* harmony export */ });
|
|
1265
|
-
/* harmony import */ var _react_hive_honey_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-hive/honey-css */ "./node_modules/.pnpm/@react-hive+honey-css@1.17.
|
|
1269
|
+
/* harmony import */ var _react_hive_honey_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-hive/honey-css */ "./node_modules/.pnpm/@react-hive+honey-css@1.17.1/node_modules/@react-hive/honey-css/dist/index.mjs");
|
|
1266
1270
|
/* harmony import */ var _css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./css */ "./src/css/css.ts");
|
|
1267
1271
|
/* harmony import */ var _compile_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./compile-css */ "./src/css/compile-css.ts");
|
|
1268
1272
|
/* harmony import */ var _transform_absolute_fill_at_rule__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./transform-absolute-fill-at-rule */ "./src/css/transform-absolute-fill-at-rule.ts");
|
|
@@ -1687,7 +1691,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1687
1691
|
/* harmony export */ });
|
|
1688
1692
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
1689
1693
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
1690
|
-
/* harmony import */ var _react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @react-hive/honey-utils */ "./node_modules/.pnpm/@react-hive+honey-utils@
|
|
1694
|
+
/* harmony import */ var _react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @react-hive/honey-utils */ "./node_modules/.pnpm/@react-hive+honey-utils@4.0.0/node_modules/@react-hive/honey-utils/dist/index.mjs");
|
|
1691
1695
|
/* harmony import */ var _contexts__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../contexts */ "./src/contexts/index.ts");
|
|
1692
1696
|
|
|
1693
1697
|
|
|
@@ -1713,49 +1717,73 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1713
1717
|
/* harmony export */ });
|
|
1714
1718
|
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants */ "./src/constants.ts");
|
|
1715
1719
|
|
|
1716
|
-
/**
|
|
1717
|
-
* Global style registry, shared across reloads and modules.
|
|
1718
|
-
*/
|
|
1719
1720
|
const getStyleRegistry = () => {
|
|
1720
|
-
|
|
1721
|
-
|
|
1721
|
+
const w = window;
|
|
1722
|
+
if (!w[_constants__WEBPACK_IMPORTED_MODULE_0__.HONEY_STYLE_REGISTRY_SYMBOL]) {
|
|
1723
|
+
w[_constants__WEBPACK_IMPORTED_MODULE_0__.HONEY_STYLE_REGISTRY_SYMBOL] = new Map();
|
|
1722
1724
|
}
|
|
1723
|
-
return
|
|
1725
|
+
return w[_constants__WEBPACK_IMPORTED_MODULE_0__.HONEY_STYLE_REGISTRY_SYMBOL];
|
|
1724
1726
|
};
|
|
1725
1727
|
const styleRegistry = getStyleRegistry();
|
|
1726
|
-
let globalStyleTag = null;
|
|
1727
1728
|
/**
|
|
1728
|
-
*
|
|
1729
|
-
*
|
|
1730
|
-
* @returns The <style> element.
|
|
1729
|
+
* Cache style tags per priority
|
|
1731
1730
|
*/
|
|
1732
|
-
const
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
if (!globalStyleTag) {
|
|
1736
|
-
globalStyleTag = document.createElement('style');
|
|
1737
|
-
globalStyleTag.setAttribute(_constants__WEBPACK_IMPORTED_MODULE_0__.HONEY_STYLE_ATTR, 'true');
|
|
1738
|
-
document.head.appendChild(globalStyleTag);
|
|
1739
|
-
}
|
|
1740
|
-
}
|
|
1741
|
-
return globalStyleTag;
|
|
1742
|
-
};
|
|
1731
|
+
const styleTagsByPriority = new Map();
|
|
1732
|
+
const pendingStyleUpdatePriorities = new Set();
|
|
1733
|
+
let isStyleUpdateScheduled = false;
|
|
1743
1734
|
/**
|
|
1744
|
-
*
|
|
1735
|
+
* Ensures a <style> tag exists for a given priority.
|
|
1745
1736
|
*/
|
|
1746
|
-
const
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1737
|
+
const ensureStyleTagForPriority = (priority) => {
|
|
1738
|
+
let styleElement = styleTagsByPriority.get(priority);
|
|
1739
|
+
if (styleElement)
|
|
1740
|
+
return styleElement;
|
|
1741
|
+
styleElement = document.createElement('style');
|
|
1742
|
+
styleElement.setAttribute(_constants__WEBPACK_IMPORTED_MODULE_0__.HONEY_STYLE_ATTR, 'true');
|
|
1743
|
+
styleElement.setAttribute(_constants__WEBPACK_IMPORTED_MODULE_0__.HONEY_STYLE_PRIORITY_ATTR, String(priority));
|
|
1744
|
+
const existing = Array.from(document.querySelectorAll(`style[${_constants__WEBPACK_IMPORTED_MODULE_0__.HONEY_STYLE_ATTR}="true"]`));
|
|
1745
|
+
const insertBefore = existing.find(el => Number(el.getAttribute(_constants__WEBPACK_IMPORTED_MODULE_0__.HONEY_STYLE_PRIORITY_ATTR)) > priority);
|
|
1746
|
+
if (insertBefore) {
|
|
1747
|
+
document.head.insertBefore(styleElement, insertBefore);
|
|
1748
|
+
}
|
|
1749
|
+
else {
|
|
1750
|
+
document.head.appendChild(styleElement);
|
|
1751
|
+
}
|
|
1752
|
+
styleTagsByPriority.set(priority, styleElement);
|
|
1753
|
+
return styleElement;
|
|
1754
|
+
};
|
|
1755
|
+
const updateStyleTagForPriority = (priority) => {
|
|
1756
|
+
const tag = ensureStyleTagForPriority(priority);
|
|
1757
|
+
const css = Array.from(styleRegistry.values())
|
|
1758
|
+
.filter(entry => entry.priority === priority)
|
|
1759
|
+
.map(entry => entry.css)
|
|
1751
1760
|
.join('\n');
|
|
1752
|
-
|
|
1761
|
+
if (css) {
|
|
1762
|
+
tag.textContent = css;
|
|
1763
|
+
}
|
|
1764
|
+
else {
|
|
1765
|
+
tag.remove();
|
|
1766
|
+
styleTagsByPriority.delete(priority);
|
|
1767
|
+
}
|
|
1768
|
+
};
|
|
1769
|
+
const flushStyleUpdates = () => {
|
|
1770
|
+
for (const priority of pendingStyleUpdatePriorities) {
|
|
1771
|
+
updateStyleTagForPriority(priority);
|
|
1772
|
+
}
|
|
1773
|
+
pendingStyleUpdatePriorities.clear();
|
|
1774
|
+
};
|
|
1775
|
+
const scheduleStyleUpdate = (priority) => {
|
|
1776
|
+
pendingStyleUpdatePriorities.add(priority);
|
|
1777
|
+
if (isStyleUpdateScheduled) {
|
|
1778
|
+
return;
|
|
1779
|
+
}
|
|
1780
|
+
isStyleUpdateScheduled = true;
|
|
1781
|
+
// microtask → no flicker (runs before paint)
|
|
1782
|
+
queueMicrotask(() => {
|
|
1783
|
+
isStyleUpdateScheduled = false;
|
|
1784
|
+
flushStyleUpdates();
|
|
1785
|
+
});
|
|
1753
1786
|
};
|
|
1754
|
-
/**
|
|
1755
|
-
* Creates a cleanup function for a style, which decrements usage count and removes it if unused.
|
|
1756
|
-
*
|
|
1757
|
-
* @param className - The key of the style.
|
|
1758
|
-
*/
|
|
1759
1787
|
const createCleanupFunction = (className) => () => {
|
|
1760
1788
|
const entry = styleRegistry.get(className);
|
|
1761
1789
|
if (!entry) {
|
|
@@ -1764,22 +1792,17 @@ const createCleanupFunction = (className) => () => {
|
|
|
1764
1792
|
entry.usages--;
|
|
1765
1793
|
if (entry.usages <= 0) {
|
|
1766
1794
|
styleRegistry.delete(className);
|
|
1767
|
-
|
|
1795
|
+
scheduleStyleUpdate(entry.priority);
|
|
1768
1796
|
}
|
|
1769
1797
|
};
|
|
1770
|
-
/**
|
|
1771
|
-
* Mounts a CSS string under a given class name. Injects into a global <style> tag and manages its lifecycle.
|
|
1772
|
-
*
|
|
1773
|
-
* @param className - Unique identifier for the style block.
|
|
1774
|
-
* @param css - Full CSS rule string (can include multiple rules, media queries, etc.)
|
|
1775
|
-
* @param priority - Optional number to determine style ordering (lower = earlier = lower specificity)
|
|
1776
|
-
*
|
|
1777
|
-
* @returns A cleanup function to unmount the style when it's no longer needed.
|
|
1778
|
-
*/
|
|
1779
1798
|
const mountStyle = (className, css, priority = 0) => {
|
|
1780
1799
|
const existing = styleRegistry.get(className);
|
|
1781
1800
|
if (existing) {
|
|
1782
1801
|
existing.usages++;
|
|
1802
|
+
if (existing.priority > priority) {
|
|
1803
|
+
existing.priority = priority;
|
|
1804
|
+
updateStyleTagForPriority(priority);
|
|
1805
|
+
}
|
|
1783
1806
|
return createCleanupFunction(className);
|
|
1784
1807
|
}
|
|
1785
1808
|
styleRegistry.set(className, {
|
|
@@ -1787,7 +1810,7 @@ const mountStyle = (className, css, priority = 0) => {
|
|
|
1787
1810
|
priority,
|
|
1788
1811
|
usages: 1,
|
|
1789
1812
|
});
|
|
1790
|
-
|
|
1813
|
+
updateStyleTagForPriority(priority);
|
|
1791
1814
|
return createCleanupFunction(className);
|
|
1792
1815
|
};
|
|
1793
1816
|
|
|
@@ -1804,7 +1827,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1804
1827
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1805
1828
|
/* harmony export */ HoneyStyleProvider: () => (/* binding */ HoneyStyleProvider)
|
|
1806
1829
|
/* harmony export */ });
|
|
1807
|
-
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/.pnpm/react@19.2.
|
|
1830
|
+
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/.pnpm/react@19.2.6/node_modules/react/jsx-runtime.js");
|
|
1808
1831
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
|
|
1809
1832
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
1810
1833
|
/* harmony import */ var _contexts__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../contexts */ "./src/contexts/index.ts");
|
|
@@ -1855,7 +1878,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1855
1878
|
/* harmony export */ });
|
|
1856
1879
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
1857
1880
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
1858
|
-
/* harmony import */ var _react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @react-hive/honey-utils */ "./node_modules/.pnpm/@react-hive+honey-utils@
|
|
1881
|
+
/* harmony import */ var _react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @react-hive/honey-utils */ "./node_modules/.pnpm/@react-hive+honey-utils@4.0.0/node_modules/@react-hive/honey-utils/dist/index.mjs");
|
|
1859
1882
|
/* harmony import */ var _css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./css */ "./src/css/index.ts");
|
|
1860
1883
|
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./constants */ "./src/constants.ts");
|
|
1861
1884
|
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./src/utils.ts");
|
|
@@ -1868,24 +1891,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1868
1891
|
|
|
1869
1892
|
|
|
1870
1893
|
|
|
1871
|
-
const evaluateDynamicCss = (interpolation, context) => {
|
|
1872
|
-
if (!interpolation) {
|
|
1873
|
-
return '';
|
|
1874
|
-
}
|
|
1875
|
-
if ((0,_react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_1__.isString)(interpolation)) {
|
|
1876
|
-
return interpolation;
|
|
1877
|
-
}
|
|
1878
|
-
// @ts-expect-error
|
|
1879
|
-
return (0,_css__WEBPACK_IMPORTED_MODULE_2__.css)([''], [interpolation])(context);
|
|
1880
|
-
};
|
|
1881
1894
|
const styled = (target, defaultProps, { omitProps } = {}) => {
|
|
1882
1895
|
return (strings, ...interpolations) => {
|
|
1883
1896
|
const componentId = (0,_utils__WEBPACK_IMPORTED_MODULE_4__.generateId)('hsc');
|
|
1884
1897
|
const computeCss = (0,_css__WEBPACK_IMPORTED_MODULE_2__.css)(strings, ...interpolations);
|
|
1885
|
-
const StyledComponent = ({ as, className, __compositionDepth = 0,
|
|
1886
|
-
if (_constants__WEBPACK_IMPORTED_MODULE_3__.__DEV__ && cssProp) {
|
|
1887
|
-
console.warn(`[@react-hive/honey-style]: The "css" prop is deprecated. Please use inheritance or composition instead.`);
|
|
1888
|
-
}
|
|
1898
|
+
const StyledComponent = ({ as, className, __compositionDepth = 0, ...props }) => {
|
|
1889
1899
|
const { theme } = (0,_hooks__WEBPACK_IMPORTED_MODULE_6__.useHoneyStyle)();
|
|
1890
1900
|
const cleanedProps = (0,_react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_1__.definedProps)(props);
|
|
1891
1901
|
const resolvedDefaultProps = {
|
|
@@ -1912,22 +1922,9 @@ const styled = (target, defaultProps, { omitProps } = {}) => {
|
|
|
1912
1922
|
});
|
|
1913
1923
|
return (0,_mount_style__WEBPACK_IMPORTED_MODULE_5__.mountStyle)(baseClassName, baseCss, __compositionDepth);
|
|
1914
1924
|
}, [baseClassName]);
|
|
1915
|
-
const cssPropRaw = (0,_react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_1__.invokeIfFunction)(cssProp, context);
|
|
1916
|
-
const cssPropString = evaluateDynamicCss(cssPropRaw, context);
|
|
1917
|
-
const cssPropClassName = cssPropString ? (0,_utils__WEBPACK_IMPORTED_MODULE_4__.buildClassName)(cssPropString) : '';
|
|
1918
|
-
(0,react__WEBPACK_IMPORTED_MODULE_0__.useInsertionEffect)(() => {
|
|
1919
|
-
if (cssPropClassName) {
|
|
1920
|
-
const overrideCss = (0,_css__WEBPACK_IMPORTED_MODULE_2__.processCss)(cssPropString, {
|
|
1921
|
-
theme,
|
|
1922
|
-
selector: `.${cssPropClassName}`,
|
|
1923
|
-
});
|
|
1924
|
-
return (0,_mount_style__WEBPACK_IMPORTED_MODULE_5__.mountStyle)(cssPropClassName, overrideCss, 1);
|
|
1925
|
-
}
|
|
1926
|
-
}, [cssPropClassName]);
|
|
1927
1925
|
const finalClassName = (0,_utils__WEBPACK_IMPORTED_MODULE_4__.combineClassNames)([
|
|
1928
1926
|
componentId,
|
|
1929
1927
|
baseClassName,
|
|
1930
|
-
cssPropClassName,
|
|
1931
1928
|
resolvedDefaultProps.className,
|
|
1932
1929
|
]);
|
|
1933
1930
|
const mergedProps = {
|
|
@@ -2032,7 +2029,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2032
2029
|
/* harmony export */ resolveFont: () => (/* binding */ resolveFont),
|
|
2033
2030
|
/* harmony export */ resolveSpacing: () => (/* binding */ resolveSpacing)
|
|
2034
2031
|
/* harmony export */ });
|
|
2035
|
-
/* harmony import */ var _react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-hive/honey-utils */ "./node_modules/.pnpm/@react-hive+honey-utils@
|
|
2032
|
+
/* harmony import */ var _react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-hive/honey-utils */ "./node_modules/.pnpm/@react-hive+honey-utils@4.0.0/node_modules/@react-hive/honey-utils/dist/index.mjs");
|
|
2036
2033
|
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constants */ "./src/constants.ts");
|
|
2037
2034
|
/* harmony import */ var _css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./css */ "./src/css/index.ts");
|
|
2038
2035
|
|
|
@@ -2194,9 +2191,9 @@ module.exports = require("react");
|
|
|
2194
2191
|
|
|
2195
2192
|
/***/ },
|
|
2196
2193
|
|
|
2197
|
-
/***/ "./node_modules/.pnpm/@react-hive+honey-css@1.17.
|
|
2194
|
+
/***/ "./node_modules/.pnpm/@react-hive+honey-css@1.17.1/node_modules/@react-hive/honey-css/dist/index.mjs"
|
|
2198
2195
|
/*!***********************************************************************************************************!*\
|
|
2199
|
-
!*** ./node_modules/.pnpm/@react-hive+honey-css@1.17.
|
|
2196
|
+
!*** ./node_modules/.pnpm/@react-hive+honey-css@1.17.1/node_modules/@react-hive/honey-css/dist/index.mjs ***!
|
|
2200
2197
|
\***********************************************************************************************************/
|
|
2201
2198
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
2202
2199
|
|
|
@@ -2220,113 +2217,118 @@ const e=e=>"{"===e||"}"===e||":"===e||";"===e||"@"===e||"("===e||'"'===e||"'"===
|
|
|
2220
2217
|
|
|
2221
2218
|
/***/ },
|
|
2222
2219
|
|
|
2223
|
-
/***/ "./node_modules/.pnpm/@react-hive+honey-utils@
|
|
2224
|
-
|
|
2225
|
-
!*** ./node_modules/.pnpm/@react-hive+honey-utils@
|
|
2226
|
-
|
|
2220
|
+
/***/ "./node_modules/.pnpm/@react-hive+honey-utils@4.0.0/node_modules/@react-hive/honey-utils/dist/index.mjs"
|
|
2221
|
+
/*!**************************************************************************************************************!*\
|
|
2222
|
+
!*** ./node_modules/.pnpm/@react-hive+honey-utils@4.0.0/node_modules/@react-hive/honey-utils/dist/index.mjs ***!
|
|
2223
|
+
\**************************************************************************************************************/
|
|
2227
2224
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
2228
2225
|
|
|
2229
2226
|
__webpack_require__.r(__webpack_exports__);
|
|
2230
2227
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2231
|
-
/* harmony export */ DATA_TRANSFER_JSON_MIME: () => (/* binding */
|
|
2228
|
+
/* harmony export */ DATA_TRANSFER_JSON_MIME: () => (/* binding */ et),
|
|
2232
2229
|
/* harmony export */ FOCUSABLE_HTML_TAGS: () => (/* binding */ a),
|
|
2233
|
-
/* harmony export */ applyInertiaStep: () => (/* binding */
|
|
2234
|
-
/* harmony export */ assert: () => (/* binding */
|
|
2235
|
-
/* harmony export */ blobToFile: () => (/* binding */
|
|
2236
|
-
/* harmony export */ calculateCenterOffset: () => (/* binding */
|
|
2237
|
-
/* harmony export */ calculateEuclideanDistance: () => (/* binding */
|
|
2238
|
-
/* harmony export */ calculateMovingSpeed: () => (/* binding */
|
|
2239
|
-
/* harmony export */ calculatePercentage: () => (/* binding */
|
|
2240
|
-
/* harmony export */ camelToDashCase: () => (/* binding */
|
|
2241
|
-
/* harmony export */ camelToWords: () => (/* binding */
|
|
2242
|
-
/* harmony export */ centerElementInContainer: () => (/* binding */
|
|
2230
|
+
/* harmony export */ applyInertiaStep: () => (/* binding */ It),
|
|
2231
|
+
/* harmony export */ assert: () => (/* binding */ d),
|
|
2232
|
+
/* harmony export */ blobToFile: () => (/* binding */ wt),
|
|
2233
|
+
/* harmony export */ calculateCenterOffset: () => (/* binding */ ut),
|
|
2234
|
+
/* harmony export */ calculateEuclideanDistance: () => (/* binding */ kt),
|
|
2235
|
+
/* harmony export */ calculateMovingSpeed: () => (/* binding */ Et),
|
|
2236
|
+
/* harmony export */ calculatePercentage: () => (/* binding */ Ot),
|
|
2237
|
+
/* harmony export */ camelToDashCase: () => (/* binding */ Tt),
|
|
2238
|
+
/* harmony export */ camelToWords: () => (/* binding */ Xt),
|
|
2239
|
+
/* harmony export */ centerElementInContainer: () => (/* binding */ ft),
|
|
2243
2240
|
/* harmony export */ chunk: () => (/* binding */ T),
|
|
2244
|
-
/* harmony export */
|
|
2245
|
-
/* harmony export */
|
|
2246
|
-
/* harmony export */
|
|
2247
|
-
/* harmony export */
|
|
2248
|
-
/* harmony export */
|
|
2249
|
-
/* harmony export */
|
|
2250
|
-
/* harmony export */
|
|
2241
|
+
/* harmony export */ clampOffsetToOverflow: () => (/* binding */ ht),
|
|
2242
|
+
/* harmony export */ cloneBlob: () => (/* binding */ t),
|
|
2243
|
+
/* harmony export */ compact: () => (/* binding */ X),
|
|
2244
|
+
/* harmony export */ compose: () => (/* binding */ c),
|
|
2245
|
+
/* harmony export */ decodeBase64: () => (/* binding */ Zt),
|
|
2246
|
+
/* harmony export */ decodeBase64Json: () => (/* binding */ Vt),
|
|
2247
|
+
/* harmony export */ definedProps: () => (/* binding */ Lt),
|
|
2248
|
+
/* harmony export */ delay: () => (/* binding */ q),
|
|
2249
|
+
/* harmony export */ difference: () => (/* binding */ u),
|
|
2250
|
+
/* harmony export */ downloadFile: () => (/* binding */ lt),
|
|
2251
2251
|
/* harmony export */ everyAsync: () => (/* binding */ V),
|
|
2252
|
-
/* harmony export */ fileListToFiles: () => (/* binding */
|
|
2252
|
+
/* harmony export */ fileListToFiles: () => (/* binding */ yt),
|
|
2253
2253
|
/* harmony export */ filterParallel: () => (/* binding */ H),
|
|
2254
2254
|
/* harmony export */ filterSequential: () => (/* binding */ D),
|
|
2255
|
-
/* harmony export */ findAsync: () => (/* binding */
|
|
2256
|
-
/* harmony export */ findCharIndices: () => (/* binding */
|
|
2257
|
-
/* harmony export */ flattenTree: () => (/* binding */
|
|
2258
|
-
/* harmony export */ forEachChar: () => (/* binding */
|
|
2259
|
-
/* harmony export */ generateEphemeralId: () => (/* binding */
|
|
2260
|
-
/* harmony export */
|
|
2261
|
-
/* harmony export */
|
|
2262
|
-
/* harmony export */
|
|
2255
|
+
/* harmony export */ findAsync: () => (/* binding */ J),
|
|
2256
|
+
/* harmony export */ findCharIndices: () => (/* binding */ Rt),
|
|
2257
|
+
/* harmony export */ flattenTree: () => (/* binding */ Ut),
|
|
2258
|
+
/* harmony export */ forEachChar: () => (/* binding */ Yt),
|
|
2259
|
+
/* harmony export */ generateEphemeralId: () => (/* binding */ Mt),
|
|
2260
|
+
/* harmony export */ getAdjacentItems: () => (/* binding */ N),
|
|
2261
|
+
/* harmony export */ getDOMRectIntersectionRatio: () => (/* binding */ vt),
|
|
2262
|
+
/* harmony export */ getDataTransferJson: () => (/* binding */ rt),
|
|
2263
|
+
/* harmony export */ getElementOffsetRect: () => (/* binding */ e),
|
|
2263
2264
|
/* harmony export */ getFocusableHtmlElements: () => (/* binding */ i),
|
|
2264
|
-
/* harmony export */ getLocalStorageCapabilities: () => (/* binding */
|
|
2265
|
-
/* harmony export */ getTreeChildren: () => (/* binding */
|
|
2266
|
-
/* harmony export */ getWordsInitials: () => (/* binding */
|
|
2267
|
-
/* harmony export */ getXOverflowWidth: () => (/* binding */
|
|
2268
|
-
/* harmony export */ getYOverflowHeight: () => (/* binding */
|
|
2269
|
-
/* harmony export */ hasXOverflow: () => (/* binding */
|
|
2270
|
-
/* harmony export */ hasYOverflow: () => (/* binding */
|
|
2271
|
-
/* harmony export */ hashString: () => (/* binding */
|
|
2272
|
-
/* harmony export */ hexWithAlpha: () => (/* binding */
|
|
2273
|
-
/* harmony export */ intersection: () => (/* binding */
|
|
2274
|
-
/* harmony export */ invokeIfFunction: () => (/* binding */
|
|
2265
|
+
/* harmony export */ getLocalStorageCapabilities: () => (/* binding */ pt),
|
|
2266
|
+
/* harmony export */ getTreeChildren: () => (/* binding */ Wt),
|
|
2267
|
+
/* harmony export */ getWordsInitials: () => (/* binding */ jt),
|
|
2268
|
+
/* harmony export */ getXOverflowWidth: () => (/* binding */ ot),
|
|
2269
|
+
/* harmony export */ getYOverflowHeight: () => (/* binding */ ct),
|
|
2270
|
+
/* harmony export */ hasXOverflow: () => (/* binding */ it),
|
|
2271
|
+
/* harmony export */ hasYOverflow: () => (/* binding */ st),
|
|
2272
|
+
/* harmony export */ hashString: () => (/* binding */ $t),
|
|
2273
|
+
/* harmony export */ hexWithAlpha: () => (/* binding */ Dt),
|
|
2274
|
+
/* harmony export */ intersection: () => (/* binding */ f),
|
|
2275
|
+
/* harmony export */ invokeIfFunction: () => (/* binding */ At),
|
|
2275
2276
|
/* harmony export */ isAnchorHtmlElement: () => (/* binding */ n),
|
|
2276
|
-
/* harmony export */ isArray: () => (/* binding */
|
|
2277
|
-
/* harmony export */ isBlob: () => (/* binding */
|
|
2278
|
-
/* harmony export */ isBool: () => (/* binding */
|
|
2277
|
+
/* harmony export */ isArray: () => (/* binding */ _),
|
|
2278
|
+
/* harmony export */ isBlob: () => (/* binding */ I),
|
|
2279
|
+
/* harmony export */ isBool: () => (/* binding */ b),
|
|
2279
2280
|
/* harmony export */ isContentEditableHtmlElement: () => (/* binding */ r),
|
|
2280
|
-
/* harmony export */ isDate: () => (/* binding */
|
|
2281
|
-
/* harmony export */ isDecimal: () => (/* binding */
|
|
2282
|
-
/* harmony export */ isDefined: () => (/* binding */
|
|
2283
|
-
/* harmony export */ isEmptyArray: () => (/* binding */
|
|
2284
|
-
/* harmony export */ isEmptyObject: () => (/* binding */
|
|
2285
|
-
/* harmony export */ isError: () => (/* binding */
|
|
2286
|
-
/* harmony export */ isFile: () => (/* binding */
|
|
2287
|
-
/* harmony export */ isFiniteNumber: () => (/* binding */
|
|
2281
|
+
/* harmony export */ isDate: () => (/* binding */ S),
|
|
2282
|
+
/* harmony export */ isDecimal: () => (/* binding */ P),
|
|
2283
|
+
/* harmony export */ isDefined: () => (/* binding */ g),
|
|
2284
|
+
/* harmony export */ isEmptyArray: () => (/* binding */ z),
|
|
2285
|
+
/* harmony export */ isEmptyObject: () => (/* binding */ A),
|
|
2286
|
+
/* harmony export */ isError: () => (/* binding */ M),
|
|
2287
|
+
/* harmony export */ isFile: () => (/* binding */ gt),
|
|
2288
|
+
/* harmony export */ isFiniteNumber: () => (/* binding */ $),
|
|
2288
2289
|
/* harmony export */ isFunction: () => (/* binding */ Y),
|
|
2289
2290
|
/* harmony export */ isHtmlElementFocusable: () => (/* binding */ l),
|
|
2290
|
-
/* harmony export */ isInteger: () => (/* binding */
|
|
2291
|
-
/* harmony export */ isLocalStorageReadable: () => (/* binding */
|
|
2292
|
-
/* harmony export */ isMap: () => (/* binding */
|
|
2293
|
-
/* harmony export */ isNil: () => (/* binding */
|
|
2294
|
-
/* harmony export */ isNilOrEmptyString: () => (/* binding */
|
|
2295
|
-
/* harmony export */ isNull: () => (/* binding */
|
|
2296
|
-
/* harmony export */ isNumber: () => (/* binding */
|
|
2297
|
-
/* harmony export */ isObject: () => (/* binding */
|
|
2298
|
-
/* harmony export */ isPromise: () => (/* binding */
|
|
2299
|
-
/* harmony export */ isRegExp: () => (/* binding */
|
|
2300
|
-
/* harmony export */ isSet: () => (/* binding */
|
|
2301
|
-
/* harmony export */ isString: () => (/* binding */
|
|
2302
|
-
/* harmony export */ isSymbol: () => (/* binding */
|
|
2303
|
-
/* harmony export */ isUndefined: () => (/* binding */
|
|
2304
|
-
/* harmony export */ isValidDate: () => (/* binding */
|
|
2291
|
+
/* harmony export */ isInteger: () => (/* binding */ L),
|
|
2292
|
+
/* harmony export */ isLocalStorageReadable: () => (/* binding */ mt),
|
|
2293
|
+
/* harmony export */ isMap: () => (/* binding */ k),
|
|
2294
|
+
/* harmony export */ isNil: () => (/* binding */ p),
|
|
2295
|
+
/* harmony export */ isNilOrEmptyString: () => (/* binding */ zt),
|
|
2296
|
+
/* harmony export */ isNull: () => (/* binding */ m),
|
|
2297
|
+
/* harmony export */ isNumber: () => (/* binding */ w),
|
|
2298
|
+
/* harmony export */ isObject: () => (/* binding */ x),
|
|
2299
|
+
/* harmony export */ isPromise: () => (/* binding */ U),
|
|
2300
|
+
/* harmony export */ isRegExp: () => (/* binding */ C),
|
|
2301
|
+
/* harmony export */ isSet: () => (/* binding */ E),
|
|
2302
|
+
/* harmony export */ isString: () => (/* binding */ at),
|
|
2303
|
+
/* harmony export */ isSymbol: () => (/* binding */ O),
|
|
2304
|
+
/* harmony export */ isUndefined: () => (/* binding */ y),
|
|
2305
|
+
/* harmony export */ isValidDate: () => (/* binding */ v),
|
|
2305
2306
|
/* harmony export */ moveFocusWithinContainer: () => (/* binding */ o),
|
|
2306
|
-
/* harmony export */ noop: () => (/* binding */
|
|
2307
|
-
/* harmony export */ not: () => (/* binding */
|
|
2308
|
-
/* harmony export */ once: () => (/* binding */
|
|
2309
|
-
/* harmony export */ parse2DMatrix: () => (/* binding */
|
|
2310
|
-
/* harmony export */ parseFileName: () => (/* binding */
|
|
2311
|
-
/* harmony export */
|
|
2312
|
-
/* harmony export */
|
|
2313
|
-
/* harmony export */
|
|
2314
|
-
/* harmony export */
|
|
2315
|
-
/* harmony export */
|
|
2316
|
-
/* harmony export */
|
|
2317
|
-
/* harmony export */
|
|
2318
|
-
/* harmony export */
|
|
2319
|
-
/* harmony export */
|
|
2320
|
-
/* harmony export */
|
|
2321
|
-
/* harmony export */
|
|
2322
|
-
/* harmony export */
|
|
2323
|
-
/* harmony export */
|
|
2324
|
-
/* harmony export */
|
|
2325
|
-
/* harmony export */
|
|
2326
|
-
/* harmony export */
|
|
2327
|
-
/* harmony export */
|
|
2307
|
+
/* harmony export */ noop: () => (/* binding */ R),
|
|
2308
|
+
/* harmony export */ not: () => (/* binding */ j),
|
|
2309
|
+
/* harmony export */ once: () => (/* binding */ F),
|
|
2310
|
+
/* harmony export */ parse2DMatrix: () => (/* binding */ dt),
|
|
2311
|
+
/* harmony export */ parseFileName: () => (/* binding */ Nt),
|
|
2312
|
+
/* harmony export */ parseJson: () => (/* binding */ tt),
|
|
2313
|
+
/* harmony export */ pipe: () => (/* binding */ s),
|
|
2314
|
+
/* harmony export */ readFilesFromDataTransfer: () => (/* binding */ xt),
|
|
2315
|
+
/* harmony export */ reduceAsync: () => (/* binding */ G),
|
|
2316
|
+
/* harmony export */ resolveAxisDelta: () => (/* binding */ Ct),
|
|
2317
|
+
/* harmony export */ resolveBoundedDelta: () => (/* binding */ St),
|
|
2318
|
+
/* harmony export */ retry: () => (/* binding */ Q),
|
|
2319
|
+
/* harmony export */ runParallel: () => (/* binding */ B),
|
|
2320
|
+
/* harmony export */ runSequential: () => (/* binding */ W),
|
|
2321
|
+
/* harmony export */ searchTree: () => (/* binding */ Bt),
|
|
2322
|
+
/* harmony export */ setDataTransferJson: () => (/* binding */ nt),
|
|
2323
|
+
/* harmony export */ someAsync: () => (/* binding */ Z),
|
|
2324
|
+
/* harmony export */ splitMapJoin: () => (/* binding */ Ft),
|
|
2325
|
+
/* harmony export */ splitStringIntoWords: () => (/* binding */ _t),
|
|
2326
|
+
/* harmony export */ timeout: () => (/* binding */ K),
|
|
2327
|
+
/* harmony export */ toKebabCase: () => (/* binding */ Pt),
|
|
2328
|
+
/* harmony export */ traverseFileSystemDirectory: () => (/* binding */ bt),
|
|
2329
|
+
/* harmony export */ unique: () => (/* binding */ h)
|
|
2328
2330
|
/* harmony export */ });
|
|
2329
|
-
const
|
|
2331
|
+
const t=t=>new Blob([t],{type:t.type}),e=t=>new DOMRect(t.offsetLeft,t.offsetTop,t.clientWidth,t.clientHeight),n=t=>"A"===t.tagName,r=t=>"true"===t.getAttribute("contenteditable"),a=["INPUT","SELECT","TEXTAREA","BUTTON","A"],l=t=>{if(!t)return!1;const e=window.getComputedStyle(t);if("hidden"===e.visibility||"none"===e.display)return!1;if("disabled"in t&&t.disabled)return!1;const l=t.getAttribute("tabindex");return"-1"!==l&&(a.includes(t.tagName)?!n(t)||""!==t.href:!!r(t)||null!==l)},i=t=>Array.from(t.querySelectorAll("*")).filter(l),o=(t,e=null,{wrap:n=!0,getNextIndex:r}={})=>{const a=document.activeElement,l=e??a?.parentElement;if(!a||!l)return;const o=i(l);if(0===o.length)return;const s=o.indexOf(a);if(-1===s)return;let c;r?c=r(s,t,o):"next"===t?(c=s+1,c>=o.length&&(c=n?0:null)):(c=s-1,c<0&&(c=n?o.length-1:null)),null!==c&&o[c]?.focus()},s=(...t)=>e=>t.reduce((t,e)=>e(t),e),c=(...t)=>e=>t.reduceRight((t,e)=>e(t),e),u=(t,e)=>t.filter(t=>!e.includes(t)),h=t=>[...new Set(t)],f=(...t)=>{if(0===t.length)return[];if(1===t.length)return[...t[0]];const[e,...n]=t;return h(e).filter(t=>n.every(e=>e.includes(t)))};function d(t,e){if(!t)throw new Error(e)}const m=t=>null===t,p=t=>null==t,g=t=>null!=t,y=t=>void 0===t,w=t=>"number"==typeof t,b=t=>"boolean"==typeof t,x=t=>"object"==typeof t,A=t=>x(t)&&!m(t)&&0===Object.keys(t).length,S=t=>t instanceof Date,I=t=>t instanceof Blob,M=t=>t instanceof Error,v=t=>S(t)&&!isNaN(t.getTime()),C=t=>t instanceof RegExp,k=t=>t instanceof Map,E=t=>t instanceof Set,O=t=>"symbol"==typeof t,$=t=>w(t)&&isFinite(t),L=t=>w(t)&&Number.isInteger(t),P=t=>$(t)&&!Number.isInteger(t),T=(t,e)=>(d(e>0,"Chunk size must be greater than 0"),Array.from({length:Math.ceil(t.length/e)},(n,r)=>t.slice(r*e,(r+1)*e))),X=t=>t.filter(Boolean),_=t=>Array.isArray(t),z=t=>_(t)&&0===t.length,N=(t,e,n)=>{if(!t?.length||!e)return{previousItem:null,currentItem:null,nextItem:null};const r=t.findIndex(t=>n(t,e));return-1===r?{previousItem:null,currentItem:null,nextItem:null}:{previousItem:r>0?t[r-1]:null,currentItem:t[r],nextItem:r<t.length-1?t[r+1]:null}},R=()=>{},Y=t=>"function"==typeof t,j=t=>(...e)=>!t(...e),F=t=>{let e,n=!1;return function(...r){return n||(n=!0,e=t.apply(this,r)),e}},U=t=>Y(t?.then),W=async(t,e)=>{const n=[];for(let r=0;r<t.length;r++)n.push(await e(t[r],r,t));return n},B=async(t,e)=>Promise.all(t.map(e)),D=async(t,e)=>{const n=[];for(let r=0;r<t.length;r++){const a=t[r];await e(a,r,t)&&n.push(a)}return n},H=async(t,e)=>{const n=await B(t,async(t,n,r)=>!!await e(t,n,r)&&t);return X(n)},Z=async(t,e)=>{for(let n=0;n<t.length;n++)if(await e(t[n],n,t))return!0;return!1},V=async(t,e)=>{for(let n=0;n<t.length;n++)if(!await e(t[n],n,t))return!1;return!0},G=async(t,e,n)=>{let r=n;for(let n=0;n<t.length;n++)r=await e(r,t[n],n,t);return r},J=async(t,e)=>{for(let n=0;n<t.length;n++)if(await e(t[n],n,t))return t[n];return null},q=t=>new Promise(e=>setTimeout(e,t)),K=async(t,e,n="Operation timed out")=>{try{return await Promise.race([t,q(e).then(()=>Promise.reject(new Error(n)))])}finally{}},Q=(t,{maxAttempts:e=3,delayMs:n=300,backoff:r=!0,onRetry:a}={})=>async(...l)=>{let i;for(let o=1;o<=e;o++)try{return await t(...l)}catch(t){if(i=t,o<e){a?.(o,t);const e=r?n*2**(o-1):n;await q(e)}}throw i},tt=t=>{try{return JSON.parse(t)}catch{return null}},et="application/json",nt=(t,e)=>{t.setData(et,JSON.stringify(e))},rt=t=>{const e=t.getData(et);return e?tt(e):null},at=t=>"string"==typeof t,lt=(t,{fileName:e,target:n}={})=>{if(y(document))return;const r=document.createElement("a");let a=null;try{const l=at(t)?t:a=URL.createObjectURL(t);r.href=l,e&&(r.download=e),n&&(r.target=n),document.body.appendChild(r),r.click()}finally{r.remove(),a&&setTimeout(()=>{d(a,"Object URL should not be null"),URL.revokeObjectURL(a)},0)}},it=t=>t.scrollWidth>t.clientWidth,ot=t=>Math.max(0,t.scrollWidth-t.clientWidth),st=t=>t.scrollHeight>t.clientHeight,ct=t=>Math.max(0,t.scrollHeight-t.clientHeight),ut=({containerSize:t,elementOffset:e,elementSize:n})=>-(e+n/2-t/2),ht=(t,e)=>e<=0?0:Math.max(-e,Math.min(t,0)),ft=(t,e,{axis:n="both",shouldClamp:r=!0}={})=>{let a=0,l=0;if("x"===n||"both"===n){const n=ut({containerSize:t.clientWidth,elementOffset:e.offsetLeft,elementSize:e.clientWidth});a=r?ht(n,ot(t)):n}if("y"===n||"both"===n){const n=ut({containerSize:t.clientHeight,elementOffset:e.offsetTop,elementSize:e.clientHeight});l=r?ht(n,ct(t)):n}t.style.transform=`translate(${a}px, ${l}px)`},dt=t=>{const e=window.getComputedStyle(t).getPropertyValue("transform").match(/^matrix\((.+)\)$/);if(!e)return{translateX:0,translateY:0,scaleX:1,scaleY:1,skewX:0,skewY:0};const[n,r,a,l,i,o]=e[1].split(", ").map(parseFloat);return{translateX:i,translateY:o,scaleX:n,scaleY:l,skewX:a,skewY:r}},mt=()=>{if("undefined"==typeof window||!window.localStorage)return!1;try{return window.localStorage.getItem("__non_existing_key__"),!0}catch{return!1}},pt=()=>{if(!mt())return{readable:!1,writable:!1};try{const t="__test_write__";return window.localStorage.setItem(t,"1"),window.localStorage.removeItem(t),{readable:!0,writable:!0}}catch{}return{readable:!0,writable:!1}},gt=t=>t instanceof File,yt=t=>{if(!t)return[];const e=[];for(let n=0;n<t.length;n++)e.push(t[n]);return e},wt=(t,e)=>new File([t],e,{type:t.type}),bt=async(t,{skipFiles:e=[".DS_Store","Thumbs.db","desktop.ini","ehthumbs.db",".Spotlight-V100",".Trashes",".fseventsd","__MACOSX"]}={})=>{const n=new Set(e),r=await(async t=>{const e=t.createReader(),n=async()=>new Promise((t,r)=>{e.readEntries(async e=>{if(e.length)try{const r=await n();t([...e,...r])}catch(t){r(t)}else t([])},r)});return n()})(t);return(await B(r,async t=>t.isDirectory?bt(t,{skipFiles:e}):n.has(t.name)?[]:[await new Promise((e,n)=>{t.file(e,n)})])).flat()},xt=async(t,e={})=>{const n=t?.items;if(!n)return[];const r=[];for(let t=0;t<n.length;t++){const a=n[t];if("webkitGetAsEntry"in a){const t=a.webkitGetAsEntry?.();if(t?.isDirectory){r.push(bt(t,e));continue}if(t?.isFile){r.push(new Promise((e,n)=>t.file(t=>e([t]),n)));continue}}const l=a.getAsFile();l&&r.push(Promise.resolve([l]))}return(await Promise.all(r)).flat()},At=(t,...e)=>"function"==typeof t?t(...e):t,St=({delta:t,value:e,min:n,max:r})=>{if(0===t)return null;const a=e+t;return t<0?e<=n?null:Math.max(a,n):t>0?e>=r?null:Math.min(a,r):null},It=({value:t,min:e,max:n,velocityPxMs:r,deltaTimeMs:a,friction:l=.002,minVelocityPxMs:i=.01,emaAlpha:o=.2})=>{if(Math.abs(r)<i)return null;const s=St({delta:r*a,value:t,min:e,max:n});if(null===s)return null;const c=r*Math.exp(-l*a),u=o>0?r*(1-o)+c*o:c;return Math.abs(u)<i?null:{value:s,velocityPxMs:u}},Mt=()=>`${Math.floor(1e3*performance.now()).toString(36)}${Math.random().toString(36).slice(2,10)}`,vt=(t,e)=>Math.max(0,Math.min(t.right,e.right)-Math.max(t.left,e.left))*Math.max(0,Math.min(t.bottom,e.bottom)-Math.max(t.top,e.top))/(e.width*e.height),Ct=(t,e,{allowFallback:n=!0,invert:r=!0}={})=>{const a=r?-1:1;switch(e){case"x":return{deltaX:a*(0!==t.deltaX?t.deltaX:n?t.deltaY:0),deltaY:0};case"y":return{deltaX:0,deltaY:a*t.deltaY};default:return{deltaX:a*t.deltaX,deltaY:a*t.deltaY}}},kt=(t,e,n,r)=>{const a=n-t,l=r-e;return Math.hypot(a,l)},Et=(t,e)=>Math.abs(t/e),Ot=(t,e)=>t*e/100,$t=t=>{let e=5381;for(let n=0;n<t.length;n++)e=33*e^t.charCodeAt(n);return(e>>>0).toString(36)},Lt=t=>Object.entries(t).reduce((t,[e,n])=>(void 0!==n&&(t[e]=n),t),{}),Pt=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Tt=t=>{const e=t.charAt(0),n=t.slice(1);return e.toLowerCase()+n.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)},Xt=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1 $2"),_t=t=>0===t.length?[]:t.split(" ").filter(Boolean),zt=t=>""===t||p(t),Nt=t=>{const e=t.lastIndexOf(".");return e<=0||e===t.length-1?[t,""]:[t.slice(0,e),t.slice(e+1).toLowerCase()]},Rt=(t,e)=>{if(0===t.length)return[];const n=e.charCodeAt(0),r=[];for(let e=0;e<t.length;e++)t.charCodeAt(e)===n&&r.push(e);return r},Yt=(t,e,n)=>{if(0===t.length)return;const r=t.length;for(let a=0;a<r;a++){const l=t[a],i={charIndex:a,prevChar:a>0?t[a-1]:null,nextChar:a<r-1?t[a+1]:null};n?.(l,i)||e(l,i)}},jt=(t,e=1/0)=>0===t.length?"":_t(t).slice(0,e).map(t=>t[0]).join("").toUpperCase(),Ft=(t,e,n,r=e)=>t.split(e).map((t,e)=>n(t.trim(),e)).join(r),Ut=(t,e,n,r=[],a=void 0,l=0)=>(t?.forEach(t=>{const{[n]:i,...o}=t,s=t[n],c=Array.isArray(s);if(r.push({...o,parentId:a,depthLevel:l,childCount:c?s.length:0}),c){const a=t[e];Ut(s,e,n,r,a,l+1)}}),r),Wt=(t,e,n)=>t.filter(t=>t.parentId===e&&(!n||n(t))),Bt=(t,e,n,r)=>{const a=_t(r.toLowerCase());if(!a.length)return t;const l=t.reduce((t,n,r)=>(t[n[e]]=r,t),{});return t.reduce((r,i)=>{const o=i[n];if(!o)return r;if(r.some(t=>t[e]===i[e]))return r;const s=_t(o.toLowerCase());if(a.every(t=>s.some(e=>e.startsWith(t))))if(y(i.parentId)){r.push(i);const n=a=>{a.childCount&&t.forEach(t=>{t.parentId===a[e]&&(r.push(t),n(t))})};n(i)}else{const e=n=>{const a=l[n.parentId],i=t[a];y(i.parentId)||e(i);const o=r.length?r[r.length-1].parentId:null;(m(o)||o!==n.parentId)&&(d(i,"[@react-hive/honey-utils]: Parent node was not found."),r.push(i))};e(i),r.push(i)}return r},[])},Dt=(t,e)=>{d(e>=0&&e<=1,`[@react-hive/honey-utils]: Alpha "${e}" must be a number between 0 and 1.`);const n=t.match(/^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/);d(n,`[@react-hive/honey-utils]: Invalid hex format: ${t}`);const r=n[1];return`#${(3===r.length?r[0]+r[0]+r[1]+r[1]+r[2]+r[2]:r)+Math.round(255*e).toString(16).toUpperCase().padStart(2,"0")}`},Ht=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,Zt=t=>{try{return Ht.test(t)?"undefined"!=typeof Buffer?Buffer.from(t,"base64").toString("utf-8"):decodeURIComponent(atob(t).split("").map(t=>`%${t.charCodeAt(0).toString(16).padStart(2,"0")}`).join("")):null}catch{return null}},Vt=t=>{const e=Zt(t);return null===e?null:tt(e)};
|
|
2330
2332
|
//# sourceMappingURL=index.mjs.map
|
|
2331
2333
|
|
|
2332
2334
|
/***/ }
|
|
@@ -2419,6 +2421,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2419
2421
|
/* harmony export */ HONEY_GLOBAL_STYLE_ATTR: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.HONEY_GLOBAL_STYLE_ATTR),
|
|
2420
2422
|
/* harmony export */ HONEY_STYLED_COMPONENT_ID_PROP: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.HONEY_STYLED_COMPONENT_ID_PROP),
|
|
2421
2423
|
/* harmony export */ HONEY_STYLE_ATTR: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.HONEY_STYLE_ATTR),
|
|
2424
|
+
/* harmony export */ HONEY_STYLE_PRIORITY_ATTR: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.HONEY_STYLE_PRIORITY_ATTR),
|
|
2425
|
+
/* harmony export */ HONEY_STYLE_REGISTRY_SYMBOL: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.HONEY_STYLE_REGISTRY_SYMBOL),
|
|
2422
2426
|
/* harmony export */ HoneyStyleContext: () => (/* reexport safe */ _contexts__WEBPACK_IMPORTED_MODULE_1__.HoneyStyleContext),
|
|
2423
2427
|
/* harmony export */ HoneyStyleProvider: () => (/* reexport safe */ _providers__WEBPACK_IMPORTED_MODULE_2__.HoneyStyleProvider),
|
|
2424
2428
|
/* harmony export */ VALID_DOM_ELEMENT_ATTRS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.VALID_DOM_ELEMENT_ATTRS),
|