@eccenca/gui-elements
Version:
GUI elements based on other libraries, usable in React application, written in Typescript.
40 lines • 1.5 kB
JavaScript
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
import { useStoreState as getStoreStateFlowV9 } from "react-flow-renderer";
import { useStore as useStoreStateFlowV12 } from "@xyflow/react";
export var ReactFlowVersions;
(function (ReactFlowVersions) {
ReactFlowVersions["NONE"] = "none";
ReactFlowVersions["V9"] = "v9";
ReactFlowVersions["V12"] = "v12";
})(ReactFlowVersions || (ReactFlowVersions = {}));
export var useReactFlowVersion = function () {
try {
var _a = __read(getStoreStateFlowV9(function (state) { return state.transform; }), 3), zoom = _a[2];
return zoom ? ReactFlowVersions.V9 : ReactFlowVersions.NONE;
// eslint-disable-next-line no-empty
}
catch (_b) { }
try {
var _c = __read(useStoreStateFlowV12(function (state) { return state.transform; }), 3), zoom = _c[2];
return zoom ? ReactFlowVersions.V12 : ReactFlowVersions.NONE;
// eslint-disable-next-line no-empty
}
catch (_d) { }
return ReactFlowVersions.NONE;
};
//# sourceMappingURL=versionsupport.js.map