UNPKG

@eccenca/gui-elements

Version:

GUI elements based on other libraries, usable in React application, written in Typescript.

28 lines 1.14 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.useReactFlowVersion = exports.ReactFlowVersions = void 0; const react_flow_renderer_1 = require("react-flow-renderer"); const react_1 = require("@xyflow/react"); var ReactFlowVersions; (function (ReactFlowVersions) { ReactFlowVersions["NONE"] = "none"; ReactFlowVersions["V9"] = "v9"; ReactFlowVersions["V12"] = "v12"; })(ReactFlowVersions || (exports.ReactFlowVersions = ReactFlowVersions = {})); const useReactFlowVersion = () => { try { const [, , zoom] = (0, react_flow_renderer_1.useStoreState)((state) => state.transform); return zoom ? ReactFlowVersions.V9 : ReactFlowVersions.NONE; // eslint-disable-next-line no-empty } catch (_a) { } try { const [, , zoom] = (0, react_1.useStore)((state) => state.transform); return zoom ? ReactFlowVersions.V12 : ReactFlowVersions.NONE; // eslint-disable-next-line no-empty } catch (_b) { } return ReactFlowVersions.NONE; }; exports.useReactFlowVersion = useReactFlowVersion; //# sourceMappingURL=versionsupport.js.map