Skip to content

Commit

Permalink
Merge branch 'release/1.1.11'
Browse files Browse the repository at this point in the history
  • Loading branch information
pdanpdan committed Nov 26, 2023
2 parents da48f29 + 876803c commit 080e193
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 30 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<title>Quasar Play</title>
<meta name="description" content="Quasar Play REPL" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="theme-color" content="#1f1f1f" />
<link rel="apple-touch-icon" href="/pwa/apple-touch-icon-180x180.png" sizes="180x180">
<link rel="icon" href="/pwa/favicon-light.ico" media="(prefers-color-scheme: light)" />
Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pdanpdan/quasar-play",
"version": "1.1.10",
"version": "1.1.11",
"description": "Playground for Quasar Framework",
"productName": "Quasar Play",
"author": {
Expand Down Expand Up @@ -32,9 +32,9 @@
"homepage": "https://pdanpdan.github.io/quasar-play",
"type": "module",
"scripts": {
"dev": "vite dev",
"dev": "vite dev --host",
"build": "vite build",
"preview": "vite preview",
"preview": "vite preview --host",
"lint": "eslint --ext .js,.vue,.cjs,.ts .",
"typecheck": "vue-tsc --noEmit",
"generate-pwa-assets": "pwa-assets-generator"
Expand Down Expand Up @@ -63,8 +63,9 @@
"vite": "^5.0.2",
"vite-plugin-compression2": "^0.11.0",
"vite-plugin-mkcert": "^1.17.1",
"vite-plugin-pwa": "^0.17.0",
"vite-plugin-pwa": "^0.17.2",
"vue": "^3.3.9",
"vue-qrious": "^3.1.0",
"vue-tsc": "^1.8.22",
"workbox-window": "^7.0.0"
},
Expand Down
30 changes: 26 additions & 4 deletions pnpm-lock.yaml

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

12 changes: 11 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,17 @@ body
color: var(--play-fg-color-base) !important
.play-container
height: 100dvh
--play-kbd-height: 0px
height: calc(100svh - env(keyboard-inset-height, var(--play-kbd-height)))
body.platform-ios &
transition: height .29999s .00001s
&:has(.editor-container:focus-within)
--play-kbd-height: 34svh
body.platform-android &:has(.editor-container:focus-within)
--play-kbd-height: 38svh
.vue-repl,
.file-selector,
Expand Down
46 changes: 35 additions & 11 deletions src/components/ShareDialog.vue
Original file line number Diff line number Diff line change
@@ -1,47 +1,68 @@
<template>
<q-dialog ref="dialogRef" @hide="onDialogHide">
<q-card class="q-dialog-plugin">
<q-card-section>
<div class="text-h6">{{ locale.share }}</div>
<q-card-section class="q-py-xs">
<div class="text-h6">{{ locale.shareTitle }}</div>
</q-card-section>

<q-card-section>
<q-card-section class="q-py-xs">
<q-option-group
color="primary"
v-model="settings.preview"
:options="previewOptions"
inline
/>
</q-card-section>

<q-separator inset />

<q-card-section>
<q-card-section v-if="settings.preview === 'output'" class="q-py-xs">
<q-option-group
color="primary"
v-model="settings.previewMode"
:options="previewModeOptions"
:disable="settings.preview !== 'output'"
inline
/>
</q-card-section>

<q-separator inset />

<q-card-section>
<q-card-section class="q-py-xs">
<q-option-group
color="primary"
v-model="settings.editor"
:options="editorOptions"
inline
/>
</q-card-section>

<q-card-section class="q-py-xs q-px-sm">
<vue-qrious class="fit" :value="shareUrl" level="L" :size="551" :padding="10" />
</q-card-section>

<q-card-actions align="right">
<q-btn flat color="grey-8" :label="locale.cancel" @click="onDialogHide" />
<q-btn flat color="grey-6" :label="locale.cancel" @click="onDialogHide" />
<q-btn autofocus flat color="primary" :label="canShare ? locale.share : locale.shareCopy" @click="onShare" />
</q-card-actions>
</q-card>
</q-dialog>
</template>

<style lang="sass" scoped>
.q-option-group :deep(> div)
width: calc(50% - 8px)
</style>

<style lang="sass">
.q-dialog-plugin.q-card--dark
box-shadow: none
border: 1px solid #666
filter: drop-shadow(0 0 2px #9999)
body.body--dark
.q-dialog__backdrop
background: rgba(0, 0, 0, 0.7)
</style>

<script lang="ts">
const canShare = ref<boolean | null>(null);
const settings = reactive({
Expand Down Expand Up @@ -74,8 +95,10 @@ settings.editor = (urlSearch.get('editor') || 'monaco').toLowerCase().includes('
</script>

<script setup lang="ts">
import { ref, reactive, onBeforeMount } from 'vue';
import { ref, reactive, computed, onBeforeMount } from 'vue';
import { useDialogPluginComponent, copyToClipboard, Notify } from 'quasar';
import VueQrious from 'vue-qrious';
import { locale } from '../utils/locale';
onBeforeMount(() => {
Expand All @@ -97,7 +120,7 @@ defineEmits([
const { dialogRef, onDialogHide } = useDialogPluginComponent();
function getUrl() {
const shareUrl = computed(() => {
const url = new URL(location.href);
url.searchParams.delete('preview');
Expand All @@ -112,11 +135,12 @@ function getUrl() {
url.searchParams.set('editor', settings.editor);
console.log(String(url).length);
return String(url);
}
});
async function onShare() {
const url = getUrl();
const url = shareUrl.value;
if (canShare.value) {
try {
Expand Down
2 changes: 1 addition & 1 deletion src/components/TopBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ body.desktop .q-select__options-list
max-width: unset !important
padding: 16px 16px 8px
transition: var(--play-transition-transform)
filter: drop-shadow(2px 2px 4px #6666)
filter: drop-shadow(1px 1px 2px #9999)
&--closed
transform: translate3d(0, -100%, -1px)
Expand Down
17 changes: 9 additions & 8 deletions src/utils/locale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@ const config = {
reset: 'Reset (delete) project',
doneShare: 'Sharable URL has been copied to clipboard',
share: 'Share project',
shareTitle: 'Share settings',
shareCopy: 'Copy to clipboard',
shareOptions: {
output: 'Start in Output mode',
code: 'Start in Code mode',
outputPreview: 'Start with Output Preview',
outputJs: 'Start with JS Preview',
outputCss: 'Start with CSS Preview',
outputSSR: 'Start with SSR Preview',
editorMonaco: 'Use Monaco editor - full featured, bigger size',
editorMirror: 'Use CodeMirror editor - smaller size',
output: 'Output',
code: 'Code',
outputPreview: 'Preview',
outputJs: 'JS',
outputCss: 'CSS',
outputSSR: 'SSR',
editorMonaco: 'Monaco',
editorMirror: 'CodeMirror',
},
cdn: 'CDN',
other: 'Other',
Expand Down

0 comments on commit 080e193

Please sign in to comment.