Skip to content

Commit

Permalink
Merge pull request #414 from IshavSohal/issue-385
Browse files Browse the repository at this point in the history
Create shared asset system
  • Loading branch information
szczz authored Feb 21, 2025
2 parents be1b434 + 7812884 commit d50b9ec
Show file tree
Hide file tree
Showing 9 changed files with 850 additions and 145 deletions.
3 changes: 3 additions & 0 deletions src/components/dynamic-editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@
:centerSlide="centerSlide"
:dynamicSelected="dynamicSelected"
@slide-edit="$emit('slide-edit')"
@shared-asset="(oppositeAssetPath: string, sharedAssetPath: string, oppositeLang: string) => {
$emit('shared-asset', oppositeAssetPath, sharedAssetPath, oppositeLang);
}"
></component>
</div>
</div>
Expand Down
32 changes: 29 additions & 3 deletions src/components/editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,14 @@
@slide-change="selectSlide"
@slides-updated="updateSlides"
@open-metadata-modal="$vfm.open('metadata-edit-modal')"
@shared-asset="(oppositeAssetPath: string, sharedAssetPath: string, oppositeLang: string) => {
$emit('shared-asset', oppositeAssetPath, sharedAssetPath, oppositeLang);
}"
@process-panel="
(panel, callback, ...args) => {
$emit('process-panel', panel, callback, ...args);
}
"
:configFileStructure="configFileStructure"
:lang="configLang"
:sourceCounts="sourceCounts"
Expand All @@ -259,6 +267,14 @@
@slides-updated="updateSlides"
@open-metadata-modal="$vfm.open('metadata-edit-modal')"
@close-sidebar="closeSidebar"
@shared-asset="(oppositeAssetPath: string, sharedAssetPath: string, oppositeLang: string) => {
$emit('shared-asset', oppositeAssetPath, sharedAssetPath, oppositeLang);
}"
@process-panel="
(panel, callback, ...args) => {
$emit('process-panel', panel, callback, ...args);
}
"
:configFileStructure="configFileStructure"
:lang="configLang"
:sourceCounts="sourceCounts"
Expand All @@ -278,6 +294,9 @@
:slideIndex="slideIndex"
:isLast="slideIndex === slides.length - 1"
:uid="uuid"
@shared-asset="(oppositeAssetPath: string, sharedAssetPath: string, oppositeLang: string) => {
$emit('shared-asset', oppositeAssetPath, sharedAssetPath, oppositeLang);
}"
@slide-change="selectSlide"
@slide-edit="onSlidesEdited"
@custom-slide-updated="updateCustomSlide"
Expand Down Expand Up @@ -312,14 +331,17 @@
<script lang="ts">
import { Options, Prop, Vue, Watch } from 'vue-property-decorator';
import {
BasePanel,
ConfigFileStructure,
HelpSection,
ImagePanel,
MetadataContent,
MultiLanguageSlide,
Slide,
SourceCounts,
StoryRampConfig,
TextPanel
TextPanel,
VideoPanel
} from '@/definitions';
import { VueSpinnerOval } from 'vue3-spinners';
import axios from 'axios';
Expand Down Expand Up @@ -448,15 +470,19 @@ export default class EditorV extends Vue {
panel: [{ type: 'loading-page' }, { type: 'loading-page' }]
};
const newLang = lang || this.configLang || 'en';
if (this.configLang !== newLang) {
this.$emit('lang-change', newLang);
}
setTimeout(() => {
if (index === -1 || !this.loadSlides) {
this.currentSlide = '';
} else {
const selectedLang = (lang ?? this.configLang) as keyof MultiLanguageSlide;
const selectedLang = newLang as keyof MultiLanguageSlide;
const selectedSlide = this.loadSlides[index][selectedLang];
this.currentSlide = selectedSlide ?? '';
}
this.slideIndex = index;
(this.$refs.slide as SlideEditorV).panelIndex = 0;
(this.$refs.slide as SlideEditorV).advancedEditorView = false;
Expand Down
2 changes: 1 addition & 1 deletion src/components/helpers/image-preview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<div class="flex-grow image-container">
<img
class="image-file object-cover"
:title="imageFile.id"
:title="imageFile.id.split('/').at(-1)"
:src="imageFile.src"
:alt="imageFile.altText"
/>
Expand Down
Loading

0 comments on commit d50b9ec

Please sign in to comment.