Skip to content

Commit

Permalink
Merge pull request #1616 from NicoPennec/main
Browse files Browse the repository at this point in the history
Various fixes
  • Loading branch information
frankrousseau authored Dec 16, 2024
2 parents 2148b62 + ff87715 commit e9c4e90
Show file tree
Hide file tree
Showing 8 changed files with 184 additions and 170 deletions.
285 changes: 157 additions & 128 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@fullcalendar/multimonth": "6.1.15",
"@fullcalendar/vue3": "6.1.15",
"@google/model-viewer": "3.5.0",
"@sentry/vue": "8.43.0",
"@sentry/vue": "8.45.1",
"@unhead/vue": "1.11.14",
"@vuepic/vue-datepicker": "9.0.3",
"async": "3.2.6",
Expand Down Expand Up @@ -63,7 +63,7 @@
"vuedraggable": "4.1.0",
"vuex": "4.1.0",
"vuex-router-sync": "6.0.0-rc.1",
"wavesurfer.js": "7.8.10"
"wavesurfer.js": "7.8.11"
},
"devDependencies": {
"@vitejs/plugin-vue": "5.2.1",
Expand Down
12 changes: 8 additions & 4 deletions src/components/mixins/annotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
* widgets.
*/
import { fabric } from 'fabric'
import { v4 as uuidv4 } from 'uuid'
import moment from 'moment'
import { v4 as uuidv4 } from 'uuid'
import { markRaw } from 'vue'

import clipboard from '@/lib/clipboard'
import { formatFullDate } from '@/lib/time'
Expand Down Expand Up @@ -945,9 +946,12 @@ export const annotationMixin = {
if (!this.annotationCanvas) return

const canvasId = this.annotationCanvas.id
this.fabricCanvas = new fabric.Canvas(canvasId, {
fireRightClick: true
})
// Use markRaw() to avoid reactivity on Fabric Canvas
this.fabricCanvas = markRaw(
new fabric.Canvas(canvasId, {
fireRightClick: true
})
)
this.fabricCanvas.setDimensions({
width: 100,
height: 100
Expand Down
8 changes: 4 additions & 4 deletions src/components/mixins/parameters.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ export const parametersMixin = {
return params
},

saveParemetersToPreferences() {
saveParametersToPreferences() {
preferences.setObjectPreference(
`parameters:{this.parameterNamespace}`,
`parameters:${this.parameterNamespace}`,
this.parameters
)
},

getParametersFromPreferences(defaultParameters) {
return (
preferences.getObjectPreference(
`parameters:{this.parameterNamespace}`
`parameters:${this.parameterNamespace}`
) || defaultParameters
)
}
Expand All @@ -51,7 +51,7 @@ export const parametersMixin = {
deep: true,
handler() {
this.applyParametersToUrl()
this.saveParemetersToPreferences()
this.saveParametersToPreferences()
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/pages/Notifications.vue
Original file line number Diff line number Diff line change
Expand Up @@ -544,8 +544,8 @@ export default {
onNotificationSelected(event, notification) {
if (
event.target.classList.contains('bool-field') ||
event.target.parentElement.classList.contains('bool-field') ||
event.target.parentElement.parentElement.classList.contains(
event.target.parentElement?.classList.contains('bool-field') ||
event.target.parentElement?.parentElement?.classList.contains(
'bool-field'
)
) {
Expand Down
24 changes: 1 addition & 23 deletions src/components/pages/playlists/PlaylistedEntity.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,6 @@
@drop="onDropped"
ref="drop-area"
></div>
<div
:id="'drop-area-wide-' + entity.id"
class="drop-area-wide"
@dragover="onDragover"
@dragleave="onDragleave"
@drop="onDropped"
@click.prevent="onPlayClick"
ref="drop-area-wide"
></div>
</div>
</template>

Expand Down Expand Up @@ -139,10 +130,6 @@ export default {
return this.$refs['drop-area']
},
dropAreaWide() {
return this.$refs['drop-area-wide']
},
taskTypeOptions() {
return this.entity.preview_files
? Object.keys(this.entity.preview_files)
Expand Down Expand Up @@ -265,7 +252,7 @@ export default {
this.$emit('preview-changed', this.entity, previewFile)
},
'entity.preview_file_id': function () {
'entity.preview_file_id'() {
if (this.previewFileId !== this.entity.preview_file_id) {
this.previewFileId = this.entity.preview_file_id
}
Expand All @@ -286,15 +273,6 @@ export default {
transition: width 0.3s ease;
}
.drop-area-wide {
cursor: pointer;
height: 100%;
left: 100px;
position: absolute;
width: 60px;
z-index: 2;
}
.playlisted-entity {
border-top: 3px solid transparent;
border-radius: 5px;
Expand Down
15 changes: 9 additions & 6 deletions src/components/previews/PreviewPlayer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -525,14 +525,14 @@
</template>

<script>
import { defineAsyncComponent } from 'vue'
import { fabric } from 'fabric'
import {
ArrowUpRightIcon,
DownloadIcon,
GlobeIcon,
LinkIcon
} from 'lucide-vue-next'
import { defineAsyncComponent, markRaw } from 'vue'
import { mapGetters, mapActions } from 'vuex'
import {
Expand Down Expand Up @@ -1231,11 +1231,14 @@ export default {
const dimensions = this.getDimensions()
const width = dimensions.width
const height = dimensions.height
this.fabricCanvas = new fabric.Canvas(this.canvasId, {
fireRightClick: true,
width,
height
})
// Use markRaw() to avoid reactivity on Fabric Canvas
this.fabricCanvas = markRaw(
new fabric.Canvas(this.canvasId, {
fireRightClick: true,
width,
height
})
)
if (!this.fabricCanvas.freeDrawingBrush) {
this.fabricCanvas.freeDrawingBrush = new fabric.PencilBrush(
this.fabricCanvas
Expand Down
2 changes: 1 addition & 1 deletion src/components/widgets/AddComment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ export default {
deep: true,
immediate: true,
handler() {
const form = this.previewForms.findLast(
const form = this.previewForms?.findLast(
form => this.getRevision(form) > 0
)
this.nextRevision = this.getRevision(form)
Expand Down

0 comments on commit e9c4e90

Please sign in to comment.