Skip to content

Commit

Permalink
v2.6.1
Browse files Browse the repository at this point in the history
## Changes
- Updated bridge.'s data to the latest Minecraft Preview (fe0d31f, dcb9d3b, b48cc17, 63002ee, 398fdba, bridge-core/editor-packages#39)
- Bridge now starts with it's window maximized (ad2d736)
- Improved Japanese translations (7e80da9, Thanks to @toka7290!)
- Bumped the json5 package (20eb14f)
- JSON files will not automatically be formatted when created (302c2a6)

## Fixes
- Fixed loading screen being jumpy (5633178)
- Fixed the ability to import multiple files at once (c42660a)
- Fixed tab order reversing when opening a project (0ff4047)
- Fixed a soft lock that could occur when trying to preview a model with no textures (0b0934a)
- Fixed the ability to drop folders on bridge native build (c2e1531)
- Fixed a missing id in an extension preventing new project from being created (834d4d7)
- Fixed dragging elements in the tree editor causing errors (bb72494)
- Fixed bridge suggesting users on tablets to download bridge native (6cc8a9f)
  • Loading branch information
ThomasOrs authored Jul 7, 2023
2 parents 6a2d162 + 99d0736 commit 8667cfb
Show file tree
Hide file tree
Showing 18 changed files with 288 additions and 91 deletions.
20 changes: 17 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,13 @@
<style>
body {
margin: 0;
overflow: hidden;
}
#app {
height: 100vh;
width: 100vw;
}
.initial-boot {
padding-bottom: 50px;
background-color: #ececec;
display: grid;
grid-template-columns: 1fr;
Expand All @@ -135,6 +135,11 @@
height: 100vh;
app-region: drag;
-webkit-app-region: drag;
opacity: 1;
transition: opacity 200ms ease;
}
.initial-boot.complete {
opacity: 0;
}
.initial-boot img {
place-self: center;
Expand All @@ -146,12 +151,13 @@
border-radius: 50%;
width: 50px;
height: 50px;
box-sizing: content-box;
}
.loader {
margin: 60px auto;
font-size: 10px;
position: relative;
top: -30em;
top: -40em;
text-indent: -9999em;
border: 0.5em solid rgba(0, 0, 0, 0.1);
border-left: 0.5em solid #131313;
Expand Down Expand Up @@ -214,7 +220,15 @@
</div>
<script>
window.addEventListener('load', () => {
document.querySelector('.initial-boot').remove()
setTimeout(() => {
document
.querySelector('.initial-boot')
.classList.add('complete')

setTimeout(() => {
document.querySelector('.initial-boot').remove()
}, 200)
}, 200)
})
</script>

Expand Down
27 changes: 15 additions & 12 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bridge",
"version": "2.6.0",
"version": "2.6.1",
"private": true,
"scripts": {
"dev": "vite",
Expand All @@ -24,7 +24,7 @@
"comlink": "^4.3.0",
"compare-versions": "^3.6.0",
"core-js": "^3.6.5",
"dash-compiler": "^0.10.8",
"dash-compiler": "^0.10.10",
"escape-string-regexp": "^5.0.0",
"fflate": "^0.6.7",
"idb-keyval": "^5.1.3",
Expand Down
Binary file modified public/packages.zip
Binary file not shown.
3 changes: 2 additions & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@
"width": 1200,
"titleBarStyle": "Overlay",
"acceptFirstMouse": true,
"fileDropEnabled": false
"fileDropEnabled": true,
"maximized": true
}
]
}
Expand Down
3 changes: 2 additions & 1 deletion src-tauri/tauri.windows.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"resizable": true,
"title": "",
"width": 1200,
"fileDropEnabled": false
"fileDropEnabled": true,
"maximized": true
}
]
}
Expand Down
8 changes: 8 additions & 0 deletions src/components/Editors/EntityModel/Tab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,14 @@ export class EntityModelTab extends GeometryPreviewTab {
await loadTextures('blocks')
)

if (textures.length === 0) {
new InformationWindow({
description: 'preview.noTextures',
})

return
}

// Prompt user to select a texture
const choiceWindow = new DropdownWindow({
options: textures,
Expand Down
36 changes: 19 additions & 17 deletions src/components/Editors/TreeEditor/Tree/TreeChildren.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,25 @@
@change="onChange"
>
<template v-for="[key, child] in children">
<InlineDiagnostic
v-if="showDiagnostics && child.highestSeverityDiagnostic"
:diagnostic="child.highestSeverityDiagnostic"
:key="`diagnostic.${child.uuid}`"
/>
<component
:key="child.uuid"
:is="child.component"
:tree="child"
:treeEditor="treeEditor"
@setActive="$emit('setActive')"
>
<span v-if="tree.type === 'array'" :style="numberDef">{{
key
}}</span>
<Highlight v-else :value="key" />
</component>
<div :key="child.uuid">
<InlineDiagnostic
v-if="
showDiagnostics && child.highestSeverityDiagnostic
"
:diagnostic="child.highestSeverityDiagnostic"
/>
<component
:is="child.component"
:tree="child"
:treeEditor="treeEditor"
@setActive="$emit('setActive')"
>
<span v-if="tree.type === 'array'" :style="numberDef">{{
key
}}</span>
<Highlight v-else :value="key" />
</component>
</div>
</template>
</Draggable>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Extensions/Scripts/Modules/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const SidebarModule = ({ disposables, extensionId }: IModuleConfig) => ({
icon: string
}) {
if (!config.id) {
console.error('SidebarModule: config.id is required')
console.warn('SidebarModule: config.id is required')
config.id = `${extensionId}//${config.displayName}`
}
const sidebar = createSidebar(config)
Expand Down
74 changes: 67 additions & 7 deletions src/components/FileDropper/FileDropper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
} from '/@/components/FileSystem/Types'
import { App } from '/@/App'
import { extname } from '/@/utils/path'
import { listen } from '@tauri-apps/api/event'

export class FileDropper {
protected fileHandlers = new Map<
Expand All @@ -20,17 +21,76 @@ export class FileDropper {
event.preventDefault()
})

window.addEventListener('drop', (event) => {
event.preventDefault()

this.onDrop([...(event.dataTransfer?.items ?? [])])
})
if (!import.meta.env.VITE_IS_TAURI_APP) {
window.addEventListener('drop', (event) => {
event.preventDefault()

this.onDrop([...(event.dataTransfer?.items ?? [])])
})
} else {
listen('tauri://file-drop', async (event) => {
const paths: string[] = <string[]>event.payload

const items: DataTransferItem[] = []

for (const path of paths) {
const posixPath = path.split('\\').join('/')

if (await app.fileSystem.fileExists(posixPath)) {
console.warn(`Getting file`)

const fileHandle = <Promise<FileSystemHandle>>(
app.fileSystem.getFileHandle(posixPath)
)

items.push({
type: 'file',
kind: 'file',
getAsFile: () => null,
getAsString: () => '',
getAsFileSystemHandle: () => fileHandle,
webkitGetAsEntry: () => null,
})
} else if (
await app.fileSystem.directoryExists(posixPath)
) {
console.warn(`Getting directory`)

const directoryHandle = <
Promise<FileSystemDirectoryHandle>
>app.fileSystem.getDirectoryHandle(posixPath)

items.push({
type: 'directory',
kind: 'file',
getAsFile: () => null,
getAsString: () => '',
getAsFileSystemHandle: () => directoryHandle,
webkitGetAsEntry: () => null,
})
} else {
console.warn(`${posixPath} does not exist!`)
}
}

this.onDrop(items)
})
}
}

protected async onDrop(dataTransferItems: DataTransferItem[]) {
const handles: Promise<AnyHandle | null>[] = []

for (const item of dataTransferItems) {
const handle = <AnyHandle | null>await item.getAsFileSystemHandle()
if (!handle) return
handles.push(
<Promise<AnyHandle | null>>item.getAsFileSystemHandle()
)
}

for (const handlePromise of handles) {
const handle = await handlePromise

if (handle === null) continue

await this.import(handle)
}
Expand Down
7 changes: 6 additions & 1 deletion src/components/FileSystem/Fast/getDirectoryHandle.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { isAbsolute } from '@tauri-apps/api/path'
import { IGetHandleConfig } from '../Common'
import { VirtualDirectoryHandle } from '../Virtual/DirectoryHandle'
import { pathFromHandle } from '../Virtual/pathFromHandle'
Expand All @@ -18,7 +19,11 @@ export async function getDirectoryHandleTauri(

const { createDir, exists } = await import('@tauri-apps/api/fs')
const { join, basename, sep } = await import('@tauri-apps/api/path')
const fullPath = await join(await pathFromHandle(baseDirectory), ...pathArr)

const path = await join(...pathArr)
const fullPath = (await isAbsolute(path))
? path
: await join(await pathFromHandle(baseDirectory), path)

if (create) {
await createDir(fullPath, { recursive: !createOnce }).catch((err) => {
Expand Down
11 changes: 6 additions & 5 deletions src/components/FileSystem/Virtual/Stores/TauriFs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
removeDir,
removeFile,
} from '@tauri-apps/api/fs'
import { join, sep } from '@tauri-apps/api/path'
import { isAbsolute, join, sep } from '@tauri-apps/api/path'
import { invoke } from '@tauri-apps/api/tauri'
import { VirtualFile } from '../File'
import { BaseStore, FsKindEnum, type TStoreType } from './BaseStore'
Expand Down Expand Up @@ -50,6 +50,7 @@ export class TauriFsStore extends BaseStore<ITauriFsSerializedData> {
async resolvePath(path: string) {
path = path.replaceAll(/\\|\//g, sep)
if (!this.baseDirectory) return path
if (await isAbsolute(path)) return path
return await join(this.baseDirectory, path)
}

Expand Down Expand Up @@ -115,12 +116,12 @@ export class TauriFsStore extends BaseStore<ITauriFsSerializedData> {
const resolvedPath = await this.resolvePath(path)

try {
await readDir(resolvedPath)
return 'directory'
await readBinaryFile(resolvedPath)
return 'file'
} catch (err) {
try {
await readBinaryFile(resolvedPath)
return 'file'
await readDir(resolvedPath)
return 'directory'
} catch (err) {
return null
}
Expand Down
Loading

0 comments on commit 8667cfb

Please sign in to comment.