@ubnt/store.core 11.18.0-alpha.0 → 11.18.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/lib/assets/ai-theta.jpg +0 -0
- package/lib/assets/ai-theta2.jpg +0 -0
- package/lib/assets/ai-turret.jpg +0 -0
- package/lib/assets/ai-turret2.jpg +0 -0
- package/lib/assets/compact.svg +1 -1
- package/lib/assets/compact2.svg +1 -1
- package/lib/assets/door-hub.jpg +0 -0
- package/lib/assets/door-hub2.jpg +0 -0
- package/lib/assets/g3-reader-flex.jpg +0 -0
- package/lib/assets/g3-reader-flex2.jpg +0 -0
- package/lib/assets/g3-reader-pro.jpg +0 -0
- package/lib/assets/g3-reader-pro2.jpg +0 -0
- package/lib/assets/g3-starter-kit.jpg +0 -0
- package/lib/assets/g3-starter-kit2.jpg +0 -0
- package/lib/assets/g4-ptz.jpg +0 -0
- package/lib/assets/g4-ptz2.jpg +0 -0
- package/lib/assets/g5-bullet.jpg +0 -0
- package/lib/assets/g5-bullet2.jpg +0 -0
- package/lib/assets/g5-dome-ultra.jpg +0 -0
- package/lib/assets/g5-dome-ultra2.jpg +0 -0
- package/lib/assets/g5-ptz.jpg +0 -0
- package/lib/assets/g5-ptz2.jpg +0 -0
- package/lib/assets/ptz2.svg +1 -1
- package/lib/assets/ptz3.svg +1 -1
- package/lib/components/ModelCompareV4/ModelCompareV4.types.d.ts +1 -0
- package/lib/components/ModelCompareV4/SideBySide/configs/masterCompetitorConfig.d.ts +1 -1
- package/lib/components/ModelCompareV4/SideBySide/configs/masterCompetitorConfig.js +25 -1
- package/lib/components/ModelCompareV4/SideBySide/configs/masterCompetitorConfig.js.map +1 -1
- package/lib/components/ModelCompareV4/SideBySide/configs/masterCompetitorConfig.mjs +25 -1
- package/lib/components/ModelCompareV4/SideBySide/configs/masterCompetitorConfig.mjs.map +1 -1
- package/lib/components/ModelCompareV4/SideBySideCompare.d.ts +1 -1
- package/lib/components/ModelCompareV4/SideBySideCompare.js +13 -4
- package/lib/components/ModelCompareV4/SideBySideCompare.js.map +1 -1
- package/lib/components/ModelCompareV4/SideBySideCompare.mjs +13 -4
- package/lib/components/ModelCompareV4/SideBySideCompare.mjs.map +1 -1
- package/lib/constants/modelCompareData/assets/Bullet/g5-bullet.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Bullet/g5-bullet.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DomeTurret/ai-turret.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DomeTurret/ai-turret.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DomeTurret/g5-dome-ultra.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DomeTurret/g5-dome-ultra.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DoorAccess/door-hub.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/door-hub.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-reader-flex.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-reader-flex.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-reader-pro.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-reader-pro.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-starter-kit.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-starter-kit.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Interior/ai-theta.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Interior/ai-theta.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/PTZ/g4-ptz.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/PTZ/g4-ptz.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/PTZ/g5-ptz.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/PTZ/g5-ptz.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/compact.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/compact.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/bullet/g5-bullet.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/bullet/g5-bullet.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/dome-and-turret/ai-turret.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/dome-and-turret/ai-turret.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/dome-and-turret/g5-dome-ultra.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/dome-and-turret/g5-dome-ultra.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/door-hub.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/door-hub.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-reader-flex.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-reader-flex.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-reader-pro.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-reader-pro.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-starter-kit.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-starter-kit.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/interior-design/ai-theta.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/interior-design/ai-theta.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/ptz/g4-ptz.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/ptz/g4-ptz.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/ptz/g5-ptz.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/ptz/g5-ptz.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/compact.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/compact.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/ptz.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/ptz.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/ptz.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/ptz.svg.mjs +2 -2
- package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/Compact.js +1 -1
- package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/Compact.mjs +1 -1
- package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/Ptz.js +1 -1
- package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/Ptz.mjs +1 -1
- package/lib/constants/modelCompareData/data/product-list-groups/compact.js +1 -1
- package/lib/constants/modelCompareData/data/product-list-groups/compact.mjs +1 -1
- package/lib/constants/modelCompareData/data/product-list-groups/ptz.js +1 -1
- package/lib/constants/modelCompareData/data/product-list-groups/ptz.mjs +1 -1
- package/lib/constants/modelCompareData/data/products/aiTurret.js +2 -2
- package/lib/constants/modelCompareData/data/products/aiTurret.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/doorHub.js +2 -2
- package/lib/constants/modelCompareData/data/products/doorHub.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g3ReaderFlex.js +2 -2
- package/lib/constants/modelCompareData/data/products/g3ReaderFlex.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g3ReaderPro.js +2 -2
- package/lib/constants/modelCompareData/data/products/g3ReaderPro.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g3StarterKit.js +2 -2
- package/lib/constants/modelCompareData/data/products/g3StarterKit.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g4Ptz.js +2 -2
- package/lib/constants/modelCompareData/data/products/g4Ptz.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g5Bullet.js +2 -2
- package/lib/constants/modelCompareData/data/products/g5Bullet.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g5DomeUltra.js +2 -2
- package/lib/constants/modelCompareData/data/products/g5DomeUltra.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g5Ptz.js +2 -2
- package/lib/constants/modelCompareData/data/products/g5Ptz.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/theta.js +2 -2
- package/lib/constants/modelCompareData/data/products/theta.mjs +2 -2
- package/lib/constants/modelCompareData/types.d.ts +17 -1
- package/lib/constants/modelCompareData/types.js +16 -0
- package/lib/constants/modelCompareData/types.js.map +1 -1
- package/lib/constants/modelCompareData/types.mjs +16 -0
- package/lib/constants/modelCompareData/types.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,7 +6,12 @@
|
|
|
6
6
|
|
|
7
7
|
## Releases
|
|
8
8
|
|
|
9
|
+
### 11.18.0-alpha.1
|
|
10
|
+
|
|
11
|
+
- [Feat] [MIC-623] Test external products adding and overriding side by side compare
|
|
12
|
+
|
|
9
13
|
### 11.18.0-alpha.0
|
|
14
|
+
|
|
10
15
|
- [Feat] [NEP-4783](https://github.com/ubiquiti/store.shared/pull/1481) ProHeader: hide submenu items and fix mobile scroll behaviors
|
|
11
16
|
|
|
12
17
|
### 11.18.0
|
package/lib/assets/ai-theta.jpg
CHANGED
|
Binary file
|
package/lib/assets/ai-theta2.jpg
CHANGED
|
Binary file
|
package/lib/assets/ai-turret.jpg
CHANGED
|
Binary file
|
|
Binary file
|
package/lib/assets/compact.svg
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="21" fill="none" viewBox="0 0 16 21"><path fill="#808893" fill-rule="evenodd" d="M5.018 1.55A4.02 4.02 0 0 0 1 5.57v8.889l.414.018c.624.022 1.718.044 3.592.044 1.26 0 2.168-.01 2.817-.023v-3.322c0-1.108.466-2.105 1.213-2.818V5.569A4.02 4.02 0 0 0 5.018 1.55m-.012 13.114c1.26 0 2.167-.01 2.817-.024v2.257c0 .993.47 1.872 1.2 2.443-.103.029-.882.21-4.005.21-3.39 0-4.018-.213-4.018-.213V14.6l.409.018c.399.014.987.029 1.845.037a175 175 0 0 0 1.752.008M5.014 2.19a3.31 3.31 0 0 0-3.31 3.31v1.065a2.916 2.916 0 0 0 2.917 2.916h.786a2.916 2.916 0 0 0 2.916-2.916V5.5a3.31 3.31 0 0 0-3.31-3.31m1.718 3.676a1.718 1.718 0 1 1-3.436 0 1.718 1.718 0 0 1 3.436 0m-.911 0a.807.807 0 1 1-1.614 0 .807.807 0 0 1 1.614 0M5.086 8.06a.102.102 0 1 1-.144-.145.102.102 0 0 1 .144.145m-.072-4.183a.102.102 0 0 0 .093-.145.103.103 0 1 0-.093.145m3.283 7.297c0-1.914 1.59-3.466 3.552-3.466s3.553 1.552 3.553 3.466v5.722c0 1.466-1.218 2.654-2.72 2.654h-1.666c-1.502 0-2.72-1.188-2.72-2.654zm1.5.079c0-1.106.919-2.003 2.052-2.003s2.053.897 2.053 2.003v1.866c0 1.106-.92 2.003-2.053 2.003s-2.052-.897-2.052-2.003zm2.052 5.61a.134.134 0 0 0-.136.133v1.02c0 .073.061.132.136.132s.136-.06.136-.132v-1.02a.134.134 0 0 0-.136-.133m1.267-5.614c0 .682-.567 1.235-1.267 1.235s-1.266-.553-1.266-1.235c0-.683.567-1.236 1.266-1.236s1.267.553 1.267 1.236" clip-rule="evenodd"/></svg>
|
package/lib/assets/compact2.svg
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="38" fill="none" viewBox="0 0 48 38"><path fill="#8e8e8e" fill-rule="evenodd" d="M16.685 0a8.48 8.48 0 0 0-8.482 8.482v18.766c.226.012.513.025.874.038 1.318.047 3.627.094 7.584.094 2.66 0 4.576-.02 5.946-.049v-7.013c0-2.34.983-4.444 2.56-5.95V8.482A8.48 8.48 0 0 0 16.686 0m-.024 27.684c2.658 0 4.573-.022 5.946-.05v4.764c0 2.096.993 3.952 2.534 5.158-.219.06-1.863.444-8.456.444-7.157 0-8.482-.452-8.482-.452V27.55a51 51 0 0 0 .863.037c.842.03 2.084.06 3.895.079a364 364 0 0 0 3.7.017m.016-26.331A6.986 6.986 0 0 0 9.69 8.339v2.248a6.16 6.16 0 0 0 6.158 6.158h1.658a6.157 6.157 0 0 0 6.157-6.158V8.34a6.987 6.987 0 0 0-6.986-6.986m3.627 7.759a3.627 3.627 0 1 1-7.254 0 3.627 3.627 0 0 1 7.254 0m-1.924 0a1.703 1.703 0 1 1-3.406 0 1.703 1.703 0 0 1 3.406 0m-1.55 4.633a.216.216 0 0 1-.37-.155.217.217 0 1 1 .37.155m-.153-8.832a.216.216 0 0 0 .197-.307.217.217 0 1 0-.197.307m6.93 15.405c0-4.042 3.358-7.318 7.5-7.318s7.5 3.276 7.5 7.318v12.08c0 3.094-2.57 5.602-5.742 5.602H29.35c-3.171 0-5.742-2.508-5.742-5.602zm3.167.166c0-2.335 1.94-4.228 4.333-4.228s4.333 1.893 4.333 4.228v3.94c0 2.334-1.94 4.227-4.333 4.227s-4.333-1.893-4.333-4.228zm4.333 11.844a.284.284 0 0 0-.287.28v2.153c0 .155.128.28.287.28a.284.284 0 0 0 .287-.28v-2.153a.284.284 0 0 0-.287-.28m2.673-11.852c0 1.44-1.197 2.608-2.673 2.608-1.477 0-2.674-1.168-2.674-2.608s1.197-2.609 2.674-2.609 2.673 1.168 2.673 2.609" clip-rule="evenodd"/></svg>
|
package/lib/assets/door-hub.jpg
CHANGED
|
Binary file
|
package/lib/assets/door-hub2.jpg
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lib/assets/g4-ptz.jpg
CHANGED
|
Binary file
|
package/lib/assets/g4-ptz2.jpg
CHANGED
|
Binary file
|
package/lib/assets/g5-bullet.jpg
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lib/assets/g5-ptz.jpg
CHANGED
|
Binary file
|
package/lib/assets/g5-ptz2.jpg
CHANGED
|
Binary file
|
package/lib/assets/ptz2.svg
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="38" fill="none" viewBox="0 0 28 38"><path fill="#8e8e8e" fill-rule="evenodd" d="M11.226 0a4.87 4.87 0 0 0-4.87 4.87v3.02c0 .896.727 1.623 1.623 1.623h17.63c.897 0 1.624-.727 1.624-1.624V4.87A4.87 4.87 0 0 0 22.363 0zM9.391 10.162a1.33 1.33 0 0 1-.346.949l-.039.043c-.527.586-2.129 2.366-2.966 6.122 1.242.017 2.979.439 3.91 2.026v3.202c2.056.038 4.455.07 6.705.073h.228c3.826-.004 8.083-.094 10.351-.155a.79.79 0 0 0 .775-.812c-.188-6.801-2.777-9.679-3.477-10.456l-.038-.043a1.33 1.33 0 0 1-.347-.949zm4.58 27.282a5.44 5.44 0 0 1-3.076-2.056c.735-1.3.959-3.641.036-5.394-.812-1.543-.992-2.899-.981-3.384v-3.457c1.86.035 4 .065 6.056.072v.001h1.527v-.001c2.956-.01 6.083-.067 8.305-.119l-.02 2.859-.665.853c-.473-.535-1.132-.95-1.877-1.274-.903-.393-1.962-.663-3.046-.846-2.168-.364-4.482-.383-5.955-.289l-.304.02zm.65-12.404v12.479a7.61 7.61 0 0 0 9.268-10.921 6 6 0 0 0-.872-.459c-.838-.364-1.841-.623-2.895-.8-1.964-.33-4.063-.37-5.501-.3m4.824 9.967a3.907 3.907 0 1 0 0-7.813 3.907 3.907 0 0 0 0 7.813m1.7-3.907a1.7 1.7 0 1 1-3.4 0 1.7 1.7 0 0 1 3.4 0M2.22 29.408l-.137-.114c.141-.341.424-1.229.424-2.055v-7.807c.31-.528 1.688-1.618 3.341-1.618 1.757 0 3.253 1.09 3.479 1.618v7.13c-.006.77.066 2.396.401 2.732l-.08.114zm0 .115h1.034v7.692C2.465 36.74.889 35.252.889 33.093s.887-3.279 1.331-3.57m6.383 0h1.033c.444.291 1.332 1.412 1.332 3.57s-1.576 3.647-2.365 4.122zm-5.28 0H8.5v7.733l-.036.027c-.368.268-.983.717-2.467.717-1.428 0-2.292-.503-2.675-.744zm2.583 1.11a2.433 2.433 0 0 0-2.433 2.434v1.886a2.433 2.433 0 0 0 4.867 0v-1.886a2.433 2.433 0 0 0-2.434-2.434m1.228 3.618a1.227 1.227 0 1 1-2.454 0 1.227 1.227 0 0 1 2.454 0" clip-rule="evenodd"/></svg>
|
package/lib/assets/ptz3.svg
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="21" fill="none" viewBox="0 0 16 21"><path fill="#808893" fill-rule="evenodd" d="M6.441.55a2.563 2.563 0 0 0-2.563 2.564v1.589c0 .472.382.854.854.854h9.28a.854.854 0 0 0 .854-.854V3.114A2.563 2.563 0 0 0 12.302.551zM5.475 5.9a.7.7 0 0 1-.182.499l-.02.022c-.278.309-1.121 1.246-1.561 3.222.653.01 1.567.232 2.057 1.067v1.685a207 207 0 0 0 3.53.038h.12a229 229 0 0 0 5.447-.081.417.417 0 0 0 .408-.428c-.099-3.58-1.462-5.094-1.83-5.503l-.02-.022a.7.7 0 0 1-.182-.5zm2.41 14.358a2.86 2.86 0 0 1-1.618-1.082c.386-.685.504-1.916.018-2.84-.427-.811-.522-1.525-.516-1.78v-1.82c.979.02 2.105.035 3.188.038v.001h.803a239 239 0 0 0 4.372-.063l-.01 1.505-.35.448c-.25-.281-.597-.5-.989-.67-.475-.207-1.033-.35-1.603-.445a14.6 14.6 0 0 0-3.134-.152l-.16.01zm.343-6.528v6.568a4.005 4.005 0 0 0 4.878-5.748 3 3 0 0 0-.46-.242c-.44-.192-.968-.328-1.523-.421a14.3 14.3 0 0 0-2.895-.157m2.539 5.245a2.056 2.056 0 1 0 0-4.112 2.056 2.056 0 0 0 0 4.112m.895-2.056a.895.895 0 1 1-1.79 0 .895.895 0 0 1 1.79 0M1.7 16.03l-.073-.06c.075-.18.224-.647.224-1.082v-4.109c.163-.278.888-.852 1.758-.852.925 0 1.712.574 1.831.852v3.752c-.003.406.035 1.262.211 1.439l-.042.06zm0 .06h.544v4.049C1.83 19.888 1 19.104 1 17.968s.467-1.726.7-1.879m3.36 0h.543c.234.153.701.744.701 1.88s-.83 1.919-1.245 2.168zm-2.78 0h2.725v4.07l-.02.014c-.193.141-.516.378-1.297.378-.752 0-1.207-.265-1.408-.392zm1.36.585a1.28 1.28 0 0 0-1.281 1.28v.993a1.28 1.28 0 1 0 2.561 0v-.993a1.28 1.28 0 0 0-1.28-1.28m.646 1.904a.646.646 0 1 1-1.292 0 .646.646 0 0 1 1.292 0" clip-rule="evenodd"/></svg>
|
|
@@ -14,7 +14,7 @@ type SideBySideMap = {
|
|
|
14
14
|
label: string;
|
|
15
15
|
matches: MatchedComparableProduct[];
|
|
16
16
|
};
|
|
17
|
-
export type ComparableProductId = Extract<ProductId, "u7proXgs" | "u7proMax" | "dS3WAP622GSI" | "dS3WAP622ESI" | "ciscoCW9178I" | "ciscoCW9176I">;
|
|
17
|
+
export type ComparableProductId = Extract<ProductId, "u7proXgs" | "u7proMax" | "dS3WAP622GSI" | "dS3WAP622ESI" | "ciscoCW9178I" | "ciscoCW9176I" | "cw9176l" | "cw9176d" | "48uxm-m" | "ms-425" | "mx-450" | "cd63-dome" | "ac12-ad64" | "arubaEdgeConnect10150" | "aruba6300m" | "arubaCx8325" | "arubaAp755" | "juniperAp47" | "fortiGate400f" | "fortiSwitch624f" | "fortiSwitch2048f" | "fortiAp441k">;
|
|
18
18
|
export declare const productObjMatcher: Record<ComparableProductId, Product>;
|
|
19
19
|
export declare const ComparableProductMap: SideBySideMap[];
|
|
20
20
|
export {};
|
|
@@ -4,6 +4,12 @@ var ciscoCW9176I = require('../../../../constants/modelCompareData/data/products
|
|
|
4
4
|
var ciscoCW9178I = require('../../../../constants/modelCompareData/data/products/ciscoCW9178I.js');
|
|
5
5
|
var dS3WAP622ESI = require('../../../../constants/modelCompareData/data/products/dS3WAP622ESI.js');
|
|
6
6
|
var dS3WAP622GSI = require('../../../../constants/modelCompareData/data/products/dS3WAP622GSI.js');
|
|
7
|
+
var e7 = require('../../../../constants/modelCompareData/data/products/e7.js');
|
|
8
|
+
var e7Campus = require('../../../../constants/modelCompareData/data/products/e7Campus.js');
|
|
9
|
+
var professional24PoE = require('../../../../constants/modelCompareData/data/products/professional24PoE.js');
|
|
10
|
+
var professional48PoE = require('../../../../constants/modelCompareData/data/products/professional48PoE.js');
|
|
11
|
+
var professionalHd24Poe = require('../../../../constants/modelCompareData/data/products/professionalHd24Poe.js');
|
|
12
|
+
var professionalMax16PoE = require('../../../../constants/modelCompareData/data/products/professionalMax16PoE.js');
|
|
7
13
|
var u7proMax = require('../../../../constants/modelCompareData/data/products/u7proMax.js');
|
|
8
14
|
var u7proXgs = require('../../../../constants/modelCompareData/data/products/u7proXgs.js');
|
|
9
15
|
var types = require('../../../../constants/modelCompareData/types.js');
|
|
@@ -15,7 +21,25 @@ const productObjMatcher = {
|
|
|
15
21
|
[types.ProductId.CiscoCW9178I]: ciscoCW9178I.ciscoCW9178I,
|
|
16
22
|
[types.ProductId.CiscoCW9176I]: ciscoCW9176I.ciscoCW9176I,
|
|
17
23
|
[types.ProductId.DS3WAP622GSI]: dS3WAP622GSI.dS3WAP622GSI,
|
|
18
|
-
[types.ProductId.DS3WAP622ESI]: dS3WAP622ESI.dS3WAP622ESI
|
|
24
|
+
[types.ProductId.DS3WAP622ESI]: dS3WAP622ESI.dS3WAP622ESI,
|
|
25
|
+
// External
|
|
26
|
+
// todo change these to actual products, for now test
|
|
27
|
+
[types.ProductId.CW9176d]: e7.e7,
|
|
28
|
+
[types.ProductId.CW9176l]: e7Campus.e7Campus,
|
|
29
|
+
[types.ProductId.UXM_M]: professional48PoE.professional48PoE,
|
|
30
|
+
[types.ProductId.MS425]: professional24PoE.professional24PoE,
|
|
31
|
+
[types.ProductId.MX450]: professionalHd24Poe.professionalHd24Poe,
|
|
32
|
+
[types.ProductId.CD63Dome]: e7.e7,
|
|
33
|
+
[types.ProductId.Ac12Ad64]: e7Campus.e7Campus,
|
|
34
|
+
[types.ProductId.ArubaEdgeConnect10150]: professional48PoE.professional48PoE,
|
|
35
|
+
[types.ProductId.Aruba6300m]: professional24PoE.professional24PoE,
|
|
36
|
+
[types.ProductId.ArubaCx8325]: professionalHd24Poe.professionalHd24Poe,
|
|
37
|
+
[types.ProductId.ArubaAp755]: e7.e7,
|
|
38
|
+
[types.ProductId.JuniperAp47]: e7Campus.e7Campus,
|
|
39
|
+
[types.ProductId.Fortigate400F]: professional48PoE.professional48PoE,
|
|
40
|
+
[types.ProductId.FortiSwitch624F]: professional24PoE.professional24PoE,
|
|
41
|
+
[types.ProductId.FortiSwitch2048F]: professionalMax16PoE.professionalMax16PoE,
|
|
42
|
+
[types.ProductId.FortiAp441k]: professionalHd24Poe.professionalHd24Poe
|
|
19
43
|
};
|
|
20
44
|
const ComparableProductMap = [{
|
|
21
45
|
label: "Cisco",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"masterCompetitorConfig.js","sources":["../../../../../src/components/ModelCompareV4/SideBySide/configs/masterCompetitorConfig.tsx"],"sourcesContent":["import { ciscoCW9176I } from \"../../../../constants/modelCompareData/data/products/ciscoCW9176I\";\nimport { ciscoCW9178I } from \"../../../../constants/modelCompareData/data/products/ciscoCW9178I\";\nimport { dS3WAP622ESI } from \"../../../../constants/modelCompareData/data/products/dS3WAP622ESI\";\nimport { dS3WAP622GSI } from \"../../../../constants/modelCompareData/data/products/dS3WAP622GSI\";\nimport { u7proMax } from \"../../../../constants/modelCompareData/data/products/u7proMax\";\nimport { u7proXgs } from \"../../../../constants/modelCompareData/data/products/u7proXgs\";\nimport type {\n Product,\n Property,\n} from \"../../../../constants/modelCompareData/types\";\nimport { ProductId } from \"../../../../constants/modelCompareData/types\";\nimport { wifiProperties } from \"./propertiesCollectionExport\";\n\n/** Using this for now to organize:\n * Also We should maybe move this file down to constants model compare data\n * https://docs.google.com/spreadsheets/d/1pXA3dI56Kzn22B4a1wu7Dasc8Y-Icx0vKXs166S3fAM/edit?usp=sharing\n */\n\ntype MatchedComparableProduct = {\n uniFiProductId: ComparableProductId;\n label?: string;\n competitorProductId: ComparableProductId;\n properties: Property[];\n};\n\ntype SideBySideMap = {\n label: string;\n matches: MatchedComparableProduct[];\n};\n\nexport type ComparableProductId = Extract<\n ProductId,\n | \"u7proXgs\"\n | \"u7proMax\"\n | \"dS3WAP622GSI\"\n | \"dS3WAP622ESI\"\n | \"ciscoCW9178I\"\n | \"ciscoCW9176I\"\n>;\n\nexport const productObjMatcher: Record<ComparableProductId, Product> = {\n [ProductId.U7proXgs]: u7proXgs,\n [ProductId.U7ProMax]: u7proMax,\n [ProductId.CiscoCW9178I]: ciscoCW9178I,\n [ProductId.CiscoCW9176I]: ciscoCW9176I,\n [ProductId.DS3WAP622GSI]: dS3WAP622GSI,\n [ProductId.DS3WAP622ESI]: dS3WAP622ESI,\n};\n\nexport const ComparableProductMap: SideBySideMap[] = [\n {\n label: \"Cisco\",\n matches: [\n {\n uniFiProductId: ProductId.U7proXgs,\n competitorProductId: ProductId.CiscoCW9178I,\n label: \"Cisco Wireless 9178I Access Point (CW9178I)\",\n properties: wifiProperties,\n },\n {\n uniFiProductId: ProductId.U7ProMax,\n competitorProductId: ProductId.CiscoCW9176I,\n label: \"Cisco Wireless 9176I Access Point (CW9176I)\",\n properties: wifiProperties,\n },\n ],\n },\n {\n label: \"Juniper\",\n matches: [],\n },\n {\n label: \"Netgear\",\n matches: [],\n },\n {\n label: \"Hikvision\",\n matches: [\n {\n uniFiProductId: ProductId.U7proXgs,\n competitorProductId: ProductId.DS3WAP622GSI,\n label: \"Wi-Fi 6 1800M Ceiling Access Point (DS-3WAP622G-SI)\",\n properties: wifiProperties,\n },\n {\n uniFiProductId: ProductId.U7ProMax,\n competitorProductId: ProductId.DS3WAP622ESI,\n label: \"Wi-Fi 6 1800M Ceiling Access Point (DS-3WAP622E-SI)\",\n properties: wifiProperties,\n },\n ],\n },\n {\n label: \"Fortinet\",\n matches: [],\n },\n {\n label: \"Arista\",\n matches: [],\n },\n {\n label: \"Aruba\",\n matches: [],\n },\n {\n label: \"Bosch\",\n matches: [],\n },\n];\n"],"names":["productObjMatcher","ProductId","U7proXgs","u7proXgs","U7ProMax","u7proMax","CiscoCW9178I","ciscoCW9178I","CiscoCW9176I","ciscoCW9176I","DS3WAP622GSI","dS3WAP622GSI","DS3WAP622ESI","dS3WAP622ESI","ComparableProductMap","label","matches","uniFiProductId","competitorProductId","properties","wifiProperties"],"mappings":"
|
|
1
|
+
{"version":3,"file":"masterCompetitorConfig.js","sources":["../../../../../src/components/ModelCompareV4/SideBySide/configs/masterCompetitorConfig.tsx"],"sourcesContent":["import { ciscoCW9176I } from \"../../../../constants/modelCompareData/data/products/ciscoCW9176I\";\nimport { ciscoCW9178I } from \"../../../../constants/modelCompareData/data/products/ciscoCW9178I\";\nimport { dS3WAP622ESI } from \"../../../../constants/modelCompareData/data/products/dS3WAP622ESI\";\nimport { dS3WAP622GSI } from \"../../../../constants/modelCompareData/data/products/dS3WAP622GSI\";\nimport { e7 } from \"../../../../constants/modelCompareData/data/products/e7\";\nimport { e7Campus } from \"../../../../constants/modelCompareData/data/products/e7Campus\";\nimport { professional24PoE } from \"../../../../constants/modelCompareData/data/products/professional24PoE\";\nimport { professional48PoE } from \"../../../../constants/modelCompareData/data/products/professional48PoE\";\nimport { professionalHd24Poe } from \"../../../../constants/modelCompareData/data/products/professionalHd24Poe\";\nimport { professionalMax16PoE } from \"../../../../constants/modelCompareData/data/products/professionalMax16PoE\";\nimport { u7proMax } from \"../../../../constants/modelCompareData/data/products/u7proMax\";\nimport { u7proXgs } from \"../../../../constants/modelCompareData/data/products/u7proXgs\";\nimport type {\n Product,\n Property,\n} from \"../../../../constants/modelCompareData/types\";\nimport { ProductId } from \"../../../../constants/modelCompareData/types\";\nimport { wifiProperties } from \"./propertiesCollectionExport\";\n\n/** Using this for now to organize:\n * Also We should maybe move this file down to constants model compare data\n * https://docs.google.com/spreadsheets/d/1pXA3dI56Kzn22B4a1wu7Dasc8Y-Icx0vKXs166S3fAM/edit?usp=sharing\n */\n\ntype MatchedComparableProduct = {\n uniFiProductId: ComparableProductId;\n label?: string;\n competitorProductId: ComparableProductId;\n properties: Property[];\n};\n\ntype SideBySideMap = {\n label: string;\n matches: MatchedComparableProduct[];\n};\n\nexport type ComparableProductId = Extract<\n ProductId,\n | \"u7proXgs\"\n | \"u7proMax\"\n | \"dS3WAP622GSI\"\n | \"dS3WAP622ESI\"\n | \"ciscoCW9178I\"\n | \"ciscoCW9176I\"\n // external list\n // cisco\n | \"cw9176l\"\n | \"cw9176d\"\n | \"48uxm-m\"\n | \"ms-425\"\n | \"mx-450\"\n // Verkada\n | \"cd63-dome\"\n | \"ac12-ad64\"\n // HPE/Aruba/Juniper\n | \"arubaEdgeConnect10150\"\n | \"aruba6300m\"\n | \"arubaCx8325\"\n | \"arubaAp755\"\n | \"juniperAp47\"\n // Fortinet\n | \"fortiGate400f\"\n | \"fortiSwitch624f\"\n | \"fortiSwitch2048f\"\n | \"fortiAp441k\"\n>;\n\nexport const productObjMatcher: Record<ComparableProductId, Product> = {\n [ProductId.U7proXgs]: u7proXgs,\n [ProductId.U7ProMax]: u7proMax,\n [ProductId.CiscoCW9178I]: ciscoCW9178I,\n [ProductId.CiscoCW9176I]: ciscoCW9176I,\n [ProductId.DS3WAP622GSI]: dS3WAP622GSI,\n [ProductId.DS3WAP622ESI]: dS3WAP622ESI,\n // External\n // todo change these to actual products, for now test\n [ProductId.CW9176d]: e7,\n [ProductId.CW9176l]: e7Campus,\n [ProductId.UXM_M]: professional48PoE,\n [ProductId.MS425]: professional24PoE,\n [ProductId.MX450]: professionalHd24Poe,\n [ProductId.CD63Dome]: e7,\n [ProductId.Ac12Ad64]: e7Campus,\n [ProductId.ArubaEdgeConnect10150]: professional48PoE,\n [ProductId.Aruba6300m]: professional24PoE,\n [ProductId.ArubaCx8325]: professionalHd24Poe,\n [ProductId.ArubaAp755]: e7,\n [ProductId.JuniperAp47]: e7Campus,\n [ProductId.Fortigate400F]: professional48PoE,\n [ProductId.FortiSwitch624F]: professional24PoE,\n [ProductId.FortiSwitch2048F]: professionalMax16PoE,\n [ProductId.FortiAp441k]: professionalHd24Poe,\n};\n\nexport const ComparableProductMap: SideBySideMap[] = [\n {\n label: \"Cisco\",\n matches: [\n {\n uniFiProductId: ProductId.U7proXgs,\n competitorProductId: ProductId.CiscoCW9178I,\n label: \"Cisco Wireless 9178I Access Point (CW9178I)\",\n properties: wifiProperties,\n },\n {\n uniFiProductId: ProductId.U7ProMax,\n competitorProductId: ProductId.CiscoCW9176I,\n label: \"Cisco Wireless 9176I Access Point (CW9176I)\",\n properties: wifiProperties,\n },\n ],\n },\n {\n label: \"Juniper\",\n matches: [],\n },\n {\n label: \"Netgear\",\n matches: [],\n },\n {\n label: \"Hikvision\",\n matches: [\n {\n uniFiProductId: ProductId.U7proXgs,\n competitorProductId: ProductId.DS3WAP622GSI,\n label: \"Wi-Fi 6 1800M Ceiling Access Point (DS-3WAP622G-SI)\",\n properties: wifiProperties,\n },\n {\n uniFiProductId: ProductId.U7ProMax,\n competitorProductId: ProductId.DS3WAP622ESI,\n label: \"Wi-Fi 6 1800M Ceiling Access Point (DS-3WAP622E-SI)\",\n properties: wifiProperties,\n },\n ],\n },\n {\n label: \"Fortinet\",\n matches: [],\n },\n {\n label: \"Arista\",\n matches: [],\n },\n {\n label: \"Aruba\",\n matches: [],\n },\n {\n label: \"Bosch\",\n matches: [],\n },\n];\n"],"names":["productObjMatcher","ProductId","U7proXgs","u7proXgs","U7ProMax","u7proMax","CiscoCW9178I","ciscoCW9178I","CiscoCW9176I","ciscoCW9176I","DS3WAP622GSI","dS3WAP622GSI","DS3WAP622ESI","dS3WAP622ESI","CW9176d","e7","CW9176l","e7Campus","UXM_M","professional48PoE","MS425","professional24PoE","MX450","professionalHd24Poe","CD63Dome","Ac12Ad64","ArubaEdgeConnect10150","Aruba6300m","ArubaCx8325","ArubaAp755","JuniperAp47","Fortigate400F","FortiSwitch624F","FortiSwitch2048F","professionalMax16PoE","FortiAp441k","ComparableProductMap","label","matches","uniFiProductId","competitorProductId","properties","wifiProperties"],"mappings":";;;;;;;;;;;;;;;;;AAmEO,MAAMA,iBAA0D,GAAA;EACrE,CAACC,KAAAA,CAAAA,SAAU,CAAAC,QAAQ,GAAGC,QAAA,CAAAA,QAAA;EACtB,CAACF,KAAAA,CAAAA,SAAU,CAAAG,QAAQ,GAAGC,QAAA,CAAAA,QAAA;EACtB,CAACJ,KAAAA,CAAAA,SAAU,CAAAK,YAAY,GAAGC,YAAA,CAAAA,YAAA;EAC1B,CAACN,KAAAA,CAAAA,SAAU,CAAAO,YAAY,GAAGC,YAAA,CAAAA,YAAA;EAC1B,CAACR,KAAAA,CAAAA,SAAU,CAAAS,YAAY,GAAGC,YAAA,CAAAA,YAAA;EAC1B,CAACV,KAAAA,CAAAA,SAAU,CAAAW,YAAY,GAAGC,YAAA,CAAAA,YAAA;EAAA;EAAA;EAG1B,CAACZ,KAAAA,CAAAA,SAAU,CAAAa,OAAO,GAAGC,EAAA,CAAAA,EAAA;EACrB,CAACd,KAAAA,CAAAA,SAAU,CAAAe,OAAO,GAAGC,QAAA,CAAAA,QAAA;EACrB,CAAChB,KAAAA,CAAAA,SAAU,CAAAi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C/B+B,KAAO,EAAA,6CAAA;IACPI,UAAY,EAAAC,0BAAAA,CAAAA;EACd,CAAA,EACA;IACEH,gBAAgBtC,KAAU,CAAAA,SAAA,CAAAG,QAAA;IAC1BoC,qBAAqBvC,KAAU,CAAAA,SAAA,CAAAO,YAAA;IAC/B6B,KAAO,EAAA,6CAAA;IACPI,UAAY,EAAAC,0BAAAA,CAAAA;EAAA,CAAA;AAGlB,CAAA,EACA;EACEL,KAAO,EAAA,SAAA;EACPC,SAAS;AACX,CAAA,EACA;EACED,KAAO,EAAA,SAAA;EACPC,SAAS;AACX,CAAA,EACA;EACED,KAAO,EAAA,WAAA;EACPC,OAAS,EAAA,CACP;IACEC,gBAAgBtC,KAAU,CAAAA,SAAA,CAAAC,QAAA;IAC1BsC,qBAAqBvC,KAAU,CAAAA,SAAA,CAAAS,YAAA;IAC/B2B,KAAO,EAAA,qDAAA;IACPI,UAAY,EAAAC,0BAAAA,CAAAA;EACd,CAAA,EACA;IACEH,gBAAgBtC,KAAU,CAAAA,SAAA,CAAAG,QAAA;IAC1BoC,qBAAqBvC,KAAU,CAAAA,SAAA,CAAAW,YAAA;IAC/ByB,KAAO,EAAA,qDAAA;IACPI,UAAY,EAAAC,0BAAAA,CAAAA;EAAA,CAAA;AAGlB,CAAA,EACA;EACEL,KAAO,EAAA,UAAA;EACPC,SAAS;AACX,CAAA,EACA;EACED,KAAO,EAAA,QAAA;EACPC,SAAS;AACX,CAAA,EACA;EACED,KAAO,EAAA,OAAA;EACPC,SAAS;AACX,CAAA,EACA;EACED,KAAO,EAAA,OAAA;EACPC,SAAS;AAAC,CAAA,CAEd;;"}
|
|
@@ -2,6 +2,12 @@ import { ciscoCW9176I } from '../../../../constants/modelCompareData/data/produc
|
|
|
2
2
|
import { ciscoCW9178I } from '../../../../constants/modelCompareData/data/products/ciscoCW9178I.mjs';
|
|
3
3
|
import { dS3WAP622ESI } from '../../../../constants/modelCompareData/data/products/dS3WAP622ESI.mjs';
|
|
4
4
|
import { dS3WAP622GSI } from '../../../../constants/modelCompareData/data/products/dS3WAP622GSI.mjs';
|
|
5
|
+
import { e7 } from '../../../../constants/modelCompareData/data/products/e7.mjs';
|
|
6
|
+
import { e7Campus } from '../../../../constants/modelCompareData/data/products/e7Campus.mjs';
|
|
7
|
+
import { professional24PoE } from '../../../../constants/modelCompareData/data/products/professional24PoE.mjs';
|
|
8
|
+
import { professional48PoE } from '../../../../constants/modelCompareData/data/products/professional48PoE.mjs';
|
|
9
|
+
import { professionalHd24Poe } from '../../../../constants/modelCompareData/data/products/professionalHd24Poe.mjs';
|
|
10
|
+
import { professionalMax16PoE } from '../../../../constants/modelCompareData/data/products/professionalMax16PoE.mjs';
|
|
5
11
|
import { u7proMax } from '../../../../constants/modelCompareData/data/products/u7proMax.mjs';
|
|
6
12
|
import { u7proXgs } from '../../../../constants/modelCompareData/data/products/u7proXgs.mjs';
|
|
7
13
|
import { ProductId } from '../../../../constants/modelCompareData/types.mjs';
|
|
@@ -13,7 +19,25 @@ const productObjMatcher = {
|
|
|
13
19
|
[ProductId.CiscoCW9178I]: ciscoCW9178I,
|
|
14
20
|
[ProductId.CiscoCW9176I]: ciscoCW9176I,
|
|
15
21
|
[ProductId.DS3WAP622GSI]: dS3WAP622GSI,
|
|
16
|
-
[ProductId.DS3WAP622ESI]: dS3WAP622ESI
|
|
22
|
+
[ProductId.DS3WAP622ESI]: dS3WAP622ESI,
|
|
23
|
+
// External
|
|
24
|
+
// todo change these to actual products, for now test
|
|
25
|
+
[ProductId.CW9176d]: e7,
|
|
26
|
+
[ProductId.CW9176l]: e7Campus,
|
|
27
|
+
[ProductId.UXM_M]: professional48PoE,
|
|
28
|
+
[ProductId.MS425]: professional24PoE,
|
|
29
|
+
[ProductId.MX450]: professionalHd24Poe,
|
|
30
|
+
[ProductId.CD63Dome]: e7,
|
|
31
|
+
[ProductId.Ac12Ad64]: e7Campus,
|
|
32
|
+
[ProductId.ArubaEdgeConnect10150]: professional48PoE,
|
|
33
|
+
[ProductId.Aruba6300m]: professional24PoE,
|
|
34
|
+
[ProductId.ArubaCx8325]: professionalHd24Poe,
|
|
35
|
+
[ProductId.ArubaAp755]: e7,
|
|
36
|
+
[ProductId.JuniperAp47]: e7Campus,
|
|
37
|
+
[ProductId.Fortigate400F]: professional48PoE,
|
|
38
|
+
[ProductId.FortiSwitch624F]: professional24PoE,
|
|
39
|
+
[ProductId.FortiSwitch2048F]: professionalMax16PoE,
|
|
40
|
+
[ProductId.FortiAp441k]: professionalHd24Poe
|
|
17
41
|
};
|
|
18
42
|
const ComparableProductMap = [{
|
|
19
43
|
label: "Cisco",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"masterCompetitorConfig.mjs","sources":["../../../../../src/components/ModelCompareV4/SideBySide/configs/masterCompetitorConfig.tsx"],"sourcesContent":["import { ciscoCW9176I } from \"../../../../constants/modelCompareData/data/products/ciscoCW9176I\";\nimport { ciscoCW9178I } from \"../../../../constants/modelCompareData/data/products/ciscoCW9178I\";\nimport { dS3WAP622ESI } from \"../../../../constants/modelCompareData/data/products/dS3WAP622ESI\";\nimport { dS3WAP622GSI } from \"../../../../constants/modelCompareData/data/products/dS3WAP622GSI\";\nimport { u7proMax } from \"../../../../constants/modelCompareData/data/products/u7proMax\";\nimport { u7proXgs } from \"../../../../constants/modelCompareData/data/products/u7proXgs\";\nimport type {\n Product,\n Property,\n} from \"../../../../constants/modelCompareData/types\";\nimport { ProductId } from \"../../../../constants/modelCompareData/types\";\nimport { wifiProperties } from \"./propertiesCollectionExport\";\n\n/** Using this for now to organize:\n * Also We should maybe move this file down to constants model compare data\n * https://docs.google.com/spreadsheets/d/1pXA3dI56Kzn22B4a1wu7Dasc8Y-Icx0vKXs166S3fAM/edit?usp=sharing\n */\n\ntype MatchedComparableProduct = {\n uniFiProductId: ComparableProductId;\n label?: string;\n competitorProductId: ComparableProductId;\n properties: Property[];\n};\n\ntype SideBySideMap = {\n label: string;\n matches: MatchedComparableProduct[];\n};\n\nexport type ComparableProductId = Extract<\n ProductId,\n | \"u7proXgs\"\n | \"u7proMax\"\n | \"dS3WAP622GSI\"\n | \"dS3WAP622ESI\"\n | \"ciscoCW9178I\"\n | \"ciscoCW9176I\"\n>;\n\nexport const productObjMatcher: Record<ComparableProductId, Product> = {\n [ProductId.U7proXgs]: u7proXgs,\n [ProductId.U7ProMax]: u7proMax,\n [ProductId.CiscoCW9178I]: ciscoCW9178I,\n [ProductId.CiscoCW9176I]: ciscoCW9176I,\n [ProductId.DS3WAP622GSI]: dS3WAP622GSI,\n [ProductId.DS3WAP622ESI]: dS3WAP622ESI,\n};\n\nexport const ComparableProductMap: SideBySideMap[] = [\n {\n label: \"Cisco\",\n matches: [\n {\n uniFiProductId: ProductId.U7proXgs,\n competitorProductId: ProductId.CiscoCW9178I,\n label: \"Cisco Wireless 9178I Access Point (CW9178I)\",\n properties: wifiProperties,\n },\n {\n uniFiProductId: ProductId.U7ProMax,\n competitorProductId: ProductId.CiscoCW9176I,\n label: \"Cisco Wireless 9176I Access Point (CW9176I)\",\n properties: wifiProperties,\n },\n ],\n },\n {\n label: \"Juniper\",\n matches: [],\n },\n {\n label: \"Netgear\",\n matches: [],\n },\n {\n label: \"Hikvision\",\n matches: [\n {\n uniFiProductId: ProductId.U7proXgs,\n competitorProductId: ProductId.DS3WAP622GSI,\n label: \"Wi-Fi 6 1800M Ceiling Access Point (DS-3WAP622G-SI)\",\n properties: wifiProperties,\n },\n {\n uniFiProductId: ProductId.U7ProMax,\n competitorProductId: ProductId.DS3WAP622ESI,\n label: \"Wi-Fi 6 1800M Ceiling Access Point (DS-3WAP622E-SI)\",\n properties: wifiProperties,\n },\n ],\n },\n {\n label: \"Fortinet\",\n matches: [],\n },\n {\n label: \"Arista\",\n matches: [],\n },\n {\n label: \"Aruba\",\n matches: [],\n },\n {\n label: \"Bosch\",\n matches: [],\n },\n];\n"],"names":["productObjMatcher","ProductId","U7proXgs","u7proXgs","U7ProMax","u7proMax","CiscoCW9178I","ciscoCW9178I","CiscoCW9176I","ciscoCW9176I","DS3WAP622GSI","dS3WAP622GSI","DS3WAP622ESI","dS3WAP622ESI","ComparableProductMap","label","matches","uniFiProductId","competitorProductId","properties","wifiProperties"],"mappings":"
|
|
1
|
+
{"version":3,"file":"masterCompetitorConfig.mjs","sources":["../../../../../src/components/ModelCompareV4/SideBySide/configs/masterCompetitorConfig.tsx"],"sourcesContent":["import { ciscoCW9176I } from \"../../../../constants/modelCompareData/data/products/ciscoCW9176I\";\nimport { ciscoCW9178I } from \"../../../../constants/modelCompareData/data/products/ciscoCW9178I\";\nimport { dS3WAP622ESI } from \"../../../../constants/modelCompareData/data/products/dS3WAP622ESI\";\nimport { dS3WAP622GSI } from \"../../../../constants/modelCompareData/data/products/dS3WAP622GSI\";\nimport { e7 } from \"../../../../constants/modelCompareData/data/products/e7\";\nimport { e7Campus } from \"../../../../constants/modelCompareData/data/products/e7Campus\";\nimport { professional24PoE } from \"../../../../constants/modelCompareData/data/products/professional24PoE\";\nimport { professional48PoE } from \"../../../../constants/modelCompareData/data/products/professional48PoE\";\nimport { professionalHd24Poe } from \"../../../../constants/modelCompareData/data/products/professionalHd24Poe\";\nimport { professionalMax16PoE } from \"../../../../constants/modelCompareData/data/products/professionalMax16PoE\";\nimport { u7proMax } from \"../../../../constants/modelCompareData/data/products/u7proMax\";\nimport { u7proXgs } from \"../../../../constants/modelCompareData/data/products/u7proXgs\";\nimport type {\n Product,\n Property,\n} from \"../../../../constants/modelCompareData/types\";\nimport { ProductId } from \"../../../../constants/modelCompareData/types\";\nimport { wifiProperties } from \"./propertiesCollectionExport\";\n\n/** Using this for now to organize:\n * Also We should maybe move this file down to constants model compare data\n * https://docs.google.com/spreadsheets/d/1pXA3dI56Kzn22B4a1wu7Dasc8Y-Icx0vKXs166S3fAM/edit?usp=sharing\n */\n\ntype MatchedComparableProduct = {\n uniFiProductId: ComparableProductId;\n label?: string;\n competitorProductId: ComparableProductId;\n properties: Property[];\n};\n\ntype SideBySideMap = {\n label: string;\n matches: MatchedComparableProduct[];\n};\n\nexport type ComparableProductId = Extract<\n ProductId,\n | \"u7proXgs\"\n | \"u7proMax\"\n | \"dS3WAP622GSI\"\n | \"dS3WAP622ESI\"\n | \"ciscoCW9178I\"\n | \"ciscoCW9176I\"\n // external list\n // cisco\n | \"cw9176l\"\n | \"cw9176d\"\n | \"48uxm-m\"\n | \"ms-425\"\n | \"mx-450\"\n // Verkada\n | \"cd63-dome\"\n | \"ac12-ad64\"\n // HPE/Aruba/Juniper\n | \"arubaEdgeConnect10150\"\n | \"aruba6300m\"\n | \"arubaCx8325\"\n | \"arubaAp755\"\n | \"juniperAp47\"\n // Fortinet\n | \"fortiGate400f\"\n | \"fortiSwitch624f\"\n | \"fortiSwitch2048f\"\n | \"fortiAp441k\"\n>;\n\nexport const productObjMatcher: Record<ComparableProductId, Product> = {\n [ProductId.U7proXgs]: u7proXgs,\n [ProductId.U7ProMax]: u7proMax,\n [ProductId.CiscoCW9178I]: ciscoCW9178I,\n [ProductId.CiscoCW9176I]: ciscoCW9176I,\n [ProductId.DS3WAP622GSI]: dS3WAP622GSI,\n [ProductId.DS3WAP622ESI]: dS3WAP622ESI,\n // External\n // todo change these to actual products, for now test\n [ProductId.CW9176d]: e7,\n [ProductId.CW9176l]: e7Campus,\n [ProductId.UXM_M]: professional48PoE,\n [ProductId.MS425]: professional24PoE,\n [ProductId.MX450]: professionalHd24Poe,\n [ProductId.CD63Dome]: e7,\n [ProductId.Ac12Ad64]: e7Campus,\n [ProductId.ArubaEdgeConnect10150]: professional48PoE,\n [ProductId.Aruba6300m]: professional24PoE,\n [ProductId.ArubaCx8325]: professionalHd24Poe,\n [ProductId.ArubaAp755]: e7,\n [ProductId.JuniperAp47]: e7Campus,\n [ProductId.Fortigate400F]: professional48PoE,\n [ProductId.FortiSwitch624F]: professional24PoE,\n [ProductId.FortiSwitch2048F]: professionalMax16PoE,\n [ProductId.FortiAp441k]: professionalHd24Poe,\n};\n\nexport const ComparableProductMap: SideBySideMap[] = [\n {\n label: \"Cisco\",\n matches: [\n {\n uniFiProductId: ProductId.U7proXgs,\n competitorProductId: ProductId.CiscoCW9178I,\n label: \"Cisco Wireless 9178I Access Point (CW9178I)\",\n properties: wifiProperties,\n },\n {\n uniFiProductId: ProductId.U7ProMax,\n competitorProductId: ProductId.CiscoCW9176I,\n label: \"Cisco Wireless 9176I Access Point (CW9176I)\",\n properties: wifiProperties,\n },\n ],\n },\n {\n label: \"Juniper\",\n matches: [],\n },\n {\n label: \"Netgear\",\n matches: [],\n },\n {\n label: \"Hikvision\",\n matches: [\n {\n uniFiProductId: ProductId.U7proXgs,\n competitorProductId: ProductId.DS3WAP622GSI,\n label: \"Wi-Fi 6 1800M Ceiling Access Point (DS-3WAP622G-SI)\",\n properties: wifiProperties,\n },\n {\n uniFiProductId: ProductId.U7ProMax,\n competitorProductId: ProductId.DS3WAP622ESI,\n label: \"Wi-Fi 6 1800M Ceiling Access Point (DS-3WAP622E-SI)\",\n properties: wifiProperties,\n },\n ],\n },\n {\n label: \"Fortinet\",\n matches: [],\n },\n {\n label: \"Arista\",\n matches: [],\n },\n {\n label: \"Aruba\",\n matches: [],\n },\n {\n label: \"Bosch\",\n matches: [],\n },\n];\n"],"names":["productObjMatcher","ProductId","U7proXgs","u7proXgs","U7ProMax","u7proMax","CiscoCW9178I","ciscoCW9178I","CiscoCW9176I","ciscoCW9176I","DS3WAP622GSI","dS3WAP622GSI","DS3WAP622ESI","dS3WAP622ESI","CW9176d","e7","CW9176l","e7Campus","UXM_M","professional48PoE","MS425","professional24PoE","MX450","professionalHd24Poe","CD63Dome","Ac12Ad64","ArubaEdgeConnect10150","Aruba6300m","ArubaCx8325","ArubaAp755","JuniperAp47","Fortigate400F","FortiSwitch624F","FortiSwitch2048F","professionalMax16PoE","FortiAp441k","ComparableProductMap","label","matches","uniFiProductId","competitorProductId","properties","wifiProperties"],"mappings":";;;;;;;;;;;;;;;AAmEO,MAAMA,iBAA0D,GAAA;EACrE,CAACC,SAAU,CAAAC,QAAQ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AAAC;EACd,CAAA,EACA;IACEH,gBAAgBtC,SAAU,CAAAG,QAAA;IAC1BoC,qBAAqBvC,SAAU,CAAAO,YAAA;IAC/B6B,KAAO,EAAA,6CAAA;IACPI,UAAY,EAAAC;EAAA,CAAA;AAGlB,CAAA,EACA;EACEL,KAAO,EAAA,SAAA;EACPC,SAAS;AACX,CAAA,EACA;EACED,KAAO,EAAA,SAAA;EACPC,SAAS;AACX,CAAA,EACA;EACED,KAAO,EAAA,WAAA;EACPC,OAAS,EAAA,CACP;IACEC,gBAAgBtC,SAAU,CAAAC,QAAA;IAC1BsC,qBAAqBvC,SAAU,CAAAS,YAAA;IAC/B2B,KAAO,EAAA,qDAAA;IACPI,UAAY,EAAAC;EACd,CAAA,EACA;IACEH,gBAAgBtC,SAAU,CAAAG,QAAA;IAC1BoC,qBAAqBvC,SAAU,CAAAW,YAAA;IAC/ByB,KAAO,EAAA,qDAAA;IACPI,UAAY,EAAAC;EAAA,CAAA;AAGlB,CAAA,EACA;EACEL,KAAO,EAAA,UAAA;EACPC,SAAS;AACX,CAAA,EACA;EACED,KAAO,EAAA,QAAA;EACPC,SAAS;AACX,CAAA,EACA;EACED,KAAO,EAAA,OAAA;EACPC,SAAS;AACX,CAAA,EACA;EACED,KAAO,EAAA,OAAA;EACPC,SAAS;AAAC,CAAA,CAEd;"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ModelCompareV4Props } from "./ModelCompareV4.types";
|
|
2
2
|
export declare const MODEL_COMPARE_V4_ANCHOR = "compare";
|
|
3
|
-
export declare const SideBySideCompare: ({ headerStickOffset, overlayTopOffset, showBuyButton, onLinkClick, linkToStoreTitleClick, isMigrationTable, additionalProductData, section, defaultSelectedProductsCount, selectedProducts: externalSelectedProducts, setSelectedProducts: setExternalSelectedProducts, }: ModelCompareV4Props) => JSX.Element;
|
|
3
|
+
export declare const SideBySideCompare: ({ headerStickOffset, overlayTopOffset, showBuyButton, onLinkClick, linkToStoreTitleClick, isMigrationTable, additionalProductData, section, defaultSelectedProductsCount, selectedProducts: externalSelectedProducts, setSelectedProducts: setExternalSelectedProducts, externalDynamicSection, }: ModelCompareV4Props) => JSX.Element;
|
|
@@ -22,9 +22,10 @@ const SideBySideCompare = ({
|
|
|
22
22
|
section,
|
|
23
23
|
defaultSelectedProductsCount = 2,
|
|
24
24
|
selectedProducts: externalSelectedProducts,
|
|
25
|
-
setSelectedProducts: setExternalSelectedProducts
|
|
25
|
+
setSelectedProducts: setExternalSelectedProducts,
|
|
26
|
+
externalDynamicSection = null
|
|
26
27
|
}) => {
|
|
27
|
-
const [dynamicMigrationSection, setDynamicMigrationSection] = React.useState(
|
|
28
|
+
const [dynamicMigrationSection, setDynamicMigrationSection] = React.useState(externalDynamicSection);
|
|
28
29
|
const hasProductList = React.useMemo(() => section.products.length > 5 && !section.isStaticTable, [section.products, section.isStaticTable]);
|
|
29
30
|
const intersectionObserverObjectRef = React.useRef(null);
|
|
30
31
|
const {
|
|
@@ -92,6 +93,14 @@ const SideBySideCompare = ({
|
|
|
92
93
|
productId: p.id
|
|
93
94
|
})));
|
|
94
95
|
}, [renderDynamicSection]);
|
|
96
|
+
React.useEffect(() => {
|
|
97
|
+
if (externalDynamicSection) {
|
|
98
|
+
setDynamicMigrationSection(externalDynamicSection);
|
|
99
|
+
setSelectedProducts(externalDynamicSection.products.map(p => ({
|
|
100
|
+
productId: p.id
|
|
101
|
+
})));
|
|
102
|
+
}
|
|
103
|
+
}, [externalDynamicSection]);
|
|
95
104
|
return /* @__PURE__ */jsxRuntime.jsxs(ModelCompareV4_styles.Container, {
|
|
96
105
|
children: [/* @__PURE__ */jsxRuntime.jsx(SideBySide.SideBySide, {
|
|
97
106
|
onProductSearchSelect
|
|
@@ -106,8 +115,8 @@ const SideBySideCompare = ({
|
|
|
106
115
|
isMigrationTable: !!isMigrationTable,
|
|
107
116
|
setSelectedProducts,
|
|
108
117
|
setExternalSelectedProducts,
|
|
109
|
-
section: dynamicMigrationSection
|
|
110
|
-
products:
|
|
118
|
+
section: dynamicMigrationSection,
|
|
119
|
+
products: dynamicMigrationSection.products,
|
|
111
120
|
hasBeenObserved: hasBeenObserved || userIsUnderneathIntersectionObserver,
|
|
112
121
|
selectedProductsLimit,
|
|
113
122
|
isOverviewPage: Boolean(section.isOverviewPage),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideBySideCompare.js","sources":["../../../src/components/ModelCompareV4/SideBySideCompare.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { useWindowScroll } from \"react-use\";\n\nimport type {\n ProductId,\n Section,\n SelectedProduct,\n} from \"../../constants/modelCompareData/types\";\nimport { CompareTable } from \"./CompareTable/CompareTable\";\nimport { SELECTED_PRODUCTS_LIMIT } from \"./constants\";\nimport * as S from \"./ModelCompareV4.styles\";\nimport type { ModelCompareV4Props } from \"./ModelCompareV4.types\";\nimport { productObjMatcher } from \"./SideBySide/configs/masterCompetitorConfig\";\nimport { SideBySide } from \"./SideBySide/SideBySide\";\nimport { type IProductOption } from \"./SideBySide/SideBySide.types\";\n\nexport const MODEL_COMPARE_V4_ANCHOR = \"compare\";\n\nconst INTERSECTION_OBSERVER_THRESHOLD = 0.35;\n\nexport const SideBySideCompare = ({\n headerStickOffset,\n overlayTopOffset,\n showBuyButton,\n onLinkClick,\n linkToStoreTitleClick,\n isMigrationTable,\n additionalProductData,\n section,\n defaultSelectedProductsCount = 2,\n selectedProducts: externalSelectedProducts,\n setSelectedProducts: setExternalSelectedProducts,\n}: ModelCompareV4Props) => {\n const [dynamicMigrationSection, setDynamicMigrationSection] =\n useState<Section | null>(null);\n\n const hasProductList = useMemo(\n () => section.products.length > 5 && !section.isStaticTable,\n [section.products, section.isStaticTable],\n );\n\n const intersectionObserverObjectRef = useRef<HTMLDivElement | null>(null);\n\n const { y: scrollPositionY } = useWindowScroll();\n\n const userIsUnderneathIntersectionObserver = useMemo(() => {\n if (!intersectionObserverObjectRef.current) return false;\n\n return (\n intersectionObserverObjectRef.current.getBoundingClientRect().bottom <\n scrollPositionY\n );\n }, [scrollPositionY]);\n\n /**\n * TODO: Improve the name and logic of this variable and related code.\n * Currently, this variable is used whether ModelCompareV4 has a product list or not.\n * It should only be used if hasProductList is `true`. Why? Because if hasProductList\n * is `false` then selecting/deselecting products isn't possible. The gap between the\n * name of the variable and what it does can be confusing for future devs.\n */\n const defaultSelectedProducts = useMemo(\n () =>\n section.products\n .map((product) => ({ productId: product.id }))\n .slice(\n 0,\n hasProductList\n ? defaultSelectedProductsCount\n : section.products.length,\n ),\n [defaultSelectedProductsCount, hasProductList, section.products],\n );\n /**\n * TODO: rewrite the \"default selected products\" feature so we don't need to use a `useEffect`\n * to update the state of V4. We'll be able to remove this hackie `useRef` as a side-effect.\n */\n const defaultSelectedProductsRef = useRef(defaultSelectedProducts);\n\n const selectedProductsLimit = useMemo(() => {\n return section.products.length < SELECTED_PRODUCTS_LIMIT\n ? section.products.length\n : SELECTED_PRODUCTS_LIMIT;\n }, [section.products.length]);\n\n const [selectedProducts, setSelectedProducts] = useState<SelectedProduct[]>(\n [],\n );\n\n const [hasBeenObserved, setHasBeenObserved] = useState(false);\n\n // #############################################################################\n // Sets selectedProducts value\n // #############################################################################\n\n useEffect(() => {\n defaultSelectedProductsRef.current = defaultSelectedProducts;\n }, [defaultSelectedProducts]);\n\n useEffect(() => {\n setSelectedProducts(\n externalSelectedProducts ||\n (defaultSelectedProductsRef.current as SelectedProduct[]),\n );\n }, [section, externalSelectedProducts]);\n\n // #############################################################################\n // Intersection Observer Logic\n // #############################################################################\n const observerCallback = useCallback<IntersectionObserverCallback>(\n (entries) => {\n entries.forEach(\n (entry) =>\n entry.isIntersecting && !hasBeenObserved && setHasBeenObserved(true),\n );\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [setHasBeenObserved],\n );\n\n useEffect(() => {\n const observer = new IntersectionObserver(observerCallback, {\n threshold: hasProductList ? INTERSECTION_OBSERVER_THRESHOLD : 0,\n });\n\n const intersectionObserverObjectRefCurrent =\n intersectionObserverObjectRef.current;\n\n if (intersectionObserverObjectRefCurrent)\n observer.observe(intersectionObserverObjectRefCurrent);\n\n return () => {\n if (intersectionObserverObjectRefCurrent) {\n observer.unobserve(intersectionObserverObjectRefCurrent);\n observer.disconnect();\n }\n };\n }, [observerCallback, hasProductList]);\n\n const renderDynamicSection = useCallback(\n (match: IProductOption): Section => {\n const { competitorProductId, uniFiProductId, properties } = match;\n\n const unifiProduct = productObjMatcher[uniFiProductId];\n const competitorProduct = productObjMatcher[competitorProductId];\n\n return {\n ...section,\n products: [unifiProduct, competitorProduct],\n properties,\n showBadges: false,\n };\n },\n [section],\n );\n\n const onProductSearchSelect = useCallback(\n (match: IProductOption) => {\n const dynamicSection = renderDynamicSection(match);\n\n if (!dynamicSection) {\n return;\n }\n\n setDynamicMigrationSection(dynamicSection);\n setSelectedProducts(\n dynamicSection.products.map((p) => ({\n productId: p.id as ProductId,\n })),\n );\n },\n [renderDynamicSection],\n );\n\n return (\n <S.Container>\n <SideBySide onProductSearchSelect={onProductSearchSelect} />\n\n {!!dynamicMigrationSection && (\n <CompareTable\n headerStickOffset={headerStickOffset}\n overlayTopOffset={overlayTopOffset}\n showBuyButton={showBuyButton}\n onLinkClick={onLinkClick}\n linkToStoreTitleClick={linkToStoreTitleClick}\n additionalProductData={additionalProductData}\n selectedProducts={selectedProducts}\n isMigrationTable={!!isMigrationTable}\n setSelectedProducts={setSelectedProducts}\n setExternalSelectedProducts={setExternalSelectedProducts}\n section={dynamicMigrationSection || section}\n products={(dynamicMigrationSection || section).products}\n // TODO: rename this property now that `userIsUnderneathIntersectionObserver` has been added\n hasBeenObserved={\n hasBeenObserved || userIsUnderneathIntersectionObserver\n }\n selectedProductsLimit={selectedProductsLimit}\n isOverviewPage={Boolean(section.isOverviewPage)}\n isStaticTable={Boolean(section.isStaticTable)}\n />\n )}\n\n <S.InterSectionObserverObject ref={intersectionObserverObjectRef} />\n </S.Container>\n );\n};\n"],"names":["MODEL_COMPARE_V4_ANCHOR","INTERSECTION_OBSERVER_THRESHOLD","SideBySideCompare","headerStickOffset","overlayTopOffset","showBuyButton","onLinkClick","linkToStoreTitleClick","isMigrationTable","additionalProductData","section","defaultSelectedProductsCount","selectedProducts","externalSelectedProducts","setSelectedProducts","setExternalSelectedProducts","dynamicMigrationSection","setDynamicMigrationSection","useState","hasProductList","useMemo","products","length","isStaticTable","intersectionObserverObjectRef","useRef","y","scrollPositionY","useWindowScroll","userIsUnderneathIntersectionObserver","current","getBoundingClientRect","bottom","defaultSelectedProducts","map","product","productId","id","slice","defaultSelectedProductsRef","selectedProductsLimit","SELECTED_PRODUCTS_LIMIT","hasBeenObserved","setHasBeenObserved","useEffect","observerCallback","useCallback","entries","forEach","entry","isIntersecting","observer","IntersectionObserver","threshold","intersectionObserverObjectRefCurrent","observe","unobserve","disconnect","renderDynamicSection","match","competitorProductId","uniFiProductId","properties","unifiProduct","productObjMatcher","competitorProduct","showBadges","onProductSearchSelect","dynamicSection","p","jsxs","S.Container","children","jsx","SideBySide","CompareTable","isOverviewPage","Boolean","S.InterSectionObserverObject","InterSectionObserverObject","ref"],"mappings":";;;;;;;;;;;AAgBO,MAAMA,uBAA0B,GAAA,SAAA;AAEvC,MAAMC,+BAAkC,GAAA,IAAA;AAEjC,MAAMC,oBAAoBA,CAAC;EAChCC,iBAAA;EACAC,gBAAA;EACAC,aAAA;EACAC,WAAA;EACAC,qBAAA;EACAC,gBAAA;EACAC,qBAAA;EACAC,OAAA;EACAC,4BAA+B,GAAA,CAAA;EAC/BC,gBAAkB,EAAAC,wBAAA;EAClBC,mBAAqB,EAAAC;AACvB,CAA2B,KAAA;EACzB,MAAM,CAACC,uBAAA,EAAyBC,0BAA0B,CAAA,GACxDC,KAAAA,CAAAA,SAAyB,IAAI,CAAA;EAE/B,MAAMC,cAAiB,GAAAC,KAAA,CAAAA,OAAA,CACrB,MAAMV,OAAQ,CAAAW,QAAA,CAASC,MAAS,GAAA,CAAA,IAAK,CAACZ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A,EAAesD,OAAQ,CAAAnE,OAAA,CAAQa,aAAa;IAAA,CAC9C,CAAA,EAGDkD,eAAAA,UAAAA,CAAAA,GAAA,CAAAK,qBAAA,CAAAC,0BAAA,EAAA;MAA6BC,KAAKxD;IAA+B,CAAA,CAAA;GACpE,CAAA;AAEJ,CAAA;;"}
|
|
1
|
+
{"version":3,"file":"SideBySideCompare.js","sources":["../../../src/components/ModelCompareV4/SideBySideCompare.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { useWindowScroll } from \"react-use\";\n\nimport type {\n ProductId,\n Section,\n SelectedProduct,\n} from \"../../constants/modelCompareData/types\";\nimport { CompareTable } from \"./CompareTable/CompareTable\";\nimport { SELECTED_PRODUCTS_LIMIT } from \"./constants\";\nimport * as S from \"./ModelCompareV4.styles\";\nimport type { ModelCompareV4Props } from \"./ModelCompareV4.types\";\nimport { productObjMatcher } from \"./SideBySide/configs/masterCompetitorConfig\";\nimport { SideBySide } from \"./SideBySide/SideBySide\";\nimport { type IProductOption } from \"./SideBySide/SideBySide.types\";\n\nexport const MODEL_COMPARE_V4_ANCHOR = \"compare\";\n\nconst INTERSECTION_OBSERVER_THRESHOLD = 0.35;\n\nexport const SideBySideCompare = ({\n headerStickOffset,\n overlayTopOffset,\n showBuyButton,\n onLinkClick,\n linkToStoreTitleClick,\n isMigrationTable,\n additionalProductData,\n section,\n defaultSelectedProductsCount = 2,\n selectedProducts: externalSelectedProducts,\n setSelectedProducts: setExternalSelectedProducts,\n externalDynamicSection = null,\n}: ModelCompareV4Props) => {\n const [dynamicMigrationSection, setDynamicMigrationSection] =\n useState<Section | null>(externalDynamicSection);\n\n const hasProductList = useMemo(\n () => section.products.length > 5 && !section.isStaticTable,\n [section.products, section.isStaticTable],\n );\n\n const intersectionObserverObjectRef = useRef<HTMLDivElement | null>(null);\n\n const { y: scrollPositionY } = useWindowScroll();\n\n const userIsUnderneathIntersectionObserver = useMemo(() => {\n if (!intersectionObserverObjectRef.current) return false;\n\n return (\n intersectionObserverObjectRef.current.getBoundingClientRect().bottom <\n scrollPositionY\n );\n }, [scrollPositionY]);\n\n /**\n * TODO: Improve the name and logic of this variable and related code.\n * Currently, this variable is used whether ModelCompareV4 has a product list or not.\n * It should only be used if hasProductList is `true`. Why? Because if hasProductList\n * is `false` then selecting/deselecting products isn't possible. The gap between the\n * name of the variable and what it does can be confusing for future devs.\n */\n const defaultSelectedProducts = useMemo(\n () =>\n section.products\n .map((product) => ({ productId: product.id }))\n .slice(\n 0,\n hasProductList\n ? defaultSelectedProductsCount\n : section.products.length,\n ),\n [defaultSelectedProductsCount, hasProductList, section.products],\n );\n /**\n * TODO: rewrite the \"default selected products\" feature so we don't need to use a `useEffect`\n * to update the state of V4. We'll be able to remove this hackie `useRef` as a side-effect.\n */\n const defaultSelectedProductsRef = useRef(defaultSelectedProducts);\n\n const selectedProductsLimit = useMemo(() => {\n return section.products.length < SELECTED_PRODUCTS_LIMIT\n ? section.products.length\n : SELECTED_PRODUCTS_LIMIT;\n }, [section.products.length]);\n\n const [selectedProducts, setSelectedProducts] = useState<SelectedProduct[]>(\n [],\n );\n\n const [hasBeenObserved, setHasBeenObserved] = useState(false);\n\n // #############################################################################\n // Sets selectedProducts value\n // #############################################################################\n\n useEffect(() => {\n defaultSelectedProductsRef.current = defaultSelectedProducts;\n }, [defaultSelectedProducts]);\n\n useEffect(() => {\n setSelectedProducts(\n externalSelectedProducts ||\n (defaultSelectedProductsRef.current as SelectedProduct[]),\n );\n }, [section, externalSelectedProducts]);\n\n // #############################################################################\n // Intersection Observer Logic\n // #############################################################################\n const observerCallback = useCallback<IntersectionObserverCallback>(\n (entries) => {\n entries.forEach(\n (entry) =>\n entry.isIntersecting && !hasBeenObserved && setHasBeenObserved(true),\n );\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [setHasBeenObserved],\n );\n\n useEffect(() => {\n const observer = new IntersectionObserver(observerCallback, {\n threshold: hasProductList ? INTERSECTION_OBSERVER_THRESHOLD : 0,\n });\n\n const intersectionObserverObjectRefCurrent =\n intersectionObserverObjectRef.current;\n\n if (intersectionObserverObjectRefCurrent)\n observer.observe(intersectionObserverObjectRefCurrent);\n\n return () => {\n if (intersectionObserverObjectRefCurrent) {\n observer.unobserve(intersectionObserverObjectRefCurrent);\n observer.disconnect();\n }\n };\n }, [observerCallback, hasProductList]);\n\n const renderDynamicSection = useCallback(\n (match: IProductOption): Section => {\n const { competitorProductId, uniFiProductId, properties } = match;\n\n const unifiProduct = productObjMatcher[uniFiProductId];\n const competitorProduct = productObjMatcher[competitorProductId];\n\n return {\n ...section,\n products: [unifiProduct, competitorProduct],\n properties,\n showBadges: false,\n };\n },\n [section],\n );\n\n const onProductSearchSelect = useCallback(\n (match: IProductOption) => {\n const dynamicSection = renderDynamicSection(match);\n\n if (!dynamicSection) {\n return;\n }\n\n setDynamicMigrationSection(dynamicSection);\n setSelectedProducts(\n dynamicSection.products.map((p) => ({\n productId: p.id as ProductId,\n })),\n );\n },\n [renderDynamicSection],\n );\n\n useEffect(() => {\n if (externalDynamicSection) {\n setDynamicMigrationSection(externalDynamicSection);\n setSelectedProducts(\n externalDynamicSection.products.map((p) => ({\n productId: p.id as ProductId,\n })),\n );\n }\n }, [externalDynamicSection]);\n\n return (\n <S.Container>\n <SideBySide onProductSearchSelect={onProductSearchSelect} />\n\n {!!dynamicMigrationSection && (\n <CompareTable\n headerStickOffset={headerStickOffset}\n overlayTopOffset={overlayTopOffset}\n showBuyButton={showBuyButton}\n onLinkClick={onLinkClick}\n linkToStoreTitleClick={linkToStoreTitleClick}\n additionalProductData={additionalProductData}\n selectedProducts={selectedProducts}\n isMigrationTable={!!isMigrationTable}\n setSelectedProducts={setSelectedProducts}\n setExternalSelectedProducts={setExternalSelectedProducts}\n section={dynamicMigrationSection}\n products={dynamicMigrationSection.products}\n // TODO: rename this property now that `userIsUnderneathIntersectionObserver` has been added\n hasBeenObserved={\n hasBeenObserved || userIsUnderneathIntersectionObserver\n }\n selectedProductsLimit={selectedProductsLimit}\n isOverviewPage={Boolean(section.isOverviewPage)}\n isStaticTable={Boolean(section.isStaticTable)}\n />\n )}\n\n <S.InterSectionObserverObject ref={intersectionObserverObjectRef} />\n </S.Container>\n );\n};\n"],"names":["MODEL_COMPARE_V4_ANCHOR","INTERSECTION_OBSERVER_THRESHOLD","SideBySideCompare","headerStickOffset","overlayTopOffset","showBuyButton","onLinkClick","linkToStoreTitleClick","isMigrationTable","additionalProductData","section","defaultSelectedProductsCount","selectedProducts","externalSelectedProducts","setSelectedProducts","setExternalSelectedProducts","externalDynamicSection","dynamicMigrationSection","setDynamicMigrationSection","useState","hasProductList","useMemo","products","length","isStaticTable","intersectionObserverObjectRef","useRef","y","scrollPositionY","useWindowScroll","userIsUnderneathIntersectionObserver","current","getBoundingClientRect","bottom","defaultSelectedProducts","map","product","productId","id","slice","defaultSelectedProductsRef","selectedProductsLimit","SELECTED_PRODUCTS_LIMIT","hasBeenObserved","setHasBeenObserved","useEffect","observerCallback","useCallback","entries","forEach","entry","isIntersecting","observer","IntersectionObserver","threshold","intersectionObserverObjectRefCurrent","observe","unobserve","disconnect","renderDynamicSection","match","competitorProductId","uniFiProductId","properties","unifiProduct","productObjMatcher","competitorProduct","showBadges","onProductSearchSelect","dynamicSection","p","jsxs","S.Container","children","jsx","SideBySide","CompareTable","isOverviewPage","Boolean","S.InterSectionObserverObject","InterSectionObserverObject","ref"],"mappings":";;;;;;;;;;;AAgBO,MAAMA,uBAA0B,GAAA,SAAA;AAEvC,MAAMC,+BAAkC,GAAA,IAAA;AAEjC,MAAMC,oBAAoBA,CAAC;EAChCC,iBAAA;EACAC,gBAAA;EACAC,aAAA;EACAC,WAAA;EACAC,qBAAA;EACAC,gBAAA;EACAC,qBAAA;EACAC,OAAA;EACAC,4BAA+B,GAAA,CAAA;EAC/BC,gBAAkB,EAAAC,wBAAA;EAClBC,mBAAqB,EAAAC,2BAAA;EACrBC,sBAAyB,GAAA;AAC3B,CAA2B,KAAA;EACzB,M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A;MAAWP;KAA8C,CAAA,EAEzD,CAAC,CAACnD,uBACD,IAAA,eAAAyD,UAAA,CAAAA,GAAA,CAACE,YAAA,CAAAA,YAAA,EAAA;MACCzE,iBAAA;MACAC,gBAAA;MACAC,aAAA;MACAC,WAAA;MACAC,qBAAA;MACAE,qBAAA;MACAG,gBAAA;MACAJ,gBAAA,EAAkB,CAAC,CAACA,gBAAA;MACpBM,mBAAA;MACAC,2BAAA;MACAL,OAAS,EAAAO,uBAAA;MACTK,UAAUL,uBAAwB,CAAAK,QAAA;MAElCqB,iBACEA,eAAmB,IAAAb,oCAAA;MAErBW,qBAAA;MACAoC,cAAA,EAAgBC,OAAQ,CAAApE,OAAA,CAAQmE,cAAc,CAAA;MAC9CrD,aAAA,EAAesD,OAAQ,CAAApE,OAAA,CAAQc,aAAa;IAAA,CAC9C,CAAA,EAGDkD,eAAAA,UAAAA,CAAAA,GAAA,CAAAK,qBAAA,CAAAC,0BAAA,EAAA;MAA6BC,KAAKxD;IAA+B,CAAA,CAAA;GACpE,CAAA;AAEJ,CAAA;;"}
|
|
@@ -20,9 +20,10 @@ const SideBySideCompare = ({
|
|
|
20
20
|
section,
|
|
21
21
|
defaultSelectedProductsCount = 2,
|
|
22
22
|
selectedProducts: externalSelectedProducts,
|
|
23
|
-
setSelectedProducts: setExternalSelectedProducts
|
|
23
|
+
setSelectedProducts: setExternalSelectedProducts,
|
|
24
|
+
externalDynamicSection = null
|
|
24
25
|
}) => {
|
|
25
|
-
const [dynamicMigrationSection, setDynamicMigrationSection] = useState(
|
|
26
|
+
const [dynamicMigrationSection, setDynamicMigrationSection] = useState(externalDynamicSection);
|
|
26
27
|
const hasProductList = useMemo(() => section.products.length > 5 && !section.isStaticTable, [section.products, section.isStaticTable]);
|
|
27
28
|
const intersectionObserverObjectRef = useRef(null);
|
|
28
29
|
const {
|
|
@@ -90,6 +91,14 @@ const SideBySideCompare = ({
|
|
|
90
91
|
productId: p.id
|
|
91
92
|
})));
|
|
92
93
|
}, [renderDynamicSection]);
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
if (externalDynamicSection) {
|
|
96
|
+
setDynamicMigrationSection(externalDynamicSection);
|
|
97
|
+
setSelectedProducts(externalDynamicSection.products.map(p => ({
|
|
98
|
+
productId: p.id
|
|
99
|
+
})));
|
|
100
|
+
}
|
|
101
|
+
}, [externalDynamicSection]);
|
|
93
102
|
return /* @__PURE__ */jsxs(Container, {
|
|
94
103
|
children: [/* @__PURE__ */jsx(SideBySide, {
|
|
95
104
|
onProductSearchSelect
|
|
@@ -104,8 +113,8 @@ const SideBySideCompare = ({
|
|
|
104
113
|
isMigrationTable: !!isMigrationTable,
|
|
105
114
|
setSelectedProducts,
|
|
106
115
|
setExternalSelectedProducts,
|
|
107
|
-
section: dynamicMigrationSection
|
|
108
|
-
products:
|
|
116
|
+
section: dynamicMigrationSection,
|
|
117
|
+
products: dynamicMigrationSection.products,
|
|
109
118
|
hasBeenObserved: hasBeenObserved || userIsUnderneathIntersectionObserver,
|
|
110
119
|
selectedProductsLimit,
|
|
111
120
|
isOverviewPage: Boolean(section.isOverviewPage),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideBySideCompare.mjs","sources":["../../../src/components/ModelCompareV4/SideBySideCompare.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { useWindowScroll } from \"react-use\";\n\nimport type {\n ProductId,\n Section,\n SelectedProduct,\n} from \"../../constants/modelCompareData/types\";\nimport { CompareTable } from \"./CompareTable/CompareTable\";\nimport { SELECTED_PRODUCTS_LIMIT } from \"./constants\";\nimport * as S from \"./ModelCompareV4.styles\";\nimport type { ModelCompareV4Props } from \"./ModelCompareV4.types\";\nimport { productObjMatcher } from \"./SideBySide/configs/masterCompetitorConfig\";\nimport { SideBySide } from \"./SideBySide/SideBySide\";\nimport { type IProductOption } from \"./SideBySide/SideBySide.types\";\n\nexport const MODEL_COMPARE_V4_ANCHOR = \"compare\";\n\nconst INTERSECTION_OBSERVER_THRESHOLD = 0.35;\n\nexport const SideBySideCompare = ({\n headerStickOffset,\n overlayTopOffset,\n showBuyButton,\n onLinkClick,\n linkToStoreTitleClick,\n isMigrationTable,\n additionalProductData,\n section,\n defaultSelectedProductsCount = 2,\n selectedProducts: externalSelectedProducts,\n setSelectedProducts: setExternalSelectedProducts,\n}: ModelCompareV4Props) => {\n const [dynamicMigrationSection, setDynamicMigrationSection] =\n useState<Section | null>(null);\n\n const hasProductList = useMemo(\n () => section.products.length > 5 && !section.isStaticTable,\n [section.products, section.isStaticTable],\n );\n\n const intersectionObserverObjectRef = useRef<HTMLDivElement | null>(null);\n\n const { y: scrollPositionY } = useWindowScroll();\n\n const userIsUnderneathIntersectionObserver = useMemo(() => {\n if (!intersectionObserverObjectRef.current) return false;\n\n return (\n intersectionObserverObjectRef.current.getBoundingClientRect().bottom <\n scrollPositionY\n );\n }, [scrollPositionY]);\n\n /**\n * TODO: Improve the name and logic of this variable and related code.\n * Currently, this variable is used whether ModelCompareV4 has a product list or not.\n * It should only be used if hasProductList is `true`. Why? Because if hasProductList\n * is `false` then selecting/deselecting products isn't possible. The gap between the\n * name of the variable and what it does can be confusing for future devs.\n */\n const defaultSelectedProducts = useMemo(\n () =>\n section.products\n .map((product) => ({ productId: product.id }))\n .slice(\n 0,\n hasProductList\n ? defaultSelectedProductsCount\n : section.products.length,\n ),\n [defaultSelectedProductsCount, hasProductList, section.products],\n );\n /**\n * TODO: rewrite the \"default selected products\" feature so we don't need to use a `useEffect`\n * to update the state of V4. We'll be able to remove this hackie `useRef` as a side-effect.\n */\n const defaultSelectedProductsRef = useRef(defaultSelectedProducts);\n\n const selectedProductsLimit = useMemo(() => {\n return section.products.length < SELECTED_PRODUCTS_LIMIT\n ? section.products.length\n : SELECTED_PRODUCTS_LIMIT;\n }, [section.products.length]);\n\n const [selectedProducts, setSelectedProducts] = useState<SelectedProduct[]>(\n [],\n );\n\n const [hasBeenObserved, setHasBeenObserved] = useState(false);\n\n // #############################################################################\n // Sets selectedProducts value\n // #############################################################################\n\n useEffect(() => {\n defaultSelectedProductsRef.current = defaultSelectedProducts;\n }, [defaultSelectedProducts]);\n\n useEffect(() => {\n setSelectedProducts(\n externalSelectedProducts ||\n (defaultSelectedProductsRef.current as SelectedProduct[]),\n );\n }, [section, externalSelectedProducts]);\n\n // #############################################################################\n // Intersection Observer Logic\n // #############################################################################\n const observerCallback = useCallback<IntersectionObserverCallback>(\n (entries) => {\n entries.forEach(\n (entry) =>\n entry.isIntersecting && !hasBeenObserved && setHasBeenObserved(true),\n );\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [setHasBeenObserved],\n );\n\n useEffect(() => {\n const observer = new IntersectionObserver(observerCallback, {\n threshold: hasProductList ? INTERSECTION_OBSERVER_THRESHOLD : 0,\n });\n\n const intersectionObserverObjectRefCurrent =\n intersectionObserverObjectRef.current;\n\n if (intersectionObserverObjectRefCurrent)\n observer.observe(intersectionObserverObjectRefCurrent);\n\n return () => {\n if (intersectionObserverObjectRefCurrent) {\n observer.unobserve(intersectionObserverObjectRefCurrent);\n observer.disconnect();\n }\n };\n }, [observerCallback, hasProductList]);\n\n const renderDynamicSection = useCallback(\n (match: IProductOption): Section => {\n const { competitorProductId, uniFiProductId, properties } = match;\n\n const unifiProduct = productObjMatcher[uniFiProductId];\n const competitorProduct = productObjMatcher[competitorProductId];\n\n return {\n ...section,\n products: [unifiProduct, competitorProduct],\n properties,\n showBadges: false,\n };\n },\n [section],\n );\n\n const onProductSearchSelect = useCallback(\n (match: IProductOption) => {\n const dynamicSection = renderDynamicSection(match);\n\n if (!dynamicSection) {\n return;\n }\n\n setDynamicMigrationSection(dynamicSection);\n setSelectedProducts(\n dynamicSection.products.map((p) => ({\n productId: p.id as ProductId,\n })),\n );\n },\n [renderDynamicSection],\n );\n\n return (\n <S.Container>\n <SideBySide onProductSearchSelect={onProductSearchSelect} />\n\n {!!dynamicMigrationSection && (\n <CompareTable\n headerStickOffset={headerStickOffset}\n overlayTopOffset={overlayTopOffset}\n showBuyButton={showBuyButton}\n onLinkClick={onLinkClick}\n linkToStoreTitleClick={linkToStoreTitleClick}\n additionalProductData={additionalProductData}\n selectedProducts={selectedProducts}\n isMigrationTable={!!isMigrationTable}\n setSelectedProducts={setSelectedProducts}\n setExternalSelectedProducts={setExternalSelectedProducts}\n section={dynamicMigrationSection || section}\n products={(dynamicMigrationSection || section).products}\n // TODO: rename this property now that `userIsUnderneathIntersectionObserver` has been added\n hasBeenObserved={\n hasBeenObserved || userIsUnderneathIntersectionObserver\n }\n selectedProductsLimit={selectedProductsLimit}\n isOverviewPage={Boolean(section.isOverviewPage)}\n isStaticTable={Boolean(section.isStaticTable)}\n />\n )}\n\n <S.InterSectionObserverObject ref={intersectionObserverObjectRef} />\n </S.Container>\n );\n};\n"],"names":["MODEL_COMPARE_V4_ANCHOR","INTERSECTION_OBSERVER_THRESHOLD","SideBySideCompare","headerStickOffset","overlayTopOffset","showBuyButton","onLinkClick","linkToStoreTitleClick","isMigrationTable","additionalProductData","section","defaultSelectedProductsCount","selectedProducts","externalSelectedProducts","setSelectedProducts","setExternalSelectedProducts","dynamicMigrationSection","setDynamicMigrationSection","useState","hasProductList","useMemo","products","length","isStaticTable","intersectionObserverObjectRef","useRef","y","scrollPositionY","useWindowScroll","userIsUnderneathIntersectionObserver","current","getBoundingClientRect","bottom","defaultSelectedProducts","map","product","productId","id","slice","defaultSelectedProductsRef","selectedProductsLimit","SELECTED_PRODUCTS_LIMIT","hasBeenObserved","setHasBeenObserved","useEffect","observerCallback","useCallback","entries","forEach","entry","isIntersecting","observer","IntersectionObserver","threshold","intersectionObserverObjectRefCurrent","observe","unobserve","disconnect","renderDynamicSection","match","competitorProductId","uniFiProductId","properties","unifiProduct","productObjMatcher","competitorProduct","showBadges","onProductSearchSelect","dynamicSection","p","jsxs","S.Container","children","jsx","SideBySide","CompareTable","isOverviewPage","Boolean","S.InterSectionObserverObject","ref"],"mappings":";;;;;;;;;AAgBO,MAAMA,uBAA0B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AAA;MACAL,SAASM,uBAA2B,IAAAN,OAAA;MACpCW,QAAA,EAAA,CAAWL,2BAA2BN,OAAS,EAAAW,QAAA;MAE/CqB,iBACEA,eAAmB,IAAAb,oCAAA;MAErBW,qBAAA;MACAoC,cAAA,EAAgBC,OAAQ,CAAAnE,OAAA,CAAQkE,cAAc,CAAA;MAC9CrD,aAAA,EAAesD,OAAQ,CAAAnE,OAAA,CAAQa,aAAa;IAAA,CAC9C,CAAA,EAGD,eAAAkD,GAAA,CAAAK,0BAAA,EAAA;MAA6BC,KAAKvD;IAA+B,CAAA,CAAA;GACpE,CAAA;AAEJ,CAAA;"}
|
|
1
|
+
{"version":3,"file":"SideBySideCompare.mjs","sources":["../../../src/components/ModelCompareV4/SideBySideCompare.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { useWindowScroll } from \"react-use\";\n\nimport type {\n ProductId,\n Section,\n SelectedProduct,\n} from \"../../constants/modelCompareData/types\";\nimport { CompareTable } from \"./CompareTable/CompareTable\";\nimport { SELECTED_PRODUCTS_LIMIT } from \"./constants\";\nimport * as S from \"./ModelCompareV4.styles\";\nimport type { ModelCompareV4Props } from \"./ModelCompareV4.types\";\nimport { productObjMatcher } from \"./SideBySide/configs/masterCompetitorConfig\";\nimport { SideBySide } from \"./SideBySide/SideBySide\";\nimport { type IProductOption } from \"./SideBySide/SideBySide.types\";\n\nexport const MODEL_COMPARE_V4_ANCHOR = \"compare\";\n\nconst INTERSECTION_OBSERVER_THRESHOLD = 0.35;\n\nexport const SideBySideCompare = ({\n headerStickOffset,\n overlayTopOffset,\n showBuyButton,\n onLinkClick,\n linkToStoreTitleClick,\n isMigrationTable,\n additionalProductData,\n section,\n defaultSelectedProductsCount = 2,\n selectedProducts: externalSelectedProducts,\n setSelectedProducts: setExternalSelectedProducts,\n externalDynamicSection = null,\n}: ModelCompareV4Props) => {\n const [dynamicMigrationSection, setDynamicMigrationSection] =\n useState<Section | null>(externalDynamicSection);\n\n const hasProductList = useMemo(\n () => section.products.length > 5 && !section.isStaticTable,\n [section.products, section.isStaticTable],\n );\n\n const intersectionObserverObjectRef = useRef<HTMLDivElement | null>(null);\n\n const { y: scrollPositionY } = useWindowScroll();\n\n const userIsUnderneathIntersectionObserver = useMemo(() => {\n if (!intersectionObserverObjectRef.current) return false;\n\n return (\n intersectionObserverObjectRef.current.getBoundingClientRect().bottom <\n scrollPositionY\n );\n }, [scrollPositionY]);\n\n /**\n * TODO: Improve the name and logic of this variable and related code.\n * Currently, this variable is used whether ModelCompareV4 has a product list or not.\n * It should only be used if hasProductList is `true`. Why? Because if hasProductList\n * is `false` then selecting/deselecting products isn't possible. The gap between the\n * name of the variable and what it does can be confusing for future devs.\n */\n const defaultSelectedProducts = useMemo(\n () =>\n section.products\n .map((product) => ({ productId: product.id }))\n .slice(\n 0,\n hasProductList\n ? defaultSelectedProductsCount\n : section.products.length,\n ),\n [defaultSelectedProductsCount, hasProductList, section.products],\n );\n /**\n * TODO: rewrite the \"default selected products\" feature so we don't need to use a `useEffect`\n * to update the state of V4. We'll be able to remove this hackie `useRef` as a side-effect.\n */\n const defaultSelectedProductsRef = useRef(defaultSelectedProducts);\n\n const selectedProductsLimit = useMemo(() => {\n return section.products.length < SELECTED_PRODUCTS_LIMIT\n ? section.products.length\n : SELECTED_PRODUCTS_LIMIT;\n }, [section.products.length]);\n\n const [selectedProducts, setSelectedProducts] = useState<SelectedProduct[]>(\n [],\n );\n\n const [hasBeenObserved, setHasBeenObserved] = useState(false);\n\n // #############################################################################\n // Sets selectedProducts value\n // #############################################################################\n\n useEffect(() => {\n defaultSelectedProductsRef.current = defaultSelectedProducts;\n }, [defaultSelectedProducts]);\n\n useEffect(() => {\n setSelectedProducts(\n externalSelectedProducts ||\n (defaultSelectedProductsRef.current as SelectedProduct[]),\n );\n }, [section, externalSelectedProducts]);\n\n // #############################################################################\n // Intersection Observer Logic\n // #############################################################################\n const observerCallback = useCallback<IntersectionObserverCallback>(\n (entries) => {\n entries.forEach(\n (entry) =>\n entry.isIntersecting && !hasBeenObserved && setHasBeenObserved(true),\n );\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [setHasBeenObserved],\n );\n\n useEffect(() => {\n const observer = new IntersectionObserver(observerCallback, {\n threshold: hasProductList ? INTERSECTION_OBSERVER_THRESHOLD : 0,\n });\n\n const intersectionObserverObjectRefCurrent =\n intersectionObserverObjectRef.current;\n\n if (intersectionObserverObjectRefCurrent)\n observer.observe(intersectionObserverObjectRefCurrent);\n\n return () => {\n if (intersectionObserverObjectRefCurrent) {\n observer.unobserve(intersectionObserverObjectRefCurrent);\n observer.disconnect();\n }\n };\n }, [observerCallback, hasProductList]);\n\n const renderDynamicSection = useCallback(\n (match: IProductOption): Section => {\n const { competitorProductId, uniFiProductId, properties } = match;\n\n const unifiProduct = productObjMatcher[uniFiProductId];\n const competitorProduct = productObjMatcher[competitorProductId];\n\n return {\n ...section,\n products: [unifiProduct, competitorProduct],\n properties,\n showBadges: false,\n };\n },\n [section],\n );\n\n const onProductSearchSelect = useCallback(\n (match: IProductOption) => {\n const dynamicSection = renderDynamicSection(match);\n\n if (!dynamicSection) {\n return;\n }\n\n setDynamicMigrationSection(dynamicSection);\n setSelectedProducts(\n dynamicSection.products.map((p) => ({\n productId: p.id as ProductId,\n })),\n );\n },\n [renderDynamicSection],\n );\n\n useEffect(() => {\n if (externalDynamicSection) {\n setDynamicMigrationSection(externalDynamicSection);\n setSelectedProducts(\n externalDynamicSection.products.map((p) => ({\n productId: p.id as ProductId,\n })),\n );\n }\n }, [externalDynamicSection]);\n\n return (\n <S.Container>\n <SideBySide onProductSearchSelect={onProductSearchSelect} />\n\n {!!dynamicMigrationSection && (\n <CompareTable\n headerStickOffset={headerStickOffset}\n overlayTopOffset={overlayTopOffset}\n showBuyButton={showBuyButton}\n onLinkClick={onLinkClick}\n linkToStoreTitleClick={linkToStoreTitleClick}\n additionalProductData={additionalProductData}\n selectedProducts={selectedProducts}\n isMigrationTable={!!isMigrationTable}\n setSelectedProducts={setSelectedProducts}\n setExternalSelectedProducts={setExternalSelectedProducts}\n section={dynamicMigrationSection}\n products={dynamicMigrationSection.products}\n // TODO: rename this property now that `userIsUnderneathIntersectionObserver` has been added\n hasBeenObserved={\n hasBeenObserved || userIsUnderneathIntersectionObserver\n }\n selectedProductsLimit={selectedProductsLimit}\n isOverviewPage={Boolean(section.isOverviewPage)}\n isStaticTable={Boolean(section.isStaticTable)}\n />\n )}\n\n <S.InterSectionObserverObject ref={intersectionObserverObjectRef} />\n </S.Container>\n );\n};\n"],"names":["MODEL_COMPARE_V4_ANCHOR","INTERSECTION_OBSERVER_THRESHOLD","SideBySideCompare","headerStickOffset","overlayTopOffset","showBuyButton","onLinkClick","linkToStoreTitleClick","isMigrationTable","additionalProductData","section","defaultSelectedProductsCount","selectedProducts","externalSelectedProducts","setSelectedProducts","setExternalSelectedProducts","externalDynamicSection","dynamicMigrationSection","setDynamicMigrationSection","useState","hasProductList","useMemo","products","length","isStaticTable","intersectionObserverObjectRef","useRef","y","scrollPositionY","useWindowScroll","userIsUnderneathIntersectionObserver","current","getBoundingClientRect","bottom","defaultSelectedProducts","map","product","productId","id","slice","defaultSelectedProductsRef","selectedProductsLimit","SELECTED_PRODUCTS_LIMIT","hasBeenObserved","setHasBeenObserved","useEffect","observerCallback","useCallback","entries","forEach","entry","isIntersecting","observer","IntersectionObserver","threshold","intersectionObserverObjectRefCurrent","observe","unobserve","disconnect","renderDynamicSection","match","competitorProductId","uniFiProductId","properties","unifiProduct","productObjMatcher","competitorProduct","showBadges","onProductSearchSelect","dynamicSection","p","jsxs","S.Container","children","jsx","SideBySide","CompareTable","isOverviewPage","Boolean","S.InterSectionObserverObject","ref"],"mappings":";;;;;;;;;AAgBO,MAAMA,uBAA0B,GAAA,SAAA;AAEvC,MAAMC,+BAAkC,GAAA,IAAA;AAEjC,MAAMC,oBAAoBA,CAAC;EAChCC,iBAAA;EACAC,gBAAA;EACAC,aAAA;EACAC,WAAA;EACAC,qBA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ACE,YAAA,EAAA;MACCzE,iBAAA;MACAC,gBAAA;MACAC,aAAA;MACAC,WAAA;MACAC,qBAAA;MACAE,qBAAA;MACAG,gBAAA;MACAJ,gBAAA,EAAkB,CAAC,CAACA,gBAAA;MACpBM,mBAAA;MACAC,2BAAA;MACAL,OAAS,EAAAO,uBAAA;MACTK,UAAUL,uBAAwB,CAAAK,QAAA;MAElCqB,iBACEA,eAAmB,IAAAb,oCAAA;MAErBW,qBAAA;MACAoC,cAAA,EAAgBC,OAAQ,CAAApE,OAAA,CAAQmE,cAAc,CAAA;MAC9CrD,aAAA,EAAesD,OAAQ,CAAApE,OAAA,CAAQc,aAAa;IAAA,CAC9C,CAAA,EAGD,eAAAkD,GAAA,CAAAK,0BAAA,EAAA;MAA6BC,KAAKvD;IAA+B,CAAA,CAAA;GACpE,CAAA;AAEJ,CAAA;"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
var v3Image = require("../../../../assets/g5-
|
|
6
|
+
var v3Image = require("../../../../assets/g5-bullet2.jpg");
|
|
7
7
|
function _interopDefault(e) {
|
|
8
8
|
return e && e.__esModule ? e : {
|
|
9
9
|
default: e
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "../../../../assets/g5-
|
|
2
|
-
export { default } from "../../../../assets/g5-
|
|
1
|
+
export * from "../../../../assets/g5-bullet2.jpg";
|
|
2
|
+
export { default } from "../../../../assets/g5-bullet2.jpg";
|
|
3
3
|
//# sourceMappingURL=g5-bullet.jpg.mjs.map
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
var v3Image = require("../../../../assets/ai-
|
|
6
|
+
var v3Image = require("../../../../assets/ai-turret2.jpg");
|
|
7
7
|
function _interopDefault(e) {
|
|
8
8
|
return e && e.__esModule ? e : {
|
|
9
9
|
default: e
|