Project Init

This commit is contained in:
Muluhabt
2026-05-29 15:23:46 +03:00
commit 2fbc557aac
67387 changed files with 6063341 additions and 0 deletions

3
node_modules/use-composed-ref/README.md generated vendored Normal file
View File

@@ -0,0 +1,3 @@
# use-composed-ref
React hook which creates a ref function from given refs. Useful when using forwardRef.

View File

@@ -0,0 +1,4 @@
import React from 'react';
type UserRef<T> = ((instance: T | null) => void) | React.RefObject<T> | null | undefined;
declare const useComposedRef: <T extends HTMLElement>(libRef: React.MutableRefObject<T | null>, userRef: UserRef<T>) => (instance: T | null) => void;
export default useComposedRef;

View File

@@ -0,0 +1,3 @@
export * from "./declarations/src/index.js";
export { _default as default } from "./use-composed-ref.cjs.default.js";
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlLWNvbXBvc2VkLXJlZi5janMuZC5tdHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuL2RlY2xhcmF0aW9ucy9zcmMvaW5kZXguZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9

View File

@@ -0,0 +1,3 @@
export * from "./declarations/src/index.js";
export { default } from "./declarations/src/index.js";
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlLWNvbXBvc2VkLXJlZi5janMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4vZGVjbGFyYXRpb25zL3NyYy9pbmRleC5kLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBIn0=

View File

@@ -0,0 +1 @@
export { default as _default } from "./declarations/src/index.js"

View File

@@ -0,0 +1 @@
exports._default = require("./use-composed-ref.cjs.js").default;

View File

@@ -0,0 +1,35 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var React = require('react');
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
var React__default = /*#__PURE__*/_interopDefault(React);
// basically Exclude<React.ClassAttributes<T>["ref"], string>
var updateRef = function updateRef(ref, value) {
if (typeof ref === 'function') {
ref(value);
return;
}
ref.current = value;
};
var useComposedRef = function useComposedRef(libRef, userRef) {
var prevUserRef = React__default["default"].useRef();
return React__default["default"].useCallback(function (instance) {
libRef.current = instance;
if (prevUserRef.current) {
updateRef(prevUserRef.current, null);
}
prevUserRef.current = userRef;
if (!userRef) {
return;
}
updateRef(userRef, instance);
}, [userRef]);
};
exports["default"] = useComposedRef;

View File

@@ -0,0 +1,2 @@
import "./use-composed-ref.cjs.js";
export { _default as default } from "./use-composed-ref.cjs.default.js";

View File

@@ -0,0 +1,27 @@
import React from 'react';
// basically Exclude<React.ClassAttributes<T>["ref"], string>
var updateRef = function updateRef(ref, value) {
if (typeof ref === 'function') {
ref(value);
return;
}
ref.current = value;
};
var useComposedRef = function useComposedRef(libRef, userRef) {
var prevUserRef = React.useRef();
return React.useCallback(function (instance) {
libRef.current = instance;
if (prevUserRef.current) {
updateRef(prevUserRef.current, null);
}
prevUserRef.current = userRef;
if (!userRef) {
return;
}
updateRef(userRef, instance);
}, [userRef]);
};
export { useComposedRef as default };

68
node_modules/use-composed-ref/package.json generated vendored Normal file
View File

@@ -0,0 +1,68 @@
{
"name": "use-composed-ref",
"version": "1.4.0",
"description": "React hook which creates a ref function from given refs. Useful when using forwardRef.",
"main": "dist/use-composed-ref.cjs.js",
"module": "dist/use-composed-ref.esm.js",
"exports": {
".": {
"types": {
"import": "./dist/use-composed-ref.cjs.mjs",
"default": "./dist/use-composed-ref.cjs.js"
},
"module": "./dist/use-composed-ref.esm.js",
"import": "./dist/use-composed-ref.cjs.mjs",
"default": "./dist/use-composed-ref.cjs.js"
},
"./package.json": "./package.json"
},
"types": "./dist/use-composed-ref.cjs.d.ts",
"files": [
"dist"
],
"scripts": {
"test": "echo \"Warning: no test specified\" || jest --env=node",
"build": "preconstruct build",
"preversion": "npm test",
"prepare": "npm run build"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Andarist/use-composed-ref.git"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/Andarist/use-composed-ref/issues"
},
"homepage": "https://github.com/Andarist/use-composed-ref#readme",
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
}
},
"devDependencies": {
"@babel/core": "^7.3.4",
"@babel/plugin-transform-modules-commonjs": "^7.2.0",
"@babel/preset-env": "^7.3.4",
"@babel/preset-typescript": "^7.3.3",
"@preconstruct/cli": "^2.8.10",
"@types/react": "^16.8.8",
"husky": "^1.3.1",
"jest": "^24.5.0",
"lint-staged": "^8.1.5",
"prettier": "^1.16.4",
"react": "^16.8.4",
"typescript": "^5.7.2"
},
"preconstruct": {
"exports": {
"importConditionDefaultExport": "default"
},
"___experimentalFlags_WILL_CHANGE_IN_PATCH": {
"importsConditions": true
}
}
}