Skip to content
Merged
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
2 changes: 2 additions & 0 deletions desktop/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export default defineConfig([
'src/generated/**',
'src-tauri/target/**',
'scripts/**',
// Copied formplayer build (large minified bundles); linting it can crash ESLint formatters.
'public/formplayer_dist/**',
]),
js.configs.recommended,
...tseslint.configs.recommended,
Expand Down
4 changes: 2 additions & 2 deletions desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"copy:formplayer": "node ./scripts/copy-formplayer-to-desktop.mjs",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"format": "prettier \"**/*.{js,jsx,ts,tsx,json,md}\" --write",
"format:check": "prettier \"**/*.{js,jsx,ts,tsx,json,md}\" --check",
"format": "prettier \"**/*.{js,jsx,ts,tsx,json,css,md}\" --write",
"format:check": "prettier \"**/*.{js,jsx,ts,tsx,json,css,md}\" --check",
"test": "vitest run",
"test:watch": "vitest",
"test:ui": "vitest --ui"
Expand Down
15 changes: 7 additions & 8 deletions desktop/public/formulus-injection.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
// Auto-generated from FormulusInterfaceDefinition.ts
// Do not edit directly - this file will be overwritten
// Last generated: 2026-04-09T07:22:39.750Z
// Last generated: 2026-04-17T14:59:47.429Z

/* global formulus */
(function () {
// Enhanced API availability detection and recovery
function getFormulus() {
// Check multiple locations where the API might exist
return (
globalThis.formulus ||
window.formulus ||
(typeof formulus !== 'undefined' ? formulus : undefined)
(typeof window !== 'undefined' ? window.formulus : undefined)
);
}

Expand Down Expand Up @@ -231,8 +229,8 @@
});
},

// openFormplayer: formType: string, params: Record<string, unknown>, savedData: Record<string, unknown> => Promise<FormCompletionResult>
openFormplayer: function (formType, params, savedData) {
// openFormplayer: formType: string, params: Record<string, unknown>, savedData: Record<string, unknown>, options: { subObservationMode?: boolean; } => Promise<FormCompletionResult>
openFormplayer: function (formType, params, savedData, options) {
return new Promise((resolve, reject) => {
const messageId =
'msg_' + Date.now() + '_' + Math.floor(Math.random() * 1000);
Expand Down Expand Up @@ -289,6 +287,7 @@
formType: formType,
params: params,
savedData: savedData,
options: options,
}),
);
});
Expand Down Expand Up @@ -1337,7 +1336,7 @@
});
},

// getAttachmentUri: fileName: string => Promise<string>
// getAttachmentUri: fileName: string | AttachmentDisplayDescriptor => Promise<string>
getAttachmentUri: function (fileName) {
return new Promise((resolve, reject) => {
const messageId =
Expand Down Expand Up @@ -1587,7 +1586,6 @@
globalThis.__formulusBridgeInitialized = true;

// Simple API availability check for internal use
// eslint-disable-next-line @typescript-eslint/no-unused-vars
function requestApiReinjection() {
console.log('Formulus: Requesting re-injection from host...');
if (globalThis.ReactNativeWebView) {
Expand All @@ -1599,6 +1597,7 @@
);
}
}
globalThis.__formulusRequestApiReinjection = requestApiReinjection;

// Notify React Native that the interface is ready
if (globalThis.ReactNativeWebView) {
Expand Down
7 changes: 7 additions & 0 deletions desktop/src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions desktop/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ keyring = { version = "3", features = ["windows-native", "apple-native", "sync-s
zip = { version = "2", default-features = false, features = ["deflate"] }
walkdir = "2"
url = "2"
urlencoding = "2"

Loading
Loading