diff --git a/plugins/ValkyrSceneCards/ValkyrSceneCards.css b/plugins/ValkyrSceneCards/ValkyrSceneCards.css index d32a417..729ceec 100644 --- a/plugins/ValkyrSceneCards/ValkyrSceneCards.css +++ b/plugins/ValkyrSceneCards/ValkyrSceneCards.css @@ -10,9 +10,6 @@ -webkit-line-clamp: 3; -webkit-box-orient: vertical; } -.vsc-card-description__title-link { - display: inline-block; -} .vsc-card-description__small-bar { display: flex; align-items: start; @@ -110,6 +107,19 @@ .vsc-performer-list__performer-hover { padding: 5px; } + +.vsc-performer-list__gender-color--male { + color: #89cff0 !important; +} +.vsc-performer-list__gender-color--female { + color: #f38cac !important; +} +.vsc-performer-list__gender-color--transgender_male, .vsc-performer-list__gender-color--transgender_female, .vsc-performer-list__gender-color--intersex, .vsc-performer-list__gender-color--non_binary { + color: #c8a2c8 !important; +} +.vsc-performer-list__gender-color--unknown { + color: white !important; +} /*!**********************************************************************************************************!*\ !*** css ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/styles.scss ***! \**********************************************************************************************************/ diff --git a/plugins/ValkyrSceneCards/ValkyrSceneCards.js b/plugins/ValkyrSceneCards/ValkyrSceneCards.js index ab8707b..73182c4 100644 --- a/plugins/ValkyrSceneCards/ValkyrSceneCards.js +++ b/plugins/ValkyrSceneCards/ValkyrSceneCards.js @@ -49,7 +49,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extr /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; -eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n__webpack_require__(/*! ./CardDescription.scss */ \"./src/components/CardDescription/CardDescription.scss\");\nconst helpers_1 = __webpack_require__(/*! ../../helpers */ \"./src/helpers/index.ts\");\nconst PerformerList_1 = __importDefault(__webpack_require__(/*! ../PerformerList/PerformerList */ \"./src/components/PerformerList/PerformerList.tsx\"));\nconst { React } = window.PluginApi;\nconst { HoverPopover, Icon } = window.PluginApi.components;\nconst { faBox, faStar } = window.PluginApi.libraries.FontAwesomeSolid;\nconst CardDescription = (props) => {\n var _a, _b;\n const link = `/scenes/${props.scene.id}`;\n const file = props.scene.files[0];\n const duration = helpers_1.TextUtils.secondsToTimestamp(file.duration);\n const resolution = helpers_1.TextUtils.resolution(file.width, file.height);\n let shortRes = \"\";\n const rating = +((_a = props.scene.rating100) !== null && _a !== void 0 ? _a : 0) > 0 ? (React.createElement(\"span\", { className: \"vsc-card-description__rating\" },\n (props.scene.rating100 || 0) / 10,\n React.createElement(Icon, { icon: faStar }))) : null;\n const organized = props.scene.organized ? (React.createElement(\"span\", { className: \"vsc-card-description__organized\" },\n React.createElement(Icon, { icon: faBox }))) : null;\n switch (resolution) {\n case \"144p\":\n case \"240p\":\n case \"360p\":\n case \"480p\":\n case \"540p\":\n shortRes = \"SD\";\n break;\n case \"720p\":\n case \"1080p\":\n shortRes = \"HD\";\n break;\n case \"1440p\":\n shortRes = \"2K\";\n break;\n default:\n shortRes = resolution || null;\n break;\n }\n return (React.createElement(\"div\", { className: \"scene-card__details\" },\n React.createElement(\"div\", { className: \"vsc-card-description__small-bar\" },\n React.createElement(\"span\", { className: \"vsc-card-description__studio\" }, (_b = props.scene.studio) === null || _b === void 0 ? void 0 : _b.name),\n React.createElement(\"div\", { className: \"vsc-card-description__file-data\" },\n React.createElement(\"span\", { className: \"vsc-card-description__duration\" }, duration),\n shortRes ? (React.createElement(HoverPopover, { className: \"vsc-card-description__resolution\", content: React.createElement(\"span\", { className: \"vsc-card-description__resolution-hover\" }, resolution), leaveDelay: 100, placement: \"top\" }, shortRes)) : null,\n organized)),\n React.createElement(\"a\", { href: link },\n React.createElement(\"h5\", { className: \"card-section-title flex-aligned\" }, props.scene.title)),\n React.createElement(\"div\", { className: \"scene-card__description vsc-card-description__details\" },\n React.createElement(\"div\", { className: \"vsc-card-description__details-inner\" }, props.scene.details)),\n React.createElement(PerformerList_1.default, { performers: props.scene.performers, pluginConfig: props.pluginConfig, scene: props.scene }),\n React.createElement(\"div\", { className: \"vsc-card-description__foot\" },\n React.createElement(\"span\", { className: \"vsc-card-description__date\" }, props.scene.date),\n rating)));\n};\nexports[\"default\"] = CardDescription;\n\n\n//# sourceURL=webpack://valkyrscenecards/./src/components/CardDescription/CardDescription.tsx?"); +eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n__webpack_require__(/*! ./CardDescription.scss */ \"./src/components/CardDescription/CardDescription.scss\");\nconst helpers_1 = __webpack_require__(/*! ../../helpers */ \"./src/helpers/index.ts\");\nconst PerformerList_1 = __importDefault(__webpack_require__(/*! ../PerformerList/PerformerList */ \"./src/components/PerformerList/PerformerList.tsx\"));\nconst { React } = window.PluginApi;\nconst { HoverPopover, Icon } = window.PluginApi.components;\nconst { faBox, faStar } = window.PluginApi.libraries.FontAwesomeSolid;\nconst CardDescription = (props) => {\n var _a;\n const { descriptionHidden } = props.pluginConfig;\n const link = `/scenes/${props.scene.id}`;\n const file = props.scene.files[0];\n const duration = helpers_1.TextUtils.secondsToTimestamp(file.duration);\n const resolution = helpers_1.TextUtils.resolution(file.width, file.height);\n let shortRes = \"\";\n const rating = +((_a = props.scene.rating100) !== null && _a !== void 0 ? _a : 0) > 0 ? (React.createElement(\"span\", { className: \"vsc-card-description__rating\" },\n (props.scene.rating100 || 0) / 10,\n React.createElement(Icon, { icon: faStar }))) : null;\n const organized = props.scene.organized ? (React.createElement(\"span\", { className: \"vsc-card-description__organized\" },\n React.createElement(Icon, { icon: faBox }))) : null;\n switch (resolution) {\n case \"144p\":\n case \"240p\":\n case \"360p\":\n case \"480p\":\n case \"540p\":\n shortRes = \"SD\";\n break;\n case \"720p\":\n case \"1080p\":\n shortRes = \"HD\";\n break;\n case \"1440p\":\n shortRes = \"2K\";\n break;\n default:\n shortRes = resolution || null;\n break;\n }\n return (React.createElement(\"div\", { className: \"scene-card__details\" },\n React.createElement(\"div\", { className: \"vsc-card-description__small-bar\" },\n props.scene.studio ? (React.createElement(\"span\", { className: \"vsc-card-description__studio\" },\n React.createElement(\"a\", { href: \"/studios/\" + props.scene.studio.id }, props.scene.studio.name))) : null,\n React.createElement(\"div\", { className: \"vsc-card-description__file-data\" },\n React.createElement(\"span\", { className: \"vsc-card-description__duration\" }, duration),\n shortRes ? (React.createElement(HoverPopover, { className: \"vsc-card-description__resolution\", content: React.createElement(\"span\", { className: \"vsc-card-description__resolution-hover\" }, resolution), leaveDelay: 100, placement: \"top\" }, shortRes)) : null,\n organized)),\n React.createElement(\"a\", { href: link },\n React.createElement(\"h5\", { className: \"card-section-title flex-aligned\" }, props.scene.title)),\n descriptionHidden ? null : (React.createElement(\"div\", { className: \"scene-card__description vsc-card-description__details\" },\n React.createElement(\"div\", { className: \"vsc-card-description__details-inner\" }, props.scene.details))),\n React.createElement(PerformerList_1.default, { performers: props.scene.performers, pluginConfig: props.pluginConfig, scene: props.scene }),\n React.createElement(\"div\", { className: \"vsc-card-description__foot\" },\n React.createElement(\"span\", { className: \"vsc-card-description__date\" }, props.scene.date),\n rating)));\n};\nexports[\"default\"] = CardDescription;\n\n\n//# sourceURL=webpack://valkyrscenecards/./src/components/CardDescription/CardDescription.tsx?"); /***/ }), @@ -60,7 +60,7 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) { /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; -eval("\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst classnames_1 = __importDefault(__webpack_require__(/*! classnames */ \"./node_modules/classnames/index.js\"));\nconst sort_1 = __webpack_require__(/*! ../../helpers/sort */ \"./src/helpers/sort.ts\");\n__webpack_require__(/*! ./PerformerList.scss */ \"./src/components/PerformerList/PerformerList.scss\");\nconst helpers_1 = __webpack_require__(/*! ../../helpers */ \"./src/helpers/index.ts\");\nconst { PluginApi } = window;\nconst { GQL, React } = PluginApi;\nconst { faMars, faTansgenderAlt, faVenus } = window.PluginApi.libraries.FontAwesomeSolid;\nconst PerformerList = (props) => {\n const { Icon } = PluginApi.components;\n const { performerAvatarsActive, performerAvatarsProfile, performerAvatarsSizeLarge, performerAvatarsTagID, } = props.pluginConfig;\n const sortedPerformers = (0, sort_1.sortPerformers)(props.performers);\n if (performerAvatarsActive) {\n const qProfileImages = GQL.useFindPerformersQuery({\n variables: {\n filter: { per_page: -1 },\n performer_ids: sortedPerformers.map((pf) => +pf.id),\n },\n });\n const qAvatars = GQL.useFindImagesQuery({\n variables: {\n filter: { per_page: -1 },\n image_filter: {\n performers: {\n modifier: \"INCLUDES\" /* CriterionModifier.Includes */,\n value: sortedPerformers.map((pf) => pf.id),\n },\n tags: {\n modifier: \"INCLUDES\" /* CriterionModifier.Includes */,\n value: [performerAvatarsTagID],\n },\n },\n },\n });\n if (qAvatars.loading || qProfileImages.loading)\n return null;\n const avatarListClasses = (0, classnames_1.default)(\"vsc-performer-list\", \"vsc-performer-list__avatar-list\", {\n [\"vsc-performer-list__avatar-list--large\"]: performerAvatarsSizeLarge,\n });\n return (React.createElement(\"div\", { className: avatarListClasses }, sortedPerformers.map((p, i) => {\n var _a, _b;\n const avatarUrl = getPerformerAvatarUrl({\n avatarsQuery: (_a = qAvatars.data) === null || _a === void 0 ? void 0 : _a.findImages,\n avatarTag: performerAvatarsTagID,\n id: p.id,\n profileImagesQuery: (_b = qProfileImages.data) === null || _b === void 0 ? void 0 : _b.findPerformers,\n });\n const useCustomAvatar = !!performerAvatarsTagID && !!avatarUrl.custom;\n const useProfileImage = performerAvatarsProfile && !!avatarUrl.profile;\n // Card inline styles. Descending z-index to put left-most cards on top.\n const inlineStyles = { zIndex: sortedPerformers.length - (i + 1) };\n if (useCustomAvatar || useProfileImage) {\n const avatarClasses = (0, classnames_1.default)(\"vsc-performer-list__avatar\", {\n [\"vsc-performer-list__avatar--custom\"]: useCustomAvatar,\n [\"vsc-performer-list__avatar--profile\"]: !useCustomAvatar,\n });\n return (React.createElement(\"div\", { style: inlineStyles },\n React.createElement(PerformerPopover, { performer: p, releaseDate: props.scene.date },\n React.createElement(\"span\", { className: avatarClasses },\n React.createElement(\"a\", { href: `/performers/${p.id}` },\n React.createElement(\"img\", { src: useCustomAvatar\n ? avatarUrl.custom\n : avatarUrl.profile, alt: p.name }))))));\n }\n else {\n const names = p.name.split(\" \");\n let initials = \"\";\n names.forEach((n, i) => {\n if (i === 0 || i === names.length - 1) {\n initials += n.split(\"\")[0];\n }\n });\n const genderIcon = getPerformerGenderIcon(p.gender);\n return (React.createElement(\"div\", { style: inlineStyles },\n React.createElement(PerformerPopover, { performer: p, releaseDate: props.scene.date },\n React.createElement(\"span\", { className: \"vsc-performer-list__avatar\" },\n React.createElement(\"a\", { href: `/performers/${p.id}` },\n React.createElement(\"span\", null, initials),\n !!genderIcon ? React.createElement(Icon, { icon: genderIcon }) : null)))));\n }\n })));\n }\n else {\n return (React.createElement(\"div\", { className: \"vsc-performer-list\" }, sortedPerformers.map((p, i) => {\n const totalPerformers = props.performers.length;\n const isOneBeforeLast = i === totalPerformers - 2;\n const isAnyBeforeLast = i < totalPerformers - 1;\n let suffix = null;\n if (totalPerformers === 2 && isOneBeforeLast)\n suffix = \" and \";\n else {\n if (isAnyBeforeLast)\n suffix = \", \";\n if (isOneBeforeLast)\n suffix += \"and \";\n }\n return (React.createElement(React.Fragment, null,\n React.createElement(\"a\", { href: `/performers/${p.id}` },\n React.createElement(\"span\", null, p.name)),\n suffix));\n })));\n }\n};\nexports[\"default\"] = PerformerList;\nconst getPerformerAvatarUrl = (args) => {\n var _a, _b, _c, _d;\n const avatarUrl = (_b = (_a = args.avatarsQuery) === null || _a === void 0 ? void 0 : _a.images.find((img) => img.performers.find((pf) => pf.id === args.id))) === null || _b === void 0 ? void 0 : _b.paths.image;\n const profileImageUrl = (_d = (_c = args.profileImagesQuery) === null || _c === void 0 ? void 0 : _c.performers.find((pf) => pf.id === args.id)) === null || _d === void 0 ? void 0 : _d.image_path;\n // Don't return the native default image\n const url = {\n custom: avatarUrl,\n profile: !(profileImageUrl === null || profileImageUrl === void 0 ? void 0 : profileImageUrl.includes(\"default=true\"))\n ? profileImageUrl\n : undefined,\n };\n return url;\n};\nconst getPerformerGenderIcon = (gender) => {\n switch (gender) {\n case undefined:\n return null;\n case \"FEMALE\":\n return faVenus;\n case \"MALE\":\n return faMars;\n default:\n return faTansgenderAlt;\n }\n};\nconst PerformerPopover = (_a) => {\n var { performer, releaseDate } = _a, props = __rest(_a, [\"performer\", \"releaseDate\"]);\n const { HoverPopover } = PluginApi.components;\n const qPerformer = GQL.useFindPerformerQuery({\n variables: { id: performer.id },\n });\n if (qPerformer.loading)\n return null;\n const Content = () => {\n var _a;\n const birthdate = (_a = qPerformer.data.findPerformer) === null || _a === void 0 ? void 0 : _a.birthdate;\n return (React.createElement(\"span\", { className: \"vsc-performer-list__performer-hover\" },\n performer.name,\n birthdate && releaseDate\n ? \" (\" + helpers_1.TextUtils.age(birthdate, releaseDate) + \")\"\n : null));\n };\n return (React.createElement(HoverPopover, { content: React.createElement(Content, null), children: props.children, leaveDelay: 100, placement: \"top\" }));\n};\n\n\n//# sourceURL=webpack://valkyrscenecards/./src/components/PerformerList/PerformerList.tsx?"); +eval("\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst classnames_1 = __importDefault(__webpack_require__(/*! classnames */ \"./node_modules/classnames/index.js\"));\nconst sort_1 = __webpack_require__(/*! ../../helpers/sort */ \"./src/helpers/sort.ts\");\n__webpack_require__(/*! ./PerformerList.scss */ \"./src/components/PerformerList/PerformerList.scss\");\nconst helpers_1 = __webpack_require__(/*! ../../helpers */ \"./src/helpers/index.ts\");\nconst { PluginApi } = window;\nconst { GQL, React } = PluginApi;\nconst { faMars, faTansgenderAlt, faVenus } = window.PluginApi.libraries.FontAwesomeSolid;\nconst PerformerList = (props) => {\n const { Icon } = PluginApi.components;\n const { performerAvatarsActive, performerAvatarsProfile, performerAvatarsSizeLarge, performerAvatarsTagID, performerTextColors, } = props.pluginConfig;\n const sortedPerformers = (0, sort_1.sortPerformers)(props.performers);\n if (performerAvatarsActive) {\n const qProfileImages = GQL.useFindPerformersQuery({\n variables: {\n filter: { per_page: -1 },\n performer_ids: sortedPerformers.map((pf) => +pf.id),\n },\n });\n const qAvatars = GQL.useFindImagesQuery({\n variables: {\n filter: { per_page: -1 },\n image_filter: {\n performers: {\n modifier: \"INCLUDES\" /* CriterionModifier.Includes */,\n value: sortedPerformers.map((pf) => pf.id),\n },\n tags: {\n modifier: \"INCLUDES\" /* CriterionModifier.Includes */,\n value: [performerAvatarsTagID],\n },\n },\n },\n });\n if (qAvatars.loading || qProfileImages.loading)\n return null;\n const avatarListClasses = (0, classnames_1.default)(\"vsc-performer-list\", \"vsc-performer-list__avatar-list\", {\n [\"vsc-performer-list__avatar-list--large\"]: performerAvatarsSizeLarge,\n });\n return (React.createElement(\"div\", { className: avatarListClasses }, sortedPerformers.map((p, i) => {\n var _a, _b;\n const avatarUrl = getPerformerAvatarUrl({\n avatarsQuery: (_a = qAvatars.data) === null || _a === void 0 ? void 0 : _a.findImages,\n avatarTag: performerAvatarsTagID,\n id: p.id,\n profileImagesQuery: (_b = qProfileImages.data) === null || _b === void 0 ? void 0 : _b.findPerformers,\n });\n const useCustomAvatar = !!performerAvatarsTagID && !!avatarUrl.custom;\n const useProfileImage = performerAvatarsProfile && !!avatarUrl.profile;\n // Card inline styles. Descending z-index to put left-most cards on top.\n const inlineStyles = { zIndex: sortedPerformers.length - (i + 1) };\n if (useCustomAvatar || useProfileImage) {\n const avatarClasses = (0, classnames_1.default)(\"vsc-performer-list__avatar\", {\n [\"vsc-performer-list__avatar--custom\"]: useCustomAvatar,\n [\"vsc-performer-list__avatar--profile\"]: !useCustomAvatar,\n });\n return (React.createElement(\"div\", { style: inlineStyles },\n React.createElement(PerformerPopover, { performer: p, releaseDate: props.scene.date, performerTextColors: performerTextColors },\n React.createElement(\"span\", { className: avatarClasses },\n React.createElement(\"a\", { href: `/performers/${p.id}` },\n React.createElement(\"img\", { src: useCustomAvatar\n ? avatarUrl.custom\n : avatarUrl.profile, alt: p.name }))))));\n }\n else {\n const names = p.name.split(\" \");\n let initials = \"\";\n names.forEach((n, i) => {\n if (i === 0 || i === names.length - 1) {\n initials += n.split(\"\")[0];\n }\n });\n const genderIcon = getPerformerGenderIcon(p.gender);\n return (React.createElement(\"div\", { style: inlineStyles },\n React.createElement(PerformerPopover, { performer: p, releaseDate: props.scene.date, performerTextColors: performerTextColors },\n React.createElement(\"span\", { className: \"vsc-performer-list__avatar\" },\n React.createElement(\"a\", { href: `/performers/${p.id}` },\n React.createElement(\"span\", null, initials),\n !!genderIcon ? React.createElement(Icon, { icon: genderIcon }) : null)))));\n }\n })));\n }\n else {\n return (React.createElement(\"div\", { className: \"vsc-performer-list\" }, sortedPerformers.map((p, i) => {\n var _a;\n const totalPerformers = props.performers.length;\n const isOneBeforeLast = i === totalPerformers - 2;\n const isAnyBeforeLast = i < totalPerformers - 1;\n const genderClass = performerTextColors\n ? `vsc-performer-list__gender-color--${((_a = p.gender) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || \"unknown\"}`\n : undefined;\n let suffix = null;\n if (totalPerformers === 2 && isOneBeforeLast)\n suffix = \" and \";\n else {\n if (isAnyBeforeLast)\n suffix = \", \";\n if (isOneBeforeLast)\n suffix += \"and \";\n }\n return (React.createElement(React.Fragment, null,\n React.createElement(\"a\", { href: `/performers/${p.id}`, className: genderClass },\n React.createElement(\"span\", null, p.name)),\n suffix));\n })));\n }\n};\nexports[\"default\"] = PerformerList;\nconst getPerformerAvatarUrl = (args) => {\n var _a, _b, _c, _d;\n const avatarUrl = (_b = (_a = args.avatarsQuery) === null || _a === void 0 ? void 0 : _a.images.find((img) => img.performers.find((pf) => pf.id === args.id))) === null || _b === void 0 ? void 0 : _b.paths.image;\n const profileImageUrl = (_d = (_c = args.profileImagesQuery) === null || _c === void 0 ? void 0 : _c.performers.find((pf) => pf.id === args.id)) === null || _d === void 0 ? void 0 : _d.image_path;\n // Don't return the native default image\n const url = {\n custom: avatarUrl,\n profile: !(profileImageUrl === null || profileImageUrl === void 0 ? void 0 : profileImageUrl.includes(\"default=true\"))\n ? profileImageUrl\n : undefined,\n };\n return url;\n};\nconst getPerformerGenderIcon = (gender) => {\n switch (gender) {\n case undefined:\n return null;\n case \"FEMALE\":\n return faVenus;\n case \"MALE\":\n return faMars;\n default:\n return faTansgenderAlt;\n }\n};\nconst PerformerPopover = (_a) => {\n var { performer, performerTextColors, releaseDate } = _a, props = __rest(_a, [\"performer\", \"performerTextColors\", \"releaseDate\"]);\n const { HoverPopover } = PluginApi.components;\n const qPerformer = GQL.useFindPerformerQuery({\n variables: { id: performer.id },\n });\n if (qPerformer.loading)\n return null;\n const Content = () => {\n var _a, _b;\n const birthdate = (_a = qPerformer.data.findPerformer) === null || _a === void 0 ? void 0 : _a.birthdate;\n const gender = (_b = qPerformer.data.findPerformer) === null || _b === void 0 ? void 0 : _b.gender;\n const genderClass = performerTextColors\n ? `vsc-performer-list__gender-color--${(gender === null || gender === void 0 ? void 0 : gender.toLowerCase()) || \"unknown\"}`\n : undefined;\n return (React.createElement(\"span\", { className: \"vsc-performer-list__performer-hover\" },\n React.createElement(\"span\", { className: genderClass }, performer.name),\n birthdate && releaseDate\n ? \" (\" + helpers_1.TextUtils.age(birthdate, releaseDate) + \")\"\n : null));\n };\n return (React.createElement(HoverPopover, { content: React.createElement(Content, null), children: props.children, leaveDelay: 100, placement: \"top\" }));\n};\n\n\n//# sourceURL=webpack://valkyrscenecards/./src/components/PerformerList/PerformerList.tsx?"); /***/ }), @@ -104,7 +104,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\ncons /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; -eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst CardDescription_1 = __importDefault(__webpack_require__(/*! ./components/CardDescription/CardDescription */ \"./src/components/CardDescription/CardDescription.tsx\"));\n__webpack_require__(/*! ./styles.scss */ \"./src/styles.scss\");\nconst { PluginApi } = window;\nconst { GQL, React } = PluginApi;\n// Remove overlays\nPluginApi.patch.instead(\"SceneCard.Details\", function (props) {\n const qConfig = GQL.useConfigurationQuery();\n const dataLoading = qConfig.loading;\n if (dataLoading)\n return [];\n const userConfig = qConfig.data.configuration.plugins\n .ValkyrSceneCards;\n // Compile the user's config with config defaults\n const pluginConfig = {\n performerAvatarsActive: getConfigProp(userConfig === null || userConfig === void 0 ? void 0 : userConfig.performerAvatarsActive, false),\n performerAvatarsProfile: getConfigProp(userConfig === null || userConfig === void 0 ? void 0 : userConfig.performerAvatarsProfile, false),\n performerAvatarsSizeLarge: getConfigProp(userConfig === null || userConfig === void 0 ? void 0 : userConfig.performerAvatarsSizeLarge, false),\n performerAvatarsTagID: getConfigProp(userConfig === null || userConfig === void 0 ? void 0 : userConfig.performerAvatarsTagID, \"\"),\n };\n return [React.createElement(CardDescription_1.default, Object.assign({}, props, { pluginConfig: pluginConfig }))];\n});\n// Remove overlays\nPluginApi.patch.instead(\"SceneCard.Overlays\", function () {\n return [];\n});\n// Remove popovers\nPluginApi.patch.instead(\"SceneCard.Popovers\", function () {\n return [];\n});\n/** Returns the given property from the user's config, or the default value if\n * the user hasn't explicitly set it. */\nfunction getConfigProp(value, defaultValue) {\n return value !== null && value !== void 0 ? value : defaultValue;\n}\n\n\n//# sourceURL=webpack://valkyrscenecards/./src/main.tsx?"); +eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst CardDescription_1 = __importDefault(__webpack_require__(/*! ./components/CardDescription/CardDescription */ \"./src/components/CardDescription/CardDescription.tsx\"));\n__webpack_require__(/*! ./styles.scss */ \"./src/styles.scss\");\nconst { PluginApi } = window;\nconst { GQL, React } = PluginApi;\n// Remove overlays\nPluginApi.patch.instead(\"SceneCard.Details\", function (props) {\n const qConfig = GQL.useConfigurationQuery();\n const dataLoading = qConfig.loading;\n if (dataLoading)\n return [];\n const userConfig = qConfig.data.configuration.plugins\n .ValkyrSceneCards;\n // Compile the user's config with config defaults\n const pluginConfig = {\n descriptionHidden: getConfigProp(userConfig === null || userConfig === void 0 ? void 0 : userConfig.descriptionHidden, false),\n performerAvatarsActive: getConfigProp(userConfig === null || userConfig === void 0 ? void 0 : userConfig.performerAvatarsActive, false),\n performerAvatarsProfile: getConfigProp(userConfig === null || userConfig === void 0 ? void 0 : userConfig.performerAvatarsProfile, false),\n performerAvatarsSizeLarge: getConfigProp(userConfig === null || userConfig === void 0 ? void 0 : userConfig.performerAvatarsSizeLarge, false),\n performerAvatarsTagID: getConfigProp(userConfig === null || userConfig === void 0 ? void 0 : userConfig.performerAvatarsTagID, \"\"),\n performerTextColors: getConfigProp(userConfig === null || userConfig === void 0 ? void 0 : userConfig.performerTextColors, false),\n };\n return [React.createElement(CardDescription_1.default, Object.assign({}, props, { pluginConfig: pluginConfig }))];\n});\n// Remove overlays\nPluginApi.patch.instead(\"SceneCard.Overlays\", function () {\n return [];\n});\n// Remove popovers\nPluginApi.patch.instead(\"SceneCard.Popovers\", function () {\n return [];\n});\n/** Returns the given property from the user's config, or the default value if\n * the user hasn't explicitly set it. */\nfunction getConfigProp(value, defaultValue) {\n return value !== null && value !== void 0 ? value : defaultValue;\n}\n\n\n//# sourceURL=webpack://valkyrscenecards/./src/main.tsx?"); /***/ }), diff --git a/plugins/ValkyrSceneCards/ValkyrSceneCards.yml b/plugins/ValkyrSceneCards/ValkyrSceneCards.yml index c17d78a..30d0a4f 100644 --- a/plugins/ValkyrSceneCards/ValkyrSceneCards.yml +++ b/plugins/ValkyrSceneCards/ValkyrSceneCards.yml @@ -1,16 +1,20 @@ name: Valkyr Scene Cards description: A rework of the scene cards for Stash. url: https://github.com/Valkyr-JS/ValkyrSceneCards -version: 0.1.0 +version: 0.2.0 ui: javascript: - ValkyrSceneCards.js css: - ValkyrSceneCards.css settings: + descriptionHidden: + displayName: Hide the description + description: When enabled, the description will be removed from scene cards. + type: BOOLEAN performerAvatarsActive: displayName: Use performer avatars - description: When enabled, the text list of performers is replaced with circular avatar images of each performer. These can be customised below. + description: When enabled, the text list of performers is replaced with circular avatar images of each performer. These can be customized below. type: BOOLEAN performerAvatarsProfile: displayName: Use profile images as default avatars @@ -24,3 +28,7 @@ settings: displayName: Custom avatar image tag ID description: Set the ID of the tag given to custom avatar images. Custom avatars will take precedence over other types of avatars. type: STRING + performerTextColors: + displayName: Performer colors + description: When enabled, performer names will be colored according to their gender. + type: BOOLEAN