More demo updates
This commit is contained in:
@@ -43,7 +43,7 @@
|
||||
<script type="importmap">
|
||||
{
|
||||
"imports": {
|
||||
"web-gphoto2": "../../src/camera.js",
|
||||
"web-gphoto2": "./node_modules/web-gphoto2/build/camera.js",
|
||||
"preact": "https://unpkg.com/preact@10.6.4/dist/preact.module.js",
|
||||
"preact/debug": "https://unpkg.com/preact@10.6.4/debug/dist/debug.module.js",
|
||||
"preact/devtools": "https://unpkg.com/preact@10.6.4/devtools/dist/devtools.module.js",
|
||||
|
||||
6
examples/preact/package-lock.json
generated
6
examples/preact/package-lock.json
generated
@@ -15,6 +15,9 @@
|
||||
"version": "0.1.0",
|
||||
"dev": true,
|
||||
"license": "LGPL-2.1-or-later",
|
||||
"dependencies": {
|
||||
"typescript": "^5.1.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/emscripten": "^1.39.5"
|
||||
}
|
||||
@@ -68,7 +71,8 @@
|
||||
"web-gphoto2": {
|
||||
"version": "file:../..",
|
||||
"requires": {
|
||||
"@types/emscripten": "^1.39.5"
|
||||
"@types/emscripten": "^1.39.5",
|
||||
"typescript": "^5.1.6"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,14 +17,14 @@
|
||||
*/
|
||||
|
||||
import { h, Component, createRef } from 'preact';
|
||||
import { rethrowIfCritical } from './ops.js';
|
||||
import { rethrowIfCritical } from 'web-gphoto2';
|
||||
|
||||
export const isDebug = new URLSearchParams(location.search).has('debug');
|
||||
|
||||
const Stats = isDebug
|
||||
? await import('stats.js').then(
|
||||
res => /** @type {typeof import('stats.js')} */(res['default'])
|
||||
)
|
||||
res => /** @type {typeof import('stats.js')} */ (res['default'])
|
||||
)
|
||||
: null;
|
||||
|
||||
/** @extends Component<{ getPreview?: () => Promise<Blob> }, { error?: string }> */
|
||||
@@ -96,9 +96,9 @@ export class Preview extends Component {
|
||||
blob,
|
||||
ratio
|
||||
? {
|
||||
resizeWidth: canvas.width,
|
||||
resizeHeight: canvas.height
|
||||
}
|
||||
resizeWidth: canvas.width,
|
||||
resizeHeight: canvas.height
|
||||
}
|
||||
: {}
|
||||
);
|
||||
if (!ratio) {
|
||||
|
||||
Reference in New Issue
Block a user