Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

gifs: Unify GIPHY and Tenor UI.

apoorvapendsed27e621f9e2b
diff --git a/package.json b/package.json
index 9269e7b5f07..3cc887c4016 100644
--- a/package.json
+++ b/package.json
@@ -10,8 +10,6 @@
"@fontsource-variable/open-sans": "^5.0.9",
"@formatjs/intl": "^4.0.7",
"@gfx/zopfli": "^1.0.15",
- "@giphy/js-components": "^5.13.0",
- "@giphy/js-fetch-api": "^5.6.0",
"@koa/bodyparser": "^6.0.0",
"@sentry/browser": "^10.5.0",
"@sentry/core": "^10.5.0",
@@ -101,7 +99,6 @@
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.15.0",
"@formatjs/cli": "^6.0.0",
- "@giphy/js-types": "^5.1.0",
"@types/autosize": "^4.0.1",
"@types/babel__core": "^7.20.5",
"@types/babel__preset-env": "^7.10.0",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 7fa2adb9685..68afa52656a 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -53,12 +53,6 @@ importers:
'@gfx/zopfli':
specifier: ^1.0.15
version: 1.0.15
- '@giphy/js-components':
- specifier: ^5.13.0
- version: 5.13.0(@babel/[email protected])
- '@giphy/js-fetch-api':
- specifier: ^5.6.0
- version: 5.7.0
'@koa/bodyparser':
specifier: ^6.0.0
version: 6.0.0([email protected])
@@ -321,9 +315,6 @@ importers:
'@formatjs/cli':
specifier: ^6.0.0
version: 6.10.0
- '@giphy/js-types':
- specifier: ^5.1.0
- version: 5.1.0
'@types/autosize':
specifier: ^4.0.1
version: 4.0.3
@@ -1634,68 +1625,6 @@ packages:
'@emnapi/[email protected]':
resolution: {integrity: sha512-mehfKSMWjjNol8659Z8KxEMrdSJDDot5SXMq00dM8BN4o+CLNXQ0xH2V7EchNHV4RmbZLmmPdEaXZc5H2FXmDg==}
- '@emotion/[email protected]':
- resolution: {integrity: sha512-pxHCpT2ex+0q+HH91/zsdHkw/lXd468DIN2zvfvLtPKLLMo6gQj7oLObq8PhkrxOZb/gGCq03S3Z7PDhS8pduQ==}
-
- '@emotion/[email protected]':
- resolution: {integrity: sha512-fU2VtSVlHiF27empSbxi1O2JFdNWZO+2NFHfwO0pxgTep6Xa3uGb+3pVKfLww2l/IBGLNEZl5Xf/++A4wAYDYQ==}
-
- '@emotion/[email protected]':
- resolution: {integrity: sha512-L/B1lc/TViYk4DcpGxtAVbx0ZyiKM5ktoIyafGkH6zg/tj+mA+NE//aPYKG0k8kCHSHVJrpLpcAlOBEXQ3SavA==}
-
- '@emotion/[email protected]':
- resolution: {integrity: sha512-S9UjCxSrxEHawOLnWw4upTwfYKb0gVQdatHejn3W9kPyXxmKv3HmjVfJ84kDLmdX8jR20OuDQwaJ4Um24qD9vA==}
- peerDependencies:
- '@babel/core': ^7.0.0
- peerDependenciesMeta:
- '@babel/core':
- optional: true
-
- '@emotion/[email protected]':
- resolution: {integrity: sha512-kBJtf7PH6aWwZ6fka3zQ0p6SBYzx4fl1LoZXE2RrnYST9Xljm7WfKJrU4g/Xr3Beg72MLrp1AWNUmuYJTL7Cow==}
-
- '@emotion/[email protected]':
- resolution: {integrity: sha512-MyqliTZGuOm3+5ZRSaaBGP3USLw6+EGykkwZns2EPC5g8jJ4z9OrdZY9apkl3+UP9+sdz76YYkwCKP5gh8iY3g==}
-
- '@emotion/[email protected]':
- resolution: {integrity: sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw==}
-
- '@emotion/[email protected]':
- resolution: {integrity: sha512-30FAj7/EoJ5mwVPOWhAyCX+FPfMDrVecJAM+Iw9NRoSl4BBAQeqj4cApHHUXOVvIPgLVDsCFoz/hGD+5QQD1GQ==}
-
- '@emotion/[email protected]':
- resolution: {integrity: sha512-G3J4o8by0VRrO+PFeSc3js2myYNOXVJ3Ya+RGVxnshRYgsvErfAOglKAiy1Eo1vhzxqtUvjCyS5gtewzkmvSSg==}
-
- '@emotion/[email protected]':
- resolution: {integrity: sha512-EISGqt7sSNWHGI76hC7x1CksiXPahbxEOrC5RjmFRJTqLyEK9/9hZvBbiYn70dw4wuwMKiEMCUlR6ZXTSWQqxA==}
-
- '@emotion/[email protected]':
- resolution: {integrity: sha512-zM9PFmgVSqBw4zL101Q0HrBVTGmpAxFZH/pYx/cjJT5advXguvcgjHFTCaIO3enL/xr89vK2bh0Mfyj9aa0ANA==}
-
- '@emotion/[email protected]':
- resolution: {integrity: sha512-fTBW9/8r2w3dXWYM4HCB1Rdp8NLibOw2+XELH5m5+AkWiL/KqYX6dc0kKYlaYyKjrQ6ds33MCdMPEwgs2z1rqg==}
-
- '@emotion/[email protected]':
- resolution: {integrity: sha512-h6KtPihKFn3T9fuIrwvXXUOwlx3rfUvfZIcP5a6rh8Y7zjE3O06hT5Ss4S/YI1AYhuZ1kjaE/5EaOOI2NqSylQ==}
-
- '@emotion/[email protected]':
- resolution: {integrity: sha512-dFoMUuQA20zvtVTuxZww6OHoJYgrzfKM1t52mVySDJnMSEa08ruEvdYQbhvyu6soU+NeLVd3yKfTfT0NeV6qGg==}
-
- '@emotion/[email protected]':
- resolution: {integrity: sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==}
-
- '@emotion/[email protected]':
- resolution: {integrity: sha512-0o4l6pZC+hI88+bzuaX/6BgOvQVhbt2PfmxauVaYOGgbsAw14wdKyvMCZXnsnsHys94iadcF+RG/wZyx6+ZZBw==}
-
- '@emotion/[email protected]':
- resolution: {integrity: sha512-3vLclRofFziIa3J2wDh9jjbkUz9qk5Vi3IZ/FSTKViB0k+ef0fPV7dYrUIugbgupYDx7v9ud/SjrtEP8Y4xLoA==}
-
- '@emotion/[email protected]':
- resolution: {integrity: sha512-6U71C2Wp7r5XtFtQzYrW5iKFT67OixrSxjI4MptCHzdSVlgabczzqLe0ZSgnub/5Kp4hSbpDB1tMytZY9pwxxA==}
-
- '@emotion/[email protected]':
- resolution: {integrity: sha512-snKqtPW01tN0ui7yu9rGv69aJXr/a/Ywvl11sUjNtEcRc+ng/mQriFL0wLXMef74iHa/EkftbDzU9F8iFbH+zg==}
-
'@esbuild/[email protected]':
resolution: {integrity: sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==}
engines: {node: '>=18'}
@@ -2006,24 +1935,6 @@ packages:
resolution: {integrity: sha512-7mBgpi7UD82fsff5ThQKet0uBTl4BYerQuc+/qA1ELTwWEiIedRTcD3JgiUu9wwZ2kytW8JOb165rSdAt8PfcQ==}
engines: {node: '>= 8'}
- '@giphy/[email protected]':
- resolution: {integrity: sha512-jBZG6OqyMWB6meLi8Sz3iLplXYnhkbj+DJhS4ChmRX8Y6UA7i5dbbsUN/So1s7tTjhZOvu0rxA6rWJE73S1FvQ==}
-
- '@giphy/[email protected]':
- resolution: {integrity: sha512-NF1Man9gDXn/gSf/Yx896EnvBFZAZ5n69OgJJHiDnztvQ9HpVtaOAjLtMfdzgZYBoSkpTlq/+zgNJWQ/hz8uug==}
-
- '@giphy/[email protected]':
- resolution: {integrity: sha512-Ca1f9CtxHLyVsUrSlVap+jLKzesO4Pbf8V42V7c60PPg6EeoKWZUsKGRitKcTW/JDI+V29ZzbDEJ79G1yum47A==}
-
- '@giphy/[email protected]':
- resolution: {integrity: sha512-5W8j7QUEnWRhW2KKlRhwHNCz0HwUeW0SlFryKFrqzE5XB8kjoAwZ2GvwtLNnkpjN0cniLE+bSGAzMKcL5Bt5Vg==}
-
- '@giphy/[email protected]':
- resolution: {integrity: sha512-BZYCDtYNRR7cUWkbDLB4wmm3qmWMsVCQdUiBNOfmZ3yAazCgygKJoDI/5Rq4CK5MBaOc5LVdF8viC2WtoBdaPA==}
-
- '@giphy/[email protected]':
- resolution: {integrity: sha512-Qt7pGh2cqiNmXLeWAgb459wK8+BuMLtIxTfg4ZksnPHPsLthiHT9hhzs2QhqUh7Pp/HOq+Cbv2etGDfnq+xiKA==}
-
resolution: {integrity: sha512-Waj1cwPXJDucOib4a3bAISsKJVb15MKi9IvmTI/7ssVEm6sywXGjVJDhl6/umt1pK1ZS7PacXU3A1PmFKHEZ2w==}
@@ -2917,9 +2828,6 @@ packages:
resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==}
- '@types/[email protected]':
- resolution: {integrity: sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==}
-
resolution: {integrity: sha512-j3pOPiEcWZ34R6a6mN07mUkM4o4Lwf6hPNt8eilOeZhTFbxFXmKhvXl9Y28jotFPaI1bpPDJsbCprUoNke6OrA==}
@@ -3352,9 +3260,6 @@ packages:
resolution: {integrity: sha512-WLbYiXzD3y/ATLZFufV/rZvWdZOs+Z/+5v1rBZ463Jn398pa6kcde27cvozYnBoxXblGZTFfoPpsaEw0orU5BA==}
engines: {node: '>=0.10.0'}
- resolution: {integrity: sha512-adm0E8o1o7ay+HbkWvGIpNNeciLB/rxJ0heThHuzSSVq5zcdQ5/ZubFnUoY0imFmk6gZVghSpwoubLVtwi9EHQ==}
-
resolution: {integrity: sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==}
engines: {node: '>=8'}
@@ -3527,9 +3432,6 @@ packages:
'@babel/core': ^7.12.0
webpack: '>=5.61.0'
- resolution: {integrity: sha512-SMSkGoqTbTyUTDeuVuPIWifPdUGkTk1Kf9BWRiXIOIcuyMfsdp2EjeiiFvOzX8NOBvEh/ypKYvUh2rkgAJMCLA==}
-
resolution: {integrity: sha512-rYOry7SVSTXn8ECjlsP3oW0mG0jplKPDvwFGQkWOjuPzvTrLrEaYGJhc2eo8sWP5djODT1oTewwiiHTjA0xXbA==}
@@ -3537,13 +3439,6 @@ packages:
resolution: {integrity: sha512-D8Z6Qm8jCvVXtIRkBnqNHX0zJ37rQcFJ9u8WOS6tkYOsRdHBzypCstaxWiu5ZIlqQtviRYbgnRLSoCEvjqcqbA==}
engines: {node: '>=12'}
- resolution: {integrity: sha512-SEP5kJpfGYqYKpBrj5XU3ahw5p5GOHJ0U5ssOSQ/WBVdwkD2Dzlce95exQTs3jOVWPPKLBN2rlEWkCK7dSmLvg==}
-
- resolution: {integrity: sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg==}
- engines: {node: '>=10', npm: '>=6'}
-
resolution: {integrity: sha512-Co2Y9wX854ts6U8gAAPXfn0GmAyctHuK8n0Yhfjd6t30g7yvKjspvvOo9yG+z52PZRgFErt7Ka2pYnXCjLKEpg==}
peerDependencies:
@@ -3559,9 +3454,6 @@ packages:
peerDependencies:
'@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0
- resolution: {integrity: sha512-qrPaCSo9c8RHNRHIotaufGbuOBN8rtdC4QrrFFc43vyWCCz7Kl7GL1PGaXtMGQZUXrkCjNEgxDfmAuAabr/rlw==}
-
resolution: {integrity: sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==}
@@ -3694,9 +3586,6 @@ packages:
resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==}
engines: {node: '>=8'}
- resolution: {integrity: sha512-XJsIGxoixpMDo/KoLXR+uQizFVGWNAQy1lLoIwXKxm6/Zpd9QQLSUd0otybbK7wjqX23ZvCXFxnIw+uCXJHo0A==}
-
resolution: {integrity: sha512-+KteEIVlrE2eJOmtteWhcs3wYKjbFd9fVPzPlj4VGggKMyf9orf+zjmlNt91ekInZ2zqox5ArEZD/tKXDj0v9Q==}
engines: {node: '>=14.0.0'}
@@ -4098,14 +3987,6 @@ packages:
resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==}
- resolution: {integrity: sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==}
- engines: {node: '>=8'}
-
- resolution: {integrity: sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==}
- engines: {node: '>=10'}
-
resolution: {integrity: sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==}
engines: {node: '>=14'}
@@ -4118,9 +3999,6 @@ packages:
resolution: {integrity: sha512-iSPlClZP8vX7MC3/u6s3lrDuoQyhQukh5LyABJ3hvfzbQ3Yyayd4fp04zjLnfi267B/B2FkumcWWgrbban7sSA==}
- resolution: {integrity: sha512-fIK73w82HPPn/RsAij7+Zt8eCE8SptcJ3WoRMfxMtjteYxud8GDTKKld7MYwAX2TVhrw29uR1N/bVGxeStHILg==}
-
resolution: {integrity: sha512-nhymn9GdnV3CqiEHJVai54TULFAE3VshJTXSqSJKa8yXAKyBKDWdhHarnlIPrshJ0WMFTGuFvG02YjLXfPiuOA==}
@@ -4278,12 +4156,6 @@ packages:
resolution: {integrity: sha512-7D2EPVltRrsTkhpQmksIu+LxeWAIEk6wRDMJ1qljlv+CKHJM+cJLlfhWIzNA44eAsHXSNe3+vO6DW1yCYx8SuQ==}
engines: {node: '>=20'}
- resolution: {integrity: sha512-Z1PhmomIfypOpoMjRQB70jfvy/wxT50qW08YXO5lMIJkrdq4yOTR+AW7FqutScmB9NkLwxo+jU+kZLbofZZq/w==}
-
- resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==}
-
resolution: {integrity: sha512-wT5Y7mO8abrV16gnssKdmIhIbA9wSkeMzhh27jAguKrV82i24wER0vL5TGhUJ9dbJNDcigoRZ0IAHFEEEI4THQ==}
@@ -4642,9 +4514,6 @@ packages:
resolution: {integrity: sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==}
engines: {node: '>= 4'}
- resolution: {integrity: sha512-2xdDzdWWzue8R8lu4G76uWX5WhyQuzATon9LmNeCy/2BHVC6dsEpfhN1a0qhELgtDVdjyEA6J8Y/VlI5ZnaH0g==}
-
resolution: {integrity: sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==}
engines: {node: '>= 0.8'}
@@ -5817,10 +5686,6 @@ packages:
resolution: {integrity: sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==}
engines: {node: '>=10.13.0'}
- resolution: {integrity: sha512-KZArj2QVnmdud9zTpKf279m2bbGfG+4/kn16UU0NL3pTVl52ZHiJ9IRNSsnn6jaHrL9EGLFM5eWjTx2fz/+zoQ==}
- deprecated: The Intersection Observer polyfill is no longer needed and can safely be removed. Intersection Observer has been Baseline since 2019.
-
resolution: {integrity: sha512-xA4aCCMnCxynKV5kI7V0GlMf+BGJxsXQRwr5tfEgmcB791eDEQa4r+s4wU7GqMR0jx7+K4jyEH2UfBpVGTDNPQ==}
@@ -6316,9 +6181,6 @@ packages:
resolution: {integrity: sha512-dhG34DXATL5hSxJbIexCft8FChFXtmskoZYnoPWjXQuebWYCNkVeV3KkGegCK9CP1oswI/vQibS2GY7Em/sJJA==}
engines: {node: '>= 8'}
- resolution: {integrity: sha512-ptGtvTrgLNtQj9ilUR+tSyHWTCPp2xu/EHkeo3OvpczzNqBSwjQKz8G7vUhzlRbasXVULBWSejsj6QRQb1pakw==}
-
resolution: {integrity: sha512-JCDrsP4Z1Sb9JwG0aJ8Eo2r7k4Ou5MwmThS/6lcIe1ICyb7UBJKGRIUUdqc2ASdE/42lgz6zFUnzAIhtXnBVrQ==}
@@ -7804,9 +7666,6 @@ packages:
resolution: {integrity: sha512-lbteaWGzGHdlIuiJ0l2Jq454m6kcpI1zNje6d8MlGAFlYvP2GO4ibnat7P74Esfz4sPTdM6UxtTwh/d3pwM9JA==}
- resolution: {integrity: sha512-uVLeEAyRsCkUEFhVHlOu17OxcrwC7+hTGZ08kBoLBiGHiZooUZuibQnphgMKftw/rqYntNMyhVCPqQhcyAGHag==}
-
resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==}
engines: {node: '>= 0.8.0'}
@@ -8664,10 +8523,6 @@ packages:
resolution: {integrity: sha512-MjZkVp0NHr5+TPihLcadqnlVoGIoWo4IBHptutGh9wI3ttUYvCG26HkSuDi+K6lsZ25syXJXcctwgyVCt//xqA==}
engines: {node: '>=0.10.0'}
- resolution: {integrity: sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==}
- engines: {node: '>=0.10.0'}
-
resolution: {integrity: sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==}
engines: {node: '>= 12'}
@@ -8860,9 +8715,6 @@ packages:
engines: {node: '>=18.12.0'}
hasBin: true
- resolution: {integrity: sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==}
-
resolution: {integrity: sha512-KvC8OPjzdNOe+xQ4XWJV2whQA0aM1kGVczMQ8+dStAO6KfEB140JEVQ9dE76ONZ0/Ylf67ni4tILPJB41U0eow==}
@@ -9004,10 +8856,6 @@ packages:
peerDependencies:
tslib: ^2
- resolution: {integrity: sha512-dTEWWNu6JmeVXY0ZYoPuH5cRIwc0MeGbJwah9KUNYSJwommQpCzTySTpEe8Gs1J23aeWEuAobe4Ag7EHVt/LOg==}
- engines: {node: '>=10'}
-
resolution: {integrity: sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA==}
@@ -9503,10 +9351,6 @@ packages:
resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==}
hasBin: true
- resolution: {integrity: sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==}
- hasBin: true
-
resolution: {integrity: sha512-+g8ENReyr8YsOc6fv/NVJs2vFdHBnBNdfE49rshrTzDWOlUx4Gq7KOS2GD8eqhy2j+Ejq29+SbKH8yjkAqXqoA==}
engines: {node: '>=8'}
@@ -9979,10 +9823,6 @@ packages:
resolution: {integrity: sha512-9F3myNmJzUN/679jycdMxqtydPSDRAarSj3wPiF7pchEPnO9Dg07Oc+gIYLqXR4L+g+FSEVXXv2+mr54StLFOg==}
hasBin: true
- resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==}
- engines: {node: '>= 6'}
-
resolution: {integrity: sha512-10ULxpnOCQXxJvBgxsn9ptjq6uviG/htZKk9veJGhlqn3w/DxQ631zFF+nlQXLwmImeS5amR2dl2U8sg6U9jsQ==}
engines: {node: '>= 14'}
@@ -11322,91 +11162,6 @@ snapshots:
tslib: 2.8.1
optional: true
- '@emotion/[email protected]':
- dependencies:
- '@babel/helper-module-imports': 7.28.6
- '@babel/runtime': 7.28.6
- '@emotion/hash': 0.9.2
- '@emotion/memoize': 0.9.0
- '@emotion/serialize': 1.3.3
- babel-plugin-macros: 3.1.0
- convert-source-map: 1.9.0
- escape-string-regexp: 4.0.0
- find-root: 1.1.0
- source-map: 0.5.7
- stylis: 4.2.0
- transitivePeerDependencies:
- - supports-color
-
- '@emotion/[email protected]':
- dependencies:
- '@emotion/sheet': 0.9.4
- '@emotion/stylis': 0.8.5
- '@emotion/utils': 0.11.3
- '@emotion/weak-memoize': 0.2.5
-
- '@emotion/[email protected]':
- dependencies:
- '@emotion/memoize': 0.9.0
- '@emotion/sheet': 1.4.0
- '@emotion/utils': 1.4.2
- '@emotion/weak-memoize': 0.4.0
- stylis: 4.2.0
-
- dependencies:
- '@emotion/babel-plugin': 11.13.5
- '@emotion/cache': 11.14.0
- '@emotion/serialize': 1.3.3
- '@emotion/sheet': 1.4.0
- '@emotion/utils': 1.4.2
- optionalDependencies:
- '@babel/core': 7.28.6
- transitivePeerDependencies:
- - supports-color
-
- '@emotion/[email protected]': {}
-
- '@emotion/[email protected]': {}
-
- '@emotion/[email protected]': {}
-
- '@emotion/[email protected]': {}
-
- '@emotion/[email protected]':
- dependencies:
- '@emotion/hash': 0.8.0
- '@emotion/memoize': 0.7.4
- '@emotion/unitless': 0.7.5
- '@emotion/utils': 0.11.3
- csstype: 2.6.21
-
- '@emotion/[email protected]':
- dependencies:
- '@emotion/hash': 0.9.2
- '@emotion/memoize': 0.9.0
- '@emotion/unitless': 0.10.0
- '@emotion/utils': 1.4.2
- csstype: 3.2.3
-
- '@emotion/[email protected]': {}
-
- '@emotion/[email protected]': {}
-
- '@emotion/[email protected]': {}
-
- '@emotion/[email protected]': {}
-
- '@emotion/[email protected]': {}
-
- '@emotion/[email protected]': {}
-
- '@emotion/[email protected]': {}
-
- '@emotion/[email protected]': {}
-
- '@emotion/[email protected]': {}
-
'@esbuild/[email protected]':
optional: true
@@ -11650,47 +11405,6 @@ snapshots:
dependencies:
base64-js: 1.5.1
- '@giphy/[email protected]':
- dependencies:
- '@giphy/js-types': 5.1.0
- '@giphy/js-util': 5.2.0
- append-query: 2.1.1
- throttle-debounce: 3.0.1
-
- '@giphy/[email protected]':
- dependencies:
- emotion: 10.0.27
- transitivePeerDependencies:
- - supports-color
-
- dependencies:
- '@emotion/css': 11.9.0(@babel/[email protected])
- '@giphy/js-analytics': 5.0.0
- '@giphy/js-brand': 3.0.0
- '@giphy/js-fetch-api': 5.7.0
- '@giphy/js-types': 5.1.0
- '@giphy/js-util': 5.2.0
- bricks.js: 1.8.0
- intersection-observer: 0.11.0
- preact: 10.4.8
- throttle-debounce: 3.0.1
- transitivePeerDependencies:
- - '@babel/core'
- - supports-color
-
- '@giphy/[email protected]':
- dependencies:
- '@giphy/js-types': 5.1.0
- '@giphy/js-util': 5.2.0
-
- '@giphy/[email protected]': {}
-
- '@giphy/[email protected]':
- dependencies:
- '@giphy/js-types': 5.1.0
- uuid: 9.0.1
-
'@hapi/[email protected]': {}
'@humanfs/[email protected]': {}
@@ -12699,8 +12413,6 @@ snapshots:
'@types/[email protected]': {}
- '@types/[email protected]': {}
-
'@types/[email protected]': {}
'@types/[email protected]': {}
@@ -13228,10 +12940,6 @@ snapshots:
dependencies:
buffer-equal: 1.0.1
- dependencies:
- extend: 3.0.2
-
dependencies:
default-require-extensions: 3.0.1
@@ -13505,21 +13213,6 @@ snapshots:
find-up: 5.0.0
- dependencies:
- '@babel/helper-module-imports': 7.28.6
- '@emotion/hash': 0.8.0
- '@emotion/memoize': 0.7.4
- '@emotion/serialize': 0.11.16
- babel-plugin-macros: 2.8.0
- babel-plugin-syntax-jsx: 6.18.0
- convert-source-map: 1.9.0
- escape-string-regexp: 1.0.5
- find-root: 1.1.0
- source-map: 0.5.7
- transitivePeerDependencies:
- - supports-color
-
dependencies:
'@babel/core': 7.28.6
@@ -13547,18 +13240,6 @@ snapshots:
transitivePeerDependencies:
- supports-color
- dependencies:
- '@babel/runtime': 7.28.6
- cosmiconfig: 6.0.0
- resolve: 1.22.11
-
- dependencies:
- '@babel/runtime': 7.28.6
- cosmiconfig: 7.1.0
- resolve: 1.22.11
-
dependencies:
'@babel/compat-data': 7.28.6
@@ -13583,8 +13264,6 @@ snapshots:
transitivePeerDependencies:
- supports-color
-
@@ -13725,10 +13404,6 @@ snapshots:
dependencies:
fill-range: 7.1.1
- dependencies:
- knot.js: 1.1.5
-
dependencies:
argue-cli: 2.1.0
@@ -14142,22 +13817,6 @@ snapshots:
- dependencies:
- '@types/parse-json': 4.0.2
- import-fresh: 3.3.1
- parse-json: 5.2.0
- path-type: 4.0.0
- yaml: 1.10.2
-
- dependencies:
- '@types/parse-json': 4.0.2
- import-fresh: 3.3.1
- parse-json: 5.2.0
- path-type: 4.0.0
- yaml: 1.10.2
-
dependencies:
env-paths: 2.2.1
@@ -14169,13 +13828,6 @@ snapshots:
- dependencies:
- '@emotion/cache': 10.0.29
- '@emotion/serialize': 0.11.16
- '@emotion/sheet': 0.9.4
- '@emotion/utils': 0.11.3
-
@@ -14352,10 +14004,6 @@ snapshots:
css-tree: 3.1.0
lru-cache: 11.2.4
-
-
@@ -14683,13 +14331,6 @@ snapshots:
- dependencies:
- babel-plugin-emotion: 10.2.2
- create-emotion: 10.0.27
- transitivePeerDependencies:
- - supports-color
-
@@ -16348,8 +15989,6 @@ snapshots:
-
dependencies:
'@formatjs/ecma402-abstract': 3.0.8
@@ -16818,8 +16457,6 @@ snapshots:
-
@@ -18832,8 +18469,6 @@ snapshots:
-
@@ -20329,8 +19964,6 @@ snapshots:
-
@@ -20596,8 +20229,6 @@ snapshots:
- supports-color
- typescript
-
dependencies:
s.color: 0.0.15
@@ -20771,8 +20402,6 @@ snapshots:
dependencies:
tslib: 2.8.1
-
dependencies:
through2: 2.0.5
@@ -21266,8 +20895,6 @@ snapshots:
-
dependencies:
dequal: 2.0.3
@@ -21837,8 +21464,6 @@ snapshots:
vscode-uri: 3.1.0
yaml: 2.7.1
-
diff --git a/tools/test-js-with-node b/tools/test-js-with-node
index 621a270cc98..78145a33b52 100755
--- a/tools/test-js-with-node
+++ b/tools/test-js-with-node
@@ -120,8 +120,9 @@ EXEMPT_FILES = make_set(
"web/src/flatpickr.ts",
"web/src/gear_menu.ts",
"web/src/gif_picker_popover_content.ts",
+ "web/src/gif_picker_ui.ts",
"web/src/gif_state.ts",
- "web/src/giphy.ts",
+ "web/src/giphy_network.ts",
"web/src/global.ts",
"web/src/group_permission_settings.ts",
"web/src/group_setting_pill.ts",
@@ -275,7 +276,6 @@ EXEMPT_FILES = make_set(
"web/src/stream_ui_updates.ts",
"web/src/submessage.ts",
"web/src/subscriber_api.ts",
- "web/src/tenor.ts",
"web/src/tenor_network.ts",
"web/src/theme.ts",
"web/src/thumbnail.ts",
diff --git a/web/src/gif_picker_popover_content.ts b/web/src/gif_picker_popover_content.ts
index 1a8f11cdf31..ced2b679c2e 100644
--- a/web/src/gif_picker_popover_content.ts
+++ b/web/src/gif_picker_popover_content.ts
@@ -10,12 +10,6 @@ export function get_gif_popover_content(is_giphy: boolean): HTMLElement {
const $picker = $(render_gif_picker_ui());
if (is_giphy) {
$picker.find("#gif-search-query").attr("placeholder", $t({defaultMessage: "Filter"}));
- // We need a container we can replace
- // without removing the simplebar wrappers.
- // We replace the `giphy-content`/`tenor-content` when
- // searching for GIFs.
- const $giphy_content = $("<div>").addClass("giphy-content");
- $picker.find(".gif-scrolling-container").append($giphy_content);
// We are required to include the
// "Powered By GIPHY" banner, which isn't mandatory
@@ -24,8 +18,6 @@ export function get_gif_popover_content(is_giphy: boolean): HTMLElement {
$picker.find(".popover-inner").append($(render_giphy_footer()));
} else {
$picker.find("#gif-search-query").attr("placeholder", $t({defaultMessage: "Search Tenor"}));
- const $tenor_content = $("<div>").addClass("tenor-content");
- $picker.find(".gif-scrolling-container").append($tenor_content);
}
return the<HTMLElement>($picker);
}
diff --git a/web/src/tenor.ts b/web/src/gif_picker_ui.ts
similarity index 89%
rename from web/src/tenor.ts
rename to web/src/gif_picker_ui.ts
index f8cba81d4a8..caae603b06c 100644
--- a/web/src/tenor.ts
+++ b/web/src/gif_picker_ui.ts
@@ -8,6 +8,7 @@ import render_gif_picker_gif from "../templates/gif_picker_gif.hbs";
import type {GifInfoUrl, GifNetwork} from "./abstract_gif_network.ts";
import {ComposeIconSession} from "./compose_icon_session.ts";
import * as gif_picker_popover_content from "./gif_picker_popover_content.ts";
+import * as giphy_network from "./giphy_network.ts";
import * as popover_menus from "./popover_menus.ts";
import * as scroll_util from "./scroll_util.ts";
import * as tenor_network from "./tenor_network.ts";
@@ -19,6 +20,7 @@ let current_search_term: undefined | string;
// Stores the index of the last GIF that is part of the grid.
let last_gif_index = -1;
let network: GifNetwork;
+let provider: "tenor" | "giphy";
function is_editing_existing_message(): boolean {
if (compose_icon_session === undefined) {
@@ -128,10 +130,10 @@ function render_gifs_to_grid(urls: GifInfoUrl[], next_page: boolean): void {
}
const $popper = $(popover_instance.popper);
if (next_page) {
- $popper.find(".tenor-content").append($(gif_grid_html));
+ $popper.find(".gif-picker-content").append($(gif_grid_html));
} else {
$popper.find(".gif-scrolling-container .simplebar-content-wrapper").scrollTop(0);
- $popper.find(".tenor-content").html(gif_grid_html);
+ $popper.find(".gif-picker-content").html(gif_grid_html);
}
}
@@ -171,8 +173,14 @@ function toggle_picker_popover(target: HTMLElement): void {
theme: "popover-menu",
placement: "top",
onCreate(instance) {
- instance.setContent(gif_picker_popover_content.get_gif_popover_content(false));
- $(instance.popper).addClass("tenor-popover");
+ instance.setContent(
+ gif_picker_popover_content.get_gif_popover_content(provider === "giphy"),
+ );
+ if (provider === "tenor") {
+ $(instance.popper).addClass("tenor-popover");
+ } else {
+ $(instance.popper).addClass("giphy-popover");
+ }
},
onShow(instance) {
popover_instance = instance;
@@ -242,6 +250,7 @@ function register_click_handlers(): void {
".compose_control_button.compose-gif-icon-tenor",
function (this: HTMLElement) {
compose_icon_session = new ComposeIconSession(this);
+ provider = "tenor";
if (network) {
network.abandon();
}
@@ -249,6 +258,20 @@ function register_click_handlers(): void {
toggle_picker_popover(this);
},
);
+
+ $("body").on(
+ "click",
+ ".compose_control_button.compose-gif-icon-giphy",
+ function (this: HTMLElement) {
+ compose_icon_session = new ComposeIconSession(this);
+ provider = "giphy";
+ if (network) {
+ network.abandon();
+ }
+ network = new giphy_network.GiphyNetwork();
+ toggle_picker_popover(this);
+ },
+ );
}
export function initialize(): void {
diff --git a/web/src/giphy.ts b/web/src/giphy.ts
deleted file mode 100644
index 4cbe9088d69..00000000000
--- a/web/src/giphy.ts
+++ /dev/null
@@ -1,210 +0,0 @@
-import type {GifsResult, GiphyFetch} from "@giphy/js-fetch-api";
-import type {IGif} from "@giphy/js-types";
-import $ from "jquery";
-import _ from "lodash";
-import assert from "minimalistic-assert";
-import type * as tippy from "tippy.js";
-
-import * as compose_ui from "./compose_ui.ts";
-import * as gif_picker_popover_content from "./gif_picker_popover_content.ts";
-import * as gif_state from "./gif_state.ts";
-import * as popover_menus from "./popover_menus.ts";
-import * as rows from "./rows.ts";
-import {realm} from "./state_data.ts";
-import * as ui_util from "./ui_util.ts";
-import {the} from "./util.ts";
-
-let giphy_fetch: GiphyFetch | undefined;
-let search_term = "";
-let gifs_grid: {remove: () => void} | undefined;
-let giphy_popover_instance: tippy.Instance | undefined;
-
-// Only used if popover called from edit message, otherwise it is `undefined`.
-let edit_message_id: number | undefined;
-
-export function is_popped_from_edit_message(): boolean {
- return giphy_popover_instance !== undefined && edit_message_id !== undefined;
-}
-
-export function focus_current_edit_message(): void {
- assert(edit_message_id !== undefined);
- $(`#edit_form_${CSS.escape(`${edit_message_id}`)} .message_edit_content`).trigger("focus");
-}
-
-async function renderGIPHYGrid(targetEl: HTMLElement): Promise<{remove: () => void}> {
- const {renderGrid} = await import(/* webpackChunkName: "giphy-sdk" */ "@giphy/js-components");
- const {GiphyFetch} = await import(/* webpackChunkName: "giphy-sdk" */ "@giphy/js-fetch-api");
-
- giphy_fetch ??= new GiphyFetch(realm.giphy_api_key);
-
- async function fetchGifs(offset: number): Promise<GifsResult> {
- assert(giphy_fetch !== undefined);
- const config = {
- offset,
- limit: 25,
- rating: gif_state.get_rating(),
- // We don't pass random_id here, for privacy reasons.
- };
- if (search_term === "") {
- // Get the trending gifs by default.
- return giphy_fetch.trending(config);
- }
- return giphy_fetch.search(search_term, config);
- }
-
- const render = (): (() => void) =>
- // See https://github.com/Giphy/giphy-js/blob/master/packages/components/README.md#grid
- // for detailed documentation.
- renderGrid(
- {
- width: 300,
- fetchGifs,
- columns: 3,
- gutter: 6,
- noLink: true,
- // Hide the creator attribution that appears over a
- // GIF; nice in principle but too distracting.
- hideAttribution: true,
- onGifClick(props: IGif) {
- let $textarea = $<HTMLTextAreaElement>("textarea#compose-textarea");
- if (edit_message_id !== undefined) {
- $textarea = $(
- `#edit_form_${CSS.escape(`${edit_message_id}`)} .message_edit_content`,
- );
- }
-
- compose_ui.insert_syntax_and_focus(
- `[](${props.images.downsized_medium.url})`,
- $textarea,
- "block",
- 1,
- );
- hide_giphy_popover();
- },
- },
- targetEl,
- );
-
- // Limit the rate at which we do queries to the GIPHY API to
- // one per 300ms, in line with animation timing, basically to avoid
- // content appearing while the user is typing.
- const resizeRender = _.throttle(render, 300);
- window.addEventListener("resize", resizeRender, false);
- const remove = render();
- return {
- remove() {
- remove();
- window.removeEventListener("resize", resizeRender, false);
- },
- };
-}
-
-async function update_grid_with_search_term(): Promise<void> {
- if (!gifs_grid) {
- return;
- }
-
- const $search_elem = $<HTMLInputElement>("input#gif-search-query");
- // GIPHY popover may have been hidden by the
- // time this function is called.
- if ($search_elem.length > 0) {
- search_term = the($search_elem).value;
- gifs_grid.remove();
- gifs_grid = await renderGIPHYGrid(the($(".gif-grid-in-popover .giphy-content")));
- return;
- }
-
- // Set to undefined to stop searching.
- gifs_grid = undefined;
-}
-
-export function hide_giphy_popover(): boolean {
- // Returns `true` if the popover was open.
- if (giphy_popover_instance) {
- giphy_popover_instance.destroy();
- giphy_popover_instance = undefined;
- edit_message_id = undefined;
- gifs_grid = undefined;
- return true;
- }
- return false;
-}
-
-function toggle_giphy_popover(target: HTMLElement): void {
- popover_menus.toggle_popover_menu(
- target,
- {
- theme: "popover-menu",
- placement: "top",
- onCreate(instance) {
- instance.setContent(gif_picker_popover_content.get_gif_popover_content(true));
- $(instance.popper).addClass("giphy-popover");
- },
- onShow(instance) {
- giphy_popover_instance = instance;
- const $popper = $(giphy_popover_instance.popper).trigger("focus");
-
- const $click_target = $(instance.reference);
- if ($click_target.parents(".message_edit_form").length === 1) {
- // Store message id in global variable edit_message_id so that
- // its value can be further used to correctly find the message textarea element.
- edit_message_id = rows.id($click_target.parents(".message_row"));
- } else {
- edit_message_id = undefined;
- }
-
- $(document).one("compose_canceled.zulip compose_finished.zulip", () => {
- hide_giphy_popover();
- });
-
- $popper.on(
- "keyup",
- "#gif-search-query",
- // Use debounce to create a 300ms interval between
- // every search. This makes the UX of searching pleasant
- // by allowing user to finish typing before search
- // is executed.
- _.debounce(() => void update_grid_with_search_term(), 300),
- );
-
- $popper.on("keydown", ".giphy-gif", ui_util.convert_enter_to_click);
- $popper.on("keydown", ".compose-gif-icon-giphy", ui_util.convert_enter_to_click);
- $popper.on("click", "#gif-search-clear", (e) => {
- e.stopPropagation();
- $("#gif-search-query").val("");
- void update_grid_with_search_term();
- });
-
- void (async () => {
- gifs_grid = await renderGIPHYGrid(the($popper.find(".giphy-content")));
-
- // Focus on search box by default.
- // This is specially helpful for users
- // navigating via keyboard.
- $("#gif-search-query").trigger("focus");
- })();
- },
- onHidden() {
- hide_giphy_popover();
- },
- },
- {
- show_as_overlay_on_mobile: true,
- show_as_overlay_always: false,
- },
- );
-}
-
-function register_click_handlers(): void {
- $("body").on(
- "click",
- ".compose_control_button.compose-gif-icon-giphy",
- function (this: HTMLElement) {
- toggle_giphy_popover(this);
- },
- );
-}
-
-export function initialize(): void {
- register_click_handlers();
-}
diff --git a/web/src/giphy_network.ts b/web/src/giphy_network.ts
new file mode 100644
index 00000000000..7ae50f33402
--- /dev/null
+++ b/web/src/giphy_network.ts
@@ -0,0 +1,128 @@
+import assert from "minimalistic-assert";
+import * as z from "zod/mini";
+
+import {type GifInfoUrl, GifNetwork, type RenderGifsCallback} from "./abstract_gif_network.ts";
+import * as channel from "./channel.ts";
+import {get_rating} from "./gif_state.ts";
+import {realm} from "./state_data.ts";
+import {user_settings} from "./user_settings.ts";
+
+const BASE_URL = "https://api.giphy.com/v1/gifs";
+// Source: https://developers.giphy.com/docs/api/endpoint
+export type GiphyPayload = {
+ api_key: string;
+ limit: number;
+ offset: number;
+ rating: string;
+ // Lets us reduce the response payload size by only requesting what we need.
+ // We could have used in a `bundle` field, but that gives us more image objects than we need.
+ // Source: https://developers.giphy.com/docs/optional-settings/#fields-on-demand
+ fields: string;
+ q?: string;
+ // only used in the search endpoint.
+ lang?: string;
+};
+
+const giphy_result_schema = z.object({
+ data: z.array(
+ z.object({
+ images: z.object({
+ downsized_medium: z.object({
+ url: z.url(),
+ }),
+ fixed_height: z.object({
+ url: z.url(),
+ }),
+ }),
+ }),
+ ),
+ pagination: z.object({
+ total_count: z.number(),
+ count: z.number(),
+ offset: z.number(),
+ }),
+});
+
+export class GiphyNetwork extends GifNetwork {
+ static LIMIT = 15;
+ is_loading_more = false;
+ next_pos_identifier = 0;
+ abandoned = false;
+ is_loading_more_gifs(): boolean {
+ return this.is_loading_more;
+ }
+
+ abandon(): void {
+ this.abandoned = true;
+ }
+
+ ask_for_default_gifs(next_page: boolean, render_gifs_callback: RenderGifsCallback): void {
+ assert(!this.abandoned);
+ // We use "default" generically here in anticipation of
+ // tenor default == featured
+ // giphy default == trending
+ const data = get_base_payload();
+ this.ask_for_gifs(`${BASE_URL}/trending`, data, next_page, render_gifs_callback);
+ }
+
+ ask_for_search_gifs(
+ search_term: string,
+ next_page: boolean,
+ render_gifs_callback: RenderGifsCallback,
+ ): void {
+ assert(!this.abandoned);
+ const data: GiphyPayload = {
+ q: search_term,
+ lang: user_settings.default_language,
+ ...get_base_payload(),
+ };
+
+ this.ask_for_gifs(`${BASE_URL}/search`, data, next_page, render_gifs_callback);
+ }
+
+ ask_for_gifs(
+ url: string,
+ data: GiphyPayload,
+ next_page = false,
+ render_gifs_callback: RenderGifsCallback,
+ ): void {
+ assert(!this.abandoned);
+ if (next_page) {
+ this.is_loading_more = true;
+ data = {...data, offset: this.next_pos_identifier};
+ }
+ void channel.get({
+ url,
+ data,
+ success: (raw_tenor_result) => {
+ // We don't want to have this code run after the caller
+ // abandons its network object, to avoid all sorts of weird
+ // bugs.
+ if (this.abandoned) {
+ return;
+ }
+ const parsed_data = giphy_result_schema.parse(raw_tenor_result);
+ const urls: GifInfoUrl[] = parsed_data.data.map((result) => ({
+ preview_url: result.images.fixed_height.url,
+ insert_url: result.images.downsized_medium.url,
+ }));
+ this.next_pos_identifier = parsed_data.pagination.offset + GiphyNetwork.LIMIT;
+ this.is_loading_more = false;
+ render_gifs_callback(urls, next_page);
+ },
+ });
+ }
+}
+
+function get_base_payload(): GiphyPayload {
+ return {
+ api_key: realm.giphy_api_key,
+ limit: GiphyNetwork.LIMIT,
+ rating: get_rating(),
+ offset: 0,
+ // Source: https://developers.giphy.com/docs/api/schema#image-object
+ // We will use the `downsized_medium` version for sending and `fixed_height` for
+ // preview in the GIF picker.
+ fields: "images.downsized_medium,images.fixed_height",
+ };
+}
diff --git a/web/src/hotkey.ts b/web/src/hotkey.ts
index 8e0e5f82efe..4c3d49fd1f1 100644
--- a/web/src/hotkey.ts
+++ b/web/src/hotkey.ts
@@ -23,7 +23,7 @@ import * as emoji from "./emoji.ts";
import * as emoji_picker from "./emoji_picker.ts";
import * as feedback_widget from "./feedback_widget.ts";
import * as gear_menu from "./gear_menu.ts";
-import * as giphy from "./giphy.ts";
+import * as gif_picker_ui from "./gif_picker_ui.ts";
import * as hash_util from "./hash_util.ts";
import * as hashchange from "./hashchange.ts";
import {$t} from "./i18n.ts";
@@ -62,7 +62,6 @@ import {realm} from "./state_data.ts";
import * as stream_list from "./stream_list.ts";
import * as stream_popover from "./stream_popover.ts";
import * as stream_settings_ui from "./stream_settings_ui.ts";
-import * as tenor from "./tenor.ts";
import * as topic_list from "./topic_list.ts";
import * as unread_ops from "./unread_ops.ts";
import * as user_card_popover from "./user_card_popover.ts";
@@ -425,19 +424,11 @@ function process_escape_key(e: JQuery.KeyDownEvent): boolean {
return true;
}
- if (giphy.is_popped_from_edit_message()) {
- giphy.focus_current_edit_message();
+ if (gif_picker_ui.is_popped_from_edit_message()) {
+ gif_picker_ui.focus_current_edit_message();
// Hide after setting focus so that `edit_message_id` is
- // still set in giphy.
- giphy.hide_giphy_popover();
- return true;
- }
-
- if (tenor.is_popped_from_edit_message()) {
- tenor.focus_current_edit_message();
- // Hide after setting focus so that `edit_message_id` is
- // still set in giphy.
- tenor.hide_picker_popover();
+ // still set in picker.
+ gif_picker_ui.hide_picker_popover();
return true;
}
@@ -492,9 +483,12 @@ function process_escape_key(e: JQuery.KeyDownEvent): boolean {
}
if (compose_state.composing()) {
- // Check if the giphy popover was open using compose box.
- // Hide GIPHY popover if it's open.
- if (!giphy.is_popped_from_edit_message() && giphy.hide_giphy_popover()) {
+ // Check if the GIF picker popover was open using compose box.
+ // Hide GIF picker popover if it's open.
+ if (
+ !gif_picker_ui.is_popped_from_edit_message() &&
+ gif_picker_ui.hide_picker_popover()
+ ) {
$("textarea#compose-textarea").trigger("focus");
return true;
}
diff --git a/web/src/ui_init.js b/web/src/ui_init.js
index 263a5c321fe..003fe469dcc 100644
--- a/web/src/ui_init.js
+++ b/web/src/ui_init.js
@@ -52,8 +52,8 @@ import * as emoji_picker from "./emoji_picker.ts";
import * as emojisets from "./emojisets.ts";
import * as fenced_code from "./fenced_code.ts";
import * as gear_menu from "./gear_menu.ts";
+import * as gif_picker_ui from "./gif_picker_ui.ts";
import * as gif_state from "./gif_state.ts";
-import * as giphy from "./giphy.ts";
import * as group_permission_settings from "./group_permission_settings.ts";
import * as hashchange from "./hashchange.ts";
import * as hotkey from "./hotkey.ts";
@@ -150,7 +150,6 @@ import * as stream_settings_ui from "./stream_settings_ui.ts";
import * as stream_topic_history from "./stream_topic_history.ts";
import * as stream_topic_history_util from "./stream_topic_history_util.ts";
import * as sub_store from "./sub_store.ts";
-import * as tenor from "./tenor.ts";
import * as theme from "./theme.ts";
import * as thumbnail from "./thumbnail.ts";
import * as timerender from "./timerender.ts";
@@ -680,8 +679,7 @@ export async function initialize_everything(state_data) {
unread_ops.initialize();
gear_menu.initialize();
navbar_help_menu.initialize();
- giphy.initialize();
- tenor.initialize();
+ gif_picker_ui.initialize();
presence.initialize(state_data.presence);
settings_preferences.initialize();
settings_notifications.initialize();
diff --git a/web/styles/popovers.css b/web/styles/popovers.css
index ebffe19b557..8da29dc972d 100644
--- a/web/styles/popovers.css
+++ b/web/styles/popovers.css
@@ -684,8 +684,7 @@ ul.popover-group-menu-member-list {
left: -1px;
}
-.giphy-popover,
-.tenor-popover,
+.gif-picker-popover,
.emoji-popover-root {
.tippy-content {
/* We remove the default padding from this container
@@ -732,43 +731,34 @@ ul.popover-group-menu-member-list {
margin: 4px 4px 2px;
}
- .tenor-content {
+ .gif-picker-content {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
grid-auto-rows: auto;
gap: 6px;
- }
- /* Meant to prevent outline overflow when the GIF
+ /* Meant to prevent outline overflow when the GIF
is focused. */
- .tenor-content,
- .giphy-content {
padding: 0 2px;
}
- .giphy-gif,
.gif-picker-gif {
cursor: pointer;
- }
-
- .gif-picker-gif {
width: 100%;
height: 100%;
border-radius: 10px;
object-fit: cover;
- }
- .giphy-gif:focus,
- .gif-picker-gif:focus {
- /* Blue outline for clear visibility
- * of which image is in focus.
- */
- outline: 2px solid var(--color-selected-gif-in-grid-picker);
- }
+ &:focus {
+ /* Blue outline for clear visibility
+ * of which image is in focus.
+ */
+ outline: 2px solid var(--color-selected-gif-in-grid-picker);
+ }
- .giphy-gif:hover,
- .gif-picker-gif:hover {
- outline: 2px solid var(--color-hovered-gif-in-grid-picker);
+ &:hover {
+ outline: 2px solid var(--color-hovered-gif-in-grid-picker);
+ }
}
.gif-scrolling-container {
diff --git a/web/templates/gif_picker_ui.hbs b/web/templates/gif_picker_ui.hbs
index a3cf61cc863..1fcb89905b7 100644
--- a/web/templates/gif_picker_ui.hbs
+++ b/web/templates/gif_picker_ui.hbs
@@ -4,6 +4,12 @@
{{#> components/input_wrapper input_type="filter-input" custom_classes="gif-search-container" icon="search" input_button_icon="close"}}
<input type="text" class="input-element" id="gif-search-query" autocomplete="off" autofocus/>
{{/components/input_wrapper}}
- <div class="gif-scrolling-container" data-simplebar data-simplebar-tab-index="-1"></div>
+ <div class="gif-scrolling-container" data-simplebar data-simplebar-tab-index="-1">
+ {{!-- We need a container we can replace
+ without removing the simplebar wrappers.
+ We replace the `gif-picker-content` when
+ searching for GIFs. --}}
+ <div class="gif-picker-content"></div>
+ </div>
</div>
</div>