Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
const base = require("@mendix/pluggable-widgets-tools/configs/eslint.ts.base.json");

// Remove jest/globals env and jest plugin — incompatible with Node 22 / ESLint 8 in this setup
const { "jest/globals": _jestGlobals, ...envWithoutJest } = base.env;
const pluginsWithoutJest = (base.plugins || []).filter(p => p !== "jest");
const rulesWithoutJest = Object.fromEntries(Object.entries(base.rules || {}).filter(([k]) => !k.startsWith("jest/")));

module.exports = {
...base
...base,
env: envWithoutJest,
plugins: pluginsWithoutJest,
rules: rulesWithoutJest
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "nativevisioncamera",
"widgetName": "NativeVisionCamera",
"version": "1.1.1",
"version": "1.1.2",
"description": "Designed from the ground up to provide all features a camera app should have. You have full control over what device is used, and can even configure options such as frame rate, colorspace and more.",
"copyright": "Groen.dev",
"author": "Marcus Groen",
Expand Down
26 changes: 13 additions & 13 deletions src/Constants.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
import { Dimensions, Platform } from 'react-native';
import StaticSafeAreaInsets from 'react-native-static-safe-area-insets';
import { Dimensions, Platform } from "react-native";
import StaticSafeAreaInsets from "react-native-static-safe-area-insets";

export const CONTENT_SPACING = 15;

const SAFE_BOTTOM =
Platform.select({
ios: StaticSafeAreaInsets.safeAreaInsetsBottom,
}) ?? 0;
Platform.select({
ios: StaticSafeAreaInsets.safeAreaInsetsBottom
}) ?? 0;

export const SAFE_AREA_PADDING = {
paddingLeft: StaticSafeAreaInsets.safeAreaInsetsLeft + CONTENT_SPACING,
paddingTop: StaticSafeAreaInsets.safeAreaInsetsTop + CONTENT_SPACING,
paddingRight: StaticSafeAreaInsets.safeAreaInsetsRight + CONTENT_SPACING,
paddingBottom: SAFE_BOTTOM + CONTENT_SPACING,
paddingLeft: StaticSafeAreaInsets.safeAreaInsetsLeft + CONTENT_SPACING,
paddingTop: StaticSafeAreaInsets.safeAreaInsetsTop + CONTENT_SPACING,
paddingRight: StaticSafeAreaInsets.safeAreaInsetsRight + CONTENT_SPACING,
paddingBottom: SAFE_BOTTOM + CONTENT_SPACING
};

// The maximum zoom _factor_ you should be able to zoom in
export const MAX_ZOOM_FACTOR = 10;

export const SCREEN_WIDTH = Dimensions.get('window').width;
export const SCREEN_WIDTH = Dimensions.get("window").width;
export const SCREEN_HEIGHT = Platform.select<number>({
android: Dimensions.get('screen').height - StaticSafeAreaInsets.safeAreaInsetsBottom,
ios: Dimensions.get('window').height,
android: Dimensions.get("screen").height - StaticSafeAreaInsets.safeAreaInsetsBottom,
ios: Dimensions.get("window").height
}) as number;

// Button sizes
export const BUTTON_SIZE = 40;
export const CAPTURE_BUTTON_SIZE = 78;
export const BUTTON_ICON_SIZE = 24;
export const BUTTON_ICON_SIZE = 24;
Loading