-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ref!: several fixes and improvements
- Loading branch information
1 parent
d2a9a5d
commit f214577
Showing
10 changed files
with
81 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { unwindCompiler } from './deps.ts' | ||
import { UnwindParams } from './mod.ts' | ||
|
||
export function runUnwind(code: string, url: URL, unwindParams: UnwindParams): string { | ||
if (url.protocol === 'file:') { | ||
if (unwindParams.noCompileLocal) return code | ||
|
||
return unwindCompiler.insertUnwindHooks(code, unwindParams) | ||
} | ||
|
||
if (unwindParams.noCompileRemote) return code | ||
|
||
return unwindCompiler.insertUnwindHooks(code, unwindParams) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import { compile as compileSvelte, preprocess as preprocessSvelte } from 'https://cdn.jsdelivr.net/npm/[email protected]/compiler.mjs' | ||
import { addTrailingLog, removeTrailingLog } from './code.ts' | ||
import { esBuild, unwindCompiler } from './deps.ts' | ||
import { runUnwind } from './css.ts' | ||
import { esBuild } from './deps.ts' | ||
import { UnwindParams } from './mod.ts' | ||
|
||
export interface SvelteTransformation { | ||
|
@@ -77,15 +78,3 @@ async function preprocessScript({ content, attributes }: PreprocessScriptParams) | |
|
||
return res | ||
} | ||
|
||
function runUnwind(code: string, url: URL, unwindParams: UnwindParams): string { | ||
if (url.protocol === 'file:') { | ||
if (unwindParams.noCompileLocal) return code | ||
|
||
return unwindCompiler.insertUnwindHooks(code, unwindParams) | ||
} | ||
|
||
if (unwindParams.noCompileRemote) return code | ||
|
||
return unwindCompiler.insertUnwindHooks(code, unwindParams) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * as transitions from 'https://cdn.jsdelivr.net/npm/[email protected]/transition/index.mjs' | ||
export * as svelte from 'https://cdn.jsdelivr.net/npm/[email protected]/index.mjs' | ||
export { UI } from 'https://code.jikno.com/design@master/mod.ts' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,21 @@ | ||
// @deno-types=../svelte.d.ts | ||
import App from './App.svelte' | ||
import { setupJiknoDesign } from '../../design/mod.ts' | ||
import { getPlugin, isMobile } from '../runtime.ts' | ||
import { AppState } from './state.bridge.ts' | ||
// import { start } from './main.tsx' | ||
|
||
setupJiknoDesign() | ||
|
||
// start() | ||
new App({ | ||
target: document.body, | ||
props: { name: 'Elijah Mooring' }, | ||
props: { state: new AppState() }, | ||
}) | ||
|
||
if (isMobile()) { | ||
getPlugin('@capacitor/splash-screen').SplashScreen.hide() | ||
} | ||
|
||
// 311.56kb | ||
// 125.01kb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { makeStorable } from 'https://deno.land/x/[email protected]/mod.ts' | ||
import { getPlugin, isMobile } from '../runtime.ts' | ||
|
||
export class AppState { | ||
photoUrl = makeStorable<string | null>(null) | ||
name = 'Jason' | ||
|
||
async takeSelfie() { | ||
if (!isMobile()) return this.photoUrl.set('https://picsum.photos/500') | ||
|
||
const camera = getPlugin('@capacitor/camera') | ||
|
||
try { | ||
const image = await camera.Camera.getPhoto({ | ||
quality: 100, | ||
allowEditing: true, | ||
resultType: camera.CameraResultType.Uri, | ||
source: camera.CameraSource.Camera, | ||
direction: camera.CameraDirection.Front, | ||
}) | ||
|
||
this.photoUrl.set(image.webPath) | ||
} catch (error) { | ||
console.log(error.message) | ||
} | ||
} | ||
|
||
removePhoto() { | ||
this.photoUrl.set(null) | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.