Skip to content

Commit

Permalink
safari fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mudloop committed Nov 6, 2024
1 parent b985de1 commit 673e857
Show file tree
Hide file tree
Showing 142 changed files with 64,872 additions and 54 deletions.
79 changes: 40 additions & 39 deletions docs/bundle/js/index.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions docs/bundle/js/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/bundle/js/previews.js.map

Large diffs are not rendered by default.

19 changes: 13 additions & 6 deletions playground/src/components/Explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ const directory = directive(class extends AsyncDirective {
render = (dir: MagicDir, mapper: (node: MagicFSEntry) => void, cache: Map<string, any>) => {
if (Array.isArray(dir.children)) {
const val = dir.children.map(mapper);
cache.set(dir.path, val);
// cache.set(dir.path, val);
return val;
}
Promise.resolve(dir.children).then((result) => {
const val = result.map(mapper);
cache.set(dir.path, val);
// cache.set(dir.path, val);
return this.setValue(val);
}).catch(e => {
console.error(e);
Expand Down Expand Up @@ -172,6 +172,7 @@ const directory = directive(class extends AsyncDirective {
this.addEventListener('dragleave', () => this.dragLeave(''));
}
render = () => html`
${console.log(this.playground.project!.fs.root.children)}
<h4>
<span class="ellipsis">Files</span>
<nav>
Expand All @@ -183,8 +184,14 @@ const directory = directive(class extends AsyncDirective {
<section><ul class="${this.target == '' ? 'target' : ''}">${directory(this.playground.project!.fs.root, this.renderNode, this.cache)}</ul></section>
`;
protected firstUpdated(_changedProperties: PropertyValues): void {
this.playground.onChange.add(async () => this.requestUpdate());
this.playground.project!.onFilesChange.add(async () => this.requestUpdate());
this.playground.onChange.add(async () => {
console.log('Project changed');
return this.requestUpdate();
});
this.playground.project!.onFilesChange.add(async () => {
console.log('Files changed');
return this.requestUpdate();
});
}
async select(node: MagicFSEntry, e?: PointerEvent) {
if (e && e?.button !== 0) return;
Expand Down Expand Up @@ -302,7 +309,7 @@ const directory = directive(class extends AsyncDirective {
this.highlighted == node.id ? 'highlighted' : '',
this.target == node.path ? 'target' : ''
].join(' ')
renderNode: any = (node: MagicFSEntry) => keyed(node.path, html`
renderNode: any = (node: MagicFSEntry) => html`
<li
class="${this.getClasses(node)}"
draggable="true"
Expand All @@ -312,7 +319,7 @@ const directory = directive(class extends AsyncDirective {
@dragover=${node.isDir ? (e: DragEvent) => this.dragOver(e, node.path, node.id) : undefined}
@dragleave=${node.isDir ? () => this.dragLeave(node.path) : undefined}
>${node.isDir ? this.renderDir(node as MagicDir, this.expanded.has(node.id)) : this.renderFile(node as MagicFile)}</li>
`);
`;
renderFile = (file: MagicFile) => html`
<header @pointerdown=${(e: PointerEvent) => this.select(file, e)}>
<ui-file-icon .path=${file.name} width="16" height="16"></ui-file-icon>
Expand Down
2 changes: 1 addition & 1 deletion playground/src/components/common-styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const COMMON_STYLES = css`
margin: 0;
overflow-y: auto;
height: 100%;
height: auto;
max-height: 400px;
color: #b3b0aa;
border: 1px solid #555;
Expand Down
1 change: 1 addition & 0 deletions plugintest/app.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log('Hello, world!');
6 changes: 6 additions & 0 deletions plugintest/build.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { myPlugin } from "./myPlugin";
Bun.build({
entrypoints: ["./app.ts"],
outdir: "./out",
plugins: [myPlugin],
});
Binary file added plugintest/bun.lockb
Binary file not shown.
9 changes: 9 additions & 0 deletions plugintest/myPlugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type { BunPlugin } from "bun";

export const myPlugin: BunPlugin = {
name: "Custom loader",
setup(build) {
console.log(build);
// implementation
},
};
21 changes: 21 additions & 0 deletions plugintest/node_modules/@types/bun/LICENSE

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

20 changes: 20 additions & 0 deletions plugintest/node_modules/@types/bun/README.md

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

1 change: 1 addition & 0 deletions plugintest/node_modules/@types/bun/index.d.ts

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

53 changes: 53 additions & 0 deletions plugintest/node_modules/@types/bun/package.json

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

21 changes: 21 additions & 0 deletions plugintest/node_modules/@types/node/LICENSE

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

15 changes: 15 additions & 0 deletions plugintest/node_modules/@types/node/README.md

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

Loading

0 comments on commit 673e857

Please sign in to comment.