diff --git a/.gitignore b/.gitignore index 7ffca948c..8df9bc346 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,7 @@ data.db *.provisionprofile npm-debug.log* .idea/ -.DS_Store/ -www/.DS_Store +.DS_Store +**/.DS_Store www/js/ .env diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d7ff1054..34b4a845b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ ## New Updates +### 9.2.1 - ਊਨਾ Release _May 24, 2024_ + +#### New Features +- Choose the order of the lines that sangat see on screen using quickview dropdowns. + ![](./assets/img/help_images/content-order.gif) +- New Multi-Pane workspace allows you to open multiple Shabads on one screen to display from. + ![](./assets/img/help_images/multipane-preview.gif) +- You now have the ability to reset the font sizes. + +#### Misc. bug fix and other improvements +- Update of the support link. +- Improve the colors of Floral theme in Bani Overlay. +- Preserve formatting (line breaks) in announcement. +- Improvements to Bani Overlay margins to adhere to standard broadcast standards. +- Code refactors and style improvements. + +**We would love to hear from you if there a feature that you have been waiting for. Send us your feedback at [sttm.co/feedback](https://www.sttm.co/feedback).** +
+ ### 9.2.0 - ਊਨਾ Release _January 30, 2024_ #### New Features diff --git a/HELP.md b/HELP.md index 6f8be4e43..8bb5e5a89 100644 --- a/HELP.md +++ b/HELP.md @@ -154,7 +154,7 @@ Bani Overlay allows you to display Gurbani from SikhiToTheMax on a Live Stream. ### How do I report a mistake? -Visit [SikhiToTheMax.org](https://sikhitothemax.org) and click "[Feedback](https://goo.gl/plk23h)" at the bottom of the page. +Visit [Khalis Support](https://support.khalisfoundation.org/support/solutions/folders/63000040721) and click on New Support Ticket. ### Video Tutorial diff --git a/analytics.js b/analytics.js index 4c0767995..ea87261dd 100644 --- a/analytics.js +++ b/analytics.js @@ -5,23 +5,18 @@ require('dotenv').config(); class Analytics { trackEvent({ category, action, label, value }) { - if (process.env.NODE_ENV !== 'development') { - // TODO: need to add variable that stops statistics collection - isOnline().then((online) => { - // TODO: for offline users, come up with a way of storing and send when online. - if (online) { - trackEvent(action, { - category, - label, - value, - }); - } - }); - } else { - console.log( - `Tracking Event suppressed for development ec: ${category}, ea: ${action}, el: ${label}, ev: ${value}`, - ); - } + // TODO: need to add variable that stops statistics collection + isOnline().then((online) => { + // TODO: for offline users, come up with a way of storing and send when online. + if (online) { + console.log('action', action, 'options', { category, label, value }); + trackEvent(action, { + category, + label, + value, + }); + } + }); } } diff --git a/package-lock.json b/package-lock.json index aed5bbc1f..e62c579de 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "sttm-desktop", - "version": "9.2.0", + "version": "9.2.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "sttm-desktop", - "version": "9.2.0", + "version": "9.2.1", "hasInstallScript": true, "license": "OSL-3.0", "dependencies": { @@ -72,11 +72,11 @@ "@babel/plugin-transform-runtime": "^7.22.15", "@babel/preset-env": "^7.22.20", "@babel/preset-react": "^7.22.15", - "@electron/notarize": "^2.1.0", + "@electron/notarize": "^2.3.0", "concurrently": "^8.2.1", "cross-env": "^7.0.3", "electron": "^26.2.4", - "electron-builder": "^24.6.4", + "electron-builder": "^24.13.3", "electron-publisher-s3": "^20.17.2", "electron-react-devtools": "^0.5.3", "electron-rebuild": "^3.2.8", @@ -2022,9 +2022,9 @@ } }, "node_modules/@electron/asar": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/@electron/asar/-/asar-3.2.7.tgz", - "integrity": "sha512-8FaSCAIiZGYFWyjeevPQt+0e9xCK9YmJ2Rjg5SXgdsXon6cRnU0Yxnbe6CvJbQn26baifur2Y2G5EBayRIsjyg==", + "version": "3.2.10", + "resolved": "https://registry.npmjs.org/@electron/asar/-/asar-3.2.10.tgz", + "integrity": "sha512-mvBSwIBUeiRscrCeJE1LwctAriBj65eUDm0Pc11iE5gRwzkmsdbS7FnZ1XUWjpSeQWL1L5g12Fc/SchPM9DUOw==", "dev": true, "dependencies": { "commander": "^5.0.0", @@ -2127,9 +2127,9 @@ } }, "node_modules/@electron/notarize": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@electron/notarize/-/notarize-2.1.0.tgz", - "integrity": "sha512-Q02xem1D0sg4v437xHgmBLxI2iz/fc0D4K7fiVWHa/AnW8o7D751xyKNXgziA6HrTOme9ul1JfWN5ark8WH1xA==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@electron/notarize/-/notarize-2.3.0.tgz", + "integrity": "sha512-EiTBU0BwE7HZZjAG1fFWQaiQpCuPrVGn7jPss1kUjD6eTTdXXd29RiZqEqkgN7xqt/Pgn4g3I7Saqovanrfj3w==", "dev": true, "dependencies": { "debug": "^4.1.1", @@ -2196,9 +2196,9 @@ } }, "node_modules/@electron/universal": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/@electron/universal/-/universal-1.4.1.tgz", - "integrity": "sha512-lE/U3UNw1YHuowNbTmKNs9UlS3En3cPgwM5MI+agIgr/B1hSze9NdOP0qn7boZaI9Lph8IDv3/24g9IxnJP7aQ==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@electron/universal/-/universal-1.5.1.tgz", + "integrity": "sha512-kbgXxyEauPJiQQUNG2VgUeyfQNFk6hBF11ISN2PNI6agUgPl55pv4eQmaqHzTAzchBvqZ2tQuRVaPStGf0mxGw==", "dev": true, "dependencies": { "@electron/asar": "^3.2.1", @@ -2837,9 +2837,9 @@ } }, "node_modules/@types/debug": { - "version": "4.1.10", - "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.10.tgz", - "integrity": "sha512-tOSCru6s732pofZ+sMv9o4o3Zc+Sa8l3bxd/tweTQudFn06vAzb13ZX46Zi6m6EJ+RUbRTHvgQJ1gBtSgkaUYA==", + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", + "integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==", "dev": true, "dependencies": { "@types/ms": "*" @@ -2891,9 +2891,9 @@ "dev": true }, "node_modules/@types/ms": { - "version": "0.7.33", - "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.33.tgz", - "integrity": "sha512-AuHIyzR5Hea7ij0P9q7vx7xu4z0C28ucwjAZC0ja7JhINyCnOw8/DnvAPQQ9TfOlCtZAmCERKQX9+o1mgQhuOQ==", + "version": "0.7.34", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.34.tgz", + "integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==", "dev": true }, "node_modules/@types/node": { @@ -2917,9 +2917,9 @@ "dev": true }, "node_modules/@types/plist": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@types/plist/-/plist-3.0.4.tgz", - "integrity": "sha512-pTa9xUFQFM9WJGSWHajYNljD+DbVylE1q9IweK1LBhUYJdJ28YNU8j3KZ4Q1Qw+cSl4+QLLLOVmqNjhhvVO8fA==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@types/plist/-/plist-3.0.5.tgz", + "integrity": "sha512-E6OCaRmAe4WDmWNsL/9RMqdkkzDCY1etutkflWk4c+AcjDU07Pcz1fQwTX0TQz+Pxqn9i4L1TU3UFpjnrcDgxA==", "dev": true, "optional": true, "dependencies": { @@ -2942,9 +2942,9 @@ "dev": true }, "node_modules/@types/verror": { - "version": "1.10.8", - "resolved": "https://registry.npmjs.org/@types/verror/-/verror-1.10.8.tgz", - "integrity": "sha512-YhUhnxRYs/NiVUbIs3F/EzviDP/NZCEAE2Mx5DUqLdldUmphOhFCVh7Kc+7zlYEExM0P8dzfbJi0yRlNb2Bw5g==", + "version": "1.10.10", + "resolved": "https://registry.npmjs.org/@types/verror/-/verror-1.10.10.tgz", + "integrity": "sha512-l4MM0Jppn18hb9xmM6wwD1uTdShpf9Pn80aXTStnK1C94gtPvJcV2FrDmbOQUAQfJ1cKZHktkQUDwEqaAKXMMg==", "dev": true, "optional": true }, @@ -3142,9 +3142,9 @@ } }, "node_modules/7zip-bin": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/7zip-bin/-/7zip-bin-5.1.1.tgz", - "integrity": "sha512-sAP4LldeWNz0lNzmTird3uWfFDWWTeg6V/MsmyyLR9X1idwKBWIgt/ZvinqQldJm3LecKEs1emkbquO6PCiLVQ==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/7zip-bin/-/7zip-bin-5.2.0.tgz", + "integrity": "sha512-ukTPVhqG4jNzMro2qA9HSCSSVJN3aN7tlb+hfqYCt3ER0yWroeA2VR38MNrOHLQ/cVj+DaIMad0kFCtWWowh/A==", "dev": true }, "node_modules/abbrev": { @@ -3666,26 +3666,25 @@ "dev": true }, "node_modules/app-builder-lib": { - "version": "24.6.4", - "resolved": "https://registry.npmjs.org/app-builder-lib/-/app-builder-lib-24.6.4.tgz", - "integrity": "sha512-m9931WXb83teb32N0rKg+ulbn6+Hl8NV5SUpVDOVz9MWOXfhV6AQtTdftf51zJJvCQnQugGtSqoLvgw6mdF/Rg==", + "version": "24.13.3", + "resolved": "https://registry.npmjs.org/app-builder-lib/-/app-builder-lib-24.13.3.tgz", + "integrity": "sha512-FAzX6IBit2POXYGnTCT8YHFO/lr5AapAII6zzhQO3Rw4cEDOgK+t1xhLc5tNcKlicTHlo9zxIwnYCX9X2DLkig==", "dev": true, "dependencies": { "@develar/schema-utils": "~2.6.5", - "@electron/notarize": "2.1.0", + "@electron/notarize": "2.2.1", "@electron/osx-sign": "1.0.5", - "@electron/universal": "1.4.1", + "@electron/universal": "1.5.1", "@malept/flatpak-bundler": "^0.4.0", "@types/fs-extra": "9.0.13", - "7zip-bin": "~5.1.1", "async-exit-hook": "^2.0.1", "bluebird-lst": "^1.0.9", - "builder-util": "24.5.0", - "builder-util-runtime": "9.2.1", + "builder-util": "24.13.1", + "builder-util-runtime": "9.2.4", "chromium-pickle-js": "^0.2.0", "debug": "^4.3.4", "ejs": "^3.1.8", - "electron-publish": "24.5.0", + "electron-publish": "24.13.1", "form-data": "^4.0.0", "fs-extra": "^10.1.0", "hosted-git-info": "^4.1.0", @@ -3702,6 +3701,52 @@ }, "engines": { "node": ">=14.0.0" + }, + "peerDependencies": { + "dmg-builder": "24.13.3", + "electron-builder-squirrel-windows": "24.13.3" + } + }, + "node_modules/app-builder-lib/node_modules/@electron/notarize": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@electron/notarize/-/notarize-2.2.1.tgz", + "integrity": "sha512-aL+bFMIkpR0cmmj5Zgy0LMKEpgy43/hw5zadEArgmAMWWlKc5buwFvFT9G/o/YJkvXAJm5q3iuTuLaiaXW39sg==", + "dev": true, + "dependencies": { + "debug": "^4.1.1", + "fs-extra": "^9.0.1", + "promise-retry": "^2.0.1" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/app-builder-lib/node_modules/@electron/notarize/node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dev": true, + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/app-builder-lib/node_modules/builder-util-runtime": { + "version": "9.2.4", + "resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-9.2.4.tgz", + "integrity": "sha512-upp+biKpN/XZMLim7aguUyW8s0FUpDvOtK6sbanMFDAMBzpHDqdhgVYm6zc9HJ6nWo7u2Lxk60i2M6Jd3aiNrA==", + "dev": true, + "dependencies": { + "debug": "^4.3.4", + "sax": "^1.2.4" + }, + "engines": { + "node": ">=12.0.0" } }, "node_modules/app-builder-lib/node_modules/fs-extra": { @@ -6369,16 +6414,16 @@ } }, "node_modules/builder-util": { - "version": "24.5.0", - "resolved": "https://registry.npmjs.org/builder-util/-/builder-util-24.5.0.tgz", - "integrity": "sha512-STnBmZN/M5vGcv01u/K8l+H+kplTaq4PAIn3yeuufUKSpcdro0DhJWxPI81k5XcNfC//bjM3+n9nr8F9uV4uAQ==", + "version": "24.13.1", + "resolved": "https://registry.npmjs.org/builder-util/-/builder-util-24.13.1.tgz", + "integrity": "sha512-NhbCSIntruNDTOVI9fdXz0dihaqX2YuE1D6zZMrwiErzH4ELZHE6mdiB40wEgZNprDia+FghRFgKoAqMZRRjSA==", "dev": true, "dependencies": { "@types/debug": "^4.1.6", - "7zip-bin": "~5.1.1", + "7zip-bin": "~5.2.0", "app-builder-bin": "4.0.0", "bluebird-lst": "^1.0.9", - "builder-util-runtime": "9.2.1", + "builder-util-runtime": "9.2.4", "chalk": "^4.1.2", "cross-spawn": "^7.0.3", "debug": "^4.3.4", @@ -6419,6 +6464,19 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/builder-util/node_modules/builder-util-runtime": { + "version": "9.2.4", + "resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-9.2.4.tgz", + "integrity": "sha512-upp+biKpN/XZMLim7aguUyW8s0FUpDvOtK6sbanMFDAMBzpHDqdhgVYm6zc9HJ6nWo7u2Lxk60i2M6Jd3aiNrA==", + "dev": true, + "dependencies": { + "debug": "^4.3.4", + "sax": "^1.2.4" + }, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/builder-util/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -7622,13 +7680,77 @@ } }, "node_modules/config-file-ts": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/config-file-ts/-/config-file-ts-0.2.4.tgz", - "integrity": "sha512-cKSW0BfrSaAUnxpgvpXPLaaW/umg4bqg4k3GO1JqlRfpx+d5W0GDXznCMkWotJQek5Mmz1MJVChQnz3IVaeMZQ==", + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/config-file-ts/-/config-file-ts-0.2.6.tgz", + "integrity": "sha512-6boGVaglwblBgJqGyxm4+xCmEGcWgnWHSWHY5jad58awQhB6gftq0G8HbzU39YqCIYHMLAiL1yjwiZ36m/CL8w==", "dev": true, "dependencies": { - "glob": "^7.1.6", - "typescript": "^4.0.2" + "glob": "^10.3.10", + "typescript": "^5.3.3" + } + }, + "node_modules/config-file-ts/node_modules/glob": { + "version": "10.3.16", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.16.tgz", + "integrity": "sha512-JDKXl1DiuuHJ6fVS2FXjownaavciiHNUU4mOvV/B793RLh05vZL1rcPnCSaOgv1hDT6RDlY7AB7ZUvFYAtPgAw==", + "dev": true, + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.1", + "minipass": "^7.0.4", + "path-scurry": "^1.11.0" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/config-file-ts/node_modules/jackspeak": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.1.2.tgz", + "integrity": "sha512-kWmLKn2tRtfYMF/BakihVVRzBKOxz4gJMiL2Rj91WnAB5TPZumSH99R/Yf1qE1u4uRimvCSJfm6hnxohXeEXjQ==", + "dev": true, + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/config-file-ts/node_modules/minimatch": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", + "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/config-file-ts/node_modules/minipass": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.1.tgz", + "integrity": "sha512-UZ7eQ+h8ywIRAW1hIEl2AqdwzJucU/Kp59+8kkZeSvafXhZjul247BvIJjEVFVeON6d7lM46XX1HXCduKAS8VA==", + "dev": true, + "engines": { + "node": ">=16 || 14 >=14.17" } }, "node_modules/confusing-browser-globals": { @@ -8734,14 +8856,14 @@ } }, "node_modules/dmg-builder": { - "version": "24.6.4", - "resolved": "https://registry.npmjs.org/dmg-builder/-/dmg-builder-24.6.4.tgz", - "integrity": "sha512-BNcHRc9CWEuI9qt0E655bUBU/j/3wUCYBVKGu1kVpbN5lcUdEJJJeiO0NHK3dgKmra6LUUZlo+mWqc+OCbi0zw==", + "version": "24.13.3", + "resolved": "https://registry.npmjs.org/dmg-builder/-/dmg-builder-24.13.3.tgz", + "integrity": "sha512-rcJUkMfnJpfCboZoOOPf4L29TRtEieHNOeAbYPWPxlaBw/Z1RKrRA86dOI9rwaI4tQSc/RD82zTNHprfUHXsoQ==", "dev": true, "dependencies": { - "app-builder-lib": "24.6.4", - "builder-util": "24.5.0", - "builder-util-runtime": "9.2.1", + "app-builder-lib": "24.13.3", + "builder-util": "24.13.1", + "builder-util-runtime": "9.2.4", "fs-extra": "^10.1.0", "iconv-lite": "^0.6.2", "js-yaml": "^4.1.0" @@ -8750,6 +8872,19 @@ "dmg-license": "^1.0.11" } }, + "node_modules/dmg-builder/node_modules/builder-util-runtime": { + "version": "9.2.4", + "resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-9.2.4.tgz", + "integrity": "sha512-upp+biKpN/XZMLim7aguUyW8s0FUpDvOtK6sbanMFDAMBzpHDqdhgVYm6zc9HJ6nWo7u2Lxk60i2M6Jd3aiNrA==", + "dev": true, + "dependencies": { + "debug": "^4.3.4", + "sax": "^1.2.4" + }, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/dmg-builder/node_modules/fs-extra": { "version": "10.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", @@ -9044,9 +9179,9 @@ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, "node_modules/ejs": { - "version": "3.1.9", - "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.9.tgz", - "integrity": "sha512-rC+QVNMJWv+MtPgkt0y+0rVEIdbtxVADApW9JXrUVlzHetgcyczP/E7DJmWJ4fJCZF2cPcBk0laWO9ZHMG3DmQ==", + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", + "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", "dev": true, "dependencies": { "jake": "^10.8.5" @@ -9076,16 +9211,16 @@ } }, "node_modules/electron-builder": { - "version": "24.6.4", - "resolved": "https://registry.npmjs.org/electron-builder/-/electron-builder-24.6.4.tgz", - "integrity": "sha512-uNWQoU7pE7qOaIQ6CJHpBi44RJFVG8OHRBIadUxrsDJVwLLo8Nma3K/EEtx5/UyWAQYdcK4nVPYKoRqBb20hbA==", + "version": "24.13.3", + "resolved": "https://registry.npmjs.org/electron-builder/-/electron-builder-24.13.3.tgz", + "integrity": "sha512-yZSgVHft5dNVlo31qmJAe4BVKQfFdwpRw7sFp1iQglDRCDD6r22zfRJuZlhtB5gp9FHUxCMEoWGq10SkCnMAIg==", "dev": true, "dependencies": { - "app-builder-lib": "24.6.4", - "builder-util": "24.5.0", - "builder-util-runtime": "9.2.1", + "app-builder-lib": "24.13.3", + "builder-util": "24.13.1", + "builder-util-runtime": "9.2.4", "chalk": "^4.1.2", - "dmg-builder": "24.6.4", + "dmg-builder": "24.13.3", "fs-extra": "^10.1.0", "is-ci": "^3.0.0", "lazy-val": "^1.0.5", @@ -9101,6 +9236,34 @@ "node": ">=14.0.0" } }, + "node_modules/electron-builder-squirrel-windows": { + "version": "24.13.3", + "resolved": "https://registry.npmjs.org/electron-builder-squirrel-windows/-/electron-builder-squirrel-windows-24.13.3.tgz", + "integrity": "sha512-oHkV0iogWfyK+ah9ZIvMDpei1m9ZRpdXcvde1wTpra2U8AFDNNpqJdnin5z+PM1GbQ5BoaKCWas2HSjtR0HwMg==", + "dev": true, + "peer": true, + "dependencies": { + "app-builder-lib": "24.13.3", + "archiver": "^5.3.1", + "builder-util": "24.13.1", + "fs-extra": "^10.1.0" + } + }, + "node_modules/electron-builder-squirrel-windows/node_modules/fs-extra": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "dev": true, + "peer": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/electron-builder/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -9116,6 +9279,19 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/electron-builder/node_modules/builder-util-runtime": { + "version": "9.2.4", + "resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-9.2.4.tgz", + "integrity": "sha512-upp+biKpN/XZMLim7aguUyW8s0FUpDvOtK6sbanMFDAMBzpHDqdhgVYm6zc9HJ6nWo7u2Lxk60i2M6Jd3aiNrA==", + "dev": true, + "dependencies": { + "debug": "^4.3.4", + "sax": "^1.2.4" + }, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/electron-builder/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -9432,14 +9608,14 @@ "integrity": "sha512-QQ4GvrXO+HkgqqEOYbi+DHL7hj5JM+nHi/j+qrN9zeeXVKy8ZABgbu4CnG+BBqDZ2+tbeq9tUC4DZfIWFU5AZA==" }, "node_modules/electron-publish": { - "version": "24.5.0", - "resolved": "https://registry.npmjs.org/electron-publish/-/electron-publish-24.5.0.tgz", - "integrity": "sha512-zwo70suH15L15B4ZWNDoEg27HIYoPsGJUF7xevLJLSI7JUPC8l2yLBdLGwqueJ5XkDL7ucYyRZzxJVR8ElV9BA==", + "version": "24.13.1", + "resolved": "https://registry.npmjs.org/electron-publish/-/electron-publish-24.13.1.tgz", + "integrity": "sha512-2ZgdEqJ8e9D17Hwp5LEq5mLQPjqU3lv/IALvgp+4W8VeNhryfGhYEQC/PgDPMrnWUp+l60Ou5SJLsu+k4mhQ8A==", "dev": true, "dependencies": { "@types/fs-extra": "^9.0.11", - "builder-util": "24.5.0", - "builder-util-runtime": "9.2.1", + "builder-util": "24.13.1", + "builder-util-runtime": "9.2.4", "chalk": "^4.1.2", "fs-extra": "^10.1.0", "lazy-val": "^1.0.5", @@ -9461,6 +9637,19 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/electron-publish/node_modules/builder-util-runtime": { + "version": "9.2.4", + "resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-9.2.4.tgz", + "integrity": "sha512-upp+biKpN/XZMLim7aguUyW8s0FUpDvOtK6sbanMFDAMBzpHDqdhgVYm6zc9HJ6nWo7u2Lxk60i2M6Jd3aiNrA==", + "dev": true, + "dependencies": { + "debug": "^4.3.4", + "sax": "^1.2.4" + }, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/electron-publish/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -14686,12 +14875,12 @@ "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" }, "node_modules/isbinaryfile": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-5.0.0.tgz", - "integrity": "sha512-UDdnyGvMajJUWCkib7Cei/dvyJrrvo4FIrsvSFWdPpXSUorzXrDJ0S+X5Q4ZlasfPjca4yqCNNsjbCeiy8FFeg==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-5.0.2.tgz", + "integrity": "sha512-GvcjojwonMjWbTkfMpnVHVqXW/wKMYDfEpY94/8zy8HFMOqb/VL6oeONq9v87q4ttVlaTLnGXnJD4B5B1OTGIg==", "dev": true, "engines": { - "node": ">= 14.0.0" + "node": ">= 18.0.0" }, "funding": { "url": "https://github.com/sponsors/gjtorikian/" @@ -14754,9 +14943,9 @@ } }, "node_modules/jake": { - "version": "10.8.7", - "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.7.tgz", - "integrity": "sha512-ZDi3aP+fG/LchyBzUM804VjddnwfSfsdeYkwt8NcbKRvo4rFkjhs456iLFn3k2ZUWvNe4i48WACDbza8fhq2+w==", + "version": "10.9.1", + "resolved": "https://registry.npmjs.org/jake/-/jake-10.9.1.tgz", + "integrity": "sha512-61btcOHNnLnsOdtLgA5efqQWjnSi/vow5HbI7HMdKKWqvrKR1bLK3BPlJn9gcSaP2ewuamUSMB5XEy76KUIS2w==", "dev": true, "dependencies": { "async": "^3.2.3", @@ -18736,24 +18925,24 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" }, "node_modules/path-scurry": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.1.tgz", - "integrity": "sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", "dependencies": { - "lru-cache": "^9.1.1 || ^10.0.0", + "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": ">=16 || 14 >=14.18" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/path-scurry/node_modules/lru-cache": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz", - "integrity": "sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==", + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.2.tgz", + "integrity": "sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==", "engines": { "node": "14 || >=16.14" } @@ -23903,15 +24092,12 @@ } }, "node_modules/tmp": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", - "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz", + "integrity": "sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==", "dev": true, - "dependencies": { - "rimraf": "^3.0.0" - }, "engines": { - "node": ">=8.17.0" + "node": ">=14.14" } }, "node_modules/tmp-promise": { @@ -24307,16 +24493,16 @@ "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" }, "node_modules/typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "version": "5.4.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", + "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=14.17" } }, "node_modules/typical": { @@ -24748,9 +24934,9 @@ } }, "node_modules/utf8-byte-length": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.4.tgz", - "integrity": "sha512-4+wkEYLBbWxqTahEsWrhxepcoVOJ+1z5PGIjPZxRkytcdSUaNjIjBM7Xn8E+pdSuV7SzvWovBFA54FO0JSoqhA==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.5.tgz", + "integrity": "sha512-Xn0w3MtiQ6zoz2vFyUVruaCL53O/DwUvkEeOvj+uulMm0BkUGYWmBYVyElqZaSLhY6ZD0ulfU3aBra2aVT4xfA==", "dev": true }, "node_modules/util": { @@ -27075,9 +27261,9 @@ } }, "@electron/asar": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/@electron/asar/-/asar-3.2.7.tgz", - "integrity": "sha512-8FaSCAIiZGYFWyjeevPQt+0e9xCK9YmJ2Rjg5SXgdsXon6cRnU0Yxnbe6CvJbQn26baifur2Y2G5EBayRIsjyg==", + "version": "3.2.10", + "resolved": "https://registry.npmjs.org/@electron/asar/-/asar-3.2.10.tgz", + "integrity": "sha512-mvBSwIBUeiRscrCeJE1LwctAriBj65eUDm0Pc11iE5gRwzkmsdbS7FnZ1XUWjpSeQWL1L5g12Fc/SchPM9DUOw==", "dev": true, "requires": { "commander": "^5.0.0", @@ -27158,9 +27344,9 @@ } }, "@electron/notarize": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@electron/notarize/-/notarize-2.1.0.tgz", - "integrity": "sha512-Q02xem1D0sg4v437xHgmBLxI2iz/fc0D4K7fiVWHa/AnW8o7D751xyKNXgziA6HrTOme9ul1JfWN5ark8WH1xA==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@electron/notarize/-/notarize-2.3.0.tgz", + "integrity": "sha512-EiTBU0BwE7HZZjAG1fFWQaiQpCuPrVGn7jPss1kUjD6eTTdXXd29RiZqEqkgN7xqt/Pgn4g3I7Saqovanrfj3w==", "dev": true, "requires": { "debug": "^4.1.1", @@ -27208,9 +27394,9 @@ "requires": {} }, "@electron/universal": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/@electron/universal/-/universal-1.4.1.tgz", - "integrity": "sha512-lE/U3UNw1YHuowNbTmKNs9UlS3En3cPgwM5MI+agIgr/B1hSze9NdOP0qn7boZaI9Lph8IDv3/24g9IxnJP7aQ==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@electron/universal/-/universal-1.5.1.tgz", + "integrity": "sha512-kbgXxyEauPJiQQUNG2VgUeyfQNFk6hBF11ISN2PNI6agUgPl55pv4eQmaqHzTAzchBvqZ2tQuRVaPStGf0mxGw==", "dev": true, "requires": { "@electron/asar": "^3.2.1", @@ -27702,9 +27888,9 @@ } }, "@types/debug": { - "version": "4.1.10", - "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.10.tgz", - "integrity": "sha512-tOSCru6s732pofZ+sMv9o4o3Zc+Sa8l3bxd/tweTQudFn06vAzb13ZX46Zi6m6EJ+RUbRTHvgQJ1gBtSgkaUYA==", + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", + "integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==", "dev": true, "requires": { "@types/ms": "*" @@ -27756,9 +27942,9 @@ "dev": true }, "@types/ms": { - "version": "0.7.33", - "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.33.tgz", - "integrity": "sha512-AuHIyzR5Hea7ij0P9q7vx7xu4z0C28ucwjAZC0ja7JhINyCnOw8/DnvAPQQ9TfOlCtZAmCERKQX9+o1mgQhuOQ==", + "version": "0.7.34", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.34.tgz", + "integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==", "dev": true }, "@types/node": { @@ -27782,9 +27968,9 @@ "dev": true }, "@types/plist": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@types/plist/-/plist-3.0.4.tgz", - "integrity": "sha512-pTa9xUFQFM9WJGSWHajYNljD+DbVylE1q9IweK1LBhUYJdJ28YNU8j3KZ4Q1Qw+cSl4+QLLLOVmqNjhhvVO8fA==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@types/plist/-/plist-3.0.5.tgz", + "integrity": "sha512-E6OCaRmAe4WDmWNsL/9RMqdkkzDCY1etutkflWk4c+AcjDU07Pcz1fQwTX0TQz+Pxqn9i4L1TU3UFpjnrcDgxA==", "dev": true, "optional": true, "requires": { @@ -27807,9 +27993,9 @@ "dev": true }, "@types/verror": { - "version": "1.10.8", - "resolved": "https://registry.npmjs.org/@types/verror/-/verror-1.10.8.tgz", - "integrity": "sha512-YhUhnxRYs/NiVUbIs3F/EzviDP/NZCEAE2Mx5DUqLdldUmphOhFCVh7Kc+7zlYEExM0P8dzfbJi0yRlNb2Bw5g==", + "version": "1.10.10", + "resolved": "https://registry.npmjs.org/@types/verror/-/verror-1.10.10.tgz", + "integrity": "sha512-l4MM0Jppn18hb9xmM6wwD1uTdShpf9Pn80aXTStnK1C94gtPvJcV2FrDmbOQUAQfJ1cKZHktkQUDwEqaAKXMMg==", "dev": true, "optional": true }, @@ -27968,9 +28154,9 @@ "dev": true }, "7zip-bin": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/7zip-bin/-/7zip-bin-5.1.1.tgz", - "integrity": "sha512-sAP4LldeWNz0lNzmTird3uWfFDWWTeg6V/MsmyyLR9X1idwKBWIgt/ZvinqQldJm3LecKEs1emkbquO6PCiLVQ==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/7zip-bin/-/7zip-bin-5.2.0.tgz", + "integrity": "sha512-ukTPVhqG4jNzMro2qA9HSCSSVJN3aN7tlb+hfqYCt3ER0yWroeA2VR38MNrOHLQ/cVj+DaIMad0kFCtWWowh/A==", "dev": true }, "abbrev": { @@ -28363,26 +28549,25 @@ "dev": true }, "app-builder-lib": { - "version": "24.6.4", - "resolved": "https://registry.npmjs.org/app-builder-lib/-/app-builder-lib-24.6.4.tgz", - "integrity": "sha512-m9931WXb83teb32N0rKg+ulbn6+Hl8NV5SUpVDOVz9MWOXfhV6AQtTdftf51zJJvCQnQugGtSqoLvgw6mdF/Rg==", + "version": "24.13.3", + "resolved": "https://registry.npmjs.org/app-builder-lib/-/app-builder-lib-24.13.3.tgz", + "integrity": "sha512-FAzX6IBit2POXYGnTCT8YHFO/lr5AapAII6zzhQO3Rw4cEDOgK+t1xhLc5tNcKlicTHlo9zxIwnYCX9X2DLkig==", "dev": true, "requires": { "@develar/schema-utils": "~2.6.5", - "@electron/notarize": "2.1.0", + "@electron/notarize": "2.2.1", "@electron/osx-sign": "1.0.5", - "@electron/universal": "1.4.1", + "@electron/universal": "1.5.1", "@malept/flatpak-bundler": "^0.4.0", "@types/fs-extra": "9.0.13", - "7zip-bin": "~5.1.1", "async-exit-hook": "^2.0.1", "bluebird-lst": "^1.0.9", - "builder-util": "24.5.0", - "builder-util-runtime": "9.2.1", + "builder-util": "24.13.1", + "builder-util-runtime": "9.2.4", "chromium-pickle-js": "^0.2.0", "debug": "^4.3.4", "ejs": "^3.1.8", - "electron-publish": "24.5.0", + "electron-publish": "24.13.1", "form-data": "^4.0.0", "fs-extra": "^10.1.0", "hosted-git-info": "^4.1.0", @@ -28398,6 +28583,41 @@ "temp-file": "^3.4.0" }, "dependencies": { + "@electron/notarize": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@electron/notarize/-/notarize-2.2.1.tgz", + "integrity": "sha512-aL+bFMIkpR0cmmj5Zgy0LMKEpgy43/hw5zadEArgmAMWWlKc5buwFvFT9G/o/YJkvXAJm5q3iuTuLaiaXW39sg==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "fs-extra": "^9.0.1", + "promise-retry": "^2.0.1" + }, + "dependencies": { + "fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dev": true, + "requires": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + } + } + } + }, + "builder-util-runtime": { + "version": "9.2.4", + "resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-9.2.4.tgz", + "integrity": "sha512-upp+biKpN/XZMLim7aguUyW8s0FUpDvOtK6sbanMFDAMBzpHDqdhgVYm6zc9HJ6nWo7u2Lxk60i2M6Jd3aiNrA==", + "dev": true, + "requires": { + "debug": "^4.3.4", + "sax": "^1.2.4" + } + }, "fs-extra": { "version": "10.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", @@ -30583,16 +30803,16 @@ "optional": true }, "builder-util": { - "version": "24.5.0", - "resolved": "https://registry.npmjs.org/builder-util/-/builder-util-24.5.0.tgz", - "integrity": "sha512-STnBmZN/M5vGcv01u/K8l+H+kplTaq4PAIn3yeuufUKSpcdro0DhJWxPI81k5XcNfC//bjM3+n9nr8F9uV4uAQ==", + "version": "24.13.1", + "resolved": "https://registry.npmjs.org/builder-util/-/builder-util-24.13.1.tgz", + "integrity": "sha512-NhbCSIntruNDTOVI9fdXz0dihaqX2YuE1D6zZMrwiErzH4ELZHE6mdiB40wEgZNprDia+FghRFgKoAqMZRRjSA==", "dev": true, "requires": { "@types/debug": "^4.1.6", - "7zip-bin": "~5.1.1", + "7zip-bin": "~5.2.0", "app-builder-bin": "4.0.0", "bluebird-lst": "^1.0.9", - "builder-util-runtime": "9.2.1", + "builder-util-runtime": "9.2.4", "chalk": "^4.1.2", "cross-spawn": "^7.0.3", "debug": "^4.3.4", @@ -30615,6 +30835,16 @@ "color-convert": "^2.0.1" } }, + "builder-util-runtime": { + "version": "9.2.4", + "resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-9.2.4.tgz", + "integrity": "sha512-upp+biKpN/XZMLim7aguUyW8s0FUpDvOtK6sbanMFDAMBzpHDqdhgVYm6zc9HJ6nWo7u2Lxk60i2M6Jd3aiNrA==", + "dev": true, + "requires": { + "debug": "^4.3.4", + "sax": "^1.2.4" + } + }, "chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -31545,13 +31775,53 @@ } }, "config-file-ts": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/config-file-ts/-/config-file-ts-0.2.4.tgz", - "integrity": "sha512-cKSW0BfrSaAUnxpgvpXPLaaW/umg4bqg4k3GO1JqlRfpx+d5W0GDXznCMkWotJQek5Mmz1MJVChQnz3IVaeMZQ==", + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/config-file-ts/-/config-file-ts-0.2.6.tgz", + "integrity": "sha512-6boGVaglwblBgJqGyxm4+xCmEGcWgnWHSWHY5jad58awQhB6gftq0G8HbzU39YqCIYHMLAiL1yjwiZ36m/CL8w==", "dev": true, "requires": { - "glob": "^7.1.6", - "typescript": "^4.0.2" + "glob": "^10.3.10", + "typescript": "^5.3.3" + }, + "dependencies": { + "glob": { + "version": "10.3.16", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.16.tgz", + "integrity": "sha512-JDKXl1DiuuHJ6fVS2FXjownaavciiHNUU4mOvV/B793RLh05vZL1rcPnCSaOgv1hDT6RDlY7AB7ZUvFYAtPgAw==", + "dev": true, + "requires": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.1", + "minipass": "^7.0.4", + "path-scurry": "^1.11.0" + } + }, + "jackspeak": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.1.2.tgz", + "integrity": "sha512-kWmLKn2tRtfYMF/BakihVVRzBKOxz4gJMiL2Rj91WnAB5TPZumSH99R/Yf1qE1u4uRimvCSJfm6hnxohXeEXjQ==", + "dev": true, + "requires": { + "@isaacs/cliui": "^8.0.2", + "@pkgjs/parseargs": "^0.11.0" + } + }, + "minimatch": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", + "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + }, + "minipass": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.1.tgz", + "integrity": "sha512-UZ7eQ+h8ywIRAW1hIEl2AqdwzJucU/Kp59+8kkZeSvafXhZjul247BvIJjEVFVeON6d7lM46XX1HXCduKAS8VA==", + "dev": true + } } }, "confusing-browser-globals": { @@ -32366,20 +32636,30 @@ } }, "dmg-builder": { - "version": "24.6.4", - "resolved": "https://registry.npmjs.org/dmg-builder/-/dmg-builder-24.6.4.tgz", - "integrity": "sha512-BNcHRc9CWEuI9qt0E655bUBU/j/3wUCYBVKGu1kVpbN5lcUdEJJJeiO0NHK3dgKmra6LUUZlo+mWqc+OCbi0zw==", + "version": "24.13.3", + "resolved": "https://registry.npmjs.org/dmg-builder/-/dmg-builder-24.13.3.tgz", + "integrity": "sha512-rcJUkMfnJpfCboZoOOPf4L29TRtEieHNOeAbYPWPxlaBw/Z1RKrRA86dOI9rwaI4tQSc/RD82zTNHprfUHXsoQ==", "dev": true, "requires": { - "app-builder-lib": "24.6.4", - "builder-util": "24.5.0", - "builder-util-runtime": "9.2.1", + "app-builder-lib": "24.13.3", + "builder-util": "24.13.1", + "builder-util-runtime": "9.2.4", "dmg-license": "^1.0.11", "fs-extra": "^10.1.0", "iconv-lite": "^0.6.2", "js-yaml": "^4.1.0" }, "dependencies": { + "builder-util-runtime": { + "version": "9.2.4", + "resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-9.2.4.tgz", + "integrity": "sha512-upp+biKpN/XZMLim7aguUyW8s0FUpDvOtK6sbanMFDAMBzpHDqdhgVYm6zc9HJ6nWo7u2Lxk60i2M6Jd3aiNrA==", + "dev": true, + "requires": { + "debug": "^4.3.4", + "sax": "^1.2.4" + } + }, "fs-extra": { "version": "10.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", @@ -32611,9 +32891,9 @@ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, "ejs": { - "version": "3.1.9", - "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.9.tgz", - "integrity": "sha512-rC+QVNMJWv+MtPgkt0y+0rVEIdbtxVADApW9JXrUVlzHetgcyczP/E7DJmWJ4fJCZF2cPcBk0laWO9ZHMG3DmQ==", + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", + "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", "dev": true, "requires": { "jake": "^10.8.5" @@ -32630,16 +32910,16 @@ } }, "electron-builder": { - "version": "24.6.4", - "resolved": "https://registry.npmjs.org/electron-builder/-/electron-builder-24.6.4.tgz", - "integrity": "sha512-uNWQoU7pE7qOaIQ6CJHpBi44RJFVG8OHRBIadUxrsDJVwLLo8Nma3K/EEtx5/UyWAQYdcK4nVPYKoRqBb20hbA==", + "version": "24.13.3", + "resolved": "https://registry.npmjs.org/electron-builder/-/electron-builder-24.13.3.tgz", + "integrity": "sha512-yZSgVHft5dNVlo31qmJAe4BVKQfFdwpRw7sFp1iQglDRCDD6r22zfRJuZlhtB5gp9FHUxCMEoWGq10SkCnMAIg==", "dev": true, "requires": { - "app-builder-lib": "24.6.4", - "builder-util": "24.5.0", - "builder-util-runtime": "9.2.1", + "app-builder-lib": "24.13.3", + "builder-util": "24.13.1", + "builder-util-runtime": "9.2.4", "chalk": "^4.1.2", - "dmg-builder": "24.6.4", + "dmg-builder": "24.13.3", "fs-extra": "^10.1.0", "is-ci": "^3.0.0", "lazy-val": "^1.0.5", @@ -32657,6 +32937,16 @@ "color-convert": "^2.0.1" } }, + "builder-util-runtime": { + "version": "9.2.4", + "resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-9.2.4.tgz", + "integrity": "sha512-upp+biKpN/XZMLim7aguUyW8s0FUpDvOtK6sbanMFDAMBzpHDqdhgVYm6zc9HJ6nWo7u2Lxk60i2M6Jd3aiNrA==", + "dev": true, + "requires": { + "debug": "^4.3.4", + "sax": "^1.2.4" + } + }, "chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -32710,6 +33000,33 @@ } } }, + "electron-builder-squirrel-windows": { + "version": "24.13.3", + "resolved": "https://registry.npmjs.org/electron-builder-squirrel-windows/-/electron-builder-squirrel-windows-24.13.3.tgz", + "integrity": "sha512-oHkV0iogWfyK+ah9ZIvMDpei1m9ZRpdXcvde1wTpra2U8AFDNNpqJdnin5z+PM1GbQ5BoaKCWas2HSjtR0HwMg==", + "dev": true, + "peer": true, + "requires": { + "app-builder-lib": "24.13.3", + "archiver": "^5.3.1", + "builder-util": "24.13.1", + "fs-extra": "^10.1.0" + }, + "dependencies": { + "fs-extra": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "dev": true, + "peer": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + } + } + } + }, "electron-chromecast": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/electron-chromecast/-/electron-chromecast-1.1.0.tgz", @@ -32912,14 +33229,14 @@ "integrity": "sha512-QQ4GvrXO+HkgqqEOYbi+DHL7hj5JM+nHi/j+qrN9zeeXVKy8ZABgbu4CnG+BBqDZ2+tbeq9tUC4DZfIWFU5AZA==" }, "electron-publish": { - "version": "24.5.0", - "resolved": "https://registry.npmjs.org/electron-publish/-/electron-publish-24.5.0.tgz", - "integrity": "sha512-zwo70suH15L15B4ZWNDoEg27HIYoPsGJUF7xevLJLSI7JUPC8l2yLBdLGwqueJ5XkDL7ucYyRZzxJVR8ElV9BA==", + "version": "24.13.1", + "resolved": "https://registry.npmjs.org/electron-publish/-/electron-publish-24.13.1.tgz", + "integrity": "sha512-2ZgdEqJ8e9D17Hwp5LEq5mLQPjqU3lv/IALvgp+4W8VeNhryfGhYEQC/PgDPMrnWUp+l60Ou5SJLsu+k4mhQ8A==", "dev": true, "requires": { "@types/fs-extra": "^9.0.11", - "builder-util": "24.5.0", - "builder-util-runtime": "9.2.1", + "builder-util": "24.13.1", + "builder-util-runtime": "9.2.4", "chalk": "^4.1.2", "fs-extra": "^10.1.0", "lazy-val": "^1.0.5", @@ -32935,6 +33252,16 @@ "color-convert": "^2.0.1" } }, + "builder-util-runtime": { + "version": "9.2.4", + "resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-9.2.4.tgz", + "integrity": "sha512-upp+biKpN/XZMLim7aguUyW8s0FUpDvOtK6sbanMFDAMBzpHDqdhgVYm6zc9HJ6nWo7u2Lxk60i2M6Jd3aiNrA==", + "dev": true, + "requires": { + "debug": "^4.3.4", + "sax": "^1.2.4" + } + }, "chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -36917,9 +37244,9 @@ "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" }, "isbinaryfile": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-5.0.0.tgz", - "integrity": "sha512-UDdnyGvMajJUWCkib7Cei/dvyJrrvo4FIrsvSFWdPpXSUorzXrDJ0S+X5Q4ZlasfPjca4yqCNNsjbCeiy8FFeg==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-5.0.2.tgz", + "integrity": "sha512-GvcjojwonMjWbTkfMpnVHVqXW/wKMYDfEpY94/8zy8HFMOqb/VL6oeONq9v87q4ttVlaTLnGXnJD4B5B1OTGIg==", "dev": true }, "isexe": { @@ -36970,9 +37297,9 @@ } }, "jake": { - "version": "10.8.7", - "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.7.tgz", - "integrity": "sha512-ZDi3aP+fG/LchyBzUM804VjddnwfSfsdeYkwt8NcbKRvo4rFkjhs456iLFn3k2ZUWvNe4i48WACDbza8fhq2+w==", + "version": "10.9.1", + "resolved": "https://registry.npmjs.org/jake/-/jake-10.9.1.tgz", + "integrity": "sha512-61btcOHNnLnsOdtLgA5efqQWjnSi/vow5HbI7HMdKKWqvrKR1bLK3BPlJn9gcSaP2ewuamUSMB5XEy76KUIS2w==", "dev": true, "requires": { "async": "^3.2.3", @@ -40113,18 +40440,18 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" }, "path-scurry": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.1.tgz", - "integrity": "sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", "requires": { - "lru-cache": "^9.1.1 || ^10.0.0", + "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" }, "dependencies": { "lru-cache": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz", - "integrity": "sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==" + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.2.tgz", + "integrity": "sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==" } } }, @@ -44161,13 +44488,10 @@ "dev": true }, "tmp": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", - "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", - "dev": true, - "requires": { - "rimraf": "^3.0.0" - } + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz", + "integrity": "sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==", + "dev": true }, "tmp-promise": { "version": "3.0.3", @@ -44477,9 +44801,9 @@ "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" }, "typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "version": "5.4.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", + "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", "dev": true }, "typical": { @@ -44807,9 +45131,9 @@ "requires": {} }, "utf8-byte-length": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.4.tgz", - "integrity": "sha512-4+wkEYLBbWxqTahEsWrhxepcoVOJ+1z5PGIjPZxRkytcdSUaNjIjBM7Xn8E+pdSuV7SzvWovBFA54FO0JSoqhA==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.5.tgz", + "integrity": "sha512-Xn0w3MtiQ6zoz2vFyUVruaCL53O/DwUvkEeOvj+uulMm0BkUGYWmBYVyElqZaSLhY6ZD0ulfU3aBra2aVT4xfA==", "dev": true }, "util": { diff --git a/package.json b/package.json index 82ebb8034..7cc2c0dff 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,11 @@ { "productName": "SikhiToTheMax", "name": "sttm-desktop", - "version": "9.2.0", + "version": "9.2.1", "description": "The SikhiToTheMax desktop app", "main": "app.js", "scripts": { + "prebuild": "cross-env node packaging/update-packagejson.js", "precommit": "npm test", "test": "run-p test:*", "test:lint": "run-p test:lint:*", @@ -43,11 +44,11 @@ "@babel/plugin-transform-runtime": "^7.22.15", "@babel/preset-env": "^7.22.20", "@babel/preset-react": "^7.22.15", - "@electron/notarize": "^2.1.0", + "@electron/notarize": "^2.3.0", "concurrently": "^8.2.1", "cross-env": "^7.0.3", "electron": "^26.2.4", - "electron-builder": "^24.6.4", + "electron-builder": "^24.13.3", "electron-publisher-s3": "^20.17.2", "electron-react-devtools": "^0.5.3", "electron-rebuild": "^3.2.8", @@ -139,7 +140,6 @@ ] }, "copyright": "Copyright © 2022 Khalis Foundation , SikhiToTheMax Trademark SHARE Charity, UK\n", - "afterSign": "packaging/afterSignHook.js", "files": [ "**/*", "!assets${/*}", @@ -177,7 +177,10 @@ "target": [ "dmg", "zip" - ] + ], + "notarize": { + "teamId": "" + } }, "nsis": { "artifactName": "SikhiToTheMaxSetup-${version}.${ext}", @@ -213,4 +216,4 @@ "NSAllowsArbitraryLoads": true } } -} +} \ No newline at end of file diff --git a/packaging/afterSignHook.js b/packaging/afterSignHook.js deleted file mode 100644 index e5aff44b2..000000000 --- a/packaging/afterSignHook.js +++ /dev/null @@ -1,38 +0,0 @@ -/* eslint-disable no-console */ -const fs = require('fs'); -const path = require('path'); -const { notarize } = require('@electron/notarize'); -require('dotenv').config(); - -module.exports = async (params) => { - // Only notarize the app on Mac OS only. - if (process.platform !== 'darwin') { - return; - } - console.log('afterSign hook triggered', params); - - // Same appId in electron-builder. - const appId = 'org.khalisfoundation.sttm'; - - const appPath = path.join(params.appOutDir, `${params.packager.appInfo.productFilename}.app`); - if (!fs.existsSync(appPath)) { - throw new Error(`Cannot find application at: ${appPath}`); - } - - console.log(`Notarizing ${appId} found at ${appPath}`); - - try { - await notarize({ - tool: 'notarytool', - appBundleId: appId, - appPath, - appleId: process.env.APPLE_ID, - appleIdPassword: process.env.APPLE_ID_PASSWORD, - teamId: process.env.APPLE_TEAM_ID, - }); - } catch (error) { - console.error(error); - } - - console.log(`Done notarizing ${appId}`); -}; diff --git a/packaging/update-packagejson.js b/packaging/update-packagejson.js new file mode 100644 index 000000000..f996b6599 --- /dev/null +++ b/packaging/update-packagejson.js @@ -0,0 +1,21 @@ +/* eslint-disable no-console */ +require('dotenv').config(); +const fs = require('fs'); +const packageJson = require('../package.json'); + +const teamId = process.env.APPLE_TEAM_ID; + +if (!teamId) { + console.error('TEAM_ID is not defined in the environment variables'); + process.exit(1); +} + +if (!process.env.I_AM_TRAVIS) { + console.log('Not running on Travis CI. Skipping update.'); + process.exit(0); +} + +packageJson.build.mac.notarize.teamId = teamId; + +fs.writeFileSync('./package.json', JSON.stringify(packageJson, null, 2), 'utf-8'); +console.log('package.json has been updated with the APPLE_TEAM_ID'); diff --git a/www/assets/img/help_images/content-order.gif b/www/assets/img/help_images/content-order.gif new file mode 100644 index 000000000..f55f65796 Binary files /dev/null and b/www/assets/img/help_images/content-order.gif differ diff --git a/www/assets/img/help_images/multipane-preview.gif b/www/assets/img/help_images/multipane-preview.gif new file mode 100644 index 000000000..80050162a Binary files /dev/null and b/www/assets/img/help_images/multipane-preview.gif differ diff --git a/www/assets/img/icons/ellipsis-vertical-solid.svg b/www/assets/img/icons/ellipsis-vertical-solid.svg new file mode 100644 index 000000000..8891fa75f --- /dev/null +++ b/www/assets/img/icons/ellipsis-vertical-solid.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/www/assets/img/icons/monitor-slash.png b/www/assets/img/icons/monitor-slash.png index ff1c15fb6..22dd8a958 100644 Binary files a/www/assets/img/icons/monitor-slash.png and b/www/assets/img/icons/monitor-slash.png differ diff --git a/www/assets/img/icons/monitor.png b/www/assets/img/icons/monitor.png index 3d9b2d00a..15b6dba25 100644 Binary files a/www/assets/img/icons/monitor.png and b/www/assets/img/icons/monitor.png differ diff --git a/www/assets/img/icons/reset-transparent.svg b/www/assets/img/icons/reset-transparent.svg new file mode 100644 index 000000000..b7ab29a8d --- /dev/null +++ b/www/assets/img/icons/reset-transparent.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/www/assets/img/icons/user-logout.png b/www/assets/img/icons/user-logout.png index 45b5c257e..fc5896935 100644 Binary files a/www/assets/img/icons/user-logout.png and b/www/assets/img/icons/user-logout.png differ diff --git a/www/assets/img/logo.png b/www/assets/img/logo.png index 8c4d44c53..8e7811e8f 100644 Binary files a/www/assets/img/logo.png and b/www/assets/img/logo.png differ diff --git a/www/configs/navigator-settings.json b/www/configs/navigator-settings.json index e0d43a06f..3295c0f89 100644 --- a/www/configs/navigator-settings.json +++ b/www/configs/navigator-settings.json @@ -16,6 +16,7 @@ "savedCrossPlatformId": null, "historyOrder": "newest", + "isMiscSlide": false, "miscSlideText": "", "isMiscSlideGurmukhi": false, @@ -44,5 +45,35 @@ "isDontSaveHistory": false, "favShabad": [], "searchVerse": "", - "currentMiscPanel": "History" + "currentMiscPanel": "History", + + "activePaneId": null, + + "pane1": { + "locked": false, + "activeShabad": null, + "activeVerse": "", + "versesRead": [], + "homeVerse": false, + "content":"", + "baniType": "" + }, + "pane2": { + "locked": false, + "activeShabad": null, + "activeVerse": "", + "versesRead": [], + "homeVerse": false, + "content":"", + "baniType": "" + }, + "pane3": { + "locked": false, + "activeShabad": null, + "activeVerse": "", + "versesRead": [], + "homeVerse": false, + "content":"", + "baniType": "" + } } diff --git a/www/configs/overlay_presets.json b/www/configs/overlay_presets.json index f12ee825a..5af8cc19d 100644 --- a/www/configs/overlay_presets.json +++ b/www/configs/overlay_presets.json @@ -31,9 +31,9 @@ }, "floral": { "label": "FLORAL", - "bgColor": "#f5b7d1", - "textColor": "#a3eafd", - "gurbaniTextColor": "#440a1d" + "bgColor": "#ff7ab2", + "textColor": "#570532", + "gurbaniTextColor": "#ffffff" }, "khalsaGold": { "label": "KHALSA_GOLD", diff --git a/www/configs/user-settings.json b/www/configs/user-settings.json index 76b825aa5..203954ff5 100644 --- a/www/configs/user-settings.json +++ b/www/configs/user-settings.json @@ -28,16 +28,17 @@ "step": 1, "settings": [ "gurbani-font-size", - "translation-font-size", - "transliteration-font-size", - "teeka-font-size", - "announcements-font-size" + "content1-font-size", + "content2-font-size", + "content3-font-size", + "announcements-font-size", + "reset-font-sizes" ] }, "visibility": { "title": "VISIBILITY", "type": "checkbox", - "settings": ["translation-visibility", "transliteration-visibility", "teeka-visibility"] + "settings": ["content1-visibility", "content2-visibility", "content3-visibility"] }, "autoplay-options": { "title": "AUTOPLAY_OPTIONS", @@ -57,13 +58,7 @@ "language": { "title": "LANGUAGE_SETTINGS", "type": "dropdown", - "settings": [ - "teeka-source", - "translation-language", - "translation-english-source", - "translation-hindi-source", - "transliteration-language" - ] + "settings": ["teeka-source"] }, "app-settings": { "title": "APP_SETTINGS", @@ -86,40 +81,132 @@ "title": "BANI", "initialValue": 9 }, - "translation-font-size": { - "title": "TRANSLATION", + "content1-font-size": { + "title": "", "initialValue": 5, - "addon": "translation-visibility" + "addon": ["content1-visibility", "content1"] }, - "teeka-font-size": { - "title": "PUNJABI_TEEKA", + "content2-font-size": { + "title": "", "initialValue": 4, - "addon": "teeka-visibility" + "addon": ["content2-visibility", "content2"] }, - "transliteration-font-size": { - "title": "TRANSLITERATION", + "content3-font-size": { + "title": "", "initialValue": 4, - "addon": "transliteration-visibility" + "addon": ["content3-visibility", "content3"] }, "announcements-font-size": { "title": "ANNOUNCEMENTS", "initialValue": 7 }, - "translation-visibility": { + "reset-font-sizes": { + "title": "RESET_FONT_SIZES", + "type": "reset-button", + "resetSettings": [ + "gurbani-font-size", + "content1-font-size", + "content2-font-size", + "content3-font-size", + "announcements-font-size" + ] + }, + "content1-visibility": { "title": "TRANSLATION_VISIBILITY", "type": "checkbox", "initialValue": true }, - "teeka-visibility": { + "content2-visibility": { "title": "TEEKA_VISIBILITY", "type": "checkbox", "initialValue": true }, - "transliteration-visibility": { + "content3-visibility": { "title": "TRANSLITERATION_VISIBILITY", "type": "checkbox", "initialValue": true }, + "content1": { + "title": "", + "initialValue": "translation-english", + "type": "multilevel-dropdown", + "disableWhen": "content1-visibility", + "options": [ + { + "label": "teeka", + "options": [{ "id": "teeka-punjabi", "text": "Punjabi" }] + }, + { + "label": "translation", + "options": [ + { "id": "translation-english", "text": "English" }, + { "id": "translation-hindi", "text": "Hindi" }, + { "id": "translation-spanish", "text": "Spanish" } + ] + }, + { + "label": "transliteration", + "options": [ + { "id": "transliteration-english", "text": "English" }, + { "id": "transliteration-hindi", "text": "Hindi" } + ] + } + ] + }, + "content2": { + "title": "", + "initialValue": "teeka-punjabi", + "type": "multilevel-dropdown", + "disableWhen": "content2-visibility", + "options": [ + { + "label": "teeka", + "options": [{ "id": "teeka-punjabi", "text": "Punjabi" }] + }, + { + "label": "translation", + "options": [ + { "id": "translation-english", "text": "English" }, + { "id": "translation-hindi", "text": "Hindi" }, + { "id": "translation-spanish", "text": "Spanish" } + ] + }, + { + "label": "transliteration", + "options": [ + { "id": "transliteration-english", "text": "English" }, + { "id": "transliteration-hindi", "text": "Hindi" } + ] + } + ] + }, + "content3": { + "title": "", + "initialValue": "transliteration-english", + "type": "multilevel-dropdown", + "disableWhen": "content3-visibility", + "options": [ + { + "label": "teeka", + "options": [{ "id": "teeka-punjabi", "text": "Punjabi" }] + }, + { + "label": "translation", + "options": [ + { "id": "translation-english", "text": "English" }, + { "id": "translation-hindi", "text": "Hindi" }, + { "id": "translation-spanish", "text": "Spanish" } + ] + }, + { + "label": "transliteration", + "options": [ + { "id": "transliteration-english", "text": "English" }, + { "id": "transliteration-hindi", "text": "Hindi" } + ] + } + ] + }, "akhandpatt": { "title": "AKHAND_PATH_VIEW", "notes": "CHROMECAST_UNAVAILABLE", @@ -224,7 +311,7 @@ "type": "dropdown", "options": { "bdb": "BANI_DB", - "ms":"MANMOHAN_SINGH", + "ms": "MANMOHAN_SINGH", "ssk": "SANT_SINGH_KHALSA" }, "condition": "translation-language", @@ -235,7 +322,7 @@ "title": "TRANSLATION_SOURCE", "type": "dropdown", "options": { - "ss":"SAHIB_SINGH", + "ss": "SAHIB_SINGH", "sts": "SANT_SINGH" }, "condition": "translation-language", @@ -248,7 +335,7 @@ "options": { "bdb": "BANI_DB", "ft": "FAREEDKOT", - "ms":"MANMOHAN_SINGH", + "ms": "MANMOHAN_SINGH", "ss": "SANT_SINGH" }, "initialValue": "bdb" @@ -294,9 +381,13 @@ "initialValue": false, "dontApplyClass": true }, - "isSingleDisplayMode": { - "title": "SINGLE_DISPLAY", - "initialValue": false + "currentWorkspace": { + "title": "CURRENT_WORKSPACE", + "initialValue": "Presentation" + }, + "defaultPaneId": { + "title": "DEFAULT_PANE", + "initialValue": 1 } } } diff --git a/www/locales/en.json b/www/locales/en.json index 593343e1a..8d4439459 100644 --- a/www/locales/en.json +++ b/www/locales/en.json @@ -28,6 +28,7 @@ "FIT_TEXT": "Fit text", "BG": "BG", "COPY_URL": "Copy URL", + "COPIED_URL": "Copied!", "LARIVAAR": "Larivaar", "LARIVAAR_ASSIST":"Larivaar Assist", "LAYOUT": "Layout", @@ -68,7 +69,8 @@ }, "WORKSPACES": { "PRESENTER": "Presentation", - "SINGLE_DISPLAY": "Single Display" + "SINGLE_DISPLAY": "Single-Display", + "MULTI_PANE": "Multi-Pane" }, "CHROMECAST": { "CANCEL": "Cancel", @@ -89,11 +91,12 @@ "DOWNLOADING": "Downloading database..." }, "INSERT": { - "ADD_ANNOUNCEMENT": "Display Announcement", + "ADD_ANNOUNCEMENT": "Publish", "ADD_ANNOUNCEMENT_SLIDE": "Add Announcement Slide", "ADD_ANNOUNCEMENT_TEXT": "Announcement goes here...", "ADD_ANNOUNCEMENT_TEXT_GURMUKHI": "GoSxw ie`Qy ilKo...", - "ADD_DHAN_GURU": "Add Dhan Guru", + "ADD_SLIDES": "Popular Slides", + "ADD_DHAN_GURU": "Ten Guru Slides", "ADD_EMPTY_SLIDE": "Add Empty Slide", "ADD_WAHEGURU_SLIDE": "Add Waheguru Slide", "ANNOUNCEMENT": "Announcement", @@ -119,6 +122,14 @@ "TEG_BAHADUR_SAHIB_JI": "Guru Teg Bahadur Ji" } }, + "MULTI_PANE": { + "CLEAR_PANE": "Clear Pane", + "MISC_SLIDES": "Misc Slides", + "SHABAD": "Shabad", + "SHABAD_BTN": "Back to shabad", + "FAVORITES": "Favorite Shabads", + "LOCKED_PANE_MSG": "This pane is locked" + }, "MENU": { "APP": { "ABOUT": "About {{appName}}", @@ -300,6 +311,8 @@ "PUNJABI_TEEKA": "Punjabi Teeka", "TRANSLATION": "Translation", "TRANSLITERATION": "Transliteration", + "RESET_FONT_SIZES": "Reset Font Sizes", + "RESET_TO_DEFAULT": "Reset to Default", "DISPLAY_OPTIONS": "Display Options", "AKHAND_PATH_VIEW": "Akhand Paatth View (Beta)", "CHROMECAST_UNAVAILABLE": "Google Chromecast Unavailable", diff --git a/www/main/addons/announcement/components/Annoucement.jsx b/www/main/addons/announcement/components/Annoucement.jsx index 02a413e15..c4347a180 100644 --- a/www/main/addons/announcement/components/Annoucement.jsx +++ b/www/main/addons/announcement/components/Annoucement.jsx @@ -27,7 +27,12 @@ const Announcement = ({ isGurmukhi }) => { const HandleKeyboardToggle = () => { setKeyboardOpenStatus(!keyboardOpenStatus); - analytics.trackEvent('display', 'announcement-slide', 'announcement-in-gurmukhi', isGurmukhi); + analytics.trackEvent({ + category: 'display', + action: 'announcement-slide', + label: 'announcement-in-gurmukhi', + value: isGurmukhi, + }); }; const addMiscSlide = (givenText) => { diff --git a/www/main/addons/announcement/components/AnnouncementOverlay.jsx b/www/main/addons/announcement/components/AnnouncementOverlay.jsx index 5a4959cae..681b71f00 100644 --- a/www/main/addons/announcement/components/AnnouncementOverlay.jsx +++ b/www/main/addons/announcement/components/AnnouncementOverlay.jsx @@ -5,6 +5,7 @@ import { useStoreState } from 'easy-peasy'; import { Overlay, Switch } from '../../../common/sttm-ui'; import Announcement from './Annoucement'; import { DhanGuru } from './DhanGuru'; +import MiscSlides from './MiscSlides'; const AnnouncementPane = ({ onScreenClose, className }) => { const { isMiscSlideGurmukhi } = useStoreState((state) => state.navigator); @@ -32,6 +33,7 @@ const AnnouncementPane = ({ onScreenClose, className }) => { /> + diff --git a/www/main/addons/announcement/components/DhanGuru.jsx b/www/main/addons/announcement/components/DhanGuru.jsx index 003d8e9e5..9be167176 100644 --- a/www/main/addons/announcement/components/DhanGuru.jsx +++ b/www/main/addons/announcement/components/DhanGuru.jsx @@ -40,10 +40,20 @@ export const DhanGuru = ({ isGurmukhi }) => { } if (typeof e === 'object') { addMiscSlide(e.target.value); - analytics.trackEvent('display', 'dhanguru-slide', e.target.value); + analytics.trackEvent({ + category: 'display', + action: 'dhanguru-slide', + label: 'Dhan guru slide', + value: e.target.value, + }); } else { addMiscSlide(e); - analytics.trackEvent('display', 'dhanguru-slide', e); + analytics.trackEvent({ + category: 'display', + action: 'dhanguru-slide', + label: 'Dhan guru slide', + value: e, + }); } }; diff --git a/www/main/addons/announcement/components/MiscSlides.jsx b/www/main/addons/announcement/components/MiscSlides.jsx new file mode 100644 index 000000000..a59c31833 --- /dev/null +++ b/www/main/addons/announcement/components/MiscSlides.jsx @@ -0,0 +1,94 @@ +import React, { useRef, useState } from 'react'; +import { useStoreState } from 'easy-peasy'; + +import { useSlides } from '../../../common/hooks'; +import { MultipaneDropdown } from '../../../common/sttm-ui'; + +const remote = require('@electron/remote'); + +const { i18n } = remote.require('./app'); + +const MiscSlides = () => { + const { + displayWaheguruSlide, + displayMoolMantraSlide, + displayBlankViewer, + displayAnandSahibBhog, + } = useSlides(); + + const { currentWorkspace } = useStoreState((state) => state.userSettings); + + const [paneSelectorActive, setPaneSelectorActive] = useState(false); + const paneSelector = useRef(null); + + const openSlideFromDropdown = (paneId) => { + displayAnandSahibBhog({ openedFrom: 'shortcut-tray', paneId }); + setPaneSelectorActive(false); + }; + + return ( + <> +
+

{i18n.t('INSERT.ADD_SLIDES')}

+
+ +
+ { + + } + + + + +
+ + ); +}; + +export default MiscSlides; diff --git a/www/main/addons/bani-controller/components/BaniController.jsx b/www/main/addons/bani-controller/components/BaniController.jsx index 8e0e04705..11a709736 100644 --- a/www/main/addons/bani-controller/components/BaniController.jsx +++ b/www/main/addons/bani-controller/components/BaniController.jsx @@ -73,24 +73,28 @@ const BaniController = ({ onScreenClose, className }) => { const { gurbaniFontSize, - translationFontSize, - transliterationFontSize, - teekaFontSize, + content1FontSize, + content2FontSize, + content3FontSize, baniLength, // mangalPosition, } = useStoreState((state) => state.userSettings); const fontSizes = { gurbani: parseInt(gurbaniFontSize, 10), - translation: parseInt(translationFontSize, 10), - teeka: parseInt(teekaFontSize, 10), - transliteration: parseInt(transliterationFontSize, 10), + translation: parseInt(content1FontSize, 10), + teeka: parseInt(content2FontSize, 10), + transliteration: parseInt(content3FontSize, 10), }; const showSyncError = (errorMessage) => { setCodeLabel(errorMessage); - setCode(null); - setAdminPin(null); + if (code !== null) { + setCode(null); + } + if (adminPin !== null) { + setAdminPin(null); + } }; const remoteSyncInit = async () => { diff --git a/www/main/addons/bani-controller/utils/get-bani-controller-items.js b/www/main/addons/bani-controller/utils/get-bani-controller-items.js index 6cd690f58..3f3487deb 100644 --- a/www/main/addons/bani-controller/utils/get-bani-controller-items.js +++ b/www/main/addons/bani-controller/utils/get-bani-controller-items.js @@ -49,7 +49,12 @@ const getBaniControllerItems = ({ code, }); setMiscSlideText(syncString); - analytics.trackEvent('controller', 'codePresented', true); + analytics.trackEvent({ + category: 'controller', + action: 'codePresented', + label: 'present code', + value: true, + }); analytics.trackEvent({ category: 'controller', action: 'codePresented', diff --git a/www/main/addons/ceremonies/components/CeremonyPane.jsx b/www/main/addons/ceremonies/components/CeremonyPane.jsx index f406d1d5e..e6100df04 100644 --- a/www/main/addons/ceremonies/components/CeremonyPane.jsx +++ b/www/main/addons/ceremonies/components/CeremonyPane.jsx @@ -1,8 +1,8 @@ -import React, { useState, useEffect } from 'react'; +import React, { useState, useEffect, useRef } from 'react'; import PropTypes from 'prop-types'; import { useStoreActions, useStoreState } from 'easy-peasy'; -import { Switch, Tile } from '../../../common/sttm-ui'; +import { MultipaneDropdown, Switch, Tile } from '../../../common/sttm-ui'; import { ceremoniesFilter } from '../../../common/constants'; import { getUserPreferenceFor } from '../utils'; @@ -17,7 +17,13 @@ const { getTheme } = require('../../../theme_editor'); const CeremonyPane = ({ token, name, id, onScreenClose }) => { const { setTheme, setThemeBg } = useStoreActions((state) => state.userSettings); - const { theme: currentTheme } = useStoreState((state) => state.userSettings); + const { setPane1, setPane2, setPane3 } = useStoreActions((state) => state.navigator); + const { pane1, pane2, pane3 } = useStoreState((state) => state.navigator); + const { theme: currentTheme, currentWorkspace } = useStoreState((state) => state.userSettings); + + const [paneSelectorActive, setPaneSelectorActive] = useState(false); + + const paneSelector = useRef(null); const { ceremonyId, isCeremonyBani, isSundarGutkaBani } = useStoreState( (state) => state.navigator, @@ -36,7 +42,22 @@ const CeremonyPane = ({ token, name, id, onScreenClose }) => { } }, []); - const onThemeClick = (theme) => { + const openPaneMenu = (e, theme) => { + paneSelector.current.style.left = `${e.clientX - 100}px`; + if (window.innerHeight - e.clientY > 200) { + paneSelector.current.style.top = `${e.clientY - 10}px`; + } else { + paneSelector.current.style.top = `${e.clientY - 195}px`; + } + paneSelector.current.dataset.theme = JSON.stringify(theme); + setPaneSelectorActive(true); + }; + + const onThemeClick = (theme, multipaneId = null) => { + let parsedTheme = theme; + if (typeof theme === 'string') { + parsedTheme = JSON.parse(theme); + } if (isSundarGutkaBani) { setIsSundarGutkaBani(false); } @@ -48,13 +69,43 @@ const CeremonyPane = ({ token, name, id, onScreenClose }) => { setIsCeremonyBani(true); } onScreenClose(); - if (currentTheme !== theme.key) { - applyTheme(theme, null, setTheme, setThemeBg); + if (currentTheme !== parsedTheme.key) { + applyTheme(parsedTheme, null, setTheme, setThemeBg); + } + if (multipaneId !== null) { + switch (multipaneId) { + case 1: + setPane1({ + ...pane1, + content: i18n.t('MULTI_PANE.SHABAD'), + baniType: 'ceremony', + activeShabad: currentCeremony, + }); + break; + case 2: + setPane2({ + ...pane2, + content: i18n.t('MULTI_PANE.SHABAD'), + baniType: 'ceremony', + activeShabad: currentCeremony, + }); + break; + case 3: + setPane3({ + ...pane3, + content: i18n.t('MULTI_PANE.SHABAD'), + baniType: 'ceremony', + activeShabad: currentCeremony, + }); + break; + default: + break; + } } analytics.trackEvent({ category: 'ceremony', action: 'theme', - label: theme.key, + label: parsedTheme.key, value: currentCeremony, }); }; @@ -85,8 +136,21 @@ const CeremonyPane = ({ token, name, id, onScreenClose }) => { current: getTheme(currentTheme), }; + const openCeremonyFromDropdown = (givenPane) => { + onThemeClick(paneSelector.current.dataset.theme, givenPane); + setPaneSelectorActive(false); + }; + return (
+ { + + }
{name}
@@ -115,8 +179,12 @@ const CeremonyPane = ({ token, name, id, onScreenClose }) => {
{i18n.t('TOOLBAR.CHOOSE_THEME')}
{ - onThemeClick(themes.light); + onClick={(e) => { + if (currentWorkspace === i18n.t('WORKSPACES.MULTI_PANE')) { + openPaneMenu(e, themes.light); + } else { + onThemeClick(themes.light); + } }} className="theme-instance" theme={themes.light} @@ -125,8 +193,12 @@ const CeremonyPane = ({ token, name, id, onScreenClose }) => { { - onThemeClick(themes[token]); + onClick={(e) => { + if (currentWorkspace === i18n.t('WORKSPACES.MULTI_PANE')) { + openPaneMenu(e, themes[token]); + } else { + onThemeClick(e, themes[token]); + } }} className="theme-instance" theme={themes[token]} @@ -135,8 +207,12 @@ const CeremonyPane = ({ token, name, id, onScreenClose }) => { { - onThemeClick(themes.current); + onClick={(e) => { + if (currentWorkspace === i18n.t('WORKSPACES.MULTI_PANE')) { + openPaneMenu(e, themes.current); + } else { + onThemeClick(e, themes.current); + } }} className="theme-instance" theme={themes.current} diff --git a/www/main/addons/sundar-gutka/components/ExtraBani.jsx b/www/main/addons/sundar-gutka/components/ExtraBani.jsx index 935cc71d3..5009b7a4e 100644 --- a/www/main/addons/sundar-gutka/components/ExtraBani.jsx +++ b/www/main/addons/sundar-gutka/components/ExtraBani.jsx @@ -4,7 +4,7 @@ import anvaad from 'anvaad-js'; import { Tile } from '../../../common/sttm-ui'; import { convertToHyphenCase } from '../../../common/utils'; -const ExtraBani = ({ title, banis = [], loadBani, isEngTransliterated = false }) => { +const ExtraBani = ({ title, banis = [], getBani, isEngTransliterated = false }) => { const hyphenedTitle = convertToHyphenCase(title.toLowerCase()); const groupHeaderClassName = `${hyphenedTitle}-heading`; const groupClassName = hyphenedTitle; @@ -16,7 +16,9 @@ const ExtraBani = ({ title, banis = [], loadBani, isEngTransliterated = false })
{banis.map(({ id, name }) => ( loadBani(id)} + onClick={(e) => { + getBani(e, id); + }} key={name} type="extras" className={groupItemClassName} @@ -33,7 +35,7 @@ const ExtraBani = ({ title, banis = [], loadBani, isEngTransliterated = false }) ExtraBani.propTypes = { title: PropTypes.string, banis: PropTypes.array, - loadBani: PropTypes.func, + getBani: PropTypes.func, isEngTransliterated: PropTypes.bool, }; diff --git a/www/main/addons/sundar-gutka/components/SundarGutka.jsx b/www/main/addons/sundar-gutka/components/SundarGutka.jsx index 070cf6fab..43016843f 100644 --- a/www/main/addons/sundar-gutka/components/SundarGutka.jsx +++ b/www/main/addons/sundar-gutka/components/SundarGutka.jsx @@ -1,9 +1,9 @@ -import React, { useState } from 'react'; +import React, { useRef, useState } from 'react'; import PropTypes from 'prop-types'; import anvaad from 'anvaad-js'; import { useStoreState, useStoreActions } from 'easy-peasy'; -import { Switch, Overlay } from '../../../common/sttm-ui'; +import { Switch, Overlay, MultipaneDropdown } from '../../../common/sttm-ui'; import ExtraBani from './ExtraBani'; import { convertToHyphenCase } from '../../../common/utils'; import { nitnemBaniIds, popularBaniIds } from '../../../common/constants'; @@ -15,18 +15,34 @@ const analytics = remote.getGlobal('analytics'); const { i18n } = remote.require('./app'); const SundarGutka = ({ isShowTranslitSwitch = false, onScreenClose }) => { - const { isSundarGutkaBani, sundarGutkaBaniId, isCeremonyBani, singleDisplayActiveTab } = - useStoreState((state) => state.navigator); + const { + isSundarGutkaBani, + sundarGutkaBaniId, + isCeremonyBani, + singleDisplayActiveTab, + pane1, + pane2, + pane3, + } = useStoreState((state) => state.navigator); + + const { currentWorkspace } = useStoreState((state) => state.userSettings); + const { setIsSundarGutkaBani, setSundarGutkaBaniId, setIsCeremonyBani, setSingleDisplayActiveTab, + setPane1, + setPane2, + setPane3, } = useStoreActions((state) => state.navigator); const { isLoadingBanis, banis } = useLoadBani(); const [isTranslit, setTranslitState] = useState(false); const [isEngTransliterated, setEngTransliterate] = useState(false); + const [paneSelectorActive, setPaneSelectorActive] = useState(false); + + const paneSelector = useRef(null); const nitnemBanis = []; const popularBanis = []; @@ -51,7 +67,18 @@ const SundarGutka = ({ isShowTranslitSwitch = false, onScreenClose }) => { return b; }); - const loadBani = (baniId) => { + const openPaneMenu = (e, baniId) => { + paneSelector.current.style.left = `${e.clientX - 100}px`; + if (window.innerHeight - e.clientY > 200) { + paneSelector.current.style.top = `${e.clientY - 10}px`; + } else { + paneSelector.current.style.top = `${e.clientY - 195}px`; + } + paneSelector.current.dataset.baniId = baniId; + setPaneSelectorActive(true); + }; + + const loadBani = (baniId, paneId = null) => { if (isCeremonyBani) { setIsCeremonyBani(false); } @@ -68,6 +95,37 @@ const SundarGutka = ({ isShowTranslitSwitch = false, onScreenClose }) => { setSingleDisplayActiveTab('shabad'); } + if (paneId !== null) { + switch (paneId) { + case 1: + setPane1({ + ...pane1, + content: i18n.t('MULTI_PANE.SHABAD'), + baniType: 'bani', + activeShabad: baniId, + }); + break; + case 2: + setPane2({ + ...pane2, + content: i18n.t('MULTI_PANE.SHABAD'), + baniType: 'bani', + activeShabad: baniId, + }); + break; + case 3: + setPane3({ + ...pane3, + content: i18n.t('MULTI_PANE.SHABAD'), + baniType: 'bani', + activeShabad: baniId, + }); + break; + default: + break; + } + } + analytics.trackEvent({ category: 'sundar-gutka', action: 'bani', @@ -76,6 +134,19 @@ const SundarGutka = ({ isShowTranslitSwitch = false, onScreenClose }) => { onScreenClose(); }; + const getBani = (e, baniId) => { + if (currentWorkspace === i18n.t('WORKSPACES.MULTI_PANE')) { + openPaneMenu(e, baniId); + } else { + loadBani(baniId); + } + }; + + const openBaniFromDropdown = (paneId) => { + loadBani(parseInt(paneSelector.current.dataset.baniId, 10), paneId); + setPaneSelectorActive(false); + }; + return (
@@ -112,12 +183,24 @@ const SundarGutka = ({ isShowTranslitSwitch = false, onScreenClose }) => { )}
+ { + + }
    {taggedBanis.map((bani) => (
  • loadBani(bani.id)} + onClick={(e) => + currentWorkspace === i18n.t('WORKSPACES.MULTI_PANE') + ? openPaneMenu(e, bani.id) + : loadBani(bani.id) + } > @@ -138,7 +221,7 @@ const SundarGutka = ({ isShowTranslitSwitch = false, onScreenClose }) => { )} @@ -146,7 +229,7 @@ const SundarGutka = ({ isShowTranslitSwitch = false, onScreenClose }) => { )} diff --git a/www/main/common/hooks/index.js b/www/main/common/hooks/index.js index 7e0016b01..47086e60f 100644 --- a/www/main/common/hooks/index.js +++ b/www/main/common/hooks/index.js @@ -1 +1,2 @@ export { useKeys } from './useKeys'; +export { useSlides } from './useSlides'; diff --git a/www/main/common/hooks/useSlides.js b/www/main/common/hooks/useSlides.js new file mode 100644 index 000000000..15222a749 --- /dev/null +++ b/www/main/common/hooks/useSlides.js @@ -0,0 +1,133 @@ +import { useStoreActions, useStoreState } from 'easy-peasy'; +import insertSlide from '../constants/slidedb'; + +const remote = require('@electron/remote'); + +const { i18n } = remote.require('./app'); + +const analytics = remote.getGlobal('analytics'); + +export const useSlides = () => { + const { akhandpatt, currentWorkspace } = useStoreState((state) => state.userSettings); + const { setAkhandpatt } = useStoreActions((state) => state.userSettings); + const { + isMiscSlide, + miscSlideText, + isAnnoucement, + isSundarGutkaBani, + isCeremonyBani, + ceremonyId, + pane1, + pane2, + pane3, + } = useStoreState((state) => state.navigator); + const { + setIsMiscSlide, + setMiscSlideText, + setIsAnnoucement, + setIsSundarGutkaBani, + setIsCeremonyBani, + setCeremonyId, + setPane1, + setPane2, + setPane3, + } = useStoreActions((state) => state.navigator); + + const addMiscSlide = (givenText) => { + if (isAnnoucement) { + setIsAnnoucement(false); + } + if (!isMiscSlide) { + if (akhandpatt) { + setAkhandpatt(false); + } + setIsMiscSlide(true); + } + if (miscSlideText !== givenText) { + setMiscSlideText(givenText); + } + }; + + const displayWaheguruSlide = ({ openedFrom }) => { + addMiscSlide(insertSlide.slideStrings.waheguru); + analytics.trackEvent({ + category: 'display', + action: 'waheguru-slide', + label: `Opened from: ${openedFrom}`, + }); + }; + + const displayMoolMantraSlide = ({ openedFrom }) => { + addMiscSlide(insertSlide.slideStrings.moolMantra); + analytics.trackEvent({ + category: 'display', + action: 'moool-mantra-slide', + label: `Opened from: ${openedFrom}`, + }); + }; + + const displayBlankViewer = ({ openedFrom }) => { + addMiscSlide(''); + analytics.trackEvent({ + category: 'display', + action: 'empty-slide', + label: `Opened from: ${openedFrom}`, + }); + }; + + const displayAnandSahibBhog = ({ openedFrom, paneId = null }) => { + if (isSundarGutkaBani) { + setIsSundarGutkaBani(false); + } + if (ceremonyId !== 3) { + setCeremonyId(3); + } + if (!isCeremonyBani) { + setIsCeremonyBani(true); + } + if (currentWorkspace === i18n.t('WORKSPACES.MULTI_PANE')) { + if (paneId) { + switch (paneId) { + case 1: + setPane1({ + ...pane1, + content: i18n.t('MULTI_PANE.SHABAD'), + baniType: 'ceremony', + activeShabad: 3, + }); + break; + case 2: + setPane2({ + ...pane2, + content: i18n.t('MULTI_PANE.SHABAD'), + baniType: 'ceremony', + activeShabad: 3, + }); + break; + case 3: + setPane3({ + ...pane3, + content: i18n.t('MULTI_PANE.SHABAD'), + baniType: 'ceremony', + activeShabad: 3, + }); + break; + default: + break; + } + } + } + analytics.trackEvent({ + category: 'ceremony', + action: 'anand-sahib-bhog', + label: `Opened from: ${openedFrom}`, + }); + }; + + return { + displayWaheguruSlide, + displayMoolMantraSlide, + displayBlankViewer, + displayAnandSahibBhog, + }; +}; diff --git a/www/main/common/sttm-ui/index.js b/www/main/common/sttm-ui/index.js index c291e49b7..babe78bcc 100644 --- a/www/main/common/sttm-ui/index.js +++ b/www/main/common/sttm-ui/index.js @@ -10,3 +10,4 @@ export { default as SearchResults } from './search-results'; export { default as ShabadVerse } from './shabad-verse'; export { default as FilterDropdown } from './filter-dropdown'; export { default as FilterTag } from './filter-tag'; +export { default as MultipaneDropdown } from './multipane-dropdown'; diff --git a/www/main/common/sttm-ui/multipane-dropdown/MultipaneDropdown.jsx b/www/main/common/sttm-ui/multipane-dropdown/MultipaneDropdown.jsx new file mode 100644 index 000000000..9a6800467 --- /dev/null +++ b/www/main/common/sttm-ui/multipane-dropdown/MultipaneDropdown.jsx @@ -0,0 +1,55 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import { useStoreState } from 'easy-peasy'; + +const remote = require('@electron/remote'); + +const { i18n } = remote.require('./app'); + +const MultipaneDropdown = ({ + paneSelectorActive, + setPaneSelectorActive, + paneSelector, + clickHandler, +}) => { + const { pane1, pane2, pane3 } = useStoreState((state) => state.navigator); + const dropdownOptions = [pane1, pane2, pane3].map((item, index) => ( +

    { + if (!item.locked) { + clickHandler(index + 1); + } + }} + title={item.locked ? i18n.t('MULTI_PANE.LOCKED_PANE_MSG') : ''} + className={`history-item option-pane-${index + 1} ${item.locked ? 'locked-option' : ''}`} + > + {`Pane ${index + 1}`} + {item.locked ? ( + + ) : ( + '' + )} +

    + )); + return ( +
    setPaneSelectorActive(false)} + > + {dropdownOptions} +
    + ); +}; + +MultipaneDropdown.propTypes = { + paneSelectorActive: PropTypes.bool, + setPaneSelectorActive: PropTypes.func, + paneSelector: PropTypes.object, + clickHandler: PropTypes.func, +}; + +export default MultipaneDropdown; diff --git a/www/main/common/sttm-ui/multipane-dropdown/index.js b/www/main/common/sttm-ui/multipane-dropdown/index.js new file mode 100644 index 000000000..296abfe54 --- /dev/null +++ b/www/main/common/sttm-ui/multipane-dropdown/index.js @@ -0,0 +1 @@ +export { default } from './MultipaneDropdown'; diff --git a/www/main/common/sttm-ui/pane/Pane.jsx b/www/main/common/sttm-ui/pane/Pane.jsx index 4ffaae2ac..ee000252f 100644 --- a/www/main/common/sttm-ui/pane/Pane.jsx +++ b/www/main/common/sttm-ui/pane/Pane.jsx @@ -4,11 +4,11 @@ import PaneContent from './PaneContent'; import PaneFooter from './PaneFooter'; import PaneHeader from './PaneHeader'; -const Pane = ({ content, header, footer, className }) => ( +const Pane = ({ content, header, footer, className, data }) => (
    - {header ? : ''} - {content ? : ''} - {footer ? : ''} + {header ? : ''} + {content ? : ''} + {footer ? : ''}
    ); @@ -17,6 +17,7 @@ Pane.propTypes = { header: PropTypes.any, footer: PropTypes.any, className: PropTypes.string, + data: PropTypes.any, }; Pane.defaultProps = { @@ -24,6 +25,7 @@ Pane.defaultProps = { header: null, footer: null, className: '', + data: {}, }; export default Pane; diff --git a/www/main/common/sttm-ui/pane/PaneContent.jsx b/www/main/common/sttm-ui/pane/PaneContent.jsx index 12f4ed028..d22e3f394 100644 --- a/www/main/common/sttm-ui/pane/PaneContent.jsx +++ b/www/main/common/sttm-ui/pane/PaneContent.jsx @@ -1,12 +1,13 @@ import React from 'react'; import PropTypes from 'prop-types'; -const PaneContent = ({ Content }) => ( -
    {Content ? : ''}
    +const PaneContent = ({ Content, data = {} }) => ( +
    {Content ? : ''}
    ); PaneContent.propTypes = { Content: PropTypes.any, + data: PropTypes.any, }; export default PaneContent; diff --git a/www/main/common/sttm-ui/pane/PaneHeader.jsx b/www/main/common/sttm-ui/pane/PaneHeader.jsx index 885d247f2..4567f97ec 100644 --- a/www/main/common/sttm-ui/pane/PaneHeader.jsx +++ b/www/main/common/sttm-ui/pane/PaneHeader.jsx @@ -1,10 +1,13 @@ import React from 'react'; import PropTypes from 'prop-types'; -const PaneHeader = ({ Header }) =>
    {Header ?
    : ''}
    ; +const PaneHeader = ({ Header, data = {} }) => ( +
    {Header ?
    : ''}
    +); PaneHeader.propTypes = { Header: PropTypes.any, + data: PropTypes.any, }; export default PaneHeader; diff --git a/www/main/common/sttm-ui/search-results/SearchResults.jsx b/www/main/common/sttm-ui/search-results/SearchResults.jsx index 49045a0e1..ba68be679 100644 --- a/www/main/common/sttm-ui/search-results/SearchResults.jsx +++ b/www/main/common/sttm-ui/search-results/SearchResults.jsx @@ -1,6 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import anvaad from 'anvaad-js'; +import { useStoreState } from 'easy-peasy'; const remote = require('@electron/remote'); @@ -19,6 +20,9 @@ const SearchResults = ({ writer, currentLanguage, }) => { + const { currentWorkspace, defaultPaneId } = useStoreState((state) => state.userSettings); + const { pane1, pane2, pane3 } = useStoreState((state) => state.navigator); + const getClassForAng = (baniSource) => { if (baniSource === 'G') { return 'sggs-color'; @@ -45,6 +49,43 @@ const SearchResults = ({ return 'other-border'; }; + const shabadPaneButtons = () => { + if (currentWorkspace === i18n.t('WORKSPACES.MULTI_PANE')) { + return ( +
    + + + +
    + ); + } + return null; + }; + const isHighlightRequired = (gurbaniVerse, word, wordIndex, searchCharacters) => { const wordsToHightlight = searchCharacters.length; const mainLetters = anvaad.mainLetters(gurbaniVerse); @@ -100,8 +141,11 @@ const SearchResults = ({ }; return ( -
  • onClick(shabadId, verseId, verse)} className="search-li"> -
    +
  • +
    onClick(shabadId, verseId, verse, defaultPaneId)} + className={`search-list ${getBorderColorClass(sourceId)}`} + > {!!ang && ( {`${i18n.t( @@ -115,6 +159,7 @@ const SearchResults = ({
+ {shabadPaneButtons()} ); }; diff --git a/www/main/common/sttm-ui/shabad-verse/ShabadVerse.jsx b/www/main/common/sttm-ui/shabad-verse/ShabadVerse.jsx index 157f44d86..106a539ab 100644 --- a/www/main/common/sttm-ui/shabad-verse/ShabadVerse.jsx +++ b/www/main/common/sttm-ui/shabad-verse/ShabadVerse.jsx @@ -7,6 +7,7 @@ const ShabadVerse = ({ isHomeVerse, lineNumber, versesRead, + activeVerseRef, updateTraversedVerse, verse, englishVerse, @@ -15,18 +16,19 @@ const ShabadVerse = ({ const loadActiveClass = (verseObj, currentVerseId, verseIndex) => Object.keys(verseObj).map((verseKey) => { if (Number(verseKey) === verseIndex && verseObj[verseKey] === currentVerseId) { - return 1; + return true; } - return 0; - })[0] - ? 'shabad-pane-active' - : ''; + return false; + })[0]; return (
  • {versesRead.map( @@ -66,6 +68,7 @@ ShabadVerse.propTypes = { isHomeVerse: PropTypes.number, lineNumber: PropTypes.number, versesRead: PropTypes.array, + activeVerseRef: PropTypes.object, updateTraversedVerse: PropTypes.func, verse: PropTypes.string, englishVerse: PropTypes.string, diff --git a/www/main/common/utils/settings-obj-generator.js b/www/main/common/utils/settings-obj-generator.js index 6f167eb95..be37baa46 100644 --- a/www/main/common/utils/settings-obj-generator.js +++ b/www/main/common/utils/settings-obj-generator.js @@ -19,9 +19,11 @@ export const settingsObjGenerator = (obj) => { settingsNewObj[category].subCatObjs[subCategory].settings.forEach((setting) => { settingsNewObj[category].subCatObjs[subCategory].settingObjs[setting] = settings[setting]; const { addon } = settingsNewObj[category].subCatObjs[subCategory].settingObjs[setting]; - if (addon) { - settingsNewObj[category].subCatObjs[subCategory].settingObjs[setting].addonObj = - settings[addon]; + if (addon && addon.length) { + addon.forEach((add) => { + settingsNewObj[category].subCatObjs[subCategory].settingObjs[setting].addonObj = + settings[add]; + }); } const subCat = settingsNewObj[category].subCatObjs[subCategory]; const { type } = subCat; diff --git a/www/main/controller.js b/www/main/controller.js index bc6913b02..600ad3f83 100644 --- a/www/main/controller.js +++ b/www/main/controller.js @@ -2,7 +2,6 @@ const electron = require('electron'); const remote = require('@electron/remote'); const { updateViewerScale } = require('./viewer/utils'); -const { ipcRenderer } = electron; const { app, dialog, Menu } = remote; const main = remote.require('./app'); const { store, appstore, i18n, isUnsupportedWindow } = main; @@ -11,15 +10,6 @@ const { changeFontSize, changeVisibility } = require('./quick-tools-utils'); const appName = i18n.t('APPNAME'); -setTimeout(() => { - global.webview = document.querySelector('webview'); - - global.webview.addEventListener('dom-ready', () => { - ipcRenderer.send('enable-wc-webview', global.webview.getWebContentsId()); - global.webview.send('is-webview'); - }); -}, 200); - const updateMenu = []; if (!isUnsupportedWindow) { @@ -433,7 +423,7 @@ global.platform.ipc.on('update-downloaded', () => { menuUpdate.items[5].visible = true; }); global.platform.ipc.on('send-scroll', (event, arg) => { - global.webview.send('send-scroll', JSON.stringify(arg)); + if (global.webview) global.webview.send('send-scroll', JSON.stringify(arg)); }); global.platform.ipc.on('next-ang', (event, arg) => { const { PageNo, SourceID } = JSON.parse(arg); @@ -450,7 +440,7 @@ global.platform.ipc.on('cast-session-active', () => { store.set('userPrefs.slide-layout.display-options.akhandpaatt', false); store.set('userPrefs.slide-layout.display-options.disable-akhandpaatt', true); - global.webview.send('clear-apv'); + if (global.webview) global.webview.send('clear-apv'); global.platform.ipc.send('clear-apv'); document.body.classList.remove('akhandpaatt'); diff --git a/www/main/launchpad/Launchpad.jsx b/www/main/launchpad/Launchpad.jsx index fd6b0db0d..999d44adf 100644 --- a/www/main/launchpad/Launchpad.jsx +++ b/www/main/launchpad/Launchpad.jsx @@ -4,7 +4,7 @@ import { useStoreState, useStoreActions } from 'easy-peasy'; import Toolbar from '../toolbar'; import Navigator from '../navigator'; import WorkspaceBar from '../workspace-bar'; -import { useKeys } from '../common/hooks'; +import { useKeys, useSlides } from '../common/hooks'; import { Ceremonies, @@ -20,6 +20,7 @@ import { DEFAULT_OVERLAY } from '../common/constants'; const remote = require('@electron/remote'); +const { i18n } = remote.require('./app'); const main = remote.require('./app'); export const InputContext = createContext(); @@ -29,7 +30,14 @@ const Launchpad = () => { const { shortcuts } = useStoreState((state) => state.navigator); const { setShortcuts } = useStoreActions((state) => state.navigator); const { setOverlayScreen } = useStoreActions((actions) => actions.app); - const { isSingleDisplayMode } = useStoreState((state) => state.userSettings); + const { currentWorkspace, defaultPaneId } = useStoreState((state) => state.userSettings); + + const { + displayWaheguruSlide, + displayMoolMantraSlide, + displayBlankViewer, + displayAnandSahibBhog, + } = useSlides(); const ref = useRef(); @@ -59,41 +67,25 @@ const Launchpad = () => { // open waheguru slide shortcut const handleCtrlPlus1 = () => { - if (!shortcuts.openWaheguruSlide) { - setShortcuts({ - ...shortcuts, - openWaheguruSlide: true, - }); - } + displayWaheguruSlide({ openedFrom: 'shortcuts' }); }; // open mool mantra slide shortcut const handleCtrlPlus2 = () => { - if (!shortcuts.openMoolMantraSlide) { - setShortcuts({ - ...shortcuts, - openMoolMantraSlide: true, - }); - } + displayMoolMantraSlide({ openedFrom: 'shortcuts' }); }; // open blank slide shortcut const handleCtrlPlus3 = () => { - if (!shortcuts.openBlankViewer) { - setShortcuts({ - ...shortcuts, - openBlankViewer: true, - }); - } + displayBlankViewer({ openedFrom: 'shortcuts' }); }; // open anand sahib bhog slide shortcut const handleCtrlPlus4 = () => { - if (!shortcuts.openAnandSahibBhog) { - setShortcuts({ - ...shortcuts, - openAnandSahibBhog: true, - }); + if (currentWorkspace === i18n.t('WORKSPACES.MULTI_PANE')) { + displayAnandSahibBhog({ openedFrom: 'shortcuts', paneId: defaultPaneId }); + } else { + displayAnandSahibBhog({ openedFrom: 'shortcuts' }); } }; @@ -194,6 +186,7 @@ const Launchpad = () => { const isSettingsOverlay = overlayScreen === 'settings'; const isAuthDialog = overlayScreen === 'auth-dialog'; const isAnnouncement = overlayScreen === 'announcement'; + const isSingleDisplayMode = currentWorkspace === i18n.t('WORKSPACES.SINGLE_DISPLAY'); return ( <> diff --git a/www/main/navigator/Navigator.jsx b/www/main/navigator/Navigator.jsx index bb5f0bb43..a4da700ce 100644 --- a/www/main/navigator/Navigator.jsx +++ b/www/main/navigator/Navigator.jsx @@ -1,167 +1,87 @@ -import React, { useEffect } from 'react'; -import { useStoreState, useStoreActions } from 'easy-peasy'; +import React from 'react'; +import { useStoreState } from 'easy-peasy'; import SearchPane from './search/components/SearchPane'; import ShabadPane from './shabad/ShabadPane'; import { MiscPane } from './misc/components'; import ViewerPane from './viewer/ViewerPane'; import { Pane } from '../common/sttm-ui/pane'; import { singleDisplayContent, singleDisplayFooter, singleDisplayHeader } from './single-display'; -import insertSlide from '../common/constants/slidedb'; +import { useSlides } from '../common/hooks'; const remote = require('@electron/remote'); -const analytics = remote.getGlobal('analytics'); +const { i18n } = remote.require('./app'); const Navigator = () => { - const { isSingleDisplayMode, akhandpatt } = useStoreState((state) => state.userSettings); - const { setAkhandpatt } = useStoreState((state) => state.userSettings); - const { - minimizedBySingleDisplay, - shortcuts, - isMiscSlide, - miscSlideText, - isAnnoucement, - isSundarGutkaBani, - isCeremonyBani, - ceremonyId, - } = useStoreState((state) => state.navigator); - const { - setShortcuts, - setIsMiscSlide, - setMiscSlideText, - setIsAnnoucement, - setIsSundarGutkaBani, - setIsCeremonyBani, - setCeremonyId, - } = useStoreActions((state) => state.navigator); - - const addMiscSlide = (givenText) => { - if (isAnnoucement) { - setIsAnnoucement(false); - } - if (!isMiscSlide) { - if (akhandpatt) { - setAkhandpatt(false); - } - setIsMiscSlide(true); - } - if (miscSlideText !== givenText) { - setMiscSlideText(givenText); - } - }; - - const openWaheguruSlide = ({ openedFrom }) => { - addMiscSlide(insertSlide.slideStrings.waheguru); - analytics.trackEvent({ - category: 'display', - action: 'waheguru-slide', - label: `Opened from: ${openedFrom}`, - }); - }; - - const openMoolMantraSlide = ({ openedFrom }) => { - addMiscSlide(insertSlide.slideStrings.moolMantra); - analytics.trackEvent({ - category: 'display', - action: 'moool-mantra-slide', - label: `Opened from: ${openedFrom}`, - }); - }; + const { minimizedBySingleDisplay, currentWorkspace } = useStoreState( + (state) => state.userSettings, + ); - const openBlankViewer = ({ openedFrom }) => { - addMiscSlide(''); - analytics.trackEvent({ - category: 'display', - action: 'empty-slide', - label: `Opened from: ${openedFrom}`, - }); - }; + const { + displayWaheguruSlide, + displayMoolMantraSlide, + displayBlankViewer, + displayAnandSahibBhog, + } = useSlides(); - const openAnandSahibBhog = ({ openedFrom }) => { - if (isSundarGutkaBani) { - setIsSundarGutkaBani(false); - } - if (ceremonyId !== 3) { - setCeremonyId(3); - } - if (!isCeremonyBani) { - setIsCeremonyBani(true); - } - analytics.trackEvent({ - category: 'ceremony', - action: 'anand-sahib-bhog', - label: `Opened from: ${openedFrom}`, - }); - }; + let controllerMarkup = null; - useEffect(() => { - if (shortcuts.openWaheguruSlide) { - openWaheguruSlide({ openedFrom: 'shortcuts' }); - setShortcuts({ - ...shortcuts, - openWaheguruSlide: false, - }); - } - if (shortcuts.openMoolMantraSlide) { - openMoolMantraSlide({ openedFrom: 'shortcuts' }); - setShortcuts({ - ...shortcuts, - openMoolMantraSlide: false, - }); - } - if (shortcuts.openBlankViewer) { - openBlankViewer({ openedFrom: 'shortcuts' }); - setShortcuts({ - ...shortcuts, - openBlankViewer: false, - }); - } - if (shortcuts.openAnandSahibBhog) { - setShortcuts({ - ...shortcuts, - openAnandSahibBhog: false, - }); - openAnandSahibBhog({ openedFrom: 'shortcuts' }); - } - }, [shortcuts]); + if (currentWorkspace === i18n.t('WORKSPACES.SINGLE_DISPLAY')) { + controllerMarkup = ( +
    + +
    + ); + } else if (currentWorkspace === i18n.t('WORKSPACES.MULTI_PANE')) { + controllerMarkup = ( +
    +
    + +
    +
    + +
    +
    + +
    +
    + ); + } else { + controllerMarkup = ( +
    + + +
    + ); + } return ( <> - {isSingleDisplayMode ? ( - <> -
    - -
    -
    - -
    - - ) : ( - <> -
    - - -
    -
    - - -
    - - )} +
    + {currentWorkspace !== i18n.t('WORKSPACES.SINGLE_DISPLAY') && } + +
    + {controllerMarkup} ); }; diff --git a/www/main/navigator/misc/components/HistoryPane.jsx b/www/main/navigator/misc/components/HistoryPane.jsx index 60e7e30d4..dd7bb7df0 100644 --- a/www/main/navigator/misc/components/HistoryPane.jsx +++ b/www/main/navigator/misc/components/HistoryPane.jsx @@ -2,7 +2,11 @@ import React from 'react'; import PropTypes from 'prop-types'; import { useStoreState, useStoreActions } from 'easy-peasy'; -export const HistoryPane = ({ className }) => { +const remote = require('@electron/remote'); + +const { i18n } = remote.require('./app'); + +export const HistoryPane = ({ className, paneId }) => { const { verseHistory, activeShabadId, @@ -16,6 +20,9 @@ export const HistoryPane = ({ className }) => { activeVerseId, historyOrder, singleDisplayActiveTab, + pane1, + pane2, + pane3, } = useStoreState((state) => state.navigator); const { setActiveShabadId, @@ -28,57 +35,102 @@ export const HistoryPane = ({ className }) => { setHomeVerse, setActiveVerseId, setSingleDisplayActiveTab, + setPane1, + setPane2, + setPane3, } = useStoreActions((state) => state.navigator); + const { currentWorkspace } = useStoreState((state) => state.userSettings); + const openShabadFromHistory = (element) => { - if (singleDisplayActiveTab !== 'shabad') { - setSingleDisplayActiveTab('shabad'); - } - if (element.verseId !== initialVerseId) { - setInitialVerseId(element.verseId); - } - if (element.homeVerse !== homeVerse) { - setHomeVerse(element.homeVerse); - } - if (element.versesRead !== versesRead) { - setVersesRead(element.versesRead); - } - if (element.type === 'shabad') { - if (isSundarGutkaBani) { - setIsSundarGutkaBani(false); - } - if (isCeremonyBani) { - setIsCeremonyBani(false); + if (currentWorkspace === i18n.t('WORKSPACES.MULTI_PANE')) { + switch (paneId) { + case 1: + setPane1({ + ...pane1, + content: i18n.t('MULTI_PANE.SHABAD'), + activeShabad: element.shabadId, + activeVerse: element.continueFrom, + baniType: element.type, + versesRead: element.versesRead, + homeVerse: element.homeVerse, + }); + break; + case 2: + setPane2({ + ...pane2, + content: i18n.t('MULTI_PANE.SHABAD'), + activeShabad: element.shabadId, + activeVerse: element.continueFrom, + baniType: element.type, + versesRead: element.versesRead, + homeVerse: element.homeVerse, + }); + break; + case 3: + setPane3({ + ...pane3, + content: i18n.t('MULTI_PANE.SHABAD'), + activeShabad: element.shabadId, + activeVerse: element.continueFrom, + baniType: element.type, + versesRead: element.versesRead, + homeVerse: element.homeVerse, + }); + break; + default: + break; } - if (element.shabadId !== activeShabadId) { - setActiveShabadId(element.shabadId); + } else { + if (singleDisplayActiveTab !== 'shabad') { + setSingleDisplayActiveTab('shabad'); } - } - if (element.type === 'ceremony') { - if (isSundarGutkaBani) { - setIsSundarGutkaBani(false); + if (element.verseId !== initialVerseId) { + setInitialVerseId(element.verseId); } - if (!isCeremonyBani) { - setIsCeremonyBani(true); + if (element.homeVerse !== homeVerse) { + setHomeVerse(element.homeVerse); } - if (ceremonyId !== element.shabadId) { - setCeremonyId(element.shabadId); + if (element.versesRead !== versesRead) { + setVersesRead(element.versesRead); } - } - if (element.type === 'bani') { - if (isCeremonyBani) { - setIsCeremonyBani(false); + if (element.type === 'shabad') { + if (isSundarGutkaBani) { + setIsSundarGutkaBani(false); + } + if (isCeremonyBani) { + setIsCeremonyBani(false); + } + if (element.shabadId !== activeShabadId) { + setActiveShabadId(element.shabadId); + } } - if (!isSundarGutkaBani) { - setIsSundarGutkaBani(true); + if (element.type === 'ceremony') { + if (isSundarGutkaBani) { + setIsSundarGutkaBani(false); + } + if (!isCeremonyBani) { + setIsCeremonyBani(true); + } + if (ceremonyId !== element.shabadId) { + setCeremonyId(element.shabadId); + } } + if (element.type === 'bani') { + if (isCeremonyBani) { + setIsCeremonyBani(false); + } + if (!isSundarGutkaBani) { + setIsSundarGutkaBani(true); + } - if (sundarGutkaBaniId !== element.shabadId) { - setSundarGutkaBaniId(element.shabadId); + if (sundarGutkaBaniId !== element.shabadId) { + setSundarGutkaBaniId(element.shabadId); + } + } + if (element.continueFrom !== activeVerseId) { + setActiveVerseId(element.continueFrom); } - } - if (element.continueFrom !== activeVerseId) { - setActiveVerseId(element.continueFrom); } }; @@ -109,4 +161,5 @@ export const HistoryPane = ({ className }) => { HistoryPane.propTypes = { className: PropTypes.string, + paneId: PropTypes.number, }; diff --git a/www/main/navigator/misc/components/favoritePane.jsx b/www/main/navigator/misc/components/favoritePane.jsx index c68610061..6191887c8 100644 --- a/www/main/navigator/misc/components/favoritePane.jsx +++ b/www/main/navigator/misc/components/favoritePane.jsx @@ -12,7 +12,7 @@ const remote = require('@electron/remote'); const { i18n } = remote.require('./app'); -export const FavoritePane = ({ className }) => { +export const FavoritePane = ({ className, paneId }) => { const { activeShabadId, initialVerseId, @@ -23,6 +23,10 @@ export const FavoritePane = ({ className }) => { activeVerseId, singleDisplayActiveTab, favShabad, + pane1, + pane2, + pane3, + activePaneId, } = useStoreState((state) => state.navigator); const { setActiveShabadId, @@ -34,7 +38,12 @@ export const FavoritePane = ({ className }) => { setActiveVerseId, setSingleDisplayActiveTab, setFavShabad, + setPane1, + setPane2, + setPane3, + setActivePaneId, } = useStoreActions((state) => state.navigator); + const { currentWorkspace } = useStoreState((state) => state.userSettings); const { userToken } = useStoreState((state) => state.app); const [parsedFav, setParsedFav] = useState([]); @@ -110,6 +119,35 @@ export const FavoritePane = ({ className }) => { if (isCeremonyBani) { setIsCeremonyBani(false); } + + if (currentWorkspace === i18n.t('WORKSPACES.MULTI_PANE')) { + if (paneId !== activePaneId) setActivePaneId(paneId); + switch (paneId) { + case 1: + setPane1({ + ...pane1, + content: i18n.t('MULTI_PANE.SHABAD'), + activeShabad: shabadId, + }); + break; + case 2: + setPane2({ + ...pane2, + content: i18n.t('MULTI_PANE.SHABAD'), + activeShabad: shabadId, + }); + break; + case 3: + setPane3({ + ...pane3, + content: i18n.t('MULTI_PANE.SHABAD'), + activeShabad: shabadId, + }); + break; + default: + break; + } + } } }; @@ -176,8 +214,22 @@ export const FavoritePane = ({ className }) => {

  • -

    {date}

    -

    {time}

    +

    + {date} +

    +

    + {time} +

    + + +
    + )}
    ); }; diff --git a/www/main/navigator/search/hooks/use-new-shabad.jsx b/www/main/navigator/search/hooks/use-new-shabad.jsx index d61f3f56c..dae6d0629 100644 --- a/www/main/navigator/search/hooks/use-new-shabad.jsx +++ b/www/main/navigator/search/hooks/use-new-shabad.jsx @@ -1,5 +1,9 @@ import { useStoreActions, useStoreState } from 'easy-peasy'; +const remote = require('@electron/remote'); + +const { i18n } = remote.require('./app'); + export const useNewShabad = () => { const { versesRead, @@ -11,8 +15,13 @@ export const useNewShabad = () => { isMiscSlide, singleDisplayActiveTab, searchVerse, + pane1, + pane2, + pane3, } = useStoreState((state) => state.navigator); + const { currentWorkspace } = useStoreState((state) => state.userSettings); + const { setActiveShabadId, setInitialVerseId, @@ -23,10 +32,49 @@ export const useNewShabad = () => { setIsCeremonyBani, setSingleDisplayActiveTab, setSearchVerse, - } = useStoreActions((state) => state.navigator); + setPane1, + setPane2, + setPane3, + } = useStoreActions((actions) => actions.navigator); + + return (newSelectedShabad, newSelectedVerse, newSearchVerse, multiPaneId = false) => { + if (currentWorkspace === i18n.t('WORKSPACES.MULTI_PANE')) { + switch (multiPaneId) { + case 1: + setPane1({ + ...pane1, + content: i18n.t('MULTI_PANE.SHABAD'), + activeShabad: newSelectedShabad, + baniType: 'shabad', + versesRead: [newSelectedVerse], + activeVerse: newSelectedVerse, + }); + break; + case 2: + setPane2({ + ...pane2, + content: i18n.t('MULTI_PANE.SHABAD'), + activeShabad: newSelectedShabad, + baniType: 'shabad', + versesRead: [newSelectedVerse], + activeVerse: newSelectedVerse, + }); + break; + case 3: + setPane3({ + ...pane3, + content: i18n.t('MULTI_PANE.SHABAD'), + activeShabad: newSelectedShabad, + baniType: 'shabad', + versesRead: [newSelectedVerse], + activeVerse: newSelectedVerse, + }); + break; + default: + break; + } + } - return (newSelectedShabad, newSelectedVerse, newSearchVerse) => { - // Push verseId of active Verse to versesRead Array when shabad is changed if (singleDisplayActiveTab !== 'shabad') { setSingleDisplayActiveTab('shabad'); } @@ -45,7 +93,9 @@ export const useNewShabad = () => { } if (activeShabadId !== newSelectedShabad) { - setActiveShabadId(newSelectedShabad); + if (currentWorkspace !== i18n.t('WORKSPACES.MULTI_PANE')) { + setActiveShabadId(newSelectedShabad); + } // initialVerseId is the verse which is stored in history // It is the verse we searched for. diff --git a/www/main/navigator/shabad/ArrowIcon.jsx b/www/main/navigator/shabad/ArrowIcon.jsx new file mode 100644 index 000000000..4eafcf18e --- /dev/null +++ b/www/main/navigator/shabad/ArrowIcon.jsx @@ -0,0 +1,153 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import { useStoreState, useStoreActions } from 'easy-peasy'; + +const remote = require('@electron/remote'); + +const { i18n } = remote.require('./app'); + +const ArrowIcon = ({ paneId }) => { + const { + isSundarGutkaBani, + activeShabadId, + initialVerseId, + isCeremonyBani, + activeVerseId, + activePaneId, + homeVerse, + pane1, + pane2, + pane3, + } = useStoreState((state) => state.navigator); + + const { currentWorkspace } = useStoreState((state) => state.userSettings); + + const { + setActiveShabadId, + setInitialVerseId, + setActiveVerseId, + setActivePaneId, + setHomeVerse, + setPane1, + setPane2, + setPane3, + } = useStoreActions((state) => state.navigator); + + const paneBani = { + 1: pane1.baniType, + 2: pane2.baniType, + 3: pane3.baniType, + }; + + const updatePaneShabad = (direction) => { + if (paneId !== activePaneId) setActivePaneId(paneId); + let currentShabad; + switch (paneId) { + case 1: + currentShabad = + direction === 'left' + ? parseInt(pane1.activeShabad, 10) - 1 + : parseInt(pane1.activeShabad, 10) + 1; + setPane1({ + ...pane1, + content: i18n.t('MULTI_PANE.SHABAD'), + activeShabad: currentShabad, + baniType: 'shabad', + versesRead: [], + activeVerse: null, + }); + break; + case 2: + currentShabad = + direction === 'left' + ? parseInt(pane2.activeShabad, 10) - 1 + : parseInt(pane2.activeShabad, 10) + 1; + setPane2({ + ...pane2, + content: i18n.t('MULTI_PANE.SHABAD'), + activeShabad: currentShabad, + baniType: 'shabad', + versesRead: [], + activeVerse: null, + }); + break; + case 3: + currentShabad = + direction === 'left' + ? parseInt(pane3.activeShabad, 10) - 1 + : parseInt(pane3.activeShabad, 10) + 1; + setPane3({ + ...pane3, + content: i18n.t('MULTI_PANE.SHABAD'), + activeShabad: currentShabad, + baniType: 'shabad', + versesRead: [], + activeVerse: null, + }); + break; + default: + break; + } + }; + + const navigateVerseLeft = () => { + if (currentWorkspace === i18n.t('WORKSPACES.MULTI_PANE')) { + updatePaneShabad('left'); + } else if (activeShabadId) { + setActiveShabadId(activeShabadId - 1); + if (activeVerseId !== null) { + setActiveVerseId(null); + } + if (homeVerse !== 0) { + setHomeVerse(0); + } + } + + if (initialVerseId !== null) { + setInitialVerseId(null); + } + }; + + const navigateVerseRight = () => { + if (currentWorkspace === i18n.t('WORKSPACES.MULTI_PANE')) { + updatePaneShabad('right'); + } else if (activeShabadId) { + setActiveShabadId(activeShabadId + 1); + if (activeVerseId !== null) { + setActiveVerseId(null); + } + if (homeVerse !== 0) { + setHomeVerse(0); + } + } + + if (initialVerseId !== null) { + setInitialVerseId(null); + } + }; + + if (currentWorkspace === i18n.t('WORKSPACES.MULTI_PANE')) { + if (paneBani[paneId] === 'shabad') { + return ( +
    + + +
    + ); + } + } else if (activeShabadId && !isSundarGutkaBani && !isCeremonyBani) { + return ( + <> + + + + ); + } + return null; +}; + +ArrowIcon.propTypes = { + paneId: PropTypes.number, +}; + +export default ArrowIcon; diff --git a/www/main/navigator/shabad/FavShabadIcon.jsx b/www/main/navigator/shabad/FavShabadIcon.jsx new file mode 100644 index 000000000..62b7484d6 --- /dev/null +++ b/www/main/navigator/shabad/FavShabadIcon.jsx @@ -0,0 +1,91 @@ +import React, { useEffect, useRef, useState } from 'react'; +import PropTypes from 'prop-types'; + +import { useStoreState, useStoreActions } from 'easy-peasy'; +import classNames from '../../common/utils/classnames'; +import { addToFav, fetchFavShabad, removeFromFav } from '../misc/utils'; + +const remote = require('@electron/remote'); + +const { i18n } = remote.require('./app'); + +const FavShabadIcon = ({ paneId }) => { + const [isLoading, setLoading] = useState(false); + const favBtnRef = useRef(null); + const { activeShabadId, activeVerseId, favShabad, pane1, pane2, pane3 } = useStoreState( + (state) => state.navigator, + ); + + const { setFavShabad } = useStoreActions((state) => state.navigator); + + const { userToken } = useStoreState((state) => state.app); + + const [currentShabad, setCurrentShabad] = useState(activeShabadId); + const [currentVerse, setCurrentVerse] = useState(activeVerseId); + const [favShabadIndex, setFavShabadIndex] = useState(-1); + + useEffect(() => { + if (paneId) { + switch (paneId) { + case 1: + setCurrentShabad(pane1.activeShabad); + setCurrentVerse(pane1.versesRead[0]); + break; + case 2: + setCurrentShabad(pane2.activeShabad); + setCurrentVerse(pane2.versesRead[0]); + break; + case 3: + setCurrentShabad(pane3.activeShabad); + setCurrentVerse(pane3.versesRead[0]); + break; + default: + break; + } + } else { + setCurrentShabad(activeShabadId); + setCurrentVerse(activeVerseId); + } + }, [pane1, pane2, pane3, activeShabadId, activeVerseId]); + + useEffect(() => { + const index = favShabad.findIndex((element) => element.shabad_id === currentShabad); + setFavShabadIndex(index); + }, [favShabad, currentShabad]); + + const toggleFavShabad = () => { + if (favShabadIndex < 0) { + addToFav(currentShabad, currentVerse, userToken); + } else { + favShabad.splice(favShabadIndex, 1); + removeFromFav(currentShabad, userToken); + setFavShabad([...favShabad]); + } + const fetchProgress = fetchFavShabad(userToken); + setLoading(true); + fetchProgress.then((data) => { + setFavShabad([...data]); + setLoading(false); + }); + }; + + if (currentShabad && !isLoading && userToken) { + return ( + + ); + } + return null; +}; + +FavShabadIcon.propTypes = { + paneId: PropTypes.number, +}; + +export default FavShabadIcon; diff --git a/www/main/navigator/shabad/MultiPaneContent.jsx b/www/main/navigator/shabad/MultiPaneContent.jsx new file mode 100644 index 000000000..bc6ad5bdf --- /dev/null +++ b/www/main/navigator/shabad/MultiPaneContent.jsx @@ -0,0 +1,122 @@ +import React, { useEffect } from 'react'; +import PropTypes from 'prop-types'; +import { useStoreActions, useStoreState } from 'easy-peasy'; + +import { ShabadText } from './ShabadText'; +import { FavoritePane, HistoryPane } from '../misc/components'; +import { useSlides } from '../../common/hooks'; + +const remote = require('@electron/remote'); + +const { i18n } = remote.require('./app'); + +const MultiPaneContent = ({ data }) => { + const paneId = data.multiPaneId; + const navigatorState = useStoreState((state) => state.navigator); + const navigatorActions = useStoreActions((state) => state.navigator); + const paneAttributes = navigatorState[`pane${paneId}`]; + const setPaneAttributes = navigatorActions[`setPane${paneId}`]; + const { activePaneId, homeVerse, versesRead } = navigatorState; + const { setHomeVerse, setVersesRead } = navigatorActions; + + const { + displayWaheguruSlide, + displayMoolMantraSlide, + displayBlankViewer, + displayAnandSahibBhog, + } = useSlides(); + + useEffect(() => { + if (activePaneId === paneId) { + if (homeVerse !== paneAttributes.homeVerse) setHomeVerse(paneAttributes.homeVerse); + if (versesRead !== paneAttributes.versesRead) setVersesRead(paneAttributes.versesRead); + } + }, [activePaneId]); + + const goToShabadBtn = ( + + ); + + switch (paneAttributes.content) { + case i18n.t('MULTI_PANE.CLEAR_PANE'): + return null; + case i18n.t('MULTI_PANE.SHABAD'): + return ( + + ); + case i18n.t('TOOLBAR.HISTORY'): + return ( + <> + {goToShabadBtn} + + + ); + case i18n.t('MULTI_PANE.MISC_SLIDES'): + return ( + <> + {goToShabadBtn} +
      +
    • displayAnandSahibBhog({ openedFrom: 'multipane-content', paneId })} + > + {i18n.t(`SHORTCUT_TRAY.ANAND_SAHIB`)} +
    • +
    • displayMoolMantraSlide({ openedFrom: 'multipane-content' })} + > + {i18n.t(`SHORTCUT_TRAY.MOOL_MANTRA`)} +
    • +
    • displayWaheguruSlide({ openedFrom: 'multipane-content' })} + > + vwihgurU +
    • +
    • displayBlankViewer({ openedFrom: 'multiplane-content' })} + > + {i18n.t(`SHORTCUT_TRAY.BLANK`)} +
    • +
    + + ); + case i18n.t('MULTI_PANE.FAVORITES'): + return ( + <> + {goToShabadBtn} + + + ); + default: + return null; + } +}; + +MultiPaneContent.propTypes = { + data: PropTypes.any, +}; +export default MultiPaneContent; diff --git a/www/main/navigator/shabad/MultiPaneHeader.jsx b/www/main/navigator/shabad/MultiPaneHeader.jsx new file mode 100644 index 000000000..f5d518e8f --- /dev/null +++ b/www/main/navigator/shabad/MultiPaneHeader.jsx @@ -0,0 +1,120 @@ +import React, { useEffect, useRef, useState } from 'react'; +import PropTypes from 'prop-types'; +import { useStoreActions, useStoreState } from 'easy-peasy'; + +import FavShabadIcon from './FavShabadIcon'; +import ArrowIcon from './ArrowIcon'; + +const remote = require('@electron/remote'); + +const { i18n } = remote.require('./app'); + +const MultiPaneHeader = ({ data }) => { + const paneId = data.multiPaneId; + const navigatorState = useStoreState((state) => state.navigator); + const navigatorActions = useStoreActions((state) => state.navigator); + const paneAttributes = navigatorState[`pane${paneId}`]; + const setPaneAttributes = navigatorActions[`setPane${paneId}`]; + + const { defaultPaneId } = useStoreState((state) => state.userSettings); + const { setDefaultPaneId } = useStoreActions((actions) => actions.userSettings); + + const [disableLock, setDisableLock] = useState(false); + + const lockIcon = useRef(null); + + const defaultPaneAttributes = { + locked: false, + activeShabad: null, + activeVerse: '', + versesRead: [], + homeVerse: false, + content: '', + }; + + const nextAvailablePane = (givenPaneId) => { + let nextPane = givenPaneId; + do { + if (nextPane === 3) { + nextPane = 1; + } else { + nextPane++; + } + if (!navigatorState[`pane${nextPane}`].locked) { + return nextPane; + } + } while (nextPane !== givenPaneId); + return null; + }; + + const lockPane = () => { + const updatedAttributes = { ...paneAttributes }; + if (paneAttributes.locked) { + updatedAttributes.locked = false; + } else if (!disableLock) { + updatedAttributes.locked = true; + if (defaultPaneId === paneId) { + const newDefault = nextAvailablePane(paneId); + if (defaultPaneId !== newDefault) { + setDefaultPaneId(newDefault); + } + } + } + if (paneAttributes !== updatedAttributes) { + setPaneAttributes(updatedAttributes); + } + }; + + useEffect(() => { + const remainingPanes = [1, 2, 3].filter((pane) => pane !== paneId); + if (remainingPanes.every((pane) => navigatorState[`pane${pane}`].locked)) { + lockIcon.current.classList.add('disabled'); + setDisableLock(true); + } else { + lockIcon.current.classList.remove('disabled'); + setDisableLock(false); + } + }, [navigatorState.pane1, navigatorState.pane2, navigatorState.pane3]); + + const selectPaneOption = (event) => { + setPaneAttributes({ ...paneAttributes, content: event.target.value }); + }; + + return ( +
    +
    + {paneId} + +
    + {paneAttributes.content} +
    + + + {paneAttributes.activeShabad && ( + + )} + +
    +
    + ); +}; + +MultiPaneHeader.propTypes = { + data: PropTypes.any, +}; +export default MultiPaneHeader; diff --git a/www/main/navigator/shabad/ShabadContent.jsx b/www/main/navigator/shabad/ShabadContent.jsx index 349dcd570..ef7f130c5 100644 --- a/www/main/navigator/shabad/ShabadContent.jsx +++ b/www/main/navigator/shabad/ShabadContent.jsx @@ -564,6 +564,7 @@ const ShabadContent = () => { isHomeVerse={homeVerse} lineNumber={index} versesRead={versesRead} + activeVerseRef={activeVerseRef} verse={verse} englishVerse={english} verseId={verseId} diff --git a/www/main/navigator/shabad/ShabadHeader.jsx b/www/main/navigator/shabad/ShabadHeader.jsx index ae9e4d015..e5a473d04 100644 --- a/www/main/navigator/shabad/ShabadHeader.jsx +++ b/www/main/navigator/shabad/ShabadHeader.jsx @@ -1,7 +1,8 @@ -import React, { useEffect, useRef, useState } from 'react'; -import { useStoreState, useStoreActions } from 'easy-peasy'; +import React, { useEffect, useState } from 'react'; + import classNames from '../../common/utils/classnames'; -import { addToFav, fetchFavShabad, removeFromFav } from '../misc/utils'; +import FavShabadIcon from './FavShabadIcon'; +import ArrowIcon from './ArrowIcon'; const electron = require('electron'); @@ -12,67 +13,6 @@ const { i18n } = remote.require('./app'); const ShabadHeader = () => { const [showViewer, setShowViewer] = useState(true); - const [isLoading, setLoading] = useState(false); - const favBtnRef = useRef(null); - const { - activeShabadId, - activeVerseId, - favShabad, - initialVerseId, - homeVerse, - isSundarGutkaBani, - isCeremonyBani, - } = useStoreState((state) => state.navigator); - const { setActiveShabadId, setActiveVerseId, setInitialVerseId, setFavShabad, setHomeVerse } = - useStoreActions((state) => state.navigator); - - const { userToken } = useStoreState((state) => state.app); - const favShabadIndex = favShabad.findIndex((element) => element.shabad_id === activeShabadId); - - const navigateVerseLeft = () => { - if (activeShabadId) { - setActiveShabadId(activeShabadId - 1); - if (activeVerseId !== null) { - setActiveVerseId(null); - } - if (initialVerseId !== null) { - setInitialVerseId(null); - } - if (homeVerse !== 0) { - setHomeVerse(0); - } - } - }; - const navigateVerseRight = () => { - if (activeShabadId) { - setActiveShabadId(activeShabadId + 1); - if (activeVerseId !== null) { - setActiveVerseId(null); - } - if (initialVerseId !== null) { - setInitialVerseId(null); - } - if (homeVerse !== 0) { - setHomeVerse(0); - } - } - }; - - const toggleFavShabad = () => { - if (favShabadIndex < 0) { - addToFav(activeShabadId, activeVerseId, userToken); - } else { - favShabad.splice(favShabadIndex, 1); - removeFromFav(activeShabadId, userToken); - setFavShabad([...favShabad]); - } - const fetchProgress = fetchFavShabad(userToken); - setLoading(true); - fetchProgress.then((data) => { - setFavShabad([...data]); - setLoading(false); - }); - }; useEffect(() => { ipcRenderer.send('toggle-viewer-window', showViewer); @@ -80,16 +20,7 @@ const ShabadHeader = () => { return (
    - {activeShabadId && !isLoading && userToken && ( - - )} + - {!isSundarGutkaBani && !isCeremonyBani && ( - <> - - - - )} +
    ); }; diff --git a/www/main/navigator/shabad/ShabadPane.jsx b/www/main/navigator/shabad/ShabadPane.jsx index 25aa5c4a6..7cd1d8c4a 100644 --- a/www/main/navigator/shabad/ShabadPane.jsx +++ b/www/main/navigator/shabad/ShabadPane.jsx @@ -1,16 +1,29 @@ import React from 'react'; import PropTypes from 'prop-types'; +import { useStoreState } from 'easy-peasy'; + import Pane from '../../common/sttm-ui/pane/Pane'; import ShabadContent from './ShabadContent'; import ShabadHeader from './ShabadHeader'; +import MultiPaneHeader from './MultiPaneHeader'; +import MultiPaneContent from './MultiPaneContent'; -const ShabadPane = ({ className }) => ( -
    - -
    -); +const ShabadPane = ({ className, multiPaneId = false }) => { + const { activePaneId } = useStoreState((state) => state.navigator); + return ( +
    + +
    + ); +}; ShabadPane.propTypes = { className: PropTypes.string, + multiPaneId: PropTypes.number, }; export default ShabadPane; diff --git a/www/main/navigator/shabad/ShabadText.jsx b/www/main/navigator/shabad/ShabadText.jsx new file mode 100644 index 000000000..7b5bf91ba --- /dev/null +++ b/www/main/navigator/shabad/ShabadText.jsx @@ -0,0 +1,312 @@ +import React, { useState, useEffect, useRef } from 'react'; +import { useStoreActions, useStoreState } from 'easy-peasy'; +import { Virtuoso } from 'react-virtuoso'; +import { ipcRenderer } from 'electron'; +import PropTypes from 'prop-types'; + +import { loadShabad, loadBani, loadCeremony } from '../utils'; +import { ShabadVerse } from '../../common/sttm-ui'; +import { + changeHomeVerse, + changeVerse, + sendToBaniController, + filterRequiredVerseItems, + udpateHistory, + scrollToVerse, + saveToHistory, + copyToClipboard, + intelligentNextVerse, +} from './utils'; +import { filterOverlayVerseItems } from './utils/filter-verse-items'; + +const baniLengthCols = { + short: 'existsSGPC', + medium: 'existsMedium', + long: 'existsTaksal', + extralong: 'existsBuddhaDal', +}; + +export const ShabadText = ({ + shabadId, + baniType, + paneAttributes, + setPaneAttributes, + currentPane, +}) => { + const [filteredItems, setFilteredItems] = useState([]); + const [rawVerses, setRawVerses] = useState([]); + const [previousVerseIndex, setPreviousIndex] = useState(); + const [atHome, setHome] = useState(true); + + const { + activeVerseId, + isMiscSlide, + isSundarGutkaBani, + sundarGutkaBaniId, + isCeremonyBani, + ceremonyId, + activeShabadId, + verseHistory, + initialVerseId, + activePaneId, + shortcuts, + } = useStoreState((state) => state.navigator); + + const { baniLength, liveFeed, autoplayDelay, autoplayToggle } = useStoreState( + (state) => state.userSettings, + ); + + const { + setActiveVerseId, + setIsMiscSlide, + setActiveShabadId, + setVerseHistory, + setActivePaneId, + setShortcuts, + } = useStoreActions((actions) => actions.navigator); + const [activeVerse, setActiveVerse] = useState({}); + + const virtuosoRef = useRef(null); + const activeVerseRef = useRef(null); + + const updateTraversedVerse = (newTraversedVerse, verseIndex, crossPlatformID = null) => { + if (isMiscSlide) { + setIsMiscSlide(false); + } + if (activePaneId !== currentPane) { + setActivePaneId(currentPane); + } + changeVerse(newTraversedVerse, verseIndex, shabadId, { + activeVerseId, + setActiveVerseId, + setActiveVerse, + activeShabadId, + setActiveShabadId, + setPreviousIndex, + }); + udpateHistory(shabadId, newTraversedVerse, { + verseHistory, + setVerseHistory, + setPaneAttributes, + paneAttributes, + }); + sendToBaniController(crossPlatformID, filteredItems, newTraversedVerse, baniLength, { + isSundarGutkaBani, + sundarGutkaBaniId, + isCeremonyBani, + ceremonyId, + activeShabadId, + paneAttributes, + }); + }; + + const updateHomeVerse = (verseIndex) => { + changeHomeVerse(verseIndex, { paneAttributes, setPaneAttributes }); + }; + + useEffect(() => { + if (baniType === 'shabad') { + loadShabad(shabadId).then((verseList) => { + if (verseList.length) { + setRawVerses(verseList); + saveToHistory( + shabadId, + verseList, + baniType, + { verseHistory, setVerseHistory, baniLength }, + initialVerseId, + ); + setFilteredItems(filterRequiredVerseItems(verseList)); + } + }); + } else if (baniType === 'bani') { + loadBani(shabadId, baniLengthCols[baniLength]).then((verseList) => { + if (verseList.length) { + setRawVerses(verseList); + saveToHistory( + shabadId, + verseList, + baniType, + { verseHistory, setVerseHistory, baniLength }, + initialVerseId, + ); + setFilteredItems(filterRequiredVerseItems(verseList)); + } + }); + } else if (baniType === 'ceremony') { + loadCeremony(shabadId).then((verseList) => { + if (verseList.length) { + setRawVerses(verseList); + saveToHistory( + shabadId, + verseList, + baniType, + { verseHistory, setVerseHistory, baniLength }, + initialVerseId, + ); + setFilteredItems(filterRequiredVerseItems(verseList)); + } + }); + } + }, [shabadId, baniType, baniLength]); + + useEffect(() => { + if (filteredItems.length) { + setTimeout(() => { + scrollToVerse(initialVerseId, filteredItems, virtuosoRef); + }, 100); + const initialVerseIndex = filteredItems.findIndex( + (verse) => verse.verseId === initialVerseId, + ); + const activeVerseIndex = filteredItems.findIndex((verse) => verse.verseId === activeVerseId); + if (initialVerseIndex >= 0) { + updateHomeVerse(initialVerseIndex); + setActiveVerse({ [activeVerseIndex]: activeVerseId }); + } + if (activeShabadId === null) { + updateTraversedVerse(initialVerseId, initialVerseIndex); + } + } + }, [filteredItems]); + + useEffect(() => { + const overlayVerse = filterOverlayVerseItems(rawVerses, activeVerseId); + ipcRenderer.send( + 'show-line', + JSON.stringify({ + Line: overlayVerse, + live: liveFeed, + }), + ); + }, [activeShabadId, activeVerseId]); + + const getVerse = (direction) => { + let verseIndex = null; + if (direction === 'next') { + Object.keys(activeVerse).forEach((activeVerseIndex) => { + if (filteredItems.length - 1 > parseInt(activeVerseIndex, 10)) { + verseIndex = parseInt(activeVerseIndex, 10) + 1; + } + }); + } else if (direction === 'prev') { + Object.keys(activeVerse).forEach((activeVerseIndex) => { + if (parseInt(activeVerseIndex, 10) > 0) { + verseIndex = parseInt(activeVerseIndex, 10) - 1; + } + }); + } + if (verseIndex !== null) { + const { verseId } = filteredItems[verseIndex]; + return { verseIndex, verseId }; + } + return null; + }; + + // checks if keyboard shortcut is fired then it invokes the function + useEffect(() => { + if (activePaneId === currentPane) { + if (shortcuts.nextVerse) { + const nextVerse = getVerse('next'); + if (nextVerse) { + updateTraversedVerse(nextVerse.verseId, nextVerse.verseIndex); + scrollToVerse(nextVerse.verseId, filteredItems, virtuosoRef); + } + setShortcuts({ + ...shortcuts, + nextVerse: false, + }); + } + if (shortcuts.prevVerse) { + const prevVerse = getVerse('prev'); + if (prevVerse) { + updateTraversedVerse(prevVerse.verseId, prevVerse.verseIndex); + scrollToVerse(prevVerse.verseId, filteredItems, virtuosoRef); + } + setShortcuts({ + ...shortcuts, + prevVerse: false, + }); + } + if (shortcuts.homeVerse) { + const verse = intelligentNextVerse(filteredItems, { + activeVerseId: paneAttributes.activeVerse, + previousVerseIndex, + setPreviousIndex, + atHome, + setHome, + homeVerse: paneAttributes.homeVerse, + }); + if (verse) { + updateTraversedVerse(verse.verseId, verse.verseIndex); + scrollToVerse(verse.verseId, filteredItems, virtuosoRef); + } + setShortcuts({ + ...shortcuts, + homeVerse: false, + }); + } + if (shortcuts.copyToClipboard) { + copyToClipboard(activeVerseRef); + setShortcuts({ + ...shortcuts, + copyToClipboard: false, + }); + } + } + }, [shortcuts]); + + useEffect(() => { + const milisecondsDelay = parseInt(autoplayDelay, 10) * 1000; + const interval = setInterval(() => { + if (autoplayToggle) { + setShortcuts({ + ...shortcuts, + nextVerse: true, + }); + } + }, milisecondsDelay); + return () => { + clearInterval(interval); + }; + }, [autoplayToggle, autoplayDelay]); + + return ( +
    +
    + { + const { verseId, verse, english } = verseObj; + return ( + + ); + }} + /> +
    +
    + ); +}; + +ShabadText.propTypes = { + shabadId: PropTypes.number, + initialVerseId: PropTypes.number, + baniType: PropTypes.string, + paneAttributes: PropTypes.object, + setPaneAttributes: PropTypes.func, + currentPane: PropTypes.number, +}; diff --git a/www/main/navigator/shabad/utils/change-home-verse.js b/www/main/navigator/shabad/utils/change-home-verse.js new file mode 100644 index 000000000..0bc143522 --- /dev/null +++ b/www/main/navigator/shabad/utils/change-home-verse.js @@ -0,0 +1,5 @@ +export const changeHomeVerse = (verseIndex, { paneAttributes, setPaneAttributes }) => { + if (paneAttributes.homeVerse !== verseIndex) { + setPaneAttributes({ ...paneAttributes, homeVerse: verseIndex }); + } +}; diff --git a/www/main/navigator/shabad/utils/change-verse.js b/www/main/navigator/shabad/utils/change-verse.js new file mode 100644 index 000000000..c4557882f --- /dev/null +++ b/www/main/navigator/shabad/utils/change-verse.js @@ -0,0 +1,163 @@ +export const udpateHistory = ( + currentShabadId, + newTraversedVerse, + { verseHistory, setPaneAttributes, paneAttributes }, +) => { + const existingShabadIndex = verseHistory.findIndex( + (historyShabad) => historyShabad.shabadId === currentShabadId, + ); + const currentHistoryObj = verseHistory[existingShabadIndex]; + if (currentHistoryObj) { + currentHistoryObj.continueFrom = newTraversedVerse; + if (!currentHistoryObj.versesRead.includes(newTraversedVerse)) { + currentHistoryObj.versesRead = [...currentHistoryObj.versesRead, newTraversedVerse]; + setPaneAttributes({ + ...paneAttributes, + activeVerse: newTraversedVerse, + versesRead: currentHistoryObj.versesRead, + }); + } + } +}; + +export const changeVerse = ( + newTraversedVerse, + verseIndex, + clickedShabad, + { + activeVerseId, + setActiveVerseId, + setActiveVerse, + setActiveShabadId, + activeShabadId, + setPreviousIndex, + }, +) => { + if (clickedShabad !== activeShabadId) { + setActiveShabadId(clickedShabad); + setPreviousIndex(null); + } + setActiveVerse({ [verseIndex]: newTraversedVerse }); + if (activeVerseId !== newTraversedVerse) { + setActiveVerseId(newTraversedVerse); + } +}; + +export const sendToBaniController = ( + crossPlatformId, + activeShabad, + newTraversedVerse, + baniLength, + { + isSundarGutkaBani, + sundarGutkaBaniId, + isCeremonyBani, + ceremonyId, + activeShabadId, + paneAttributes, + }, +) => { + if (window.socket !== undefined && window.socket !== null) { + let baniVerse; + if (!crossPlatformId) { + baniVerse = activeShabad.find((obj) => obj.ID === newTraversedVerse); + } + if (isSundarGutkaBani) { + window.socket.emit('data', { + host: 'sttm-desktop', + type: 'bani', + id: sundarGutkaBaniId, + shabadid: sundarGutkaBaniId, // @deprecated + highlight: crossPlatformId || baniVerse.crossPlatformID, + baniLength, + // mangalPosition, + verseChange: false, + }); + } else if (isCeremonyBani) { + window.socket.emit('data', { + host: 'sttm-desktop', + type: 'ceremony', + id: ceremonyId, + shabadid: ceremonyId, // @deprecated + highlight: crossPlatformId || baniVerse.crossPlatformID, + verseChange: false, + }); + } else { + window.socket.emit('data', { + type: 'shabad', + host: 'sttm-desktop', + id: activeShabadId, + shabadid: activeShabadId, // @deprecated + highlight: newTraversedVerse, + homeId: paneAttributes.homeVerse, + verseChange: false, + }); + } + } +}; + +const skipIkOnkar = (shabadVerses, index) => { + if (shabadVerses[index]) { + // eslint-disable-next-line no-unsafe-optional-chaining + const { verse: gurmukhi } = shabadVerses[index]?.verse; + const { verseId } = shabadVerses[index]; + if (verseId !== 1 && /^(<>)/gm.test(gurmukhi)) { + return index + 1; + } + return index; + } + return 0; +}; + +const skipMangla = (shabadVerses, index) => { + const gurmukhi = shabadVerses[index]?.verse; + if (/(mhlw [\w])|(mÚ [\w])/.test(gurmukhi) || (index === 0 && /sloku/.test(gurmukhi))) { + return skipIkOnkar(shabadVerses, index + 1); + } + return skipIkOnkar(shabadVerses, index); +}; + +export const intelligentNextVerse = ( + filteredItems, + { activeVerseId, previousVerseIndex, setPreviousIndex, atHome, setHome, homeVerse }, +) => { + if (homeVerse) { + const currentVerseIndex = filteredItems.findIndex(({ verseId }) => verseId === activeVerseId); + let nextVerseIndex; + + if (atHome) { + if (previousVerseIndex !== null) { + nextVerseIndex = previousVerseIndex + 1; + if (nextVerseIndex >= filteredItems.length) { + nextVerseIndex = 0; + } + } else { + nextVerseIndex = 0; + } + nextVerseIndex = skipMangla(filteredItems, nextVerseIndex); + if (nextVerseIndex === homeVerse) { + nextVerseIndex++; + } + setPreviousIndex(nextVerseIndex); + setHome(false); + } else { + nextVerseIndex = skipMangla(filteredItems, currentVerseIndex + 1); + + if (nextVerseIndex >= filteredItems.length) { + nextVerseIndex = 0; + } + const currentVerseObj = filteredItems[currentVerseIndex]; + const nextVerseObj = filteredItems[nextVerseIndex]; + + if (currentVerseObj.lineNo !== nextVerseObj.lineNo) { + nextVerseIndex = homeVerse; + setHome(true); + } else { + setPreviousIndex(nextVerseIndex); + } + } + const nextVerseId = filteredItems[nextVerseIndex].verseId; + return { verseId: nextVerseId, verseIndex: nextVerseIndex }; + } + return null; +}; diff --git a/www/main/navigator/shabad/utils/copy-to-clipboard.js b/www/main/navigator/shabad/utils/copy-to-clipboard.js new file mode 100644 index 000000000..cd39ead76 --- /dev/null +++ b/www/main/navigator/shabad/utils/copy-to-clipboard.js @@ -0,0 +1,20 @@ +import Noty from 'noty'; +import copy from 'copy-to-clipboard'; + +const anvaad = require('anvaad-js'); +const remote = require('@electron/remote'); + +const { i18n } = remote.require('./app'); + +export const copyToClipboard = (activeVerseRef) => { + if (activeVerseRef && activeVerseRef.current) { + const nonUniCodePanktee = activeVerseRef.current.childNodes[1].innerText; + const uniCodePanktee = anvaad.unicode(nonUniCodePanktee); + copy(uniCodePanktee); + new Noty({ + type: 'info', + text: `${i18n.t('SHORTCUT.COPY_TO_CLIPBOARD')}`, + timeout: 2000, + }).show(); + } +}; diff --git a/www/main/navigator/shabad/utils/filter-verse-items.js b/www/main/navigator/shabad/utils/filter-verse-items.js new file mode 100644 index 000000000..c521bca69 --- /dev/null +++ b/www/main/navigator/shabad/utils/filter-verse-items.js @@ -0,0 +1,61 @@ +const anvaad = require('anvaad-js'); + +export const filterRequiredVerseItems = (verses) => { + let versesNew; + let currentLine = 0; + try { + versesNew = verses.flat(1); + } catch (error) { + versesNew = verses; + } + const checkPauri = versesNew.filter((verse) => /]\d*]/.test(verse.Gurmukhi)); + const regex = checkPauri.length > 1 ? /]\d*]/ : /]/; + return versesNew + ? versesNew.map((verse, index) => { + if (verse) { + const verseObj = { + ID: index, + verseId: verse.ID, + verse: verse.Gurmukhi, + english: verse.English ? verse.English : '', + lineNo: currentLine, + crossPlatformId: verse.crossPlatformID ? verse.crossPlatformID : '', + }; + if (regex.test(verse.Gurmukhi)) { + currentLine++; + } + return verseObj; + } + return {}; + }) + : []; +}; + +export const filterOverlayVerseItems = (verses, verseId) => { + if (verses) { + const currentIndex = verses.findIndex((obj) => obj.ID === verseId); + const currentVerse = verses[currentIndex]; + if (currentVerse) { + const Line = { ...currentVerse.toJSON() }; + if (Line.Translations) { + const lineTranslations = JSON.parse(Line.Translations); + Line.English = lineTranslations.en.bdb || lineTranslations.en.ms || lineTranslations.en.ssk; + Line.Punjabi = + lineTranslations.pu.bdb || + lineTranslations.pu.ss || + lineTranslations.pu.ft || + lineTranslations.pu.ms; + Line.Spanish = lineTranslations.es.sn; + Line.Hindi = (lineTranslations.hi && lineTranslations.hi.ss) || ''; + } + Line.Transliteration = { + English: anvaad.translit(Line.Gurmukhi || ''), + Shahmukhi: anvaad.translit(Line.Gurmukhi || '', 'shahmukhi'), + Devanagari: anvaad.translit(Line.Gurmukhi || '', 'devnagri'), + }; + Line.Unicode = anvaad.unicode(Line.Gurmukhi || ''); + return Line; + } + } + return {}; +}; diff --git a/www/main/navigator/shabad/utils/index.js b/www/main/navigator/shabad/utils/index.js new file mode 100644 index 000000000..b889bceb8 --- /dev/null +++ b/www/main/navigator/shabad/utils/index.js @@ -0,0 +1,11 @@ +export { + changeVerse, + sendToBaniController, + udpateHistory, + intelligentNextVerse, +} from './change-verse'; +export { filterRequiredVerseItems } from './filter-verse-items'; +export { changeHomeVerse } from './change-home-verse'; +export { scrollToVerse } from './scroll-to-verse'; +export { saveToHistory } from './save-to-history'; +export { copyToClipboard } from './copy-to-clipboard'; diff --git a/www/main/navigator/shabad/utils/save-to-history.js b/www/main/navigator/shabad/utils/save-to-history.js new file mode 100644 index 000000000..4fa7f8ef3 --- /dev/null +++ b/www/main/navigator/shabad/utils/save-to-history.js @@ -0,0 +1,53 @@ +export const saveToHistory = ( + shabadId, + verses, + verseType, + { verseHistory, setVerseHistory, baniLength }, + initialVerse = null, +) => { + const firstVerse = verses[0]; + let verseId; + if (initialVerse === null) { + verseId = firstVerse.ID; + } else { + verseId = initialVerse; + } + const firstVerseIndex = verses.findIndex((v) => v.verseId === verseId); + let baniId = shabadId; + let verse; + if (verseType === 'shabad') { + if (initialVerse) { + const clickedVerse = verses.filter((verseObj) => verseObj.ID === initialVerse); + verse = clickedVerse.length && clickedVerse[0].Gurmukhi; + } else { + verse = firstVerse.Gurmukhi; + } + } else if (verseType === 'bani') { + verse = firstVerse.baniName; + baniId = firstVerse.baniId; + } else if (verseType === 'ceremony') { + verse = firstVerse.ceremonyName; + baniId = firstVerse.ceremonyId; + } + const check = verseHistory.filter((historyObj) => historyObj.shabadId === baniId); + if (check.length === 0) { + const updatedHistory = [ + { + shabadId: baniId, + verseId, + label: verse, + type: verseType, + meta: { + baniLength, + }, + versesRead: [verseId], + continueFrom: verseId, + homeVerse: firstVerseIndex, + }, + ...verseHistory, + ]; + setVerseHistory(updatedHistory); + return true; + } + return false; +}; diff --git a/www/main/navigator/shabad/utils/scroll-to-verse.js b/www/main/navigator/shabad/utils/scroll-to-verse.js new file mode 100644 index 000000000..bdb60c190 --- /dev/null +++ b/www/main/navigator/shabad/utils/scroll-to-verse.js @@ -0,0 +1,8 @@ +export const scrollToVerse = (verseId, activeShabad, virtuosoRef) => { + const verseIndex = activeShabad.findIndex((obj) => obj.verseId === verseId); + virtuosoRef.current.scrollToIndex({ + index: verseIndex, + behavior: 'smooth', + align: 'center', + }); +}; diff --git a/www/main/navigator/viewer/ViewerContent.jsx b/www/main/navigator/viewer/ViewerContent.jsx index 4ebf4d9cf..b40a855e5 100644 --- a/www/main/navigator/viewer/ViewerContent.jsx +++ b/www/main/navigator/viewer/ViewerContent.jsx @@ -1,16 +1,43 @@ -import React from 'react'; +import React, { useEffect, useRef } from 'react'; +import { ipcRenderer } from 'electron'; -const ViewerContent = () => ( -
    - -
    -); +const ViewerContent = () => { + const webviewRef = useRef(null); + + useEffect(() => { + const handleDomReady = () => { + ipcRenderer.send('enable-wc-webview', webviewRef.current.getWebContentsId()); + global.webview = webviewRef.current; + global.webview.send('update-settings'); + }; + + const webviewElement = webviewRef.current; + if (webviewElement) { + webviewElement.addEventListener('dom-ready', handleDomReady); + } + + return () => { + if (webviewElement) { + webviewElement.removeEventListener('dom-ready', handleDomReady); + global.webview = null; + } + }; + }, []); + + return ( +
    + +
    + ); +}; export default ViewerContent; diff --git a/www/main/navigator/viewer/ViewerPane.jsx b/www/main/navigator/viewer/ViewerPane.jsx index cde56f337..e382077eb 100644 --- a/www/main/navigator/viewer/ViewerPane.jsx +++ b/www/main/navigator/viewer/ViewerPane.jsx @@ -2,10 +2,12 @@ import React from 'react'; import Pane from '../../common/sttm-ui/pane/Pane'; import ViewerContent from './ViewerContent'; -const ViewerPane = () => ( +const ViewerPane = React.memo(() => (
    -); +)); + +ViewerPane.displayName = 'ViewerPane'; export default ViewerPane; diff --git a/www/main/overlay/components/CopyToClipboard.jsx b/www/main/overlay/components/CopyToClipboard.jsx index 296c76da6..2d9187f68 100644 --- a/www/main/overlay/components/CopyToClipboard.jsx +++ b/www/main/overlay/components/CopyToClipboard.jsx @@ -6,22 +6,43 @@ const copy = require('copy-to-clipboard'); const { i18n } = remote.require('./app'); -export const CopyToClipboard = ({ url }) => ( -
    -

    {i18n.t(`BANI_OVERLAY.LIVE_URL`)}

    -
    - - { - copy(url); - }} - > - - +export const CopyToClipboard = ({ url }) => { + const [copied, setCopied] = React.useState(false); + + const handleCopy = () => { + copy(url); + setCopied(true); + }; + + return ( +
    +

    {i18n.t(`BANI_OVERLAY.LIVE_URL`)}

    +
    + event.target.select()} // Select all text on focus + onMouseLeave={() => setCopied(false)} + readOnly={true} + value={url} + /> + setCopied(false)} + > + + + + {copied ? i18n.t('BANI_OVERLAY.COPIED_URL') : i18n.t('BANI_OVERLAY.COPY_URL')} + +
    -
    -); + ); +}; + + CopyToClipboard.propTypes = { url: PropTypes.string, diff --git a/www/main/settings/components/Categories.jsx b/www/main/settings/components/Categories.jsx index 131d6ab0a..e761f263b 100644 --- a/www/main/settings/components/Categories.jsx +++ b/www/main/settings/components/Categories.jsx @@ -22,18 +22,30 @@ const SettingsFactory = ({ subCategory }) => { } } + const addonMarkup = []; + + if (addon) { + addonObj.forEach((add, index) => { + addonMarkup.push( + , + ); + }); + } + settingsDOM.push( - /* 1. Push the Addon first */
    - {addon && ( - - )} + {/* 1. Push the Addon first */} + {addon && addonMarkup} + {/* 2. Then add title */} - {i18n.t(`SETTINGS.${subCategory.settingObjs[settingKey].title}`)} + + {subCategory.settingObjs[settingKey].title && + i18n.t(`SETTINGS.${subCategory.settingObjs[settingKey].title}`)} + {/* 3. Push notes and default value text */} diff --git a/www/main/settings/components/Setting.jsx b/www/main/settings/components/Setting.jsx index 9a3e8c614..d6af08699 100644 --- a/www/main/settings/components/Setting.jsx +++ b/www/main/settings/components/Setting.jsx @@ -4,6 +4,7 @@ import { useStoreState, useStoreActions } from 'easy-peasy'; import { Switch, Checkbox } from '../../common/sttm-ui'; import { convertToCamelCase } from '../../common/utils'; +import { settings } from '../../../configs/user-settings.json'; const remote = require('@electron/remote'); @@ -43,6 +44,31 @@ const Setting = ({ settingObj, stateVar, stateFunction }) => { let settingDOM; + const dropdownLabel = (option) => { + if (option.includes('teeka')) { + return i18n.t(`QUICK_TOOLS.TEEKA`); + } + if (option.includes('translation')) { + return i18n.t(`QUICK_TOOLS.TRANSLATION`); + } + if (option.includes('transliteration')) { + return i18n.t(`QUICK_TOOLS.TRANSLITERATION`); + } + return ''; + }; + + const handleResetFontSizes = () => { + const { resetSettings } = settingObj; + if (resetSettings) { + resetSettings.forEach((settingKey) => { + const value = settings[settingKey].initialValue; + if (userSettings[convertToCamelCase(settingKey)] !== value) { + userSettingsActions[`set${convertToCamelCase(settingKey, true)}`](value); + } + }); + } + }; + switch (type) { case 'range': settingDOM = ( @@ -92,6 +118,36 @@ const Setting = ({ settingObj, stateVar, stateFunction }) => { /> ); break; + case 'multilevel-dropdown': + settingDOM = ( + <> + + {dropdownLabel(userSettings[stateVar])} + + ); + break; + case 'reset-button': + settingDOM = ( + + ); + break; default: return null; } diff --git a/www/main/settings/components/SettingViewer.jsx b/www/main/settings/components/SettingViewer.jsx index 352215797..d079e092b 100644 --- a/www/main/settings/components/SettingViewer.jsx +++ b/www/main/settings/components/SettingViewer.jsx @@ -31,9 +31,9 @@ const SettingViewer = () => { const { gurbaniFontSize, - translationFontSize, - teekaFontSize, - transliterationFontSize, + content1FontSize, + content2FontSize, + content3FontSize, displayNextLine, leftAlign, theme, @@ -63,15 +63,15 @@ const SettingViewer = () => { }; const translationStyles = { - fontSize: `${translationFontSize * 3}px`, + fontSize: `${content1FontSize * 3}px`, }; const transliterationStyles = { - fontSize: `${transliterationFontSize * 3}px`, + fontSize: `${content2FontSize * 3}px`, }; const teekaStyles = { - fontSize: `${teekaFontSize * 3}px`, + fontSize: `${content3FontSize * 3}px`, }; const nextLineStyles = { @@ -157,10 +157,7 @@ const SettingViewer = () => { )}
    -

    +

    Whatever I ask for from my Lord and Master, he gives that to me. @@ -173,14 +170,14 @@ const SettingViewer = () => {

    -

    +

    hy BweI! pRBU dy dws Awpxy pRBU pwsoN jo kuJ mMgdy hn auh auhI kuJ auhnW ƒ dyNdw hY [

    diff --git a/www/main/settings/utils/parse-settings.js b/www/main/settings/utils/parse-settings.js index e3df3d73d..dce48ea5e 100644 --- a/www/main/settings/utils/parse-settings.js +++ b/www/main/settings/utils/parse-settings.js @@ -33,9 +33,13 @@ const settingsObjGenerator = () => { settingsNewObj[category].subCatObjs[subCategory].settings.forEach((setting) => { settingsNewObj[category].subCatObjs[subCategory].settingObjs[setting] = settings[setting]; const { addon } = settingsNewObj[category].subCatObjs[subCategory].settingObjs[setting]; - if (addon) { - settingsNewObj[category].subCatObjs[subCategory].settingObjs[setting].addonObj = - settings[addon]; + if (addon && addon.length) { + settingsNewObj[category].subCatObjs[subCategory].settingObjs[setting].addonObj = []; + addon.forEach((add) => { + settingsNewObj[category].subCatObjs[subCategory].settingObjs[setting].addonObj.push( + settings[add], + ); + }); } const subCat = settingsNewObj[category].subCatObjs[subCategory]; const { type } = subCat; diff --git a/www/main/viewer/ShabadDeck/ShabadDeck.jsx b/www/main/viewer/ShabadDeck/ShabadDeck.jsx index 7e133c7f7..e12d61a4c 100644 --- a/www/main/viewer/ShabadDeck/ShabadDeck.jsx +++ b/www/main/viewer/ShabadDeck/ShabadDeck.jsx @@ -12,8 +12,11 @@ import { import ViewerIcon from '../icons/ViewerIcon'; const os = require('os'); +const remote = require('@electron/remote'); +const { i18n } = remote.require('./app'); const platform = os.platform(); + const themes = require('../../../configs/themes.json'); function ShabadDeck() { @@ -34,8 +37,8 @@ function ShabadDeck() { baniLength, // mangalPosition, displayNextLine, - isSingleDisplayMode, themeBg, + currentWorkspace, } = useStoreState((state) => state.userSettings); const [activeVerse, setActiveVerse] = useState([]); const [nextVerse, setNextVerse] = useState({}); @@ -169,7 +172,7 @@ function ShabadDeck() { } }); } - }, [activeVerseId, sundarGutkaBaniId, ceremonyId, akhandpatt, displayNextLine]); + }, [activeShabadId, activeVerseId, sundarGutkaBaniId, ceremonyId, akhandpatt, displayNextLine]); useEffect(() => { if (isMiscSlide) { @@ -186,7 +189,7 @@ function ShabadDeck() {
    { - const { - setTranslationVisibility, - setTeekaVisibility, - setTransliterationVisibility, - setGurbaniFontSize, - setTranslationFontSize, - setTeekaFontSize, - setTransliterationFontSize, - setAnnouncementsFontSize, - } = useStoreActions((state) => state.userSettings); - const { - translationVisibility, - teekaVisibility, - transliterationVisibility, - gurbaniFontSize, - translationFontSize, - teekaFontSize, - transliterationFontSize, - announcementsFontSize, - quickTools, - } = useStoreState((state) => state.userSettings); + const userSettings = useStoreState((state) => state.userSettings); + const { quickToolsOpen } = useStoreState((state) => state.viewerSettings); const { setQuickToolsOpen } = useStoreActions((state) => state.viewerSettings); - const [quickToolsActions, setQuickToolsActions] = useState([ - 'Gurbani', - 'Translation', - 'Teeka', - 'Transliteration', + + const [prevOrder, setPrevOrder] = useState([]); + + const [baniOrder, setBaniOrder] = useState([ + 'gurbani', + userSettings.content1, + userSettings.content2, + userSettings.content3, ]); + const dropdownLabel = (option) => { + if (option.includes('gurbani')) { + return i18n.t(`QUICK_TOOLS.BANI`); + } + if (option.includes('teeka')) { + return i18n.t(`QUICK_TOOLS.TEEKA`); + } + if (option.includes('translation')) { + return i18n.t(`QUICK_TOOLS.TRANSLATION`); + } + if (option.includes('transliteration')) { + return i18n.t(`QUICK_TOOLS.TRANSLITERATION`); + } + return ''; + }; + + const baniOptions = [ + { + label: 'teeka', + options: [{ id: 'teeka-punjabi', text: 'Punjabi' }], + }, + { + label: 'translation', + options: [ + { id: 'translation-english', text: 'English' }, + { id: 'translation-hindi', text: 'Hindi' }, + { id: 'translation-spanish', text: 'Spanish' }, + ], + }, + { + label: 'transliteration', + options: [ + { id: 'transliteration-english', text: 'English' }, + { id: 'transliteration-hindi', text: 'Hindi' }, + ], + }, + ]; + const quickToolsModifiers = [ { name: 'visibility', @@ -53,41 +76,55 @@ const QuickTools = ({ isMiscSlide }) => { }, ]; - const createGlobalPlatformObj = (name, toolName, action) => { - let payload = eval(convertToCamelCase(`${toolName}${action}`)); - const actionName = `set${toolName}${action}`; - if (name === 'visibility') payload = eval(`${actionName}(${!payload})`); - if (name === 'minus') payload = eval(`${actionName}(${payload} - 1)`); - if (name === 'plus') payload = eval(`${actionName}(${payload} + 1)`); + const createGlobalPlatformObj = (name, index, action) => { + let payload; + let actionName; + let stateName; + + if (index > 0) { + stateName = `content${index}${action}`; + actionName = `setContent${index}${action}`; + } else { + stateName = `gurbani${action}`; + actionName = `setGurbani${action}`; + } + + if (name === 'visibility') { + payload = !userSettings[stateName]; + } else if (name === 'minus') { + payload = parseInt(userSettings[stateName], 10) - 1; + } else if (name === 'plus') { + payload = parseInt(userSettings[stateName], 10) + 1; + } return { actionName, - payload: payload.payload, + payload, settingType: 'userSettings', }; }; - const getIconClassName = (name, toolName, action) => { - if (name === 'visibility' && ['Translation', 'Teeka', 'Transliteration'].includes(toolName)) - return eval(convertToCamelCase(`${toolName}${action}`)) ? 'fa fa-eye' : 'fa fa-eye-slash'; + const getIconClassName = (name, index, action) => { + if (index > 0 && name === 'visibility') + return userSettings[`content${index}${action}`] ? 'fa fa-eye' : 'fa fa-eye-slash'; if (name === 'minus') return 'fa fa-minus-circle'; if (name === 'plus') return 'fa fa-plus-circle'; return ''; }; const hide = (name, toolName) => - name === 'visibility' && ['Gurbani', 'Announcements'].includes(toolName) + name === 'visibility' && ['gurbani', 'announcements'].includes(toolName) ? 'quicktool-icons-hidden' : ''; - const bakeIcons = (toolName, icons) => + const bakeIcons = (toolName, index, icons) => icons.map(({ name, actionName }) => (
    { global.platform.ipc.send( 'update-global-setting', - JSON.stringify(createGlobalPlatformObj(name, toolName, actionName)), + JSON.stringify(createGlobalPlatformObj(name, index, actionName)), ); }} /> @@ -96,24 +133,70 @@ const QuickTools = ({ isMiscSlide }) => { useEffect(() => { if (isMiscSlide) { - setQuickToolsActions(['Announcements']); - } else { - setQuickToolsActions(['Gurbani', 'Translation', 'Teeka', 'Transliteration']); + if (prevOrder !== baniOrder) { + setPrevOrder(baniOrder); + } + setBaniOrder(['announcements']); + } else if (baniOrder !== prevOrder && prevOrder.length > 1) { + setBaniOrder(prevOrder); } }, [isMiscSlide]); + useEffect(() => { + setBaniOrder(['gurbani', userSettings.content1, userSettings.content2, userSettings.content3]); + }, [userSettings.content1, userSettings.content2, userSettings.content3]); + + const handleQuickTools = (order, index) => { + if (order === 'gurbani' || order === 'announcements') { + return
    {dropdownLabel(order)}
    ; + } + + const markup = baniOptions.map((optionObj, optionIndex) => ( + + {optionObj.options.map((optionName, nameIndex) => ( + + ))} + + )); + return ( + <> +
    {dropdownLabel(order)}
    + + + ); + }; + return ( -
    +
    setQuickToolsOpen(!quickToolsOpen)}> Quick Tools
    {quickToolsOpen && (
    - {quickToolsActions.map((name) => ( -
    -
    {name}
    -
    {bakeIcons(name, quickToolsModifiers)}
    + {baniOrder.map((order, index) => ( +
    + {handleQuickTools(order, index)} +
    {bakeIcons(order, index, quickToolsModifiers)}
    ))}
    diff --git a/www/main/viewer/Slide/Slide.jsx b/www/main/viewer/Slide/Slide.jsx index ced380f0a..69014e42e 100644 --- a/www/main/viewer/Slide/Slide.jsx +++ b/www/main/viewer/Slide/Slide.jsx @@ -13,9 +13,6 @@ global.platform = require('../../desktop_scripts'); const Slide = ({ verseObj, nextLineObj, isMiscSlide, bgColor }) => { const { - translationVisibility, - transliterationVisibility, - teekaVisibility, larivaar, larivaarAssist, larivaarAssistType, @@ -23,13 +20,22 @@ const Slide = ({ verseObj, nextLineObj, isMiscSlide, bgColor }) => { vishraamSource, vishraamType, displayNextLine, + content1, + content2, + content3, + content1Visibility, + content2Visibility, + content3Visibility, } = useStoreState((state) => state.userSettings); const { activeVerseId } = useStoreState((state) => state.navigator); const [showVerse, setShowVerse] = useState(true); + const [orderMarkup, setOrderMarkup] = useState(null); const activeVerseRef = useRef(null); + const visibilityStates = [content1Visibility, content2Visibility, content3Visibility]; + const getLarivaarAssistClass = () => { if (larivaarAssist) { return larivaarAssistType === 'single-color' @@ -65,6 +71,64 @@ const Slide = ({ verseObj, nextLineObj, isMiscSlide, bgColor }) => { }, 100); }, [verseObj]); + useEffect(() => { + const markup = [content1, content2, content3].map((content, index) => { + if (visibilityStates[index]) { + if (content.includes('teeka')) { + return ( + verseObj && + verseObj.Translations && ( + + ) + ); + } + if (content.includes('translation')) { + return ( + verseObj && + verseObj.Translations && ( + + ) + ); + } + if (content.includes('transliteration')) { + return ( + verseObj && + verseObj.Gurmukhi && ( + + ) + ); + } + } + return null; + }); + setOrderMarkup(markup); + }, [ + content1, + content2, + content3, + content1Visibility, + content2Visibility, + content3Visibility, + verseObj, + ]); + return (
    @@ -79,7 +143,7 @@ const Slide = ({ verseObj, nextLineObj, isMiscSlide, bgColor }) => { }`} ref={activeVerseRef} style={{ - 'font-weight': 'normal', // adding style here to reach chromecast + fontWeight: 'normal', // adding style here to reach chromecast }} > {

    )} - {translationVisibility && verseObj.Translations && ( - - )} + {orderMarkup !== null && orderMarkup} {verseObj.English && ( )} - {teekaVisibility && verseObj.Translations && ( - - )} - {transliterationVisibility && ( - - )} {displayNextLine && nextLineObj && (
    { - const { teekaFontSize, teekaSource } = useStoreState((state) => state.userSettings); +const SlideTeeka = ({ getFontSize, teekaObj, position }) => { + const { content1FontSize, content2FontSize, content3FontSize, teekaSource } = useStoreState( + (state) => state.userSettings, + ); const [teekaString, setTeekaString] = useState(null); + const fontSizes = [content1FontSize, content2FontSize, content3FontSize]; const getTeeka = (inputTeeka) => { if (inputTeeka && inputTeeka.pu) { @@ -20,7 +23,7 @@ const SlideTeeka = ({ getFontSize, teekaObj }) => { getTeeka(teekaObj); }, [teekaObj]); - const customStyle = getFontSize(teekaFontSize); + const customStyle = getFontSize(fontSizes[position]); return ( teekaString && ( @@ -34,6 +37,7 @@ const SlideTeeka = ({ getFontSize, teekaObj }) => { SlideTeeka.propTypes = { getFontSize: PropTypes.func, teekaObj: PropTypes.object, + position: PropTypes.number, }; export default SlideTeeka; diff --git a/www/main/viewer/Slide/SlideTranslation.jsx b/www/main/viewer/Slide/SlideTranslation.jsx index 8d7802284..40d22805b 100644 --- a/www/main/viewer/Slide/SlideTranslation.jsx +++ b/www/main/viewer/Slide/SlideTranslation.jsx @@ -2,25 +2,23 @@ import React, { useState, useEffect } from 'react'; import PropTypes from 'prop-types'; import { useStoreState } from 'easy-peasy'; -const SlideTranslation = ({ getFontSize, translationObj, translationHTML }) => { - const { - translationLanguage, - translationFontSize, - translationEnglishSource, - translationHindiSource, - } = useStoreState((state) => state.userSettings); +const SlideTranslation = ({ getFontSize, translationObj, translationHTML, lang, position }) => { + const { content1FontSize, content2FontSize, content3FontSize } = useStoreState( + (state) => state.userSettings, + ); const [translationString, setTranslationString] = useState(null); + const fontSizes = [content1FontSize, content2FontSize, content3FontSize]; const getTranslation = (translations) => { - switch (translationLanguage) { - case 'English': - setTranslationString(translations.en[translationEnglishSource]); + switch (lang) { + case 'translation-english': + setTranslationString(translations.en.bdb); break; - case 'Spanish': + case 'translation-spanish': setTranslationString(translations.es.sn); break; - case 'Hindi': - setTranslationString((translations.hi && translations.hi[translationHindiSource]) || null); + case 'translation-hindi': + setTranslationString((translations.hi && translations.hi.ss) || null); break; default: setTranslationString(null); @@ -32,33 +30,28 @@ const SlideTranslation = ({ getFontSize, translationObj, translationHTML }) => { if (translationObj) { getTranslation(translationObj); } - }, [translationObj]); + }, [translationObj, lang]); let translationMarkup; - const customStyle = getFontSize(translationFontSize); + const customStyle = getFontSize(fontSizes[position]); if (translationHTML) { translationMarkup = (
    ); } else if (translationString) { translationMarkup = ( -
    +
    {translationString}
    ); } else { - translationMarkup = ( -
    - ); + translationMarkup =
    ; } return translationMarkup; @@ -67,6 +60,7 @@ const SlideTranslation = ({ getFontSize, translationObj, translationHTML }) => { SlideTranslation.propTypes = { getFontSize: PropTypes.func, translationObj: PropTypes.object, + lang: PropTypes.string, }; export default SlideTranslation; diff --git a/www/main/viewer/Slide/SlideTransliteration.jsx b/www/main/viewer/Slide/SlideTransliteration.jsx index 335e0e73a..c127be46d 100644 --- a/www/main/viewer/Slide/SlideTransliteration.jsx +++ b/www/main/viewer/Slide/SlideTransliteration.jsx @@ -3,21 +3,22 @@ import PropTypes from 'prop-types'; import { useStoreState } from 'easy-peasy'; import anvaad from 'anvaad-js'; -const SlideTransliteration = ({ getFontSize, gurmukhiString }) => { - const { transliterationLanguage, transliterationFontSize } = useStoreState( +const SlideTransliteration = ({ getFontSize, gurmukhiString, lang, position }) => { + const { content1FontSize, content2FontSize, content3FontSize } = useStoreState( (state) => state.userSettings, ); + const fontSizes = [content1FontSize, content2FontSize, content3FontSize]; const [transliterationString, setTransliterationString] = useState(null); const getTransliteration = (gurmukhi) => { - switch (transliterationLanguage) { - case 'English': + switch (lang) { + case 'transliteration-english': setTransliterationString(anvaad.translit(gurmukhi)); break; - case 'Shahmukhi': + case 'transliteration-punjabi': setTransliterationString(anvaad.translit(gurmukhi || '', 'shahmukhi')); break; - case 'Devanagari': + case 'transliteration-hindi': setTransliterationString(anvaad.translit(gurmukhi || '', 'devnagri')); break; default: @@ -28,16 +29,13 @@ const SlideTransliteration = ({ getFontSize, gurmukhiString }) => { useEffect(() => { getTransliteration(gurmukhiString); - }, [gurmukhiString, transliterationLanguage]); + }, [gurmukhiString, lang]); - const customStyle = getFontSize(transliterationFontSize); + const customStyle = getFontSize(fontSizes[position]); return ( transliterationString && ( -
    +
    {transliterationString}
    ) @@ -47,6 +45,8 @@ const SlideTransliteration = ({ getFontSize, gurmukhiString }) => { SlideTransliteration.propTypes = { getFontSize: PropTypes.func, gurmukhiString: PropTypes.string, + lang: PropTypes.string, + position: PropTypes.number, }; export default SlideTransliteration; diff --git a/www/main/viewer/hooks/bakePanktee.js b/www/main/viewer/hooks/bakePanktee.js index 73edf64b8..6a35bbb34 100644 --- a/www/main/viewer/hooks/bakePanktee.js +++ b/www/main/viewer/hooks/bakePanktee.js @@ -53,7 +53,7 @@ const bakePanktee = () => { ...getFontSize(gurbaniFontSize), display: 'inline-block', margin: '0 0.15em', - 'white-space': 'nowrap', + whiteSpace: 'nowrap', }; } return breakIntoWords(gurmukhiString).map((word, i) => ( diff --git a/www/main/workspace-bar/components/WorkspaceBar.jsx b/www/main/workspace-bar/components/WorkspaceBar.jsx index a09f77b11..4bbf31d3a 100644 --- a/www/main/workspace-bar/components/WorkspaceBar.jsx +++ b/www/main/workspace-bar/components/WorkspaceBar.jsx @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import React from 'react'; import { useStoreState, useStoreActions } from 'easy-peasy'; import { updateViewerScale } from '../../viewer/utils'; @@ -7,32 +7,26 @@ const remote = require('@electron/remote'); const { i18n } = remote.require('./app'); const analytics = remote.getGlobal('analytics'); -const { store } = remote.require('./app'); +// const { store } = remote.require('./app'); const WorkspaceBar = () => { - const { isSingleDisplayMode } = useStoreState((state) => state.userSettings); - const { setIsSingleDisplayMode } = useStoreActions((state) => state.userSettings); + const { currentWorkspace } = useStoreState((state) => state.userSettings); const { minimizedBySingleDisplay } = useStoreState((state) => state.navigator); + const { setCurrentWorkspace } = useStoreActions((state) => state.userSettings); const presenterIdentifier = i18n.t('WORKSPACES.PRESENTER'); - const workspaces = [presenterIdentifier, i18n.t('WORKSPACES.SINGLE_DISPLAY')]; - const defaultWsState = !isSingleDisplayMode ? workspaces[0] : workspaces[1]; - const [currentWorkspace, setWorkspace] = useState(defaultWsState); + const singleDisplayIdentifier = i18n.t('WORKSPACES.SINGLE_DISPLAY'); + const multiPaneIdentifier = i18n.t('WORKSPACES.MULTI_PANE'); + const workspaces = [singleDisplayIdentifier, presenterIdentifier, multiPaneIdentifier]; const handleWorkspaceChange = (workspace) => { const moveToPresenter = workspace === presenterIdentifier; if (moveToPresenter) { - if (isSingleDisplayMode) { - setIsSingleDisplayMode(false); - } - store.setUserPref('app.layout.presenter-view', moveToPresenter); - global.platform.updateSettings(); global.controller['presenter-view'](); - } else if (!isSingleDisplayMode) { - setIsSingleDisplayMode(true); } - setWorkspace(workspace); - analytics.trackEvent('changed workspace', workspace); + if (currentWorkspace !== workspace) { + setCurrentWorkspace(workspace); + } analytics.trackEvent({ category: 'workspace', action: 'changed', diff --git a/www/obs/index.html b/www/obs/index.html index a147a660b..3866f02c1 100644 --- a/www/obs/index.html +++ b/www/obs/index.html @@ -131,13 +131,13 @@ const layoutContainer = document.querySelector('.layout-top-bottom'); layoutContainer.style.color = overlayPrefs.textColor; layoutContainer.style.fontSize = `${(preview && overlayPrefs.fitTextSwitch) ? 3 : overlayPrefs.textSize}vh`; - layoutContainer.style.padding = `${overlayPrefs.fitTextSwitch ? 1 : overlayPrefs.padding}vh`; + layoutContainer.style.padding = `${overlayPrefs.fitTextSwitch ? '1vh 5%' : `${overlayPrefs.padding}vh 5%`}`; layoutContainer.style.backgroundColor = `rgba(${hexToRgb(overlayPrefs.bgColor)}, ${bgOpacity})`; document.querySelectorAll('.content-top, .content-bottom').forEach(el => { el.style.color = overlayPrefs.textColor; el.style.fontSize = `${(preview && overlayPrefs.fitTextSwitch) ? 3 : overlayPrefs.textSize}vh`; - el.style.padding = `${overlayPrefs.fitTextSwitch ? 1 : overlayPrefs.padding}vh`; + el.style.padding = `${overlayPrefs.fitTextSwitch ? '1vh 5%' : `${overlayPrefs.padding}vh 5%`}`; el.style.backgroundColor = `rgba(${hexToRgb(overlayPrefs.bgColor)}, ${bgOpacity})`; }); @@ -149,11 +149,11 @@ if (!preview && ['top', 'bottom'].includes(overlayPrefs.layout)) { if (overlayPrefs.fitTextSwitch) { fitTextInstances = fitty('.layout-top-bottom .o-gurbani', { - minSize: 14, + minSize: 18, maxSize: 36, }); fitTextInstances.push(...fitty('.layout-top-bottom .o-translation', { - minSize: 12, + minSize: 14, maxSize: 24, multiLine: true, })); diff --git a/www/src/scss/_overlay.scss b/www/src/scss/_overlay.scss index fa9bb4c26..b939467a3 100644 --- a/www/src/scss/_overlay.scss +++ b/www/src/scss/_overlay.scss @@ -98,16 +98,31 @@ $toolbar-width: 40px; } .url-container { + display: flex; + flex-wrap: wrap; + align-items: center; + input[type='text'] { background: #fff; border: 1px solid #ddd; border-radius: 32px; color: #333; font-size: 12px; + line-height: 2; margin: 0; padding: 10px; text-align: center; } + + .tooltip { + background-color: black; + border-radius: 6px; + color: #fff; + font-size: 12px; + opacity: 0; + padding: 0.5em 0.7em; + width: max-content; + } } .toggle-text > .layout-btn, @@ -329,6 +344,10 @@ input[type='color'] { background: #ddd; display: inline-block; margin: 2px; + + &:hover + .tooltip { + opacity: 1; + } } .resize-btn { diff --git a/www/src/scss/_settings.scss b/www/src/scss/_settings.scss index 54839af11..e936318c4 100644 --- a/www/src/scss/_settings.scss +++ b/www/src/scss/_settings.scss @@ -219,6 +219,21 @@ } } } + + .icon-reset { + border-radius: 4px; + box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2); + cursor: pointer; + padding: 8px; + display: flex; + gap: 8px; + + img{ + height: 16px; + width: 16px; + filter: invert(0.4); + } + } } } } @@ -379,14 +394,6 @@ margin-top: 0.25em; } -.translation, -.transliteration, -.teeka { - display: none; - height: 0; - opacity: 0; -} - .translation-visibility-true .translation, .transliteration-visibility-true .transliteration, .teeka-visibility-true .teeka { diff --git a/www/src/scss/controller.scss b/www/src/scss/controller.scss index 98ac5d545..4e4ac0b0e 100644 --- a/www/src/scss/controller.scss +++ b/www/src/scss/controller.scss @@ -11,6 +11,7 @@ $totalSessionOffset: $footerOffset + $shortcutTrayHeight; $sessionPageHeight: calc(100% - #{$totalSessionOffset}); .presenter-view.shortcut-tray-true { + #main-ui, .nav-page:nth-child(2) { height: $sessionPageHeight; @@ -92,6 +93,7 @@ ul { .launchpad { display: flex; flex-direction: row; + flex-wrap: wrap; height: 100%; overflow-x: auto; padding: 10px 10px 40px 50px; @@ -121,6 +123,7 @@ ul { .pane { height: inherit; } + .shabad-list { height: inherit; } @@ -142,7 +145,7 @@ ul { } .pane-content { - > div { + >div { padding: 0; } } @@ -175,6 +178,7 @@ ul { .pane { height: inherit; } + .search-footer { margin: 0; width: 100%; @@ -204,7 +208,7 @@ ul { top: 0; width: 100%; - & > .viewer-pane { + &>.viewer-pane { padding: 0; & .pane { @@ -228,13 +232,14 @@ ul { } } } - + .single-display { &-minimize { min-height: auto; height: 5vh; } } + .single-display-switches { background: rgba(221, 221, 221, 1); @@ -252,14 +257,46 @@ ul { } } - .navigator-row { + .navigator-column { align-items: center; display: flex; flex-direction: column; + flex-wrap: wrap; justify-content: space-evenly; position: relative; - width: 50vw; + width: 50%; + } + + .navigator-row { + height: 50%; + width: 100vw; + display: flex; + justify-content: space-evenly; } + + .multipane-grid { + display: grid; + grid-template-columns: repeat(6, 1fr); + width: 100%; + height: 50%; + } + + .shabad1-container, .shabad2-container, .shabad3-container { + grid-row: 1; + } + + .shabad1-container { + grid-column: 1/3; + } + + .shabad2-container { + grid-column: 3/5; + } + + .shabad3-container { + grid-column: 5/7; + } + } .minimized { @@ -342,7 +379,7 @@ ul { } &#session-page { - ul > li { + ul>li { align-items: center; display: flex; @@ -389,7 +426,7 @@ ul { border-bottom: none; } - li > a { + li>a { cursor: default; display: block; line-height: normal; @@ -517,4 +554,4 @@ ul { } @import 'foundation/foundation', 'animations', 'footer', 'forms', 'header', 'helpers', 'search', - 'share-sync', 'settings', 'notifications'; +'share-sync', 'settings', 'notifications'; \ No newline at end of file diff --git a/www/src/scss/navigator/common/_pane.scss b/www/src/scss/navigator/common/_pane.scss index 284da0017..bbff1c24f 100644 --- a/www/src/scss/navigator/common/_pane.scss +++ b/www/src/scss/navigator/common/_pane.scss @@ -2,12 +2,16 @@ .pane-container { flex: 1; max-height: 45vh; + height: 100%; } .pane { display: flex; flex-direction: column; min-width: 500px; + .multipane-grid & { + min-width: 300px; + } position: relative; overflow: hidden; height: 100%; @@ -40,7 +44,7 @@ } .pane-content { - @include flex($fd-value: column, $ai-value: initial); + @include flex($fd-value: column, $ai-value: initial, $jc-value: flex-start); flex-grow: 1; flex-wrap: nowrap; height: 100%; diff --git a/www/src/scss/navigator/common/_verse-block.scss b/www/src/scss/navigator/common/_verse-block.scss index d8c05ef12..e71ca2815 100644 --- a/www/src/scss/navigator/common/_verse-block.scss +++ b/www/src/scss/navigator/common/_verse-block.scss @@ -16,7 +16,7 @@ .verse-content { flex-grow: 1; - padding: 5px 0; + padding: 10px 0; line-height: 1.3; } @@ -47,10 +47,19 @@ .theme-dark-theme & { background-color: $dull-blue; } + .inactive-pane & { + .theme-light-theme & { + background-color: $transparent-light-black; + } + .theme-dark-theme & { + background-color: $transparent-light-white; + } + } } .search-list { display: inline-flex; padding: 0 5px; + width: 100%; .sggs-color { color: $cadmium-orange; } @@ -83,15 +92,17 @@ transition: 0.3s all ease; &.search-li { - padding: 2px 10px; + display: flex; + justify-content: space-between; list-style: none; + padding: 2px 10px; } &.shabad-li { align-items: center; display: flex; justify-content: center; - padding: 5px 10px; + padding: 0 10px; transition: 0.3s all ease; } div { diff --git a/www/src/scss/navigator/misc/_misc.scss b/www/src/scss/navigator/misc/_misc.scss index b070da65a..5294228d7 100644 --- a/www/src/scss/navigator/misc/_misc.scss +++ b/www/src/scss/navigator/misc/_misc.scss @@ -37,15 +37,6 @@ $misc-footer-active: 70px; } } } - .history-results { - overflow-y: auto; - - .history-item { - cursor: pointer; - margin: 8px 0; - padding: 10px; - } - } .list-of-items { @include flex($fd-value: column, $jc-value: start); margin: 0; @@ -69,6 +60,7 @@ $misc-footer-active: 70px; } } } + .misc-footer { @include flex($fd-value: column); height: fit-content; @@ -133,12 +125,22 @@ $misc-footer-active: 70px; } } +.history-results { + overflow-y: auto; + + .history-item { + cursor: pointer; + margin: 0; + padding: 16px 10px; + } +} + .fav-shabad-container { align-items: center; display: flex; flex-direction: row; justify-content: space-between; - padding: 0px 8px; + padding: 0px 10px; transition: 0.3s all ease; .fav-shabad-text { @@ -146,6 +148,11 @@ $misc-footer-active: 70px; width: 65%; } + .fav-item { + margin: 0; + padding: 16px 0; + } + .fav-shabad-options { align-items: center; color: $grey; @@ -268,6 +275,21 @@ $misc-footer-active: 70px; } } +.misc-slides-pane { + @include flex($jc-value: flex-start); + gap: 20px; + padding: 0 32px; + + .misc-slide-button { + background: $cadmium-orange; + border-radius: 4px; + box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2); + color: $white; + cursor: pointer; + padding: 8px; + } +} + .dhan-guru { &-pane { padding: 0 32px; diff --git a/www/src/scss/navigator/search/_searchNew.scss b/www/src/scss/navigator/search/_searchNew.scss index 2b68376b8..9b30aa5c4 100644 --- a/www/src/scss/navigator/search/_searchNew.scss +++ b/www/src/scss/navigator/search/_searchNew.scss @@ -254,10 +254,9 @@ overflow: auto; } .search-footer { - @include flex($ai-value: start, $jc-value: initial, $width: 99%); + @include flex($ai-value: center, $jc-value: initial, $width: 100%); font-size: 14px; padding: 10px; - margin-bottom: 5px; span { &:not(:last-child) { @include inline-flex($width: initial); diff --git a/www/src/scss/navigator/shabad/_multipane.scss b/www/src/scss/navigator/shabad/_multipane.scss new file mode 100644 index 000000000..29febd08f --- /dev/null +++ b/www/src/scss/navigator/shabad/_multipane.scss @@ -0,0 +1,193 @@ +@each $pane, $color in $multipane-colors { + .#{$pane} { + border-bottom: 2px solid $color; + display: flex; + justify-content: space-between; + position: relative; + + .pane-info { + height: 100%; + + button { + height: 100%; + + &.disabled { + opacity: 0.5; + i { + cursor: not-allowed; + } + } + } + } + + .pane-symbol { + background-color: $color; + color: white; + display: inline-block; + height: 100%; + font-size: 18px; + margin-right: 4px; + text-align: center; + width: 40px; + } + + .pane-tools { + align-items: center; + display: flex; + justify-content: flex-end; + width: 100px; + + button { + background-color: transparent; + cursor: pointer; + padding: 0 8px; + } + + .fav-btn { + border-radius: 50%; + margin: 0; + i { + padding-right: 0; + } + } + + .arrow-icons { + display: flex; + + i { + border-radius: 50%; + font-size: 16px; + padding: 5px; + } + } + + .pane-options-dropdown { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + background: url('../../assets/img/icons/ellipsis-vertical-solid.svg'); + background-position: center; + background-repeat: no-repeat; + background-size: auto 18px; + border: none; + color: transparent; + cursor: pointer; + height: 40px; + outline: none; + padding: 16px; + width: 40px; + } + } + + &-btn { + &:disabled { + cursor: not-allowed; + } + + &.active { + background-color: $color; + color: white; + } + } + + .pane-options { + position: absolute; + top: 35px; + right: 0px; + width: 120px; + list-style-type: none; + z-index: 100; + + ul { + list-style-type: none; + + li { + padding-left: 24px; + cursor: pointer; + } + } + + &.hidden { + display: none; + } + } + } + + .button-#{$pane} { + cursor: pointer; + margin: 0 2px; + padding: 12px; + transition: 0.3s all ease; + + i { + color: $snow-white; + font-size: 14px; + } + + &:hover { + background-color: $color; + color: white; + } + + &:disabled { + background-color: rgba($color, 0.8); + color: initial; + cursor: not-allowed; + i { + cursor: not-allowed; + } + } + } +} + +.default-pane-switcher { + flex-grow: 1; + text-align: right; + + button { + cursor: pointer; + padding: 8px 12px; + } +} + +.multipane-content-btn { + border: 1px solid black; + border-radius: 4px; + cursor: pointer; + font-size: 14px; + margin: 12px; + padding: 8px; + width: 160px; + + span { + margin-left: 12px; + } +} + +.multipane-dropdown { + list-style-type: none; + overflow: hidden; + position: absolute; + padding: 4px; + z-index: 10; + + &.disabled { + height: 0px; + transition: 0.3s height ease; + opacity: 0; + } + + &.enabled { + box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px; + height: 154px; + transition: 0.3s height ease; + opacity: 1; + } + + p { + &.locked-option { + cursor: not-allowed; + opacity: 0.5; + } + } +} \ No newline at end of file diff --git a/www/src/scss/navigator/shabad/_shabad.scss b/www/src/scss/navigator/shabad/_shabad.scss index 007909136..0825cc576 100644 --- a/www/src/scss/navigator/shabad/_shabad.scss +++ b/www/src/scss/navigator/shabad/_shabad.scss @@ -1,4 +1,5 @@ @import '../utils/variables'; + .shabad-pane { @include flex($ai-value: start); width: 100%; @@ -7,6 +8,7 @@ &:hover { outline: 0; } + .shabad-list { height: 100%; } @@ -17,6 +19,8 @@ &-header { @include flex($ai-value: center, $jc-value: flex-end); + height: 100%; + width: 100%; .toggle-viewer-btn { align-items: center; @@ -60,4 +64,4 @@ i { padding-right: 8px; } -} +} \ No newline at end of file diff --git a/www/src/scss/obs/styles.scss b/www/src/scss/obs/styles.scss index 7f710d26d..5c70ed0d1 100644 --- a/www/src/scss/obs/styles.scss +++ b/www/src/scss/obs/styles.scss @@ -34,6 +34,11 @@ body { padding: 0; } } + + .o-gurbani, + .o-translation { + white-space: pre-wrap; + } } .gurmukhi { diff --git a/www/src/scss/styles.scss b/www/src/scss/styles.scss index cc877a14d..b54d3b6e0 100644 --- a/www/src/scss/styles.scss +++ b/www/src/scss/styles.scss @@ -45,7 +45,7 @@ $tag-popular-color: #ce744e; @import 'controller.scss', 'markdown', 'themes/themes', 'update', 'viewer', 'window', 'addon', 'akhandpaatt', 'overlay', 'animations', 'noty', 'ui-library', 'workspace-bar', 'navigator/common/pane', - 'navigator/common/verse-block', 'navigator/search/searchNew', 'navigator/shabad/shabad', + 'navigator/common/verse-block', 'navigator/search/searchNew', 'navigator/shabad/shabad', 'navigator/shabad/multipane', 'navigator/misc/misc', 'navigator/common/icon-button', 'navigator/viewer/viewer', 'navigator/search/gurmukhi-keyboard'; @@ -179,6 +179,7 @@ button { padding: 0.3rem 1rem; display: flex; align-items: center; + transition: 0.3s all ease; } header, diff --git a/www/src/scss/themes/helpers/_dark-base.scss b/www/src/scss/themes/helpers/_dark-base.scss index fe7ce3c4c..6f6ee4bd0 100644 --- a/www/src/scss/themes/helpers/_dark-base.scss +++ b/www/src/scss/themes/helpers/_dark-base.scss @@ -35,13 +35,15 @@ .addon-overlay, .fav-results { background-color: $bg-alt; + .sttm-loader { border-color: $bg-bright; border-top-color: $accent; } } - .viewer-controls, .tingle-modal-box__footer { + .viewer-controls, + .tingle-modal-box__footer { background-color: $bg-main; } @@ -68,6 +70,7 @@ .settings-wrapper { .settings-viewer { + .slide-transliteration, .slide-translation, .slide-teeka { @@ -99,11 +102,13 @@ filter: invert(1); } } + .misc-active { color: $white; } } } + .pane-content { background-color: $bg-alt; } @@ -126,6 +131,7 @@ color: $white; } } + .control-item:hover { background-color: $bg-main; } @@ -138,9 +144,11 @@ .slide#announcement-slide .announcements { color: $white; } + .search-footer { background: $bg-main; } + .search-pane { .pane { .pane-footer { @@ -152,7 +160,7 @@ &-dd-group:hover { background-color: $transparent-light-white; } - + option { color: $text-base; } @@ -164,6 +172,7 @@ border: 1px solid $light-grey; } } + &-checkbox { &:checked { + { @@ -180,26 +189,32 @@ .clear-pane { background-color: $black; - .quick-tray > i { + .quick-tray>i { color: $white; } + .footer-toggler-inactive { background: $tray-bg; } + .footer-toggler { background-color: $tray-bg; } } } + .shortcut-drawer { background: $tray-bg; } + .tray-item-icon { background: $button-bg; } + .tray-item-icon { color: $white; } + &.shortcut-tray-true .shortcut-toggle { background: darken($bg-main, 10); } @@ -255,27 +270,27 @@ background-color: $highlight-bg !important; color: $text-base !important; - & + i { + &+i { background-color: $highlight-bg !important; color: $text-base !important; } } } - .switch > label { + .switch>label { background: $text-dim; } - .switch > label::after { + .switch>label::after { background: $text-bright; border-color: $text-dim; } - .switch input:checked + label { + .switch input:checked+label { background: $accent; } - .switch input:checked + label::after { + .switch input:checked+label::after { background: $white; border-color: $accent; } @@ -323,11 +338,11 @@ } } - input:focus + div { + input:focus+div { background: rgba(255, 255, 255, 0.12); } - > button { + >button { color: $text-bright; } } @@ -335,6 +350,7 @@ .search-container:focus { background: white; } + .filters { select { border: $bg-main; @@ -359,6 +375,7 @@ a { color: $text-base; } + &:hover { background-color: $bg-bright; cursor: pointer; @@ -384,11 +401,45 @@ color: $text-base; } } + .fav-shabad-container:hover { background-color: $bg-bright; } } + .shabad-pane { + .pane-options-dropdown { + filter: invert(1); + + option { + background-color: $bg-main; + color: $white; + } + } + + .live-pane { + box-shadow: rgba($transparent-light-white, 0.25) 0px 13px 27px -5px, + rgba($transparent-light-white, 0.3) 0px 8px 16px -8px; + } + } + + .pane-tools { + button, + select, + div > i { + color: $text-base; + + &:hover { + background-color: $transparent-light-white; + } + } + } + + .pane-info button { + color: $text-base; + background-color: transparent; + } + #footer { background-color: $bg-main; @@ -405,8 +456,10 @@ } } } + .workspace-bar { background-color: $bg-main; + div:hover { color: $text-base; background-color: $bg-bright; @@ -416,8 +469,9 @@ ::-webkit-scrollbar-thumb { background-color: $scrollbar; } - + .verse-block { + .search-li, .shabad-li { &:hover { @@ -433,4 +487,29 @@ } } } + + .sundar-gutka-bani { + &:hover { + background-color: $disabled-dark; + } + } + + .multipane-dropdown { + background-color: $bg-main; + } + + @each $pane, $color in $multipane-colors { + .button-#{$pane} { + background-color: rgba($color, 0.6); + color: rgba($white, 0.7); + } + .#{$pane}-btn { + background-color: $bg-alt; + color: $text-base; + + &:disabled { + opacity: 0.5; + } + } + } } diff --git a/www/src/scss/themes/helpers/_light-base.scss b/www/src/scss/themes/helpers/_light-base.scss index 012225140..8b9abbb36 100644 --- a/www/src/scss/themes/helpers/_light-base.scss +++ b/www/src/scss/themes/helpers/_light-base.scss @@ -58,6 +58,7 @@ .addon-overlay, .fav-results { background-color: $nav-bg; + .sttm-loader { border-color: $alt-bg; border-top-color: $active-focus; @@ -66,6 +67,7 @@ .workspace-bar { background-color: $dialog-bg; + div:hover { background-color: $nav-bg; } @@ -102,35 +104,42 @@ background-color: $statusbar-bg; color: $base-text; } + .control-item { input[type='range']::before { color: $base-text; } } + .control-item:hover { background-color: $statusbar-bg; } + .misc-pane { .misc-header { a { color: $grey; } + .misc-active { color: $dark-grey; } } + .pane-footer { background-color: $alt-bg; .clear-pane { background-color: $not-so-white; - .quick-tray > i { + .quick-tray>i { color: $white; } + .footer-toggler-inactive { background-color: $tray-bg; } + .footer-toggler { background-color: $tray-bg; } @@ -147,10 +156,12 @@ .pane-footer { background-color: transparent; } + .search-footer { background-color: $statusbar-bg; } } + .select-bani { &-dd-group:hover { background-color: $transparent-light-black; @@ -159,7 +170,7 @@ option { color: $base-text; } - } + } } .viewer-pane { @@ -171,12 +182,15 @@ .pane-footer { background: $statusbar-bg; } + .tray-item-icon { background: $button-bg; } + .tray-item-icon { color: $white; } + &.shortcut-tray-true .shortcut-toggle { background: $alt-bg; } @@ -215,11 +229,12 @@ .pane { background-color: $nav-bg; color: $base-text !important; + a.panktee.current { background-color: $current-focus !important; color: $base-text !important; - & + i { + &+i { background-color: $current-focus !important; color: $base-text !important; } @@ -249,9 +264,11 @@ background-color: $statusbar-bg; border-top: 1px solid $lighter-grey; color: $base-text; + .input-box { color: $black; } + input { color: $base-text; @@ -267,17 +284,18 @@ } } - input:focus + div { + input:focus+div { background: $dialog-bg; } - > button { + >button { color: $base-text; } } .panktee span.gurmukhi { color: $base-text; + span.highlight { color: $black; } @@ -313,6 +331,7 @@ color: $base-text; } } + .fav-shabad-container:hover { background-color: $statusbar-bg; } @@ -334,7 +353,9 @@ } } } + .verse-block { + .search-li, .shabad-li { &:hover { @@ -342,7 +363,7 @@ } } } - + .shabad-pane-header { >i { &:hover { @@ -350,4 +371,64 @@ } } } + + .shabad-pane { + .pane-options-dropdown { + option { + color: $base-text; + } + } + + .live-pane { + box-shadow: rgba($transparent-light-black, 0.25) 0px 13px 27px -5px, + rgba($transparent-light-black, 0.3) 0px 8px 16px -8px; + } + } + + + .pane-tools { + + button, + select, + div > i { + color: $base-text; + + &:hover { + background-color: $transparent-light-black; + } + } + } + + .pane-info button { + color: $base-text; + background-color: transparent; + } + + .sundar-gutka-bani { + &:hover { + background-color: $disabled-light; + } + } + + .pane-options { + background-color: $nav-bg; + + ul { + li { + &:hover { + background-color: $current-focus; + } + } + } + } + + .multipane-dropdown { + background-color: $alt-bg; + } + + @each $pane, $color in $multipane-colors { + .button-#{$pane} { + background-color: rgba($color, 0.3); + } + } } diff --git a/www/src/scss/themes/helpers/_variables.scss b/www/src/scss/themes/helpers/_variables.scss index 2902f66c4..4a73d6e2f 100644 --- a/www/src/scss/themes/helpers/_variables.scss +++ b/www/src/scss/themes/helpers/_variables.scss @@ -41,3 +41,10 @@ $light-green: #27ae60; $apple-green: #65a757; $picton-blue: #348ce7; +$grape: #7209B7; + +$multipane-colors: ( + "pane-1": $picton-blue, + "pane-2": $princeton-orange, + "pane-3": $grape +); diff --git a/www/src/scss/viewer/verse-slide/_verse-slide.scss b/www/src/scss/viewer/verse-slide/_verse-slide.scss index b62af6a2c..e57d962db 100644 --- a/www/src/scss/viewer/verse-slide/_verse-slide.scss +++ b/www/src/scss/viewer/verse-slide/_verse-slide.scss @@ -35,7 +35,6 @@ font-size: 45px; font-weight: normal; line-height: 1.15; - order: 1; } .slide-announcement { @@ -43,6 +42,7 @@ display: flex; height: 100%; justify-content: center; + white-space: pre-wrap; .gurmukhi-announcement-slide { @extend .gurmukhi-vaak-thick; @@ -59,7 +59,6 @@ .slide-translation { font-weight: 600; margin: 10px 0; - order: 2; &.custom-english { display: flex; @@ -75,19 +74,16 @@ @extend .gurmukhi-vaak; font-weight: 600; margin: 10px 0; - order: 3; } .slide-transliteration { font-weight: 600; margin: 10px 0; - order: 4; } .slide-next-line { opacity: 0.5; margin: 10px 0; - order: 5; } .slide-left-align { diff --git a/www/viewer.html b/www/viewer.html index bced2ead5..380fae414 100644 --- a/www/viewer.html +++ b/www/viewer.html @@ -14,7 +14,7 @@