From 36a9b3390de6ee7040b237d1565eb934620a1a7f Mon Sep 17 00:00:00 2001 From: mohsin-r Date: Sun, 21 May 2023 15:22:24 -0400 Subject: [PATCH] Dynamic Slideshow --- StoryRampSchema.json | 256 +++++---- ...000000-0000-0000-0000-000000000000_en.json | 106 ++-- ...000000-0000-0000-0000-000000000000_fr.json | 94 ++-- src/components/editor/dynamic-editor.vue | 28 +- .../editor/helpers/image-preview.vue | 4 +- src/components/editor/image-editor.vue | 4 +- src/components/editor/metadata-editor.vue | 14 +- src/components/editor/slide-editor.vue | 34 +- src/components/editor/slide-toc.vue | 14 +- src/components/editor/slideshow-editor.vue | 519 ++++++++++++++++++ src/components/editor/text-editor.vue | 4 +- src/components/panels/image-panel.vue | 165 +++++- src/components/panels/slideshow-panel.vue | 115 ++-- src/definitions.ts | 26 +- src/lang/lang.csv | 5 + src/style.css | 5 + 16 files changed, 1084 insertions(+), 309 deletions(-) create mode 100644 src/components/editor/slideshow-editor.vue diff --git a/StoryRampSchema.json b/StoryRampSchema.json index 9d7b0410..9e262663 100644 --- a/StoryRampSchema.json +++ b/StoryRampSchema.json @@ -138,7 +138,7 @@ "description": "A multimedia slide component.", "oneOf": [ { - "$ref": "#/$defs/multimediaImage" + "$ref": "#/$defs/imagePanel" }, { "$ref": "#/$defs/multimediaVideo" @@ -147,7 +147,7 @@ "$ref": "#/$defs/multimediaAudio" }, { - "$ref": "#/$defs/multimediaSlideshow" + "$ref": "#/$defs/slideshowPanel" } ], "properties": { @@ -159,6 +159,88 @@ } }, + "imagePanel": { + "type": "object", + "description": "An image panel.", + "properties": { + "images": { + "type": "array", + "items": { + "$ref": "#/$defs/multimediaImage" + }, + "description": "An array of images to display in the slideshow.", + "minItems": 1 + }, + "loop": { + "type": "boolean", + "description": "Determines whether the slideshow loops back around to the beginning when you reach the end.", + "default": false + }, + "caption": { + "type": "text", + "description": "A caption to display below the slideshow." + }, + "type": { + "type": "string", + "enum": ["slideshow"] + } + } + }, + + "slideshowPanel": { + "type": "object", + "description": "A multimedia slideshow component.", + "properties": { + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Type of this slideshow item.", + "enum": ["text", "map", "image", "chart"] + }, + "config": { + "type": "object", + "description": "Config for this slideshow item.", + "oneOf": [ + { + "$ref": "#/$defs/multimediaImage" + }, + { + "$ref": "#/$defs/mapPanel" + }, + { + "$ref": "#/$defs/textPanel" + }, + { + "$ref": "#/$defs/dqvchartPanel" + } + ] + } + } + }, + "description": "An array of images to display in the slideshow.", + "minItems": 1 + }, + "loop": { + "type": "boolean", + "description": "Determines whether the slideshow loops back around to the beginning when you reach the end.", + "default": false + }, + "caption": { + "type": "text", + "description": "A caption to display below the slideshow." + }, + "type": { + "type": "string", + "enum": ["slideshow"] + } + }, + "required": ["items", "type"] + }, + "mapPanel": { "type": "object", "description": "A map slide component.", @@ -249,10 +331,6 @@ "tooltip": { "type": "string", "description": "Tooltip content for the image." - }, - "type": { - "type": "string", - "enum": ["image"] } }, "required": ["src", "type"] @@ -306,34 +384,6 @@ "required": ["src", "type"] }, - "multimediaSlideshow": { - "type": "object", - "description": "A multimedia slideshow component.", - "properties": { - "images": { - "type": "array", - "items": { - "$ref": "#/$defs/multimediaImage" - }, - "description": "An array of images to display in the slideshow.", - "minItems": 1 - }, - "loop": { - "type": "boolean", - "description": "Determines whether the slideshow loops back around to the beginning when you reach the end.", - "default": false - }, - "caption": { - "type": "text", - "description": "A caption to display below the slideshow." - }, - "type": { - "type": "string", - "enum": ["slideshow"] - } - }, - "required": ["images", "type"] - }, "dqvchartOptions": { "type": "object", "description": "Configuration for a dqvchart.", @@ -349,7 +399,20 @@ "type": { "type": "string", "description": "The type of chart.", - "enum": ["line", "spline", "area", "areaspline", "column", "bar", "pie", "scatter", "gauge", "arearange", "areasplinerange", "columnrange"] + "enum": [ + "line", + "spline", + "area", + "areaspline", + "column", + "bar", + "pie", + "scatter", + "gauge", + "arearange", + "areasplinerange", + "columnrange" + ] }, "width": { "type": "number", @@ -385,79 +448,80 @@ "description": "The title of the y-axis." } } - }, - - "properties": { - "title": { - "type": "string", - "description": "The title of the story map." }, - "introSlide": { - "type": "object", - "description": "The introductory slide", - "properties": { - "logo": { - "type": "object", - "description": "Information about the StoryRAMP logo", - "properties": { - "src": { - "type": "string", - "description": "An image source that is displayed at the top of the slide" + "properties": { + "title": { + "type": "string", + "description": "The title of the story map." + }, + + "introSlide": { + "type": "object", + "description": "The introductory slide", + "properties": { + "logo": { + "type": "object", + "description": "Information about the StoryRAMP logo", + "properties": { + "src": { + "type": "string", + "description": "An image source that is displayed at the top of the slide" + }, + "altText": { + "type": "string", + "description": "Alt text for the logo" + } }, - "altText": { - "type": "string", - "description": "Alt text for the logo" - } + "required": ["src"] }, - "required": ["src"] - }, - "title": { - "type": "string", - "description": "The title of the project, displayed under the image" + "title": { + "type": "string", + "description": "The title of the project, displayed under the image" + }, + "subtitle": { + "type": "string", + "description": "An optional subtitle that is displayed under the title." + }, + "blurb": { + "type": "string", + "description": "Any additional information to display on the introductory slide." + } }, - "subtitle": { - "type": "string", - "description": "An optional subtitle that is displayed under the title." + "required": ["logo", "title"] + }, + + "slides": { + "type": "array", + "description": "A list of StoryRAMP slides. A minimum of one slide is required.", + "items": { + "$ref": "#/$defs/slide" }, - "blurb": { - "type": "string", - "description": "Any additional information to display on the introductory slide." - } + "minItems": 1 }, - "required": ["logo", "title"] - }, - "slides": { - "type": "array", - "description": "A list of StoryRAMP slides. A minimum of one slide is required.", - "items": { - "$ref": "#/$defs/slide" + "contextLink": { + "type": "string", + "description": "A link pointing to the source information" }, - "minItems": 1 - }, - "contextLink": { - "type": "string", - "description": "A link pointing to the source information" - }, + "contextLabel": { + "type": "string", + "description": "A description that explains the context link." + }, - "contextLabel": { - "type": "string", - "description": "A description that explains the context link." - }, + "lang": { + "type": "string", + "description": "The language to display in the app", + "enum": ["en", "fr"] + }, - "lang": { - "type": "string", - "description": "The language to display in the app", - "enum": ["en", "fr"] + "dateModified": { + "type": "string", + "description": "The last date that this config file was modified." + } }, - "dateModified": { - "type": "string", - "description": "The last date that this config file was modified." - } - }, - - "required": ["title", "introSlide", "slides"] + "required": ["title", "introSlide", "slides"] + } } diff --git a/public/00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000_en.json b/public/00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000_en.json index 3400bb20..22cf9068 100644 --- a/public/00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000_en.json +++ b/public/00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000_en.json @@ -18,9 +18,13 @@ "type": "text" }, { - "src": "00000000-0000-0000-0000-000000000000/assets/en/NPRIpictogramme-2016data-EN__1553797637582__w1430.jpg", "type": "image", - "caption": "This is a caption for the image." + "images": [ + { + "src": "00000000-0000-0000-0000-000000000000/assets/en/NPRIpictogramme-2016data-EN__1553797637582__w1430.jpg", + "caption": "This is a caption for the image." + } + ] } ] }, @@ -43,8 +47,12 @@ { "id": "panel-2", "panel": { - "src": "00000000-0000-0000-0000-000000000000/assets/en/GettyImages-187242601__1554821467033__w1920.jpg", - "type": "image" + "type": "image", + "images": [ + { + "src": "00000000-0000-0000-0000-000000000000/assets/en/GettyImages-187242601__1554821467033__w1920.jpg" + } + ] } }, { @@ -105,9 +113,13 @@ "type": "text" }, { - "src": "00000000-0000-0000-0000-000000000000/assets/en/GettyImages-187242601__1554821467033__w1920.jpg", "type": "image", - "fullscreen": false + "images": [ + { + "src": "00000000-0000-0000-0000-000000000000/assets/en/GettyImages-187242601__1554821467033__w1920.jpg", + "fullscreen": false + } + ] } ] }, @@ -120,8 +132,8 @@ "type": "text" }, { - "src": "00000000-0000-0000-0000-000000000000/assets/en/Slide 3 - mine vs insitu.jpg", - "type": "image" + "type": "image", + "images": [{ "src": "00000000-0000-0000-0000-000000000000/assets/en/Slide 3 - mine vs insitu.jpg" }] } ] }, @@ -151,37 +163,30 @@ { "images": [ { - "src": "00000000-0000-0000-0000-000000000000/assets/en/substances/1_AuroraNorth_RelDisp.PNG", - "type": "image" + "src": "00000000-0000-0000-0000-000000000000/assets/en/substances/1_AuroraNorth_RelDisp.PNG" }, { - "src": "00000000-0000-0000-0000-000000000000/assets/en/substances/2_FortHills_RelDisp.PNG", - "type": "image" + "src": "00000000-0000-0000-0000-000000000000/assets/en/substances/2_FortHills_RelDisp.PNG" }, { - "src": "00000000-0000-0000-0000-000000000000/assets/en/substances/3_Horizon_RelDisp.PNG", - "type": "image" + "src": "00000000-0000-0000-0000-000000000000/assets/en/substances/3_Horizon_RelDisp.PNG" }, { - "src": "00000000-0000-0000-0000-000000000000/assets/en/substances/4_Kearl_RelDisp.PNG", - "type": "image" + "src": "00000000-0000-0000-0000-000000000000/assets/en/substances/4_Kearl_RelDisp.PNG" }, { - "src": "00000000-0000-0000-0000-000000000000/assets/en/substances/5_MuskegJackpine_R5_RelDisp.PNG", - "type": "image" + "src": "00000000-0000-0000-0000-000000000000/assets/en/substances/5_MuskegJackpine_R5_RelDisp.PNG" }, { - "src": "00000000-0000-0000-0000-000000000000/assets/en/substances/6_Suncor_RelDisp.PNG", - "type": "image" + "src": "00000000-0000-0000-0000-000000000000/assets/en/substances/6_Suncor_RelDisp.PNG" }, { - "src": "00000000-0000-0000-0000-000000000000/assets/en/substances/7_Syncrude_RelDisp.PNG", - "type": "image" + "src": "00000000-0000-0000-0000-000000000000/assets/en/substances/7_Syncrude_RelDisp.PNG" } ], "loop": true, "caption": "NPRI substances reported for oil sands mining facilities", - "type": "slideshow" + "type": "image" } ] }, @@ -245,8 +250,8 @@ "type": "text" }, { - "src": "00000000-0000-0000-0000-000000000000/assets/en/slide 6 - mining trends.jpg", - "type": "image" + "type": "image", + "images": [{ "src": "00000000-0000-0000-0000-000000000000/assets/en/slide 6 - mining trends.jpg" }] } ] }, @@ -259,8 +264,12 @@ "type": "text" }, { - "src": "00000000-0000-0000-0000-000000000000/assets/en/Top10SubstancesTailings2019.png", - "type": "image" + "type": "image", + "images": [ + { + "src": "00000000-0000-0000-0000-000000000000/assets/en/Top10SubstancesTailings2019.png" + } + ] } ] }, @@ -275,37 +284,30 @@ { "images": [ { - "src": "00000000-0000-0000-0000-000000000000/assets/en/tailings/AuroraNorth_Tailings.PNG", - "type": "image" + "src": "00000000-0000-0000-0000-000000000000/assets/en/tailings/AuroraNorth_Tailings.PNG" }, { - "src": "00000000-0000-0000-0000-000000000000/assets/en/tailings/FortHills_Tailings.PNG", - "type": "image" + "src": "00000000-0000-0000-0000-000000000000/assets/en/tailings/FortHills_Tailings.PNG" }, { - "src": "00000000-0000-0000-0000-000000000000/assets/en/tailings/Horizon_Tailings.PNG", - "type": "image" + "src": "00000000-0000-0000-0000-000000000000/assets/en/tailings/Horizon_Tailings.PNG" }, { - "src": "00000000-0000-0000-0000-000000000000/assets/en/tailings/Kearl_Tailings.PNG", - "type": "image" + "src": "00000000-0000-0000-0000-000000000000/assets/en/tailings/Kearl_Tailings.PNG" }, { - "src": "00000000-0000-0000-0000-000000000000/assets/en/tailings/Muskeg_Tailings.PNG", - "type": "image" + "src": "00000000-0000-0000-0000-000000000000/assets/en/tailings/Muskeg_Tailings.PNG" }, { - "src": "00000000-0000-0000-0000-000000000000/assets/en/tailings/Suncor_Tailings.PNG", - "type": "image" + "src": "00000000-0000-0000-0000-000000000000/assets/en/tailings/Suncor_Tailings.PNG" }, { - "src": "00000000-0000-0000-0000-000000000000/assets/en/tailings/Syncrude_Tailings.PNG", - "type": "image" + "src": "00000000-0000-0000-0000-000000000000/assets/en/tailings/Syncrude_Tailings.PNG" } ], "loop": true, "caption": "Reported mine tailings from oil sands surface mining facilities", - "type": "slideshow" + "type": "image" } ] }, @@ -346,8 +348,8 @@ "type": "text" }, { - "src": "00000000-0000-0000-0000-000000000000/assets/en/Slide 10 - SAGD vs CSS.jpg", - "type": "image" + "type": "image", + "images": [{ "src": "00000000-0000-0000-0000-000000000000/assets/en/Slide 10 - SAGD vs CSS.jpg" }] } ] }, @@ -393,8 +395,12 @@ "type": "text" }, { - "src": "00000000-0000-0000-0000-000000000000/assets/en/Slide%2013%20-%20InSitu%20Trends__1554406944277__w594.jpg", - "type": "image" + "type": "image", + "images": [ + { + "src": "00000000-0000-0000-0000-000000000000/assets/en/Slide%2013%20-%20InSitu%20Trends__1554406944277__w594.jpg" + } + ] } ] }, @@ -407,8 +413,12 @@ "type": "text" }, { - "src": "00000000-0000-0000-0000-000000000000/assets/en/GettyImages-516166467__1554821531978__w1920.jpg", - "type": "image" + "type": "image", + "images": [ + { + "src": "00000000-0000-0000-0000-000000000000/assets/en/GettyImages-516166467__1554821531978__w1920.jpg" + } + ] } ] }, diff --git a/public/00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000_fr.json b/public/00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000_fr.json index 27853ce9..d7f4ae6e 100644 --- a/public/00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000_fr.json +++ b/public/00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000_fr.json @@ -18,8 +18,12 @@ "type": "text" }, { - "src": "00000000-0000-0000-0000-000000000000/assets/fr/NPRIpictogramme-2016data-FR__1552505700147__w975.jpg", - "type": "image" + "type": "image", + "images": [ + { + "src": "00000000-0000-0000-0000-000000000000/assets/fr/NPRIpictogramme-2016data-FR__1552505700147__w975.jpg" + } + ] } ] }, @@ -47,8 +51,12 @@ "type": "text" }, { - "src": "00000000-0000-0000-0000-000000000000/assets/fr/GettyImages-187242601__1554821412825__w1920.jpg", - "type": "image" + "type": "image", + "images": [ + { + "src": "00000000-0000-0000-0000-000000000000/assets/fr/GettyImages-187242601__1554821412825__w1920.jpg" + } + ] } ] }, @@ -61,8 +69,8 @@ "type": "text" }, { - "src": "00000000-0000-0000-0000-000000000000/assets/fr/Slide 3 - mine vs insitu.jpg", - "type": "image" + "type": "image", + "images": [{ "src": "00000000-0000-0000-0000-000000000000/assets/fr/Slide 3 - mine vs insitu.jpg" }] } ] }, @@ -91,37 +99,30 @@ { "images": [ { - "src": "00000000-0000-0000-0000-000000000000/assets/fr/substances/AuroraNorth_RelDisp_FR.PNG", - "type": "image" + "src": "00000000-0000-0000-0000-000000000000/assets/fr/substances/AuroraNorth_RelDisp_FR.PNG" }, { - "src": "00000000-0000-0000-0000-000000000000/assets/fr/substances/FortHills_RelDisp_FR.PNG", - "type": "image" + "src": "00000000-0000-0000-0000-000000000000/assets/fr/substances/FortHills_RelDisp_FR.PNG" }, { - "src": "00000000-0000-0000-0000-000000000000/assets/fr/substances/Horizon_RelDisp_FR.PNG", - "type": "image" + "src": "00000000-0000-0000-0000-000000000000/assets/fr/substances/Horizon_RelDisp_FR.PNG" }, { - "src": "00000000-0000-0000-0000-000000000000/assets/fr/substances/Kearl_RelDisp_FR.PNG", - "type": "image" + "src": "00000000-0000-0000-0000-000000000000/assets/fr/substances/Kearl_RelDisp_FR.PNG" }, { - "src": "00000000-0000-0000-0000-000000000000/assets/fr/substances/MuskegJackpine_RelDisp_FR.PNG", - "type": "image" + "src": "00000000-0000-0000-0000-000000000000/assets/fr/substances/MuskegJackpine_RelDisp_FR.PNG" }, { - "src": "00000000-0000-0000-0000-000000000000/assets/fr/substances/Suncor_RelDisp_FR.PNG", - "type": "image" + "src": "00000000-0000-0000-0000-000000000000/assets/fr/substances/Suncor_RelDisp_FR.PNG" }, { - "src": "00000000-0000-0000-0000-000000000000/assets/fr/substances/Syncrude_RelDisp_FR.PNG", - "type": "image" + "src": "00000000-0000-0000-0000-000000000000/assets/fr/substances/Syncrude_RelDisp_FR.PNG" } ], "loop": true, "caption": "NPRI substances reported for oil sands mining facilities", - "type": "slideshow" + "type": "image" } ] }, @@ -187,8 +188,8 @@ "type": "text" }, { - "src": "00000000-0000-0000-0000-000000000000/assets/fr/slide 6 trends in mining.jpg", - "type": "image" + "type": "image", + "images": [{ "src": "00000000-0000-0000-0000-000000000000/assets/fr/slide 6 trends in mining.jpg" }] } ] }, @@ -201,8 +202,10 @@ "type": "text" }, { - "src": "00000000-0000-0000-0000-000000000000/assets/fr/Top10SubstancesTailings2019.png", - "type": "image" + "type": "image", + "images": [ + { "src": "00000000-0000-0000-0000-000000000000/assets/fr/Top10SubstancesTailings2019.png" } + ] } ] }, @@ -217,37 +220,30 @@ { "images": [ { - "src": "00000000-0000-0000-0000-000000000000/assets/fr/tailings/AuroraNorth_Tailings_FR.PNG", - "type": "image" + "src": "00000000-0000-0000-0000-000000000000/assets/fr/tailings/AuroraNorth_Tailings_FR.PNG" }, { - "src": "00000000-0000-0000-0000-000000000000/assets/fr/tailings/FortHills_Tailings_FR.PNG", - "type": "image" + "src": "00000000-0000-0000-0000-000000000000/assets/fr/tailings/FortHills_Tailings_FR.PNG" }, { - "src": "00000000-0000-0000-0000-000000000000/assets/fr/tailings/Horizon_Tailings_FR.PNG", - "type": "image" + "src": "00000000-0000-0000-0000-000000000000/assets/fr/tailings/Horizon_Tailings_FR.PNG" }, { - "src": "00000000-0000-0000-0000-000000000000/assets/fr/tailings/Kearl_Tailings_FR.PNG", - "type": "image" + "src": "00000000-0000-0000-0000-000000000000/assets/fr/tailings/Kearl_Tailings_FR.PNG" }, { - "src": "00000000-0000-0000-0000-000000000000/assets/fr/tailings/Muskeg_Tailings_FR.PNG", - "type": "image" + "src": "00000000-0000-0000-0000-000000000000/assets/fr/tailings/Muskeg_Tailings_FR.PNG" }, { - "src": "00000000-0000-0000-0000-000000000000/assets/fr/tailings/Suncor_Tailings_FR.PNG", - "type": "image" + "src": "00000000-0000-0000-0000-000000000000/assets/fr/tailings/Suncor_Tailings_FR.PNG" }, { - "src": "00000000-0000-0000-0000-000000000000/assets/fr/tailings/Syncrude_Tailings_FR.PNG", - "type": "image" + "src": "00000000-0000-0000-0000-000000000000/assets/fr/tailings/Syncrude_Tailings_FR.PNG" } ], "loop": true, "caption": "Résidus miniers déclarés à l’INRP par les installations d’exploitation minière à ciel ouvert de sables bitumineux", - "type": "slideshow" + "type": "image" } ] }, @@ -288,8 +284,8 @@ "type": "text" }, { - "src": "00000000-0000-0000-0000-000000000000/assets/fr/Slide 10 - SAGD vs CSS.jpg", - "type": "image" + "type": "image", + "images": [{ "src": "00000000-0000-0000-0000-000000000000/assets/fr/Slide 10 - SAGD vs CSS.jpg" }] } ] }, @@ -330,8 +326,12 @@ "type": "text" }, { - "src": "00000000-0000-0000-0000-000000000000/assets/fr/Slide%2013%20Insitu%20trends%20-%20French__1554407015712__w628.jpg", - "type": "image" + "type": "image", + "images": [ + { + "src": "00000000-0000-0000-0000-000000000000/assets/fr/Slide%2013%20Insitu%20trends%20-%20French__1554407015712__w628.jpg" + } + ] } ] }, @@ -344,8 +344,10 @@ "type": "text" }, { - "src": "00000000-0000-0000-0000-000000000000/assets/fr/slide%2014%20-%20athabasca.jpg", - "type": "image" + "type": "image", + "images": [ + { "src": "00000000-0000-0000-0000-000000000000/assets/fr/slide%2014%20-%20athabasca.jpg" } + ] } ] } diff --git a/src/components/editor/dynamic-editor.vue b/src/components/editor/dynamic-editor.vue index 3c194204..6abad91b 100644 --- a/src/components/editor/dynamic-editor.vue +++ b/src/components/editor/dynamic-editor.vue @@ -93,6 +93,7 @@ import ImageEditorV from './image-editor.vue'; import TextEditorV from './text-editor.vue'; import MapEditorV from './map-editor.vue'; import { DefaultConfigs, PanelType } from '@/definitions'; +import SlideshowEditorV from './slideshow-editor.vue'; @Component({ components: { @@ -100,7 +101,8 @@ import { DefaultConfigs, PanelType } from '@/definitions'; 'image-editor': ImageEditorV, 'text-editor': TextEditorV, 'dynamic-editor': DynamicEditorV, - 'map-editor': MapEditorV + 'map-editor': MapEditorV, + 'slideshow-editor': SlideshowEditorV } }) export default class DynamicEditorV extends Vue { @@ -109,10 +111,10 @@ export default class DynamicEditorV extends Vue { @Prop() lang!: string; @Prop() sourceCounts!: any; - editors = { + editors: { [key: string]: string } = { text: 'text-editor', image: 'image-editor', - slideshow: 'image-editor', + slideshow: 'slideshow-editor', chart: 'chart-editor', map: 'map-editor' }; @@ -130,9 +132,13 @@ export default class DynamicEditorV extends Vue { content: '', children: [] }, + image: { + type: PanelType.Image, + images: [] + }, slideshow: { type: PanelType.Slideshow, - images: [] + items: [] }, chart: { type: PanelType.Chart, @@ -196,7 +202,7 @@ export default class DynamicEditorV extends Vue { }); break; - case 'slideshow': + case 'image': panel.images.forEach((image: any) => { this.sourceCounts[image.src] -= 1; if (this.sourceCounts[image.src] === 0) { @@ -204,6 +210,18 @@ export default class DynamicEditorV extends Vue { } }); break; + + case 'slideshow': + panel.items.forEach((item: any) => { + if (item.type !== 'text') { + const itemSrc = item.type === 'map' ? item.config.config : item.config.src; + this.sourceCounts[itemSrc] -= 1; + if (this.sourceCounts[itemSrc] === 0) { + this.configFileStructure.zip.remove(`${itemSrc.substring(itemSrc.indexOf('/') + 1)}`); + } + } + }); + break; } // Remove the panel itself. diff --git a/src/components/editor/helpers/image-preview.vue b/src/components/editor/helpers/image-preview.vue index 2df7d412..b3d3e6a8 100644 --- a/src/components/editor/helpers/image-preview.vue +++ b/src/components/editor/helpers/image-preview.vue @@ -2,7 +2,7 @@