UNPKG

@omnia/fx-models

Version:
41 lines (40 loc) 2.01 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MediaPickerCentralImageLocationProvider = void 0; const ManifestIds_1 = require("../../ManifestIds"); const Enums_1 = require("../../Enums"); const Icon_1 = require("../../Icon"); // TODO: Rename to MediaPickerCentralMediaLocationProvider (7.0) class MediaPickerCentralImageLocationProvider { constructor(imageLocationSettings, providerName) { this.hasEditorForMedia = (media) => { const centralMedia = media; let result = false; if (media && (centralMedia.libraryId && centralMedia.graphDriveId && centralMedia.graphDriveItemId || centralMedia.videoUrl)) { result = centralMedia.libraryId == this.imageLocationSettings.libraryId; } return result; }; this.id = imageLocationSettings.libraryId; this.category = "image"; this.name = providerName; this.icon = !!imageLocationSettings.icon ? new Icon_1.FontAwesomeIcon(imageLocationSettings.icon) : new Icon_1.FontAwesomeIcon("fas fa-image"); //this.providerElementName = "omfx-media-picker-central-image-location-provider"; this.providerComponentId = !!imageLocationSettings.providerComponentId ? imageLocationSettings.providerComponentId : ManifestIds_1.OmniaWebComponentManifests.FxUxCentralImageLocationProvider; this.sortOrder = imageLocationSettings.sortOrder ?? 20; /** * Added support videos type (since 6.11) */ this.selectableMediaTypes = imageLocationSettings.selectableMediaTypes ?? [Enums_1.MediaPickerEnums.OmniaMediaTypes.Image, Enums_1.MediaPickerEnums.OmniaMediaTypes.Video]; this.imageLocationSettings = imageLocationSettings; this.supportGalleryFeature = true; } } exports.MediaPickerCentralImageLocationProvider = MediaPickerCentralImageLocationProvider;