Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
FineArchs committed Nov 5, 2023
1 parent 015322d commit e632497
Show file tree
Hide file tree
Showing 22 changed files with 974 additions and 783 deletions.
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Ignore artifacts:
node_modules
dist
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
16 changes: 16 additions & 0 deletions package-lock.json

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

19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
"dev": "vite",
"build": "vue-tsc && vite build",
"serve": "vite preview",
"preinstall": "npm run build-develop && npm run build-next",
"submodules": "git submodule update --init --depth=1",
"build-develop": "cd develop && npm ci && npm run build",
"build-next": "cd next && npm ci && npm run build",
"update-aiscript": "git submodule update --remote"
"preinstall": "npm run build-develop && npm run build-next",
"submodules": "git submodule update --init --depth=1",
"build-develop": "cd develop && npm ci && npm run build",
"build-next": "cd next && npm ci && npm run build",
"update-aiscript": "git submodule update --remote"
},
"dependencies": {
"aiscript_next": "file:./next",
"aiscript_develop": "file:./develop",
"aiscript0_16_0": "npm:@syuilo/aiscript@0.16.0",
"aiscript0_15_0": "npm:@syuilo/aiscript@0.15.0",
"aiscript_develop": "file:./develop",
"aiscript_next": "file:./next",
"aiscript0_14_1": "npm:@syuilo/aiscript@0.14.1",
"aiscript0_15_0": "npm:@syuilo/aiscript@0.15.0",
"aiscript0_16_0": "npm:@syuilo/aiscript@0.16.0",
"prismjs": "^1.29.0",
"vue": "^3.3.7",
"vue-prism-editor": "^2.0.0-alpha.2"
Expand All @@ -27,6 +27,7 @@
"@types/node": "^20.8.10",
"@vitejs/plugin-vue": "^4.4.0",
"@vue/compiler-sfc": "^3.0.5",
"prettier": "^3.0.3",
"typescript": "^5.2.2",
"vite": "^4.5.0",
"vue-tsc": "^1.8.22"
Expand Down
84 changes: 43 additions & 41 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,67 +1,69 @@
<template>
<h1>AiScript (
<MenuButton id='version' :options='menu' @select='onVersionSelect'>{{ version }}</MenuButton>
) Playground</h1>
<Next v-if='version === "next"'></Next>
<Develop v-if='version === "develop"'></Develop>
<V0_16_0 v-if='version === "0.16.0"'></V0_16_0>
<V0_15_0 v-if='version === "0.15.0"'></V0_15_0>
<V0_14_1 v-if='version === "0.14.1"'></V0_14_1>
<h1>
AiScript (
<MenuButton id="version" :options="menu" @select="onVersionSelect">{{
version
}}</MenuButton>
) Playground
</h1>
<Next v-if="version === 'next'"></Next>
<Develop v-if="version === 'develop'"></Develop>
<V0_16_0 v-if="version === '0.16.0'"></V0_16_0>
<V0_15_0 v-if="version === '0.15.0'"></V0_15_0>
<V0_14_1 v-if="version === '0.14.1'"></V0_14_1>
</template>

<script setup lang='ts'>
import { ref } from 'vue';
import MenuButton from '@common/MenuButton.vue';
import Next from './versions/next/index.vue';
import Develop from './versions/develop/index.vue';
import V0_16_0 from './versions/0.16.0/index.vue';
import V0_15_0 from './versions/0.15.0/index.vue';
import V0_14_1 from './versions/0.14.1/index.vue';
const versions = [
'next',
'develop',
'0.16.0',
'0.15.0',
'0.14.1'
] as const;
const latest = '0.16.0';
<script setup lang="ts">
import { ref } from "vue";
import MenuButton from "@common/MenuButton.vue";
import Next from "./versions/next/index.vue";
import Develop from "./versions/develop/index.vue";
import V0_16_0 from "./versions/0.16.0/index.vue";
import V0_15_0 from "./versions/0.15.0/index.vue";
import V0_14_1 from "./versions/0.14.1/index.vue";
const versions = ["next", "develop", "0.16.0", "0.15.0", "0.14.1"] as const;
const latest = "0.16.0";
const version = ref(window.localStorage.getItem('version') ?? latest);
const menu = Object.fromEntries(versions.map(v => [v, v + (v == latest ? '(latest)' : '')]));
const version = ref(window.localStorage.getItem("version") ?? latest);
const menu = Object.fromEntries(
versions.map((v) => [v, v + (v == latest ? "(latest)" : "")]),
);
function onVersionSelect(v: string) {
version.value = v;
window.localStorage.setItem('version', version.value);
version.value = v;
window.localStorage.setItem("version", version.value);
}
</script>

<style>
:root {
--borderThickness: 1px;
--borderThickness: 1px;
}
* {
font-family: Fira code, Fira Mono, Consolas, Menlo, Courier, monospace;
font-family:
Fira code,
Fira Mono,
Consolas,
Menlo,
Courier,
monospace;
}
html {
background: #171717;
color: #fff;
tab-size: 2;
background: #171717;
color: #fff;
tab-size: 2;
}
body {
margin: 0;
padding: 0;
margin: 0;
padding: 0;
}
</style>

<style scoped>
h1 {
font-size: 1.5em;
margin: 16px 16px 0 16px;
font-size: 1.5em;
margin: 16px 16px 0 16px;
}
</style>

50 changes: 25 additions & 25 deletions src/common/Container.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<template>
<div :class="$style.container">
<header v-if="hasHeader" :class="$style.header">
<slot name="header"></slot>
</header>
<main :class="$style.main">
<slot></slot>
</main>
<footer v-if="hasFooter" :class="$style.footer">
<slot name="footer"></slot>
</footer>
</div>
<div :class="$style.container">
<header v-if="hasHeader" :class="$style.header">
<slot name="header"></slot>
</header>
<main :class="$style.main">
<slot></slot>
</main>
<footer v-if="hasFooter" :class="$style.footer">
<slot name="footer"></slot>
</footer>
</div>
</template>

<script lang='ts'>
<script lang="ts">
export default {
computed: {
hasHeader() {
Expand All @@ -27,24 +27,24 @@ export default {

<style module>
.container {
display: flex;
flex-direction: column;
border: solid var(--borderThickness) #555;
border-radius: 8px;
background: #202020;
display: flex;
flex-direction: column;
border: solid var(--borderThickness) #555;
border-radius: 8px;
background: #202020;
}
.header {
padding: 8px 16px;
border-bottom: dashed var(--borderThickness) #555;
font-weight: bold;
padding: 8px 16px;
border-bottom: dashed var(--borderThickness) #555;
font-weight: bold;
}
.main {
flex: 1;
overflow: auto;
padding: 16px;
flex: 1;
overflow: auto;
padding: 16px;
}
.footer {
padding: 8px 16px;
border-top: dashed var(--borderThickness) #555;
padding: 8px 16px;
border-top: dashed var(--borderThickness) #555;
}
</style>
Loading

0 comments on commit e632497

Please sign in to comment.