@fluid-app/portal-sdk 0.1.287 → 0.1.288
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/dist/{ShareablesScreen-CQZBq1Hl.cjs → ShareablesScreen-BT3H1Omb.cjs} +982 -543
- package/dist/ShareablesScreen-BT3H1Omb.cjs.map +1 -0
- package/dist/{ShareablesScreen-DYOIQwK-.mjs → ShareablesScreen-BrsJQqia.mjs} +982 -543
- package/dist/ShareablesScreen-BrsJQqia.mjs.map +1 -0
- package/dist/{ShareablesScreen-CPvylNL7.mjs → ShareablesScreen-IU9JBJzD.mjs} +2 -1
- package/dist/{ShareablesScreen-ljPcmGLg.cjs → ShareablesScreen-RxdJqjda.cjs} +2 -1
- package/dist/{ShopScreen-CZ9j_KkC.mjs → ShopScreen-BLo9zSmm.mjs} +1 -1
- package/dist/{ShopScreen-DjpBctSs.cjs → ShopScreen-BgiNBkIk.cjs} +21 -21
- package/dist/{ShopScreen-DjpBctSs.cjs.map → ShopScreen-BgiNBkIk.cjs.map} +1 -1
- package/dist/{ShopScreen-BpA6aD2v.mjs → ShopScreen-Bjo-5mdC.mjs} +21 -21
- package/dist/{ShopScreen-BpA6aD2v.mjs.map → ShopScreen-Bjo-5mdC.mjs.map} +1 -1
- package/dist/{ShopScreen-DcHCZmzi.cjs → ShopScreen-BzaTY9cV.cjs} +1 -1
- package/dist/{SubscriptionsScreen-GYGrW5-O.cjs → SubscriptionsScreen-5IsYJnvc.cjs} +21 -21
- package/dist/{SubscriptionsScreen-GYGrW5-O.cjs.map → SubscriptionsScreen-5IsYJnvc.cjs.map} +1 -1
- package/dist/{SubscriptionsScreen-C63ieyKx.mjs → SubscriptionsScreen-B9_Cmmrc.mjs} +21 -21
- package/dist/{SubscriptionsScreen-C63ieyKx.mjs.map → SubscriptionsScreen-B9_Cmmrc.mjs.map} +1 -1
- package/dist/{SubscriptionsScreen-D9m0xJuk.cjs → SubscriptionsScreen-BpiWZf9J.cjs} +1 -1
- package/dist/{de-D6Lv3YWx.mjs → de-B2xuRzqB.mjs} +1 -1
- package/dist/de-B2xuRzqB.mjs.map +1 -0
- package/dist/{de-BSkuBbT5.mjs → de-BMzN6pvJ.mjs} +1 -1
- package/dist/de-BMzN6pvJ.mjs.map +1 -0
- package/dist/{de-DaHmuCCC.cjs → de-CA1BpazO.cjs} +1 -1
- package/dist/de-CA1BpazO.cjs.map +1 -0
- package/dist/{de-DVlH5v7j.cjs → de-CQojBku3.cjs} +1 -1
- package/dist/de-CQojBku3.cjs.map +1 -0
- package/dist/de-d5sXuDlc.cjs +12 -0
- package/dist/de-d5sXuDlc.cjs.map +1 -0
- package/dist/de-ndSZ5ykY.mjs +6 -0
- package/dist/de-ndSZ5ykY.mjs.map +1 -0
- package/dist/el-3T5wNvmF.cjs +12 -0
- package/dist/el-3T5wNvmF.cjs.map +1 -0
- package/dist/{el-BbF6kVcS.cjs → el-BVROkdqG.cjs} +1 -1
- package/dist/el-BVROkdqG.cjs.map +1 -0
- package/dist/{el-CAyQKFtf.cjs → el-C1QZdoK1.cjs} +1 -1
- package/dist/el-C1QZdoK1.cjs.map +1 -0
- package/dist/{el-gB8Hq3fO.mjs → el-CT5RY-mx.mjs} +1 -1
- package/dist/el-CT5RY-mx.mjs.map +1 -0
- package/dist/{el-X6FQJ94p.mjs → el-CWq1GFO2.mjs} +1 -1
- package/dist/el-CWq1GFO2.mjs.map +1 -0
- package/dist/el-epEJkauy.mjs +6 -0
- package/dist/el-epEJkauy.mjs.map +1 -0
- package/dist/{es-CE1vcNIk.cjs → es-C2uchKja.cjs} +1 -1
- package/dist/es-C2uchKja.cjs.map +1 -0
- package/dist/{es-6BbLrKR8.mjs → es-C2zfJQck.mjs} +1 -1
- package/dist/es-C2zfJQck.mjs.map +1 -0
- package/dist/es-CWW1uLK3.mjs +6 -0
- package/dist/es-CWW1uLK3.mjs.map +1 -0
- package/dist/{es-BRduk0CI.cjs → es-CyPr-juY.cjs} +1 -1
- package/dist/es-CyPr-juY.cjs.map +1 -0
- package/dist/es-DYAui4cM.cjs +12 -0
- package/dist/es-DYAui4cM.cjs.map +1 -0
- package/dist/{es-DWWQRCG6.mjs → es-DjcSUa7j.mjs} +1 -1
- package/dist/es-DjcSUa7j.mjs.map +1 -0
- package/dist/{fr-JI0AJpi4.mjs → fr-BiJrmc6t.mjs} +1 -1
- package/dist/fr-BiJrmc6t.mjs.map +1 -0
- package/dist/{fr-DsRxIPGX.cjs → fr-BzVQUMC0.cjs} +1 -1
- package/dist/fr-BzVQUMC0.cjs.map +1 -0
- package/dist/{fr-fn45Htrq.cjs → fr-C-2Pj7D2.cjs} +1 -1
- package/dist/fr-C-2Pj7D2.cjs.map +1 -0
- package/dist/fr-CT47eWK_.mjs +6 -0
- package/dist/fr-CT47eWK_.mjs.map +1 -0
- package/dist/fr-DYML7Hb_.cjs +12 -0
- package/dist/fr-DYML7Hb_.cjs.map +1 -0
- package/dist/{fr-cuw-6rMw.mjs → fr-jXtwm66y.mjs} +1 -1
- package/dist/fr-jXtwm66y.mjs.map +1 -0
- package/dist/{he-BrmBdbqF.cjs → he-BNgtWUzu.cjs} +1 -1
- package/dist/he-BNgtWUzu.cjs.map +1 -0
- package/dist/{he-Bo038PQk.cjs → he-CBny3yj_.cjs} +1 -1
- package/dist/he-CBny3yj_.cjs.map +1 -0
- package/dist/he-Cu_YCy1f.cjs +12 -0
- package/dist/he-Cu_YCy1f.cjs.map +1 -0
- package/dist/{he-alv3r1UX.mjs → he-D-R8pe0L.mjs} +1 -1
- package/dist/he-D-R8pe0L.mjs.map +1 -0
- package/dist/he-gcmGB1-C.mjs +6 -0
- package/dist/he-gcmGB1-C.mjs.map +1 -0
- package/dist/{he-BkfYmB1i.mjs → he-z0iIyfGu.mjs} +1 -1
- package/dist/he-z0iIyfGu.mjs.map +1 -0
- package/dist/{hu-CnNC2Pbr.mjs → hu-BLBHZrAu.mjs} +1 -1
- package/dist/hu-BLBHZrAu.mjs.map +1 -0
- package/dist/{hu-CWg9eTQi.cjs → hu-BR0rOtJC.cjs} +1 -1
- package/dist/hu-BR0rOtJC.cjs.map +1 -0
- package/dist/{hu-Bac0NMFc.cjs → hu-BTBlTUaQ.cjs} +1 -1
- package/dist/hu-BTBlTUaQ.cjs.map +1 -0
- package/dist/hu-Czc1FPg9.cjs +12 -0
- package/dist/hu-Czc1FPg9.cjs.map +1 -0
- package/dist/{hu-uNLuVt0n.mjs → hu-D4fy_GxO.mjs} +1 -1
- package/dist/hu-D4fy_GxO.mjs.map +1 -0
- package/dist/hu-pswRdooT.mjs +6 -0
- package/dist/hu-pswRdooT.mjs.map +1 -0
- package/dist/{id-CxB-SzNc.cjs → id-52itow18.cjs} +1 -1
- package/dist/id-52itow18.cjs.map +1 -0
- package/dist/{id-QB01f2eJ.mjs → id-Bbvk8MDA.mjs} +1 -1
- package/dist/id-Bbvk8MDA.mjs.map +1 -0
- package/dist/{id-DcYvttVc.cjs → id-BxQgqmXd.cjs} +1 -1
- package/dist/id-BxQgqmXd.cjs.map +1 -0
- package/dist/{id-DyMHy3kg.mjs → id-DGh6JGZ5.mjs} +1 -1
- package/dist/id-DGh6JGZ5.mjs.map +1 -0
- package/dist/id-Dhws7LdN.mjs +6 -0
- package/dist/id-Dhws7LdN.mjs.map +1 -0
- package/dist/id-Vw9DQ3V1.cjs +12 -0
- package/dist/id-Vw9DQ3V1.cjs.map +1 -0
- package/dist/index.cjs +9 -9
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +9 -9
- package/dist/{it-DZodgnbb.cjs → it-CbZjaErj.cjs} +1 -1
- package/dist/it-CbZjaErj.cjs.map +1 -0
- package/dist/{it-bICkLWhn.mjs → it-CfLSq25e.mjs} +1 -1
- package/dist/it-CfLSq25e.mjs.map +1 -0
- package/dist/it-CpnrX6Qu.cjs +12 -0
- package/dist/it-CpnrX6Qu.cjs.map +1 -0
- package/dist/{it-DVaUm43V.mjs → it-ELWZ1sxy.mjs} +1 -1
- package/dist/it-ELWZ1sxy.mjs.map +1 -0
- package/dist/{it-BEH3ds1H.cjs → it-L0NVZqjU.cjs} +1 -1
- package/dist/it-L0NVZqjU.cjs.map +1 -0
- package/dist/it-dsOgAn3r.mjs +6 -0
- package/dist/it-dsOgAn3r.mjs.map +1 -0
- package/dist/{ja-DScRnwnk.cjs → ja-BaU2QXo2.cjs} +1 -1
- package/dist/ja-BaU2QXo2.cjs.map +1 -0
- package/dist/ja-BqySbP-W.mjs +6 -0
- package/dist/ja-BqySbP-W.mjs.map +1 -0
- package/dist/{ja-D18mnnKW.mjs → ja-C1QZfTGN.mjs} +1 -1
- package/dist/ja-C1QZfTGN.mjs.map +1 -0
- package/dist/{ja-DJwp44R3.cjs → ja-D5fpLCDT.cjs} +1 -1
- package/dist/ja-D5fpLCDT.cjs.map +1 -0
- package/dist/ja-JVcCjBJ9.cjs +12 -0
- package/dist/ja-JVcCjBJ9.cjs.map +1 -0
- package/dist/{ja-RoxMTtpa.mjs → ja-kM5CUvdg.mjs} +1 -1
- package/dist/ja-kM5CUvdg.mjs.map +1 -0
- package/dist/{ko-H2-0hunm.mjs → ko-BX4GXxaa.mjs} +1 -1
- package/dist/ko-BX4GXxaa.mjs.map +1 -0
- package/dist/ko-Cdb4MyCC.mjs +6 -0
- package/dist/ko-Cdb4MyCC.mjs.map +1 -0
- package/dist/{ko-tQ7eTEXA.mjs → ko-D2TLG_3_.mjs} +1 -1
- package/dist/ko-D2TLG_3_.mjs.map +1 -0
- package/dist/{ko-C1JrZ8Zc.cjs → ko-D64no-WM.cjs} +1 -1
- package/dist/ko-D64no-WM.cjs.map +1 -0
- package/dist/ko-WIfVodYY.cjs +12 -0
- package/dist/ko-WIfVodYY.cjs.map +1 -0
- package/dist/{ko-pdYT9YP0.cjs → ko-vQjiRfrX.cjs} +1 -1
- package/dist/ko-vQjiRfrX.cjs.map +1 -0
- package/dist/nl-C5U5y6gr.cjs +12 -0
- package/dist/nl-C5U5y6gr.cjs.map +1 -0
- package/dist/{nl-Bv4B_LAE.cjs → nl-C8T6RqHI.cjs} +1 -1
- package/dist/nl-C8T6RqHI.cjs.map +1 -0
- package/dist/nl-D0dcnS-5.mjs +6 -0
- package/dist/nl-D0dcnS-5.mjs.map +1 -0
- package/dist/{nl-BpHcFzEh.cjs → nl-DRxCBp_v.cjs} +1 -1
- package/dist/nl-DRxCBp_v.cjs.map +1 -0
- package/dist/{nl-DluEm_YD.mjs → nl-Dww7O0AO.mjs} +1 -1
- package/dist/nl-Dww7O0AO.mjs.map +1 -0
- package/dist/{nl-C4QRmvLS.mjs → nl-mL8uL7cu.mjs} +1 -1
- package/dist/nl-mL8uL7cu.mjs.map +1 -0
- package/dist/{pl-CD6XB8Yb.cjs → pl-AsC20yM9.cjs} +1 -1
- package/dist/pl-AsC20yM9.cjs.map +1 -0
- package/dist/{pl-BMYfuJP2.mjs → pl-Beb7Fiam.mjs} +1 -1
- package/dist/pl-Beb7Fiam.mjs.map +1 -0
- package/dist/pl-COP9NGch.mjs +6 -0
- package/dist/pl-COP9NGch.mjs.map +1 -0
- package/dist/pl-DJKAFKNJ.cjs +12 -0
- package/dist/pl-DJKAFKNJ.cjs.map +1 -0
- package/dist/{pl-D0UcIjco.cjs → pl-DpVEpGL0.cjs} +1 -1
- package/dist/pl-DpVEpGL0.cjs.map +1 -0
- package/dist/{pl-DCEQYzdi.mjs → pl-PV9rlOz1.mjs} +1 -1
- package/dist/pl-PV9rlOz1.mjs.map +1 -0
- package/dist/{pt-CdlP3ZEw.mjs → pt-B4hr_uJO.mjs} +1 -1
- package/dist/pt-B4hr_uJO.mjs.map +1 -0
- package/dist/{pt-DS-bjz4a.cjs → pt-BBFH5zDu.cjs} +1 -1
- package/dist/pt-BBFH5zDu.cjs.map +1 -0
- package/dist/{pt-DcZKpc5z.mjs → pt-BC56DXTY.mjs} +1 -1
- package/dist/pt-BC56DXTY.mjs.map +1 -0
- package/dist/pt-CSvh02ed.mjs +6 -0
- package/dist/pt-CSvh02ed.mjs.map +1 -0
- package/dist/{pt-C8mqwNHS.cjs → pt-CifIYahI.cjs} +1 -1
- package/dist/pt-CifIYahI.cjs.map +1 -0
- package/dist/pt-CpQN7iPy.cjs +12 -0
- package/dist/pt-CpQN7iPy.cjs.map +1 -0
- package/dist/{ro-kawLYFcb.cjs → ro-B6ExafZC.cjs} +1 -1
- package/dist/ro-B6ExafZC.cjs.map +1 -0
- package/dist/ro-CGOwHLvs.cjs +12 -0
- package/dist/ro-CGOwHLvs.cjs.map +1 -0
- package/dist/{ro-Bb7f9dpa.mjs → ro-CJJKGRs9.mjs} +1 -1
- package/dist/ro-CJJKGRs9.mjs.map +1 -0
- package/dist/ro-D2WH48l8.mjs +6 -0
- package/dist/ro-D2WH48l8.mjs.map +1 -0
- package/dist/{ro-Cl2KkquO.cjs → ro-DS3mARiW.cjs} +1 -1
- package/dist/ro-DS3mARiW.cjs.map +1 -0
- package/dist/{ro-nRdCzIy6.mjs → ro-DhGoI55Z.mjs} +1 -1
- package/dist/ro-DhGoI55Z.mjs.map +1 -0
- package/dist/ru-BCP_P-Kw.mjs +6 -0
- package/dist/ru-BCP_P-Kw.mjs.map +1 -0
- package/dist/{ru-SD9I_vbQ.mjs → ru-BymfL4lY.mjs} +1 -1
- package/dist/ru-BymfL4lY.mjs.map +1 -0
- package/dist/{ru-DhVdR84E.cjs → ru-CKfstS2M.cjs} +1 -1
- package/dist/ru-CKfstS2M.cjs.map +1 -0
- package/dist/ru-CW4wBDfy.cjs +12 -0
- package/dist/ru-CW4wBDfy.cjs.map +1 -0
- package/dist/{ru-C8vlzdV2.mjs → ru-DHNcAvHk.mjs} +1 -1
- package/dist/ru-DHNcAvHk.mjs.map +1 -0
- package/dist/{ru-DkGCoTib.cjs → ru-fz-F75f4.cjs} +1 -1
- package/dist/ru-fz-F75f4.cjs.map +1 -0
- package/dist/{th-BwrX1HXy.cjs → th-BVg0Jjgr.cjs} +1 -1
- package/dist/th-BVg0Jjgr.cjs.map +1 -0
- package/dist/{th-DzMSJQnA.cjs → th-BYXBW0X2.cjs} +1 -1
- package/dist/th-BYXBW0X2.cjs.map +1 -0
- package/dist/th-C7VrhPP5.cjs +12 -0
- package/dist/th-C7VrhPP5.cjs.map +1 -0
- package/dist/th-CZxqRIHs.mjs +6 -0
- package/dist/th-CZxqRIHs.mjs.map +1 -0
- package/dist/{th-DeiGkH2A.mjs → th-cad5Cap4.mjs} +1 -1
- package/dist/th-cad5Cap4.mjs.map +1 -0
- package/dist/{th-Q32fruvI.mjs → th-ge5FSv6T.mjs} +1 -1
- package/dist/th-ge5FSv6T.mjs.map +1 -0
- package/dist/{tl-DcgEPkew.mjs → tl-B888TBzV.mjs} +1 -1
- package/dist/tl-B888TBzV.mjs.map +1 -0
- package/dist/tl-CATDGPeB.cjs +12 -0
- package/dist/tl-CATDGPeB.cjs.map +1 -0
- package/dist/{tl-BrFPZytT.cjs → tl-CKjLSF_S.cjs} +1 -1
- package/dist/tl-CKjLSF_S.cjs.map +1 -0
- package/dist/tl-DCKUBvuV.mjs +6 -0
- package/dist/tl-DCKUBvuV.mjs.map +1 -0
- package/dist/{tl-Rc9FUVPE.mjs → tl-icpkJ5RY.mjs} +1 -1
- package/dist/tl-icpkJ5RY.mjs.map +1 -0
- package/dist/{tl-DKc258LE.cjs → tl-lZlSu-sM.cjs} +1 -1
- package/dist/tl-lZlSu-sM.cjs.map +1 -0
- package/dist/{tr-BSLMOkiM.mjs → tr-B96yy4BZ.mjs} +1 -1
- package/dist/tr-B96yy4BZ.mjs.map +1 -0
- package/dist/tr-Bsdv5dWu.cjs +12 -0
- package/dist/tr-Bsdv5dWu.cjs.map +1 -0
- package/dist/tr-COlHtN47.mjs +6 -0
- package/dist/tr-COlHtN47.mjs.map +1 -0
- package/dist/{tr--9yVKl_5.cjs → tr-CifdAA_w.cjs} +1 -1
- package/dist/tr-CifdAA_w.cjs.map +1 -0
- package/dist/{tr-YozY7m25.cjs → tr-DMnXKPnI.cjs} +1 -1
- package/dist/tr-DMnXKPnI.cjs.map +1 -0
- package/dist/{tr-BGaeZdYg.mjs → tr-QaTfqnit.mjs} +1 -1
- package/dist/tr-QaTfqnit.mjs.map +1 -0
- package/dist/{zh_CN-D1Ms29s8.mjs → zh_CN-BJnhvkc0.mjs} +1 -1
- package/dist/zh_CN-BJnhvkc0.mjs.map +1 -0
- package/dist/{zh_CN-CsMqRjiQ.mjs → zh_CN-BT8zi4ct.mjs} +1 -1
- package/dist/zh_CN-BT8zi4ct.mjs.map +1 -0
- package/dist/{zh_CN-E0kXVRxC.cjs → zh_CN-BWIy2qoV.cjs} +1 -1
- package/dist/zh_CN-BWIy2qoV.cjs.map +1 -0
- package/dist/{zh_CN-CbVSbwQS.cjs → zh_CN-BrkBDK-m.cjs} +1 -1
- package/dist/zh_CN-BrkBDK-m.cjs.map +1 -0
- package/dist/zh_CN-Bzo7sqbA.cjs +12 -0
- package/dist/zh_CN-Bzo7sqbA.cjs.map +1 -0
- package/dist/zh_CN-oOeDsP-B.mjs +6 -0
- package/dist/zh_CN-oOeDsP-B.mjs.map +1 -0
- package/dist/{zh_TW-xI_SNVQ3.mjs → zh_TW-Bz5_kUpI.mjs} +1 -1
- package/dist/zh_TW-Bz5_kUpI.mjs.map +1 -0
- package/dist/zh_TW-D-xI7JBs.mjs +6 -0
- package/dist/zh_TW-D-xI7JBs.mjs.map +1 -0
- package/dist/{zh_TW-BnIFVRFE.cjs → zh_TW-D86GUR9C.cjs} +1 -1
- package/dist/zh_TW-D86GUR9C.cjs.map +1 -0
- package/dist/zh_TW-DQdWK1u9.cjs +12 -0
- package/dist/zh_TW-DQdWK1u9.cjs.map +1 -0
- package/dist/{zh_TW-CqIYX4Jc.cjs → zh_TW-DzFlj-kU.cjs} +1 -1
- package/dist/zh_TW-DzFlj-kU.cjs.map +1 -0
- package/dist/{zh_TW-BmouVjK8.mjs → zh_TW-idE0Evam.mjs} +1 -1
- package/dist/zh_TW-idE0Evam.mjs.map +1 -0
- package/package.json +15 -15
- package/dist/ShareablesScreen-CQZBq1Hl.cjs.map +0 -1
- package/dist/ShareablesScreen-DYOIQwK-.mjs.map +0 -1
- package/dist/de-BSkuBbT5.mjs.map +0 -1
- package/dist/de-D6Lv3YWx.mjs.map +0 -1
- package/dist/de-DVlH5v7j.cjs.map +0 -1
- package/dist/de-DaHmuCCC.cjs.map +0 -1
- package/dist/el-BbF6kVcS.cjs.map +0 -1
- package/dist/el-CAyQKFtf.cjs.map +0 -1
- package/dist/el-X6FQJ94p.mjs.map +0 -1
- package/dist/el-gB8Hq3fO.mjs.map +0 -1
- package/dist/es-6BbLrKR8.mjs.map +0 -1
- package/dist/es-BRduk0CI.cjs.map +0 -1
- package/dist/es-CE1vcNIk.cjs.map +0 -1
- package/dist/es-DWWQRCG6.mjs.map +0 -1
- package/dist/fr-DsRxIPGX.cjs.map +0 -1
- package/dist/fr-JI0AJpi4.mjs.map +0 -1
- package/dist/fr-cuw-6rMw.mjs.map +0 -1
- package/dist/fr-fn45Htrq.cjs.map +0 -1
- package/dist/he-BkfYmB1i.mjs.map +0 -1
- package/dist/he-Bo038PQk.cjs.map +0 -1
- package/dist/he-BrmBdbqF.cjs.map +0 -1
- package/dist/he-alv3r1UX.mjs.map +0 -1
- package/dist/hu-Bac0NMFc.cjs.map +0 -1
- package/dist/hu-CWg9eTQi.cjs.map +0 -1
- package/dist/hu-CnNC2Pbr.mjs.map +0 -1
- package/dist/hu-uNLuVt0n.mjs.map +0 -1
- package/dist/id-CxB-SzNc.cjs.map +0 -1
- package/dist/id-DcYvttVc.cjs.map +0 -1
- package/dist/id-DyMHy3kg.mjs.map +0 -1
- package/dist/id-QB01f2eJ.mjs.map +0 -1
- package/dist/it-BEH3ds1H.cjs.map +0 -1
- package/dist/it-DVaUm43V.mjs.map +0 -1
- package/dist/it-DZodgnbb.cjs.map +0 -1
- package/dist/it-bICkLWhn.mjs.map +0 -1
- package/dist/ja-D18mnnKW.mjs.map +0 -1
- package/dist/ja-DJwp44R3.cjs.map +0 -1
- package/dist/ja-DScRnwnk.cjs.map +0 -1
- package/dist/ja-RoxMTtpa.mjs.map +0 -1
- package/dist/ko-C1JrZ8Zc.cjs.map +0 -1
- package/dist/ko-H2-0hunm.mjs.map +0 -1
- package/dist/ko-pdYT9YP0.cjs.map +0 -1
- package/dist/ko-tQ7eTEXA.mjs.map +0 -1
- package/dist/nl-BpHcFzEh.cjs.map +0 -1
- package/dist/nl-Bv4B_LAE.cjs.map +0 -1
- package/dist/nl-C4QRmvLS.mjs.map +0 -1
- package/dist/nl-DluEm_YD.mjs.map +0 -1
- package/dist/pl-BMYfuJP2.mjs.map +0 -1
- package/dist/pl-CD6XB8Yb.cjs.map +0 -1
- package/dist/pl-D0UcIjco.cjs.map +0 -1
- package/dist/pl-DCEQYzdi.mjs.map +0 -1
- package/dist/pt-C8mqwNHS.cjs.map +0 -1
- package/dist/pt-CdlP3ZEw.mjs.map +0 -1
- package/dist/pt-DS-bjz4a.cjs.map +0 -1
- package/dist/pt-DcZKpc5z.mjs.map +0 -1
- package/dist/ro-Bb7f9dpa.mjs.map +0 -1
- package/dist/ro-Cl2KkquO.cjs.map +0 -1
- package/dist/ro-kawLYFcb.cjs.map +0 -1
- package/dist/ro-nRdCzIy6.mjs.map +0 -1
- package/dist/ru-C8vlzdV2.mjs.map +0 -1
- package/dist/ru-DhVdR84E.cjs.map +0 -1
- package/dist/ru-DkGCoTib.cjs.map +0 -1
- package/dist/ru-SD9I_vbQ.mjs.map +0 -1
- package/dist/th-BwrX1HXy.cjs.map +0 -1
- package/dist/th-DeiGkH2A.mjs.map +0 -1
- package/dist/th-DzMSJQnA.cjs.map +0 -1
- package/dist/th-Q32fruvI.mjs.map +0 -1
- package/dist/tl-BrFPZytT.cjs.map +0 -1
- package/dist/tl-DKc258LE.cjs.map +0 -1
- package/dist/tl-DcgEPkew.mjs.map +0 -1
- package/dist/tl-Rc9FUVPE.mjs.map +0 -1
- package/dist/tr--9yVKl_5.cjs.map +0 -1
- package/dist/tr-BGaeZdYg.mjs.map +0 -1
- package/dist/tr-BSLMOkiM.mjs.map +0 -1
- package/dist/tr-YozY7m25.cjs.map +0 -1
- package/dist/zh_CN-CbVSbwQS.cjs.map +0 -1
- package/dist/zh_CN-CsMqRjiQ.mjs.map +0 -1
- package/dist/zh_CN-D1Ms29s8.mjs.map +0 -1
- package/dist/zh_CN-E0kXVRxC.cjs.map +0 -1
- package/dist/zh_TW-BmouVjK8.mjs.map +0 -1
- package/dist/zh_TW-BnIFVRFE.cjs.map +0 -1
- package/dist/zh_TW-CqIYX4Jc.cjs.map +0 -1
- package/dist/zh_TW-xI_SNVQ3.mjs.map +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { A as playlists_list, C as pages_show, D as playlists_items_list, E as playlists_items_add, M as playlists_update, N as shares_create, O as playlists_items_remove, P as shares_list, S as pages_list, T as playlists_destroy, _ as media_products_add, a as content_playlists_by_shares, b as media_show, c as dam_asset_paths_list, d as dam_assets_discard, f as dam_assets_list, g as media_list, h as media_destroy, i as content_pages_by_visits, j as playlists_show, k as playlists_items_reorder, l as dam_assets_create, m as media_create, n as content_media_by_visits, o as content_playlists_by_visits, p as dam_query, r as content_pages_by_shares, s as dam_asset_paths_create, t as content_media_by_shares, u as dam_assets_destroy, v as media_products_list, w as playlists_create, x as media_update, y as media_products_remove } from "./portal_tenant_content-DPLnrtOG.mjs";
|
|
2
2
|
import { l as enrollment_packs_list, u as enrollment_packs_show } from "./portal_tenant-l4a-eX2B.mjs";
|
|
3
3
|
import { n as usePortalTenantClient } from "./PortalTenantClientProvider-BF-1Fy27.mjs";
|
|
4
|
+
import { i as createTranslationContext, n as createDomainTranslations, o as useActiveLocale, r as useDomainDict, t as createStaticDictAdapter } from "./static-dict-adapter-OprHuHgs.mjs";
|
|
4
5
|
import { $ as DialogDescription, B as DropdownMenuContent, C as SelectContent, Cn as cn, Ct as Checkbox, E as SelectValue, F as FormItem, G as DropdownMenuSeparator, I as FormLabel, J as DropdownMenuSubTrigger, K as DropdownMenuSub, L as FormMessage, M as Form, N as FormControl, P as FormField, Q as DialogContent, R as Label, S as Select, Sn as useZodForm, T as SelectTrigger, V as DropdownMenuItem, X as Dialog, Y as DropdownMenuTrigger, _n as AlertDialogTitle, a as Textarea, an as BreadcrumbLink, at as Popover, c as TabsTrigger, cn as BreadcrumbSeparator, d as Spinner, dn as AlertDialogAction, f as fluidToast, fn as AlertDialogCancel, gn as AlertDialogHeader, gt as Card, h as Skeleton, hn as AlertDialogFooter, i as TooltipTrigger, in as BreadcrumbItem, it as DialogTitle, k as Input, l as Switch, ln as Badge, m as Slider, mn as AlertDialogDescription, n as TooltipContent, nt as DialogOverlay, o as Tabs, on as BreadcrumbList, ot as PopoverContent, pn as AlertDialogContent, q as DropdownMenuSubContent, r as TooltipProvider, rn as Breadcrumb, rt as DialogPortal, s as TabsList, sn as BreadcrumbPage, st as PopoverTrigger, t as Tooltip, tt as DialogHeader, un as AlertDialog, vn as Button, vt as CardContent, w as SelectItem, x as Separator, yn as Content, z as DropdownMenu } from "./src-Dk1FJOX0.mjs";
|
|
5
6
|
import { n as ScreenHeaderBreadcrumbs, t as ScreenHeaderActions } from "./ScreenHeaderContext-Dn12BZyj.mjs";
|
|
6
7
|
import { t as useStore } from "./use-store-BnHhQDYo.mjs";
|
|
@@ -486,11 +487,18 @@ async function getProduct(client, id, options) {
|
|
|
486
487
|
});
|
|
487
488
|
}
|
|
488
489
|
//#endregion
|
|
490
|
+
//#region ../../shareables/core/src/translation-api-context.ts
|
|
491
|
+
const { Provider: ShareablesProvider, useTranslation } = createTranslationContext("Shareables");
|
|
492
|
+
const ShareablesTranslationProvider = ShareablesProvider;
|
|
493
|
+
const useShareablesTranslation = useTranslation;
|
|
494
|
+
//#endregion
|
|
489
495
|
//#region ../../shareables/ui/src/components/MediaShare/ShareItemCard.tsx
|
|
490
496
|
const DEFAULT_IMAGE$6 = "https://assets.fluid.app/fluid-admin/images/we-commerce/we-commerce.png";
|
|
491
|
-
function ShareItemCard({ title, imageUrl, href, badge, isVideo = false, subtitle
|
|
497
|
+
function ShareItemCard({ title, imageUrl, href, badge, isVideo = false, subtitle }) {
|
|
492
498
|
const { navigate } = useShareablesUI();
|
|
493
499
|
const renderImage = useRenderImage();
|
|
500
|
+
const { t } = useShareablesTranslation();
|
|
501
|
+
const resolvedSubtitle = subtitle ?? t("share_click_to_find_assets");
|
|
494
502
|
function handleClick() {
|
|
495
503
|
navigate(href);
|
|
496
504
|
}
|
|
@@ -532,10 +540,10 @@ function ShareItemCard({ title, imageUrl, href, badge, isVideo = false, subtitle
|
|
|
532
540
|
className: "px-2 pt-2 pb-4",
|
|
533
541
|
children: [/* @__PURE__ */ jsx("h3", {
|
|
534
542
|
className: "text-foreground line-clamp-2 text-sm leading-tight font-bold",
|
|
535
|
-
children: title || "
|
|
543
|
+
children: title || t("common_untitled")
|
|
536
544
|
}), /* @__PURE__ */ jsx("p", {
|
|
537
545
|
className: "text-muted-foreground mt-1 text-xs",
|
|
538
|
-
children:
|
|
546
|
+
children: resolvedSubtitle
|
|
539
547
|
})]
|
|
540
548
|
})]
|
|
541
549
|
});
|
|
@@ -550,13 +558,14 @@ function getProductImageUrl(product) {
|
|
|
550
558
|
return product.image_url ?? null;
|
|
551
559
|
}
|
|
552
560
|
function ShareProductCard({ product, mediaCount }) {
|
|
561
|
+
const { t } = useShareablesTranslation();
|
|
553
562
|
const imageUrl = getProductImageUrl(product);
|
|
554
563
|
const isVideo = product.kind === "video" && !!product.video_url;
|
|
555
564
|
return /* @__PURE__ */ jsx(ShareItemCard, {
|
|
556
565
|
title: product.title,
|
|
557
566
|
imageUrl,
|
|
558
567
|
href: `product/${product.id}`,
|
|
559
|
-
badge: !isVideo && mediaCount != null ? { text:
|
|
568
|
+
badge: !isVideo && mediaCount != null ? { text: t("products_asset_count", { count: String(mediaCount) }) } : void 0,
|
|
560
569
|
isVideo
|
|
561
570
|
});
|
|
562
571
|
}
|
|
@@ -580,7 +589,9 @@ const SHAREABLE_GRID_CLASS = "grid grid-cols-1 gap-8 sm:grid-cols-2 md:grid-cols
|
|
|
580
589
|
* `filters` and `children`. This component does NOT own data fetching or
|
|
581
590
|
* any state — callers pass in the derived flags.
|
|
582
591
|
*/
|
|
583
|
-
function ShareableListLayout({ filters, children, isLoading, error, errorMessage
|
|
592
|
+
function ShareableListLayout({ filters, children, isLoading, error, errorMessage, isEmpty, emptyMessage, footer, loadingFilterShape = "search", sentinelRef }) {
|
|
593
|
+
const { t } = useShareablesTranslation();
|
|
594
|
+
const resolvedErrorMessage = errorMessage ?? t("common_load_error_default");
|
|
584
595
|
if (isLoading) return /* @__PURE__ */ jsxs("div", {
|
|
585
596
|
className: "space-y-6 px-4 py-4 md:px-10 md:py-6",
|
|
586
597
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
@@ -606,7 +617,7 @@ function ShareableListLayout({ filters, children, isLoading, error, errorMessage
|
|
|
606
617
|
className: "flex flex-col items-center justify-center py-16",
|
|
607
618
|
children: /* @__PURE__ */ jsx("p", {
|
|
608
619
|
className: "text-destructive text-sm",
|
|
609
|
-
children:
|
|
620
|
+
children: resolvedErrorMessage
|
|
610
621
|
})
|
|
611
622
|
});
|
|
612
623
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -642,6 +653,7 @@ const SHAREABLE_LIST_CLASS = "divide-border divide-y rounded-lg border";
|
|
|
642
653
|
* button. Hover styling applies to the entire row container.
|
|
643
654
|
*/
|
|
644
655
|
function ShareableListRow({ imageUrl, imageAlt, title, subtitle, onClick, leading, trailing }) {
|
|
656
|
+
const { t } = useShareablesTranslation();
|
|
645
657
|
return /* @__PURE__ */ jsxs("div", {
|
|
646
658
|
className: "hover:bg-muted flex items-center gap-3 px-4 py-3 transition-colors",
|
|
647
659
|
children: [
|
|
@@ -661,7 +673,7 @@ function ShareableListRow({ imageUrl, imageAlt, title, subtitle, onClick, leadin
|
|
|
661
673
|
className: "min-w-0 flex-1",
|
|
662
674
|
children: [/* @__PURE__ */ jsx("p", {
|
|
663
675
|
className: "text-foreground truncate text-sm font-medium",
|
|
664
|
-
children: title || "
|
|
676
|
+
children: title || t("common_untitled")
|
|
665
677
|
}), subtitle != null && subtitle !== false && /* @__PURE__ */ jsx("p", {
|
|
666
678
|
className: "text-muted-foreground flex items-center gap-1.5 text-xs",
|
|
667
679
|
children: subtitle
|
|
@@ -679,16 +691,17 @@ function ShareableListRow({ imageUrl, imageAlt, title, subtitle, onClick, leadin
|
|
|
679
691
|
* listing screen. Stateless — callers own the `viewMode` state.
|
|
680
692
|
*/
|
|
681
693
|
function ViewModeToggle({ value, onChange }) {
|
|
694
|
+
const { t } = useShareablesTranslation();
|
|
682
695
|
return /* @__PURE__ */ jsxs("div", {
|
|
683
696
|
className: "border-input bg-muted flex items-center rounded-lg border p-0.5",
|
|
684
697
|
children: [/* @__PURE__ */ jsx(ToggleButton, {
|
|
685
698
|
active: value === "list",
|
|
686
|
-
label: "
|
|
699
|
+
label: t("common_list_view"),
|
|
687
700
|
onClick: () => onChange("list"),
|
|
688
701
|
children: /* @__PURE__ */ jsx(List, { className: "h-4 w-4" })
|
|
689
702
|
}), /* @__PURE__ */ jsx(ToggleButton, {
|
|
690
703
|
active: value === "grid",
|
|
691
|
-
label: "
|
|
704
|
+
label: t("common_grid_view"),
|
|
692
705
|
onClick: () => onChange("grid"),
|
|
693
706
|
children: /* @__PURE__ */ jsx(LayoutGrid, { className: "h-4 w-4" })
|
|
694
707
|
})]
|
|
@@ -739,35 +752,36 @@ function useInfiniteListSentinel({ hasNextPage, isFetchingNextPage, fetchNextPag
|
|
|
739
752
|
//#endregion
|
|
740
753
|
//#region ../../shareables/ui/src/components/screens/ProductsScreen.tsx
|
|
741
754
|
const PAGE_SIZE$6 = 24;
|
|
742
|
-
const SORT_OPTIONS$1 = [
|
|
743
|
-
{
|
|
744
|
-
label: "Newest",
|
|
745
|
-
value: "created_at_desc"
|
|
746
|
-
},
|
|
747
|
-
{
|
|
748
|
-
label: "Oldest",
|
|
749
|
-
value: "created_at_asc"
|
|
750
|
-
},
|
|
751
|
-
{
|
|
752
|
-
label: "Title A–Z",
|
|
753
|
-
value: "title_asc"
|
|
754
|
-
},
|
|
755
|
-
{
|
|
756
|
-
label: "Title Z–A",
|
|
757
|
-
value: "title_desc"
|
|
758
|
-
},
|
|
759
|
-
{
|
|
760
|
-
label: "Price: Low to High",
|
|
761
|
-
value: "price_asc"
|
|
762
|
-
},
|
|
763
|
-
{
|
|
764
|
-
label: "Price: High to Low",
|
|
765
|
-
value: "price_desc"
|
|
766
|
-
}
|
|
767
|
-
];
|
|
768
755
|
function ProductsScreen({ countryCode, fetchProducts: fetchPortalProducts, onNavigate }) {
|
|
769
756
|
const client = useShareablesClient();
|
|
770
757
|
const { navigate } = useShareablesUI();
|
|
758
|
+
const { t } = useShareablesTranslation();
|
|
759
|
+
const SORT_OPTIONS = useMemo(() => [
|
|
760
|
+
{
|
|
761
|
+
label: t("sort_newest"),
|
|
762
|
+
value: "created_at_desc"
|
|
763
|
+
},
|
|
764
|
+
{
|
|
765
|
+
label: t("sort_oldest"),
|
|
766
|
+
value: "created_at_asc"
|
|
767
|
+
},
|
|
768
|
+
{
|
|
769
|
+
label: t("sort_title_asc"),
|
|
770
|
+
value: "title_asc"
|
|
771
|
+
},
|
|
772
|
+
{
|
|
773
|
+
label: t("sort_title_desc"),
|
|
774
|
+
value: "title_desc"
|
|
775
|
+
},
|
|
776
|
+
{
|
|
777
|
+
label: t("sort_price_asc"),
|
|
778
|
+
value: "price_asc"
|
|
779
|
+
},
|
|
780
|
+
{
|
|
781
|
+
label: t("sort_price_desc"),
|
|
782
|
+
value: "price_desc"
|
|
783
|
+
}
|
|
784
|
+
], [t]);
|
|
771
785
|
const [searchTerm, setSearchTerm] = useState("");
|
|
772
786
|
const [debouncedSearch, setDebouncedSearch] = useState("");
|
|
773
787
|
const [sortValue, setSortValue] = useState("created_at_desc");
|
|
@@ -846,18 +860,18 @@ function ProductsScreen({ countryCode, fetchProducts: fetchPortalProducts, onNav
|
|
|
846
860
|
children: /* @__PURE__ */ jsx("div", { className: "border-primary h-6 w-6 animate-spin rounded-full border-2 border-t-transparent" })
|
|
847
861
|
}), error && /* @__PURE__ */ jsx("p", {
|
|
848
862
|
className: "bg-destructive/10 text-destructive rounded-lg px-3 py-2",
|
|
849
|
-
children: "
|
|
863
|
+
children: t("products_load_error")
|
|
850
864
|
})] });
|
|
851
865
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(ScreenHeaderBreadcrumbs, { children: /* @__PURE__ */ jsx(Breadcrumb, { children: /* @__PURE__ */ jsx(BreadcrumbList, {
|
|
852
866
|
className: "text-lg",
|
|
853
867
|
children: /* @__PURE__ */ jsx(BreadcrumbItem, { children: /* @__PURE__ */ jsx(BreadcrumbPage, {
|
|
854
868
|
className: "font-semibold",
|
|
855
|
-
children: "
|
|
869
|
+
children: t("products_breadcrumb")
|
|
856
870
|
}) })
|
|
857
871
|
}) }) }), /* @__PURE__ */ jsx(ShareableListLayout, {
|
|
858
872
|
isLoading,
|
|
859
873
|
isEmpty: !error && products.length === 0 && !isFetchingNextPage && !hasNextPage,
|
|
860
|
-
emptyMessage: debouncedSearch ? "
|
|
874
|
+
emptyMessage: debouncedSearch ? t("products_search_no_results") : t("products_empty_default"),
|
|
861
875
|
filters: /* @__PURE__ */ jsxs("div", {
|
|
862
876
|
className: "flex items-center justify-end gap-2",
|
|
863
877
|
children: [/* @__PURE__ */ jsx("div", {
|
|
@@ -865,8 +879,8 @@ function ProductsScreen({ countryCode, fetchProducts: fetchPortalProducts, onNav
|
|
|
865
879
|
children: /* @__PURE__ */ jsx(SearchSort, {
|
|
866
880
|
searchValue: searchTerm,
|
|
867
881
|
onSearchChange: setSearchTerm,
|
|
868
|
-
placeholder: "
|
|
869
|
-
sortOptions: SORT_OPTIONS
|
|
882
|
+
placeholder: t("products_search_placeholder"),
|
|
883
|
+
sortOptions: SORT_OPTIONS,
|
|
870
884
|
sortValue,
|
|
871
885
|
onSortChange: setSortValue
|
|
872
886
|
})
|
|
@@ -893,7 +907,7 @@ function ProductsScreen({ countryCode, fetchProducts: fetchPortalProducts, onNav
|
|
|
893
907
|
children: products.map((product) => /* @__PURE__ */ jsx(ShareableListRow, {
|
|
894
908
|
imageUrl: product.image_url,
|
|
895
909
|
title: product.title,
|
|
896
|
-
subtitle: product.media_count != null ?
|
|
910
|
+
subtitle: product.media_count != null ? t("products_asset_count", { count: String(product.media_count) }) : void 0,
|
|
897
911
|
onClick: () => navigate(`product/${product.id}`)
|
|
898
912
|
}, product.id))
|
|
899
913
|
})
|
|
@@ -954,7 +968,9 @@ function SharePageImageDisplay({ displayImage, displayTitle, displayVideo, isVid
|
|
|
954
968
|
}
|
|
955
969
|
//#endregion
|
|
956
970
|
//#region ../../shareables/ui/src/components/QrCodeDisplay.tsx
|
|
957
|
-
function QrCodeDisplay({ url, alt
|
|
971
|
+
function QrCodeDisplay({ url, alt, size = "md", className = "" }) {
|
|
972
|
+
const { t } = useShareablesTranslation();
|
|
973
|
+
const resolvedAlt = alt ?? t("share_qr_code_default_alt");
|
|
958
974
|
const qrCodeUrl = useMemo(() => url ? `https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${encodeURIComponent(url)}` : "", [url]);
|
|
959
975
|
return /* @__PURE__ */ jsx("div", {
|
|
960
976
|
className: `flex ${{
|
|
@@ -964,13 +980,13 @@ function QrCodeDisplay({ url, alt = "QR Code", size = "md", className = "" }) {
|
|
|
964
980
|
}[size]} items-center justify-center overflow-hidden rounded-xl border border-gray-200 bg-white shadow-sm ${className}`,
|
|
965
981
|
children: qrCodeUrl ? /* @__PURE__ */ jsx("img", {
|
|
966
982
|
src: qrCodeUrl,
|
|
967
|
-
alt,
|
|
983
|
+
alt: resolvedAlt,
|
|
968
984
|
className: "h-full w-full object-cover",
|
|
969
985
|
loading: "lazy",
|
|
970
986
|
onError: (e) => {
|
|
971
987
|
e.currentTarget.style.display = "none";
|
|
972
988
|
const parent = e.currentTarget.parentElement;
|
|
973
|
-
if (parent) parent.title = "
|
|
989
|
+
if (parent) parent.title = t("share_qr_code_load_error");
|
|
974
990
|
}
|
|
975
991
|
}) : /* @__PURE__ */ jsx("div", {
|
|
976
992
|
className: "flex items-center justify-center text-gray-400",
|
|
@@ -1029,16 +1045,17 @@ function XTwitterIcon(props) {
|
|
|
1029
1045
|
//#region ../../shareables/ui/src/components/SharePage/ShareLinkSection.tsx
|
|
1030
1046
|
function ShareLinkSection({ shareLink, loading, displayTitle, isVideo, relateableId, relateableType }) {
|
|
1031
1047
|
const { showToast, onMySiteShare } = useShareablesUI();
|
|
1048
|
+
const { t } = useShareablesTranslation();
|
|
1032
1049
|
const handleCopyLink = async () => {
|
|
1033
1050
|
if (shareLink) try {
|
|
1034
1051
|
await navigator.clipboard.writeText(shareLink);
|
|
1035
1052
|
showToast({
|
|
1036
|
-
title: "
|
|
1053
|
+
title: t("share_link_copied"),
|
|
1037
1054
|
type: "success"
|
|
1038
1055
|
});
|
|
1039
1056
|
} catch (error) {
|
|
1040
1057
|
showToast({
|
|
1041
|
-
title: "
|
|
1058
|
+
title: t("share_link_copy_error"),
|
|
1042
1059
|
type: "error",
|
|
1043
1060
|
error
|
|
1044
1061
|
});
|
|
@@ -1047,7 +1064,7 @@ function ShareLinkSection({ shareLink, loading, displayTitle, isVideo, relateabl
|
|
|
1047
1064
|
const handlePlatformShare = async (platform) => {
|
|
1048
1065
|
if (!shareLink) {
|
|
1049
1066
|
showToast({
|
|
1050
|
-
title: "
|
|
1067
|
+
title: t("share_link_not_available"),
|
|
1051
1068
|
type: "error"
|
|
1052
1069
|
});
|
|
1053
1070
|
return;
|
|
@@ -1055,7 +1072,10 @@ function ShareLinkSection({ shareLink, loading, displayTitle, isVideo, relateabl
|
|
|
1055
1072
|
await handleSocialShare(platform.toLowerCase(), {
|
|
1056
1073
|
url: shareLink,
|
|
1057
1074
|
title: displayTitle,
|
|
1058
|
-
description:
|
|
1075
|
+
description: t("share_social_description", {
|
|
1076
|
+
type: isVideo ? "video" : "image",
|
|
1077
|
+
title: displayTitle
|
|
1078
|
+
})
|
|
1059
1079
|
}, (message) => showToast({
|
|
1060
1080
|
title: message,
|
|
1061
1081
|
type: "success"
|
|
@@ -1067,7 +1087,7 @@ function ShareLinkSection({ shareLink, loading, displayTitle, isVideo, relateabl
|
|
|
1067
1087
|
const handleMySiteShareClick = async () => {
|
|
1068
1088
|
if (!shareLink) {
|
|
1069
1089
|
showToast({
|
|
1070
|
-
title: "
|
|
1090
|
+
title: t("share_link_not_available"),
|
|
1071
1091
|
type: "error"
|
|
1072
1092
|
});
|
|
1073
1093
|
return;
|
|
@@ -1079,12 +1099,12 @@ function ShareLinkSection({ shareLink, loading, displayTitle, isVideo, relateabl
|
|
|
1079
1099
|
relateable_type: relateableType
|
|
1080
1100
|
});
|
|
1081
1101
|
showToast({
|
|
1082
|
-
title: "
|
|
1102
|
+
title: t("share_mysite_success"),
|
|
1083
1103
|
type: "success"
|
|
1084
1104
|
});
|
|
1085
1105
|
} catch (error) {
|
|
1086
1106
|
showToast({
|
|
1087
|
-
title: "
|
|
1107
|
+
title: t("share_mysite_error"),
|
|
1088
1108
|
type: "error",
|
|
1089
1109
|
error
|
|
1090
1110
|
});
|
|
@@ -1114,7 +1134,7 @@ function ShareLinkSection({ shareLink, loading, displayTitle, isVideo, relateabl
|
|
|
1114
1134
|
className: "flex items-center gap-3",
|
|
1115
1135
|
children: [/* @__PURE__ */ jsx("h3", {
|
|
1116
1136
|
className: "text-foreground shrink-0 text-sm font-semibold",
|
|
1117
|
-
children: "
|
|
1137
|
+
children: t("share_unique_link_heading")
|
|
1118
1138
|
}), /* @__PURE__ */ jsx("div", { className: "bg-foreground h-px flex-1" })]
|
|
1119
1139
|
}), /* @__PURE__ */ jsxs("div", {
|
|
1120
1140
|
className: "flex items-start gap-4",
|
|
@@ -1122,7 +1142,7 @@ function ShareLinkSection({ shareLink, loading, displayTitle, isVideo, relateabl
|
|
|
1122
1142
|
className: "bg-muted shrink-0 rounded-md p-2",
|
|
1123
1143
|
children: /* @__PURE__ */ jsx(QrCodeDisplay, {
|
|
1124
1144
|
url: shareLink,
|
|
1125
|
-
alt: "
|
|
1145
|
+
alt: t("share_qr_code_alt"),
|
|
1126
1146
|
size: "sm",
|
|
1127
1147
|
className: "h-[75px] w-[75px] rounded-none! border-none"
|
|
1128
1148
|
})
|
|
@@ -1135,14 +1155,14 @@ function ShareLinkSection({ shareLink, loading, displayTitle, isVideo, relateabl
|
|
|
1135
1155
|
variant: "secondary",
|
|
1136
1156
|
size: "sm",
|
|
1137
1157
|
className: "border-foreground bg-background text-foreground hover:bg-muted h-8 rounded-md border px-3 text-xs font-semibold transition-colors",
|
|
1138
|
-
children: "
|
|
1158
|
+
children: t("share_mysite_button")
|
|
1139
1159
|
}), isMobileDevice() ? /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
1140
1160
|
asChild: true,
|
|
1141
1161
|
children: /* @__PURE__ */ jsxs(Button, {
|
|
1142
1162
|
variant: "secondary",
|
|
1143
1163
|
size: "sm",
|
|
1144
1164
|
className: "border-foreground bg-background text-foreground hover:bg-muted h-8 rounded-md border px-3 text-xs font-semibold transition-colors",
|
|
1145
|
-
children: [/* @__PURE__ */ jsx(Menu, { className: "mr-1 h-3 w-3" }), "
|
|
1165
|
+
children: [/* @__PURE__ */ jsx(Menu, { className: "mr-1 h-3 w-3" }), t("share_button")]
|
|
1146
1166
|
})
|
|
1147
1167
|
}), /* @__PURE__ */ jsx(DropdownMenuContent, {
|
|
1148
1168
|
className: "w-48",
|
|
@@ -1163,7 +1183,7 @@ function ShareLinkSection({ shareLink, loading, displayTitle, isVideo, relateabl
|
|
|
1163
1183
|
style: { background: "linear-gradient(81.27deg, #E5F7FF 0.95%, #FFDBF5 34.5%, #FFE0CF 60.44%, #EDFFFB 75.06%, #FFDBF5 99.76%)" },
|
|
1164
1184
|
children: [/* @__PURE__ */ jsx("span", {
|
|
1165
1185
|
className: "flex-1 truncate text-sm text-[#344054]",
|
|
1166
|
-
children: shareLink || (loading ? "
|
|
1186
|
+
children: shareLink || (loading ? t("share_generating_link") : t("common_loading"))
|
|
1167
1187
|
}), /* @__PURE__ */ jsx(Button, {
|
|
1168
1188
|
onClick: handleCopyLink,
|
|
1169
1189
|
variant: "ghost",
|
|
@@ -1194,6 +1214,7 @@ async function downloadFile(url, filename) {
|
|
|
1194
1214
|
//#region ../../shareables/ui/src/components/SharePage/AssetActions.tsx
|
|
1195
1215
|
function AssetActions({ downloadUrl, displayTitle, shareLink, shareLinkLoading, isVideo, relateableId, relateableType }) {
|
|
1196
1216
|
const { onFileDownload } = useShareablesUI();
|
|
1217
|
+
const { t } = useShareablesTranslation();
|
|
1197
1218
|
const [isDownloading, setIsDownloading] = useState(false);
|
|
1198
1219
|
const handleDownload = useCallback(async () => {
|
|
1199
1220
|
if (!downloadUrl || isDownloading) return;
|
|
@@ -1221,7 +1242,7 @@ function AssetActions({ downloadUrl, displayTitle, shareLink, shareLinkLoading,
|
|
|
1221
1242
|
className: "bg-foreground text-background hover:bg-foreground/70 flex h-10 w-full items-center justify-between rounded-lg px-4 transition-all",
|
|
1222
1243
|
children: [/* @__PURE__ */ jsx("span", {
|
|
1223
1244
|
className: "text-sm font-medium",
|
|
1224
|
-
children: "
|
|
1245
|
+
children: t("share_download_asset")
|
|
1225
1246
|
}), /* @__PURE__ */ jsx(Download, { className: "h-4 w-4" })]
|
|
1226
1247
|
}), /* @__PURE__ */ jsx(ShareLinkSection, {
|
|
1227
1248
|
shareLink,
|
|
@@ -1235,25 +1256,21 @@ function AssetActions({ downloadUrl, displayTitle, shareLink, shareLinkLoading,
|
|
|
1235
1256
|
//#endregion
|
|
1236
1257
|
//#region ../../shareables/ui/src/components/ShareablesModal/MarketingAssetsGrid.tsx
|
|
1237
1258
|
const PLACEHOLDER_IMAGE = "https://assets.fluid.app/fluid-admin/images/placeholder.png";
|
|
1238
|
-
const FILTER_TABS = [
|
|
1239
|
-
"All",
|
|
1240
|
-
"Images",
|
|
1241
|
-
"Videos"
|
|
1242
|
-
];
|
|
1243
1259
|
const FilterTabs = React.memo(function FilterTabs({ tabs, activeTab, onTabChange }) {
|
|
1244
1260
|
return /* @__PURE__ */ jsx("div", {
|
|
1245
1261
|
className: "mb-3 flex gap-2",
|
|
1246
1262
|
children: tabs.map((tab) => /* @__PURE__ */ jsx(Button, {
|
|
1247
|
-
onClick: () => onTabChange(tab),
|
|
1263
|
+
onClick: () => onTabChange(tab.id),
|
|
1248
1264
|
variant: "secondary",
|
|
1249
1265
|
size: "sm",
|
|
1250
|
-
className: `inline-flex items-center gap-x-1.5 rounded-sm border-none px-2 py-1 text-xs font-medium capitalize shadow-none! transition-colors ${activeTab === tab ? "bg-primary text-primary-foreground ring-primary hover:bg-primary hover:text-primary-foreground hover:ring-primary" : "bg-muted text-foreground hover:bg-primary hover:text-primary-foreground hover:ring-primary"}`,
|
|
1251
|
-
children: tab
|
|
1252
|
-
}, tab))
|
|
1266
|
+
className: `inline-flex items-center gap-x-1.5 rounded-sm border-none px-2 py-1 text-xs font-medium capitalize shadow-none! transition-colors ${activeTab === tab.id ? "bg-primary text-primary-foreground ring-primary hover:bg-primary hover:text-primary-foreground hover:ring-primary" : "bg-muted text-foreground hover:bg-primary hover:text-primary-foreground hover:ring-primary"}`,
|
|
1267
|
+
children: tab.label
|
|
1268
|
+
}, tab.id))
|
|
1253
1269
|
});
|
|
1254
1270
|
});
|
|
1255
1271
|
const MediaCard = React.memo(function MediaCard({ mediaItem, onClick }) {
|
|
1256
1272
|
const renderImage = useRenderImage();
|
|
1273
|
+
const { t } = useShareablesTranslation();
|
|
1257
1274
|
const isVideo = mediaItem.kind === "video";
|
|
1258
1275
|
const isImage = mediaItem.kind === "image";
|
|
1259
1276
|
const MediaIcon = isVideo ? Play : isImage ? FileImage : Image;
|
|
@@ -1264,7 +1281,7 @@ const MediaCard = React.memo(function MediaCard({ mediaItem, onClick }) {
|
|
|
1264
1281
|
className: "bg-background relative aspect-[3/4] w-full overflow-hidden rounded-lg",
|
|
1265
1282
|
children: [renderImage({
|
|
1266
1283
|
src: mediaItem.image_url || PLACEHOLDER_IMAGE,
|
|
1267
|
-
alt: mediaItem.title || "
|
|
1284
|
+
alt: mediaItem.title || t("media_type_default"),
|
|
1268
1285
|
fill: true,
|
|
1269
1286
|
className: "object-cover"
|
|
1270
1287
|
}), /* @__PURE__ */ jsx("div", {
|
|
@@ -1276,25 +1293,28 @@ const MediaCard = React.memo(function MediaCard({ mediaItem, onClick }) {
|
|
|
1276
1293
|
})]
|
|
1277
1294
|
}), /* @__PURE__ */ jsx("h3", {
|
|
1278
1295
|
className: "text-foreground line-clamp-2 px-1 text-[15px] leading-[1.4] font-semibold",
|
|
1279
|
-
children: mediaItem.title || "
|
|
1296
|
+
children: mediaItem.title || t("common_untitled")
|
|
1280
1297
|
})]
|
|
1281
1298
|
});
|
|
1282
1299
|
});
|
|
1283
|
-
const LoadingState = React.memo(function LoadingState({ message
|
|
1300
|
+
const LoadingState = React.memo(function LoadingState({ message }) {
|
|
1301
|
+
const { t } = useShareablesTranslation();
|
|
1302
|
+
const resolvedMessage = message ?? t("share_loading_media");
|
|
1284
1303
|
return /* @__PURE__ */ jsxs("div", {
|
|
1285
1304
|
className: "flex flex-col items-center justify-center gap-3 py-12",
|
|
1286
1305
|
children: [/* @__PURE__ */ jsx(Spinner, { className: "size-8" }), /* @__PURE__ */ jsx("div", {
|
|
1287
1306
|
className: "text-muted-foreground text-sm",
|
|
1288
|
-
children:
|
|
1307
|
+
children: resolvedMessage
|
|
1289
1308
|
})]
|
|
1290
1309
|
});
|
|
1291
1310
|
});
|
|
1292
|
-
const ErrorState = React.memo(function ErrorState({ message
|
|
1311
|
+
const ErrorState = React.memo(function ErrorState({ message }) {
|
|
1312
|
+
const { t } = useShareablesTranslation();
|
|
1293
1313
|
return /* @__PURE__ */ jsx("div", {
|
|
1294
1314
|
className: "flex items-center justify-center",
|
|
1295
1315
|
children: /* @__PURE__ */ jsx("div", {
|
|
1296
1316
|
className: "text-sm text-red-500",
|
|
1297
|
-
children: message
|
|
1317
|
+
children: message ?? t("share_media_load_error")
|
|
1298
1318
|
})
|
|
1299
1319
|
});
|
|
1300
1320
|
});
|
|
@@ -1317,29 +1337,30 @@ const EmptyState = React.memo(function EmptyState({ message, icon, description }
|
|
|
1317
1337
|
});
|
|
1318
1338
|
});
|
|
1319
1339
|
const AnalyticsPlaceholder = React.memo(function AnalyticsPlaceholder() {
|
|
1340
|
+
const { t } = useShareablesTranslation();
|
|
1320
1341
|
return /* @__PURE__ */ jsx("div", {
|
|
1321
1342
|
className: "flex flex-1 items-center justify-center",
|
|
1322
1343
|
children: /* @__PURE__ */ jsxs("div", {
|
|
1323
1344
|
className: "text-center",
|
|
1324
1345
|
children: [/* @__PURE__ */ jsx("div", {
|
|
1325
1346
|
className: "mb-1 text-sm text-gray-500",
|
|
1326
|
-
children: "
|
|
1347
|
+
children: t("share_analytics_coming_soon")
|
|
1327
1348
|
}), /* @__PURE__ */ jsx("div", {
|
|
1328
1349
|
className: "text-xs text-gray-400",
|
|
1329
|
-
children: "
|
|
1350
|
+
children: t("share_analytics_description")
|
|
1330
1351
|
})]
|
|
1331
1352
|
})
|
|
1332
1353
|
});
|
|
1333
1354
|
});
|
|
1334
|
-
const RELATEABLE_TYPE_LABELS = {
|
|
1335
|
-
Product: "product",
|
|
1336
|
-
Medium: "media",
|
|
1337
|
-
EnrollmentPack: "enrollment pack",
|
|
1338
|
-
MySite: "site",
|
|
1339
|
-
Library: "library"
|
|
1340
|
-
};
|
|
1341
1355
|
const NoAssetsState = React.memo(function NoAssetsState({ relateable_type }) {
|
|
1342
|
-
const
|
|
1356
|
+
const { t } = useShareablesTranslation();
|
|
1357
|
+
const label = useMemo(() => ({
|
|
1358
|
+
Product: t("share_type_product"),
|
|
1359
|
+
Medium: t("share_type_media"),
|
|
1360
|
+
EnrollmentPack: t("share_type_enrollment_pack"),
|
|
1361
|
+
MySite: t("share_type_site"),
|
|
1362
|
+
Library: t("share_type_library")
|
|
1363
|
+
}), [t])[relateable_type] ?? "item";
|
|
1343
1364
|
return /* @__PURE__ */ jsx("div", {
|
|
1344
1365
|
className: "flex flex-1 items-center justify-center px-6",
|
|
1345
1366
|
children: /* @__PURE__ */ jsxs("div", {
|
|
@@ -1351,21 +1372,32 @@ const NoAssetsState = React.memo(function NoAssetsState({ relateable_type }) {
|
|
|
1351
1372
|
}),
|
|
1352
1373
|
/* @__PURE__ */ jsx("div", {
|
|
1353
1374
|
className: "mb-1 text-sm text-gray-500",
|
|
1354
|
-
children: "
|
|
1375
|
+
children: t("share_no_marketing_assets")
|
|
1355
1376
|
}),
|
|
1356
|
-
/* @__PURE__ */
|
|
1377
|
+
/* @__PURE__ */ jsx("div", {
|
|
1357
1378
|
className: "text-xs text-gray-400",
|
|
1358
|
-
children:
|
|
1359
|
-
"This ",
|
|
1360
|
-
label,
|
|
1361
|
-
" does not have any associated media"
|
|
1362
|
-
]
|
|
1379
|
+
children: t("share_no_associated_media", { label })
|
|
1363
1380
|
})
|
|
1364
1381
|
]
|
|
1365
1382
|
})
|
|
1366
1383
|
});
|
|
1367
1384
|
});
|
|
1368
1385
|
function MarketingAssetsGrid({ isLoading, error, activeTab, onTabChange, mediaItems, onMediaItemClick, showEmptyState = false, activeMainTab = "Related Sharables", relateable_type }) {
|
|
1386
|
+
const { t } = useShareablesTranslation();
|
|
1387
|
+
const FILTER_TABS = useMemo(() => [
|
|
1388
|
+
{
|
|
1389
|
+
id: "all",
|
|
1390
|
+
label: t("common_all")
|
|
1391
|
+
},
|
|
1392
|
+
{
|
|
1393
|
+
id: "images",
|
|
1394
|
+
label: t("media_filter_images")
|
|
1395
|
+
},
|
|
1396
|
+
{
|
|
1397
|
+
id: "videos",
|
|
1398
|
+
label: t("media_filter_videos")
|
|
1399
|
+
}
|
|
1400
|
+
], [t]);
|
|
1369
1401
|
const handleMediaItemClick = useCallback((mediaItem) => {
|
|
1370
1402
|
onMediaItemClick(mediaItem);
|
|
1371
1403
|
}, [onMediaItemClick]);
|
|
@@ -1374,13 +1406,9 @@ function MarketingAssetsGrid({ isLoading, error, activeTab, onTabChange, mediaIt
|
|
|
1374
1406
|
if (activeMainTab === "Analytics" && relateable_type === "Medium") return /* @__PURE__ */ jsx(AnalyticsPlaceholder, {});
|
|
1375
1407
|
if (activeMainTab === "Related Sharables") return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("div", {
|
|
1376
1408
|
className: "mb-4 px-4 pt-4",
|
|
1377
|
-
children: /* @__PURE__ */
|
|
1409
|
+
children: /* @__PURE__ */ jsx("h2", {
|
|
1378
1410
|
className: "text-foreground text-[15px] leading-[1.4] font-semibold",
|
|
1379
|
-
children:
|
|
1380
|
-
"Related Sharables (",
|
|
1381
|
-
mediaItems.length,
|
|
1382
|
-
")"
|
|
1383
|
-
]
|
|
1411
|
+
children: t("share_related_sharables_count", { count: String(mediaItems.length) })
|
|
1384
1412
|
})
|
|
1385
1413
|
}), /* @__PURE__ */ jsxs("div", {
|
|
1386
1414
|
className: "px-4 pb-4",
|
|
@@ -1399,7 +1427,7 @@ function MarketingAssetsGrid({ isLoading, error, activeTab, onTabChange, mediaIt
|
|
|
1399
1427
|
onClick: handleMediaItemClick
|
|
1400
1428
|
}, mediaItem.id))
|
|
1401
1429
|
}),
|
|
1402
|
-
!isLoading && !error && mediaItems.length === 0 && /* @__PURE__ */ jsx(EmptyState, { message:
|
|
1430
|
+
!isLoading && !error && mediaItems.length === 0 && /* @__PURE__ */ jsx(EmptyState, { message: t("share_no_tab_items_found", { tab: (FILTER_TABS.find((tab) => tab.id === activeTab)?.label ?? activeTab).toLowerCase() }) })
|
|
1403
1431
|
]
|
|
1404
1432
|
})] });
|
|
1405
1433
|
return null;
|
|
@@ -1426,7 +1454,9 @@ var MarketingAssetsGrid_default = React.memo(MarketingAssetsGrid);
|
|
|
1426
1454
|
* NOT touch the shell header. Dialogs (delete confirmation, etc.) belong to
|
|
1427
1455
|
* the caller and should be rendered as siblings to this component.
|
|
1428
1456
|
*/
|
|
1429
|
-
function ShareableDetailLayout({ isLoading, notFound, notFoundMessage
|
|
1457
|
+
function ShareableDetailLayout({ isLoading, notFound, notFoundMessage, title, description, image, actions, meta, children, containerHeightClass = "md:h-[calc(100vh-140px)]" }) {
|
|
1458
|
+
const { t } = useShareablesTranslation();
|
|
1459
|
+
const resolvedNotFoundMessage = notFoundMessage ?? t("common_not_found_default");
|
|
1430
1460
|
if (isLoading) return /* @__PURE__ */ jsx("div", {
|
|
1431
1461
|
className: "flex items-center justify-center py-16",
|
|
1432
1462
|
children: /* @__PURE__ */ jsx(Spinner, { className: "size-8" })
|
|
@@ -1435,7 +1465,7 @@ function ShareableDetailLayout({ isLoading, notFound, notFoundMessage = "Not fou
|
|
|
1435
1465
|
className: "flex flex-col items-center justify-center py-16",
|
|
1436
1466
|
children: /* @__PURE__ */ jsx("p", {
|
|
1437
1467
|
className: "text-destructive text-sm",
|
|
1438
|
-
children:
|
|
1468
|
+
children: resolvedNotFoundMessage
|
|
1439
1469
|
})
|
|
1440
1470
|
});
|
|
1441
1471
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -1469,6 +1499,7 @@ function ShareableDetailLayout({ isLoading, notFound, notFoundMessage = "Not fou
|
|
|
1469
1499
|
* (e.g. mediaItem.description.body) — tags are stripped internally.
|
|
1470
1500
|
*/
|
|
1471
1501
|
function ShareableDescription({ html, threshold = 150 }) {
|
|
1502
|
+
const { t } = useShareablesTranslation();
|
|
1472
1503
|
const [isExpanded, setIsExpanded] = useState(false);
|
|
1473
1504
|
const stripped = stripTags(html ?? "");
|
|
1474
1505
|
if (!stripped) return null;
|
|
@@ -1483,7 +1514,7 @@ function ShareableDescription({ html, threshold = 150 }) {
|
|
|
1483
1514
|
variant: "ghost",
|
|
1484
1515
|
size: "sm",
|
|
1485
1516
|
className: "text-foreground hover:text-foreground/80 mt-1 h-auto p-0 text-xs font-normal underline",
|
|
1486
|
-
children: isExpanded ? "
|
|
1517
|
+
children: isExpanded ? t("common_read_less") : t("common_read_more")
|
|
1487
1518
|
})]
|
|
1488
1519
|
});
|
|
1489
1520
|
}
|
|
@@ -1493,7 +1524,8 @@ function ProductDetailScreen({ productId, countryCode, fetchProduct: fetchPortal
|
|
|
1493
1524
|
const api = useShareablesApi();
|
|
1494
1525
|
const client = useShareablesClient();
|
|
1495
1526
|
const { navigate } = useShareablesUI();
|
|
1496
|
-
const
|
|
1527
|
+
const { t } = useShareablesTranslation();
|
|
1528
|
+
const [activeTab, setActiveTab] = useState("all");
|
|
1497
1529
|
const { data: portalProductResponse, isLoading: isLoadingPortalProduct } = useQuery({
|
|
1498
1530
|
queryKey: [
|
|
1499
1531
|
"portal-products",
|
|
@@ -1543,9 +1575,9 @@ function ProductDetailScreen({ productId, countryCode, fetchProduct: fetchPortal
|
|
|
1543
1575
|
}
|
|
1544
1576
|
})();
|
|
1545
1577
|
const filteredMediaItems = (productMediaResponse?.media ?? []).filter((item) => {
|
|
1546
|
-
if (activeTab === "
|
|
1547
|
-
if (activeTab === "
|
|
1548
|
-
if (activeTab === "
|
|
1578
|
+
if (activeTab === "all") return true;
|
|
1579
|
+
if (activeTab === "images") return item.kind === "image";
|
|
1580
|
+
if (activeTab === "videos") return item.kind === "video";
|
|
1549
1581
|
return true;
|
|
1550
1582
|
}).map((item) => ({
|
|
1551
1583
|
id: item.id,
|
|
@@ -1568,18 +1600,18 @@ function ProductDetailScreen({ productId, countryCode, fetchProduct: fetchPortal
|
|
|
1568
1600
|
e.preventDefault();
|
|
1569
1601
|
(onBack ?? (() => navigate("products")))();
|
|
1570
1602
|
},
|
|
1571
|
-
children: "
|
|
1603
|
+
children: t("products_breadcrumb")
|
|
1572
1604
|
}) }),
|
|
1573
1605
|
/* @__PURE__ */ jsx(BreadcrumbSeparator, {}),
|
|
1574
1606
|
/* @__PURE__ */ jsx(BreadcrumbItem, { children: /* @__PURE__ */ jsx(BreadcrumbPage, {
|
|
1575
1607
|
className: "font-semibold",
|
|
1576
|
-
children: displayTitle || "
|
|
1608
|
+
children: displayTitle || t("products_breadcrumb_fallback")
|
|
1577
1609
|
}) })
|
|
1578
1610
|
]
|
|
1579
1611
|
}) }) }), /* @__PURE__ */ jsxs(ShareableDetailLayout, {
|
|
1580
1612
|
isLoading: isLoadingProduct,
|
|
1581
1613
|
notFound: !product,
|
|
1582
|
-
notFoundMessage: "
|
|
1614
|
+
notFoundMessage: t("products_not_found"),
|
|
1583
1615
|
title: displayTitle,
|
|
1584
1616
|
description: displayDescription,
|
|
1585
1617
|
image: /* @__PURE__ */ jsx("div", {
|
|
@@ -1593,11 +1625,11 @@ function ProductDetailScreen({ productId, countryCode, fetchProduct: fetchPortal
|
|
|
1593
1625
|
}),
|
|
1594
1626
|
/* @__PURE__ */ jsx("div", {
|
|
1595
1627
|
className: "mb-1 text-sm text-gray-500",
|
|
1596
|
-
children: "
|
|
1628
|
+
children: t("products_no_image")
|
|
1597
1629
|
}),
|
|
1598
1630
|
/* @__PURE__ */ jsx("div", {
|
|
1599
1631
|
className: "text-xs text-gray-400",
|
|
1600
|
-
children: "
|
|
1632
|
+
children: t("products_no_media")
|
|
1601
1633
|
})
|
|
1602
1634
|
]
|
|
1603
1635
|
}) : /* @__PURE__ */ jsx(SharePageImageDisplay, {
|
|
@@ -1612,7 +1644,7 @@ function ProductDetailScreen({ productId, countryCode, fetchProduct: fetchPortal
|
|
|
1612
1644
|
children: [
|
|
1613
1645
|
/* @__PURE__ */ jsx("span", {
|
|
1614
1646
|
className: "font-semibold",
|
|
1615
|
-
children: "
|
|
1647
|
+
children: t("products_price_label")
|
|
1616
1648
|
}),
|
|
1617
1649
|
/* @__PURE__ */ jsx("span", { children: "|" }),
|
|
1618
1650
|
/* @__PURE__ */ jsx("span", {
|
|
@@ -1648,29 +1680,36 @@ function ProductDetailScreen({ productId, countryCode, fetchProduct: fetchPortal
|
|
|
1648
1680
|
}
|
|
1649
1681
|
//#endregion
|
|
1650
1682
|
//#region ../../shareables/ui/src/components/OwnerFilterTabs.tsx
|
|
1651
|
-
function getFilteredEmptyMessage({ searchTerm, ownerFilter, hasOtherFilters = false, entityName = "items", defaultMessage = "Nothing available at the moment." }) {
|
|
1683
|
+
function getFilteredEmptyMessage({ searchTerm, ownerFilter, hasOtherFilters = false, entityName = "items", defaultMessage = "Nothing available at the moment.", messages }) {
|
|
1652
1684
|
const isFiltered = ownerFilter !== "all" || hasOtherFilters;
|
|
1685
|
+
if (messages) {
|
|
1686
|
+
if (searchTerm && isFiltered) return messages.filterSearchNoResults;
|
|
1687
|
+
if (searchTerm) return messages.searchNoResults;
|
|
1688
|
+
if (isFiltered) return messages.filterNoResults;
|
|
1689
|
+
return defaultMessage;
|
|
1690
|
+
}
|
|
1653
1691
|
if (searchTerm && isFiltered) return `No ${entityName} match "${searchTerm}" with the current filters. Try a different search term or switch to "All".`;
|
|
1654
1692
|
if (searchTerm) return `No ${entityName} match "${searchTerm}". Try a different search term.`;
|
|
1655
1693
|
if (isFiltered) return `No matching ${entityName} for the current filters.`;
|
|
1656
1694
|
return defaultMessage;
|
|
1657
1695
|
}
|
|
1658
|
-
function OwnerFilterTabs({ value, onValueChange, myLabel
|
|
1696
|
+
function OwnerFilterTabs({ value, onValueChange, myLabel }) {
|
|
1697
|
+
const { t } = useShareablesTranslation();
|
|
1659
1698
|
return /* @__PURE__ */ jsx(Tabs, {
|
|
1660
1699
|
value,
|
|
1661
1700
|
onValueChange: (v) => onValueChange(v),
|
|
1662
1701
|
children: /* @__PURE__ */ jsxs(TabsList, { children: [
|
|
1663
1702
|
/* @__PURE__ */ jsx(TabsTrigger, {
|
|
1664
1703
|
value: "all",
|
|
1665
|
-
children: "
|
|
1704
|
+
children: t("common_all")
|
|
1666
1705
|
}),
|
|
1667
1706
|
/* @__PURE__ */ jsx(TabsTrigger, {
|
|
1668
1707
|
value: "mine",
|
|
1669
|
-
children: myLabel
|
|
1708
|
+
children: myLabel ?? t("common_mine")
|
|
1670
1709
|
}),
|
|
1671
1710
|
/* @__PURE__ */ jsx(TabsTrigger, {
|
|
1672
1711
|
value: "company",
|
|
1673
|
-
children: "
|
|
1712
|
+
children: t("common_company")
|
|
1674
1713
|
})
|
|
1675
1714
|
] })
|
|
1676
1715
|
});
|
|
@@ -1678,17 +1717,18 @@ function OwnerFilterTabs({ value, onValueChange, myLabel = "Mine" }) {
|
|
|
1678
1717
|
//#endregion
|
|
1679
1718
|
//#region ../../shareables/ui/src/components/screens/MediaListingScreen.tsx
|
|
1680
1719
|
const PAGE_SIZE$5 = 24;
|
|
1681
|
-
function getMediaKindLabel(kind) {
|
|
1720
|
+
function getMediaKindLabel(kind, labels) {
|
|
1682
1721
|
switch (kind) {
|
|
1683
|
-
case "video": return
|
|
1684
|
-
case "pdf": return
|
|
1685
|
-
default: return
|
|
1722
|
+
case "video": return labels.video;
|
|
1723
|
+
case "pdf": return labels.pdf;
|
|
1724
|
+
default: return labels.image;
|
|
1686
1725
|
}
|
|
1687
1726
|
}
|
|
1688
1727
|
/** Three-dot dropdown attached to each media row/card — currently just
|
|
1689
1728
|
* exposes "Delete", but kept as its own component so future actions
|
|
1690
1729
|
* (Duplicate, Archive, etc.) slot in cleanly. */
|
|
1691
1730
|
function MediaRowActionsMenu({ onDelete }) {
|
|
1731
|
+
const { t } = useShareablesTranslation();
|
|
1692
1732
|
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
1693
1733
|
asChild: true,
|
|
1694
1734
|
children: /* @__PURE__ */ jsx(Button, {
|
|
@@ -1698,7 +1738,7 @@ function MediaRowActionsMenu({ onDelete }) {
|
|
|
1698
1738
|
onClick: (e) => {
|
|
1699
1739
|
e.stopPropagation();
|
|
1700
1740
|
},
|
|
1701
|
-
"aria-label": "
|
|
1741
|
+
"aria-label": t("media_actions_aria"),
|
|
1702
1742
|
children: /* @__PURE__ */ jsx(MoreVertical, { className: "h-4 w-4" })
|
|
1703
1743
|
})
|
|
1704
1744
|
}), /* @__PURE__ */ jsx(DropdownMenuContent, {
|
|
@@ -1707,11 +1747,12 @@ function MediaRowActionsMenu({ onDelete }) {
|
|
|
1707
1747
|
children: /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
1708
1748
|
onClick: onDelete,
|
|
1709
1749
|
className: "text-destructive focus:text-destructive",
|
|
1710
|
-
children: [/* @__PURE__ */ jsx(Trash2, { className: "mr-2 h-4 w-4" }), "
|
|
1750
|
+
children: [/* @__PURE__ */ jsx(Trash2, { className: "mr-2 h-4 w-4" }), t("common_delete")]
|
|
1711
1751
|
})
|
|
1712
1752
|
})] });
|
|
1713
1753
|
}
|
|
1714
1754
|
function MediaListingScreen(_props) {
|
|
1755
|
+
const { t } = useShareablesTranslation();
|
|
1715
1756
|
const api = useShareablesApi();
|
|
1716
1757
|
const repContext = useRepContext();
|
|
1717
1758
|
const queryClient = useQueryClient();
|
|
@@ -1733,7 +1774,7 @@ function MediaListingScreen(_props) {
|
|
|
1733
1774
|
mutationFn: (id) => api.media.deleteMedia(id),
|
|
1734
1775
|
onSuccess: () => {
|
|
1735
1776
|
showToast({
|
|
1736
|
-
title: "
|
|
1777
|
+
title: t("media_delete_success"),
|
|
1737
1778
|
type: "success"
|
|
1738
1779
|
});
|
|
1739
1780
|
queryClient.invalidateQueries({ queryKey: shareablesKeys.media.all });
|
|
@@ -1741,7 +1782,7 @@ function MediaListingScreen(_props) {
|
|
|
1741
1782
|
},
|
|
1742
1783
|
onError: (error) => {
|
|
1743
1784
|
showToast({
|
|
1744
|
-
title:
|
|
1785
|
+
title: t("media_delete_error", { message: error.message }),
|
|
1745
1786
|
type: "error",
|
|
1746
1787
|
error
|
|
1747
1788
|
});
|
|
@@ -1785,7 +1826,7 @@ function MediaListingScreen(_props) {
|
|
|
1785
1826
|
children: [/* @__PURE__ */ jsx(OwnerFilterTabs, {
|
|
1786
1827
|
value: ownerFilter,
|
|
1787
1828
|
onValueChange: setOwnerFilter,
|
|
1788
|
-
myLabel: "
|
|
1829
|
+
myLabel: t("media_my_media_tab")
|
|
1789
1830
|
}), /* @__PURE__ */ jsxs("div", {
|
|
1790
1831
|
className: "ml-auto flex items-center gap-2",
|
|
1791
1832
|
children: [
|
|
@@ -1794,18 +1835,18 @@ function MediaListingScreen(_props) {
|
|
|
1794
1835
|
children: /* @__PURE__ */ jsx(SearchSort, {
|
|
1795
1836
|
searchValue: searchTerm,
|
|
1796
1837
|
onSearchChange: setSearchTerm,
|
|
1797
|
-
placeholder: "
|
|
1838
|
+
placeholder: t("media_search_placeholder"),
|
|
1798
1839
|
sortOptions: [
|
|
1799
1840
|
{
|
|
1800
|
-
label: "
|
|
1841
|
+
label: t("sort_newest"),
|
|
1801
1842
|
value: "newest"
|
|
1802
1843
|
},
|
|
1803
1844
|
{
|
|
1804
|
-
label: "
|
|
1845
|
+
label: t("sort_name_asc"),
|
|
1805
1846
|
value: "title_asc"
|
|
1806
1847
|
},
|
|
1807
1848
|
{
|
|
1808
|
-
label: "
|
|
1849
|
+
label: t("sort_name_desc"),
|
|
1809
1850
|
value: "title_desc"
|
|
1810
1851
|
}
|
|
1811
1852
|
],
|
|
@@ -1817,29 +1858,29 @@ function MediaListingScreen(_props) {
|
|
|
1817
1858
|
asChild: true,
|
|
1818
1859
|
children: /* @__PURE__ */ jsxs(Button, {
|
|
1819
1860
|
variant: "outline",
|
|
1820
|
-
"aria-label": `Filter: ${kindFilter === "all" ? "
|
|
1861
|
+
"aria-label": `Filter: ${kindFilter === "all" ? t("media_filter_all_types") : kindFilter}`,
|
|
1821
1862
|
children: [/* @__PURE__ */ jsx(Filter, { className: "size-4" }), /* @__PURE__ */ jsx("span", {
|
|
1822
1863
|
className: "hidden sm:inline",
|
|
1823
|
-
children: kindFilter === "all" ? "
|
|
1864
|
+
children: kindFilter === "all" ? t("media_filter_all_types") : kindFilter === "image" ? t("media_filter_images") : kindFilter === "video" ? t("media_filter_videos") : t("media_filter_pdfs")
|
|
1824
1865
|
})]
|
|
1825
1866
|
})
|
|
1826
1867
|
}), /* @__PURE__ */ jsx(DropdownMenuContent, {
|
|
1827
1868
|
align: "end",
|
|
1828
1869
|
children: [
|
|
1829
1870
|
{
|
|
1830
|
-
label: "
|
|
1871
|
+
label: t("media_filter_all_types"),
|
|
1831
1872
|
value: "all"
|
|
1832
1873
|
},
|
|
1833
1874
|
{
|
|
1834
|
-
label: "
|
|
1875
|
+
label: t("media_filter_images"),
|
|
1835
1876
|
value: "image"
|
|
1836
1877
|
},
|
|
1837
1878
|
{
|
|
1838
|
-
label: "
|
|
1879
|
+
label: t("media_filter_videos"),
|
|
1839
1880
|
value: "video"
|
|
1840
1881
|
},
|
|
1841
1882
|
{
|
|
1842
|
-
label: "
|
|
1883
|
+
label: t("media_filter_pdfs"),
|
|
1843
1884
|
value: "pdf"
|
|
1844
1885
|
}
|
|
1845
1886
|
].map((opt) => /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
@@ -1862,19 +1903,19 @@ function MediaListingScreen(_props) {
|
|
|
1862
1903
|
children: /* @__PURE__ */ jsx("div", { className: "border-primary h-6 w-6 animate-spin rounded-full border-2 border-t-transparent" })
|
|
1863
1904
|
}), error && /* @__PURE__ */ jsxs("p", {
|
|
1864
1905
|
className: "bg-destructive/10 text-destructive rounded-lg px-3 py-2",
|
|
1865
|
-
children: ["
|
|
1906
|
+
children: [t("common_error_prefix"), error.message]
|
|
1866
1907
|
})] });
|
|
1867
1908
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
1868
1909
|
/* @__PURE__ */ jsx(ScreenHeaderActions, { children: readOnly ? null : /* @__PURE__ */ jsxs(Button, {
|
|
1869
1910
|
onClick: () => navigate("media/new"),
|
|
1870
1911
|
size: "sm",
|
|
1871
|
-
children: [/* @__PURE__ */ jsx(Plus, { className: "mr-1 h-4 w-4" }), "
|
|
1912
|
+
children: [/* @__PURE__ */ jsx(Plus, { className: "mr-1 h-4 w-4" }), t("media_add_button")]
|
|
1872
1913
|
}) }),
|
|
1873
1914
|
/* @__PURE__ */ jsx(ScreenHeaderBreadcrumbs, { children: /* @__PURE__ */ jsx(Breadcrumb, { children: /* @__PURE__ */ jsx(BreadcrumbList, {
|
|
1874
1915
|
className: "text-lg",
|
|
1875
1916
|
children: /* @__PURE__ */ jsx(BreadcrumbItem, { children: /* @__PURE__ */ jsx(BreadcrumbPage, {
|
|
1876
1917
|
className: "font-semibold",
|
|
1877
|
-
children: "
|
|
1918
|
+
children: t("media_breadcrumb")
|
|
1878
1919
|
}) })
|
|
1879
1920
|
}) }) }),
|
|
1880
1921
|
/* @__PURE__ */ jsx(ShareableListLayout, {
|
|
@@ -1885,7 +1926,18 @@ function MediaListingScreen(_props) {
|
|
|
1885
1926
|
ownerFilter,
|
|
1886
1927
|
hasOtherFilters: kindFilter !== "all",
|
|
1887
1928
|
entityName: "media",
|
|
1888
|
-
defaultMessage: "
|
|
1929
|
+
defaultMessage: t("media_empty_default"),
|
|
1930
|
+
messages: {
|
|
1931
|
+
filterSearchNoResults: t("common_filter_search_no_results", {
|
|
1932
|
+
entityName: "media",
|
|
1933
|
+
searchTerm: debouncedSearch
|
|
1934
|
+
}),
|
|
1935
|
+
searchNoResults: t("common_search_no_results", {
|
|
1936
|
+
entityName: "media",
|
|
1937
|
+
searchTerm: debouncedSearch
|
|
1938
|
+
}),
|
|
1939
|
+
filterNoResults: t("common_filter_no_results", { entityName: "media" })
|
|
1940
|
+
}
|
|
1889
1941
|
}),
|
|
1890
1942
|
filters: filterBar,
|
|
1891
1943
|
footer,
|
|
@@ -1901,14 +1953,22 @@ function MediaListingScreen(_props) {
|
|
|
1901
1953
|
title: item.title ?? "",
|
|
1902
1954
|
imageUrl: item.image_url,
|
|
1903
1955
|
href: `media/${item.id}`,
|
|
1904
|
-
badge: { text: getMediaKindLabel(item.kind
|
|
1956
|
+
badge: { text: getMediaKindLabel(item.kind, {
|
|
1957
|
+
video: t("media_type_video"),
|
|
1958
|
+
pdf: t("media_type_pdf"),
|
|
1959
|
+
image: t("media_type_image")
|
|
1960
|
+
}) },
|
|
1905
1961
|
isVideo: item.kind === "video",
|
|
1906
1962
|
subtitle: /* @__PURE__ */ jsxs("span", {
|
|
1907
1963
|
className: "flex items-center gap-1.5",
|
|
1908
|
-
children: [getMediaKindLabel(item.kind
|
|
1964
|
+
children: [getMediaKindLabel(item.kind, {
|
|
1965
|
+
video: t("media_type_video"),
|
|
1966
|
+
pdf: t("media_type_pdf"),
|
|
1967
|
+
image: t("media_type_image")
|
|
1968
|
+
}), item.owner_type === "user" && /* @__PURE__ */ jsx(Badge, {
|
|
1909
1969
|
variant: "secondary",
|
|
1910
1970
|
className: "px-1.5 py-0 text-[10px] leading-4",
|
|
1911
|
-
children: "
|
|
1971
|
+
children: t("media_my_media_badge")
|
|
1912
1972
|
})]
|
|
1913
1973
|
})
|
|
1914
1974
|
}), canEdit && /* @__PURE__ */ jsx("div", {
|
|
@@ -1924,8 +1984,12 @@ function MediaListingScreen(_props) {
|
|
|
1924
1984
|
return /* @__PURE__ */ jsx(ShareableListRow, {
|
|
1925
1985
|
imageUrl: item.image_url,
|
|
1926
1986
|
imageAlt: item.title ?? "",
|
|
1927
|
-
title: item.title ?? "
|
|
1928
|
-
subtitle: /* @__PURE__ */ jsxs(Fragment$1, { children: [getMediaKindLabel(item.kind
|
|
1987
|
+
title: item.title ?? t("common_untitled"),
|
|
1988
|
+
subtitle: /* @__PURE__ */ jsxs(Fragment$1, { children: [getMediaKindLabel(item.kind, {
|
|
1989
|
+
video: t("media_type_video"),
|
|
1990
|
+
pdf: t("media_type_pdf"),
|
|
1991
|
+
image: t("media_type_image")
|
|
1992
|
+
}), item.owner_type === "user" && /* @__PURE__ */ jsx(Badge, {
|
|
1929
1993
|
variant: "secondary",
|
|
1930
1994
|
className: "px-1.5 py-0 text-[10px] leading-4",
|
|
1931
1995
|
children: "My Media"
|
|
@@ -1939,9 +2003,9 @@ function MediaListingScreen(_props) {
|
|
|
1939
2003
|
/* @__PURE__ */ jsx(AlertDialog, {
|
|
1940
2004
|
open: pendingDeleteId !== null,
|
|
1941
2005
|
onOpenChange: (open) => !open && setPendingDeleteId(null),
|
|
1942
|
-
children: /* @__PURE__ */ jsxs(AlertDialogContent, { children: [/* @__PURE__ */ jsxs(AlertDialogHeader, { children: [/* @__PURE__ */ jsx(AlertDialogTitle, { children: "
|
|
2006
|
+
children: /* @__PURE__ */ jsxs(AlertDialogContent, { children: [/* @__PURE__ */ jsxs(AlertDialogHeader, { children: [/* @__PURE__ */ jsx(AlertDialogTitle, { children: t("media_delete_confirm_title") }), /* @__PURE__ */ jsx(AlertDialogDescription, { children: t("media_delete_confirm_description") })] }), /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [/* @__PURE__ */ jsx(AlertDialogCancel, {
|
|
1943
2007
|
disabled: isDeleting,
|
|
1944
|
-
children: "
|
|
2008
|
+
children: t("common_cancel")
|
|
1945
2009
|
}), /* @__PURE__ */ jsx(AlertDialogAction, {
|
|
1946
2010
|
onClick: (e) => {
|
|
1947
2011
|
e.preventDefault();
|
|
@@ -1949,7 +2013,7 @@ function MediaListingScreen(_props) {
|
|
|
1949
2013
|
},
|
|
1950
2014
|
disabled: isDeleting,
|
|
1951
2015
|
className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
1952
|
-
children: isDeleting ? /* @__PURE__ */ jsx(Spinner, { className: "size-4" }) : "
|
|
2016
|
+
children: isDeleting ? /* @__PURE__ */ jsx(Spinner, { className: "size-4" }) : t("common_delete")
|
|
1953
2017
|
})] })] })
|
|
1954
2018
|
})
|
|
1955
2019
|
] });
|
|
@@ -1972,6 +2036,7 @@ function resolvePrice(product) {
|
|
|
1972
2036
|
}
|
|
1973
2037
|
function TaggedProductsList({ products, onProductClick }) {
|
|
1974
2038
|
const renderImage = useRenderImage();
|
|
2039
|
+
const { t } = useShareablesTranslation();
|
|
1975
2040
|
const handleProductClick = (productId, e) => {
|
|
1976
2041
|
e.stopPropagation();
|
|
1977
2042
|
if (productId == null) return;
|
|
@@ -1983,7 +2048,7 @@ function TaggedProductsList({ products, onProductClick }) {
|
|
|
1983
2048
|
className: "mb-4 px-4",
|
|
1984
2049
|
children: /* @__PURE__ */ jsx("h2", {
|
|
1985
2050
|
className: "text-foreground text-[15px] leading-[1.4] font-semibold",
|
|
1986
|
-
children: "
|
|
2051
|
+
children: t("share_tagged_products_count", { count: "0" })
|
|
1987
2052
|
})
|
|
1988
2053
|
}), /* @__PURE__ */ jsx("div", {
|
|
1989
2054
|
className: "flex flex-1 items-center justify-center px-6 py-12",
|
|
@@ -1996,11 +2061,11 @@ function TaggedProductsList({ products, onProductClick }) {
|
|
|
1996
2061
|
}),
|
|
1997
2062
|
/* @__PURE__ */ jsx("div", {
|
|
1998
2063
|
className: "text-foreground mb-1 text-sm",
|
|
1999
|
-
children: "
|
|
2064
|
+
children: t("share_no_tagged_products")
|
|
2000
2065
|
}),
|
|
2001
2066
|
/* @__PURE__ */ jsx("div", {
|
|
2002
2067
|
className: "text-muted-foreground text-xs",
|
|
2003
|
-
children: "
|
|
2068
|
+
children: t("share_no_tagged_products_description")
|
|
2004
2069
|
})
|
|
2005
2070
|
]
|
|
2006
2071
|
})
|
|
@@ -2010,13 +2075,9 @@ function TaggedProductsList({ products, onProductClick }) {
|
|
|
2010
2075
|
className: "mb-6",
|
|
2011
2076
|
children: [/* @__PURE__ */ jsx("div", {
|
|
2012
2077
|
className: "mb-4 px-4",
|
|
2013
|
-
children: /* @__PURE__ */
|
|
2078
|
+
children: /* @__PURE__ */ jsx("h2", {
|
|
2014
2079
|
className: "text-foreground text-[15px] leading-[1.4] font-semibold",
|
|
2015
|
-
children:
|
|
2016
|
-
"Tagged Products (",
|
|
2017
|
-
products.length,
|
|
2018
|
-
")"
|
|
2019
|
-
]
|
|
2080
|
+
children: t("share_tagged_products_count", { count: String(products.length) })
|
|
2020
2081
|
})
|
|
2021
2082
|
}), /* @__PURE__ */ jsx("div", {
|
|
2022
2083
|
className: "px-4",
|
|
@@ -2024,7 +2085,7 @@ function TaggedProductsList({ products, onProductClick }) {
|
|
|
2024
2085
|
className: "scrollbar-none flex gap-4 overflow-x-auto pb-2",
|
|
2025
2086
|
children: products.map((product, index) => {
|
|
2026
2087
|
const imageUrl = product.images?.[0]?.image_url || product.image_url || product.compressed_image_url || DEFAULT_IMAGE$5;
|
|
2027
|
-
const title = product.title || "
|
|
2088
|
+
const title = product.title || t("common_untitled");
|
|
2028
2089
|
const displayPrice = resolvePrice(product);
|
|
2029
2090
|
return /* @__PURE__ */ jsxs("button", {
|
|
2030
2091
|
onClick: (e) => handleProductClick(product.id, e),
|
|
@@ -2058,15 +2119,16 @@ function TaggedProductsList({ products, onProductClick }) {
|
|
|
2058
2119
|
}
|
|
2059
2120
|
//#endregion
|
|
2060
2121
|
//#region ../../shareables/ui/src/components/screens/MediaDetailScreen.tsx
|
|
2061
|
-
function getBadgeLabel(kind) {
|
|
2122
|
+
function getBadgeLabel(kind, labels) {
|
|
2062
2123
|
switch (kind) {
|
|
2063
|
-
case "video": return
|
|
2064
|
-
case "image": return
|
|
2065
|
-
case "pdf": return
|
|
2066
|
-
default: return
|
|
2124
|
+
case "video": return labels.video;
|
|
2125
|
+
case "image": return labels.image;
|
|
2126
|
+
case "pdf": return labels.pdf;
|
|
2127
|
+
default: return labels.default;
|
|
2067
2128
|
}
|
|
2068
2129
|
}
|
|
2069
2130
|
function MediaDetailScreen({ mediaId, onNavigate, onBack }) {
|
|
2131
|
+
const { t } = useShareablesTranslation();
|
|
2070
2132
|
const api = useShareablesApi();
|
|
2071
2133
|
const repContext = useRepContext();
|
|
2072
2134
|
const { navigate, readOnly, mediaProductsApi } = useShareablesUI();
|
|
@@ -2093,7 +2155,12 @@ function MediaDetailScreen({ mediaId, onNavigate, onBack }) {
|
|
|
2093
2155
|
const displayImage = mediaItem?.image_url || "";
|
|
2094
2156
|
const displayVideo = mediaItem?.video_url || "";
|
|
2095
2157
|
const isVideo = mediaItem?.kind === "video" && !!displayVideo;
|
|
2096
|
-
const badgeLabel = getBadgeLabel(mediaItem?.kind ?? null
|
|
2158
|
+
const badgeLabel = getBadgeLabel(mediaItem?.kind ?? null, {
|
|
2159
|
+
video: t("media_type_video"),
|
|
2160
|
+
image: t("media_type_image"),
|
|
2161
|
+
pdf: t("media_type_pdf"),
|
|
2162
|
+
default: t("media_type_default")
|
|
2163
|
+
});
|
|
2097
2164
|
const rawDescription = mediaItem?.description?.body || mediaItem?.stripped || "";
|
|
2098
2165
|
const downloadUrl = isVideo ? displayVideo : mediaItem?.pdf_url || displayImage;
|
|
2099
2166
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
@@ -2106,12 +2173,12 @@ function MediaDetailScreen({ mediaId, onNavigate, onBack }) {
|
|
|
2106
2173
|
e.preventDefault();
|
|
2107
2174
|
(onBack ?? (() => navigate("media")))();
|
|
2108
2175
|
},
|
|
2109
|
-
children: "
|
|
2176
|
+
children: t("media_breadcrumb")
|
|
2110
2177
|
}) }),
|
|
2111
2178
|
/* @__PURE__ */ jsx(BreadcrumbSeparator, {}),
|
|
2112
2179
|
/* @__PURE__ */ jsx(BreadcrumbItem, { children: /* @__PURE__ */ jsx(BreadcrumbPage, {
|
|
2113
2180
|
className: "block max-w-[60vw] truncate align-bottom font-semibold md:max-w-[60ch]",
|
|
2114
|
-
children: displayTitle || "
|
|
2181
|
+
children: displayTitle || t("media_breadcrumb")
|
|
2115
2182
|
}) })
|
|
2116
2183
|
]
|
|
2117
2184
|
}) }) }),
|
|
@@ -2120,12 +2187,12 @@ function MediaDetailScreen({ mediaId, onNavigate, onBack }) {
|
|
|
2120
2187
|
variant: "outline",
|
|
2121
2188
|
onClick: () => navigate(`media/${mediaId}/edit`),
|
|
2122
2189
|
className: "flex items-center gap-1.5",
|
|
2123
|
-
children: [/* @__PURE__ */ jsx(Pencil, { className: "h-3.5 w-3.5" }), "
|
|
2190
|
+
children: [/* @__PURE__ */ jsx(Pencil, { className: "h-3.5 w-3.5" }), t("common_edit")]
|
|
2124
2191
|
}) }),
|
|
2125
2192
|
/* @__PURE__ */ jsx(ShareableDetailLayout, {
|
|
2126
2193
|
isLoading,
|
|
2127
2194
|
notFound: !mediaItem,
|
|
2128
|
-
notFoundMessage: "
|
|
2195
|
+
notFoundMessage: t("media_not_found"),
|
|
2129
2196
|
title: displayTitle,
|
|
2130
2197
|
description: rawDescription,
|
|
2131
2198
|
containerHeightClass: "md:h-[calc(95vh-140px)]",
|
|
@@ -7623,7 +7690,8 @@ function useThumbnailMeta(src) {
|
|
|
7623
7690
|
}
|
|
7624
7691
|
//#endregion
|
|
7625
7692
|
//#region ../../shareables/ui/src/components/playlists/RichTextEditor.tsx
|
|
7626
|
-
function RichTextEditor({ value, onChange, placeholder
|
|
7693
|
+
function RichTextEditor({ value, onChange, placeholder, className, editorClassName }) {
|
|
7694
|
+
const { t } = useShareablesTranslation();
|
|
7627
7695
|
const editor = useEditor({
|
|
7628
7696
|
extensions: [
|
|
7629
7697
|
StarterKit.configure({
|
|
@@ -7636,7 +7704,7 @@ function RichTextEditor({ value, onChange, placeholder = "Start writing...", cla
|
|
|
7636
7704
|
keepAttributes: false
|
|
7637
7705
|
}
|
|
7638
7706
|
}),
|
|
7639
|
-
Placeholder.configure({ placeholder }),
|
|
7707
|
+
Placeholder.configure({ placeholder: placeholder ?? t("common_start_writing_placeholder") }),
|
|
7640
7708
|
TextAlign.configure({
|
|
7641
7709
|
types: ["paragraph"],
|
|
7642
7710
|
alignments: [
|
|
@@ -7672,7 +7740,7 @@ function RichTextEditor({ value, onChange, placeholder = "Start writing...", cla
|
|
|
7672
7740
|
onClick: () => editor?.chain().focus().toggleBold().run(),
|
|
7673
7741
|
disabled: !editor?.can().chain().focus().toggleBold().run(),
|
|
7674
7742
|
className: cn(buttonBase, "font-bold", editor?.isActive("bold") ? buttonActive : buttonInactive),
|
|
7675
|
-
title: "
|
|
7743
|
+
title: t("editor_bold"),
|
|
7676
7744
|
children: "B"
|
|
7677
7745
|
}),
|
|
7678
7746
|
/* @__PURE__ */ jsx("button", {
|
|
@@ -7680,7 +7748,7 @@ function RichTextEditor({ value, onChange, placeholder = "Start writing...", cla
|
|
|
7680
7748
|
onClick: () => editor?.chain().focus().toggleItalic().run(),
|
|
7681
7749
|
disabled: !editor?.can().chain().focus().toggleItalic().run(),
|
|
7682
7750
|
className: cn(buttonBase, "italic", editor?.isActive("italic") ? buttonActive : buttonInactive),
|
|
7683
|
-
title: "
|
|
7751
|
+
title: t("editor_italic"),
|
|
7684
7752
|
children: "I"
|
|
7685
7753
|
}),
|
|
7686
7754
|
/* @__PURE__ */ jsx("button", {
|
|
@@ -7688,7 +7756,7 @@ function RichTextEditor({ value, onChange, placeholder = "Start writing...", cla
|
|
|
7688
7756
|
onClick: () => editor?.chain().focus().toggleUnderline().run(),
|
|
7689
7757
|
disabled: !editor?.can().chain().focus().toggleUnderline().run(),
|
|
7690
7758
|
className: cn(buttonBase, "underline", editor?.isActive("underline") ? buttonActive : buttonInactive),
|
|
7691
|
-
title: "
|
|
7759
|
+
title: t("editor_underline"),
|
|
7692
7760
|
children: "U"
|
|
7693
7761
|
}),
|
|
7694
7762
|
separator,
|
|
@@ -7696,28 +7764,28 @@ function RichTextEditor({ value, onChange, placeholder = "Start writing...", cla
|
|
|
7696
7764
|
type: "button",
|
|
7697
7765
|
onClick: () => editor?.chain().focus().setTextAlign("left").run(),
|
|
7698
7766
|
className: cn(buttonBase, editor?.isActive({ textAlign: "left" }) ? buttonActive : buttonInactive),
|
|
7699
|
-
title: "
|
|
7767
|
+
title: t("editor_align_left"),
|
|
7700
7768
|
children: /* @__PURE__ */ jsx(AlignLeft, { className: "h-3.5 w-3.5" })
|
|
7701
7769
|
}),
|
|
7702
7770
|
/* @__PURE__ */ jsx("button", {
|
|
7703
7771
|
type: "button",
|
|
7704
7772
|
onClick: () => editor?.chain().focus().setTextAlign("center").run(),
|
|
7705
7773
|
className: cn(buttonBase, editor?.isActive({ textAlign: "center" }) ? buttonActive : buttonInactive),
|
|
7706
|
-
title: "
|
|
7774
|
+
title: t("editor_align_center"),
|
|
7707
7775
|
children: /* @__PURE__ */ jsx(AlignCenter, { className: "h-3.5 w-3.5" })
|
|
7708
7776
|
}),
|
|
7709
7777
|
/* @__PURE__ */ jsx("button", {
|
|
7710
7778
|
type: "button",
|
|
7711
7779
|
onClick: () => editor?.chain().focus().setTextAlign("right").run(),
|
|
7712
7780
|
className: cn(buttonBase, editor?.isActive({ textAlign: "right" }) ? buttonActive : buttonInactive),
|
|
7713
|
-
title: "
|
|
7781
|
+
title: t("editor_align_right"),
|
|
7714
7782
|
children: /* @__PURE__ */ jsx(AlignRight, { className: "h-3.5 w-3.5" })
|
|
7715
7783
|
}),
|
|
7716
7784
|
/* @__PURE__ */ jsx("button", {
|
|
7717
7785
|
type: "button",
|
|
7718
7786
|
onClick: () => editor?.chain().focus().setTextAlign("justify").run(),
|
|
7719
7787
|
className: cn(buttonBase, editor?.isActive({ textAlign: "justify" }) ? buttonActive : buttonInactive),
|
|
7720
|
-
title: "
|
|
7788
|
+
title: t("editor_justify"),
|
|
7721
7789
|
children: /* @__PURE__ */ jsx(AlignJustify, { className: "h-3.5 w-3.5" })
|
|
7722
7790
|
}),
|
|
7723
7791
|
separator,
|
|
@@ -7725,14 +7793,14 @@ function RichTextEditor({ value, onChange, placeholder = "Start writing...", cla
|
|
|
7725
7793
|
type: "button",
|
|
7726
7794
|
onClick: () => editor?.chain().focus().toggleBulletList().run(),
|
|
7727
7795
|
className: cn(buttonBase, editor?.isActive("bulletList") ? buttonActive : buttonInactive),
|
|
7728
|
-
title: "
|
|
7796
|
+
title: t("editor_bullet_list"),
|
|
7729
7797
|
children: /* @__PURE__ */ jsx(List, { className: "h-3.5 w-3.5" })
|
|
7730
7798
|
}),
|
|
7731
7799
|
/* @__PURE__ */ jsx("button", {
|
|
7732
7800
|
type: "button",
|
|
7733
7801
|
onClick: () => editor?.chain().focus().toggleOrderedList().run(),
|
|
7734
7802
|
className: cn(buttonBase, editor?.isActive("orderedList") ? buttonActive : buttonInactive),
|
|
7735
|
-
title: "
|
|
7803
|
+
title: t("editor_ordered_list"),
|
|
7736
7804
|
children: /* @__PURE__ */ jsx(ListOrdered, { className: "h-3.5 w-3.5" })
|
|
7737
7805
|
})
|
|
7738
7806
|
]
|
|
@@ -7777,10 +7845,11 @@ function RichTextEditor({ value, onChange, placeholder = "Start writing...", cla
|
|
|
7777
7845
|
//#region ../../shareables/ui/src/components/media/MediaProductTagging.tsx
|
|
7778
7846
|
const PAGE_SIZE$3 = 25;
|
|
7779
7847
|
function ProductImage({ imageUrl, name }) {
|
|
7848
|
+
const { t } = useShareablesTranslation();
|
|
7780
7849
|
const [errored, setErrored] = useState(false);
|
|
7781
7850
|
if (imageUrl && imageUrl.length > 0 && !errored) return /* @__PURE__ */ jsx("img", {
|
|
7782
7851
|
src: imageUrl,
|
|
7783
|
-
alt: name ?? "
|
|
7852
|
+
alt: name ?? t("common_product"),
|
|
7784
7853
|
width: 40,
|
|
7785
7854
|
height: 40,
|
|
7786
7855
|
className: "h-10 w-10 shrink-0 rounded object-cover",
|
|
@@ -7792,6 +7861,7 @@ function ProductImage({ imageUrl, name }) {
|
|
|
7792
7861
|
});
|
|
7793
7862
|
}
|
|
7794
7863
|
function MediaProductTagging({ products, onAddProduct, onRemoveProduct, onSearchProducts, disabled = false, maxProducts = 100 }) {
|
|
7864
|
+
const { t } = useShareablesTranslation();
|
|
7795
7865
|
const { showToast } = useShareablesUI();
|
|
7796
7866
|
const [isModalOpen, setIsModalOpen] = useState(false);
|
|
7797
7867
|
const [query, setQuery] = useState("");
|
|
@@ -7816,7 +7886,7 @@ function MediaProductTagging({ products, onAddProduct, onRemoveProduct, onSearch
|
|
|
7816
7886
|
setSearchResults([]);
|
|
7817
7887
|
setNextCursor(null);
|
|
7818
7888
|
showToast({
|
|
7819
|
-
title: "
|
|
7889
|
+
title: t("products_load_error"),
|
|
7820
7890
|
type: "error",
|
|
7821
7891
|
error
|
|
7822
7892
|
});
|
|
@@ -7837,7 +7907,7 @@ function MediaProductTagging({ products, onAddProduct, onRemoveProduct, onSearch
|
|
|
7837
7907
|
} catch (error) {
|
|
7838
7908
|
setNextCursor(null);
|
|
7839
7909
|
showToast({
|
|
7840
|
-
title: "
|
|
7910
|
+
title: t("products_load_more_error"),
|
|
7841
7911
|
type: "error",
|
|
7842
7912
|
error
|
|
7843
7913
|
});
|
|
@@ -7896,7 +7966,7 @@ function MediaProductTagging({ products, onAddProduct, onRemoveProduct, onSearch
|
|
|
7896
7966
|
runSearch(query);
|
|
7897
7967
|
} catch (error) {
|
|
7898
7968
|
showToast({
|
|
7899
|
-
title: "
|
|
7969
|
+
title: t("products_add_error"),
|
|
7900
7970
|
type: "error",
|
|
7901
7971
|
error
|
|
7902
7972
|
});
|
|
@@ -7910,7 +7980,7 @@ function MediaProductTagging({ products, onAddProduct, onRemoveProduct, onSearch
|
|
|
7910
7980
|
await onRemoveProduct(productId);
|
|
7911
7981
|
} catch (error) {
|
|
7912
7982
|
showToast({
|
|
7913
|
-
title: "
|
|
7983
|
+
title: t("products_remove_error"),
|
|
7914
7984
|
type: "error",
|
|
7915
7985
|
error
|
|
7916
7986
|
});
|
|
@@ -7923,7 +7993,7 @@ function MediaProductTagging({ products, onAddProduct, onRemoveProduct, onSearch
|
|
|
7923
7993
|
children: [
|
|
7924
7994
|
/* @__PURE__ */ jsx("h3", {
|
|
7925
7995
|
className: "text-foreground mb-4 text-base font-semibold",
|
|
7926
|
-
children: "
|
|
7996
|
+
children: t("media_tagged_products_heading")
|
|
7927
7997
|
}),
|
|
7928
7998
|
/* @__PURE__ */ jsx("div", {
|
|
7929
7999
|
className: "space-y-3",
|
|
@@ -7931,39 +8001,37 @@ function MediaProductTagging({ products, onAddProduct, onRemoveProduct, onSearch
|
|
|
7931
8001
|
className: "rounded-lg border border-dashed border-gray-200 p-4 text-center",
|
|
7932
8002
|
children: [/* @__PURE__ */ jsx("p", {
|
|
7933
8003
|
className: "mb-3 text-sm text-gray-500",
|
|
7934
|
-
children: "
|
|
8004
|
+
children: t("media_no_products_tagged")
|
|
7935
8005
|
}), !disabled && /* @__PURE__ */ jsxs(Button, {
|
|
7936
8006
|
type: "button",
|
|
7937
8007
|
onClick: handleOpenModal,
|
|
7938
8008
|
size: "sm",
|
|
7939
8009
|
className: "gap-1.5",
|
|
7940
|
-
children: [/* @__PURE__ */ jsx(Plus, { className: "h-3 w-3" }), "
|
|
8010
|
+
children: [/* @__PURE__ */ jsx(Plus, { className: "h-3 w-3" }), t("media_add_product_button")]
|
|
7941
8011
|
})]
|
|
7942
8012
|
}) : /* @__PURE__ */ jsxs("div", {
|
|
7943
8013
|
className: "relative space-y-4",
|
|
7944
8014
|
children: [
|
|
7945
8015
|
/* @__PURE__ */ jsxs("div", {
|
|
7946
8016
|
className: "flex items-center justify-between",
|
|
7947
|
-
children: [/* @__PURE__ */
|
|
8017
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
7948
8018
|
className: "text-xs text-gray-500",
|
|
7949
|
-
children:
|
|
7950
|
-
products.length,
|
|
7951
|
-
|
|
7952
|
-
|
|
7953
|
-
" products selected"
|
|
7954
|
-
]
|
|
8019
|
+
children: t("media_products_selected_count", {
|
|
8020
|
+
current: String(products.length),
|
|
8021
|
+
max: String(maxProducts)
|
|
8022
|
+
})
|
|
7955
8023
|
}), !disabled && !isAtMaxLimit && /* @__PURE__ */ jsxs(Button, {
|
|
7956
8024
|
type: "button",
|
|
7957
8025
|
onClick: handleOpenModal,
|
|
7958
8026
|
variant: "outline",
|
|
7959
8027
|
size: "sm",
|
|
7960
8028
|
className: "gap-1.5 text-xs",
|
|
7961
|
-
children: [/* @__PURE__ */ jsx(Plus, { className: "h-3 w-3" }), "
|
|
8029
|
+
children: [/* @__PURE__ */ jsx(Plus, { className: "h-3 w-3" }), t("media_add_products_button")]
|
|
7962
8030
|
})]
|
|
7963
8031
|
}),
|
|
7964
8032
|
/* @__PURE__ */ jsx("p", {
|
|
7965
8033
|
className: "text-xs text-gray-500",
|
|
7966
|
-
children: "
|
|
8034
|
+
children: t("media_products_country_note")
|
|
7967
8035
|
}),
|
|
7968
8036
|
/* @__PURE__ */ jsx("div", {
|
|
7969
8037
|
className: "max-h-96 space-y-2 overflow-y-auto pb-2",
|
|
@@ -7976,10 +8044,10 @@ function MediaProductTagging({ products, onAddProduct, onRemoveProduct, onSearch
|
|
|
7976
8044
|
name: product.name
|
|
7977
8045
|
}), /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("p", {
|
|
7978
8046
|
className: "text-sm font-medium text-gray-900",
|
|
7979
|
-
children: product.name ??
|
|
8047
|
+
children: product.name ?? t("media_product_fallback_name", { id: String(product.id) })
|
|
7980
8048
|
}), /* @__PURE__ */ jsx("p", {
|
|
7981
8049
|
className: "text-xs text-gray-500",
|
|
7982
|
-
children: product.price ? `$${product.price}` : "
|
|
8050
|
+
children: product.price ? `$${product.price}` : t("common_na")
|
|
7983
8051
|
})] })]
|
|
7984
8052
|
}), !disabled && /* @__PURE__ */ jsx(Button, {
|
|
7985
8053
|
type: "button",
|
|
@@ -7988,17 +8056,13 @@ function MediaProductTagging({ products, onAddProduct, onRemoveProduct, onSearch
|
|
|
7988
8056
|
onClick: () => void handleRemove(product.id),
|
|
7989
8057
|
disabled: removingId === product.id,
|
|
7990
8058
|
className: "text-xs text-red-600 hover:bg-red-50 hover:text-red-700",
|
|
7991
|
-
children: removingId === product.id ? "
|
|
8059
|
+
children: removingId === product.id ? t("common_removing") : t("common_remove")
|
|
7992
8060
|
})]
|
|
7993
8061
|
}, product.id))
|
|
7994
8062
|
}),
|
|
7995
|
-
isAtMaxLimit && /* @__PURE__ */
|
|
8063
|
+
isAtMaxLimit && /* @__PURE__ */ jsx("p", {
|
|
7996
8064
|
className: "py-2 text-center text-xs text-gray-500",
|
|
7997
|
-
children:
|
|
7998
|
-
"Maximum ",
|
|
7999
|
-
maxProducts,
|
|
8000
|
-
" products reached"
|
|
8001
|
-
]
|
|
8065
|
+
children: t("media_max_products_reached", { max: String(maxProducts) })
|
|
8002
8066
|
})
|
|
8003
8067
|
]
|
|
8004
8068
|
})
|
|
@@ -8009,31 +8073,24 @@ function MediaProductTagging({ products, onAddProduct, onRemoveProduct, onSearch
|
|
|
8009
8073
|
children: /* @__PURE__ */ jsxs(DialogContent, {
|
|
8010
8074
|
className: "max-w-2xl",
|
|
8011
8075
|
children: [
|
|
8012
|
-
/* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsxs(DialogTitle, { children: ["
|
|
8076
|
+
/* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsxs(DialogTitle, { children: [t("media_select_products_title"), /* @__PURE__ */ jsx("span", {
|
|
8013
8077
|
className: "ml-2 text-sm font-normal text-gray-500",
|
|
8014
|
-
children:
|
|
8015
|
-
|
|
8016
|
-
|
|
8017
|
-
|
|
8018
|
-
maxProducts,
|
|
8019
|
-
" selected)"
|
|
8020
|
-
]
|
|
8078
|
+
children: t("media_products_selected_ratio", {
|
|
8079
|
+
current: String(products.length),
|
|
8080
|
+
max: String(maxProducts)
|
|
8081
|
+
})
|
|
8021
8082
|
})] }) }),
|
|
8022
8083
|
isAtMaxLimit && /* @__PURE__ */ jsx("div", {
|
|
8023
8084
|
className: "rounded-md border border-yellow-200 bg-yellow-50 p-3",
|
|
8024
|
-
children: /* @__PURE__ */
|
|
8085
|
+
children: /* @__PURE__ */ jsx("p", {
|
|
8025
8086
|
className: "text-sm text-yellow-800",
|
|
8026
|
-
children:
|
|
8027
|
-
"You have reached the maximum limit of ",
|
|
8028
|
-
maxProducts,
|
|
8029
|
-
" products."
|
|
8030
|
-
]
|
|
8087
|
+
children: t("media_max_products_warning", { max: String(maxProducts) })
|
|
8031
8088
|
})
|
|
8032
8089
|
}),
|
|
8033
8090
|
/* @__PURE__ */ jsxs("div", {
|
|
8034
8091
|
className: "relative",
|
|
8035
8092
|
children: [searching ? /* @__PURE__ */ jsx(Spinner, { className: "absolute top-1/2 left-3 size-4 -translate-y-1/2" }) : /* @__PURE__ */ jsx(Search, { className: "absolute top-1/2 left-3 size-4 -translate-y-1/2 text-gray-400" }), /* @__PURE__ */ jsx(Input, {
|
|
8036
|
-
placeholder: "
|
|
8093
|
+
placeholder: t("products_search_placeholder"),
|
|
8037
8094
|
value: query,
|
|
8038
8095
|
onChange: (e) => setQuery(e.target.value),
|
|
8039
8096
|
className: "pl-10",
|
|
@@ -8048,7 +8105,7 @@ function MediaProductTagging({ products, onAddProduct, onRemoveProduct, onSearch
|
|
|
8048
8105
|
children: /* @__PURE__ */ jsx(Spinner, { className: "size-5" })
|
|
8049
8106
|
}) : searchResults.length === 0 ? /* @__PURE__ */ jsx("p", {
|
|
8050
8107
|
className: "py-8 text-center text-sm text-gray-500",
|
|
8051
|
-
children: query.length > 0 ? "
|
|
8108
|
+
children: query.length > 0 ? t("products_search_no_results") : t("products_search_start_typing")
|
|
8052
8109
|
}) : /* @__PURE__ */ jsxs("div", {
|
|
8053
8110
|
className: "space-y-2 px-1",
|
|
8054
8111
|
children: [searchResults.map((result) => {
|
|
@@ -8063,7 +8120,7 @@ function MediaProductTagging({ products, onAddProduct, onRemoveProduct, onSearch
|
|
|
8063
8120
|
name: result.name
|
|
8064
8121
|
}), /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("p", {
|
|
8065
8122
|
className: `text-sm font-medium ${canAdd ? "text-gray-900" : "text-gray-500"}`,
|
|
8066
|
-
children: result.name ??
|
|
8123
|
+
children: result.name ?? t("media_product_fallback_name", { id: String(result.id) })
|
|
8067
8124
|
}), result.price && /* @__PURE__ */ jsxs("p", {
|
|
8068
8125
|
className: "text-xs text-gray-500",
|
|
8069
8126
|
children: ["$", result.price]
|
|
@@ -8077,7 +8134,7 @@ function MediaProductTagging({ products, onAddProduct, onRemoveProduct, onSearch
|
|
|
8077
8134
|
},
|
|
8078
8135
|
disabled: !canAdd || addingId === result.id,
|
|
8079
8136
|
className: isTagged ? "text-green-600" : "",
|
|
8080
|
-
children: addingId === result.id ? "
|
|
8137
|
+
children: addingId === result.id ? t("common_adding") : isTagged ? t("common_added") : canAdd ? t("common_add") : t("media_limit_reached")
|
|
8081
8138
|
})]
|
|
8082
8139
|
}, result.id);
|
|
8083
8140
|
}), nextCursor !== null && /* @__PURE__ */ jsx("div", {
|
|
@@ -8093,7 +8150,7 @@ function MediaProductTagging({ products, onAddProduct, onRemoveProduct, onSearch
|
|
|
8093
8150
|
type: "button",
|
|
8094
8151
|
variant: "outline",
|
|
8095
8152
|
onClick: () => setIsModalOpen(false),
|
|
8096
|
-
children: "
|
|
8153
|
+
children: t("common_done")
|
|
8097
8154
|
})
|
|
8098
8155
|
})
|
|
8099
8156
|
]
|
|
@@ -8104,29 +8161,30 @@ function MediaProductTagging({ products, onAddProduct, onRemoveProduct, onSearch
|
|
|
8104
8161
|
}
|
|
8105
8162
|
//#endregion
|
|
8106
8163
|
//#region ../../shareables/ui/src/components/media/CtaModal.tsx
|
|
8107
|
-
const CTA_TYPES = [
|
|
8108
|
-
{
|
|
8109
|
-
value: "link",
|
|
8110
|
-
label: "Page",
|
|
8111
|
-
icon: /* @__PURE__ */ jsx(Globe, { className: "h-3.5 w-3.5 text-gray-500" })
|
|
8112
|
-
},
|
|
8113
|
-
{
|
|
8114
|
-
value: "cart",
|
|
8115
|
-
label: "Cart",
|
|
8116
|
-
icon: /* @__PURE__ */ jsx(ShoppingCart, { className: "h-3.5 w-3.5 text-gray-500" })
|
|
8117
|
-
},
|
|
8118
|
-
{
|
|
8119
|
-
value: "email",
|
|
8120
|
-
label: "Email",
|
|
8121
|
-
icon: /* @__PURE__ */ jsx(Mail, { className: "h-3.5 w-3.5 text-gray-500" })
|
|
8122
|
-
},
|
|
8123
|
-
{
|
|
8124
|
-
value: "phone",
|
|
8125
|
-
label: "Phone",
|
|
8126
|
-
icon: /* @__PURE__ */ jsx(Phone, { className: "h-3.5 w-3.5 text-gray-500" })
|
|
8127
|
-
}
|
|
8128
|
-
];
|
|
8129
8164
|
function CtaModal({ open, onOpenChange, ctaEnabled, ctaType, ctaButtonText, ctaUrl, onDone }) {
|
|
8165
|
+
const { t } = useShareablesTranslation();
|
|
8166
|
+
const CTA_TYPES = useMemo(() => [
|
|
8167
|
+
{
|
|
8168
|
+
value: "link",
|
|
8169
|
+
label: t("cta_type_page"),
|
|
8170
|
+
icon: /* @__PURE__ */ jsx(Globe, { className: "h-3.5 w-3.5 text-gray-500" })
|
|
8171
|
+
},
|
|
8172
|
+
{
|
|
8173
|
+
value: "cart",
|
|
8174
|
+
label: t("cta_type_cart"),
|
|
8175
|
+
icon: /* @__PURE__ */ jsx(ShoppingCart, { className: "h-3.5 w-3.5 text-gray-500" })
|
|
8176
|
+
},
|
|
8177
|
+
{
|
|
8178
|
+
value: "email",
|
|
8179
|
+
label: t("cta_type_email"),
|
|
8180
|
+
icon: /* @__PURE__ */ jsx(Mail, { className: "h-3.5 w-3.5 text-gray-500" })
|
|
8181
|
+
},
|
|
8182
|
+
{
|
|
8183
|
+
value: "phone",
|
|
8184
|
+
label: t("cta_type_phone"),
|
|
8185
|
+
icon: /* @__PURE__ */ jsx(Phone, { className: "h-3.5 w-3.5 text-gray-500" })
|
|
8186
|
+
}
|
|
8187
|
+
], [t]);
|
|
8130
8188
|
const [enabled, setEnabled] = useState(ctaEnabled);
|
|
8131
8189
|
const [type, setType] = useState(ctaType || "link");
|
|
8132
8190
|
const [buttonText, setButtonText] = useState(ctaButtonText);
|
|
@@ -8135,7 +8193,7 @@ function CtaModal({ open, onOpenChange, ctaEnabled, ctaType, ctaButtonText, ctaU
|
|
|
8135
8193
|
if (open) {
|
|
8136
8194
|
setEnabled(ctaEnabled);
|
|
8137
8195
|
setType(ctaType || "link");
|
|
8138
|
-
setButtonText(ctaButtonText || "
|
|
8196
|
+
setButtonText(ctaButtonText || t("cta_default_button_text"));
|
|
8139
8197
|
setUrl(ctaUrl);
|
|
8140
8198
|
}
|
|
8141
8199
|
}, [
|
|
@@ -8147,7 +8205,7 @@ function CtaModal({ open, onOpenChange, ctaEnabled, ctaType, ctaButtonText, ctaU
|
|
|
8147
8205
|
]);
|
|
8148
8206
|
const handleEnable = (checked) => {
|
|
8149
8207
|
setEnabled(checked);
|
|
8150
|
-
if (checked && !buttonText) setButtonText("
|
|
8208
|
+
if (checked && !buttonText) setButtonText(t("cta_default_button_text"));
|
|
8151
8209
|
};
|
|
8152
8210
|
const handleCancel = () => {
|
|
8153
8211
|
onOpenChange(false);
|
|
@@ -8168,10 +8226,10 @@ function CtaModal({ open, onOpenChange, ctaEnabled, ctaType, ctaButtonText, ctaU
|
|
|
8168
8226
|
children: /* @__PURE__ */ jsxs(DialogContent, {
|
|
8169
8227
|
className: "max-w-lg",
|
|
8170
8228
|
children: [
|
|
8171
|
-
/* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: "
|
|
8229
|
+
/* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: t("cta_dialog_title") }) }),
|
|
8172
8230
|
/* @__PURE__ */ jsx("p", {
|
|
8173
8231
|
className: "mt-1 text-sm text-gray-500",
|
|
8174
|
-
children: "
|
|
8232
|
+
children: t("cta_dialog_description")
|
|
8175
8233
|
}),
|
|
8176
8234
|
/* @__PURE__ */ jsxs("div", {
|
|
8177
8235
|
className: "space-y-5",
|
|
@@ -8180,7 +8238,7 @@ function CtaModal({ open, onOpenChange, ctaEnabled, ctaType, ctaButtonText, ctaU
|
|
|
8180
8238
|
className: "flex items-center justify-between border-b border-gray-200 pb-4",
|
|
8181
8239
|
children: [/* @__PURE__ */ jsx("span", {
|
|
8182
8240
|
className: "text-sm font-medium text-gray-700",
|
|
8183
|
-
children: "
|
|
8241
|
+
children: t("cta_enable_toggle_label")
|
|
8184
8242
|
}), /* @__PURE__ */ jsx(Switch, {
|
|
8185
8243
|
checked: enabled,
|
|
8186
8244
|
onCheckedChange: handleEnable
|
|
@@ -8192,21 +8250,21 @@ function CtaModal({ open, onOpenChange, ctaEnabled, ctaType, ctaButtonText, ctaU
|
|
|
8192
8250
|
className: "flex flex-col gap-1.5",
|
|
8193
8251
|
children: [/* @__PURE__ */ jsx(Label, {
|
|
8194
8252
|
className: fieldsDisabled ? "text-gray-400" : "text-gray-700",
|
|
8195
|
-
children: "
|
|
8253
|
+
children: t("cta_action_type_label")
|
|
8196
8254
|
}), /* @__PURE__ */ jsxs(Select, {
|
|
8197
8255
|
value: type,
|
|
8198
8256
|
onValueChange: (v) => setType(v),
|
|
8199
8257
|
disabled: fieldsDisabled,
|
|
8200
8258
|
children: [/* @__PURE__ */ jsx(SelectTrigger, {
|
|
8201
8259
|
className: `w-full ${fieldsDisabled ? "opacity-50" : ""}`,
|
|
8202
|
-
children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "
|
|
8203
|
-
}), /* @__PURE__ */ jsx(SelectContent, { children: CTA_TYPES.map((
|
|
8204
|
-
value:
|
|
8260
|
+
children: /* @__PURE__ */ jsx(SelectValue, { placeholder: t("cta_type_placeholder") })
|
|
8261
|
+
}), /* @__PURE__ */ jsx(SelectContent, { children: CTA_TYPES.map((ctaOption) => /* @__PURE__ */ jsx(SelectItem, {
|
|
8262
|
+
value: ctaOption.value,
|
|
8205
8263
|
children: /* @__PURE__ */ jsxs("span", {
|
|
8206
8264
|
className: "flex items-center gap-2",
|
|
8207
|
-
children: [
|
|
8265
|
+
children: [ctaOption.icon, ctaOption.label]
|
|
8208
8266
|
})
|
|
8209
|
-
},
|
|
8267
|
+
}, ctaOption.value)) })]
|
|
8210
8268
|
})]
|
|
8211
8269
|
}), type !== "cart" ? /* @__PURE__ */ jsxs("div", {
|
|
8212
8270
|
className: "flex flex-col gap-1.5",
|
|
@@ -8214,12 +8272,12 @@ function CtaModal({ open, onOpenChange, ctaEnabled, ctaType, ctaButtonText, ctaU
|
|
|
8214
8272
|
className: "flex items-center gap-1.5",
|
|
8215
8273
|
children: [/* @__PURE__ */ jsx(Label, {
|
|
8216
8274
|
className: fieldsDisabled ? "text-gray-400" : "text-gray-700",
|
|
8217
|
-
children: "
|
|
8275
|
+
children: t("cta_button_label")
|
|
8218
8276
|
}), /* @__PURE__ */ jsx(HelpCircle, { className: "h-3.5 w-3.5 text-gray-400" })]
|
|
8219
8277
|
}), /* @__PURE__ */ jsx(Input, {
|
|
8220
8278
|
value: buttonText,
|
|
8221
8279
|
onChange: (e) => setButtonText(e.target.value),
|
|
8222
|
-
placeholder: "
|
|
8280
|
+
placeholder: t("cta_default_button_text"),
|
|
8223
8281
|
disabled: fieldsDisabled,
|
|
8224
8282
|
className: fieldsDisabled ? "opacity-50" : ""
|
|
8225
8283
|
})]
|
|
@@ -8231,12 +8289,12 @@ function CtaModal({ open, onOpenChange, ctaEnabled, ctaType, ctaButtonText, ctaU
|
|
|
8231
8289
|
className: "flex items-center gap-1.5",
|
|
8232
8290
|
children: [/* @__PURE__ */ jsx(Label, {
|
|
8233
8291
|
className: fieldsDisabled ? "text-gray-400" : "text-gray-700",
|
|
8234
|
-
children: "
|
|
8292
|
+
children: t("cta_url_label")
|
|
8235
8293
|
}), /* @__PURE__ */ jsx(HelpCircle, { className: "h-3.5 w-3.5 text-gray-400" })]
|
|
8236
8294
|
}), /* @__PURE__ */ jsx(Input, {
|
|
8237
8295
|
value: url,
|
|
8238
8296
|
onChange: (e) => setUrl(e.target.value),
|
|
8239
|
-
placeholder: "
|
|
8297
|
+
placeholder: t("cta_url_placeholder"),
|
|
8240
8298
|
type: "url",
|
|
8241
8299
|
disabled: fieldsDisabled,
|
|
8242
8300
|
className: fieldsDisabled ? "opacity-50" : ""
|
|
@@ -8249,10 +8307,10 @@ function CtaModal({ open, onOpenChange, ctaEnabled, ctaType, ctaButtonText, ctaU
|
|
|
8249
8307
|
children: [/* @__PURE__ */ jsx(Button, {
|
|
8250
8308
|
variant: "outline",
|
|
8251
8309
|
onClick: handleCancel,
|
|
8252
|
-
children: "
|
|
8310
|
+
children: t("common_cancel")
|
|
8253
8311
|
}), /* @__PURE__ */ jsx(Button, {
|
|
8254
8312
|
onClick: handleDone,
|
|
8255
|
-
children: "
|
|
8313
|
+
children: t("common_done")
|
|
8256
8314
|
})]
|
|
8257
8315
|
})
|
|
8258
8316
|
]
|
|
@@ -8265,6 +8323,7 @@ function formatTime(seconds) {
|
|
|
8265
8323
|
return `${Math.floor(seconds / 60)}:${Math.floor(seconds % 60).toString().padStart(2, "0")}`;
|
|
8266
8324
|
}
|
|
8267
8325
|
function VideoThumbnailSelector({ videoUrl, thumbnailUrl, onThumbnailCaptured, onThumbnailSelected, disabled = false }) {
|
|
8326
|
+
const { t } = useShareablesTranslation();
|
|
8268
8327
|
const { showToast } = useShareablesUI();
|
|
8269
8328
|
const [frameSelectorOpen, setFrameSelectorOpen] = useState(false);
|
|
8270
8329
|
const [isPlaying, setIsPlaying] = useState(false);
|
|
@@ -8323,20 +8382,24 @@ function VideoThumbnailSelector({ videoUrl, thumbnailUrl, onThumbnailCaptured, o
|
|
|
8323
8382
|
onThumbnailCaptured(blob);
|
|
8324
8383
|
setFrameSelectorOpen(false);
|
|
8325
8384
|
} else showToast({
|
|
8326
|
-
title:
|
|
8385
|
+
title: t("media_frame_capture_error"),
|
|
8327
8386
|
type: "error"
|
|
8328
8387
|
});
|
|
8329
8388
|
setCapturing(false);
|
|
8330
8389
|
}, "image/jpeg", .92);
|
|
8331
8390
|
} catch (error) {
|
|
8332
8391
|
showToast({
|
|
8333
|
-
title:
|
|
8392
|
+
title: t("media_frame_capture_error"),
|
|
8334
8393
|
type: "error",
|
|
8335
8394
|
error
|
|
8336
8395
|
});
|
|
8337
8396
|
setCapturing(false);
|
|
8338
8397
|
}
|
|
8339
|
-
}, [
|
|
8398
|
+
}, [
|
|
8399
|
+
onThumbnailCaptured,
|
|
8400
|
+
showToast,
|
|
8401
|
+
t
|
|
8402
|
+
]);
|
|
8340
8403
|
const handleOpenDialog = useCallback(() => {
|
|
8341
8404
|
setIsPlaying(false);
|
|
8342
8405
|
setCurrentTime(0);
|
|
@@ -8349,7 +8412,7 @@ function VideoThumbnailSelector({ videoUrl, thumbnailUrl, onThumbnailCaptured, o
|
|
|
8349
8412
|
className: "space-y-3",
|
|
8350
8413
|
children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
|
|
8351
8414
|
className: "text-foreground mb-1.5 block text-sm font-medium",
|
|
8352
|
-
children: "
|
|
8415
|
+
children: t("media_thumbnail_label")
|
|
8353
8416
|
}), thumbnailUrl ? /* @__PURE__ */ jsxs("div", {
|
|
8354
8417
|
className: "flex items-start gap-4",
|
|
8355
8418
|
children: [imgLoadError ? /* @__PURE__ */ jsx("div", {
|
|
@@ -8357,7 +8420,7 @@ function VideoThumbnailSelector({ videoUrl, thumbnailUrl, onThumbnailCaptured, o
|
|
|
8357
8420
|
children: /* @__PURE__ */ jsx(ImageIcon, { className: "text-muted-foreground h-8 w-8" })
|
|
8358
8421
|
}) : /* @__PURE__ */ jsx("img", {
|
|
8359
8422
|
src: thumbnailUrl,
|
|
8360
|
-
alt: "
|
|
8423
|
+
alt: t("media_video_thumbnail_alt"),
|
|
8361
8424
|
className: "w-48 shrink-0 rounded-md border object-contain",
|
|
8362
8425
|
onLoad: handleImgLoad,
|
|
8363
8426
|
onError: handleImgError
|
|
@@ -8388,13 +8451,13 @@ function VideoThumbnailSelector({ videoUrl, thumbnailUrl, onThumbnailCaptured, o
|
|
|
8388
8451
|
size: "sm",
|
|
8389
8452
|
onClick: handleOpenDialog,
|
|
8390
8453
|
className: "gap-1.5",
|
|
8391
|
-
children: [/* @__PURE__ */ jsx(Camera, { className: "h-3.5 w-3.5" }), "
|
|
8454
|
+
children: [/* @__PURE__ */ jsx(Camera, { className: "h-3.5 w-3.5" }), t("media_select_from_video_frame")]
|
|
8392
8455
|
}), onThumbnailSelected && /* @__PURE__ */ jsxs(Button, {
|
|
8393
8456
|
variant: "outline",
|
|
8394
8457
|
size: "sm",
|
|
8395
8458
|
onClick: onThumbnailSelected,
|
|
8396
8459
|
className: "gap-1.5",
|
|
8397
|
-
children: [/* @__PURE__ */ jsx(ImageIcon, { className: "h-3.5 w-3.5" }), "
|
|
8460
|
+
children: [/* @__PURE__ */ jsx(ImageIcon, { className: "h-3.5 w-3.5" }), t("media_select_new_image")]
|
|
8398
8461
|
})]
|
|
8399
8462
|
})
|
|
8400
8463
|
]
|
|
@@ -8408,7 +8471,7 @@ function VideoThumbnailSelector({ videoUrl, thumbnailUrl, onThumbnailCaptured, o
|
|
|
8408
8471
|
className: "min-w-0 flex-1",
|
|
8409
8472
|
children: [/* @__PURE__ */ jsx("p", {
|
|
8410
8473
|
className: "text-muted-foreground text-sm",
|
|
8411
|
-
children: "
|
|
8474
|
+
children: t("media_no_thumbnail")
|
|
8412
8475
|
}), !disabled && /* @__PURE__ */ jsx("div", {
|
|
8413
8476
|
className: "mt-2",
|
|
8414
8477
|
children: /* @__PURE__ */ jsxs(Button, {
|
|
@@ -8416,7 +8479,7 @@ function VideoThumbnailSelector({ videoUrl, thumbnailUrl, onThumbnailCaptured, o
|
|
|
8416
8479
|
size: "sm",
|
|
8417
8480
|
onClick: handleOpenDialog,
|
|
8418
8481
|
className: "gap-1.5",
|
|
8419
|
-
children: [/* @__PURE__ */ jsx(Camera, { className: "h-3.5 w-3.5" }), "
|
|
8482
|
+
children: [/* @__PURE__ */ jsx(Camera, { className: "h-3.5 w-3.5" }), t("media_select_video_frame")]
|
|
8420
8483
|
})
|
|
8421
8484
|
})]
|
|
8422
8485
|
})]
|
|
@@ -8426,7 +8489,7 @@ function VideoThumbnailSelector({ videoUrl, thumbnailUrl, onThumbnailCaptured, o
|
|
|
8426
8489
|
children: /* @__PURE__ */ jsxs(DialogContent, {
|
|
8427
8490
|
className: "max-w-2xl",
|
|
8428
8491
|
children: [
|
|
8429
|
-
/* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: "
|
|
8492
|
+
/* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: t("media_select_video_frame") }) }),
|
|
8430
8493
|
/* @__PURE__ */ jsxs("div", {
|
|
8431
8494
|
className: "space-y-4",
|
|
8432
8495
|
children: [
|
|
@@ -8478,7 +8541,7 @@ function VideoThumbnailSelector({ videoUrl, thumbnailUrl, onThumbnailCaptured, o
|
|
|
8478
8541
|
onClick: handleCapture,
|
|
8479
8542
|
disabled: !isMetadataLoaded || capturing,
|
|
8480
8543
|
className: "w-full gap-2",
|
|
8481
|
-
children: [capturing ? /* @__PURE__ */ jsx(Spinner, { className: "size-4" }) : /* @__PURE__ */ jsx(Camera, { className: "h-4 w-4" }), "
|
|
8544
|
+
children: [capturing ? /* @__PURE__ */ jsx(Spinner, { className: "size-4" }) : /* @__PURE__ */ jsx(Camera, { className: "h-4 w-4" }), t("media_capture_frame")]
|
|
8482
8545
|
})
|
|
8483
8546
|
]
|
|
8484
8547
|
}),
|
|
@@ -8526,6 +8589,7 @@ function buildEditState(mediaItem) {
|
|
|
8526
8589
|
};
|
|
8527
8590
|
}
|
|
8528
8591
|
function ThumbnailWithMeta({ src, onReplace }) {
|
|
8592
|
+
const { t } = useShareablesTranslation();
|
|
8529
8593
|
const { meta, fileName, handleLoad, handleError, loadError } = useThumbnailMeta(src);
|
|
8530
8594
|
return /* @__PURE__ */ jsxs("div", {
|
|
8531
8595
|
className: "flex items-start gap-4",
|
|
@@ -8534,7 +8598,7 @@ function ThumbnailWithMeta({ src, onReplace }) {
|
|
|
8534
8598
|
children: /* @__PURE__ */ jsx(ImageIcon, { className: "text-muted-foreground h-8 w-8" })
|
|
8535
8599
|
}) : /* @__PURE__ */ jsx("img", {
|
|
8536
8600
|
src,
|
|
8537
|
-
alt: "
|
|
8601
|
+
alt: t("media_thumbnail_alt"),
|
|
8538
8602
|
className: "w-48 shrink-0 rounded-md border object-contain",
|
|
8539
8603
|
onLoad: handleLoad,
|
|
8540
8604
|
onError: handleError
|
|
@@ -8565,7 +8629,7 @@ function ThumbnailWithMeta({ src, onReplace }) {
|
|
|
8565
8629
|
size: "sm",
|
|
8566
8630
|
onClick: onReplace,
|
|
8567
8631
|
className: "gap-1.5",
|
|
8568
|
-
children: [/* @__PURE__ */ jsx(ImageIcon, { className: "h-3.5 w-3.5" }), "
|
|
8632
|
+
children: [/* @__PURE__ */ jsx(ImageIcon, { className: "h-3.5 w-3.5" }), t("media_select_new_image")]
|
|
8569
8633
|
})
|
|
8570
8634
|
})
|
|
8571
8635
|
]
|
|
@@ -8573,6 +8637,7 @@ function ThumbnailWithMeta({ src, onReplace }) {
|
|
|
8573
8637
|
});
|
|
8574
8638
|
}
|
|
8575
8639
|
function CurrentMediaPreview({ mediaItem, pendingFileUrl, pendingKind }) {
|
|
8640
|
+
const { t } = useShareablesTranslation();
|
|
8576
8641
|
const effectiveKind = pendingKind ?? mediaItem.content_format ?? mediaItem.kind;
|
|
8577
8642
|
const effectiveVideoUrl = pendingKind === "video" ? pendingFileUrl : mediaItem.video_url;
|
|
8578
8643
|
const effectiveImageUrl = pendingKind === "image" ? pendingFileUrl : pendingKind ? null : mediaItem.image_url;
|
|
@@ -8609,11 +8674,12 @@ function CurrentMediaPreview({ mediaItem, pendingFileUrl, pendingKind }) {
|
|
|
8609
8674
|
className: "border-border text-muted-foreground flex h-40 w-full flex-col items-center justify-center gap-2 rounded-lg border",
|
|
8610
8675
|
children: [/* @__PURE__ */ jsx(ImageIcon, { className: "h-6 w-6" }), /* @__PURE__ */ jsx("span", {
|
|
8611
8676
|
className: "text-sm",
|
|
8612
|
-
children: "
|
|
8677
|
+
children: t("media_no_media_available")
|
|
8613
8678
|
})]
|
|
8614
8679
|
});
|
|
8615
8680
|
}
|
|
8616
8681
|
function MediaEditScreen({ mediaId, onNavigate: _onNavigate, onBack }) {
|
|
8682
|
+
const { t } = useShareablesTranslation();
|
|
8617
8683
|
const api = useShareablesApi();
|
|
8618
8684
|
const repContext = useRepContext();
|
|
8619
8685
|
const queryClient = useQueryClient();
|
|
@@ -8692,13 +8758,13 @@ function MediaEditScreen({ mediaId, onNavigate: _onNavigate, onBack }) {
|
|
|
8692
8758
|
setPendingMediaFile(null);
|
|
8693
8759
|
setPendingThumbnail(null);
|
|
8694
8760
|
showToast({
|
|
8695
|
-
title: "
|
|
8761
|
+
title: t("media_save_success"),
|
|
8696
8762
|
type: "success"
|
|
8697
8763
|
});
|
|
8698
8764
|
},
|
|
8699
8765
|
onError: (error) => {
|
|
8700
8766
|
showToast({
|
|
8701
|
-
title:
|
|
8767
|
+
title: t("media_save_error", { message: error.message }),
|
|
8702
8768
|
type: "error",
|
|
8703
8769
|
error
|
|
8704
8770
|
});
|
|
@@ -8708,14 +8774,14 @@ function MediaEditScreen({ mediaId, onNavigate: _onNavigate, onBack }) {
|
|
|
8708
8774
|
mutationFn: () => api.media.deleteMedia(Number(mediaId)),
|
|
8709
8775
|
onSuccess: () => {
|
|
8710
8776
|
showToast({
|
|
8711
|
-
title: "
|
|
8777
|
+
title: t("media_delete_success"),
|
|
8712
8778
|
type: "success"
|
|
8713
8779
|
});
|
|
8714
8780
|
navigate("media");
|
|
8715
8781
|
},
|
|
8716
8782
|
onError: (error) => {
|
|
8717
8783
|
showToast({
|
|
8718
|
-
title:
|
|
8784
|
+
title: t("media_delete_error", { message: error.message }),
|
|
8719
8785
|
type: "error",
|
|
8720
8786
|
error
|
|
8721
8787
|
});
|
|
@@ -8758,7 +8824,7 @@ function MediaEditScreen({ mediaId, onNavigate: _onNavigate, onBack }) {
|
|
|
8758
8824
|
className: "flex flex-col items-center justify-center py-16",
|
|
8759
8825
|
children: /* @__PURE__ */ jsx("p", {
|
|
8760
8826
|
className: "text-destructive text-sm",
|
|
8761
|
-
children: "
|
|
8827
|
+
children: t("media_not_found")
|
|
8762
8828
|
})
|
|
8763
8829
|
});
|
|
8764
8830
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
@@ -8771,7 +8837,7 @@ function MediaEditScreen({ mediaId, onNavigate: _onNavigate, onBack }) {
|
|
|
8771
8837
|
e.preventDefault();
|
|
8772
8838
|
(onBack ?? (() => navigate("media")))();
|
|
8773
8839
|
},
|
|
8774
|
-
children: "
|
|
8840
|
+
children: t("media_breadcrumb")
|
|
8775
8841
|
}) }),
|
|
8776
8842
|
/* @__PURE__ */ jsx(BreadcrumbSeparator, {}),
|
|
8777
8843
|
/* @__PURE__ */ jsx(BreadcrumbItem, { children: /* @__PURE__ */ jsx(BreadcrumbLink, {
|
|
@@ -8781,12 +8847,12 @@ function MediaEditScreen({ mediaId, onNavigate: _onNavigate, onBack }) {
|
|
|
8781
8847
|
navigate(`media/${mediaId}`);
|
|
8782
8848
|
},
|
|
8783
8849
|
className: "block max-w-[40vw] truncate align-bottom md:max-w-[60ch]",
|
|
8784
|
-
children: displayTitle || "
|
|
8850
|
+
children: displayTitle || t("media_breadcrumb")
|
|
8785
8851
|
}) }),
|
|
8786
8852
|
/* @__PURE__ */ jsx(BreadcrumbSeparator, {}),
|
|
8787
8853
|
/* @__PURE__ */ jsx(BreadcrumbItem, { children: /* @__PURE__ */ jsx(BreadcrumbPage, {
|
|
8788
8854
|
className: "font-semibold",
|
|
8789
|
-
children: "
|
|
8855
|
+
children: t("common_edit")
|
|
8790
8856
|
}) })
|
|
8791
8857
|
]
|
|
8792
8858
|
}) }) }),
|
|
@@ -8805,13 +8871,13 @@ function MediaEditScreen({ mediaId, onNavigate: _onNavigate, onBack }) {
|
|
|
8805
8871
|
children: /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
8806
8872
|
onClick: () => setIsDeleteOpen(true),
|
|
8807
8873
|
className: "text-destructive focus:text-destructive",
|
|
8808
|
-
children: [/* @__PURE__ */ jsx(Trash2, { className: "mr-2 h-4 w-4" }), "
|
|
8874
|
+
children: [/* @__PURE__ */ jsx(Trash2, { className: "mr-2 h-4 w-4" }), t("common_delete")]
|
|
8809
8875
|
})
|
|
8810
8876
|
})] }), /* @__PURE__ */ jsx(Button, {
|
|
8811
8877
|
onClick: handleSave,
|
|
8812
8878
|
disabled: !isDirty || isSaving,
|
|
8813
8879
|
size: "sm",
|
|
8814
|
-
children: isSaving ? /* @__PURE__ */ jsx(Spinner, { className: "size-4" }) : "
|
|
8880
|
+
children: isSaving ? /* @__PURE__ */ jsx(Spinner, { className: "size-4" }) : t("common_save")
|
|
8815
8881
|
})]
|
|
8816
8882
|
}) }),
|
|
8817
8883
|
/* @__PURE__ */ jsxs("div", {
|
|
@@ -8821,7 +8887,7 @@ function MediaEditScreen({ mediaId, onNavigate: _onNavigate, onBack }) {
|
|
|
8821
8887
|
className: "mx-auto flex w-full max-w-5xl items-center gap-3",
|
|
8822
8888
|
children: /* @__PURE__ */ jsx("h1", {
|
|
8823
8889
|
className: "text-foreground text-xl font-semibold break-words",
|
|
8824
|
-
children: editState.title || displayTitle || "
|
|
8890
|
+
children: editState.title || displayTitle || t("media_heading")
|
|
8825
8891
|
})
|
|
8826
8892
|
}),
|
|
8827
8893
|
/* @__PURE__ */ jsxs("div", {
|
|
@@ -8836,20 +8902,20 @@ function MediaEditScreen({ mediaId, onNavigate: _onNavigate, onBack }) {
|
|
|
8836
8902
|
className: "mb-4 flex flex-wrap items-center justify-between gap-2",
|
|
8837
8903
|
children: [/* @__PURE__ */ jsx("h3", {
|
|
8838
8904
|
className: "text-foreground text-base font-semibold",
|
|
8839
|
-
children: "
|
|
8905
|
+
children: t("media_heading")
|
|
8840
8906
|
}), /* @__PURE__ */ jsxs("div", {
|
|
8841
8907
|
className: "flex flex-wrap items-center gap-2",
|
|
8842
8908
|
children: [!readOnly && filePickerContextValue && filePickerApi && /* @__PURE__ */ jsx(Button, {
|
|
8843
8909
|
onClick: () => setIsPickerOpen(true),
|
|
8844
8910
|
variant: "outline",
|
|
8845
8911
|
size: "sm",
|
|
8846
|
-
children: "
|
|
8912
|
+
children: t("media_replace_button")
|
|
8847
8913
|
}), !readOnly && /* @__PURE__ */ jsxs(Button, {
|
|
8848
8914
|
variant: "outline",
|
|
8849
8915
|
size: "sm",
|
|
8850
8916
|
onClick: () => setIsCtaModalOpen(true),
|
|
8851
8917
|
className: editState.ctaEnabled ? "border-primary text-primary" : "",
|
|
8852
|
-
children: ["
|
|
8918
|
+
children: [t("media_cta_button_label"), editState.ctaEnabled ? t("common_on") : t("common_off")]
|
|
8853
8919
|
})]
|
|
8854
8920
|
})]
|
|
8855
8921
|
}),
|
|
@@ -8872,7 +8938,7 @@ function MediaEditScreen({ mediaId, onNavigate: _onNavigate, onBack }) {
|
|
|
8872
8938
|
onThumbnailCaptured: async (blob) => {
|
|
8873
8939
|
if (!uploadThumbnail) {
|
|
8874
8940
|
showToast({
|
|
8875
|
-
title: "
|
|
8941
|
+
title: t("media_thumbnail_capture_unavailable"),
|
|
8876
8942
|
type: "error"
|
|
8877
8943
|
});
|
|
8878
8944
|
return;
|
|
@@ -8881,7 +8947,7 @@ function MediaEditScreen({ mediaId, onNavigate: _onNavigate, onBack }) {
|
|
|
8881
8947
|
setPendingThumbnail(await uploadThumbnail(blob, `thumbnail-${mediaId}.jpg`));
|
|
8882
8948
|
} catch (error) {
|
|
8883
8949
|
showToast({
|
|
8884
|
-
title: "
|
|
8950
|
+
title: t("media_thumbnail_upload_error"),
|
|
8885
8951
|
type: "error",
|
|
8886
8952
|
error
|
|
8887
8953
|
});
|
|
@@ -8890,7 +8956,7 @@ function MediaEditScreen({ mediaId, onNavigate: _onNavigate, onBack }) {
|
|
|
8890
8956
|
onThumbnailSelected: () => setIsThumbnailPickerOpen(true)
|
|
8891
8957
|
}), pendingThumbnail && /* @__PURE__ */ jsx("p", {
|
|
8892
8958
|
className: "text-muted-foreground mt-1.5 text-xs",
|
|
8893
|
-
children: "
|
|
8959
|
+
children: t("media_pending_save")
|
|
8894
8960
|
})]
|
|
8895
8961
|
});
|
|
8896
8962
|
if (effectiveKind === "pdf") {
|
|
@@ -8901,7 +8967,7 @@ function MediaEditScreen({ mediaId, onNavigate: _onNavigate, onBack }) {
|
|
|
8901
8967
|
className: "space-y-3",
|
|
8902
8968
|
children: [/* @__PURE__ */ jsx("label", {
|
|
8903
8969
|
className: "text-foreground mb-1.5 block text-sm font-medium",
|
|
8904
|
-
children: "
|
|
8970
|
+
children: t("media_thumbnail_label")
|
|
8905
8971
|
}), currentThumbnail ? /* @__PURE__ */ jsx(ThumbnailWithMeta, {
|
|
8906
8972
|
src: currentThumbnail,
|
|
8907
8973
|
onReplace: () => setIsThumbnailPickerOpen(true)
|
|
@@ -8914,19 +8980,19 @@ function MediaEditScreen({ mediaId, onNavigate: _onNavigate, onBack }) {
|
|
|
8914
8980
|
className: "min-w-0 flex-1",
|
|
8915
8981
|
children: [/* @__PURE__ */ jsx("p", {
|
|
8916
8982
|
className: "text-muted-foreground mb-2 text-sm",
|
|
8917
|
-
children: "
|
|
8983
|
+
children: t("media_no_thumbnail")
|
|
8918
8984
|
}), /* @__PURE__ */ jsxs(Button, {
|
|
8919
8985
|
variant: "outline",
|
|
8920
8986
|
size: "sm",
|
|
8921
8987
|
onClick: () => setIsThumbnailPickerOpen(true),
|
|
8922
8988
|
className: "gap-1.5",
|
|
8923
|
-
children: [/* @__PURE__ */ jsx(ImageIcon, { className: "h-3.5 w-3.5" }), "
|
|
8989
|
+
children: [/* @__PURE__ */ jsx(ImageIcon, { className: "h-3.5 w-3.5" }), t("media_select_new_image")]
|
|
8924
8990
|
})]
|
|
8925
8991
|
})]
|
|
8926
8992
|
})]
|
|
8927
8993
|
}), pendingThumbnail && /* @__PURE__ */ jsx("p", {
|
|
8928
8994
|
className: "text-muted-foreground mt-1.5 text-xs",
|
|
8929
|
-
children: "
|
|
8995
|
+
children: t("media_pending_save")
|
|
8930
8996
|
})]
|
|
8931
8997
|
});
|
|
8932
8998
|
}
|
|
@@ -8938,17 +9004,21 @@ function MediaEditScreen({ mediaId, onNavigate: _onNavigate, onBack }) {
|
|
|
8938
9004
|
className: "border-border bg-card rounded-lg border p-4 md:p-5",
|
|
8939
9005
|
children: [/* @__PURE__ */ jsx("h3", {
|
|
8940
9006
|
className: "text-foreground mb-4 text-base font-semibold",
|
|
8941
|
-
children: "
|
|
9007
|
+
children: t("media_details_heading")
|
|
8942
9008
|
}), /* @__PURE__ */ jsxs("div", {
|
|
8943
9009
|
className: "flex flex-col gap-4",
|
|
8944
9010
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
8945
9011
|
className: "flex flex-col gap-1.5",
|
|
8946
9012
|
children: [/* @__PURE__ */ jsxs(Label, {
|
|
8947
9013
|
htmlFor: "media-title",
|
|
8948
|
-
children: [
|
|
8949
|
-
|
|
8950
|
-
|
|
8951
|
-
|
|
9014
|
+
children: [
|
|
9015
|
+
t("common_title_label"),
|
|
9016
|
+
" ",
|
|
9017
|
+
/* @__PURE__ */ jsx("span", {
|
|
9018
|
+
className: "text-destructive",
|
|
9019
|
+
children: "*"
|
|
9020
|
+
})
|
|
9021
|
+
]
|
|
8952
9022
|
}), readOnly ? /* @__PURE__ */ jsx("p", {
|
|
8953
9023
|
className: "text-foreground text-sm",
|
|
8954
9024
|
children: displayTitle
|
|
@@ -8959,11 +9029,11 @@ function MediaEditScreen({ mediaId, onNavigate: _onNavigate, onBack }) {
|
|
|
8959
9029
|
...s,
|
|
8960
9030
|
title: e.target.value
|
|
8961
9031
|
})),
|
|
8962
|
-
placeholder: "
|
|
9032
|
+
placeholder: t("media_title_placeholder")
|
|
8963
9033
|
})]
|
|
8964
9034
|
}), /* @__PURE__ */ jsxs("div", {
|
|
8965
9035
|
className: "flex flex-col gap-1.5",
|
|
8966
|
-
children: [/* @__PURE__ */ jsx(Label, { children: "
|
|
9036
|
+
children: [/* @__PURE__ */ jsx(Label, { children: t("common_description_label") }), readOnly ? /* @__PURE__ */ jsx("p", {
|
|
8967
9037
|
className: "text-foreground/70 text-sm leading-relaxed",
|
|
8968
9038
|
children: stripTags(editState.description)
|
|
8969
9039
|
}) : /* @__PURE__ */ jsx(RichTextEditor, {
|
|
@@ -8972,7 +9042,7 @@ function MediaEditScreen({ mediaId, onNavigate: _onNavigate, onBack }) {
|
|
|
8972
9042
|
...s,
|
|
8973
9043
|
description: val
|
|
8974
9044
|
})),
|
|
8975
|
-
placeholder: "
|
|
9045
|
+
placeholder: t("common_start_writing_placeholder")
|
|
8976
9046
|
})]
|
|
8977
9047
|
})]
|
|
8978
9048
|
})]
|
|
@@ -9021,12 +9091,12 @@ function MediaEditScreen({ mediaId, onNavigate: _onNavigate, onBack }) {
|
|
|
9021
9091
|
className: "mb-4 flex items-center justify-between",
|
|
9022
9092
|
children: [/* @__PURE__ */ jsx("h3", {
|
|
9023
9093
|
className: "text-foreground text-base font-semibold",
|
|
9024
|
-
children: "
|
|
9094
|
+
children: t("seo_heading")
|
|
9025
9095
|
}), !readOnly && /* @__PURE__ */ jsx(Button, {
|
|
9026
9096
|
variant: "ghost",
|
|
9027
9097
|
size: "sm",
|
|
9028
9098
|
onClick: () => setSeoExpanded((prev) => !prev),
|
|
9029
|
-
children: seoExpanded ? "
|
|
9099
|
+
children: seoExpanded ? t("common_done") : t("common_edit")
|
|
9030
9100
|
})]
|
|
9031
9101
|
}),
|
|
9032
9102
|
(() => {
|
|
@@ -9046,10 +9116,10 @@ function MediaEditScreen({ mediaId, onNavigate: _onNavigate, onBack }) {
|
|
|
9046
9116
|
className: "min-w-0 flex-1",
|
|
9047
9117
|
children: [/* @__PURE__ */ jsx("p", {
|
|
9048
9118
|
className: "text-foreground truncate text-xs font-medium",
|
|
9049
|
-
children: editState.seoTitle || displayTitle || "
|
|
9119
|
+
children: editState.seoTitle || displayTitle || t("seo_preview_title_fallback")
|
|
9050
9120
|
}), /* @__PURE__ */ jsx("p", {
|
|
9051
9121
|
className: "text-muted-foreground truncate text-xs",
|
|
9052
|
-
children: mediaItem?.preview_link ?? mediaItem?.canonical_url ?? "
|
|
9122
|
+
children: mediaItem?.preview_link ?? mediaItem?.canonical_url ?? t("seo_preview_url_fallback")
|
|
9053
9123
|
})]
|
|
9054
9124
|
})]
|
|
9055
9125
|
}), editState.seoDescription && /* @__PURE__ */ jsx("p", {
|
|
@@ -9065,7 +9135,7 @@ function MediaEditScreen({ mediaId, onNavigate: _onNavigate, onBack }) {
|
|
|
9065
9135
|
className: "flex flex-col gap-1.5",
|
|
9066
9136
|
children: [/* @__PURE__ */ jsx(Label, {
|
|
9067
9137
|
htmlFor: "seo-title",
|
|
9068
|
-
children: "
|
|
9138
|
+
children: t("seo_title_label")
|
|
9069
9139
|
}), /* @__PURE__ */ jsx(Input, {
|
|
9070
9140
|
id: "seo-title",
|
|
9071
9141
|
value: editState.seoTitle,
|
|
@@ -9073,14 +9143,14 @@ function MediaEditScreen({ mediaId, onNavigate: _onNavigate, onBack }) {
|
|
|
9073
9143
|
...s,
|
|
9074
9144
|
seoTitle: e.target.value
|
|
9075
9145
|
})),
|
|
9076
|
-
placeholder: "
|
|
9146
|
+
placeholder: t("seo_title_placeholder")
|
|
9077
9147
|
})]
|
|
9078
9148
|
}),
|
|
9079
9149
|
/* @__PURE__ */ jsxs("div", {
|
|
9080
9150
|
className: "flex flex-col gap-1.5",
|
|
9081
9151
|
children: [/* @__PURE__ */ jsx(Label, {
|
|
9082
9152
|
htmlFor: "seo-description",
|
|
9083
|
-
children: "
|
|
9153
|
+
children: t("seo_description_label")
|
|
9084
9154
|
}), /* @__PURE__ */ jsx(Textarea, {
|
|
9085
9155
|
id: "seo-description",
|
|
9086
9156
|
value: editState.seoDescription,
|
|
@@ -9088,7 +9158,7 @@ function MediaEditScreen({ mediaId, onNavigate: _onNavigate, onBack }) {
|
|
|
9088
9158
|
...s,
|
|
9089
9159
|
seoDescription: e.target.value
|
|
9090
9160
|
})),
|
|
9091
|
-
placeholder: "
|
|
9161
|
+
placeholder: t("seo_description_placeholder"),
|
|
9092
9162
|
rows: 3
|
|
9093
9163
|
})]
|
|
9094
9164
|
}),
|
|
@@ -9098,10 +9168,10 @@ function MediaEditScreen({ mediaId, onNavigate: _onNavigate, onBack }) {
|
|
|
9098
9168
|
className: "flex flex-col gap-0.5",
|
|
9099
9169
|
children: [/* @__PURE__ */ jsx("span", {
|
|
9100
9170
|
className: "text-foreground text-sm font-medium",
|
|
9101
|
-
children: "
|
|
9171
|
+
children: t("seo_block_crawlers_label")
|
|
9102
9172
|
}), /* @__PURE__ */ jsx("span", {
|
|
9103
9173
|
className: "text-muted-foreground text-xs",
|
|
9104
|
-
children: "
|
|
9174
|
+
children: t("seo_block_crawlers_description")
|
|
9105
9175
|
})]
|
|
9106
9176
|
}), /* @__PURE__ */ jsx(Switch, {
|
|
9107
9177
|
checked: editState.blockCrawler,
|
|
@@ -9109,7 +9179,7 @@ function MediaEditScreen({ mediaId, onNavigate: _onNavigate, onBack }) {
|
|
|
9109
9179
|
...s,
|
|
9110
9180
|
blockCrawler: checked
|
|
9111
9181
|
})),
|
|
9112
|
-
"aria-label": "
|
|
9182
|
+
"aria-label": t("seo_block_crawlers_aria")
|
|
9113
9183
|
})]
|
|
9114
9184
|
})
|
|
9115
9185
|
]
|
|
@@ -9121,18 +9191,14 @@ function MediaEditScreen({ mediaId, onNavigate: _onNavigate, onBack }) {
|
|
|
9121
9191
|
/* @__PURE__ */ jsx(AlertDialog, {
|
|
9122
9192
|
open: isDeleteOpen,
|
|
9123
9193
|
onOpenChange: setIsDeleteOpen,
|
|
9124
|
-
children: /* @__PURE__ */ jsxs(AlertDialogContent, { children: [/* @__PURE__ */ jsxs(AlertDialogHeader, { children: [/* @__PURE__ */ jsx(AlertDialogTitle, { children: "
|
|
9125
|
-
"Are you sure you want to delete “",
|
|
9126
|
-
displayTitle,
|
|
9127
|
-
"”? This action cannot be undone."
|
|
9128
|
-
] })] }), /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [/* @__PURE__ */ jsx(AlertDialogCancel, {
|
|
9194
|
+
children: /* @__PURE__ */ jsxs(AlertDialogContent, { children: [/* @__PURE__ */ jsxs(AlertDialogHeader, { children: [/* @__PURE__ */ jsx(AlertDialogTitle, { children: t("media_delete_dialog_title") }), /* @__PURE__ */ jsx(AlertDialogDescription, { children: t("media_delete_dialog_description", { title: mediaItem?.title ?? "" }) })] }), /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [/* @__PURE__ */ jsx(AlertDialogCancel, {
|
|
9129
9195
|
disabled: isDeleting,
|
|
9130
|
-
children: "
|
|
9196
|
+
children: t("common_cancel")
|
|
9131
9197
|
}), /* @__PURE__ */ jsx(AlertDialogAction, {
|
|
9132
9198
|
onClick: handleDelete,
|
|
9133
9199
|
disabled: isDeleting,
|
|
9134
9200
|
className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
9135
|
-
children: isDeleting ? "
|
|
9201
|
+
children: isDeleting ? t("common_deleting") : t("common_delete")
|
|
9136
9202
|
})] })] })
|
|
9137
9203
|
}),
|
|
9138
9204
|
/* @__PURE__ */ jsx(CtaModal, {
|
|
@@ -9206,6 +9272,7 @@ function deriveMediaType(mimeType) {
|
|
|
9206
9272
|
return "image";
|
|
9207
9273
|
}
|
|
9208
9274
|
function FilePreview({ result, mediaType }) {
|
|
9275
|
+
const { t } = useShareablesTranslation();
|
|
9209
9276
|
const thumbnailSrc = mediaType === "image" ? result.file_url : result.thumbnail_url;
|
|
9210
9277
|
if (thumbnailSrc) {
|
|
9211
9278
|
const Icon = mediaType === "video" ? Video : mediaType === "pdf" ? FileText : null;
|
|
@@ -9219,7 +9286,7 @@ function FilePreview({ result, mediaType }) {
|
|
|
9219
9286
|
className: "absolute bottom-2 left-2 flex items-center gap-1.5 rounded-md bg-black/60 px-2 py-1 text-white",
|
|
9220
9287
|
children: [/* @__PURE__ */ jsx(Icon, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ jsx("span", {
|
|
9221
9288
|
className: "text-xs font-medium",
|
|
9222
|
-
children: mediaType === "video" ? "
|
|
9289
|
+
children: mediaType === "video" ? t("media_type_video") : t("media_type_pdf")
|
|
9223
9290
|
})]
|
|
9224
9291
|
})]
|
|
9225
9292
|
});
|
|
@@ -9239,6 +9306,7 @@ function FilePreview({ result, mediaType }) {
|
|
|
9239
9306
|
});
|
|
9240
9307
|
}
|
|
9241
9308
|
function MediaCreateScreen({ onNavigate, onBack }) {
|
|
9309
|
+
const { t } = useShareablesTranslation();
|
|
9242
9310
|
const { navigate, showToast, filePickerApi } = useShareablesUI();
|
|
9243
9311
|
const user = useShareablesUser();
|
|
9244
9312
|
const [title, setTitle] = useState("");
|
|
@@ -9259,14 +9327,14 @@ function MediaCreateScreen({ onNavigate, onBack }) {
|
|
|
9259
9327
|
const { mutate: createMedia, isPending: isCreating } = useCreateMediaMutation({
|
|
9260
9328
|
onSuccess: (newMedia) => {
|
|
9261
9329
|
showToast({
|
|
9262
|
-
title: "
|
|
9330
|
+
title: t("media_create_success"),
|
|
9263
9331
|
type: "success"
|
|
9264
9332
|
});
|
|
9265
9333
|
onNavigate?.("media", String(newMedia.id));
|
|
9266
9334
|
},
|
|
9267
9335
|
onError: (error) => {
|
|
9268
9336
|
showToast({
|
|
9269
|
-
title:
|
|
9337
|
+
title: t("media_create_error", { message: error.message }),
|
|
9270
9338
|
type: "error"
|
|
9271
9339
|
});
|
|
9272
9340
|
}
|
|
@@ -9274,14 +9342,14 @@ function MediaCreateScreen({ onNavigate, onBack }) {
|
|
|
9274
9342
|
const handleSave = useCallback(() => {
|
|
9275
9343
|
if (!title.trim()) {
|
|
9276
9344
|
showToast({
|
|
9277
|
-
title: "
|
|
9345
|
+
title: t("media_title_required"),
|
|
9278
9346
|
type: "warning"
|
|
9279
9347
|
});
|
|
9280
9348
|
return;
|
|
9281
9349
|
}
|
|
9282
9350
|
if (!selectedResult) {
|
|
9283
9351
|
showToast({
|
|
9284
|
-
title: "
|
|
9352
|
+
title: t("media_file_required"),
|
|
9285
9353
|
type: "warning"
|
|
9286
9354
|
});
|
|
9287
9355
|
return;
|
|
@@ -9312,6 +9380,7 @@ function MediaCreateScreen({ onNavigate, onBack }) {
|
|
|
9312
9380
|
}
|
|
9313
9381
|
});
|
|
9314
9382
|
}, [
|
|
9383
|
+
t,
|
|
9315
9384
|
title,
|
|
9316
9385
|
description,
|
|
9317
9386
|
active,
|
|
@@ -9359,12 +9428,12 @@ function MediaCreateScreen({ onNavigate, onBack }) {
|
|
|
9359
9428
|
e.preventDefault();
|
|
9360
9429
|
(onBack ?? (() => navigate("media")))();
|
|
9361
9430
|
},
|
|
9362
|
-
children: "
|
|
9431
|
+
children: t("media_breadcrumb")
|
|
9363
9432
|
}) }),
|
|
9364
9433
|
/* @__PURE__ */ jsx(BreadcrumbSeparator, {}),
|
|
9365
9434
|
/* @__PURE__ */ jsx(BreadcrumbItem, { children: /* @__PURE__ */ jsx(BreadcrumbPage, {
|
|
9366
9435
|
className: "font-semibold",
|
|
9367
|
-
children: "
|
|
9436
|
+
children: t("media_create_breadcrumb")
|
|
9368
9437
|
}) })
|
|
9369
9438
|
]
|
|
9370
9439
|
}) }) }),
|
|
@@ -9372,7 +9441,7 @@ function MediaCreateScreen({ onNavigate, onBack }) {
|
|
|
9372
9441
|
onClick: handleSave,
|
|
9373
9442
|
disabled: isCreating,
|
|
9374
9443
|
size: "sm",
|
|
9375
|
-
children: isCreating ? /* @__PURE__ */ jsx(Spinner, { className: "size-4" }) : "
|
|
9444
|
+
children: isCreating ? /* @__PURE__ */ jsx(Spinner, { className: "size-4" }) : t("common_save")
|
|
9376
9445
|
}) }),
|
|
9377
9446
|
/* @__PURE__ */ jsxs("div", {
|
|
9378
9447
|
className: "flex flex-col gap-4 px-4 py-4 md:px-10 md:py-6",
|
|
@@ -9381,7 +9450,7 @@ function MediaCreateScreen({ onNavigate, onBack }) {
|
|
|
9381
9450
|
className: "mx-auto flex w-full max-w-5xl items-center gap-3",
|
|
9382
9451
|
children: /* @__PURE__ */ jsx("h1", {
|
|
9383
9452
|
className: "text-foreground text-xl font-semibold",
|
|
9384
|
-
children: title.trim() || "
|
|
9453
|
+
children: title.trim() || t("media_new_title")
|
|
9385
9454
|
})
|
|
9386
9455
|
}),
|
|
9387
9456
|
/* @__PURE__ */ jsxs("div", {
|
|
@@ -9394,7 +9463,7 @@ function MediaCreateScreen({ onNavigate, onBack }) {
|
|
|
9394
9463
|
className: "mb-4 flex items-center justify-between",
|
|
9395
9464
|
children: [/* @__PURE__ */ jsx("h3", {
|
|
9396
9465
|
className: "text-foreground text-base font-semibold",
|
|
9397
|
-
children: "
|
|
9466
|
+
children: t("media_heading")
|
|
9398
9467
|
}), /* @__PURE__ */ jsxs("div", {
|
|
9399
9468
|
className: "flex items-center gap-2",
|
|
9400
9469
|
children: [/* @__PURE__ */ jsx(Button, {
|
|
@@ -9402,13 +9471,13 @@ function MediaCreateScreen({ onNavigate, onBack }) {
|
|
|
9402
9471
|
variant: "outline",
|
|
9403
9472
|
size: "sm",
|
|
9404
9473
|
disabled: !filePickerApi,
|
|
9405
|
-
children: "
|
|
9474
|
+
children: t("media_select_button")
|
|
9406
9475
|
}), /* @__PURE__ */ jsxs(Button, {
|
|
9407
9476
|
variant: "outline",
|
|
9408
9477
|
size: "sm",
|
|
9409
9478
|
onClick: () => setIsCtaModalOpen(true),
|
|
9410
9479
|
className: ctaEnabled ? "border-primary text-primary" : "",
|
|
9411
|
-
children: ["
|
|
9480
|
+
children: [t("media_cta_button_label"), ctaEnabled ? t("common_on") : t("common_off")]
|
|
9412
9481
|
})]
|
|
9413
9482
|
})]
|
|
9414
9483
|
}), selectedResult && mediaType ? /* @__PURE__ */ jsxs("div", {
|
|
@@ -9421,7 +9490,7 @@ function MediaCreateScreen({ onNavigate, onBack }) {
|
|
|
9421
9490
|
variant: "outline",
|
|
9422
9491
|
size: "sm",
|
|
9423
9492
|
className: "w-fit",
|
|
9424
|
-
children: "
|
|
9493
|
+
children: t("common_replace")
|
|
9425
9494
|
})]
|
|
9426
9495
|
}) : /* @__PURE__ */ jsxs("button", {
|
|
9427
9496
|
type: "button",
|
|
@@ -9430,37 +9499,41 @@ function MediaCreateScreen({ onNavigate, onBack }) {
|
|
|
9430
9499
|
className: "border-border text-muted-foreground hover:bg-muted/30 flex h-40 w-full flex-col items-center justify-center gap-2 rounded-lg border border-dashed transition-colors disabled:cursor-not-allowed disabled:opacity-50",
|
|
9431
9500
|
children: [/* @__PURE__ */ jsx(Upload, { className: "h-6 w-6" }), /* @__PURE__ */ jsx("span", {
|
|
9432
9501
|
className: "text-sm",
|
|
9433
|
-
children: "
|
|
9502
|
+
children: t("media_upload_placeholder")
|
|
9434
9503
|
})]
|
|
9435
9504
|
})]
|
|
9436
9505
|
}), /* @__PURE__ */ jsxs("div", {
|
|
9437
9506
|
className: "border-border bg-card rounded-lg border p-5",
|
|
9438
9507
|
children: [/* @__PURE__ */ jsx("h3", {
|
|
9439
9508
|
className: "text-foreground mb-4 text-base font-semibold",
|
|
9440
|
-
children: "
|
|
9509
|
+
children: t("media_details_heading")
|
|
9441
9510
|
}), /* @__PURE__ */ jsxs("div", {
|
|
9442
9511
|
className: "flex flex-col gap-4",
|
|
9443
9512
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
9444
9513
|
className: "flex flex-col gap-1.5",
|
|
9445
9514
|
children: [/* @__PURE__ */ jsxs(Label, {
|
|
9446
9515
|
htmlFor: "media-title",
|
|
9447
|
-
children: [
|
|
9448
|
-
|
|
9449
|
-
|
|
9450
|
-
|
|
9516
|
+
children: [
|
|
9517
|
+
t("common_title_label"),
|
|
9518
|
+
" ",
|
|
9519
|
+
/* @__PURE__ */ jsx("span", {
|
|
9520
|
+
className: "text-destructive",
|
|
9521
|
+
children: "*"
|
|
9522
|
+
})
|
|
9523
|
+
]
|
|
9451
9524
|
}), /* @__PURE__ */ jsx(Input, {
|
|
9452
9525
|
id: "media-title",
|
|
9453
9526
|
value: title,
|
|
9454
9527
|
onChange: (e) => setTitle(e.target.value),
|
|
9455
|
-
placeholder: "
|
|
9528
|
+
placeholder: t("media_title_placeholder"),
|
|
9456
9529
|
required: true
|
|
9457
9530
|
})]
|
|
9458
9531
|
}), /* @__PURE__ */ jsxs("div", {
|
|
9459
9532
|
className: "flex flex-col gap-1.5",
|
|
9460
|
-
children: [/* @__PURE__ */ jsx(Label, { children: "
|
|
9533
|
+
children: [/* @__PURE__ */ jsx(Label, { children: t("common_description_label") }), /* @__PURE__ */ jsx(RichTextEditor, {
|
|
9461
9534
|
value: description,
|
|
9462
9535
|
onChange: setDescription,
|
|
9463
|
-
placeholder: "
|
|
9536
|
+
placeholder: t("common_start_writing_placeholder")
|
|
9464
9537
|
})]
|
|
9465
9538
|
})]
|
|
9466
9539
|
})]
|
|
@@ -9474,12 +9547,12 @@ function MediaCreateScreen({ onNavigate, onBack }) {
|
|
|
9474
9547
|
className: "mb-4 flex items-center justify-between",
|
|
9475
9548
|
children: [/* @__PURE__ */ jsx("h3", {
|
|
9476
9549
|
className: "text-foreground text-base font-semibold",
|
|
9477
|
-
children: "
|
|
9550
|
+
children: t("seo_heading")
|
|
9478
9551
|
}), /* @__PURE__ */ jsx(Button, {
|
|
9479
9552
|
variant: "ghost",
|
|
9480
9553
|
size: "sm",
|
|
9481
9554
|
onClick: () => setSeoExpanded((prev) => !prev),
|
|
9482
|
-
children: seoExpanded ? "
|
|
9555
|
+
children: seoExpanded ? t("common_done") : t("common_edit")
|
|
9483
9556
|
})]
|
|
9484
9557
|
}),
|
|
9485
9558
|
/* @__PURE__ */ jsxs("div", {
|
|
@@ -9493,10 +9566,10 @@ function MediaCreateScreen({ onNavigate, onBack }) {
|
|
|
9493
9566
|
className: "min-w-0 flex-1",
|
|
9494
9567
|
children: [/* @__PURE__ */ jsx("p", {
|
|
9495
9568
|
className: "text-foreground truncate text-xs font-medium",
|
|
9496
|
-
children: seoTitle || "
|
|
9569
|
+
children: seoTitle || t("seo_preview_title_fallback")
|
|
9497
9570
|
}), /* @__PURE__ */ jsx("p", {
|
|
9498
9571
|
className: "text-muted-foreground truncate text-xs",
|
|
9499
|
-
children: "
|
|
9572
|
+
children: t("seo_preview_url_fallback")
|
|
9500
9573
|
})]
|
|
9501
9574
|
})]
|
|
9502
9575
|
}), seoDescription && /* @__PURE__ */ jsx("p", {
|
|
@@ -9511,24 +9584,24 @@ function MediaCreateScreen({ onNavigate, onBack }) {
|
|
|
9511
9584
|
className: "flex flex-col gap-1.5",
|
|
9512
9585
|
children: [/* @__PURE__ */ jsx(Label, {
|
|
9513
9586
|
htmlFor: "seo-title",
|
|
9514
|
-
children: "
|
|
9587
|
+
children: t("seo_title_label")
|
|
9515
9588
|
}), /* @__PURE__ */ jsx(Input, {
|
|
9516
9589
|
id: "seo-title",
|
|
9517
9590
|
value: seoTitle,
|
|
9518
9591
|
onChange: (e) => setSeoTitle(e.target.value),
|
|
9519
|
-
placeholder: "
|
|
9592
|
+
placeholder: t("seo_title_placeholder")
|
|
9520
9593
|
})]
|
|
9521
9594
|
}),
|
|
9522
9595
|
/* @__PURE__ */ jsxs("div", {
|
|
9523
9596
|
className: "flex flex-col gap-1.5",
|
|
9524
9597
|
children: [/* @__PURE__ */ jsx(Label, {
|
|
9525
9598
|
htmlFor: "seo-description",
|
|
9526
|
-
children: "
|
|
9599
|
+
children: t("seo_description_label")
|
|
9527
9600
|
}), /* @__PURE__ */ jsx(Textarea, {
|
|
9528
9601
|
id: "seo-description",
|
|
9529
9602
|
value: seoDescription,
|
|
9530
9603
|
onChange: (e) => setSeoDescription(e.target.value),
|
|
9531
|
-
placeholder: "
|
|
9604
|
+
placeholder: t("seo_description_placeholder"),
|
|
9532
9605
|
rows: 3
|
|
9533
9606
|
})]
|
|
9534
9607
|
}),
|
|
@@ -9538,15 +9611,15 @@ function MediaCreateScreen({ onNavigate, onBack }) {
|
|
|
9538
9611
|
className: "flex flex-col gap-0.5",
|
|
9539
9612
|
children: [/* @__PURE__ */ jsx("span", {
|
|
9540
9613
|
className: "text-foreground text-sm font-medium",
|
|
9541
|
-
children: "
|
|
9614
|
+
children: t("seo_block_crawlers_label")
|
|
9542
9615
|
}), /* @__PURE__ */ jsx("span", {
|
|
9543
9616
|
className: "text-muted-foreground text-xs",
|
|
9544
|
-
children: "
|
|
9617
|
+
children: t("seo_block_crawlers_description")
|
|
9545
9618
|
})]
|
|
9546
9619
|
}), /* @__PURE__ */ jsx(Switch, {
|
|
9547
9620
|
checked: seoBlockCrawler,
|
|
9548
9621
|
onCheckedChange: setSeoBlockCrawler,
|
|
9549
|
-
"aria-label": "
|
|
9622
|
+
"aria-label": t("seo_block_crawlers_aria")
|
|
9550
9623
|
})]
|
|
9551
9624
|
})
|
|
9552
9625
|
]
|
|
@@ -9597,10 +9670,11 @@ function MediaCreateScreen({ onNavigate, onBack }) {
|
|
|
9597
9670
|
const DEFAULT_IMAGE$4 = "https://assets.fluid.app/fluid-admin/images/we-commerce/we-commerce.png";
|
|
9598
9671
|
function PlaylistCard({ title, imageUrl, href, itemCount, isFavorited = false, isSelectable = false, isSelected = false, canEdit = false, onSelectionChange, onToggleFavorite, onEdit, onDelete }) {
|
|
9599
9672
|
const { navigate } = useShareablesUI();
|
|
9673
|
+
const { t } = useShareablesTranslation();
|
|
9600
9674
|
const renderImage = useRenderImage();
|
|
9601
9675
|
const [imgError, setImgError] = useState(false);
|
|
9602
9676
|
const hasStack = itemCount > 1;
|
|
9603
|
-
const badgeText =
|
|
9677
|
+
const badgeText = itemCount === 1 ? t("playlist_item_count_one", { count: "1" }) : t("playlist_item_count_other", { count: String(itemCount) });
|
|
9604
9678
|
return /* @__PURE__ */ jsx("button", {
|
|
9605
9679
|
type: "button",
|
|
9606
9680
|
onClick: () => navigate(href),
|
|
@@ -9643,7 +9717,7 @@ function PlaylistCard({ title, imageUrl, href, itemCount, isFavorited = false, i
|
|
|
9643
9717
|
type: "button",
|
|
9644
9718
|
onClick: (e) => e.stopPropagation(),
|
|
9645
9719
|
className: "bg-background/90 hover:bg-background flex h-8 w-8 items-center justify-center rounded-lg shadow-md backdrop-blur-sm transition-all",
|
|
9646
|
-
"aria-label": "
|
|
9720
|
+
"aria-label": t("common_more_options_aria"),
|
|
9647
9721
|
children: /* @__PURE__ */ jsx(MoreVertical, { className: "text-foreground h-4 w-4" })
|
|
9648
9722
|
})
|
|
9649
9723
|
}), /* @__PURE__ */ jsxs(DropdownMenuContent, {
|
|
@@ -9652,16 +9726,16 @@ function PlaylistCard({ title, imageUrl, href, itemCount, isFavorited = false, i
|
|
|
9652
9726
|
children: [
|
|
9653
9727
|
onToggleFavorite && /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
9654
9728
|
onClick: onToggleFavorite,
|
|
9655
|
-
children: [/* @__PURE__ */ jsx(Heart, { className: cn("mr-2 h-4 w-4", isFavorited && "text-destructive fill-current") }), isFavorited ? "
|
|
9729
|
+
children: [/* @__PURE__ */ jsx(Heart, { className: cn("mr-2 h-4 w-4", isFavorited && "text-destructive fill-current") }), isFavorited ? t("common_unfavorite") : t("common_favorite")]
|
|
9656
9730
|
}),
|
|
9657
9731
|
canEdit && onEdit && /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
9658
9732
|
onClick: onEdit,
|
|
9659
|
-
children: [/* @__PURE__ */ jsx(Pencil, { className: "mr-2 h-4 w-4" }), "
|
|
9733
|
+
children: [/* @__PURE__ */ jsx(Pencil, { className: "mr-2 h-4 w-4" }), t("common_edit")]
|
|
9660
9734
|
}),
|
|
9661
9735
|
canEdit && onDelete && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(DropdownMenuSeparator, {}), /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
9662
9736
|
variant: "destructive",
|
|
9663
9737
|
onClick: onDelete,
|
|
9664
|
-
children: [/* @__PURE__ */ jsx(Trash2, { className: "mr-2 h-4 w-4" }), "
|
|
9738
|
+
children: [/* @__PURE__ */ jsx(Trash2, { className: "mr-2 h-4 w-4" }), t("common_delete")]
|
|
9665
9739
|
})] })
|
|
9666
9740
|
]
|
|
9667
9741
|
})] })
|
|
@@ -9674,7 +9748,7 @@ function PlaylistCard({ title, imageUrl, href, itemCount, isFavorited = false, i
|
|
|
9674
9748
|
e.stopPropagation();
|
|
9675
9749
|
onToggleFavorite();
|
|
9676
9750
|
},
|
|
9677
|
-
"aria-label": isFavorited ? "
|
|
9751
|
+
"aria-label": isFavorited ? t("common_unfavorite") : t("common_favorite"),
|
|
9678
9752
|
children: /* @__PURE__ */ jsx(Heart, { className: cn("h-6 w-6 drop-shadow-lg transition-all", isFavorited ? "fill-destructive text-destructive" : "text-[#ffffff]") })
|
|
9679
9753
|
}),
|
|
9680
9754
|
/* @__PURE__ */ jsx("div", {
|
|
@@ -9690,7 +9764,7 @@ function PlaylistCard({ title, imageUrl, href, itemCount, isFavorited = false, i
|
|
|
9690
9764
|
className: "px-2 pt-2 pb-4",
|
|
9691
9765
|
children: /* @__PURE__ */ jsx("h3", {
|
|
9692
9766
|
className: "text-foreground line-clamp-2 text-sm leading-tight font-bold",
|
|
9693
|
-
children: title || "
|
|
9767
|
+
children: title || t("common_untitled")
|
|
9694
9768
|
})
|
|
9695
9769
|
})]
|
|
9696
9770
|
})]
|
|
@@ -9700,6 +9774,7 @@ function PlaylistCard({ title, imageUrl, href, itemCount, isFavorited = false, i
|
|
|
9700
9774
|
//#endregion
|
|
9701
9775
|
//#region ../../shareables/ui/src/components/playlists/BulkSelectionBar.tsx
|
|
9702
9776
|
function BulkSelectionBar({ selectedCount, totalCount, onSelectAll, onClearSelection, onBulkFavorite }) {
|
|
9777
|
+
const { t } = useShareablesTranslation();
|
|
9703
9778
|
return /* @__PURE__ */ jsxs("div", {
|
|
9704
9779
|
className: "bg-foreground flex items-center justify-between rounded-lg px-4 py-3",
|
|
9705
9780
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
@@ -9708,10 +9783,10 @@ function BulkSelectionBar({ selectedCount, totalCount, onSelectAll, onClearSelec
|
|
|
9708
9783
|
type: "button",
|
|
9709
9784
|
onClick: onSelectAll,
|
|
9710
9785
|
className: "text-background hover:text-background/80 text-sm font-medium",
|
|
9711
|
-
children: selectedCount === totalCount ? "
|
|
9712
|
-
}), /* @__PURE__ */
|
|
9786
|
+
children: selectedCount === totalCount ? t("common_deselect_all") : t("common_select_all")
|
|
9787
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
9713
9788
|
className: "text-background/70 text-sm",
|
|
9714
|
-
children:
|
|
9789
|
+
children: t("common_selected_count", { count: String(selectedCount) })
|
|
9715
9790
|
})]
|
|
9716
9791
|
}), /* @__PURE__ */ jsxs("div", {
|
|
9717
9792
|
className: "flex items-center gap-3",
|
|
@@ -9721,12 +9796,12 @@ function BulkSelectionBar({ selectedCount, totalCount, onSelectAll, onClearSelec
|
|
|
9721
9796
|
variant: "secondary",
|
|
9722
9797
|
size: "sm",
|
|
9723
9798
|
className: "bg-background text-foreground hover:bg-background/90 rounded-md px-3 py-1.5 text-xs font-medium disabled:cursor-not-allowed disabled:opacity-50",
|
|
9724
|
-
children: "
|
|
9799
|
+
children: t("common_favorite")
|
|
9725
9800
|
}), /* @__PURE__ */ jsx("button", {
|
|
9726
9801
|
type: "button",
|
|
9727
9802
|
onClick: onClearSelection,
|
|
9728
9803
|
className: "text-background hover:text-background/80",
|
|
9729
|
-
"aria-label": "
|
|
9804
|
+
"aria-label": t("common_cancel_selection_aria"),
|
|
9730
9805
|
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
9731
9806
|
})]
|
|
9732
9807
|
})]
|
|
@@ -9738,6 +9813,7 @@ const PAGE_SIZE$2 = 12;
|
|
|
9738
9813
|
const GRID_CLASS = "grid grid-cols-1 gap-8 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4";
|
|
9739
9814
|
function PlaylistsListingScreen(_props) {
|
|
9740
9815
|
const api = useShareablesApi();
|
|
9816
|
+
const { t } = useShareablesTranslation();
|
|
9741
9817
|
const { navigate, showToast, user, onToggleFavorite, onDeletePlaylist, readOnly } = useShareablesUI();
|
|
9742
9818
|
const queryClient = useQueryClient();
|
|
9743
9819
|
const [searchTerm, setSearchTerm] = useState("");
|
|
@@ -9840,13 +9916,13 @@ function PlaylistsListingScreen(_props) {
|
|
|
9840
9916
|
onError: (_err, _playlistId, context) => {
|
|
9841
9917
|
if (context?.previousData) queryClient.setQueryData(context.capturedKey, context.previousData);
|
|
9842
9918
|
showToast({
|
|
9843
|
-
title: "
|
|
9919
|
+
title: t("playlist_favorite_error"),
|
|
9844
9920
|
type: "error"
|
|
9845
9921
|
});
|
|
9846
9922
|
},
|
|
9847
9923
|
onSuccess: (result) => {
|
|
9848
9924
|
showToast({
|
|
9849
|
-
title: result.is_favorited ? "
|
|
9925
|
+
title: result.is_favorited ? t("playlist_favorite_added") : t("playlist_favorite_removed"),
|
|
9850
9926
|
type: "success"
|
|
9851
9927
|
});
|
|
9852
9928
|
},
|
|
@@ -9873,14 +9949,14 @@ function PlaylistsListingScreen(_props) {
|
|
|
9873
9949
|
onSuccess: () => {
|
|
9874
9950
|
queryClient.invalidateQueries({ queryKey: shareablesKeys.playlists.all });
|
|
9875
9951
|
showToast({
|
|
9876
|
-
title: "
|
|
9952
|
+
title: t("playlist_delete_success"),
|
|
9877
9953
|
type: "success"
|
|
9878
9954
|
});
|
|
9879
9955
|
setPendingDeleteId(null);
|
|
9880
9956
|
},
|
|
9881
9957
|
onError: (error) => {
|
|
9882
9958
|
showToast({
|
|
9883
|
-
title: "
|
|
9959
|
+
title: t("playlist_delete_error"),
|
|
9884
9960
|
type: "error",
|
|
9885
9961
|
error
|
|
9886
9962
|
});
|
|
@@ -9890,6 +9966,24 @@ function PlaylistsListingScreen(_props) {
|
|
|
9890
9966
|
const confirmDelete = useCallback(() => {
|
|
9891
9967
|
if (pendingDeleteId != null) deletePlaylist(pendingDeleteId);
|
|
9892
9968
|
}, [pendingDeleteId, deletePlaylist]);
|
|
9969
|
+
const sortOptions = useMemo(() => [
|
|
9970
|
+
{
|
|
9971
|
+
label: t("sort_name_asc"),
|
|
9972
|
+
value: "title"
|
|
9973
|
+
},
|
|
9974
|
+
{
|
|
9975
|
+
label: t("sort_name_desc"),
|
|
9976
|
+
value: "-title"
|
|
9977
|
+
},
|
|
9978
|
+
{
|
|
9979
|
+
label: t("sort_date_newest"),
|
|
9980
|
+
value: "-created_at"
|
|
9981
|
+
},
|
|
9982
|
+
{
|
|
9983
|
+
label: t("sort_date_oldest"),
|
|
9984
|
+
value: "created_at"
|
|
9985
|
+
}
|
|
9986
|
+
], [t]);
|
|
9893
9987
|
const filterBar = hasSelection ? /* @__PURE__ */ jsx(BulkSelectionBar, {
|
|
9894
9988
|
selectedCount: selectedIds.size,
|
|
9895
9989
|
totalCount: filteredPlaylists.length,
|
|
@@ -9901,7 +9995,7 @@ function PlaylistsListingScreen(_props) {
|
|
|
9901
9995
|
children: [/* @__PURE__ */ jsx(OwnerFilterTabs, {
|
|
9902
9996
|
value: ownerFilter,
|
|
9903
9997
|
onValueChange: setOwnerFilter,
|
|
9904
|
-
myLabel: "
|
|
9998
|
+
myLabel: t("playlist_my_playlists_tab")
|
|
9905
9999
|
}), /* @__PURE__ */ jsxs("div", {
|
|
9906
10000
|
className: "ml-auto flex items-center gap-2",
|
|
9907
10001
|
children: [/* @__PURE__ */ jsx("div", {
|
|
@@ -9909,25 +10003,8 @@ function PlaylistsListingScreen(_props) {
|
|
|
9909
10003
|
children: /* @__PURE__ */ jsx(SearchSort, {
|
|
9910
10004
|
searchValue: searchTerm,
|
|
9911
10005
|
onSearchChange: setSearchTerm,
|
|
9912
|
-
placeholder: "
|
|
9913
|
-
sortOptions
|
|
9914
|
-
{
|
|
9915
|
-
label: "Name (A-Z)",
|
|
9916
|
-
value: "title"
|
|
9917
|
-
},
|
|
9918
|
-
{
|
|
9919
|
-
label: "Name (Z-A)",
|
|
9920
|
-
value: "-title"
|
|
9921
|
-
},
|
|
9922
|
-
{
|
|
9923
|
-
label: "Date Created (Newest)",
|
|
9924
|
-
value: "-created_at"
|
|
9925
|
-
},
|
|
9926
|
-
{
|
|
9927
|
-
label: "Date Created (Oldest)",
|
|
9928
|
-
value: "created_at"
|
|
9929
|
-
}
|
|
9930
|
-
],
|
|
10006
|
+
placeholder: t("playlist_search_placeholder"),
|
|
10007
|
+
sortOptions,
|
|
9931
10008
|
sortValue,
|
|
9932
10009
|
onSortChange: setSortValue
|
|
9933
10010
|
})
|
|
@@ -9949,13 +10026,13 @@ function PlaylistsListingScreen(_props) {
|
|
|
9949
10026
|
/* @__PURE__ */ jsx(ScreenHeaderActions, { children: readOnly ? null : /* @__PURE__ */ jsxs(Button, {
|
|
9950
10027
|
onClick: () => navigate("playlists/new"),
|
|
9951
10028
|
size: "sm",
|
|
9952
|
-
children: [/* @__PURE__ */ jsx(Plus, { className: "mr-1 h-4 w-4" }), "
|
|
10029
|
+
children: [/* @__PURE__ */ jsx(Plus, { className: "mr-1 h-4 w-4" }), t("playlist_create_button")]
|
|
9953
10030
|
}) }),
|
|
9954
10031
|
/* @__PURE__ */ jsx(ScreenHeaderBreadcrumbs, { children: /* @__PURE__ */ jsx(Breadcrumb, { children: /* @__PURE__ */ jsx(BreadcrumbList, {
|
|
9955
10032
|
className: "text-lg",
|
|
9956
10033
|
children: /* @__PURE__ */ jsx(BreadcrumbItem, { children: /* @__PURE__ */ jsx(BreadcrumbPage, {
|
|
9957
10034
|
className: "font-semibold",
|
|
9958
|
-
children: "
|
|
10035
|
+
children: t("playlist_breadcrumb")
|
|
9959
10036
|
}) })
|
|
9960
10037
|
}) }) }),
|
|
9961
10038
|
/* @__PURE__ */ jsx(ShareableListLayout, {
|
|
@@ -9966,7 +10043,18 @@ function PlaylistsListingScreen(_props) {
|
|
|
9966
10043
|
searchTerm,
|
|
9967
10044
|
ownerFilter,
|
|
9968
10045
|
entityName: "playlists",
|
|
9969
|
-
defaultMessage: "
|
|
10046
|
+
defaultMessage: t("playlist_empty_default"),
|
|
10047
|
+
messages: {
|
|
10048
|
+
filterSearchNoResults: t("common_filter_search_no_results", {
|
|
10049
|
+
entityName: "playlists",
|
|
10050
|
+
searchTerm
|
|
10051
|
+
}),
|
|
10052
|
+
searchNoResults: t("common_search_no_results", {
|
|
10053
|
+
entityName: "playlists",
|
|
10054
|
+
searchTerm
|
|
10055
|
+
}),
|
|
10056
|
+
filterNoResults: t("common_filter_no_results", { entityName: "playlists" })
|
|
10057
|
+
}
|
|
9970
10058
|
}),
|
|
9971
10059
|
footer,
|
|
9972
10060
|
sentinelRef: observerTarget,
|
|
@@ -9979,7 +10067,7 @@ function PlaylistsListingScreen(_props) {
|
|
|
9979
10067
|
const itemCount = playlist.items_count ?? playlist.items?.length ?? 0;
|
|
9980
10068
|
const canEdit = !readOnly && playlist.user_id === user?.id;
|
|
9981
10069
|
return /* @__PURE__ */ jsx(PlaylistCard, {
|
|
9982
|
-
title: playlist.title || "
|
|
10070
|
+
title: playlist.title || t("playlist_untitled"),
|
|
9983
10071
|
imageUrl,
|
|
9984
10072
|
href: `playlists/${playlist.id}`,
|
|
9985
10073
|
itemCount,
|
|
@@ -10001,29 +10089,25 @@ function PlaylistsListingScreen(_props) {
|
|
|
10001
10089
|
const itemCount = playlist.items_count ?? playlist.items?.length ?? 0;
|
|
10002
10090
|
const canEdit = !readOnly && playlist.user_id === user?.id;
|
|
10003
10091
|
const isSelected = selectedIds.has(playlist.id);
|
|
10004
|
-
const title = playlist.title || "
|
|
10092
|
+
const title = playlist.title || t("playlist_untitled");
|
|
10005
10093
|
return /* @__PURE__ */ jsx(ShareableListRow, {
|
|
10006
10094
|
imageUrl,
|
|
10007
10095
|
title,
|
|
10008
|
-
subtitle: /* @__PURE__ */
|
|
10096
|
+
subtitle: /* @__PURE__ */ jsx(Badge, {
|
|
10009
10097
|
variant: "secondary",
|
|
10010
10098
|
className: "px-1.5 py-0 text-[10px] leading-4",
|
|
10011
|
-
children:
|
|
10012
|
-
itemCount,
|
|
10013
|
-
" ",
|
|
10014
|
-
itemCount === 1 ? "item" : "items"
|
|
10015
|
-
]
|
|
10099
|
+
children: itemCount === 1 ? t("playlist_item_count_one", { count: "1" }) : t("playlist_item_count_other", { count: String(itemCount) })
|
|
10016
10100
|
}),
|
|
10017
10101
|
onClick: () => navigate(`playlists/${playlist.id}`),
|
|
10018
10102
|
leading: /* @__PURE__ */ jsx(Checkbox, {
|
|
10019
10103
|
checked: isSelected,
|
|
10020
10104
|
onCheckedChange: (checked) => handleToggleSelection(playlist.id, checked === true),
|
|
10021
|
-
"aria-label":
|
|
10105
|
+
"aria-label": t("playlist_select_aria", { title })
|
|
10022
10106
|
}),
|
|
10023
10107
|
trailing: /* @__PURE__ */ jsxs(Fragment$1, { children: [onToggleFavorite && /* @__PURE__ */ jsx("button", {
|
|
10024
10108
|
type: "button",
|
|
10025
10109
|
onClick: () => handleFavorite(playlist.id),
|
|
10026
|
-
"aria-label": playlist.is_favorited ? "
|
|
10110
|
+
"aria-label": playlist.is_favorited ? t("common_unfavorite") : t("common_favorite"),
|
|
10027
10111
|
className: "hover:bg-muted-foreground/10 flex h-8 w-8 items-center justify-center rounded-md transition-colors",
|
|
10028
10112
|
children: /* @__PURE__ */ jsx(Heart, { className: cn("h-4 w-4 transition-colors", playlist.is_favorited ? "fill-destructive text-destructive" : "text-muted-foreground") })
|
|
10029
10113
|
}), canEdit && /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
@@ -10032,18 +10116,18 @@ function PlaylistsListingScreen(_props) {
|
|
|
10032
10116
|
variant: "ghost",
|
|
10033
10117
|
size: "sm",
|
|
10034
10118
|
className: "h-8 w-8 p-0",
|
|
10035
|
-
"aria-label": "
|
|
10119
|
+
"aria-label": t("playlist_actions_aria"),
|
|
10036
10120
|
children: /* @__PURE__ */ jsx(MoreVertical, { className: "h-4 w-4" })
|
|
10037
10121
|
})
|
|
10038
10122
|
}), /* @__PURE__ */ jsxs(DropdownMenuContent, {
|
|
10039
10123
|
align: "end",
|
|
10040
10124
|
children: [/* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
10041
10125
|
onClick: () => handleEdit(playlist.id),
|
|
10042
|
-
children: [/* @__PURE__ */ jsx(Pencil, { className: "mr-2 h-4 w-4" }), "
|
|
10126
|
+
children: [/* @__PURE__ */ jsx(Pencil, { className: "mr-2 h-4 w-4" }), t("common_edit")]
|
|
10043
10127
|
}), onDeletePlaylist && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(DropdownMenuSeparator, {}), /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
10044
10128
|
variant: "destructive",
|
|
10045
10129
|
onClick: () => setPendingDeleteId(playlist.id),
|
|
10046
|
-
children: [/* @__PURE__ */ jsx(Trash2, { className: "mr-2 h-4 w-4" }), "
|
|
10130
|
+
children: [/* @__PURE__ */ jsx(Trash2, { className: "mr-2 h-4 w-4" }), t("common_delete")]
|
|
10047
10131
|
})] })]
|
|
10048
10132
|
})] })] })
|
|
10049
10133
|
}, playlist.id);
|
|
@@ -10055,9 +10139,9 @@ function PlaylistsListingScreen(_props) {
|
|
|
10055
10139
|
onOpenChange: (open) => {
|
|
10056
10140
|
if (!open && !isDeleting) setPendingDeleteId(null);
|
|
10057
10141
|
},
|
|
10058
|
-
children: /* @__PURE__ */ jsxs(AlertDialogContent, { children: [/* @__PURE__ */ jsxs(AlertDialogHeader, { children: [/* @__PURE__ */ jsx(AlertDialogTitle, { children: "
|
|
10142
|
+
children: /* @__PURE__ */ jsxs(AlertDialogContent, { children: [/* @__PURE__ */ jsxs(AlertDialogHeader, { children: [/* @__PURE__ */ jsx(AlertDialogTitle, { children: t("playlist_delete_confirm_title") }), /* @__PURE__ */ jsx(AlertDialogDescription, { children: t("playlist_delete_confirm_description") })] }), /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [/* @__PURE__ */ jsx(AlertDialogCancel, {
|
|
10059
10143
|
disabled: isDeleting,
|
|
10060
|
-
children: "
|
|
10144
|
+
children: t("common_cancel")
|
|
10061
10145
|
}), /* @__PURE__ */ jsx(AlertDialogAction, {
|
|
10062
10146
|
onClick: (e) => {
|
|
10063
10147
|
e.preventDefault();
|
|
@@ -10065,7 +10149,7 @@ function PlaylistsListingScreen(_props) {
|
|
|
10065
10149
|
},
|
|
10066
10150
|
disabled: isDeleting,
|
|
10067
10151
|
className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
10068
|
-
children: isDeleting ? /* @__PURE__ */ jsx(Spinner, { className: "size-4" }) : "
|
|
10152
|
+
children: isDeleting ? /* @__PURE__ */ jsx(Spinner, { className: "size-4" }) : t("common_delete")
|
|
10069
10153
|
})] })] })
|
|
10070
10154
|
})
|
|
10071
10155
|
] });
|
|
@@ -10080,13 +10164,13 @@ const NAVIGABLE_RELATEABLE_TYPES = new Set([
|
|
|
10080
10164
|
//#endregion
|
|
10081
10165
|
//#region ../../shareables/ui/src/components/SharePage/PlaylistItemsList.tsx
|
|
10082
10166
|
const DEFAULT_IMAGE$3 = "https://assets.fluid.app/fluid-admin/images/we-commerce/we-commerce.png";
|
|
10083
|
-
function getItemType(type, kind) {
|
|
10084
|
-
if (type === "Product") return
|
|
10085
|
-
if (type === "EnrollmentPack") return
|
|
10086
|
-
if (type === "Page") return
|
|
10087
|
-
if (kind === "video") return
|
|
10088
|
-
if (kind === "image") return
|
|
10089
|
-
return
|
|
10167
|
+
function getItemType(type, kind, labels) {
|
|
10168
|
+
if (type === "Product") return labels.product;
|
|
10169
|
+
if (type === "EnrollmentPack") return labels.enrollment;
|
|
10170
|
+
if (type === "Page") return labels.page;
|
|
10171
|
+
if (kind === "video") return labels.video;
|
|
10172
|
+
if (kind === "image") return labels.image;
|
|
10173
|
+
return labels.media;
|
|
10090
10174
|
}
|
|
10091
10175
|
function formatVideoLength(seconds) {
|
|
10092
10176
|
if (seconds == null) return null;
|
|
@@ -10104,6 +10188,7 @@ function getFileType(mediaFormat, imageUrl) {
|
|
|
10104
10188
|
return null;
|
|
10105
10189
|
}
|
|
10106
10190
|
function PlaylistItemsList({ items, onSelectItem, selectedItemIndex = 0, onNavigateToItem }) {
|
|
10191
|
+
const { t } = useShareablesTranslation();
|
|
10107
10192
|
const handleNavigateToItem = (itemId, type, e) => {
|
|
10108
10193
|
e?.stopPropagation();
|
|
10109
10194
|
onNavigateToItem?.(itemId, type);
|
|
@@ -10124,11 +10209,11 @@ function PlaylistItemsList({ items, onSelectItem, selectedItemIndex = 0, onNavig
|
|
|
10124
10209
|
}),
|
|
10125
10210
|
/* @__PURE__ */ jsx("div", {
|
|
10126
10211
|
className: "mb-1 text-sm text-gray-500",
|
|
10127
|
-
children: "
|
|
10212
|
+
children: t("playlist_no_items")
|
|
10128
10213
|
}),
|
|
10129
10214
|
/* @__PURE__ */ jsx("div", {
|
|
10130
10215
|
className: "text-xs text-gray-400",
|
|
10131
|
-
children:
|
|
10216
|
+
children: t("playlist_no_items_description")
|
|
10132
10217
|
})
|
|
10133
10218
|
]
|
|
10134
10219
|
})
|
|
@@ -10138,11 +10223,18 @@ function PlaylistItemsList({ items, onSelectItem, selectedItemIndex = 0, onNavig
|
|
|
10138
10223
|
children: items.map((item, index) => {
|
|
10139
10224
|
const relateable = item.relateable;
|
|
10140
10225
|
const imageUrl = item.image_url ?? relateable?.image_url ?? relateable?.compressed_image_url ?? DEFAULT_IMAGE$3;
|
|
10141
|
-
const title = item.title ?? relateable?.title ?? "
|
|
10226
|
+
const title = item.title ?? relateable?.title ?? t("common_untitled");
|
|
10142
10227
|
const rawPrice = relateable?.display_price || relateable?.price;
|
|
10143
10228
|
const price = rawPrice && parseFloat(rawPrice.replace(/[^0-9.-]/g, "")) > 0 ? rawPrice : null;
|
|
10144
10229
|
const kind = item.kind ?? relateable?.kind;
|
|
10145
|
-
const itemType = getItemType(item.relateable_type, kind
|
|
10230
|
+
const itemType = getItemType(item.relateable_type, kind, {
|
|
10231
|
+
product: t("common_product"),
|
|
10232
|
+
enrollment: t("common_enrollment"),
|
|
10233
|
+
page: t("common_page"),
|
|
10234
|
+
video: t("media_type_video"),
|
|
10235
|
+
image: t("media_type_image"),
|
|
10236
|
+
media: t("media_type_default")
|
|
10237
|
+
});
|
|
10146
10238
|
const isVideo = kind === "video";
|
|
10147
10239
|
const isImage = kind === "image";
|
|
10148
10240
|
const isProduct = item.relateable_type === "Product";
|
|
@@ -10189,7 +10281,7 @@ function PlaylistItemsList({ items, onSelectItem, selectedItemIndex = 0, onNavig
|
|
|
10189
10281
|
}),
|
|
10190
10282
|
isVideo && /* @__PURE__ */ jsx("div", {
|
|
10191
10283
|
className: "text-muted-foreground text-[13px] leading-[1.4] font-normal",
|
|
10192
|
-
children: videoLength || "
|
|
10284
|
+
children: videoLength || t("media_type_video")
|
|
10193
10285
|
}),
|
|
10194
10286
|
isImage && /* @__PURE__ */ jsx("div", {
|
|
10195
10287
|
className: "text-muted-foreground text-[13px] leading-[1.4] font-normal",
|
|
@@ -10212,13 +10304,9 @@ function PlaylistItemsList({ items, onSelectItem, selectedItemIndex = 0, onNavig
|
|
|
10212
10304
|
className: "hide-scrollbar flex h-full flex-col",
|
|
10213
10305
|
children: [/* @__PURE__ */ jsx("div", {
|
|
10214
10306
|
className: "mb-4 px-4 pt-4",
|
|
10215
|
-
children: /* @__PURE__ */
|
|
10307
|
+
children: /* @__PURE__ */ jsx("h2", {
|
|
10216
10308
|
className: "text-foreground text-[15px] leading-[1.4] font-semibold",
|
|
10217
|
-
children:
|
|
10218
|
-
"Items in playlist (",
|
|
10219
|
-
items.length,
|
|
10220
|
-
")"
|
|
10221
|
-
]
|
|
10309
|
+
children: t("playlist_items_in_playlist_count", { count: String(items.length) })
|
|
10222
10310
|
})
|
|
10223
10311
|
}), /* @__PURE__ */ jsx("div", {
|
|
10224
10312
|
className: "flex-1 overflow-y-auto px-4 pb-4",
|
|
@@ -10231,6 +10319,7 @@ function PlaylistItemsList({ items, onSelectItem, selectedItemIndex = 0, onNavig
|
|
|
10231
10319
|
const DEFAULT_IMAGE$2 = "https://assets.fluid.app/fluid-admin/images/we-commerce/we-commerce.png";
|
|
10232
10320
|
function PlaylistDetailScreen({ playlistId, onNavigate }) {
|
|
10233
10321
|
const api = useShareablesApi();
|
|
10322
|
+
const { t } = useShareablesTranslation();
|
|
10234
10323
|
const { navigate, user, readOnly } = useShareablesUI();
|
|
10235
10324
|
const [selectedPlaylistItemIndex, setSelectedPlaylistItemIndex] = useState(0);
|
|
10236
10325
|
const { data: playlistResponse, isLoading } = useQuery({
|
|
@@ -10256,7 +10345,7 @@ function PlaylistDetailScreen({ playlistId, onNavigate }) {
|
|
|
10256
10345
|
variant: "outline",
|
|
10257
10346
|
size: "sm",
|
|
10258
10347
|
onClick: () => navigate(`playlists/${playlistId}/edit`),
|
|
10259
|
-
children: [/* @__PURE__ */ jsx(Pencil, { className: "mr-1 h-3.5 w-3.5" }), "
|
|
10348
|
+
children: [/* @__PURE__ */ jsx(Pencil, { className: "mr-1 h-3.5 w-3.5" }), t("common_edit")]
|
|
10260
10349
|
})
|
|
10261
10350
|
}) : null }),
|
|
10262
10351
|
/* @__PURE__ */ jsx(ScreenHeaderBreadcrumbs, { children: /* @__PURE__ */ jsx(Breadcrumb, { children: /* @__PURE__ */ jsxs(BreadcrumbList, {
|
|
@@ -10268,19 +10357,19 @@ function PlaylistDetailScreen({ playlistId, onNavigate }) {
|
|
|
10268
10357
|
e.preventDefault();
|
|
10269
10358
|
navigate("playlists");
|
|
10270
10359
|
},
|
|
10271
|
-
children: "
|
|
10360
|
+
children: t("playlist_breadcrumb")
|
|
10272
10361
|
}) }),
|
|
10273
10362
|
/* @__PURE__ */ jsx(BreadcrumbSeparator, {}),
|
|
10274
10363
|
/* @__PURE__ */ jsx(BreadcrumbItem, { children: /* @__PURE__ */ jsx(BreadcrumbPage, {
|
|
10275
10364
|
className: "block max-w-[60vw] truncate align-bottom font-semibold md:max-w-[60ch]",
|
|
10276
|
-
children: displayTitle || "
|
|
10365
|
+
children: displayTitle || t("playlist_breadcrumb_fallback")
|
|
10277
10366
|
}) })
|
|
10278
10367
|
]
|
|
10279
10368
|
}) }) }),
|
|
10280
10369
|
/* @__PURE__ */ jsxs(ShareableDetailLayout, {
|
|
10281
10370
|
isLoading,
|
|
10282
10371
|
notFound: !playlist,
|
|
10283
|
-
notFoundMessage: "
|
|
10372
|
+
notFoundMessage: t("playlist_not_found"),
|
|
10284
10373
|
title: displayTitle,
|
|
10285
10374
|
description: displayDescription,
|
|
10286
10375
|
image: /* @__PURE__ */ jsx("div", {
|
|
@@ -10290,7 +10379,7 @@ function PlaylistDetailScreen({ playlistId, onNavigate }) {
|
|
|
10290
10379
|
displayTitle,
|
|
10291
10380
|
displayVideo,
|
|
10292
10381
|
isVideo,
|
|
10293
|
-
badgeLabel: "
|
|
10382
|
+
badgeLabel: t("playlist_badge_label")
|
|
10294
10383
|
})
|
|
10295
10384
|
}),
|
|
10296
10385
|
actions: /* @__PURE__ */ jsx(AssetActions, {
|
|
@@ -10485,6 +10574,7 @@ function PlaylistItemsProvider({ children, initialItems = [] }) {
|
|
|
10485
10574
|
//#endregion
|
|
10486
10575
|
//#region ../../shareables/ui/src/components/playlists/form/PlaylistFormHeader.tsx
|
|
10487
10576
|
function PlaylistFormHeader({ playlistId, isEditMode, onSubmit, isSaving }) {
|
|
10577
|
+
const { t } = useShareablesTranslation();
|
|
10488
10578
|
const { form, isDirty: formIsDirty } = usePlaylistForm();
|
|
10489
10579
|
const { isDirty: itemsIsDirty } = usePlaylistItems();
|
|
10490
10580
|
const { onDeletePlaylist, showToast, navigate } = useShareablesUI();
|
|
@@ -10501,13 +10591,13 @@ function PlaylistFormHeader({ playlistId, isEditMode, onSubmit, isSaving }) {
|
|
|
10501
10591
|
try {
|
|
10502
10592
|
await onDeletePlaylist(Number(playlistId));
|
|
10503
10593
|
showToast({
|
|
10504
|
-
title: "
|
|
10594
|
+
title: t("playlist_delete_success_full"),
|
|
10505
10595
|
type: "success"
|
|
10506
10596
|
});
|
|
10507
10597
|
navigate("playlists");
|
|
10508
10598
|
} catch (error) {
|
|
10509
10599
|
showToast({
|
|
10510
|
-
title: "
|
|
10600
|
+
title: t("playlist_delete_error"),
|
|
10511
10601
|
type: "error",
|
|
10512
10602
|
error
|
|
10513
10603
|
});
|
|
@@ -10525,7 +10615,7 @@ function PlaylistFormHeader({ playlistId, isEditMode, onSubmit, isSaving }) {
|
|
|
10525
10615
|
variant: "outline",
|
|
10526
10616
|
size: "sm",
|
|
10527
10617
|
className: "h-8 w-8 p-0",
|
|
10528
|
-
"aria-label": "
|
|
10618
|
+
"aria-label": t("playlist_actions_aria"),
|
|
10529
10619
|
disabled: isMutating,
|
|
10530
10620
|
children: /* @__PURE__ */ jsx(MoreVertical, { className: "h-4 w-4" })
|
|
10531
10621
|
})
|
|
@@ -10534,7 +10624,7 @@ function PlaylistFormHeader({ playlistId, isEditMode, onSubmit, isSaving }) {
|
|
|
10534
10624
|
children: /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
10535
10625
|
onClick: () => setIsDeleteOpen(true),
|
|
10536
10626
|
className: "text-destructive focus:text-destructive",
|
|
10537
|
-
children: [/* @__PURE__ */ jsx(Trash2, { className: "mr-2 h-4 w-4" }), "
|
|
10627
|
+
children: [/* @__PURE__ */ jsx(Trash2, { className: "mr-2 h-4 w-4" }), t("common_delete")]
|
|
10538
10628
|
})
|
|
10539
10629
|
})] }), /* @__PURE__ */ jsx(Button, {
|
|
10540
10630
|
onClick: () => {
|
|
@@ -10542,7 +10632,7 @@ function PlaylistFormHeader({ playlistId, isEditMode, onSubmit, isSaving }) {
|
|
|
10542
10632
|
},
|
|
10543
10633
|
disabled: isMutating || !isDirty || !isFormValid,
|
|
10544
10634
|
size: "sm",
|
|
10545
|
-
children: isSaving ? /* @__PURE__ */ jsx(Spinner, { className: "size-4" }) : "
|
|
10635
|
+
children: isSaving ? /* @__PURE__ */ jsx(Spinner, { className: "size-4" }) : t("common_save")
|
|
10546
10636
|
})]
|
|
10547
10637
|
}) }),
|
|
10548
10638
|
/* @__PURE__ */ jsx(ScreenHeaderBreadcrumbs, { children: /* @__PURE__ */ jsx(Breadcrumb, { children: /* @__PURE__ */ jsxs(BreadcrumbList, {
|
|
@@ -10554,12 +10644,12 @@ function PlaylistFormHeader({ playlistId, isEditMode, onSubmit, isSaving }) {
|
|
|
10554
10644
|
e.preventDefault();
|
|
10555
10645
|
navigate("playlists");
|
|
10556
10646
|
},
|
|
10557
|
-
children: "
|
|
10647
|
+
children: t("playlist_breadcrumb")
|
|
10558
10648
|
}) }),
|
|
10559
10649
|
/* @__PURE__ */ jsx(BreadcrumbSeparator, {}),
|
|
10560
10650
|
/* @__PURE__ */ jsx(BreadcrumbItem, { children: /* @__PURE__ */ jsx(BreadcrumbPage, {
|
|
10561
10651
|
className: "font-semibold",
|
|
10562
|
-
children: isEditMode ? "
|
|
10652
|
+
children: isEditMode ? t("playlist_edit_breadcrumb") : t("playlist_create_breadcrumb")
|
|
10563
10653
|
}) })
|
|
10564
10654
|
]
|
|
10565
10655
|
}) }) }),
|
|
@@ -10568,9 +10658,9 @@ function PlaylistFormHeader({ playlistId, isEditMode, onSubmit, isSaving }) {
|
|
|
10568
10658
|
onOpenChange: (open) => {
|
|
10569
10659
|
if (!open && !isDeleting) setIsDeleteOpen(false);
|
|
10570
10660
|
},
|
|
10571
|
-
children: /* @__PURE__ */ jsxs(AlertDialogContent, { children: [/* @__PURE__ */ jsxs(AlertDialogHeader, { children: [/* @__PURE__ */ jsx(AlertDialogTitle, { children: "
|
|
10661
|
+
children: /* @__PURE__ */ jsxs(AlertDialogContent, { children: [/* @__PURE__ */ jsxs(AlertDialogHeader, { children: [/* @__PURE__ */ jsx(AlertDialogTitle, { children: t("playlist_delete_confirm_title") }), /* @__PURE__ */ jsx(AlertDialogDescription, { children: t("playlist_delete_confirm_description") })] }), /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [/* @__PURE__ */ jsx(AlertDialogCancel, {
|
|
10572
10662
|
disabled: isDeleting,
|
|
10573
|
-
children: "
|
|
10663
|
+
children: t("common_cancel")
|
|
10574
10664
|
}), /* @__PURE__ */ jsx(AlertDialogAction, {
|
|
10575
10665
|
onClick: (e) => {
|
|
10576
10666
|
e.preventDefault();
|
|
@@ -10578,7 +10668,7 @@ function PlaylistFormHeader({ playlistId, isEditMode, onSubmit, isSaving }) {
|
|
|
10578
10668
|
},
|
|
10579
10669
|
disabled: isDeleting,
|
|
10580
10670
|
className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
10581
|
-
children: isDeleting ? /* @__PURE__ */ jsx(Spinner, { className: "size-4" }) : "
|
|
10671
|
+
children: isDeleting ? /* @__PURE__ */ jsx(Spinner, { className: "size-4" }) : t("common_delete")
|
|
10582
10672
|
})] })] })
|
|
10583
10673
|
})
|
|
10584
10674
|
] });
|
|
@@ -10586,6 +10676,7 @@ function PlaylistFormHeader({ playlistId, isEditMode, onSubmit, isSaving }) {
|
|
|
10586
10676
|
//#endregion
|
|
10587
10677
|
//#region ../../shareables/ui/src/components/playlists/form/PlaylistFormDetails.tsx
|
|
10588
10678
|
function PlaylistFormDetails() {
|
|
10679
|
+
const { t } = useShareablesTranslation();
|
|
10589
10680
|
const { form, updateField, validationErrors } = usePlaylistForm();
|
|
10590
10681
|
return /* @__PURE__ */ jsx("div", {
|
|
10591
10682
|
className: "border-border bg-card w-full rounded-lg border p-4 shadow-xs",
|
|
@@ -10593,10 +10684,10 @@ function PlaylistFormDetails() {
|
|
|
10593
10684
|
className: "space-y-6",
|
|
10594
10685
|
children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h2", {
|
|
10595
10686
|
className: "text-md text-foreground font-semibold",
|
|
10596
|
-
children: "
|
|
10687
|
+
children: t("playlist_form_heading")
|
|
10597
10688
|
}), /* @__PURE__ */ jsx("p", {
|
|
10598
10689
|
className: "text-muted-foreground text-sm",
|
|
10599
|
-
children: "
|
|
10690
|
+
children: t("playlist_form_description")
|
|
10600
10691
|
})] }), /* @__PURE__ */ jsxs("div", {
|
|
10601
10692
|
className: "space-y-4",
|
|
10602
10693
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
@@ -10604,11 +10695,11 @@ function PlaylistFormDetails() {
|
|
|
10604
10695
|
children: [
|
|
10605
10696
|
/* @__PURE__ */ jsx(Label, {
|
|
10606
10697
|
className: "text-foreground font-medium",
|
|
10607
|
-
children: "
|
|
10698
|
+
children: t("playlist_name_label")
|
|
10608
10699
|
}),
|
|
10609
10700
|
/* @__PURE__ */ jsx(Input, {
|
|
10610
10701
|
name: "title",
|
|
10611
|
-
placeholder: "
|
|
10702
|
+
placeholder: t("playlist_name_placeholder"),
|
|
10612
10703
|
value: form.title,
|
|
10613
10704
|
onChange: (e) => updateField("title", e.target.value),
|
|
10614
10705
|
required: true,
|
|
@@ -10623,7 +10714,7 @@ function PlaylistFormDetails() {
|
|
|
10623
10714
|
className: "flex flex-col gap-2",
|
|
10624
10715
|
children: [/* @__PURE__ */ jsx(Label, {
|
|
10625
10716
|
className: "text-foreground font-medium",
|
|
10626
|
-
children: "
|
|
10717
|
+
children: t("common_description_label")
|
|
10627
10718
|
}), /* @__PURE__ */ jsx("div", {
|
|
10628
10719
|
className: "border-border rounded-[6px] border shadow-xs",
|
|
10629
10720
|
children: /* @__PURE__ */ jsx(RichTextEditor, {
|
|
@@ -10631,7 +10722,7 @@ function PlaylistFormDetails() {
|
|
|
10631
10722
|
onChange: (value) => updateField("description", value),
|
|
10632
10723
|
className: "h-48 border-0",
|
|
10633
10724
|
editorClassName: "h-36 overflow-auto",
|
|
10634
|
-
placeholder: "
|
|
10725
|
+
placeholder: t("playlist_description_placeholder")
|
|
10635
10726
|
})
|
|
10636
10727
|
})]
|
|
10637
10728
|
})]
|
|
@@ -10673,18 +10764,18 @@ function typeBadgeIcon(relateableType, kind) {
|
|
|
10673
10764
|
if (relateableType === "EnrollmentPack") return Package;
|
|
10674
10765
|
return ShoppingBag;
|
|
10675
10766
|
}
|
|
10676
|
-
function getTypeDisplay(relateableType, relateableKind) {
|
|
10767
|
+
function getTypeDisplay(relateableType, relateableKind, t) {
|
|
10677
10768
|
switch (relateableType) {
|
|
10678
|
-
case "Product": return "
|
|
10679
|
-
case "EnrollmentPack": return "
|
|
10769
|
+
case "Product": return t("common_product");
|
|
10770
|
+
case "EnrollmentPack": return t("common_enrollment_pack");
|
|
10680
10771
|
case "Medium": {
|
|
10681
10772
|
const kind = relateableKind?.toLowerCase() ?? "";
|
|
10682
|
-
if (kind === "video" || kind.includes("video")) return "
|
|
10683
|
-
if (kind === "image" || kind.includes("image")) return "
|
|
10684
|
-
return relateableKind || "
|
|
10773
|
+
if (kind === "video" || kind.includes("video")) return t("media_type_video");
|
|
10774
|
+
if (kind === "image" || kind.includes("image")) return t("media_type_image");
|
|
10775
|
+
return relateableKind || t("media_type_default");
|
|
10685
10776
|
}
|
|
10686
|
-
case "Page": return "
|
|
10687
|
-
default: return relateableType?.replace(/_/g, " ") || "
|
|
10777
|
+
case "Page": return t("common_page");
|
|
10778
|
+
default: return relateableType?.replace(/_/g, " ") || t("common_unknown");
|
|
10688
10779
|
}
|
|
10689
10780
|
}
|
|
10690
10781
|
function getItemIcon(relateableType) {
|
|
@@ -10697,6 +10788,7 @@ function getItemIcon(relateableType) {
|
|
|
10697
10788
|
}
|
|
10698
10789
|
}
|
|
10699
10790
|
function SortableTable({ items, setItems, onDeleteItem, isDeletePending, enableReordering = true }) {
|
|
10791
|
+
const { t } = useShareablesTranslation();
|
|
10700
10792
|
const sensors = useSensors(useSensor(PointerSensor), useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates }));
|
|
10701
10793
|
const handleDragEnd = (event) => {
|
|
10702
10794
|
const { active, over } = event;
|
|
@@ -10721,19 +10813,19 @@ function SortableTable({ items, setItems, onDeleteItem, isDeletePending, enableR
|
|
|
10721
10813
|
children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
10722
10814
|
/* @__PURE__ */ jsx("th", {
|
|
10723
10815
|
className: "text-muted-foreground px-6 py-3 text-left text-xs font-medium tracking-wider uppercase",
|
|
10724
|
-
children: "
|
|
10816
|
+
children: t("playlist_table_order")
|
|
10725
10817
|
}),
|
|
10726
10818
|
/* @__PURE__ */ jsx("th", {
|
|
10727
10819
|
className: "text-muted-foreground px-6 py-3 text-left text-xs font-medium tracking-wider uppercase",
|
|
10728
|
-
children: "
|
|
10820
|
+
children: t("playlist_table_item")
|
|
10729
10821
|
}),
|
|
10730
10822
|
/* @__PURE__ */ jsx("th", {
|
|
10731
10823
|
className: "text-muted-foreground px-6 py-3 text-left text-xs font-medium tracking-wider uppercase",
|
|
10732
|
-
children: "
|
|
10824
|
+
children: t("playlist_table_type")
|
|
10733
10825
|
}),
|
|
10734
10826
|
/* @__PURE__ */ jsx("th", {
|
|
10735
10827
|
className: "text-muted-foreground px-6 py-3 text-left text-xs font-medium tracking-wider uppercase",
|
|
10736
|
-
children: "
|
|
10828
|
+
children: t("playlist_table_actions")
|
|
10737
10829
|
})
|
|
10738
10830
|
] })
|
|
10739
10831
|
}), /* @__PURE__ */ jsx("tbody", {
|
|
@@ -10770,7 +10862,7 @@ function SortableTable({ items, setItems, onDeleteItem, isDeletePending, enableR
|
|
|
10770
10862
|
className: "min-w-0 flex-1",
|
|
10771
10863
|
children: /* @__PURE__ */ jsx("div", {
|
|
10772
10864
|
className: "text-foreground truncate text-sm font-medium",
|
|
10773
|
-
children: row.title || "
|
|
10865
|
+
children: row.title || t("common_untitled")
|
|
10774
10866
|
})
|
|
10775
10867
|
})]
|
|
10776
10868
|
})
|
|
@@ -10779,7 +10871,7 @@ function SortableTable({ items, setItems, onDeleteItem, isDeletePending, enableR
|
|
|
10779
10871
|
className: "px-6 py-4 whitespace-nowrap",
|
|
10780
10872
|
children: /* @__PURE__ */ jsx("div", {
|
|
10781
10873
|
className: "bg-muted text-foreground inline-flex items-center gap-1 rounded-full px-2 py-1 text-xs",
|
|
10782
|
-
children: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(typeBadgeIcon(row.relateable_type || "", row.kind || ""), { className: "h-3 w-3 shrink-0" }), getTypeDisplay(row.relateable_type || "", row.kind || "")] })
|
|
10874
|
+
children: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(typeBadgeIcon(row.relateable_type || "", row.kind || ""), { className: "h-3 w-3 shrink-0" }), getTypeDisplay(row.relateable_type || "", row.kind || "", t)] })
|
|
10783
10875
|
})
|
|
10784
10876
|
}),
|
|
10785
10877
|
/* @__PURE__ */ jsx("td", {
|
|
@@ -10800,7 +10892,7 @@ function SortableTable({ items, setItems, onDeleteItem, isDeletePending, enableR
|
|
|
10800
10892
|
onDeleteItem(typeof row.id === "number" ? row.id : parseInt(String(row.id).replace("item-", "")));
|
|
10801
10893
|
},
|
|
10802
10894
|
variant: "destructive",
|
|
10803
|
-
children: [/* @__PURE__ */ jsx(Trash2, { className: "mr-2 h-4 w-4" }), "
|
|
10895
|
+
children: [/* @__PURE__ */ jsx(Trash2, { className: "mr-2 h-4 w-4" }), t("playlist_delete_item")]
|
|
10804
10896
|
})
|
|
10805
10897
|
})] })
|
|
10806
10898
|
})
|
|
@@ -10876,23 +10968,27 @@ function computeOrderedItems(items) {
|
|
|
10876
10968
|
});
|
|
10877
10969
|
return result;
|
|
10878
10970
|
}
|
|
10879
|
-
|
|
10880
|
-
|
|
10881
|
-
|
|
10882
|
-
|
|
10883
|
-
|
|
10884
|
-
|
|
10885
|
-
|
|
10886
|
-
|
|
10887
|
-
|
|
10888
|
-
|
|
10889
|
-
|
|
10890
|
-
|
|
10891
|
-
|
|
10892
|
-
}
|
|
10971
|
+
function useSections(t) {
|
|
10972
|
+
return useMemo(() => ({
|
|
10973
|
+
primary: {
|
|
10974
|
+
heading: t("playlist_items_heading"),
|
|
10975
|
+
description: t("playlist_items_description"),
|
|
10976
|
+
allowedMethods: ["media", "pages"],
|
|
10977
|
+
allowedRelateableTypes: PRIMARY_CONTENT_TYPES
|
|
10978
|
+
},
|
|
10979
|
+
tagged: {
|
|
10980
|
+
heading: t("playlist_tagged_products_heading"),
|
|
10981
|
+
description: t("playlist_tagged_products_description"),
|
|
10982
|
+
allowedMethods: ["products", "enrollment_packs"],
|
|
10983
|
+
allowedRelateableTypes: TAGGED_CONTENT_TYPES
|
|
10984
|
+
}
|
|
10985
|
+
}), [t]);
|
|
10986
|
+
}
|
|
10893
10987
|
function PlaylistItemsSection({ playlistId }) {
|
|
10988
|
+
const { t } = useShareablesTranslation();
|
|
10894
10989
|
const { showToast, filePickerApi, pickerSources } = useShareablesUI();
|
|
10895
10990
|
const api = useShareablesApi();
|
|
10991
|
+
const SECTIONS = useSections(t);
|
|
10896
10992
|
const [openSection, setOpenSection] = useState(null);
|
|
10897
10993
|
const { items: contextItems, updateItems, addItem, removeItem } = usePlaylistItems();
|
|
10898
10994
|
const tableItems = contextItems;
|
|
@@ -10910,7 +11006,7 @@ function PlaylistItemsSection({ playlistId }) {
|
|
|
10910
11006
|
}, [tableItems]);
|
|
10911
11007
|
const addItemMutation = useAddItemToPlaylistMutation({ onError: (error) => {
|
|
10912
11008
|
showToast({
|
|
10913
|
-
title: "
|
|
11009
|
+
title: t("playlist_add_item_error"),
|
|
10914
11010
|
type: "error",
|
|
10915
11011
|
error
|
|
10916
11012
|
});
|
|
@@ -10918,13 +11014,13 @@ function PlaylistItemsSection({ playlistId }) {
|
|
|
10918
11014
|
const removeItemMutation = useRemoveItemsFromPlaylistMutation({
|
|
10919
11015
|
onSuccess: () => {
|
|
10920
11016
|
showToast({
|
|
10921
|
-
title: "
|
|
11017
|
+
title: t("playlist_remove_item_success"),
|
|
10922
11018
|
type: "success"
|
|
10923
11019
|
});
|
|
10924
11020
|
},
|
|
10925
11021
|
onError: (error) => {
|
|
10926
11022
|
showToast({
|
|
10927
|
-
title: "
|
|
11023
|
+
title: t("playlist_remove_item_error"),
|
|
10928
11024
|
type: "error",
|
|
10929
11025
|
error
|
|
10930
11026
|
});
|
|
@@ -10961,7 +11057,7 @@ function PlaylistItemsSection({ playlistId }) {
|
|
|
10961
11057
|
if (rollback) updateItems(rollback);
|
|
10962
11058
|
reorderRollbackRef.current = null;
|
|
10963
11059
|
showToast({
|
|
10964
|
-
title: "
|
|
11060
|
+
title: t("playlist_reorder_error"),
|
|
10965
11061
|
type: "error",
|
|
10966
11062
|
error
|
|
10967
11063
|
});
|
|
@@ -10976,7 +11072,8 @@ function PlaylistItemsSection({ playlistId }) {
|
|
|
10976
11072
|
playlistId,
|
|
10977
11073
|
canPersistReorder,
|
|
10978
11074
|
reorderItemsMutation.mutate,
|
|
10979
|
-
showToast
|
|
11075
|
+
showToast,
|
|
11076
|
+
t
|
|
10980
11077
|
]);
|
|
10981
11078
|
const handleDeleteItem = (itemId) => {
|
|
10982
11079
|
removeItem(itemId);
|
|
@@ -10989,7 +11086,7 @@ function PlaylistItemsSection({ playlistId }) {
|
|
|
10989
11086
|
setOpenSection(null);
|
|
10990
11087
|
if (results.length === 0) {
|
|
10991
11088
|
showToast({
|
|
10992
|
-
title: "
|
|
11089
|
+
title: t("playlist_no_items_selected"),
|
|
10993
11090
|
type: "warning"
|
|
10994
11091
|
});
|
|
10995
11092
|
return;
|
|
@@ -11003,7 +11100,7 @@ function PlaylistItemsSection({ playlistId }) {
|
|
|
11003
11100
|
const label = result.metadata?.file_name || `${relateableType} #${relateableId}`;
|
|
11004
11101
|
if (tableItems.some((existing) => existing.relateable_type === relateableType && existing.relateable?.id === relateableId)) {
|
|
11005
11102
|
showToast({
|
|
11006
|
-
title: "
|
|
11103
|
+
title: t("playlist_item_already_exists"),
|
|
11007
11104
|
type: "error"
|
|
11008
11105
|
});
|
|
11009
11106
|
continue;
|
|
@@ -11030,7 +11127,7 @@ function PlaylistItemsSection({ playlistId }) {
|
|
|
11030
11127
|
}
|
|
11031
11128
|
});
|
|
11032
11129
|
showToast({
|
|
11033
|
-
title: "
|
|
11130
|
+
title: t("playlist_add_item_success"),
|
|
11034
11131
|
type: "success"
|
|
11035
11132
|
});
|
|
11036
11133
|
} catch {}
|
|
@@ -11041,7 +11138,8 @@ function PlaylistItemsSection({ playlistId }) {
|
|
|
11041
11138
|
playlistId,
|
|
11042
11139
|
addItemMutation,
|
|
11043
11140
|
addItem,
|
|
11044
|
-
showToast
|
|
11141
|
+
showToast,
|
|
11142
|
+
t
|
|
11045
11143
|
]);
|
|
11046
11144
|
const filePickerContextValue = useMemo(() => {
|
|
11047
11145
|
if (!filePickerApi) return null;
|
|
@@ -11124,6 +11222,7 @@ function PlaylistItemsSection({ playlistId }) {
|
|
|
11124
11222
|
});
|
|
11125
11223
|
}
|
|
11126
11224
|
function PlaylistItemsSubsection({ section, items, onAdd, onReorder, onDeleteItem, isPending, isDeletePending, disableAdd = false }) {
|
|
11225
|
+
const { t } = useShareablesTranslation();
|
|
11127
11226
|
return /* @__PURE__ */ jsx("div", {
|
|
11128
11227
|
className: "border-border bg-card rounded-lg border p-4",
|
|
11129
11228
|
children: /* @__PURE__ */ jsxs("div", {
|
|
@@ -11148,7 +11247,7 @@ function PlaylistItemsSubsection({ section, items, onAdd, onReorder, onDeleteIte
|
|
|
11148
11247
|
size: "sm",
|
|
11149
11248
|
className: "flex min-w-25 items-center gap-2",
|
|
11150
11249
|
onClick: onAdd,
|
|
11151
|
-
children: [/* @__PURE__ */ jsx(Plus, { className: "h-4 w-4" }), "
|
|
11250
|
+
children: [/* @__PURE__ */ jsx(Plus, { className: "h-4 w-4" }), t("playlist_add_item_button")]
|
|
11152
11251
|
})
|
|
11153
11252
|
})]
|
|
11154
11253
|
}), /* @__PURE__ */ jsx(SortableTable, {
|
|
@@ -11196,13 +11295,14 @@ function buildPlaylistUrl(options) {
|
|
|
11196
11295
|
return "";
|
|
11197
11296
|
}
|
|
11198
11297
|
function PlaylistOpenGraphPreview({ playlist, playlistShareBaseUrl }) {
|
|
11298
|
+
const { t } = useShareablesTranslation();
|
|
11199
11299
|
const { form } = usePlaylistForm();
|
|
11200
11300
|
const { items } = usePlaylistItems();
|
|
11201
11301
|
const seo = form.search_engine_optimizer;
|
|
11202
11302
|
const firstContentItem = useMemo(() => getFirstOrderedContentItem(items), [items]);
|
|
11203
11303
|
const firstItemImageUrl = useMemo(() => getImageFromRelateable(firstContentItem), [firstContentItem]);
|
|
11204
|
-
const title = (seo?.title || form.title || "").trim() || "
|
|
11205
|
-
const description = (seo?.description || "").trim() || stripHtml(form.description || "") || "
|
|
11304
|
+
const title = (seo?.title || form.title || "").trim() || t("playlist_og_title_fallback");
|
|
11305
|
+
const description = (seo?.description || "").trim() || stripHtml(form.description || "") || t("playlist_og_description_fallback");
|
|
11206
11306
|
const imageUrl = firstItemImageUrl || (seo?.image_url || "").trim() || (form.image_url || "").trim();
|
|
11207
11307
|
const shareUrl = useMemo(() => buildPlaylistUrl({
|
|
11208
11308
|
playlist,
|
|
@@ -11226,7 +11326,7 @@ function PlaylistOpenGraphPreview({ playlist, playlistShareBaseUrl }) {
|
|
|
11226
11326
|
className: "border-border bg-card rounded-lg border p-4 shadow-xs",
|
|
11227
11327
|
children: [/* @__PURE__ */ jsx("h3", {
|
|
11228
11328
|
className: "text-foreground mb-2 text-sm font-semibold",
|
|
11229
|
-
children: "
|
|
11329
|
+
children: t("playlist_preview_heading")
|
|
11230
11330
|
}), /* @__PURE__ */ jsxs("div", {
|
|
11231
11331
|
className: "border-border bg-card overflow-hidden rounded-lg border",
|
|
11232
11332
|
children: [/* @__PURE__ */ jsx("div", {
|
|
@@ -11241,7 +11341,7 @@ function PlaylistOpenGraphPreview({ playlist, playlistShareBaseUrl }) {
|
|
|
11241
11341
|
children: [
|
|
11242
11342
|
/* @__PURE__ */ jsx("p", {
|
|
11243
11343
|
className: "text-muted-foreground text-[11px] tracking-wide uppercase",
|
|
11244
|
-
children: hostname || "
|
|
11344
|
+
children: hostname || t("common_site_hostname_fallback")
|
|
11245
11345
|
}),
|
|
11246
11346
|
/* @__PURE__ */ jsx("p", {
|
|
11247
11347
|
className: "text-foreground line-clamp-2 text-base font-semibold",
|
|
@@ -11260,6 +11360,7 @@ function PlaylistOpenGraphPreview({ playlist, playlistShareBaseUrl }) {
|
|
|
11260
11360
|
//#region ../../shareables/ui/src/components/screens/PlaylistCreateScreen.tsx
|
|
11261
11361
|
function PlaylistFormContent({ playlistId, playlist, isEditMode, itemsToUse, onBack, hideHeader, renderHeaderSlot }) {
|
|
11262
11362
|
const api = useShareablesApi();
|
|
11363
|
+
const { t } = useShareablesTranslation();
|
|
11263
11364
|
const { showToast, navigate, user } = useShareablesUI();
|
|
11264
11365
|
const { items: contextItems } = usePlaylistItems();
|
|
11265
11366
|
const { form, updateField, validateForm } = usePlaylistForm();
|
|
@@ -11281,7 +11382,7 @@ function PlaylistFormContent({ playlistId, playlist, isEditMode, itemsToUse, onB
|
|
|
11281
11382
|
const createMutation = useCreatePlaylistMutation({
|
|
11282
11383
|
onSuccess: (createdPlaylist) => {
|
|
11283
11384
|
showToast({
|
|
11284
|
-
title: "
|
|
11385
|
+
title: t("playlist_create_success"),
|
|
11285
11386
|
type: "success"
|
|
11286
11387
|
});
|
|
11287
11388
|
const newId = createdPlaylist.playlist.id;
|
|
@@ -11289,7 +11390,7 @@ function PlaylistFormContent({ playlistId, playlist, isEditMode, itemsToUse, onB
|
|
|
11289
11390
|
},
|
|
11290
11391
|
onError: (error) => {
|
|
11291
11392
|
showToast({
|
|
11292
|
-
title: "
|
|
11393
|
+
title: t("playlist_create_error"),
|
|
11293
11394
|
type: "error",
|
|
11294
11395
|
error
|
|
11295
11396
|
});
|
|
@@ -11298,13 +11399,13 @@ function PlaylistFormContent({ playlistId, playlist, isEditMode, itemsToUse, onB
|
|
|
11298
11399
|
const updateMutation = useUpdatePlaylistMutation({
|
|
11299
11400
|
onSuccess: () => {
|
|
11300
11401
|
showToast({
|
|
11301
|
-
title: "
|
|
11402
|
+
title: t("playlist_update_success"),
|
|
11302
11403
|
type: "success"
|
|
11303
11404
|
});
|
|
11304
11405
|
},
|
|
11305
11406
|
onError: (error) => {
|
|
11306
11407
|
showToast({
|
|
11307
|
-
title: "
|
|
11408
|
+
title: t("playlist_update_error"),
|
|
11308
11409
|
type: "error",
|
|
11309
11410
|
error
|
|
11310
11411
|
});
|
|
@@ -11314,7 +11415,7 @@ function PlaylistFormContent({ playlistId, playlist, isEditMode, itemsToUse, onB
|
|
|
11314
11415
|
const onSaveForm = useCallback(async () => {
|
|
11315
11416
|
if (!validateForm()) {
|
|
11316
11417
|
showToast({
|
|
11317
|
-
title: "
|
|
11418
|
+
title: t("common_fill_required_fields"),
|
|
11318
11419
|
type: "error"
|
|
11319
11420
|
});
|
|
11320
11421
|
return Promise.reject(/* @__PURE__ */ new Error("Validation failed"));
|
|
@@ -11369,7 +11470,7 @@ function PlaylistFormContent({ playlistId, playlist, isEditMode, itemsToUse, onB
|
|
|
11369
11470
|
} catch (itemError) {
|
|
11370
11471
|
console.error("Error adding items to playlist:", itemError);
|
|
11371
11472
|
showToast({
|
|
11372
|
-
title: "
|
|
11473
|
+
title: t("playlist_create_items_partial_error"),
|
|
11373
11474
|
type: "warning"
|
|
11374
11475
|
});
|
|
11375
11476
|
}
|
|
@@ -11384,7 +11485,8 @@ function PlaylistFormContent({ playlistId, playlist, isEditMode, itemsToUse, onB
|
|
|
11384
11485
|
updateMutation,
|
|
11385
11486
|
showToast,
|
|
11386
11487
|
api,
|
|
11387
|
-
user?.id
|
|
11488
|
+
user?.id,
|
|
11489
|
+
t
|
|
11388
11490
|
]);
|
|
11389
11491
|
const isSaving = createMutation.isPending || updateMutation.isPending;
|
|
11390
11492
|
const handleSubmit = async () => {
|
|
@@ -11399,7 +11501,7 @@ function PlaylistFormContent({ playlistId, playlist, isEditMode, itemsToUse, onB
|
|
|
11399
11501
|
e.preventDefault();
|
|
11400
11502
|
(onBack ?? (() => navigate("playlists")))();
|
|
11401
11503
|
},
|
|
11402
|
-
children: "
|
|
11504
|
+
children: t("playlist_breadcrumb")
|
|
11403
11505
|
}) }), isEditMode ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
11404
11506
|
/* @__PURE__ */ jsx(BreadcrumbSeparator, {}),
|
|
11405
11507
|
/* @__PURE__ */ jsx(BreadcrumbItem, { children: /* @__PURE__ */ jsx(BreadcrumbLink, {
|
|
@@ -11409,16 +11511,16 @@ function PlaylistFormContent({ playlistId, playlist, isEditMode, itemsToUse, onB
|
|
|
11409
11511
|
navigate(`playlists/${playlistId}`);
|
|
11410
11512
|
},
|
|
11411
11513
|
className: "block max-w-[40vw] truncate align-bottom md:max-w-[60ch]",
|
|
11412
|
-
children: playlistTitle || "
|
|
11514
|
+
children: playlistTitle || t("playlist_breadcrumb_fallback")
|
|
11413
11515
|
}) }),
|
|
11414
11516
|
/* @__PURE__ */ jsx(BreadcrumbSeparator, {}),
|
|
11415
11517
|
/* @__PURE__ */ jsx(BreadcrumbItem, { children: /* @__PURE__ */ jsx(BreadcrumbPage, {
|
|
11416
11518
|
className: "font-semibold",
|
|
11417
|
-
children: "
|
|
11519
|
+
children: t("common_edit")
|
|
11418
11520
|
}) })
|
|
11419
11521
|
] }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(BreadcrumbSeparator, {}), /* @__PURE__ */ jsx(BreadcrumbItem, { children: /* @__PURE__ */ jsx(BreadcrumbPage, {
|
|
11420
11522
|
className: "font-semibold",
|
|
11421
|
-
children: "
|
|
11523
|
+
children: t("playlist_create_breadcrumb")
|
|
11422
11524
|
}) })] })]
|
|
11423
11525
|
}) }) }),
|
|
11424
11526
|
renderHeaderSlot?.({
|
|
@@ -11486,16 +11588,17 @@ function PlaylistCreateScreen({ playlistId, onBack, hideHeader, renderHeaderSlot
|
|
|
11486
11588
|
//#endregion
|
|
11487
11589
|
//#region ../../shareables/ui/src/components/screens/FilesListingScreen.tsx
|
|
11488
11590
|
const PAGE_SIZE$1 = 24;
|
|
11489
|
-
function formatFileSize(bytes) {
|
|
11490
|
-
if (bytes < 1024) return `${bytes}
|
|
11491
|
-
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)}
|
|
11492
|
-
if (bytes < 1024 * 1024 * 1024) return `${(bytes / (1024 * 1024)).toFixed(1)}
|
|
11493
|
-
return `${(bytes / (1024 * 1024 * 1024)).toFixed(1)}
|
|
11591
|
+
function formatFileSize(bytes, labels) {
|
|
11592
|
+
if (bytes < 1024) return `${bytes} ${labels.b}`;
|
|
11593
|
+
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} ${labels.kb}`;
|
|
11594
|
+
if (bytes < 1024 * 1024 * 1024) return `${(bytes / (1024 * 1024)).toFixed(1)} ${labels.mb}`;
|
|
11595
|
+
return `${(bytes / (1024 * 1024 * 1024)).toFixed(1)} ${labels.gb}`;
|
|
11494
11596
|
}
|
|
11495
11597
|
const DEFAULT_IMAGE$1 = "https://assets.fluid.app/fluid-admin/images/we-commerce/we-commerce.png";
|
|
11496
11598
|
function FilesListingScreen({ onNavigate }) {
|
|
11497
11599
|
const api = useShareablesApi();
|
|
11498
11600
|
const renderImage = useRenderImage();
|
|
11601
|
+
const { t } = useShareablesTranslation();
|
|
11499
11602
|
const [searchTerm, setSearchTerm] = useState("");
|
|
11500
11603
|
const [debouncedSearch, setDebouncedSearch] = useState("");
|
|
11501
11604
|
useEffect(() => {
|
|
@@ -11531,18 +11634,18 @@ function FilesListingScreen({ onNavigate }) {
|
|
|
11531
11634
|
children: /* @__PURE__ */ jsx("div", { className: "border-primary h-6 w-6 animate-spin rounded-full border-2 border-t-transparent" })
|
|
11532
11635
|
}), error && /* @__PURE__ */ jsx("p", {
|
|
11533
11636
|
className: "bg-destructive/10 text-destructive rounded-lg px-3 py-2",
|
|
11534
|
-
children: "
|
|
11637
|
+
children: t("files_load_error")
|
|
11535
11638
|
})] });
|
|
11536
11639
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(ScreenHeaderBreadcrumbs, { children: /* @__PURE__ */ jsx(Breadcrumb, { children: /* @__PURE__ */ jsx(BreadcrumbList, {
|
|
11537
11640
|
className: "text-lg",
|
|
11538
11641
|
children: /* @__PURE__ */ jsx(BreadcrumbItem, { children: /* @__PURE__ */ jsx(BreadcrumbPage, {
|
|
11539
11642
|
className: "font-semibold",
|
|
11540
|
-
children: "
|
|
11643
|
+
children: t("files_breadcrumb")
|
|
11541
11644
|
}) })
|
|
11542
11645
|
}) }) }), /* @__PURE__ */ jsx(ShareableListLayout, {
|
|
11543
11646
|
isLoading,
|
|
11544
11647
|
isEmpty: !error && files.length === 0 && !isFetchingNextPage && !hasNextPage,
|
|
11545
|
-
emptyMessage: debouncedSearch ?
|
|
11648
|
+
emptyMessage: debouncedSearch ? t("files_search_no_results", { search: debouncedSearch }) : t("files_empty_default"),
|
|
11546
11649
|
filters: /* @__PURE__ */ jsx("div", {
|
|
11547
11650
|
className: "flex justify-end",
|
|
11548
11651
|
children: /* @__PURE__ */ jsx("div", {
|
|
@@ -11550,7 +11653,7 @@ function FilesListingScreen({ onNavigate }) {
|
|
|
11550
11653
|
children: /* @__PURE__ */ jsx(SearchSort, {
|
|
11551
11654
|
searchValue: searchTerm,
|
|
11552
11655
|
onSearchChange: setSearchTerm,
|
|
11553
|
-
placeholder: "
|
|
11656
|
+
placeholder: t("files_search_placeholder")
|
|
11554
11657
|
})
|
|
11555
11658
|
})
|
|
11556
11659
|
}),
|
|
@@ -11577,7 +11680,7 @@ function FilesListingScreen({ onNavigate }) {
|
|
|
11577
11680
|
children: [
|
|
11578
11681
|
renderImage({
|
|
11579
11682
|
src: file.preview_image_url || DEFAULT_IMAGE$1,
|
|
11580
|
-
alt: file.filename || "
|
|
11683
|
+
alt: file.filename || t("files_untitled"),
|
|
11581
11684
|
fill: true,
|
|
11582
11685
|
className: "object-cover transition-transform group-hover:scale-105"
|
|
11583
11686
|
}),
|
|
@@ -11591,17 +11694,22 @@ function FilesListingScreen({ onNavigate }) {
|
|
|
11591
11694
|
!isVideo && /* @__PURE__ */ jsx(Badge, {
|
|
11592
11695
|
className: "absolute top-2 right-2 shadow-lg",
|
|
11593
11696
|
variant: "default",
|
|
11594
|
-
children: formatFileSize(file.content_size
|
|
11697
|
+
children: formatFileSize(file.content_size, {
|
|
11698
|
+
b: t("files_size_b"),
|
|
11699
|
+
kb: t("files_size_kb"),
|
|
11700
|
+
mb: t("files_size_mb"),
|
|
11701
|
+
gb: t("files_size_gb")
|
|
11702
|
+
})
|
|
11595
11703
|
})
|
|
11596
11704
|
]
|
|
11597
11705
|
}), /* @__PURE__ */ jsxs("div", {
|
|
11598
11706
|
className: "px-2 pt-2 pb-4",
|
|
11599
11707
|
children: [/* @__PURE__ */ jsx("h3", {
|
|
11600
11708
|
className: "text-foreground line-clamp-2 text-sm leading-tight font-bold",
|
|
11601
|
-
children: file.filename || "
|
|
11709
|
+
children: file.filename || t("files_untitled")
|
|
11602
11710
|
}), /* @__PURE__ */ jsx("p", {
|
|
11603
11711
|
className: "text-muted-foreground mt-1 text-xs",
|
|
11604
|
-
children: file.content_type || "
|
|
11712
|
+
children: file.content_type || t("files_type_default")
|
|
11605
11713
|
})]
|
|
11606
11714
|
})]
|
|
11607
11715
|
}, file.id);
|
|
@@ -11619,6 +11727,7 @@ function toApiSort(value) {
|
|
|
11619
11727
|
function PagesListingScreen({ onNavigate }) {
|
|
11620
11728
|
const api = useShareablesApi();
|
|
11621
11729
|
const renderImage = useRenderImage();
|
|
11730
|
+
const { t } = useShareablesTranslation();
|
|
11622
11731
|
const [searchTerm, setSearchTerm] = useState("");
|
|
11623
11732
|
const [debouncedSearch, setDebouncedSearch] = useState("");
|
|
11624
11733
|
const [sortValue, setSortValue] = useState("newest");
|
|
@@ -11645,6 +11754,20 @@ function PagesListingScreen({ onNavigate }) {
|
|
|
11645
11754
|
initialPageParam: void 0,
|
|
11646
11755
|
placeholderData: keepPreviousData
|
|
11647
11756
|
});
|
|
11757
|
+
const sortOptions = useMemo(() => [
|
|
11758
|
+
{
|
|
11759
|
+
label: t("sort_newest_first"),
|
|
11760
|
+
value: "newest"
|
|
11761
|
+
},
|
|
11762
|
+
{
|
|
11763
|
+
label: t("sort_title_asc"),
|
|
11764
|
+
value: "title_asc"
|
|
11765
|
+
},
|
|
11766
|
+
{
|
|
11767
|
+
label: t("sort_title_desc"),
|
|
11768
|
+
value: "title_desc"
|
|
11769
|
+
}
|
|
11770
|
+
], [t]);
|
|
11648
11771
|
const allPages = useMemo(() => data?.pages.flatMap((p) => p.pages) ?? [], [data?.pages]);
|
|
11649
11772
|
useEffect(() => {
|
|
11650
11773
|
const target = observerTarget.current;
|
|
@@ -11666,14 +11789,14 @@ function PagesListingScreen({ onNavigate }) {
|
|
|
11666
11789
|
className: "text-lg",
|
|
11667
11790
|
children: /* @__PURE__ */ jsx(BreadcrumbItem, { children: /* @__PURE__ */ jsx(BreadcrumbPage, {
|
|
11668
11791
|
className: "font-semibold",
|
|
11669
|
-
children: "
|
|
11792
|
+
children: t("pages_breadcrumb")
|
|
11670
11793
|
}) })
|
|
11671
11794
|
}) }) }), /* @__PURE__ */ jsx(ShareableListLayout, {
|
|
11672
11795
|
isLoading,
|
|
11673
11796
|
error,
|
|
11674
|
-
errorMessage: "
|
|
11797
|
+
errorMessage: t("pages_load_error"),
|
|
11675
11798
|
isEmpty: allPages.length === 0 && !isFetchingNextPage,
|
|
11676
|
-
emptyMessage: debouncedSearch ?
|
|
11799
|
+
emptyMessage: debouncedSearch ? t("pages_search_no_results", { search: debouncedSearch }) : t("pages_empty_default"),
|
|
11677
11800
|
filters: /* @__PURE__ */ jsx("div", {
|
|
11678
11801
|
className: "flex justify-end",
|
|
11679
11802
|
children: /* @__PURE__ */ jsx("div", {
|
|
@@ -11681,21 +11804,8 @@ function PagesListingScreen({ onNavigate }) {
|
|
|
11681
11804
|
children: /* @__PURE__ */ jsx(SearchSort, {
|
|
11682
11805
|
searchValue: searchTerm,
|
|
11683
11806
|
onSearchChange: setSearchTerm,
|
|
11684
|
-
placeholder: "
|
|
11685
|
-
sortOptions
|
|
11686
|
-
{
|
|
11687
|
-
label: "Newest first",
|
|
11688
|
-
value: "newest"
|
|
11689
|
-
},
|
|
11690
|
-
{
|
|
11691
|
-
label: "Title (A-Z)",
|
|
11692
|
-
value: "title_asc"
|
|
11693
|
-
},
|
|
11694
|
-
{
|
|
11695
|
-
label: "Title (Z-A)",
|
|
11696
|
-
value: "title_desc"
|
|
11697
|
-
}
|
|
11698
|
-
],
|
|
11807
|
+
placeholder: t("pages_search_placeholder"),
|
|
11808
|
+
sortOptions,
|
|
11699
11809
|
sortValue,
|
|
11700
11810
|
onSortChange: (v) => setSortValue(v)
|
|
11701
11811
|
})
|
|
@@ -11709,7 +11819,7 @@ function PagesListingScreen({ onNavigate }) {
|
|
|
11709
11819
|
children: /* @__PURE__ */ jsx("div", {
|
|
11710
11820
|
className: SHAREABLE_GRID_CLASS,
|
|
11711
11821
|
children: allPages.map((page) => {
|
|
11712
|
-
const title = page.title || "
|
|
11822
|
+
const title = page.title || t("pages_untitled");
|
|
11713
11823
|
const openDetail = () => onNavigate?.("pages", String(page.id));
|
|
11714
11824
|
return /* @__PURE__ */ jsxs(Card, {
|
|
11715
11825
|
role: "button",
|
|
@@ -11732,7 +11842,7 @@ function PagesListingScreen({ onNavigate }) {
|
|
|
11732
11842
|
}), /* @__PURE__ */ jsx(Badge, {
|
|
11733
11843
|
className: "absolute top-2 right-2 shadow-lg",
|
|
11734
11844
|
variant: page.status === "published" ? "default" : "secondary",
|
|
11735
|
-
children: page.status === "published" ? "
|
|
11845
|
+
children: page.status === "published" ? t("pages_status_published") : t("pages_status_unpublished")
|
|
11736
11846
|
})]
|
|
11737
11847
|
}), /* @__PURE__ */ jsxs("div", {
|
|
11738
11848
|
className: "px-2 pt-2 pb-4",
|
|
@@ -11754,6 +11864,7 @@ function PagesListingScreen({ onNavigate }) {
|
|
|
11754
11864
|
function PageDetailScreen({ pageId, onBack }) {
|
|
11755
11865
|
const api = useShareablesApi();
|
|
11756
11866
|
const { navigate } = useShareablesUI();
|
|
11867
|
+
const { t } = useShareablesTranslation();
|
|
11757
11868
|
const { data: pageResponse, isLoading } = useQuery({
|
|
11758
11869
|
queryKey: shareablesKeys.pages.detail(Number(pageId)),
|
|
11759
11870
|
queryFn: () => api.pages.getPage(Number(pageId))
|
|
@@ -11775,18 +11886,18 @@ function PageDetailScreen({ pageId, onBack }) {
|
|
|
11775
11886
|
e.preventDefault();
|
|
11776
11887
|
(onBack ?? (() => navigate("pages")))();
|
|
11777
11888
|
},
|
|
11778
|
-
children: "
|
|
11889
|
+
children: t("pages_breadcrumb")
|
|
11779
11890
|
}) }),
|
|
11780
11891
|
/* @__PURE__ */ jsx(BreadcrumbSeparator, {}),
|
|
11781
11892
|
/* @__PURE__ */ jsx(BreadcrumbItem, { children: /* @__PURE__ */ jsx(BreadcrumbPage, {
|
|
11782
11893
|
className: "block max-w-[60vw] truncate align-bottom font-semibold md:max-w-[60ch]",
|
|
11783
|
-
children: displayTitle || "
|
|
11894
|
+
children: displayTitle || t("pages_breadcrumb_fallback")
|
|
11784
11895
|
}) })
|
|
11785
11896
|
]
|
|
11786
11897
|
}) }) }), /* @__PURE__ */ jsx(ShareableDetailLayout, {
|
|
11787
11898
|
isLoading,
|
|
11788
11899
|
notFound: !page && !isLoading,
|
|
11789
|
-
notFoundMessage: "
|
|
11900
|
+
notFoundMessage: t("pages_not_found"),
|
|
11790
11901
|
title: displayTitle,
|
|
11791
11902
|
description,
|
|
11792
11903
|
containerHeightClass: "md:h-[calc(95vh-140px)]",
|
|
@@ -11796,13 +11907,13 @@ function PageDetailScreen({ pageId, onBack }) {
|
|
|
11796
11907
|
displayImage,
|
|
11797
11908
|
displayTitle,
|
|
11798
11909
|
isVideo: false,
|
|
11799
|
-
badgeLabel: "
|
|
11910
|
+
badgeLabel: t("pages_badge_label"),
|
|
11800
11911
|
rounded: true,
|
|
11801
11912
|
showBadge: false
|
|
11802
11913
|
}), page && /* @__PURE__ */ jsx(Badge, {
|
|
11803
11914
|
variant: page.status === "published" ? "default" : "secondary",
|
|
11804
11915
|
className: "bg-background/80 text-foreground absolute top-3 right-3 z-0 inline-flex h-8 items-center rounded-full px-3 text-xs font-medium shadow-md backdrop-blur-sm",
|
|
11805
|
-
children: page.status === "published" ? "
|
|
11916
|
+
children: page.status === "published" ? t("pages_status_published") : t("pages_status_unpublished")
|
|
11806
11917
|
})]
|
|
11807
11918
|
}),
|
|
11808
11919
|
actions: page && /* @__PURE__ */ jsx(AssetActions, {
|
|
@@ -11880,6 +11991,334 @@ function ShareablesApp({ screen, detailId, action, onNavigate, onBack, countryCo
|
|
|
11880
11991
|
return content;
|
|
11881
11992
|
}
|
|
11882
11993
|
//#endregion
|
|
11994
|
+
//#region ../../shareables/core/src/translation-adapter.ts
|
|
11995
|
+
const shareablesDomain = createDomainTranslations({
|
|
11996
|
+
fallback: {
|
|
11997
|
+
common_save: "Save",
|
|
11998
|
+
common_cancel: "Cancel",
|
|
11999
|
+
common_delete: "Delete",
|
|
12000
|
+
common_deleting: "Deleting...",
|
|
12001
|
+
common_edit: "Edit",
|
|
12002
|
+
common_done: "Done",
|
|
12003
|
+
common_on: "On",
|
|
12004
|
+
common_off: "Off",
|
|
12005
|
+
common_replace: "Replace",
|
|
12006
|
+
common_remove: "Remove",
|
|
12007
|
+
common_removing: "Removing...",
|
|
12008
|
+
common_add: "Add",
|
|
12009
|
+
common_adding: "Adding...",
|
|
12010
|
+
common_added: "Added",
|
|
12011
|
+
common_untitled: "Untitled",
|
|
12012
|
+
common_loading: "Loading...",
|
|
12013
|
+
common_na: "N/A",
|
|
12014
|
+
common_all: "All",
|
|
12015
|
+
common_mine: "Mine",
|
|
12016
|
+
common_company: "Company",
|
|
12017
|
+
common_product: "Product",
|
|
12018
|
+
common_enrollment: "Enrollment",
|
|
12019
|
+
common_enrollment_pack: "Enrollment Pack",
|
|
12020
|
+
common_page: "Page",
|
|
12021
|
+
common_unknown: "Unknown",
|
|
12022
|
+
common_title_label: "Title",
|
|
12023
|
+
common_description_label: "Description",
|
|
12024
|
+
common_start_writing_placeholder: "Start writing...",
|
|
12025
|
+
common_read_more: "Read more",
|
|
12026
|
+
common_read_less: "Read less",
|
|
12027
|
+
common_not_found_default: "Not found or failed to load.",
|
|
12028
|
+
common_load_error_default: "Failed to load. Please try again.",
|
|
12029
|
+
common_error_prefix: "Error: ",
|
|
12030
|
+
common_fill_required_fields: "Please fill out all required fields",
|
|
12031
|
+
common_select_all: "Select All",
|
|
12032
|
+
common_deselect_all: "Deselect All",
|
|
12033
|
+
common_selected_count: "{{count}} selected",
|
|
12034
|
+
common_favorite: "Favorite",
|
|
12035
|
+
common_unfavorite: "Unfavorite",
|
|
12036
|
+
common_cancel_selection_aria: "Cancel selection",
|
|
12037
|
+
common_more_options_aria: "More options",
|
|
12038
|
+
common_list_view: "List view",
|
|
12039
|
+
common_grid_view: "Grid view",
|
|
12040
|
+
common_site_hostname_fallback: "your-site.com",
|
|
12041
|
+
sort_newest: "Newest",
|
|
12042
|
+
sort_oldest: "Oldest",
|
|
12043
|
+
sort_newest_first: "Newest first",
|
|
12044
|
+
sort_name_asc: "Name (A-Z)",
|
|
12045
|
+
sort_name_desc: "Name (Z-A)",
|
|
12046
|
+
sort_title_asc: "Title (A-Z)",
|
|
12047
|
+
sort_title_desc: "Title (Z-A)",
|
|
12048
|
+
sort_date_newest: "Date Created (Newest)",
|
|
12049
|
+
sort_date_oldest: "Date Created (Oldest)",
|
|
12050
|
+
sort_price_asc: "Price: Low to High",
|
|
12051
|
+
sort_price_desc: "Price: High to Low",
|
|
12052
|
+
media_breadcrumb: "Media",
|
|
12053
|
+
media_heading: "Media",
|
|
12054
|
+
media_new_title: "New Media",
|
|
12055
|
+
media_create_breadcrumb: "New Media",
|
|
12056
|
+
media_type_image: "Image",
|
|
12057
|
+
media_type_video: "Video",
|
|
12058
|
+
media_type_pdf: "PDF",
|
|
12059
|
+
media_type_default: "Media",
|
|
12060
|
+
media_create_success: "Media created successfully",
|
|
12061
|
+
media_create_error: "Failed to create media: {{message}}",
|
|
12062
|
+
media_save_success: "Media saved successfully",
|
|
12063
|
+
media_save_error: "Failed to save: {{message}}",
|
|
12064
|
+
media_delete_success: "Media deleted",
|
|
12065
|
+
media_delete_error: "Failed to delete: {{message}}",
|
|
12066
|
+
media_title_required: "Title is required",
|
|
12067
|
+
media_file_required: "Please select a file",
|
|
12068
|
+
media_not_found: "Media not found or failed to load.",
|
|
12069
|
+
media_select_button: "Select Media",
|
|
12070
|
+
media_replace_button: "Replace Media",
|
|
12071
|
+
media_add_button: "Add Media",
|
|
12072
|
+
media_upload_placeholder: "No media uploaded. Click to upload an image, video, or PDF.",
|
|
12073
|
+
media_details_heading: "Media Details",
|
|
12074
|
+
media_title_placeholder: "Enter media title",
|
|
12075
|
+
media_cta_button_label: "CTA Button: ",
|
|
12076
|
+
media_thumbnail_label: "Thumbnail",
|
|
12077
|
+
media_thumbnail_alt: "Thumbnail",
|
|
12078
|
+
media_video_thumbnail_alt: "Video thumbnail",
|
|
12079
|
+
media_no_thumbnail: "No thumbnail set",
|
|
12080
|
+
media_pending_save: "Pending — save to apply",
|
|
12081
|
+
media_select_new_image: "Select New Image",
|
|
12082
|
+
media_thumbnail_capture_unavailable: "Thumbnail capture is not available in this context",
|
|
12083
|
+
media_thumbnail_upload_error: "Failed to upload thumbnail",
|
|
12084
|
+
media_no_media_available: "No media available",
|
|
12085
|
+
media_actions_aria: "Media actions",
|
|
12086
|
+
media_my_media_tab: "My Media",
|
|
12087
|
+
media_my_media_badge: "My Media",
|
|
12088
|
+
media_search_placeholder: "Search media...",
|
|
12089
|
+
media_filter_all_types: "All types",
|
|
12090
|
+
media_filter_images: "Images",
|
|
12091
|
+
media_filter_videos: "Videos",
|
|
12092
|
+
media_filter_pdfs: "PDFs",
|
|
12093
|
+
media_empty_default: "No media available.",
|
|
12094
|
+
media_delete_dialog_title: "Delete Media",
|
|
12095
|
+
media_delete_dialog_description: "Are you sure you want to delete {{title}}? This action cannot be undone.",
|
|
12096
|
+
media_delete_confirm_title: "Delete this media?",
|
|
12097
|
+
media_delete_confirm_description: "This removes the item from your media library. Shared links that point to it will stop working.",
|
|
12098
|
+
media_frame_capture_error: "Couldn't capture the video frame. Please try again.",
|
|
12099
|
+
media_select_from_video_frame: "Select from video frame",
|
|
12100
|
+
media_select_video_frame: "Select Video Frame",
|
|
12101
|
+
media_select_video_frame_title: "Select Video Frame",
|
|
12102
|
+
media_capture_frame: "Capture Frame",
|
|
12103
|
+
media_tagged_products_heading: "Tagged Products",
|
|
12104
|
+
media_no_products_tagged: "No products tagged yet.",
|
|
12105
|
+
media_add_product_button: "Add Product",
|
|
12106
|
+
media_add_products_button: "Add Products",
|
|
12107
|
+
media_products_selected_count: "{{current}} of {{max}} products selected",
|
|
12108
|
+
media_products_country_note: "Products will only display in available countries.",
|
|
12109
|
+
media_product_fallback_name: "Product #{{id}}",
|
|
12110
|
+
media_max_products_reached: "Maximum {{max}} products reached",
|
|
12111
|
+
media_select_products_title: "Select Products to Tag",
|
|
12112
|
+
media_products_selected_ratio: "({{current}}/{{max}} selected)",
|
|
12113
|
+
media_max_products_warning: "You have reached the maximum limit of {{max}} products.",
|
|
12114
|
+
media_limit_reached: "Limit reached",
|
|
12115
|
+
cta_dialog_title: "CTA Button",
|
|
12116
|
+
cta_dialog_description: "Configure the call-to-action button that appears with your media.",
|
|
12117
|
+
cta_enable_toggle_label: "Enable call-to-action button",
|
|
12118
|
+
cta_action_type_label: "Action Type",
|
|
12119
|
+
cta_type_placeholder: "Select type",
|
|
12120
|
+
cta_type_page: "Page",
|
|
12121
|
+
cta_type_cart: "Cart",
|
|
12122
|
+
cta_type_email: "Email",
|
|
12123
|
+
cta_type_phone: "Phone",
|
|
12124
|
+
cta_button_label: "Button Label",
|
|
12125
|
+
cta_default_button_text: "Learn More",
|
|
12126
|
+
cta_url_label: "URL",
|
|
12127
|
+
cta_url_placeholder: "https://example.com",
|
|
12128
|
+
seo_heading: "SEO And Link Sharing",
|
|
12129
|
+
seo_title_label: "SEO Title",
|
|
12130
|
+
seo_title_placeholder: "Page title for search engines",
|
|
12131
|
+
seo_description_label: "SEO Description",
|
|
12132
|
+
seo_description_placeholder: "Description for search engines",
|
|
12133
|
+
seo_block_crawlers_label: "Block Crawlers",
|
|
12134
|
+
seo_block_crawlers_description: "Prevent search engines from indexing",
|
|
12135
|
+
seo_block_crawlers_aria: "Block search engine crawlers",
|
|
12136
|
+
seo_preview_title_fallback: "Your page title",
|
|
12137
|
+
seo_preview_url_fallback: "yoursite.com/media/...",
|
|
12138
|
+
playlist_breadcrumb: "Playlists",
|
|
12139
|
+
playlist_breadcrumb_fallback: "Playlist",
|
|
12140
|
+
playlist_create_breadcrumb: "New Playlist",
|
|
12141
|
+
playlist_edit_breadcrumb: "Edit Playlist",
|
|
12142
|
+
playlist_badge_label: "Playlist",
|
|
12143
|
+
playlist_create_success: "Playlist created successfully",
|
|
12144
|
+
playlist_create_error: "Failed to create playlist",
|
|
12145
|
+
playlist_update_success: "Playlist updated successfully",
|
|
12146
|
+
playlist_update_error: "Failed to update playlist",
|
|
12147
|
+
playlist_delete_success: "Playlist deleted",
|
|
12148
|
+
playlist_delete_success_full: "Playlist deleted successfully",
|
|
12149
|
+
playlist_delete_error: "Failed to delete playlist",
|
|
12150
|
+
playlist_not_found: "Playlist not found or failed to load.",
|
|
12151
|
+
playlist_create_items_partial_error: "Playlist created but some items failed to add",
|
|
12152
|
+
playlist_favorite_error: "Failed to update favorite",
|
|
12153
|
+
playlist_favorite_added: "Added to favorites",
|
|
12154
|
+
playlist_favorite_removed: "Removed from favorites",
|
|
12155
|
+
playlist_my_playlists_tab: "My Playlists",
|
|
12156
|
+
playlist_search_placeholder: "Search playlists...",
|
|
12157
|
+
playlist_create_button: "Create Playlist",
|
|
12158
|
+
playlist_empty_default: "There are no playlists available at the moment.",
|
|
12159
|
+
playlist_untitled: "Untitled Playlist",
|
|
12160
|
+
playlist_item_count_one: "{{count}} item",
|
|
12161
|
+
playlist_item_count_other: "{{count}} items",
|
|
12162
|
+
playlist_select_aria: "Select {{title}}",
|
|
12163
|
+
playlist_actions_aria: "Playlist actions",
|
|
12164
|
+
playlist_delete_confirm_title: "Delete this playlist?",
|
|
12165
|
+
playlist_delete_confirm_description: "This removes the playlist from your library. Shared links that point to it will stop working.",
|
|
12166
|
+
playlist_form_heading: "Playlist",
|
|
12167
|
+
playlist_form_description: "Name your playlist and add a short description.",
|
|
12168
|
+
playlist_name_label: "Name *",
|
|
12169
|
+
playlist_name_placeholder: "Playlist name",
|
|
12170
|
+
playlist_description_placeholder: "Describe this playlist...",
|
|
12171
|
+
playlist_items_heading: "Playlist Items",
|
|
12172
|
+
playlist_items_description: "Manage the media and pages in your playlist. At least one is required.",
|
|
12173
|
+
playlist_tagged_products_heading: "Tagged Products",
|
|
12174
|
+
playlist_tagged_products_description: "Manage the products and enrollments in your playlist. These items will show as recommended items in the cart.",
|
|
12175
|
+
playlist_add_item_button: "Add Item",
|
|
12176
|
+
playlist_add_item_success: "Item added to playlist successfully",
|
|
12177
|
+
playlist_add_item_error: "Failed to add item to playlist",
|
|
12178
|
+
playlist_remove_item_success: "Item removed from playlist successfully",
|
|
12179
|
+
playlist_remove_item_error: "Failed to remove item from playlist",
|
|
12180
|
+
playlist_reorder_error: "Failed to save new item order",
|
|
12181
|
+
playlist_no_items_selected: "No items selected",
|
|
12182
|
+
playlist_item_already_exists: "This item is already in the playlist",
|
|
12183
|
+
playlist_delete_item: "Delete Item",
|
|
12184
|
+
playlist_table_order: "Order",
|
|
12185
|
+
playlist_table_item: "Item",
|
|
12186
|
+
playlist_table_type: "Type",
|
|
12187
|
+
playlist_table_actions: "Actions",
|
|
12188
|
+
playlist_preview_heading: "Preview",
|
|
12189
|
+
playlist_og_title_fallback: "Playlist title",
|
|
12190
|
+
playlist_og_description_fallback: "Description shown when this playlist is shared on social platforms.",
|
|
12191
|
+
playlist_no_other_playlists: "No Other Playlists",
|
|
12192
|
+
playlist_no_other_playlists_description: "There are no other playlists available",
|
|
12193
|
+
playlist_view_link: "View playlist ->",
|
|
12194
|
+
playlist_other_playlists_tab: "Other Playlists",
|
|
12195
|
+
playlist_no_items: "No Items",
|
|
12196
|
+
playlist_no_items_description: "This playlist doesn't have any items yet",
|
|
12197
|
+
playlist_items_in_playlist_count: "Items in playlist ({{count}})",
|
|
12198
|
+
pages_breadcrumb: "Pages",
|
|
12199
|
+
pages_breadcrumb_fallback: "Page",
|
|
12200
|
+
pages_badge_label: "Page",
|
|
12201
|
+
pages_load_error: "Failed to load pages. Please try again.",
|
|
12202
|
+
pages_search_no_results: "No pages match \"{{search}}\". Try a different search term.",
|
|
12203
|
+
pages_empty_default: "No pages available.",
|
|
12204
|
+
pages_search_placeholder: "Search pages...",
|
|
12205
|
+
pages_untitled: "Untitled Page",
|
|
12206
|
+
pages_status_published: "Published",
|
|
12207
|
+
pages_status_unpublished: "Unpublished",
|
|
12208
|
+
pages_not_found: "Page not found or failed to load.",
|
|
12209
|
+
products_breadcrumb: "Products",
|
|
12210
|
+
products_breadcrumb_fallback: "Product",
|
|
12211
|
+
products_load_error: "Failed to load products. Please try again.",
|
|
12212
|
+
products_load_more_error: "Failed to load more products.",
|
|
12213
|
+
products_add_error: "Failed to add product. Please try again.",
|
|
12214
|
+
products_remove_error: "Failed to remove product. Please try again.",
|
|
12215
|
+
products_search_placeholder: "Search products...",
|
|
12216
|
+
products_search_no_results: "No products found matching your search.",
|
|
12217
|
+
products_search_start_typing: "Start typing to search for products.",
|
|
12218
|
+
products_empty_default: "No products available.",
|
|
12219
|
+
products_not_found: "Product not found or failed to load.",
|
|
12220
|
+
products_no_image: "No Product Image",
|
|
12221
|
+
products_no_media: "This product does not have any associated media",
|
|
12222
|
+
products_price_label: "Price",
|
|
12223
|
+
products_related_sharables: "Related Sharables",
|
|
12224
|
+
products_asset_count: "{{count}} assets",
|
|
12225
|
+
files_breadcrumb: "Files",
|
|
12226
|
+
files_load_error: "Failed to load files. Please try again.",
|
|
12227
|
+
files_search_no_results: "No files match \"{{search}}\". Try a different search term.",
|
|
12228
|
+
files_empty_default: "No files available.",
|
|
12229
|
+
files_search_placeholder: "Search files...",
|
|
12230
|
+
files_untitled: "Untitled File",
|
|
12231
|
+
files_type_default: "File",
|
|
12232
|
+
files_size_b: "B",
|
|
12233
|
+
files_size_kb: "KB",
|
|
12234
|
+
files_size_mb: "MB",
|
|
12235
|
+
files_size_gb: "GB",
|
|
12236
|
+
share_download_asset: "Download Asset",
|
|
12237
|
+
share_download_no_asset: "No downloadable asset available",
|
|
12238
|
+
share_link_copied: "Share link copied to clipboard!",
|
|
12239
|
+
share_link_copy_error: "Failed to copy link to clipboard",
|
|
12240
|
+
share_link_not_available: "Share link not available yet. Please wait...",
|
|
12241
|
+
share_social_description: "Check out this {{type}}: {{title}}",
|
|
12242
|
+
share_mysite_success: "Shared to MySite",
|
|
12243
|
+
share_mysite_error: "Failed to share to MySite",
|
|
12244
|
+
share_unique_link_heading: "Share Your Unique Link",
|
|
12245
|
+
share_qr_code_alt: "QR Code for share link",
|
|
12246
|
+
share_qr_code_default_alt: "QR Code",
|
|
12247
|
+
share_qr_code_load_error: "QR code failed to load",
|
|
12248
|
+
share_mysite_button: "MySite",
|
|
12249
|
+
share_mysite_preview_title: "MySite Preview",
|
|
12250
|
+
share_button: "Share",
|
|
12251
|
+
share_generating_link: "Generating link...",
|
|
12252
|
+
share_loading_media: "Loading media...",
|
|
12253
|
+
share_media_load_error: "Failed to load media",
|
|
12254
|
+
share_analytics_coming_soon: "Analytics Coming Soon",
|
|
12255
|
+
share_analytics_description: "View engagement metrics and performance data",
|
|
12256
|
+
share_type_product: "product",
|
|
12257
|
+
share_type_media: "media",
|
|
12258
|
+
share_type_enrollment_pack: "enrollment pack",
|
|
12259
|
+
share_type_site: "site",
|
|
12260
|
+
share_type_library: "library",
|
|
12261
|
+
share_no_marketing_assets: "No Marketing Assets",
|
|
12262
|
+
share_no_associated_media: "This {{label}} does not have any associated media",
|
|
12263
|
+
share_related_sharables_count: "Related Sharables ({{count}})",
|
|
12264
|
+
share_no_tab_items_found: "No {{tab}} found",
|
|
12265
|
+
share_no_items_to_display: "No items to display",
|
|
12266
|
+
share_click_to_find_assets: "Click to find shareable assets",
|
|
12267
|
+
share_click_to_share_video: "Click to share this video",
|
|
12268
|
+
share_click_to_share_asset: "Click to share this asset",
|
|
12269
|
+
share_no_tagged_products: "No Tagged Products",
|
|
12270
|
+
share_no_tagged_products_description: "No products are tagged in this playlist",
|
|
12271
|
+
share_tagged_products_count: "Tagged Products ({{count}})",
|
|
12272
|
+
common_filter_search_no_results: "No {{entityName}} match \"{{searchTerm}}\" with the current filters. Try a different search term or switch to \"All\".",
|
|
12273
|
+
common_search_no_results: "No {{entityName}} match \"{{searchTerm}}\". Try a different search term.",
|
|
12274
|
+
common_filter_no_results: "No matching {{entityName}} for the current filters.",
|
|
12275
|
+
editor_bold: "Bold",
|
|
12276
|
+
editor_italic: "Italic",
|
|
12277
|
+
editor_underline: "Underline",
|
|
12278
|
+
editor_align_left: "Align left",
|
|
12279
|
+
editor_align_center: "Align center",
|
|
12280
|
+
editor_align_right: "Align right",
|
|
12281
|
+
editor_justify: "Justify",
|
|
12282
|
+
editor_bullet_list: "Bullet list",
|
|
12283
|
+
editor_ordered_list: "Ordered list"
|
|
12284
|
+
},
|
|
12285
|
+
loaders: {
|
|
12286
|
+
de: () => import("./de-ndSZ5ykY.mjs").then((m) => m.default),
|
|
12287
|
+
el: () => import("./el-epEJkauy.mjs").then((m) => m.default),
|
|
12288
|
+
es: () => import("./es-CWW1uLK3.mjs").then((m) => m.default),
|
|
12289
|
+
fr: () => import("./fr-CT47eWK_.mjs").then((m) => m.default),
|
|
12290
|
+
he: () => import("./he-gcmGB1-C.mjs").then((m) => m.default),
|
|
12291
|
+
hu: () => import("./hu-pswRdooT.mjs").then((m) => m.default),
|
|
12292
|
+
id: () => import("./id-Dhws7LdN.mjs").then((m) => m.default),
|
|
12293
|
+
it: () => import("./it-dsOgAn3r.mjs").then((m) => m.default),
|
|
12294
|
+
ja: () => import("./ja-BqySbP-W.mjs").then((m) => m.default),
|
|
12295
|
+
ko: () => import("./ko-Cdb4MyCC.mjs").then((m) => m.default),
|
|
12296
|
+
nl: () => import("./nl-D0dcnS-5.mjs").then((m) => m.default),
|
|
12297
|
+
pl: () => import("./pl-COP9NGch.mjs").then((m) => m.default),
|
|
12298
|
+
pt: () => import("./pt-CSvh02ed.mjs").then((m) => m.default),
|
|
12299
|
+
ro: () => import("./ro-D2WH48l8.mjs").then((m) => m.default),
|
|
12300
|
+
ru: () => import("./ru-BCP_P-Kw.mjs").then((m) => m.default),
|
|
12301
|
+
th: () => import("./th-CZxqRIHs.mjs").then((m) => m.default),
|
|
12302
|
+
tl: () => import("./tl-DCKUBvuV.mjs").then((m) => m.default),
|
|
12303
|
+
tr: () => import("./tr-COlHtN47.mjs").then((m) => m.default),
|
|
12304
|
+
zh_CN: () => import("./zh_CN-oOeDsP-B.mjs").then((m) => m.default),
|
|
12305
|
+
zh_TW: () => import("./zh_TW-D-xI7JBs.mjs").then((m) => m.default)
|
|
12306
|
+
}
|
|
12307
|
+
});
|
|
12308
|
+
function createShareablesTranslationAdapter(locale, dict) {
|
|
12309
|
+
return createStaticDictAdapter(locale, dict);
|
|
12310
|
+
}
|
|
12311
|
+
//#endregion
|
|
12312
|
+
//#region src/providers/ShareablesTranslationBridge.tsx
|
|
12313
|
+
function ShareablesTranslationBridge({ children }) {
|
|
12314
|
+
const { locale } = useActiveLocale();
|
|
12315
|
+
const dict = useDomainDict(shareablesDomain, locale);
|
|
12316
|
+
return /* @__PURE__ */ jsx(ShareablesTranslationProvider, {
|
|
12317
|
+
value: useMemo(() => createShareablesTranslationAdapter(locale, dict), [locale, dict]),
|
|
12318
|
+
children
|
|
12319
|
+
});
|
|
12320
|
+
}
|
|
12321
|
+
//#endregion
|
|
11883
12322
|
//#region ../../file-picker/api-client/src/api/url-proxy.ts
|
|
11884
12323
|
const urlProxyResponseSchema = z.object({
|
|
11885
12324
|
data: z.string(),
|
|
@@ -13278,7 +13717,7 @@ function ShareablesScreenContent() {
|
|
|
13278
13717
|
detailId,
|
|
13279
13718
|
screen
|
|
13280
13719
|
]);
|
|
13281
|
-
return /* @__PURE__ */ jsx(ShareablesCoreProvider, {
|
|
13720
|
+
return /* @__PURE__ */ jsx(ShareablesTranslationBridge, { children: /* @__PURE__ */ jsx(ShareablesCoreProvider, {
|
|
13282
13721
|
config: useMemo(() => ({
|
|
13283
13722
|
user: account ? { id: account.id } : null,
|
|
13284
13723
|
repContext: true
|
|
@@ -13424,7 +13863,7 @@ function ShareablesScreenContent() {
|
|
|
13424
13863
|
onBack: handleBack
|
|
13425
13864
|
})
|
|
13426
13865
|
})
|
|
13427
|
-
});
|
|
13866
|
+
}) });
|
|
13428
13867
|
}
|
|
13429
13868
|
const shareablesScreenPropertySchema = {
|
|
13430
13869
|
widgetType: "ShareablesScreen",
|
|
@@ -13438,4 +13877,4 @@ const shareablesScreenPropertySchema = {
|
|
|
13438
13877
|
//#endregion
|
|
13439
13878
|
export { shareablesScreenPropertySchema as n, ShareablesScreen as t };
|
|
13440
13879
|
|
|
13441
|
-
//# sourceMappingURL=ShareablesScreen-
|
|
13880
|
+
//# sourceMappingURL=ShareablesScreen-BrsJQqia.mjs.map
|