Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Sep 24, 2020
1 parent a9314e7 commit 255154f
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 43 deletions.
2 changes: 2 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
</strong>
</noscript>
<div id="app"></div>
<div id="stamp-picker"></div>
<div id="message-menu-popup"></div>
<!-- built files will be auto injected -->
</body>
</html>
13 changes: 8 additions & 5 deletions src/components/Main/MainView/MainViewSidebar/ContentEditor.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<template>
<div :class="$style.container">
<div v-if="isEditing">
<textarea-autosize
:value="value"
:class="$style.editor"
@input="onInput"
/>
<div :class="$style.editor">textarea</div>
<!--
<textarea-autosize
:value="value"
:class="$style.editor"
@input="onInput"
/>
-->
<div
v-if="maxlength"
:class="$style.count"
Expand Down
37 changes: 20 additions & 17 deletions src/components/Main/MainView/MessageInput/MessageInputTextArea.vue
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
<template>
<textarea-autosize
ref="textareaAutosizeRef"
:class="$style.container"
:value="text"
:readonly="isPosting"
placeholder="メッセージを送信"
rows="1"
:max-height="160"
@input="onInput"
@compositionupdate.native="onCompositionUpdate"
@before-input.native="onBeforeInput"
@keydown.native="onKeyDown"
@keyup.native="onKeyUp"
@focus.native="onFocus"
@blur.native="onBlur"
@paste.native="onPaste"
/>
<div>textarea</div>
<!--
<textarea-autosize
ref="textareaAutosizeRef"
:class="$style.container"
:value="text"
:readonly="isPosting"
placeholder="メッセージを送信"
rows="1"
:max-height="160"
@input="onInput"
@compositionupdate.native="onCompositionUpdate"
@before-input.native="onBeforeInput"
@keydown.native="onKeyDown"
@keyup.native="onKeyUp"
@focus.native="onFocus"
@blur.native="onBlur"
@paste.native="onPaste"
/>
-->
</template>

<script lang="ts">
Expand Down
35 changes: 19 additions & 16 deletions src/components/UI/Slider.vue
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
<template>
<vue-slider
:value="value"
@change="onChange"
:min="min"
:max="max"
:disabled="disabled"
:tooltip="tooltip"
:tooltip-formatter="tooltipFormatter"
:dot-size="12"
/>
<div>slider</div>
<!--
<vue-slider
:value="value"
@change="onChange"
:min="min"
:max="max"
:disabled="disabled"
:tooltip="tooltip"
:tooltip-formatter="tooltipFormatter"
:dot-size="12"
/>
-->
</template>

<script lang="ts">
import { defineComponent, PropType } from 'vue'
import VueSlider from 'vue-slider-component'
import { TooltipFormatter } from 'vue-slider-component/typings/typings'
// import VueSlider from 'vue-slider-component'
// import { TooltipFormatter } from 'vue-slider-component/typings/typings'
export default defineComponent({
name: 'Slider',
components: {
VueSlider
},
// components: {
// VueSlider
// },
props: {
value: {
type: [Number, String] as PropType<number | string>,
Expand All @@ -38,7 +41,7 @@ export default defineComponent({
type: Number,
default: 100
},
tooltipFormatter: [String, Function] as PropType<TooltipFormatter>,
tooltipFormatter: [String, Function], // as PropType<TooltipFormatter>,
tooltip: {
type: String as PropType<
'none' | 'always' | 'hover' | 'focus' | 'active'
Expand Down
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import router from './router'
import store from './store'
import boolAttr from './bool-attr'
import vClickOutside from 'v-click-outside'
import VueTextareaAutosize from 'vue-textarea-autosize'
// import VueTextareaAutosize from 'vue-textarea-autosize'
import { setupGlobalFuncs } from './markdown-bridge'
import { loadResizeObserver } from './resizeObserver'

Expand All @@ -21,7 +21,7 @@ import('katex/dist/katex.css')

app.use(boolAttr)
app.use(vClickOutside)
app.use(VueTextareaAutosize)
//app.use(VueTextareaAutosize)

app.mount('#app')

Expand Down
2 changes: 1 addition & 1 deletion src/store/ui/stampPicker/mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const mutations = defineMutations<S>()({
state.selectHandler = (_: SelectedStampData) => {}
},
clearTeleportTargetName(state) {
state.teleportTargetName = ''
state.teleportTargetName = 'stamp-picker'
},
clearCurrentStampPaletteId(state) {
state.currentStampSet = {
Expand Down
2 changes: 1 addition & 1 deletion src/store/ui/stampPicker/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export interface S {
}

export const state: S = {
teleportTargetName: '', // TODO validにする
teleportTargetName: 'stamp-picker',
selectHandler: defaultSelectHandler,
currentStampSet: {
type: 'history',
Expand Down
5 changes: 5 additions & 0 deletions src/styles/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,8 @@ body {
img {
image-orientation: from-image;
}

#stamp-picker,
#message-menu-popup {
display: none;
}
1 change: 0 additions & 1 deletion src/views/Main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
<stamp-picker-container />
<message-tools-menu-container />
<toast-container />
<div :id="teleportTargetName" />
</div>
<div v-else></div>
</template>
Expand Down

0 comments on commit 255154f

Please sign in to comment.