@livepreso/api 6.55.1 → 6.56.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.rush/temp/shrinkwrap-deps.json +1013 -1191
- package/CHANGELOG.json +29 -0
- package/CHANGELOG.md +19 -1
- package/cjs/api.js +3 -5
- package/cjs/api.js.map +1 -1
- package/cjs/auth.spec.js +11 -11
- package/cjs/auth.spec.js.map +1 -1
- package/cjs/collections/appointment-tags.js +14 -15
- package/cjs/collections/appointment-tags.js.map +1 -1
- package/cjs/collections/base.spec.js +30 -30
- package/cjs/collections/base.spec.js.map +1 -1
- package/cjs/fixtures.js +1 -2
- package/cjs/fixtures.js.map +1 -1
- package/cjs/models/appointment.js +7 -7
- package/cjs/models/appointment.js.map +1 -1
- package/cjs/models/base.js +30 -12
- package/cjs/models/base.js.map +1 -1
- package/cjs/models/cms-val.spec.js +2 -2
- package/cjs/models/cms-val.spec.js.map +1 -1
- package/cjs/models/deck-version.js +14 -34
- package/cjs/models/deck-version.js.map +1 -1
- package/cjs/models/manifest-json.js +41 -5
- package/cjs/models/manifest-json.js.map +1 -1
- package/cjs/models/pack.js +2 -1
- package/cjs/models/pack.js.map +1 -1
- package/cjs/models/snapshot.spec.js +2 -2
- package/cjs/models/snapshot.spec.js.map +1 -1
- package/cjs/models/template.js +10 -10
- package/cjs/models/template.js.map +1 -1
- package/cjs/models/timing-log.spec.js +2 -2
- package/cjs/models/timing-log.spec.js.map +1 -1
- package/cjs/models/user.spec.js +4 -4
- package/cjs/models/user.spec.js.map +1 -1
- package/cjs/presentation/presentation-deck.js +19 -9
- package/cjs/presentation/presentation-deck.js.map +1 -1
- package/cjs/presentation/presentation-deck.spec.js +6 -6
- package/cjs/presentation/presentation-deck.spec.js.map +1 -1
- package/cjs/presentation/presentation-section.js +33 -10
- package/cjs/presentation/presentation-section.js.map +1 -1
- package/cjs/presentation/presentation-section.spec.js +24 -16
- package/cjs/presentation/presentation-section.spec.js.map +1 -1
- package/cjs/presentation/presentation-slide.js +18 -7
- package/cjs/presentation/presentation-slide.js.map +1 -1
- package/cjs/presentation/presentation-slide.spec.js +21 -12
- package/cjs/presentation/presentation-slide.spec.js.map +1 -1
- package/cjs/presentation/presentation-subslide.spec.js +10 -10
- package/cjs/presentation/presentation-subslide.spec.js.map +1 -1
- package/cjs/presentation/presentation.js +26 -26
- package/cjs/presentation/presentation.js.map +1 -1
- package/cjs/sync.js +1 -3
- package/cjs/sync.js.map +1 -1
- package/cjs/utils.js +33 -3
- package/cjs/utils.js.map +1 -1
- package/package.json +3 -3
- package/src/api.js +3 -5
- package/src/models/base.js +27 -9
- package/src/models/deck-version.js +5 -31
- package/src/models/manifest-json.js +33 -5
- package/src/models/pack.js +1 -0
- package/src/presentation/presentation-deck.js +9 -9
- package/src/presentation/presentation-section.js +35 -12
- package/src/presentation/presentation-section.spec.js +8 -0
- package/src/presentation/presentation-slide.js +7 -4
- package/src/presentation/presentation-slide.spec.js +9 -0
- package/src/sync.js +1 -3
- package/src/utils.js +31 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation-deck.js","names":["require","collections","_interopRequireWildcard","_utils","_basePresentationModel","_models","_presentationSection","_presentationSlide","_lodash","_interopRequireDefault","_index","_log","_stateRegister","_url","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","PresentationDeck","exports","BasePresentationModel","extend","props","html","css","id","deckID","index","thumbnail","visible","type","key","common","title","usesImpostorSections","editable","titleEditable","notesEditable","tagsEditable","tags","version","namespacedKey","cmsvalkey_set","children","realSection","derived","welcomeSlide","fn","PresentationSection","getAttributes","isWelcome","sections","url","DeckVersionModel","createFromDeckVersion","deckVersionModel","_deckVersionModel$nam","options","undefined","_","defaults","autoAdjuncts","AutoAdjunctCollection","adjunctSections","AdjunctSectionCollection","adjunctSlides","AdjunctSlideCollection","adjunctSubSlides","AdjunctSubSlideCollection","sectionSelections","SectionSelectionCollection","slideSelections","SlideSelectionCollection","screenshots","DeckVersionScreenshotCollection","rootAssetPath","templates","choicelist","screenshotsToMap","assetRoot","getAssetRoot","index_asset","concat","getTags","deck","getThumbnail","manifest_json","indexOf","isImpostorDeck","namespaced_key","log","warn","toJSON","selections","map","selection","sequence","section","slide","maxID","getMaxID","getUniqueAdjunctID","section_set","sectionModel","createFromSection","addSlides","slide_set","add","adjunctSection","createFromAdjunctSection","first","adjunctSlideLimit","adjunctslide_limit","slides","slideModel","isSection","isImpostor","createFromImpostorSection","PresentationSlide","createFromSlide","adjunctSlideModel","createFromAdjunctSlide","models","reverse","sectionSlides","Math","floor","template","createFromTemplate","autoSections","auto","Error","createFromAutoAdjunct","deckversionID","setSequentialSequences","createFromManifestJSON","manifestJSON","project","_project$welcome$edit","_project$welcome","parseInt","uniqueId","url2","resolve","getAssetPath","welcome","editables","some","items","titles","ordering","splitKey","split","newKey","sortBy","item","startIndex","endIndex","slice","createFromManifestImpostor","sectionKeys","_project$templates$fi","_project$templates","_project$templates$fi2","_project$templates$fi3","cmsvals","find","getTemplateAssetPath","minID","max","_project$templates2","_project$templates2$f","projTemplate","s","replace","autoAdjunctID","register"],"sources":["../../src/presentation/presentation-deck.js"],"sourcesContent":["import \"./presentation-sections.js\";\n\nimport * as collections from \"../collections\";\n\nimport {\n\tgetMaxID,\n\tisImpostor,\n\tisImpostorDeck,\n\tsetSequentialSequences,\n} from \"../utils.js\";\n\nimport { BasePresentationModel } from \"./base-presentation-model\";\nimport { DeckVersionModel } from \"../models\";\nimport { PresentationSection } from \"./presentation-section\";\nimport { PresentationSlide } from \"./presentation-slide\";\nimport _ from \"lodash\";\nimport { getAssetRoot } from \"../index.js\";\nimport log from \"../log.js\";\nimport { register } from \"../state-register\";\nimport url2 from \"url\";\n\n/**\n * @constructor\n * @alias presentation.PresentationDeck\n * @extends presentation.BasePresentationModel\n */\nexport const PresentationDeck = BasePresentationModel.extend(\n\t/** @lends presentation.PresentationDeck# */ {\n\t\t/**\n\t\t * @property {string} html\n\t\t * @property {string} css\n\t\t * @property {number} id\n\t\t * @property {number} deckID\n\t\t * @property {number} index\n\t\t * @property {string} thumbnail\n\t\t * @property {boolean} visible\n\t\t * @property {string} key\n\t\t * @property {object} common\n\t\t * @property {string} title\n\t\t * @property {boolean} usesImpostorSections\n\t\t * @property {boolean} editable\n\t\t * @property {array} tags\n\t\t * @property {number} version\n\t\t * @property {string} namespacedKey\n\t\t * @property {string[]} cmsvalkey_set\n\t\t */\n\t\tprops: {\n\t\t\thtml: \"string\",\n\t\t\tcss: \"string\",\n\t\t\tid: \"number\",\n\t\t\tdeckID: \"number\",\n\t\t\tindex: \"number\",\n\t\t\tthumbnail: \"string\",\n\t\t\tvisible: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tvisible: true,\n\t\t\t},\n\t\t\tkey: \"string\",\n\t\t\tcommon: \"object\",\n\t\t\ttitle: \"string\",\n\t\t\tusesImpostorSections: \"boolean\",\n\t\t\teditable: \"boolean\",\n\t\t\ttitleEditable: \"boolean\",\n\t\t\tnotesEditable: \"boolean\",\n\t\t\ttagsEditable: \"boolean\",\n\t\t\ttags: \"array\",\n\t\t\tversion: \"number\",\n\t\t\tnamespacedKey: \"string\",\n\t\t\tcmsvalkey_set: \"array\",\n\t\t},\n\n\t\t/**\n\t\t * @property {presentation.PresentationSection} realSection\n\t\t */\n\t\tchildren: {\n\t\t\trealSection: \"PresentationSection\",\n\t\t},\n\n\t\tderived: {\n\t\t\twelcomeSlide: {\n\t\t\t\tfn: function () {\n\t\t\t\t\treturn new PresentationSection({\n\t\t\t\t\t\t...this.getAttributes({ props: true }),\n\t\t\t\t\t\tisWelcome: true,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\n\t\t/**\n\t\t * @property {presentation.PresentationSectionCollection} sections\n\t\t */\n\t\tcollections: {\n\t\t\tsections: \"PresentationSectionCollection\",\n\t\t},\n\n\t\turl() {\n\t\t\tif (!this._url) {\n\t\t\t\tthis._url = new DeckVersionModel({ id: this.id }).url();\n\t\t\t}\n\n\t\t\treturn this._url;\n\t\t},\n\t},\n);\n\n/**\n * @function createFromURL\n * @memberof presentation.PresentationDeck\n * @param {models.DeckVersionModel} deckVersionModel\n * @param {object} [options]\n * @param {number} [options.index = 0]\n * @param {collections.AdjunctSectionCollection}} [adjunctSections]\n * @returns {presentation.PresentationDeck}\n */\nPresentationDeck.createFromDeckVersion = function (\n\tdeckVersionModel,\n\toptions = {},\n) {\n\t_.defaults(options, {\n\t\tindex: 0,\n\t\tautoAdjuncts: new collections.AutoAdjunctCollection(),\n\t\tadjunctSections: new collections.AdjunctSectionCollection(),\n\t\tadjunctSlides: new collections.AdjunctSlideCollection(),\n\t\tadjunctSubSlides: new collections.AdjunctSubSlideCollection(),\n\t\tsectionSelections: new collections.SectionSelectionCollection(),\n\t\tslideSelections: new collections.SlideSelectionCollection(),\n\t\tscreenshots: new collections.DeckVersionScreenshotCollection(),\n\t\trootAssetPath: null,\n\t\ttemplates: null,\n\t\tchoicelist: null,\n\t});\n\n\toptions.screenshots = PresentationDeck.screenshotsToMap(options.screenshots);\n\n\tconst assetRoot = getAssetRoot(deckVersionModel.index_asset.url());\n\tlet html;\n\tlet css;\n\n\tif (options.rootAssetPath) {\n\t\thtml = `${options.rootAssetPath}index.html`;\n\t\tcss = `${options.rootAssetPath}slide.css`;\n\t} else {\n\t\thtml = `${assetRoot}index.html`;\n\t\tcss = `${assetRoot}slide.css`;\n\t}\n\n\tconst tags = PresentationDeck.getTags(deckVersionModel, options);\n\n\tconst deck = new PresentationDeck({\n\t\thtml,\n\t\tcss,\n\t\tid: deckVersionModel.id,\n\t\tindex: options.index,\n\t\tthumbnail: PresentationDeck.getThumbnail(\n\t\t\tdeckVersionModel,\n\t\t\toptions.screenshots,\n\t\t),\n\t\tdeckID: deckVersionModel.deck.id,\n\t\tvisible: true,\n\t\tkey: deckVersionModel.deck.key,\n\t\tcommon: deckVersionModel.manifest_json.common,\n\t\ttitle: deckVersionModel.deck.title,\n\t\teditable: tags.indexOf(\"editable\") > -1,\n\t\ttitleEditable: false,\n\t\tnotesEditable: true,\n\t\ttagsEditable: true,\n\t\ttags,\n\t\tversion: deckVersionModel.version,\n\t\tusesImpostorSections: isImpostorDeck(deckVersionModel),\n\t\tcmsvalkey_set: deckVersionModel.cmsvalkey_set || [],\n\n\t\t// Prefer getting the value from the server, but if, for example, it's an old\n\t\t// cached version that doesn't have a namespaced key, we can make a very good\n\t\t// guess at a default!\n\t\tnamespacedKey: deckVersionModel.namespaced_key ?? \"\",\n\t});\n\n\tif (!deck.key) {\n\t\tlog.warn(\n\t\t\t\"Deck key not available to presentation\",\n\t\t\tdeckVersionModel.deck.toJSON(),\n\t\t);\n\t}\n\n\t// Convert the selections to an easier format to use later\n\tconst sectionSelections = options.sectionSelections;\n\tconst slideSelections = options.slideSelections;\n\n\toptions.selections = sectionSelections\n\t\t.map((selection) => {\n\t\t\treturn {\n\t\t\t\tsequence: selection.sequence,\n\t\t\t\tvisible: selection.visible,\n\t\t\t\turl: selection.section.url(),\n\t\t\t\tid: selection.id,\n\t\t\t};\n\t\t})\n\t\t.concat(\n\t\t\tslideSelections.map((selection) => {\n\t\t\t\treturn {\n\t\t\t\t\tsequence: selection.sequence,\n\t\t\t\t\tvisible: selection.visible,\n\t\t\t\t\turl: selection.slide.url(),\n\t\t\t\t\tid: selection.id,\n\t\t\t\t};\n\t\t\t}),\n\t\t);\n\n\t// We want all adjuncts to have fake ids that can't possibly overlap with the ids of\n\t// normal sections, slides and subslides, so we make a base ID that is larger than\n\t// all existing IDs then use the getUniqueAdjunctID function to retrieve an incremented ID\n\tlet maxID = getMaxID(deckVersionModel);\n\n\toptions.getUniqueAdjunctID = function () {\n\t\treturn ++maxID;\n\t};\n\n\t// We have four different ways to create a presentation structure here - we are\n\t// using either selections or a choicelist, and the deck is either a normal\n\t// deck or an impostor deck. Setting up a non-impostor deck is easier, so I've\n\t// split this up into two primary methods to cover those two branches, and the models\n\t// internally retrieve the correct sequence & visibility data depending on whether\n\t// we're using selections or a choicelist.\n\n\tif (!deck.usesImpostorSections) {\n\t\t// Non impostor deck using selections or a choicelist. Slides are already\n\t\t// associated with the correct sections, so all we have to do is turn\n\t\t// everything into a presentation model and pass the options through with\n\t\t// the selections or choicelist data.\n\n\t\tdeckVersionModel.section_set.forEach((sectionModel) => {\n\t\t\tconst section = PresentationSection.createFromSection(\n\t\t\t\tsectionModel,\n\t\t\t\toptions,\n\t\t\t);\n\n\t\t\tsection.addSlides(sectionModel.slide_set, options);\n\t\t\tdeck.sections.add(section);\n\n\t\t\tconst adjunctSlides = options.adjunctSlides.filter((slide) => {\n\t\t\t\treturn slide.section && slide.section.id === section.id;\n\t\t\t});\n\n\t\t\tsection.addSlides(adjunctSlides, options);\n\t\t});\n\n\t\toptions.adjunctSections.forEach((adjunctSection) => {\n\t\t\tconst section = PresentationSection.createFromAdjunctSection(\n\t\t\t\tadjunctSection,\n\t\t\t\tDeckVersionModel,\n\t\t\t\toptions,\n\t\t\t);\n\n\t\t\tdeck.sections.add(section);\n\t\t});\n\t} else {\n\t\t// Impostor deck using selections or a choicelist. The deckversion.section_set\n\t\t// only contains one section, which is the \"real\" section but is not used in\n\t\t// the presentation. Some slides have the tag \"section-header\", and these slides\n\t\t// will be turned into sections and may be given sets of slides.\n\n\t\tconst realSection = deckVersionModel.section_set.first();\n\n\t\tdeck.realSection = new PresentationSection({\n\t\t\tid: realSection.id,\n\t\t\tkey: realSection.key,\n\t\t\tadjunctSlideLimit: realSection.adjunctslide_limit,\n\t\t});\n\n\t\tlet slides = [];\n\n\t\t// First we go through all slides and separate the impostor sections from the\n\t\t// normal slides. If a slide is a \"section header\" then we turn it into a presentation\n\t\t// section; if it is just a slide then we add it to the slides array, which will contain\n\t\t// all slides. We can't allocate slides to sections yet because we don't know\n\t\t// which section a slide belongs to.\n\t\trealSection.slide_set.forEach((slideModel) => {\n\t\t\tconst isSection = isImpostor(slideModel);\n\n\t\t\tif (isSection) {\n\t\t\t\tconst section = PresentationSection.createFromImpostorSection(\n\t\t\t\t\tslideModel,\n\t\t\t\t\toptions,\n\t\t\t\t);\n\n\t\t\t\tdeck.sections.add(section);\n\t\t\t} else {\n\t\t\t\tconst slide = PresentationSlide.createFromSlide(slideModel, options);\n\t\t\t\tslides.push(slide);\n\t\t\t}\n\t\t});\n\n\t\t// We filter the adjunct slides and add all the non-section slides to the slides array too.\n\t\toptions.adjunctSlides\n\t\t\t.filter((slide) => !isImpostor(slide))\n\t\t\t.forEach((adjunctSlideModel) => {\n\t\t\t\tconst slide = PresentationSlide.createFromAdjunctSlide(\n\t\t\t\t\tadjunctSlideModel,\n\t\t\t\t\tnull,\n\t\t\t\t\toptions,\n\t\t\t\t);\n\n\t\t\t\tslides.push(slide);\n\t\t\t});\n\n\t\t// Next we go through the sections backwards and use the sequence to find all slides\n\t\t// which belong to a section. Doing this backwards means that we only need to know\n\t\t// one section's sequence at a time, e.g. if I went forwards and the first section\n\t\t// had the sequence 1, I know that I can start looking for slides with sequence > 1\n\t\t// but I don't know where to stop. If I start with the last section and look for\n\t\t// slides with the sequence > 110 then I know that all slides with a sequence > 110\n\t\t// are valid. I then remove those slides from the slides array and move down to the\n\t\t// next section.\n\t\tdeck.sections.models.reverse().forEach((section) => {\n\t\t\tconst sectionSlides = slides.filter(\n\t\t\t\t(slide) => slide.sequence > section.sequence,\n\t\t\t);\n\n\t\t\tsection.slides.add(sectionSlides);\n\n\t\t\t// Slides have a \"section\" on their model that represents the section\n\t\t\t// that they belong to. Because this is an impostor deck, there's a\n\t\t\t// good chance that the section is now incorrect for normal slides,\n\t\t\t// and a 100% chance that it's incorrect for adjunct slides as we\n\t\t\t// didn't populate the section field when we created the adjunct slides.\n\t\t\t// We update those now with the correct section.\n\t\t\tsection.slides.forEach((slide) => {\n\t\t\t\tslide.section = section.id;\n\t\t\t});\n\n\t\t\tslides = slides.filter((slide) => slide.sequence <= section.sequence);\n\t\t});\n\n\t\t// Average the adjunct slide limit used across the entire deck over each section\n\t\t// in the deck. We do this before we add the adjunct impostor sections, 'cause you\n\t\t// can't add custom slides to those.\n\t\tdeck.sections.forEach((section) => {\n\t\t\tsection.adjunctSlideLimit = section.adjunctSlideLimit\n\t\t\t\t? section.adjunctSlideLimit\n\t\t\t\t: Math.floor(realSection.adjunctSlideLimit / deck.sections.length);\n\t\t});\n\n\t\t// Return the sections to the correct order\n\t\tdeck.sections.models.reverse();\n\n\t\t// Finally, we add the adjunct impostor sections. These are adjunct slides with\n\t\t// the \"section-header\" tag and they work the same way as the slide impostors,\n\t\t// but because adjunct sections can't have slides we're adding them after the\n\t\t// slide-assigning process\n\t\toptions.adjunctSlides\n\t\t\t.filter((slide) => isImpostor(slide))\n\t\t\t.forEach((adjunctSlideModel) => {\n\t\t\t\tconst adjunctSection = PresentationSection.createFromAdjunctSection(\n\t\t\t\t\tadjunctSlideModel,\n\t\t\t\t\tDeckVersionModel,\n\t\t\t\t\toptions,\n\t\t\t\t);\n\n\t\t\t\tdeck.sections.add(adjunctSection);\n\t\t\t});\n\t}\n\n\t// Add templates as sections if present. This is only used by the CDK.\n\tif (options.templates && options.templates.length > 0) {\n\t\tdeck.sections.add(\n\t\t\toptions.templates.map((template, index) => {\n\t\t\t\treturn PresentationSection.createFromTemplate(\n\t\t\t\t\ttemplate,\n\t\t\t\t\tdeck.sections.length + index,\n\t\t\t\t\toptions.getUniqueAdjunctID(),\n\t\t\t\t);\n\t\t\t}),\n\t\t);\n\t}\n\n\t// This is generally only used by screenshots\n\tif (options.autoAdjuncts) {\n\t\tconst autoSections = options.autoAdjuncts.map((auto, index) => {\n\t\t\t// We already have the template on the deckversion, so we can find it here.\n\t\t\tif (!auto.template) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"Attempted to use an autoadjunct that has no template.\",\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst section = PresentationSection.createFromAutoAdjunct(auto, {\n\t\t\t\tindex: deck.sections.length + index,\n\t\t\t\tdeckversionID: deck.id,\n\t\t\t});\n\n\t\t\treturn section;\n\t\t});\n\n\t\tdeck.sections.add(autoSections);\n\t}\n\n\tsetSequentialSequences(deck);\n\n\treturn deck;\n};\n\nPresentationDeck.createFromManifestJSON = function (manifestJSON, project) {\n\tconst deck = new PresentationDeck({\n\t\tid: parseInt(_.uniqueId(), 10),\n\t\tindex: 0,\n\t\tvisible: true,\n\t\tkey: manifestJSON.key || \"manifest_deck\",\n\t\thtml: url2.resolve(manifestJSON.getAssetPath(), \"index.html\"),\n\t\tcss: url2.resolve(manifestJSON.getAssetPath(), \"slide.css\"),\n\t\tcommon: manifestJSON.common,\n\t\tthumbnail: null,\n\t\tdeckID: 1,\n\t\ttitle: \"Local\",\n\t\tversion: 1,\n\t\ttags: manifestJSON.tags[\"\"] || [],\n\t\tcmsvalkey_set: project?.welcome?.editables ?? [],\n\t});\n\n\tconst usesImpostorSections = _.some(\n\t\tmanifestJSON.tags,\n\t\t(tags) => tags.indexOf(\"section-header\") !== -1,\n\t);\n\tdeck.usesImpostorSections = usesImpostorSections;\n\n\tif (usesImpostorSections) {\n\t\tdeck.usesImpostorSections = true;\n\n\t\tlet items = Object.keys(manifestJSON.titles).map((key) => {\n\t\t\tconst sequence = manifestJSON.toJSON().ordering[key];\n\t\t\tconst splitKey = key.split(\"/\");\n\t\t\tconst newKey = splitKey[splitKey.length - 1];\n\n\t\t\treturn {\n\t\t\t\tkey: newKey,\n\t\t\t\tsequence,\n\t\t\t\thtml: url2.resolve(manifestJSON.getAssetPath(key), \"index.html\"),\n\t\t\t\tcss: url2.resolve(manifestJSON.getAssetPath(key), \"slide.css\"),\n\t\t\t\ttitle: manifestJSON.titles[key],\n\t\t\t\ttags: manifestJSON.tags[key] || [],\n\t\t\t\tcmsvalkey_set: [],\n\t\t\t};\n\t\t});\n\n\t\titems = _.sortBy(items, \"sequence\");\n\n\t\tconst sections = items.filter(\n\t\t\t(item) => item.tags.indexOf(\"section-header\") !== -1,\n\t\t);\n\n\t\tsections.forEach((item, index) => {\n\t\t\tconst startIndex = items.indexOf(item) + 1;\n\t\t\tconst endIndex = sections[index + 1]\n\t\t\t\t? items.indexOf(sections[index + 1])\n\t\t\t\t: items.length;\n\n\t\t\tconst slides = items.slice(startIndex, endIndex);\n\n\t\t\titem.slides = slides;\n\t\t});\n\n\t\tdeck.sections.add(\n\t\t\tsections.map((section, index) => {\n\t\t\t\treturn PresentationSection.createFromManifestImpostor(\n\t\t\t\t\tsection,\n\t\t\t\t\tproject,\n\t\t\t\t\tindex,\n\t\t\t\t);\n\t\t\t}),\n\t\t);\n\n\t\tdeck.realSection = PresentationSection.createFromManifestImpostor(\n\t\t\titems[0],\n\t\t\tproject,\n\t\t);\n\t} else {\n\t\tconst sectionKeys = Object.keys(manifestJSON.titles).filter((title) => {\n\t\t\treturn title.split(\"/\").length === 1;\n\t\t});\n\n\t\tdeck.sections.add(\n\t\t\tsectionKeys.map((key, index) => {\n\t\t\t\treturn PresentationSection.createFromManifestJSON(\n\t\t\t\t\tmanifestJSON,\n\t\t\t\t\tproject,\n\t\t\t\t\tkey,\n\t\t\t\t\tindex,\n\t\t\t\t);\n\t\t\t}),\n\t\t);\n\t}\n\n\tif (manifestJSON.templates) {\n\t\tconst templates = Object.keys(manifestJSON.templates).map((key) => {\n\t\t\tconst cmsvals =\n\t\t\t\tproject?.templates?.find?.((t) => t.key === key)?.editables ?? [];\n\n\t\t\treturn {\n\t\t\t\t...manifestJSON.templates[key],\n\t\t\t\tkey,\n\t\t\t\tsequence: manifestJSON.templates[key].ordering,\n\t\t\t\tindex_asset: {\n\t\t\t\t\turl: url2.resolve(\n\t\t\t\t\t\tmanifestJSON.getTemplateAssetPath(key),\n\t\t\t\t\t\t\"index.html\",\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\tcmsvalkey_set: cmsvals,\n\t\t\t};\n\t\t});\n\n\t\tconst minID = _.max(_.map(deck.sections.toJSON(), \"id\"));\n\n\t\tdeck.sections.add(\n\t\t\ttemplates.map((template, index) => {\n\t\t\t\tconst section = PresentationSection.createFromTemplate(\n\t\t\t\t\ttemplate,\n\t\t\t\t\tindex,\n\t\t\t\t\tminID,\n\t\t\t\t);\n\t\t\t\tconst projTemplate = project?.templates?.find?.(\n\t\t\t\t\t(s) => s.key === section.key.replace(\"template-\", \"\"),\n\t\t\t\t);\n\t\t\t\tif (projTemplate?.editables) {\n\t\t\t\t\tsection.cmsvalkey_set = projTemplate.editables.map((key) => {\n\t\t\t\t\t\treturn `${key}-autoadjunct-${section.autoAdjunctID}`;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn section;\n\t\t\t}),\n\t\t);\n\t}\n\n\treturn deck;\n};\n\nregister(\"PresentationDeck\", PresentationDeck);\n"],"mappings":";;;;;;;;;AAAAA,OAAA;AAEA,IAAAC,WAAA,GAAAC,uBAAA,CAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AAOA,IAAAI,sBAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,oBAAA,GAAAN,OAAA;AACA,IAAAO,kBAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAC,sBAAA,CAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,IAAA,GAAAF,sBAAA,CAAAT,OAAA;AACA,IAAAY,cAAA,GAAAZ,OAAA;AACA,IAAAa,IAAA,GAAAJ,sBAAA,CAAAT,OAAA;AAAuB,SAAAc,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAb,wBAAAa,CAAA,EAAAE,CA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CAAC;IAExDR,IAAI,CAACjC,QAAQ,CAACwD,GAAG,CAChB/B,SAAS,CAACkB,GAAG,CAAC,UAACiC,QAAQ,EAAEpG,KAAK,EAAK;MAAA,IAAA+I,mBAAA,EAAAC,qBAAA;MAClC,IAAM1E,OAAO,GAAGjD,wCAAmB,CAACgF,kBAAkB,CACrDD,QAAQ,EACRpG,KAAK,EACL6I,KACD,CAAC;MACD,IAAMI,YAAY,GAAGnC,OAAO,aAAPA,OAAO,wBAAAiC,mBAAA,GAAPjC,OAAO,CAAE7D,SAAS,cAAA8F,mBAAA,wBAAAC,qBAAA,GAAlBD,mBAAA,CAAoBJ,IAAI,cAAAK,qBAAA,uBAAxBA,qBAAA,CAAA3K,IAAA,CAAA0K,mBAAA,EACpB,UAACG,CAAC;QAAA,OAAKA,CAAC,CAAC9I,GAAG,KAAKkE,OAAO,CAAClE,GAAG,CAAC+I,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC;MAAA,CACtD,CAAC;MACD,IAAIF,YAAY,aAAZA,YAAY,eAAZA,YAAY,CAAE1B,SAAS,EAAE;QAC5BjD,OAAO,CAACvD,aAAa,GAAGkI,YAAY,CAAC1B,SAAS,CAACpD,GAAG,CAAC,UAAC/D,GAAG,EAAK;UAC3D,UAAAmD,MAAA,CAAUnD,GAAG,mBAAAmD,MAAA,CAAgBe,OAAO,CAAC8E,aAAa;QACnD,CAAC,CAAC;MACH;MACA,OAAO9E,OAAO;IACf,CAAC,CACF,CAAC;EACF;EAEA,OAAOb,IAAI;AACZ,CAAC;AAED,IAAA4F,uBAAQ,EAAC,kBAAkB,EAAE9J,gBAAgB,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"presentation-deck.js","names":["require","collections","_interopRequireWildcard","_utils","_basePresentationModel","_models","_presentationSection","_presentationSlide","_lodash","_interopRequireDefault","_index","_log","_stateRegister","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","_typeof","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ownKeys","keys","getOwnPropertySymbols","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","PresentationDeck","exports","BasePresentationModel","extend","props","html","css","id","deckID","index","thumbnail","visible","type","key","common","title","usesImpostorSections","editable","titleEditable","notesEditable","tagsEditable","tags","version","namespacedKey","cmsvalkey_set","isWelcome","isSlide","isSection","children","realSection","derived","welcomeSlide","fn","PresentationSection","getAttributes","sections","url","_url","DeckVersionModel","createFromDeckVersion","deckVersionModel","_deckVersionModel$nam","options","undefined","_","defaults","autoAdjuncts","AutoAdjunctCollection","adjunctSections","AdjunctSectionCollection","adjunctSlides","AdjunctSlideCollection","adjunctSubSlides","AdjunctSubSlideCollection","sectionSelections","SectionSelectionCollection","slideSelections","SlideSelectionCollection","screenshots","DeckVersionScreenshotCollection","rootAssetPath","templates","choicelist","screenshotsToMap","assetRoot","getAssetRoot","index_asset","concat","getTags","deck","getThumbnail","manifest_json","indexOf","isImpostorDeck","namespaced_key","log","warn","toJSON","selections","map","selection","sequence","section","slide","maxID","getMaxID","getUniqueAdjunctID","section_set","sectionModel","createFromSection","addSlides","slide_set","add","adjunctSection","createFromAdjunctSection","first","adjunctSlideLimit","adjunctslide_limit","slides","slideModel","isImpostor","createFromImpostorSection","PresentationSlide","createFromSlide","adjunctSlideModel","createFromAdjunctSlide","models","reverse","sectionSlides","Math","floor","template","createFromTemplate","autoSections","auto","Error","createFromAutoAdjunct","deckversionID","setSequentialSequences","createFromManifestJSON","manifestJSON","project","_project$welcome$edit","_project$welcome","parseInt","uniqueId","resolveURL","getAssetPath","welcome","editables","some","items","titles","ordering","splitKey","split","newKey","sortBy","item","startIndex","endIndex","slice","createFromManifestImpostor","sectionKeys","_project$templates$fi","_project$templates","_project$templates$fi2","_project$templates$fi3","cmsvals","find","getTemplateAssetPath","minID","max","_project$templates2","_project$templates2$f","projTemplate","s","replace","autoAdjunctID","register"],"sources":["../../src/presentation/presentation-deck.js"],"sourcesContent":["import \"./presentation-sections.js\";\n\nimport * as collections from \"../collections\";\n\nimport {\n\tgetMaxID,\n\tisImpostor,\n\tisImpostorDeck,\n\tsetSequentialSequences,\n} from \"../utils.js\";\n\nimport { BasePresentationModel } from \"./base-presentation-model\";\nimport { DeckVersionModel } from \"../models\";\nimport { PresentationSection } from \"./presentation-section\";\nimport { PresentationSlide } from \"./presentation-slide\";\nimport _ from \"lodash\";\nimport { getAssetRoot } from \"../index.js\";\nimport log from \"../log.js\";\nimport { register } from \"../state-register\";\nimport { resolveURL } from \"../utils.js\";\n\n/**\n * @constructor\n * @alias presentation.PresentationDeck\n * @extends presentation.BasePresentationModel\n */\nexport const PresentationDeck = BasePresentationModel.extend(\n\t/** @lends presentation.PresentationDeck# */ {\n\t\t/**\n\t\t * @property {string} html\n\t\t * @property {string} css\n\t\t * @property {number} id\n\t\t * @property {number} deckID\n\t\t * @property {number} index\n\t\t * @property {string} thumbnail\n\t\t * @property {boolean} visible\n\t\t * @property {string} key\n\t\t * @property {object} common\n\t\t * @property {string} title\n\t\t * @property {boolean} usesImpostorSections\n\t\t * @property {boolean} editable\n\t\t * @property {array} tags\n\t\t * @property {number} version\n\t\t * @property {string} namespacedKey\n\t\t * @property {string[]} cmsvalkey_set\n\t\t */\n\t\tprops: {\n\t\t\thtml: \"string\",\n\t\t\tcss: \"string\",\n\t\t\tid: \"number\",\n\t\t\tdeckID: \"number\",\n\t\t\tindex: \"number\",\n\t\t\tthumbnail: \"string\",\n\t\t\tvisible: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tvisible: true,\n\t\t\t},\n\t\t\tkey: \"string\",\n\t\t\tcommon: \"object\",\n\t\t\ttitle: \"string\",\n\t\t\tusesImpostorSections: \"boolean\",\n\t\t\teditable: \"boolean\",\n\t\t\ttitleEditable: \"boolean\",\n\t\t\tnotesEditable: \"boolean\",\n\t\t\ttagsEditable: \"boolean\",\n\t\t\ttags: \"array\",\n\t\t\tversion: \"number\",\n\t\t\tnamespacedKey: \"string\",\n\t\t\tcmsvalkey_set: \"array\",\n\t\t\tisWelcome: { type: \"boolean\", default: true },\n\t\t\tisSlide: { type: \"boolean\", default: false },\n\t\t\tisSection: { type: \"boolean\", default: false },\n\t\t},\n\n\t\t/**\n\t\t * @property {presentation.PresentationSection} realSection\n\t\t */\n\t\tchildren: {\n\t\t\trealSection: \"PresentationSection\",\n\t\t},\n\n\t\tderived: {\n\t\t\twelcomeSlide: {\n\t\t\t\tfn: function () {\n\t\t\t\t\treturn new PresentationSection({\n\t\t\t\t\t\t...this.getAttributes({ props: true }),\n\t\t\t\t\t\tisWelcome: true,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\n\t\t/**\n\t\t * @property {presentation.PresentationSectionCollection} sections\n\t\t */\n\t\tcollections: {\n\t\t\tsections: \"PresentationSectionCollection\",\n\t\t},\n\n\t\turl() {\n\t\t\tif (!this._url) {\n\t\t\t\tthis._url = new DeckVersionModel({ id: this.id }).url();\n\t\t\t}\n\n\t\t\treturn this._url;\n\t\t},\n\t},\n);\n\n/**\n * @function createFromURL\n * @memberof presentation.PresentationDeck\n * @param {models.DeckVersionModel} deckVersionModel\n * @param {object} [options]\n * @param {number} [options.index = 0]\n * @param {collections.AdjunctSectionCollection}} [adjunctSections]\n * @returns {presentation.PresentationDeck}\n */\nPresentationDeck.createFromDeckVersion = function (\n\tdeckVersionModel,\n\toptions = {},\n) {\n\t_.defaults(options, {\n\t\tindex: 0,\n\t\tautoAdjuncts: new collections.AutoAdjunctCollection(),\n\t\tadjunctSections: new collections.AdjunctSectionCollection(),\n\t\tadjunctSlides: new collections.AdjunctSlideCollection(),\n\t\tadjunctSubSlides: new collections.AdjunctSubSlideCollection(),\n\t\tsectionSelections: new collections.SectionSelectionCollection(),\n\t\tslideSelections: new collections.SlideSelectionCollection(),\n\t\tscreenshots: new collections.DeckVersionScreenshotCollection(),\n\t\trootAssetPath: null,\n\t\ttemplates: null,\n\t\tchoicelist: null,\n\t});\n\n\toptions.screenshots = PresentationDeck.screenshotsToMap(options.screenshots);\n\n\tconst assetRoot = getAssetRoot(deckVersionModel.index_asset.url());\n\tlet html;\n\tlet css;\n\n\tif (options.rootAssetPath) {\n\t\thtml = `${options.rootAssetPath}index.html`;\n\t\tcss = `${options.rootAssetPath}slide.css`;\n\t} else {\n\t\thtml = `${assetRoot}index.html`;\n\t\tcss = `${assetRoot}slide.css`;\n\t}\n\n\tconst tags = PresentationDeck.getTags(deckVersionModel, options);\n\n\tconst deck = new PresentationDeck({\n\t\thtml,\n\t\tcss,\n\t\tid: deckVersionModel.id,\n\t\tindex: options.index,\n\t\tthumbnail: PresentationDeck.getThumbnail(\n\t\t\tdeckVersionModel,\n\t\t\toptions.screenshots,\n\t\t),\n\t\tdeckID: deckVersionModel.deck.id,\n\t\tvisible: true,\n\t\tkey: deckVersionModel.deck.key,\n\t\tcommon: deckVersionModel.manifest_json.common,\n\t\ttitle: deckVersionModel.deck.title,\n\t\teditable: tags.indexOf(\"editable\") > -1,\n\t\ttitleEditable: false,\n\t\tnotesEditable: true,\n\t\ttagsEditable: true,\n\t\ttags,\n\t\tversion: deckVersionModel.version,\n\t\tusesImpostorSections: isImpostorDeck(deckVersionModel),\n\t\tcmsvalkey_set: deckVersionModel.cmsvalkey_set || [],\n\n\t\t// Prefer getting the value from the server, but if, for example, it's an old\n\t\t// cached version that doesn't have a namespaced key, we can make a very good\n\t\t// guess at a default!\n\t\tnamespacedKey: deckVersionModel.namespaced_key ?? \"\",\n\t});\n\n\tif (!deck.key) {\n\t\tlog.warn(\n\t\t\t\"Deck key not available to presentation\",\n\t\t\tdeckVersionModel.deck.toJSON(),\n\t\t);\n\t}\n\n\t// Convert the selections to an easier format to use later\n\tconst sectionSelections = options.sectionSelections;\n\tconst slideSelections = options.slideSelections;\n\n\toptions.selections = sectionSelections\n\t\t.map((selection) => {\n\t\t\treturn {\n\t\t\t\tsequence: selection.sequence,\n\t\t\t\tvisible: selection.visible,\n\t\t\t\turl: selection.section.url(),\n\t\t\t\tid: selection.id,\n\t\t\t};\n\t\t})\n\t\t.concat(\n\t\t\tslideSelections.map((selection) => {\n\t\t\t\treturn {\n\t\t\t\t\tsequence: selection.sequence,\n\t\t\t\t\tvisible: selection.visible,\n\t\t\t\t\turl: selection.slide.url(),\n\t\t\t\t\tid: selection.id,\n\t\t\t\t};\n\t\t\t}),\n\t\t);\n\n\t// We want all adjuncts to have fake ids that can't possibly overlap with the ids of\n\t// normal sections, slides and subslides, so we make a base ID that is larger than\n\t// all existing IDs then use the getUniqueAdjunctID function to retrieve an incremented ID\n\tlet maxID = getMaxID(deckVersionModel);\n\n\toptions.getUniqueAdjunctID = function () {\n\t\treturn ++maxID;\n\t};\n\n\t// We have four different ways to create a presentation structure here - we are\n\t// using either selections or a choicelist, and the deck is either a normal\n\t// deck or an impostor deck. Setting up a non-impostor deck is easier, so I've\n\t// split this up into two primary methods to cover those two branches, and the models\n\t// internally retrieve the correct sequence & visibility data depending on whether\n\t// we're using selections or a choicelist.\n\n\tif (!deck.usesImpostorSections) {\n\t\t// Non impostor deck using selections or a choicelist. Slides are already\n\t\t// associated with the correct sections, so all we have to do is turn\n\t\t// everything into a presentation model and pass the options through with\n\t\t// the selections or choicelist data.\n\n\t\tdeckVersionModel.section_set.forEach((sectionModel) => {\n\t\t\tconst section = PresentationSection.createFromSection(\n\t\t\t\tsectionModel,\n\t\t\t\toptions,\n\t\t\t);\n\n\t\t\tsection.addSlides(sectionModel.slide_set, options);\n\t\t\tdeck.sections.add(section);\n\n\t\t\tconst adjunctSlides = options.adjunctSlides.filter((slide) => {\n\t\t\t\treturn slide.section && slide.section.id === section.id;\n\t\t\t});\n\n\t\t\tsection.addSlides(adjunctSlides, options);\n\t\t});\n\n\t\toptions.adjunctSections.forEach((adjunctSection) => {\n\t\t\tconst section = PresentationSection.createFromAdjunctSection(\n\t\t\t\tadjunctSection,\n\t\t\t\tDeckVersionModel,\n\t\t\t\toptions,\n\t\t\t);\n\n\t\t\tdeck.sections.add(section);\n\t\t});\n\t} else {\n\t\t// Impostor deck using selections or a choicelist. The deckversion.section_set\n\t\t// only contains one section, which is the \"real\" section but is not used in\n\t\t// the presentation. Some slides have the tag \"section-header\", and these slides\n\t\t// will be turned into sections and may be given sets of slides.\n\n\t\tconst realSection = deckVersionModel.section_set.first();\n\n\t\tdeck.realSection = new PresentationSection({\n\t\t\tid: realSection.id,\n\t\t\tkey: realSection.key,\n\t\t\tadjunctSlideLimit: realSection.adjunctslide_limit,\n\t\t});\n\n\t\tlet slides = [];\n\n\t\t// First we go through all slides and separate the impostor sections from the\n\t\t// normal slides. If a slide is a \"section header\" then we turn it into a presentation\n\t\t// section; if it is just a slide then we add it to the slides array, which will contain\n\t\t// all slides. We can't allocate slides to sections yet because we don't know\n\t\t// which section a slide belongs to.\n\t\trealSection.slide_set.forEach((slideModel) => {\n\t\t\tconst isSection = isImpostor(slideModel);\n\n\t\t\tif (isSection) {\n\t\t\t\tconst section = PresentationSection.createFromImpostorSection(\n\t\t\t\t\tslideModel,\n\t\t\t\t\toptions,\n\t\t\t\t);\n\n\t\t\t\tdeck.sections.add(section);\n\t\t\t} else {\n\t\t\t\tconst slide = PresentationSlide.createFromSlide(slideModel, options);\n\t\t\t\tslides.push(slide);\n\t\t\t}\n\t\t});\n\n\t\t// We filter the adjunct slides and add all the non-section slides to the slides array too.\n\t\toptions.adjunctSlides\n\t\t\t.filter((slide) => !isImpostor(slide))\n\t\t\t.forEach((adjunctSlideModel) => {\n\t\t\t\tconst slide = PresentationSlide.createFromAdjunctSlide(\n\t\t\t\t\tadjunctSlideModel,\n\t\t\t\t\tnull,\n\t\t\t\t\toptions,\n\t\t\t\t);\n\n\t\t\t\tslides.push(slide);\n\t\t\t});\n\n\t\t// Next we go through the sections backwards and use the sequence to find all slides\n\t\t// which belong to a section. Doing this backwards means that we only need to know\n\t\t// one section's sequence at a time, e.g. if I went forwards and the first section\n\t\t// had the sequence 1, I know that I can start looking for slides with sequence > 1\n\t\t// but I don't know where to stop. If I start with the last section and look for\n\t\t// slides with the sequence > 110 then I know that all slides with a sequence > 110\n\t\t// are valid. I then remove those slides from the slides array and move down to the\n\t\t// next section.\n\t\tdeck.sections.models.reverse().forEach((section) => {\n\t\t\tconst sectionSlides = slides.filter(\n\t\t\t\t(slide) => slide.sequence > section.sequence,\n\t\t\t);\n\n\t\t\tsection.slides.add(sectionSlides);\n\n\t\t\t// Slides have a \"section\" on their model that represents the section\n\t\t\t// that they belong to. Because this is an impostor deck, there's a\n\t\t\t// good chance that the section is now incorrect for normal slides,\n\t\t\t// and a 100% chance that it's incorrect for adjunct slides as we\n\t\t\t// didn't populate the section field when we created the adjunct slides.\n\t\t\t// We update those now with the correct section.\n\t\t\tsection.slides.forEach((slide) => {\n\t\t\t\tslide.section = section.id;\n\t\t\t});\n\n\t\t\tslides = slides.filter((slide) => slide.sequence <= section.sequence);\n\t\t});\n\n\t\t// Average the adjunct slide limit used across the entire deck over each section\n\t\t// in the deck. We do this before we add the adjunct impostor sections, 'cause you\n\t\t// can't add custom slides to those.\n\t\tdeck.sections.forEach((section) => {\n\t\t\tsection.adjunctSlideLimit = section.adjunctSlideLimit\n\t\t\t\t? section.adjunctSlideLimit\n\t\t\t\t: Math.floor(realSection.adjunctSlideLimit / deck.sections.length);\n\t\t});\n\n\t\t// Return the sections to the correct order\n\t\tdeck.sections.models.reverse();\n\n\t\t// Finally, we add the adjunct impostor sections. These are adjunct slides with\n\t\t// the \"section-header\" tag and they work the same way as the slide impostors,\n\t\t// but because adjunct sections can't have slides we're adding them after the\n\t\t// slide-assigning process\n\t\toptions.adjunctSlides\n\t\t\t.filter((slide) => isImpostor(slide))\n\t\t\t.forEach((adjunctSlideModel) => {\n\t\t\t\tconst adjunctSection = PresentationSection.createFromAdjunctSection(\n\t\t\t\t\tadjunctSlideModel,\n\t\t\t\t\tDeckVersionModel,\n\t\t\t\t\toptions,\n\t\t\t\t);\n\n\t\t\t\tdeck.sections.add(adjunctSection);\n\t\t\t});\n\t}\n\n\t// Add templates as sections if present. This is only used by the CDK.\n\tif (options.templates && options.templates.length > 0) {\n\t\tdeck.sections.add(\n\t\t\toptions.templates.map((template, index) => {\n\t\t\t\treturn PresentationSection.createFromTemplate(\n\t\t\t\t\ttemplate,\n\t\t\t\t\tdeck.sections.length + index,\n\t\t\t\t\toptions.getUniqueAdjunctID(),\n\t\t\t\t);\n\t\t\t}),\n\t\t);\n\t}\n\n\t// This is generally only used by screenshots\n\tif (options.autoAdjuncts) {\n\t\tconst autoSections = options.autoAdjuncts.map((auto, index) => {\n\t\t\t// We already have the template on the deckversion, so we can find it here.\n\t\t\tif (!auto.template) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"Attempted to use an autoadjunct that has no template.\",\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst section = PresentationSection.createFromAutoAdjunct(auto, {\n\t\t\t\tindex: deck.sections.length + index,\n\t\t\t\tdeckversionID: deck.id,\n\t\t\t});\n\n\t\t\treturn section;\n\t\t});\n\n\t\tdeck.sections.add(autoSections);\n\t}\n\n\tsetSequentialSequences(deck);\n\n\treturn deck;\n};\n\nPresentationDeck.createFromManifestJSON = function (manifestJSON, project) {\n\tconst deck = new PresentationDeck({\n\t\tid: parseInt(_.uniqueId(), 10),\n\t\tindex: 0,\n\t\tvisible: true,\n\t\tkey: manifestJSON.key || \"manifest_deck\",\n\t\thtml: resolveURL(manifestJSON.getAssetPath(), \"index.html\"),\n\t\tcss: resolveURL(manifestJSON.getAssetPath(), \"slide.css\"),\n\t\tcommon: manifestJSON.common,\n\t\tthumbnail: null,\n\t\tdeckID: 1,\n\t\ttitle: \"Local\",\n\t\tversion: 1,\n\t\ttags: manifestJSON.tags[\"\"] || [],\n\t\tcmsvalkey_set: project?.welcome?.editables ?? [],\n\t});\n\n\tconst usesImpostorSections = _.some(\n\t\tmanifestJSON.tags,\n\t\t(tags) => tags.indexOf(\"section-header\") !== -1,\n\t);\n\tdeck.usesImpostorSections = usesImpostorSections;\n\n\tif (usesImpostorSections) {\n\t\tdeck.usesImpostorSections = true;\n\n\t\tlet items = Object.keys(manifestJSON.titles).map((key) => {\n\t\t\tconst sequence = manifestJSON.toJSON().ordering[key];\n\t\t\tconst splitKey = key.split(\"/\");\n\t\t\tconst newKey = splitKey[splitKey.length - 1];\n\n\t\t\treturn {\n\t\t\t\tkey: newKey,\n\t\t\t\tsequence,\n\t\t\t\thtml: resolveURL(manifestJSON.getAssetPath(key), \"index.html\"),\n\t\t\t\tcss: resolveURL(manifestJSON.getAssetPath(key), \"slide.css\"),\n\t\t\t\ttitle: manifestJSON.titles[key],\n\t\t\t\ttags: manifestJSON.tags[key] || [],\n\t\t\t\tcmsvalkey_set: [],\n\t\t\t};\n\t\t});\n\n\t\titems = _.sortBy(items, \"sequence\");\n\n\t\tconst sections = items.filter(\n\t\t\t(item) => item.tags.indexOf(\"section-header\") !== -1,\n\t\t);\n\n\t\tsections.forEach((item, index) => {\n\t\t\tconst startIndex = items.indexOf(item) + 1;\n\t\t\tconst endIndex = sections[index + 1]\n\t\t\t\t? items.indexOf(sections[index + 1])\n\t\t\t\t: items.length;\n\n\t\t\tconst slides = items.slice(startIndex, endIndex);\n\n\t\t\titem.slides = slides;\n\t\t});\n\n\t\tdeck.sections.add(\n\t\t\tsections.map((section, index) => {\n\t\t\t\treturn PresentationSection.createFromManifestImpostor(\n\t\t\t\t\tsection,\n\t\t\t\t\tproject,\n\t\t\t\t\tindex,\n\t\t\t\t);\n\t\t\t}),\n\t\t);\n\n\t\tdeck.realSection = PresentationSection.createFromManifestImpostor(\n\t\t\titems[0],\n\t\t\tproject,\n\t\t);\n\t} else {\n\t\tconst sectionKeys = Object.keys(manifestJSON.titles).filter((title) => {\n\t\t\treturn title.split(\"/\").length === 1;\n\t\t});\n\n\t\tdeck.sections.add(\n\t\t\tsectionKeys.map((key, index) => {\n\t\t\t\treturn PresentationSection.createFromManifestJSON(\n\t\t\t\t\tmanifestJSON,\n\t\t\t\t\tproject,\n\t\t\t\t\tkey,\n\t\t\t\t\tindex,\n\t\t\t\t);\n\t\t\t}),\n\t\t);\n\t}\n\n\tif (manifestJSON.templates) {\n\t\tconst templates = Object.keys(manifestJSON.templates).map((key) => {\n\t\t\tconst cmsvals =\n\t\t\t\tproject?.templates?.find?.((t) => t.key === key)?.editables ?? [];\n\n\t\t\treturn {\n\t\t\t\t...manifestJSON.templates[key],\n\t\t\t\tkey,\n\t\t\t\tsequence: manifestJSON.templates[key].ordering,\n\t\t\t\tindex_asset: {\n\t\t\t\t\turl: resolveURL(manifestJSON.getTemplateAssetPath(key), \"index.html\"),\n\t\t\t\t},\n\t\t\t\tcmsvalkey_set: cmsvals,\n\t\t\t};\n\t\t});\n\n\t\tconst minID = _.max(_.map(deck.sections.toJSON(), \"id\"));\n\n\t\tdeck.sections.add(\n\t\t\ttemplates.map((template, index) => {\n\t\t\t\tconst section = PresentationSection.createFromTemplate(\n\t\t\t\t\ttemplate,\n\t\t\t\t\tindex,\n\t\t\t\t\tminID,\n\t\t\t\t);\n\t\t\t\tconst projTemplate = project?.templates?.find?.(\n\t\t\t\t\t(s) => s.key === section.key.replace(\"template-\", \"\"),\n\t\t\t\t);\n\t\t\t\tif (projTemplate?.editables) {\n\t\t\t\t\tsection.cmsvalkey_set = projTemplate.editables.map((key) => {\n\t\t\t\t\t\treturn `${key}-autoadjunct-${section.autoAdjunctID}`;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn section;\n\t\t\t}),\n\t\t);\n\t}\n\n\treturn deck;\n};\n\nregister(\"PresentationDeck\", PresentationDeck);\n"],"mappings":";;;;;;;;;AAAAA,OAAA;AAEA,IAAAC,WAAA,GAAAC,uBAAA,CAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AAOA,IAAAI,sBAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,oBAAA,GAAAN,OAAA;AACA,IAAAO,kBAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAC,sB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AAsD,MAAA,CAAUtD,GAAG,mBAAAsD,MAAA,CAAgBe,OAAO,CAAC4E,aAAa;QACnD,CAAC,CAAC;MACH;MACA,OAAO5E,OAAO;IACf,CAAC,CACF,CAAC;EACF;EAEA,OAAOb,IAAI;AACZ,CAAC;AAED,IAAA0F,uBAAQ,EAAC,kBAAkB,EAAE/J,gBAAgB,CAAC","ignoreList":[]}
|
|
@@ -14,7 +14,7 @@ describe("#createFromManifestJSON", function () {
|
|
|
14
14
|
});
|
|
15
15
|
it("should add template sections to the end of a deck", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
16
16
|
var model, deck, lastSection;
|
|
17
|
-
return _regenerator.default.wrap(function
|
|
17
|
+
return _regenerator.default.wrap(function (_context) {
|
|
18
18
|
while (1) switch (_context.prev = _context.next) {
|
|
19
19
|
case 0:
|
|
20
20
|
(0, _api.G)(_manifestJson.ManifestJSONModel);
|
|
@@ -56,7 +56,7 @@ describe("#createFromManifestJSON", function () {
|
|
|
56
56
|
expect(lastSection.key).toEqual("template-orange");
|
|
57
57
|
expect(lastSection.html).toEqual("/api/templates/orange/index.html");
|
|
58
58
|
expect(lastSection.css).toEqual("/api/templates/orange/slide.css");
|
|
59
|
-
case
|
|
59
|
+
case 1:
|
|
60
60
|
case "end":
|
|
61
61
|
return _context.stop();
|
|
62
62
|
}
|
|
@@ -140,7 +140,7 @@ describe("#createFromDeckVersion", function () {
|
|
|
140
140
|
};
|
|
141
141
|
it("should not add template sections to the end of a deck", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
142
142
|
var model, deck;
|
|
143
|
-
return _regenerator.default.wrap(function
|
|
143
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
144
144
|
while (1) switch (_context2.prev = _context2.next) {
|
|
145
145
|
case 0:
|
|
146
146
|
(0, _api.G)(_deckVersion.DeckVersionModel);
|
|
@@ -149,7 +149,7 @@ describe("#createFromDeckVersion", function () {
|
|
|
149
149
|
expect(deck.sections.length).toEqual(3);
|
|
150
150
|
expect(deck.sections.at(0).title).toEqual("Section 1");
|
|
151
151
|
expect(deck.sections.at(deck.sections.length - 1).title).toEqual("Section 3");
|
|
152
|
-
case
|
|
152
|
+
case 1:
|
|
153
153
|
case "end":
|
|
154
154
|
return _context2.stop();
|
|
155
155
|
}
|
|
@@ -157,7 +157,7 @@ describe("#createFromDeckVersion", function () {
|
|
|
157
157
|
})));
|
|
158
158
|
it("should add template sections to the end of a deck", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
159
159
|
var model, deck, lastSection;
|
|
160
|
-
return _regenerator.default.wrap(function
|
|
160
|
+
return _regenerator.default.wrap(function (_context3) {
|
|
161
161
|
while (1) switch (_context3.prev = _context3.next) {
|
|
162
162
|
case 0:
|
|
163
163
|
(0, _api.G)(_deckVersion.DeckVersionModel);
|
|
@@ -173,7 +173,7 @@ describe("#createFromDeckVersion", function () {
|
|
|
173
173
|
expect(lastSection.key).toEqual("template-orange");
|
|
174
174
|
expect(lastSection.html).toEqual("http://path/to/template/orange/index.html");
|
|
175
175
|
expect(lastSection.css).toEqual("http://path/to/template/orange/slide.css");
|
|
176
|
-
case
|
|
176
|
+
case 1:
|
|
177
177
|
case "end":
|
|
178
178
|
return _context3.stop();
|
|
179
179
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation-deck.spec.js","names":["_deckVersion","require","_deckVersionScreenshots","_api","_manifestJson","_presentationDeck","describe","beforeEach","jest","spyOn","ManifestJSONModel","prototype","mockReturnValue","it","_asyncToGenerator2","default","_regenerator","mark","_callee","model","deck","lastSection","wrap","_callee$","_context","prev","next","G","titles","section_1","section_2","section_3","ordering","templates","apple","title","orange","tags","PresentationDeck","createFromManifestJSON","expect","sections","length","toEqual","at","key","html","css","stop","deckVersionJSON","image_256","template_set","id","sequence","index_asset","url","section_set","deckversion","slide_set","subslide_set","section","_callee2","_callee2$","_context2","DeckVersionModel","createFromDeckVersion","_callee3","_callee3$","_context3","presentationDeck","thumbnail","options","screenshots","DeckVersionScreenshotCollection","subject","first","slide","presentationSection","presentationSlide","slides"],"sources":["../../src/presentation/presentation-deck.spec.js"],"sourcesContent":["import { DeckVersionModel } from \"../models/deck-version\";\nimport { DeckVersionScreenshotCollection } from \"../collections/deck-version-screenshots.js\";\nimport { G } from \"sp-test/api\";\nimport { ManifestJSONModel } from \"../models/manifest-json\";\nimport { PresentationDeck } from \"./presentation-deck\";\n\ndescribe(\"#createFromManifestJSON\", () => {\n\tbeforeEach(() => {\n\t\tjest\n\t\t\t.spyOn(ManifestJSONModel.prototype, \"getAssetPath\")\n\t\t\t.mockReturnValue(\"/api/\");\n\t});\n\n\tit(\"should add template sections to the end of a deck\", async () => {\n\t\tG(ManifestJSONModel);\n\t\tconst model = new ManifestJSONModel({\n\t\t\ttitles: {\n\t\t\t\tsection_1: \"Section 1\",\n\t\t\t\t\"section_1/slide_1\": \"Section 1 Slide 1\",\n\t\t\t\tsection_2: \"Section 2\",\n\t\t\t\t\"section_2/slide_1\": \"Section 2 Slide 1\",\n\t\t\t\t\"section_2/slide_2\": \"Section 2 Slide 2\",\n\t\t\t\tsection_3: \"Section 3\",\n\t\t\t},\n\t\t\tordering: {\n\t\t\t\tsection_1: 1,\n\t\t\t\t\"section_1/slide_1\": 1,\n\t\t\t\tsection_2: 2,\n\t\t\t\t\"section_2/slide_1\": 1,\n\t\t\t\t\"section_2/slide_2\": 2,\n\t\t\t\tsection_3: 3,\n\t\t\t},\n\t\t\ttemplates: {\n\t\t\t\tapple: {\n\t\t\t\t\ttitle: \"Apple\",\n\t\t\t\t\tordering: 1,\n\t\t\t\t},\n\t\t\t\torange: {\n\t\t\t\t\ttitle: \"Orange\",\n\t\t\t\t\tordering: 2,\n\t\t\t\t},\n\t\t\t},\n\t\t\ttags: {},\n\t\t});\n\n\t\tconst deck = PresentationDeck.createFromManifestJSON(model);\n\t\texpect(deck.sections.length).toEqual(5);\n\t\texpect(deck.sections.at(0).title).toEqual(\"Section 1\");\n\t\texpect(deck.sections.at(3).title).toEqual(\"Apple\");\n\n\t\tconst lastSection = deck.sections.at(deck.sections.length - 1);\n\t\texpect(lastSection.title).toEqual(\"Orange\");\n\t\texpect(lastSection.key).toEqual(\"template-orange\");\n\t\texpect(lastSection.html).toEqual(\"/api/templates/orange/index.html\");\n\t\texpect(lastSection.css).toEqual(\"/api/templates/orange/slide.css\");\n\t});\n});\n\ndescribe(\"#createFromDeckVersion\", () => {\n\tconst deckVersionJSON = {\n\t\timage_256: \"http://path/to/deck/thumbnail.png\",\n\t\ttemplate_set: [\n\t\t\t{\n\t\t\t\tid: 20,\n\t\t\t\ttitle: \"Apple\",\n\t\t\t\tkey: \"apple\",\n\t\t\t\tsequence: 1,\n\t\t\t\tindex_asset: {\n\t\t\t\t\turl: \"http://path/to/template/apple/index.html\",\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 21,\n\t\t\t\ttitle: \"Orange\",\n\t\t\t\tkey: \"orange\",\n\t\t\t\tsequence: 2,\n\t\t\t\tindex_asset: {\n\t\t\t\t\turl: \"http://path/to/template/orange/index.html\",\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t\tindex_asset: {\n\t\t\turl: \"http://path/to/index.html\",\n\t\t},\n\t\tdeck: {\n\t\t\tid: 1,\n\t\t},\n\t\tsection_set: [\n\t\t\t{\n\t\t\t\tid: 1,\n\t\t\t\ttitle: \"Section 1\",\n\t\t\t\timage_256: \"default_section.png\",\n\t\t\t\tindex_asset: {\n\t\t\t\t\turl: \"http://path/to/index.html\",\n\t\t\t\t},\n\t\t\t\tdeckversion: { id: 1 },\n\t\t\t\tsequence: 1,\n\t\t\t\tslide_set: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 1,\n\t\t\t\t\t\ttitle: \"Slide 1\",\n\t\t\t\t\t\tindex_asset: {\n\t\t\t\t\t\t\turl: \"http://path/to/index.html\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\timage_256: \"default_slide.png\",\n\t\t\t\t\t\tsubslide_set: [],\n\t\t\t\t\t\tsection: { id: 1 },\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 2,\n\t\t\t\ttitle: \"Section 2\",\n\t\t\t\timage_256: \"default_section.png\",\n\t\t\t\tindex_asset: {\n\t\t\t\t\turl: \"http://path/to/index.html\",\n\t\t\t\t},\n\t\t\t\tdeckversion: { id: 1 },\n\t\t\t\tsequence: 2,\n\t\t\t\tslide_set: [],\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 3,\n\t\t\t\ttitle: \"Section 3\",\n\t\t\t\timage_256: \"default_section.png\",\n\t\t\t\tindex_asset: {\n\t\t\t\t\turl: \"http://path/to/index.html\",\n\t\t\t\t},\n\t\t\t\tdeckversion: { id: 1 },\n\t\t\t\tsequence: 3,\n\t\t\t\tslide_set: [],\n\t\t\t},\n\t\t],\n\t};\n\n\tit(\"should not add template sections to the end of a deck\", async () => {\n\t\tG(DeckVersionModel);\n\t\tconst model = new DeckVersionModel(deckVersionJSON);\n\t\tconst deck = PresentationDeck.createFromDeckVersion(model);\n\n\t\texpect(deck.sections.length).toEqual(3);\n\t\texpect(deck.sections.at(0).title).toEqual(\"Section 1\");\n\t\texpect(deck.sections.at(deck.sections.length - 1).title).toEqual(\n\t\t\t\"Section 3\",\n\t\t);\n\t});\n\n\tit(\"should add template sections to the end of a deck\", async () => {\n\t\tG(DeckVersionModel);\n\t\tconst model = new DeckVersionModel(deckVersionJSON);\n\t\tconst deck = PresentationDeck.createFromDeckVersion(model, {\n\t\t\ttemplates: model.template_set,\n\t\t});\n\n\t\texpect(deck.sections.length).toEqual(5);\n\t\texpect(deck.sections.at(0).title).toEqual(\"Section 1\");\n\t\texpect(deck.sections.at(3).title).toEqual(\"Apple\");\n\n\t\tconst lastSection = deck.sections.at(deck.sections.length - 1);\n\t\texpect(lastSection.title).toEqual(\"Orange\");\n\t\texpect(lastSection.key).toEqual(\"template-orange\");\n\t\texpect(lastSection.html).toEqual(\n\t\t\t\"http://path/to/template/orange/index.html\",\n\t\t);\n\t\texpect(lastSection.css).toEqual(\"http://path/to/template/orange/slide.css\");\n\t});\n\n\tdescribe(\"Screenshots\", () => {\n\t\tit(\"should use the default image from the slide if no screenshot found\", () => {\n\t\t\tconst deck = new DeckVersionModel(deckVersionJSON);\n\t\t\tconst presentationDeck = PresentationDeck.createFromDeckVersion(deck);\n\t\t\texpect(presentationDeck.thumbnail).toEqual(deckVersionJSON.image_256);\n\t\t});\n\n\t\tit(\"should use the screenshot model if it matches\", () => {\n\t\t\tconst deck = new DeckVersionModel(deckVersionJSON);\n\t\t\tconst options = {\n\t\t\t\tscreenshots: new DeckVersionScreenshotCollection([\n\t\t\t\t\t{ subject: deck.url(), image_256: \"test-screenshot.png\" },\n\t\t\t\t]),\n\t\t\t};\n\n\t\t\tconst presentationDeck = PresentationDeck.createFromDeckVersion(\n\t\t\t\tdeck,\n\t\t\t\toptions,\n\t\t\t);\n\t\t\texpect(presentationDeck.thumbnail).toEqual(\"test-screenshot.png\");\n\t\t});\n\n\t\tit(\"should pass screenshots to nested models\", () => {\n\t\t\tconst deck = new DeckVersionModel(deckVersionJSON);\n\t\t\tconst section = deck.section_set.first();\n\t\t\tconst slide = section.slide_set.first();\n\n\t\t\tconst options = {\n\t\t\t\tscreenshots: new DeckVersionScreenshotCollection([\n\t\t\t\t\t{ subject: deck.url(), image_256: \"test-screenshot.png\" },\n\t\t\t\t\t{ subject: section.url(), image_256: \"test-screenshot.png\" },\n\t\t\t\t\t{ subject: slide.url(), image_256: \"test-screenshot.png\" },\n\t\t\t\t]),\n\t\t\t};\n\n\t\t\tconst presentationDeck = PresentationDeck.createFromDeckVersion(\n\t\t\t\tdeck,\n\t\t\t\toptions,\n\t\t\t);\n\t\t\tconst presentationSection = presentationDeck.sections.first();\n\t\t\tconst presentationSlide = presentationSection.slides.first();\n\n\t\t\texpect(presentationSection.thumbnail).toEqual(\"test-screenshot.png\");\n\t\t\texpect(presentationSlide.thumbnail).toEqual(\"test-screenshot.png\");\n\t\t});\n\t});\n});\n"],"mappings":";;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,uBAAA,GAAAD,OAAA;AACA,IAAAE,IAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AAEAK,QAAQ,CAAC,yBAAyB,EAAE,YAAM;EACzCC,UAAU,CAAC,YAAM;IAChBC,IAAI,CACFC,KAAK,CAACC,+BAAiB,CAACC,SAAS,EAAE,cAAc,CAAC,CAClDC,eAAe,CAAC,OAAO,CAAC;EAC3B,CAAC,CAAC;EAEFC,EAAE,CAAC,mDAAmD,mBAAAC,kBAAA,CAAAC,OAAA,eAAAC,YAAA,CAAAD,OAAA,CAAAE,IAAA,CAAE,SAAAC,QAAA;IAAA,IAAAC,KAAA,EAAAC,IAAA,EAAAC,WAAA;IAAA,OAAAL,YAAA,CAAAD,OAAA,CAAAO,IAAA,UAAAC,SAAAC,QAAA;MAAA,kBAAAA,QAAA,CAAAC,IAAA,GAAAD,QAAA,CAAAE,IAAA;QAAA;UACvD,IAAAC,MAAC,EAACjB,+BAAiB,CAAC;UACdS,KAAK,GAAG,IAAIT,+BAAiB,CAAC;YACnCkB,MAAM,EAAE;cACPC,SAAS,EAAE,WAAW;cACtB,mBAAmB,EAAE,mBAAmB;cACxCC,SAAS,EAAE,WAAW;cACtB,mBAAmB,EAAE,mBAAmB;cACxC,mBAAmB,EAAE,mBAAmB;cACxCC,SAAS,EAAE;YACZ,CAAC;YACDC,QAAQ,EAAE;cACTH,SAAS,EAAE,CAAC;cACZ,mBAAmB,EAAE,CAAC;cACtBC,SAAS,EAAE,CAAC;cACZ,mBAAmB,EAAE,CAAC;cACtB,mBAAmB,EAAE,CAAC;cACtBC,SAAS,EAAE;YACZ,CA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AAG,CAAC,CAAC;UAAEL,SAAS,EAAE;QAAsB,CAAC,EAC5D;UAAEwB,OAAO,EAAEE,KAAK,CAACrB,GAAG,CAAC,CAAC;UAAEL,SAAS,EAAE;QAAsB,CAAC,CAC1D;MACF,CAAC;MAED,IAAMmB,gBAAgB,GAAG/B,kCAAgB,CAAC2B,qBAAqB,CAC9D7C,IAAI,EACJmD,OACD,CAAC;MACD,IAAMM,mBAAmB,GAAGR,gBAAgB,CAAC5B,QAAQ,CAACkC,KAAK,CAAC,CAAC;MAC7D,IAAMG,iBAAiB,GAAGD,mBAAmB,CAACE,MAAM,CAACJ,KAAK,CAAC,CAAC;MAE5DnC,MAAM,CAACqC,mBAAmB,CAACP,SAAS,CAAC,CAAC3B,OAAO,CAAC,qBAAqB,CAAC;MACpEH,MAAM,CAACsC,iBAAiB,CAACR,SAAS,CAAC,CAAC3B,OAAO,CAAC,qBAAqB,CAAC;IACnE,CAAC,CAAC;EACH,CAAC,CAAC;AACH,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"presentation-deck.spec.js","names":["_deckVersion","require","_deckVersionScreenshots","_api","_manifestJson","_presentationDeck","describe","beforeEach","jest","spyOn","ManifestJSONModel","prototype","mockReturnValue","it","_asyncToGenerator2","default","_regenerator","mark","_callee","model","deck","lastSection","wrap","_context","prev","next","G","titles","section_1","section_2","section_3","ordering","templates","apple","title","orange","tags","PresentationDeck","createFromManifestJSON","expect","sections","length","toEqual","at","key","html","css","stop","deckVersionJSON","image_256","template_set","id","sequence","index_asset","url","section_set","deckversion","slide_set","subslide_set","section","_callee2","_context2","DeckVersionModel","createFromDeckVersion","_callee3","_context3","presentationDeck","thumbnail","options","screenshots","DeckVersionScreenshotCollection","subject","first","slide","presentationSection","presentationSlide","slides"],"sources":["../../src/presentation/presentation-deck.spec.js"],"sourcesContent":["import { DeckVersionModel } from \"../models/deck-version\";\nimport { DeckVersionScreenshotCollection } from \"../collections/deck-version-screenshots.js\";\nimport { G } from \"sp-test/api\";\nimport { ManifestJSONModel } from \"../models/manifest-json\";\nimport { PresentationDeck } from \"./presentation-deck\";\n\ndescribe(\"#createFromManifestJSON\", () => {\n\tbeforeEach(() => {\n\t\tjest\n\t\t\t.spyOn(ManifestJSONModel.prototype, \"getAssetPath\")\n\t\t\t.mockReturnValue(\"/api/\");\n\t});\n\n\tit(\"should add template sections to the end of a deck\", async () => {\n\t\tG(ManifestJSONModel);\n\t\tconst model = new ManifestJSONModel({\n\t\t\ttitles: {\n\t\t\t\tsection_1: \"Section 1\",\n\t\t\t\t\"section_1/slide_1\": \"Section 1 Slide 1\",\n\t\t\t\tsection_2: \"Section 2\",\n\t\t\t\t\"section_2/slide_1\": \"Section 2 Slide 1\",\n\t\t\t\t\"section_2/slide_2\": \"Section 2 Slide 2\",\n\t\t\t\tsection_3: \"Section 3\",\n\t\t\t},\n\t\t\tordering: {\n\t\t\t\tsection_1: 1,\n\t\t\t\t\"section_1/slide_1\": 1,\n\t\t\t\tsection_2: 2,\n\t\t\t\t\"section_2/slide_1\": 1,\n\t\t\t\t\"section_2/slide_2\": 2,\n\t\t\t\tsection_3: 3,\n\t\t\t},\n\t\t\ttemplates: {\n\t\t\t\tapple: {\n\t\t\t\t\ttitle: \"Apple\",\n\t\t\t\t\tordering: 1,\n\t\t\t\t},\n\t\t\t\torange: {\n\t\t\t\t\ttitle: \"Orange\",\n\t\t\t\t\tordering: 2,\n\t\t\t\t},\n\t\t\t},\n\t\t\ttags: {},\n\t\t});\n\n\t\tconst deck = PresentationDeck.createFromManifestJSON(model);\n\t\texpect(deck.sections.length).toEqual(5);\n\t\texpect(deck.sections.at(0).title).toEqual(\"Section 1\");\n\t\texpect(deck.sections.at(3).title).toEqual(\"Apple\");\n\n\t\tconst lastSection = deck.sections.at(deck.sections.length - 1);\n\t\texpect(lastSection.title).toEqual(\"Orange\");\n\t\texpect(lastSection.key).toEqual(\"template-orange\");\n\t\texpect(lastSection.html).toEqual(\"/api/templates/orange/index.html\");\n\t\texpect(lastSection.css).toEqual(\"/api/templates/orange/slide.css\");\n\t});\n});\n\ndescribe(\"#createFromDeckVersion\", () => {\n\tconst deckVersionJSON = {\n\t\timage_256: \"http://path/to/deck/thumbnail.png\",\n\t\ttemplate_set: [\n\t\t\t{\n\t\t\t\tid: 20,\n\t\t\t\ttitle: \"Apple\",\n\t\t\t\tkey: \"apple\",\n\t\t\t\tsequence: 1,\n\t\t\t\tindex_asset: {\n\t\t\t\t\turl: \"http://path/to/template/apple/index.html\",\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 21,\n\t\t\t\ttitle: \"Orange\",\n\t\t\t\tkey: \"orange\",\n\t\t\t\tsequence: 2,\n\t\t\t\tindex_asset: {\n\t\t\t\t\turl: \"http://path/to/template/orange/index.html\",\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t\tindex_asset: {\n\t\t\turl: \"http://path/to/index.html\",\n\t\t},\n\t\tdeck: {\n\t\t\tid: 1,\n\t\t},\n\t\tsection_set: [\n\t\t\t{\n\t\t\t\tid: 1,\n\t\t\t\ttitle: \"Section 1\",\n\t\t\t\timage_256: \"default_section.png\",\n\t\t\t\tindex_asset: {\n\t\t\t\t\turl: \"http://path/to/index.html\",\n\t\t\t\t},\n\t\t\t\tdeckversion: { id: 1 },\n\t\t\t\tsequence: 1,\n\t\t\t\tslide_set: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 1,\n\t\t\t\t\t\ttitle: \"Slide 1\",\n\t\t\t\t\t\tindex_asset: {\n\t\t\t\t\t\t\turl: \"http://path/to/index.html\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\timage_256: \"default_slide.png\",\n\t\t\t\t\t\tsubslide_set: [],\n\t\t\t\t\t\tsection: { id: 1 },\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 2,\n\t\t\t\ttitle: \"Section 2\",\n\t\t\t\timage_256: \"default_section.png\",\n\t\t\t\tindex_asset: {\n\t\t\t\t\turl: \"http://path/to/index.html\",\n\t\t\t\t},\n\t\t\t\tdeckversion: { id: 1 },\n\t\t\t\tsequence: 2,\n\t\t\t\tslide_set: [],\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 3,\n\t\t\t\ttitle: \"Section 3\",\n\t\t\t\timage_256: \"default_section.png\",\n\t\t\t\tindex_asset: {\n\t\t\t\t\turl: \"http://path/to/index.html\",\n\t\t\t\t},\n\t\t\t\tdeckversion: { id: 1 },\n\t\t\t\tsequence: 3,\n\t\t\t\tslide_set: [],\n\t\t\t},\n\t\t],\n\t};\n\n\tit(\"should not add template sections to the end of a deck\", async () => {\n\t\tG(DeckVersionModel);\n\t\tconst model = new DeckVersionModel(deckVersionJSON);\n\t\tconst deck = PresentationDeck.createFromDeckVersion(model);\n\n\t\texpect(deck.sections.length).toEqual(3);\n\t\texpect(deck.sections.at(0).title).toEqual(\"Section 1\");\n\t\texpect(deck.sections.at(deck.sections.length - 1).title).toEqual(\n\t\t\t\"Section 3\",\n\t\t);\n\t});\n\n\tit(\"should add template sections to the end of a deck\", async () => {\n\t\tG(DeckVersionModel);\n\t\tconst model = new DeckVersionModel(deckVersionJSON);\n\t\tconst deck = PresentationDeck.createFromDeckVersion(model, {\n\t\t\ttemplates: model.template_set,\n\t\t});\n\n\t\texpect(deck.sections.length).toEqual(5);\n\t\texpect(deck.sections.at(0).title).toEqual(\"Section 1\");\n\t\texpect(deck.sections.at(3).title).toEqual(\"Apple\");\n\n\t\tconst lastSection = deck.sections.at(deck.sections.length - 1);\n\t\texpect(lastSection.title).toEqual(\"Orange\");\n\t\texpect(lastSection.key).toEqual(\"template-orange\");\n\t\texpect(lastSection.html).toEqual(\n\t\t\t\"http://path/to/template/orange/index.html\",\n\t\t);\n\t\texpect(lastSection.css).toEqual(\"http://path/to/template/orange/slide.css\");\n\t});\n\n\tdescribe(\"Screenshots\", () => {\n\t\tit(\"should use the default image from the slide if no screenshot found\", () => {\n\t\t\tconst deck = new DeckVersionModel(deckVersionJSON);\n\t\t\tconst presentationDeck = PresentationDeck.createFromDeckVersion(deck);\n\t\t\texpect(presentationDeck.thumbnail).toEqual(deckVersionJSON.image_256);\n\t\t});\n\n\t\tit(\"should use the screenshot model if it matches\", () => {\n\t\t\tconst deck = new DeckVersionModel(deckVersionJSON);\n\t\t\tconst options = {\n\t\t\t\tscreenshots: new DeckVersionScreenshotCollection([\n\t\t\t\t\t{ subject: deck.url(), image_256: \"test-screenshot.png\" },\n\t\t\t\t]),\n\t\t\t};\n\n\t\t\tconst presentationDeck = PresentationDeck.createFromDeckVersion(\n\t\t\t\tdeck,\n\t\t\t\toptions,\n\t\t\t);\n\t\t\texpect(presentationDeck.thumbnail).toEqual(\"test-screenshot.png\");\n\t\t});\n\n\t\tit(\"should pass screenshots to nested models\", () => {\n\t\t\tconst deck = new DeckVersionModel(deckVersionJSON);\n\t\t\tconst section = deck.section_set.first();\n\t\t\tconst slide = section.slide_set.first();\n\n\t\t\tconst options = {\n\t\t\t\tscreenshots: new DeckVersionScreenshotCollection([\n\t\t\t\t\t{ subject: deck.url(), image_256: \"test-screenshot.png\" },\n\t\t\t\t\t{ subject: section.url(), image_256: \"test-screenshot.png\" },\n\t\t\t\t\t{ subject: slide.url(), image_256: \"test-screenshot.png\" },\n\t\t\t\t]),\n\t\t\t};\n\n\t\t\tconst presentationDeck = PresentationDeck.createFromDeckVersion(\n\t\t\t\tdeck,\n\t\t\t\toptions,\n\t\t\t);\n\t\t\tconst presentationSection = presentationDeck.sections.first();\n\t\t\tconst presentationSlide = presentationSection.slides.first();\n\n\t\t\texpect(presentationSection.thumbnail).toEqual(\"test-screenshot.png\");\n\t\t\texpect(presentationSlide.thumbnail).toEqual(\"test-screenshot.png\");\n\t\t});\n\t});\n});\n"],"mappings":";;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,uBAAA,GAAAD,OAAA;AACA,IAAAE,IAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAA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AK,CAAC,CAAC;MAC7D,IAAMG,iBAAiB,GAAGD,mBAAmB,CAACE,MAAM,CAACJ,KAAK,CAAC,CAAC;MAE5DjC,MAAM,CAACmC,mBAAmB,CAACP,SAAS,CAAC,CAACzB,OAAO,CAAC,qBAAqB,CAAC;MACpEH,MAAM,CAACoC,iBAAiB,CAACR,SAAS,CAAC,CAACzB,OAAO,CAAC,qBAAqB,CAAC;IACnE,CAAC,CAAC;EACH,CAAC,CAAC;AACH,CAAC,CAAC","ignoreList":[]}
|
|
@@ -16,9 +16,8 @@ var _presentationSlide = require("./presentation-slide.js");
|
|
|
16
16
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
17
17
|
var _index = require("../index.js");
|
|
18
18
|
var _stateRegister = require("../state-register.js");
|
|
19
|
-
var
|
|
20
|
-
function
|
|
21
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
|
+
var _utils = require("../utils.js");
|
|
20
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
22
21
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
23
22
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
24
23
|
/**
|
|
@@ -103,11 +102,19 @@ var PresentationSection = exports.PresentationSection = _basePresentationModel.B
|
|
|
103
102
|
tagsEditable: "boolean",
|
|
104
103
|
tags: "array",
|
|
105
104
|
impostor: "boolean",
|
|
105
|
+
cmsvalkey_set: "array",
|
|
106
106
|
isWelcome: {
|
|
107
107
|
type: "boolean",
|
|
108
108
|
default: false
|
|
109
109
|
},
|
|
110
|
-
|
|
110
|
+
isSlide: {
|
|
111
|
+
type: "boolean",
|
|
112
|
+
default: false
|
|
113
|
+
},
|
|
114
|
+
isSection: {
|
|
115
|
+
type: "boolean",
|
|
116
|
+
default: true
|
|
117
|
+
}
|
|
111
118
|
},
|
|
112
119
|
/**
|
|
113
120
|
* @property {models.AdjunctModel} adjunct
|
|
@@ -372,8 +379,8 @@ PresentationSection.createFromManifestJSON = function (manifestJSON, project, se
|
|
|
372
379
|
id: parseInt(_lodash.default.uniqueId(), 10),
|
|
373
380
|
index: index,
|
|
374
381
|
title: manifestJSON.titles[sectionKey],
|
|
375
|
-
html:
|
|
376
|
-
css:
|
|
382
|
+
html: (0, _utils.resolveURL)(manifestJSON.getAssetPath(sectionKey), "index.html"),
|
|
383
|
+
css: (0, _utils.resolveURL)(manifestJSON.getAssetPath(sectionKey), "slide.css"),
|
|
377
384
|
key: sectionKey,
|
|
378
385
|
sequence: manifestJSON.ordering[sectionKey] - 1,
|
|
379
386
|
thumbnail: null,
|
|
@@ -395,7 +402,9 @@ PresentationSection.createFromManifestImpostor = function (section, project, ind
|
|
|
395
402
|
var _projectSection$edita2;
|
|
396
403
|
var slides = section.slides || [];
|
|
397
404
|
section.slides = null;
|
|
398
|
-
|
|
405
|
+
|
|
406
|
+
// Single section with slides
|
|
407
|
+
var projectSection = project === null || project === void 0 ? void 0 : project.sections[0].slides.find(function (s) {
|
|
399
408
|
return s.key === section.key;
|
|
400
409
|
});
|
|
401
410
|
var presentationSection = new PresentationSection(_objectSpread(_objectSpread({
|
|
@@ -491,17 +500,31 @@ PresentationSection.createFromAutoAdjunct = function (model) {
|
|
|
491
500
|
};
|
|
492
501
|
PresentationSection.createFromTemplate = function (template, index) {
|
|
493
502
|
var minID = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
503
|
+
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
494
504
|
var templateModel = new _models.TemplateModel(template);
|
|
505
|
+
_lodash.default.defaults(options, {
|
|
506
|
+
rootAssetPath: null
|
|
507
|
+
});
|
|
495
508
|
var deckversion = new _models.DeckVersionModel(templateModel.deckversion);
|
|
496
|
-
var
|
|
509
|
+
var html;
|
|
510
|
+
var css;
|
|
511
|
+
if (options.rootAssetPath) {
|
|
512
|
+
var origPath = templateModel.index_asset.orig_path;
|
|
513
|
+
html = "".concat(options.rootAssetPath).concat(origPath, "/index.html");
|
|
514
|
+
css = "".concat(options.rootAssetPath).concat(origPath, "/slide.css");
|
|
515
|
+
} else {
|
|
516
|
+
var templateAssetRoot = (0, _index.getAssetRoot)(templateModel.index_asset.url());
|
|
517
|
+
html = "".concat(templateAssetRoot, "index.html");
|
|
518
|
+
css = "".concat(templateAssetRoot, "slide.css");
|
|
519
|
+
}
|
|
497
520
|
var presentationSection = new PresentationSection({
|
|
498
521
|
id: minID + parseInt(_lodash.default.uniqueId(), 10),
|
|
499
522
|
templateID: templateModel.id,
|
|
500
523
|
template: templateModel,
|
|
501
524
|
key: "template-".concat(templateModel.key),
|
|
502
525
|
title: templateModel.title,
|
|
503
|
-
html:
|
|
504
|
-
css:
|
|
526
|
+
html: html,
|
|
527
|
+
css: css,
|
|
505
528
|
custom: false,
|
|
506
529
|
visible: true,
|
|
507
530
|
thumbnail: templateModel.image_256,
|