Skip to content

Commit

Permalink
719 fix electron build (#723)
Browse files Browse the repository at this point in the history
* Fixed import

* Added :key to v-for elements

* Replaced reference to exportAsPNG with exportAsJSON in beforeMount() to match corresponding reference in beforeDestroy()
  • Loading branch information
diegomdo authored Jan 15, 2025
1 parent 51e8680 commit d689d78
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/electron/renderer/ElectronApp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
import shortid from 'shortid';
import { enrichSchemeWithDefaults } from '../../ui/scheme/Scheme';
import { Keys, simulateKeyPress } from '../../ui/events';
import SchemioEditorApp from '../../ui/SchemioEditorApp.vue';
import SchemioEditorApp from '../../ui/components/SchemioEditorApp.vue';
import Navigator from './Navigator.vue';
import History from '../../ui/history/History';
import FileTabPanel from './FileTabPanel.vue';
Expand Down Expand Up @@ -208,7 +208,7 @@ export default {
window.electronAPI.$on('file:exportStatic:stopped', this.onStaticExporterStopped);
window.electronAPI.$on('menu:contextMenuOptionSelected', this.onContextMenuOptionSelected);
window.electronAPI.$on('file:openProject', this.onMenuFileOpenProject);
window.electronAPI.$on('file:exportAsPNG', this.onFileExportAsPNG);
window.electronAPI.$on('file:exportAsJSON', this.onFileExportAsJSON);
window.electronAPI.$on('file:importDiagramFromText', this.onImportDiagramFromText);
window.electronAPI.$on('project-selected', this.onProjectSelected);
Expand Down
9 changes: 5 additions & 4 deletions src/ui/components/editor/CreateItemMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</div>
</div>

<panel v-for="panel in filteredItemPanels" v-if="panel.items.length > 0" :name="panel.name">
<panel v-for="panel in filteredItemPanels" :key="panel.id" v-if="panel.items.length > 0" :name="panel.name">
<div class="item-menu">
<div v-for="item in panel.items"
class="item-container"
Expand All @@ -49,7 +49,7 @@
</div>
</panel>

<panel v-for="panel in extraShapeGroups" :name="panel.name">
<panel v-for="panel in extraShapeGroups" :key="panel.id" :name="panel.name">
<div class="item-menu">
<div v-for="item in panel.items"
class="item-container"
Expand All @@ -67,7 +67,7 @@
</div>
</panel>

<panel v-for="panel in customItemMenuPanels" :name="panel.name">
<panel v-for="panel in customItemMenuPanels" :key="panel.id" :name="panel.name">
<component :is="panel.component"
:search-keyword="searchKeyword"
:editor-id="editorId"
Expand Down Expand Up @@ -117,7 +117,7 @@
</div>
</panel>

<panel v-for="artPack in filteredArtPacks" v-if="artPack.icons.length > 0" :name="artPack.name" :closable="true" @close="closeArtPack(artPack)">
<panel v-for="artPack in filteredArtPacks" :key="artPack.id" v-if="artPack.icons.length > 0" :name="artPack.name" :closable="true" @close="closeArtPack(artPack)">
<div class="art-pack">
<div class="art-pack-author" v-if="artPack.author">
Created by
Expand All @@ -127,6 +127,7 @@
<div class="item-menu">
<div class="item-container"
v-for="icon in artPack.icons"
:key="icon.id"
v-if="!searchKeyword || safeTextMatchKeyword(icon.name) || safeTextMatchKeyword(icon.description)"
@mouseover="showPreviewArt(icon)"
@mouseleave="stopPreviewArt(icon)"
Expand Down
4 changes: 2 additions & 2 deletions src/ui/components/editor/items/AdvancedFill.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

<defs v-if="fill.type === 'gradient' && fill.gradient">
<linearGradient v-if="fill.gradient.type === 'linear'" :id="fillId" :x1="`${direction.x1}%`" :y1="`${direction.y1}%`" :x2="`${direction.x2}%`" :y2="`${direction.y2}%`" >
<stop v-for="color in fill.gradient.colors" :style="{'stop-color': color.c}" :offset="`${color.p}%`"/>
<stop v-for="color in fill.gradient.colors" :key="color.id" :style="{'stop-color': color.c}" :offset="`${color.p}%`"/>
</linearGradient>
<radialGradient v-if="fill.gradient.type === 'radial'" :id="fillId" cx="50%" cy="50%" r="50%" fx="50%" fy="50%">
<stop v-for="color in fill.gradient.colors" :style="{'stop-color': color.c}" :offset="`${color.p}%`"/>
<stop v-for="color in fill.gradient.colors" :key="color.id" :style="{'stop-color': color.c}" :offset="`${color.p}%`"/>
</radialGradient>
</defs>
</g>
Expand Down

0 comments on commit d689d78

Please sign in to comment.