@sima-land/ui-nucleons 45.0.0-alpha.41 → 45.0.0-alpha.43
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/dropdown/utils.d.ts
CHANGED
|
@@ -8,8 +8,8 @@ export declare function dropdownFloatingConfig(): {
|
|
|
8
8
|
whileElementsMounted: typeof autoUpdate;
|
|
9
9
|
placement: "bottom-start";
|
|
10
10
|
middleware: {
|
|
11
|
-
name: string;
|
|
12
11
|
options?: any;
|
|
12
|
+
name: string;
|
|
13
13
|
fn: (state: import("@floating-ui/dom").MiddlewareState) => import("@floating-ui/core").MiddlewareReturn | Promise<import("@floating-ui/core").MiddlewareReturn>;
|
|
14
14
|
}[];
|
|
15
15
|
};
|
|
@@ -5,7 +5,7 @@ exports.useBreakpoint = useBreakpoint;
|
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
const __1 = require("..");
|
|
8
|
-
const
|
|
8
|
+
const helpers_1 = require("../../helpers");
|
|
9
9
|
const utils_1 = require("./utils");
|
|
10
10
|
const context_1 = require("../../context");
|
|
11
11
|
const Context = (0, react_1.createContext)(null);
|
|
@@ -19,7 +19,7 @@ function BreakpointProvider({ children }) {
|
|
|
19
19
|
const [contextValue, setRegistry] = (0, react_1.useState)(null);
|
|
20
20
|
const { matchMedia } = (0, react_1.useContext)(context_1.MatchMediaContext);
|
|
21
21
|
(0, __1.useIsomorphicLayoutEffect)(() => {
|
|
22
|
-
(0,
|
|
22
|
+
(0, helpers_1.isBrowser)() && setRegistry((0, utils_1.createRegistry)({ matchMedia }));
|
|
23
23
|
}, []);
|
|
24
24
|
return (0, jsx_runtime_1.jsx)(Context.Provider, { value: contextValue, children: children });
|
|
25
25
|
}
|
|
@@ -32,10 +32,10 @@ function useBreakpoint(query) {
|
|
|
32
32
|
if (!utils_1.BreakpointQuery.isValid(query)) {
|
|
33
33
|
throw Error(`useBreakpoint: Invalid query, "${query}"`);
|
|
34
34
|
}
|
|
35
|
+
const { matchMedia } = (0, react_1.useContext)(context_1.MatchMediaContext);
|
|
35
36
|
const [, setRegistry] = (0, react_1.useState)(null);
|
|
36
37
|
const registryFromContext = (0, react_1.useContext)(Context);
|
|
37
|
-
const [matches, setMatches] = (0, react_1.useState)(false);
|
|
38
|
-
const { matchMedia } = (0, react_1.useContext)(context_1.MatchMediaContext);
|
|
38
|
+
const [matches, setMatches] = (0, react_1.useState)((0, helpers_1.isBrowser)() ? matchMedia(utils_1.BreakpointQuery.toMediaQuery(query)).matches : false);
|
|
39
39
|
(0, __1.useIsomorphicLayoutEffect)(() => {
|
|
40
40
|
let registry;
|
|
41
41
|
if (registryFromContext) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/use-breakpoint/index.tsx"],"names":[],"mappings":";;AAeA,gDAUC;AAOD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/use-breakpoint/index.tsx"],"names":[],"mappings":";;AAeA,gDAUC;AAOD,sCAkCC;;AAlED,iCAAuE;AACvE,0BAA+C;AAC/C,2CAA0C;AAE1C,mCAA0D;AAC1D,2CAAkD;AAElD,MAAM,OAAO,GAAG,IAAA,qBAAa,EAAkB,IAAI,CAAC,CAAC;AAErD;;;;;GAKG;AACH,SAAgB,kBAAkB,CAAC,EAAE,QAAQ,EAA2B;IACtE,MAAM,CAAC,YAAY,EAAE,WAAW,CAAC,GAAG,IAAA,gBAAQ,EAAkB,IAAI,CAAC,CAAC;IAEpE,MAAM,EAAE,UAAU,EAAE,GAAG,IAAA,kBAAU,EAAC,2BAAiB,CAAC,CAAC;IAErD,IAAA,6BAAyB,EAAC,GAAG,EAAE;QAC7B,IAAA,mBAAS,GAAE,IAAI,WAAW,CAAC,IAAA,sBAAc,EAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;IAC7D,CAAC,EAAE,EAAE,C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,CAAC;IAClC,CAAC,EAAE,CAAC,mBAAmB,CAAC,CAAC,CAAC;IAE1B,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sima-land/ui-nucleons",
|
|
3
3
|
"type": "commonjs",
|
|
4
|
-
"version": "45.0.0-alpha.
|
|
4
|
+
"version": "45.0.0-alpha.43",
|
|
5
5
|
"repository": "ssh://git@github.com:sima-land/ui-nucleons.git",
|
|
6
6
|
"author": "www.sima-land.ru team",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"build:package": "cd build && npm pkg delete scripts.prepare && cd ..",
|
|
19
19
|
"type-check": "tsc -p . --noEmit",
|
|
20
20
|
"lint": "npm run lint:scripts && npm run lint:styles",
|
|
21
|
-
"lint:scripts": "eslint ./src/**/*.{js,jsx,ts,tsx}",
|
|
21
|
+
"lint:scripts": "eslint './src/**/*.{js,jsx,ts,tsx}'",
|
|
22
22
|
"lint:styles": "stylelint 'src/**/*.{css,scss}'",
|
|
23
23
|
"test": "BROWSERSLIST_ENV=\"test\" npx jest",
|
|
24
24
|
"test:coverage": "jest --clearCache && BROWSERSLIST_ENV=\"test\" npx jest --coverage",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@babel/preset-env": "^7.16.11",
|
|
43
43
|
"@babel/preset-react": "^7.16.7",
|
|
44
44
|
"@babel/preset-typescript": "^7.16.7",
|
|
45
|
-
"@playwright/test": "1.
|
|
45
|
+
"@playwright/test": "^1.56.1",
|
|
46
46
|
"@sima-land/linters": "^5.0.0",
|
|
47
47
|
"@testing-library/react": "^14.0.0",
|
|
48
48
|
"@testing-library/user-event": "^14.4.3",
|