@allbluecn/web-app 0.3.0
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/package.json +189 -0
- package/public/avatar/part/accessories/accessories-0.svg +7 -0
- package/public/avatar/part/accessories/accessories-1.svg +11 -0
- package/public/avatar/part/accessories/accessories-10.svg +11 -0
- package/public/avatar/part/accessories/accessories-11.svg +6 -0
- package/public/avatar/part/accessories/accessories-12.svg +6 -0
- package/public/avatar/part/accessories/accessories-13.svg +4 -0
- package/public/avatar/part/accessories/accessories-14.svg +6 -0
- package/public/avatar/part/accessories/accessories-2.svg +11 -0
- package/public/avatar/part/accessories/accessories-3.svg +10 -0
- package/public/avatar/part/accessories/accessories-4.svg +15 -0
- package/public/avatar/part/accessories/accessories-5.svg +11 -0
- package/public/avatar/part/accessories/accessories-6.svg +8 -0
- package/public/avatar/part/accessories/accessories-7.svg +11 -0
- package/public/avatar/part/accessories/accessories-8.svg +14 -0
- package/public/avatar/part/accessories/accessories-9.svg +15 -0
- package/public/avatar/part/beard/beard-0.svg +7 -0
- package/public/avatar/part/beard/beard-1.svg +11 -0
- package/public/avatar/part/beard/beard-10.svg +8 -0
- package/public/avatar/part/beard/beard-11.svg +4 -0
- package/public/avatar/part/beard/beard-12.svg +11 -0
- package/public/avatar/part/beard/beard-13.svg +4 -0
- package/public/avatar/part/beard/beard-14.svg +5 -0
- package/public/avatar/part/beard/beard-15.svg +6 -0
- package/public/avatar/part/beard/beard-16.svg +4 -0
- package/public/avatar/part/beard/beard-2.svg +32 -0
- package/public/avatar/part/beard/beard-3.svg +8 -0
- package/public/avatar/part/beard/beard-4.svg +11 -0
- package/public/avatar/part/beard/beard-5.svg +18 -0
- package/public/avatar/part/beard/beard-6.svg +8 -0
- package/public/avatar/part/beard/beard-7.svg +8 -0
- package/public/avatar/part/beard/beard-8.svg +8 -0
- package/public/avatar/part/beard/beard-9.svg +8 -0
- package/public/avatar/part/details/details-0.svg +7 -0
- package/public/avatar/part/details/details-1.svg +8 -0
- package/public/avatar/part/details/details-10.svg +8 -0
- package/public/avatar/part/details/details-11.svg +4 -0
- package/public/avatar/part/details/details-12.svg +4 -0
- package/public/avatar/part/details/details-13.svg +3 -0
- package/public/avatar/part/details/details-2.svg +8 -0
- package/public/avatar/part/details/details-3.svg +8 -0
- package/public/avatar/part/details/details-4.svg +8 -0
- package/public/avatar/part/details/details-5.svg +11 -0
- package/public/avatar/part/details/details-6.svg +8 -0
- package/public/avatar/part/details/details-7.svg +11 -0
- package/public/avatar/part/details/details-8.svg +11 -0
- package/public/avatar/part/details/details-9.svg +8 -0
- package/public/avatar/part/eyebrows/eyebrows-0.svg +11 -0
- package/public/avatar/part/eyebrows/eyebrows-1.svg +11 -0
- package/public/avatar/part/eyebrows/eyebrows-10.svg +8 -0
- package/public/avatar/part/eyebrows/eyebrows-11.svg +4 -0
- package/public/avatar/part/eyebrows/eyebrows-12.svg +4 -0
- package/public/avatar/part/eyebrows/eyebrows-13.svg +4 -0
- package/public/avatar/part/eyebrows/eyebrows-14.svg +4 -0
- package/public/avatar/part/eyebrows/eyebrows-15.svg +4 -0
- package/public/avatar/part/eyebrows/eyebrows-2.svg +8 -0
- package/public/avatar/part/eyebrows/eyebrows-3.svg +11 -0
- package/public/avatar/part/eyebrows/eyebrows-4.svg +11 -0
- package/public/avatar/part/eyebrows/eyebrows-5.svg +11 -0
- package/public/avatar/part/eyebrows/eyebrows-6.svg +8 -0
- package/public/avatar/part/eyebrows/eyebrows-7.svg +11 -0
- package/public/avatar/part/eyebrows/eyebrows-8.svg +11 -0
- package/public/avatar/part/eyebrows/eyebrows-9.svg +11 -0
- package/public/avatar/part/eyes/eyes-0.svg +8 -0
- package/public/avatar/part/eyes/eyes-1.svg +14 -0
- package/public/avatar/part/eyes/eyes-10.svg +17 -0
- package/public/avatar/part/eyes/eyes-11.svg +4 -0
- package/public/avatar/part/eyes/eyes-12.svg +4 -0
- package/public/avatar/part/eyes/eyes-13.svg +16 -0
- package/public/avatar/part/eyes/eyes-2.svg +8 -0
- package/public/avatar/part/eyes/eyes-3.svg +11 -0
- package/public/avatar/part/eyes/eyes-4.svg +8 -0
- package/public/avatar/part/eyes/eyes-5.svg +19 -0
- package/public/avatar/part/eyes/eyes-6.svg +13 -0
- package/public/avatar/part/eyes/eyes-7.svg +8 -0
- package/public/avatar/part/eyes/eyes-8.svg +8 -0
- package/public/avatar/part/eyes/eyes-9.svg +8 -0
- package/public/avatar/part/face/face-0.svg +8 -0
- package/public/avatar/part/face/face-1.svg +8 -0
- package/public/avatar/part/face/face-10.svg +8 -0
- package/public/avatar/part/face/face-11.svg +6 -0
- package/public/avatar/part/face/face-12.svg +6 -0
- package/public/avatar/part/face/face-13.svg +6 -0
- package/public/avatar/part/face/face-14.svg +6 -0
- package/public/avatar/part/face/face-15.svg +6 -0
- package/public/avatar/part/face/face-2.svg +8 -0
- package/public/avatar/part/face/face-3.svg +8 -0
- package/public/avatar/part/face/face-4.svg +8 -0
- package/public/avatar/part/face/face-5.svg +8 -0
- package/public/avatar/part/face/face-6.svg +8 -0
- package/public/avatar/part/face/face-7.svg +8 -0
- package/public/avatar/part/face/face-8.svg +8 -0
- package/public/avatar/part/face/face-9.svg +8 -0
- package/public/avatar/part/glasses/glasses-0.svg +7 -0
- package/public/avatar/part/glasses/glasses-1.svg +13 -0
- package/public/avatar/part/glasses/glasses-10.svg +14 -0
- package/public/avatar/part/glasses/glasses-11.svg +5 -0
- package/public/avatar/part/glasses/glasses-12.svg +12 -0
- package/public/avatar/part/glasses/glasses-13.svg +21 -0
- package/public/avatar/part/glasses/glasses-14.svg +5 -0
- package/public/avatar/part/glasses/glasses-2.svg +8 -0
- package/public/avatar/part/glasses/glasses-3.svg +14 -0
- package/public/avatar/part/glasses/glasses-4.svg +11 -0
- package/public/avatar/part/glasses/glasses-5.svg +13 -0
- package/public/avatar/part/glasses/glasses-6.svg +11 -0
- package/public/avatar/part/glasses/glasses-7.svg +11 -0
- package/public/avatar/part/glasses/glasses-8.svg +14 -0
- package/public/avatar/part/glasses/glasses-9.svg +11 -0
- package/public/avatar/part/hair/hair-0.svg +7 -0
- package/public/avatar/part/hair/hair-1.svg +8 -0
- package/public/avatar/part/hair/hair-10.svg +8 -0
- package/public/avatar/part/hair/hair-11.svg +8 -0
- package/public/avatar/part/hair/hair-12.svg +8 -0
- package/public/avatar/part/hair/hair-13.svg +19 -0
- package/public/avatar/part/hair/hair-14.svg +8 -0
- package/public/avatar/part/hair/hair-15.svg +8 -0
- package/public/avatar/part/hair/hair-16.svg +8 -0
- package/public/avatar/part/hair/hair-17.svg +8 -0
- package/public/avatar/part/hair/hair-18.svg +8 -0
- package/public/avatar/part/hair/hair-19.svg +8 -0
- package/public/avatar/part/hair/hair-2.svg +8 -0
- package/public/avatar/part/hair/hair-20.svg +8 -0
- package/public/avatar/part/hair/hair-21.svg +8 -0
- package/public/avatar/part/hair/hair-22.svg +8 -0
- package/public/avatar/part/hair/hair-23.svg +8 -0
- package/public/avatar/part/hair/hair-24.svg +8 -0
- package/public/avatar/part/hair/hair-25.svg +8 -0
- package/public/avatar/part/hair/hair-26.svg +8 -0
- package/public/avatar/part/hair/hair-27.svg +8 -0
- package/public/avatar/part/hair/hair-28.svg +8 -0
- package/public/avatar/part/hair/hair-29.svg +8 -0
- package/public/avatar/part/hair/hair-3.svg +8 -0
- package/public/avatar/part/hair/hair-30.svg +8 -0
- package/public/avatar/part/hair/hair-31.svg +3 -0
- package/public/avatar/part/hair/hair-32.svg +3 -0
- package/public/avatar/part/hair/hair-33.svg +3 -0
- package/public/avatar/part/hair/hair-34.svg +4 -0
- package/public/avatar/part/hair/hair-35.svg +3 -0
- package/public/avatar/part/hair/hair-36.svg +3 -0
- package/public/avatar/part/hair/hair-37.svg +3 -0
- package/public/avatar/part/hair/hair-38.svg +3 -0
- package/public/avatar/part/hair/hair-39.svg +3 -0
- package/public/avatar/part/hair/hair-4.svg +8 -0
- package/public/avatar/part/hair/hair-40.svg +3 -0
- package/public/avatar/part/hair/hair-41.svg +4 -0
- package/public/avatar/part/hair/hair-42.svg +3 -0
- package/public/avatar/part/hair/hair-43.svg +3 -0
- package/public/avatar/part/hair/hair-44.svg +3 -0
- package/public/avatar/part/hair/hair-45.svg +3 -0
- package/public/avatar/part/hair/hair-46.svg +3 -0
- package/public/avatar/part/hair/hair-47.svg +3 -0
- package/public/avatar/part/hair/hair-48.svg +3 -0
- package/public/avatar/part/hair/hair-49.svg +3 -0
- package/public/avatar/part/hair/hair-5.svg +8 -0
- package/public/avatar/part/hair/hair-50.svg +3 -0
- package/public/avatar/part/hair/hair-51.svg +3 -0
- package/public/avatar/part/hair/hair-52.svg +3 -0
- package/public/avatar/part/hair/hair-53.svg +3 -0
- package/public/avatar/part/hair/hair-54.svg +3 -0
- package/public/avatar/part/hair/hair-55.svg +3 -0
- package/public/avatar/part/hair/hair-56.svg +3 -0
- package/public/avatar/part/hair/hair-57.svg +3 -0
- package/public/avatar/part/hair/hair-58.svg +3 -0
- package/public/avatar/part/hair/hair-6.svg +8 -0
- package/public/avatar/part/hair/hair-7.svg +8 -0
- package/public/avatar/part/hair/hair-8.svg +8 -0
- package/public/avatar/part/hair/hair-9.svg +8 -0
- package/public/avatar/part/mouth/mouth-0.svg +8 -0
- package/public/avatar/part/mouth/mouth-1.svg +8 -0
- package/public/avatar/part/mouth/mouth-10.svg +8 -0
- package/public/avatar/part/mouth/mouth-11.svg +3 -0
- package/public/avatar/part/mouth/mouth-12.svg +4 -0
- package/public/avatar/part/mouth/mouth-13.svg +6 -0
- package/public/avatar/part/mouth/mouth-14.svg +4 -0
- package/public/avatar/part/mouth/mouth-15.svg +5 -0
- package/public/avatar/part/mouth/mouth-16.svg +4 -0
- package/public/avatar/part/mouth/mouth-17.svg +6 -0
- package/public/avatar/part/mouth/mouth-18.svg +4 -0
- package/public/avatar/part/mouth/mouth-19.svg +4 -0
- package/public/avatar/part/mouth/mouth-2.svg +8 -0
- package/public/avatar/part/mouth/mouth-3.svg +12 -0
- package/public/avatar/part/mouth/mouth-4.svg +8 -0
- package/public/avatar/part/mouth/mouth-5.svg +8 -0
- package/public/avatar/part/mouth/mouth-6.svg +8 -0
- package/public/avatar/part/mouth/mouth-7.svg +8 -0
- package/public/avatar/part/mouth/mouth-8.svg +11 -0
- package/public/avatar/part/mouth/mouth-9.svg +8 -0
- package/public/avatar/part/nose/nose-0.svg +8 -0
- package/public/avatar/part/nose/nose-1.svg +8 -0
- package/public/avatar/part/nose/nose-10.svg +8 -0
- package/public/avatar/part/nose/nose-11.svg +3 -0
- package/public/avatar/part/nose/nose-12.svg +3 -0
- package/public/avatar/part/nose/nose-13.svg +3 -0
- package/public/avatar/part/nose/nose-2.svg +8 -0
- package/public/avatar/part/nose/nose-3.svg +8 -0
- package/public/avatar/part/nose/nose-4.svg +8 -0
- package/public/avatar/part/nose/nose-5.svg +8 -0
- package/public/avatar/part/nose/nose-6.svg +8 -0
- package/public/avatar/part/nose/nose-7.svg +8 -0
- package/public/avatar/part/nose/nose-8.svg +8 -0
- package/public/avatar/part/nose/nose-9.svg +8 -0
- package/public/avatar/preview/accessories/0.svg +4 -0
- package/public/avatar/preview/accessories/1.svg +9 -0
- package/public/avatar/preview/accessories/10.svg +9 -0
- package/public/avatar/preview/accessories/11.svg +10 -0
- package/public/avatar/preview/accessories/12.svg +10 -0
- package/public/avatar/preview/accessories/13.svg +8 -0
- package/public/avatar/preview/accessories/14.svg +10 -0
- package/public/avatar/preview/accessories/2.svg +9 -0
- package/public/avatar/preview/accessories/3.svg +8 -0
- package/public/avatar/preview/accessories/4.svg +11 -0
- package/public/avatar/preview/accessories/5.svg +7 -0
- package/public/avatar/preview/accessories/6.svg +6 -0
- package/public/avatar/preview/accessories/7.svg +9 -0
- package/public/avatar/preview/accessories/8.svg +10 -0
- package/public/avatar/preview/accessories/9.svg +13 -0
- package/public/avatar/preview/beard/0.svg +4 -0
- package/public/avatar/preview/beard/1.svg +9 -0
- package/public/avatar/preview/beard/10.svg +6 -0
- package/public/avatar/preview/beard/11.svg +8 -0
- package/public/avatar/preview/beard/12.svg +17 -0
- package/public/avatar/preview/beard/13.svg +8 -0
- package/public/avatar/preview/beard/14.svg +9 -0
- package/public/avatar/preview/beard/15.svg +12 -0
- package/public/avatar/preview/beard/16.svg +8 -0
- package/public/avatar/preview/beard/2.svg +30 -0
- package/public/avatar/preview/beard/3.svg +6 -0
- package/public/avatar/preview/beard/4.svg +9 -0
- package/public/avatar/preview/beard/5.svg +16 -0
- package/public/avatar/preview/beard/6.svg +6 -0
- package/public/avatar/preview/beard/7.svg +6 -0
- package/public/avatar/preview/beard/8.svg +6 -0
- package/public/avatar/preview/beard/9.svg +6 -0
- package/public/avatar/preview/details/0.svg +4 -0
- package/public/avatar/preview/details/1.svg +6 -0
- package/public/avatar/preview/details/10.svg +6 -0
- package/public/avatar/preview/details/11.svg +8 -0
- package/public/avatar/preview/details/12.svg +8 -0
- package/public/avatar/preview/details/13.svg +5 -0
- package/public/avatar/preview/details/2.svg +6 -0
- package/public/avatar/preview/details/3.svg +6 -0
- package/public/avatar/preview/details/4.svg +6 -0
- package/public/avatar/preview/details/5.svg +9 -0
- package/public/avatar/preview/details/6.svg +6 -0
- package/public/avatar/preview/details/7.svg +7 -0
- package/public/avatar/preview/details/8.svg +7 -0
- package/public/avatar/preview/details/9.svg +6 -0
- package/public/avatar/preview/eyebrows/0.svg +9 -0
- package/public/avatar/preview/eyebrows/1.svg +9 -0
- package/public/avatar/preview/eyebrows/10.svg +6 -0
- package/public/avatar/preview/eyebrows/11.svg +8 -0
- package/public/avatar/preview/eyebrows/12.svg +8 -0
- package/public/avatar/preview/eyebrows/13.svg +8 -0
- package/public/avatar/preview/eyebrows/14.svg +8 -0
- package/public/avatar/preview/eyebrows/15.svg +8 -0
- package/public/avatar/preview/eyebrows/2.svg +6 -0
- package/public/avatar/preview/eyebrows/3.svg +9 -0
- package/public/avatar/preview/eyebrows/4.svg +9 -0
- package/public/avatar/preview/eyebrows/5.svg +9 -0
- package/public/avatar/preview/eyebrows/6.svg +6 -0
- package/public/avatar/preview/eyebrows/7.svg +9 -0
- package/public/avatar/preview/eyebrows/8.svg +9 -0
- package/public/avatar/preview/eyebrows/9.svg +9 -0
- package/public/avatar/preview/eyes/0.svg +6 -0
- package/public/avatar/preview/eyes/1.svg +12 -0
- package/public/avatar/preview/eyes/10.svg +15 -0
- package/public/avatar/preview/eyes/11.svg +8 -0
- package/public/avatar/preview/eyes/12.svg +8 -0
- package/public/avatar/preview/eyes/13.svg +24 -0
- package/public/avatar/preview/eyes/2.svg +6 -0
- package/public/avatar/preview/eyes/3.svg +9 -0
- package/public/avatar/preview/eyes/4.svg +6 -0
- package/public/avatar/preview/eyes/5.svg +17 -0
- package/public/avatar/preview/eyes/6.svg +11 -0
- package/public/avatar/preview/eyes/7.svg +6 -0
- package/public/avatar/preview/eyes/8.svg +6 -0
- package/public/avatar/preview/eyes/9.svg +6 -0
- package/public/avatar/preview/face/0.svg +6 -0
- package/public/avatar/preview/face/1.svg +6 -0
- package/public/avatar/preview/face/10.svg +6 -0
- package/public/avatar/preview/face/11.svg +6 -0
- package/public/avatar/preview/face/12.svg +8 -0
- package/public/avatar/preview/face/13.svg +8 -0
- package/public/avatar/preview/face/14.svg +8 -0
- package/public/avatar/preview/face/15.svg +8 -0
- package/public/avatar/preview/face/2.svg +6 -0
- package/public/avatar/preview/face/3.svg +6 -0
- package/public/avatar/preview/face/4.svg +6 -0
- package/public/avatar/preview/face/5.svg +6 -0
- package/public/avatar/preview/face/6.svg +6 -0
- package/public/avatar/preview/face/7.svg +6 -0
- package/public/avatar/preview/face/8.svg +6 -0
- package/public/avatar/preview/face/9.svg +6 -0
- package/public/avatar/preview/glasses/0.svg +4 -0
- package/public/avatar/preview/glasses/1.svg +11 -0
- package/public/avatar/preview/glasses/10.svg +12 -0
- package/public/avatar/preview/glasses/11.svg +11 -0
- package/public/avatar/preview/glasses/12.svg +18 -0
- package/public/avatar/preview/glasses/13.svg +29 -0
- package/public/avatar/preview/glasses/14.svg +11 -0
- package/public/avatar/preview/glasses/2.svg +6 -0
- package/public/avatar/preview/glasses/3.svg +12 -0
- package/public/avatar/preview/glasses/4.svg +9 -0
- package/public/avatar/preview/glasses/5.svg +11 -0
- package/public/avatar/preview/glasses/6.svg +9 -0
- package/public/avatar/preview/glasses/7.svg +9 -0
- package/public/avatar/preview/glasses/8.svg +12 -0
- package/public/avatar/preview/glasses/9.svg +9 -0
- package/public/avatar/preview/hair/0.svg +4 -0
- package/public/avatar/preview/hair/1.svg +6 -0
- package/public/avatar/preview/hair/10.svg +6 -0
- package/public/avatar/preview/hair/11.svg +6 -0
- package/public/avatar/preview/hair/12.svg +6 -0
- package/public/avatar/preview/hair/13.svg +17 -0
- package/public/avatar/preview/hair/14.svg +6 -0
- package/public/avatar/preview/hair/15.svg +6 -0
- package/public/avatar/preview/hair/16.svg +6 -0
- package/public/avatar/preview/hair/17.svg +6 -0
- package/public/avatar/preview/hair/18.svg +6 -0
- package/public/avatar/preview/hair/19.svg +6 -0
- package/public/avatar/preview/hair/2.svg +6 -0
- package/public/avatar/preview/hair/20.svg +6 -0
- package/public/avatar/preview/hair/21.svg +6 -0
- package/public/avatar/preview/hair/22.svg +6 -0
- package/public/avatar/preview/hair/23.svg +6 -0
- package/public/avatar/preview/hair/24.svg +6 -0
- package/public/avatar/preview/hair/25.svg +6 -0
- package/public/avatar/preview/hair/26.svg +6 -0
- package/public/avatar/preview/hair/27.svg +6 -0
- package/public/avatar/preview/hair/28.svg +6 -0
- package/public/avatar/preview/hair/29.svg +6 -0
- package/public/avatar/preview/hair/3.svg +6 -0
- package/public/avatar/preview/hair/30.svg +6 -0
- package/public/avatar/preview/hair/31.svg +5 -0
- package/public/avatar/preview/hair/32.svg +5 -0
- package/public/avatar/preview/hair/33.svg +5 -0
- package/public/avatar/preview/hair/34.svg +8 -0
- package/public/avatar/preview/hair/35.svg +5 -0
- package/public/avatar/preview/hair/36.svg +5 -0
- package/public/avatar/preview/hair/37.svg +5 -0
- package/public/avatar/preview/hair/38.svg +5 -0
- package/public/avatar/preview/hair/39.svg +5 -0
- package/public/avatar/preview/hair/4.svg +6 -0
- package/public/avatar/preview/hair/40.svg +5 -0
- package/public/avatar/preview/hair/41.svg +8 -0
- package/public/avatar/preview/hair/42.svg +5 -0
- package/public/avatar/preview/hair/43.svg +5 -0
- package/public/avatar/preview/hair/44.svg +5 -0
- package/public/avatar/preview/hair/45.svg +5 -0
- package/public/avatar/preview/hair/46.svg +5 -0
- package/public/avatar/preview/hair/47.svg +5 -0
- package/public/avatar/preview/hair/48.svg +5 -0
- package/public/avatar/preview/hair/49.svg +5 -0
- package/public/avatar/preview/hair/5.svg +6 -0
- package/public/avatar/preview/hair/50.svg +5 -0
- package/public/avatar/preview/hair/51.svg +5 -0
- package/public/avatar/preview/hair/52.svg +5 -0
- package/public/avatar/preview/hair/53.svg +5 -0
- package/public/avatar/preview/hair/54.svg +5 -0
- package/public/avatar/preview/hair/55.svg +5 -0
- package/public/avatar/preview/hair/56.svg +5 -0
- package/public/avatar/preview/hair/57.svg +5 -0
- package/public/avatar/preview/hair/58.svg +5 -0
- package/public/avatar/preview/hair/6.svg +6 -0
- package/public/avatar/preview/hair/7.svg +6 -0
- package/public/avatar/preview/hair/8.svg +6 -0
- package/public/avatar/preview/hair/9.svg +6 -0
- package/public/avatar/preview/mouth/0.svg +6 -0
- package/public/avatar/preview/mouth/1.svg +6 -0
- package/public/avatar/preview/mouth/10.svg +6 -0
- package/public/avatar/preview/mouth/11.svg +5 -0
- package/public/avatar/preview/mouth/12.svg +8 -0
- package/public/avatar/preview/mouth/13.svg +10 -0
- package/public/avatar/preview/mouth/14.svg +8 -0
- package/public/avatar/preview/mouth/15.svg +9 -0
- package/public/avatar/preview/mouth/16.svg +8 -0
- package/public/avatar/preview/mouth/17.svg +10 -0
- package/public/avatar/preview/mouth/18.svg +8 -0
- package/public/avatar/preview/mouth/19.svg +8 -0
- package/public/avatar/preview/mouth/2.svg +6 -0
- package/public/avatar/preview/mouth/3.svg +10 -0
- package/public/avatar/preview/mouth/4.svg +6 -0
- package/public/avatar/preview/mouth/5.svg +6 -0
- package/public/avatar/preview/mouth/6.svg +6 -0
- package/public/avatar/preview/mouth/7.svg +6 -0
- package/public/avatar/preview/mouth/8.svg +9 -0
- package/public/avatar/preview/mouth/9.svg +6 -0
- package/public/avatar/preview/nose/0.svg +6 -0
- package/public/avatar/preview/nose/1.svg +6 -0
- package/public/avatar/preview/nose/10.svg +6 -0
- package/public/avatar/preview/nose/11.svg +5 -0
- package/public/avatar/preview/nose/12.svg +5 -0
- package/public/avatar/preview/nose/13.svg +5 -0
- package/public/avatar/preview/nose/2.svg +6 -0
- package/public/avatar/preview/nose/3.svg +6 -0
- package/public/avatar/preview/nose/4.svg +6 -0
- package/public/avatar/preview/nose/5.svg +6 -0
- package/public/avatar/preview/nose/6.svg +6 -0
- package/public/avatar/preview/nose/7.svg +6 -0
- package/public/avatar/preview/nose/8.svg +6 -0
- package/public/avatar/preview/nose/9.svg +6 -0
- package/public/downloads/allblue-sketch-meaxure-plugin.zip +0 -0
- package/public/file.svg +1 -0
- package/public/fonts/NGSwv5HMAFg6IuGlBNMjxLsD8ah8QA.woff2 +0 -0
- package/public/fonts/NGSwv5HMAFg6IuGlBNMjxLsE8ah8QA.woff2 +0 -0
- package/public/fonts/NGSwv5HMAFg6IuGlBNMjxLsH8ag.woff2 +0 -0
- package/public/fonts/NGSwv5HMAFg6IuGlBNMjxLsI8ah8QA.woff2 +0 -0
- package/public/fonts/NGSwv5HMAFg6IuGlBNMjxLsJ8ah8QA.woff2 +0 -0
- package/public/fonts/NGSwv5HMAFg6IuGlBNMjxLsK8ah8QA.woff2 +0 -0
- package/public/fonts/NGSwv5HMAFg6IuGlBNMjxLsL8ah8QA.woff2 +0 -0
- package/public/fonts/NGSyv5HMAFg6IuGlBNMjxLsCwa5kRFe9.woff2 +0 -0
- package/public/fonts/NGSyv5HMAFg6IuGlBNMjxLsCwaRkRFe9.woff2 +0 -0
- package/public/fonts/NGSyv5HMAFg6IuGlBNMjxLsCwaVkRFe9.woff2 +0 -0
- package/public/fonts/NGSyv5HMAFg6IuGlBNMjxLsCwaZkRFe9.woff2 +0 -0
- package/public/fonts/NGSyv5HMAFg6IuGlBNMjxLsCwadkRFe9.woff2 +0 -0
- package/public/fonts/NGSyv5HMAFg6IuGlBNMjxLsCwalkRFe9.woff2 +0 -0
- package/public/fonts/NGSyv5HMAFg6IuGlBNMjxLsCwapkRA.woff2 +0 -0
- package/public/fonts/fonts.css +145 -0
- package/public/fonts/jizBRFtNs2ka5fXjeivQ4LroWlx-6zUTjg.woff2 +0 -0
- package/public/fonts/jizBRFtNs2ka5fXjeivQ4LroWlx-6zsTjmbI.woff2 +0 -0
- package/public/fonts/jizHRFtNs2ka5fXjeivQ4LroWlx-6zAjgn7MsNo.woff2 +0 -0
- package/public/fonts/jizHRFtNs2ka5fXjeivQ4LroWlx-6zAjjH7M.woff2 +0 -0
- package/public/globe.svg +1 -0
- package/public/icons/github-dark.svg +3 -0
- package/public/icons/github-line-dark.svg +1 -0
- package/public/icons/github-line.svg +1 -0
- package/public/icons/github.svg +3 -0
- package/public/next.svg +1 -0
- package/public/vercel.svg +1 -0
- package/public/window.svg +1 -0
- package/src/__tests__/components/auth/auth-brand-panel.test.tsx +49 -0
- package/src/__tests__/components/auth/auth-header.test.tsx +45 -0
- package/src/__tests__/components/auth/auth-layout.test.tsx +42 -0
- package/src/__tests__/components/auth/icon-input.test.tsx +38 -0
- package/src/__tests__/components/auth/oauth-section.test.tsx +51 -0
- package/src/__tests__/components/auth/password-input.test.tsx +49 -0
- package/src/__tests__/components/pages/dashboard.test.ts +29 -0
- package/src/__tests__/components/reference-inline.test.tsx +42 -0
- package/src/__tests__/knowledge-public/canonical-id.test.ts +67 -0
- package/src/__tests__/knowledge-public/favicon.test.ts +59 -0
- package/src/__tests__/knowledge-public/github-sync.test.ts +67 -0
- package/src/__tests__/knowledge-public/share-merge.test.ts +92 -0
- package/src/__tests__/setup.ts +32 -0
- package/src/__tests__/story-view.test.ts +148 -0
- package/src/__tests__/tag-badge.test.tsx +41 -0
- package/src/assets/logo/logo.tsx +53 -0
- package/src/components/agents/agent-card.tsx +127 -0
- package/src/components/agents/agent-form-dialog.tsx +404 -0
- package/src/components/agents/agent-selector.tsx +64 -0
- package/src/components/agents/agents-page.tsx +266 -0
- package/src/components/agents/schemas/agent-form.ts +24 -0
- package/src/components/agents/skill-card.tsx +64 -0
- package/src/components/agents/skill-form-dialog.tsx +148 -0
- package/src/components/agents/slash-skill-menu.tsx +71 -0
- package/src/components/agents/use-agent-handlers.ts +24 -0
- package/src/components/ai/ai-chat-prompt.tsx +179 -0
- package/src/components/ai/global-chat-panel.tsx +138 -0
- package/src/components/ai/use-knowledge-bases.ts +41 -0
- package/src/components/ai/use-selected-model.ts +41 -0
- package/src/components/animated-icons/bell.tsx +110 -0
- package/src/components/animated-icons/book-open-text.tsx +132 -0
- package/src/components/animated-icons/brain.tsx +209 -0
- package/src/components/animated-icons/briefcase-business.tsx +124 -0
- package/src/components/animated-icons/cart.tsx +114 -0
- package/src/components/animated-icons/compass.tsx +115 -0
- package/src/components/animated-icons/contrast.tsx +117 -0
- package/src/components/animated-icons/cursor-click.tsx +163 -0
- package/src/components/animated-icons/earth.tsx +174 -0
- package/src/components/animated-icons/file-text.tsx +176 -0
- package/src/components/animated-icons/flask.tsx +137 -0
- package/src/components/animated-icons/folder-kanban.tsx +128 -0
- package/src/components/animated-icons/graduation-cap.tsx +142 -0
- package/src/components/animated-icons/heart-pulse.tsx +153 -0
- package/src/components/animated-icons/heart.tsx +107 -0
- package/src/components/animated-icons/layers.tsx +130 -0
- package/src/components/animated-icons/layout-grid.tsx +174 -0
- package/src/components/animated-icons/layout-panel-top.tsx +1 -0
- package/src/components/animated-icons/message-square.tsx +124 -0
- package/src/components/animated-icons/pen-tool.tsx +131 -0
- package/src/components/animated-icons/rocket.tsx +147 -0
- package/src/components/animated-icons/search.tsx +111 -0
- package/src/components/animated-icons/settings.tsx +109 -0
- package/src/components/animated-icons/shield-check.tsx +126 -0
- package/src/components/animated-icons/smile.tsx +180 -0
- package/src/components/animated-icons/sparkles.tsx +165 -0
- package/src/components/animated-icons/terminal.tsx +120 -0
- package/src/components/animated-icons/user.tsx +136 -0
- package/src/components/animated-icons/users.tsx +130 -0
- package/src/components/animated-icons/workflow.tsx +144 -0
- package/src/components/animated-icons/zap.tsx +122 -0
- package/src/components/anyhub/anyhub-app-card.tsx +154 -0
- package/src/components/anyhub/anyhub-app-runner.tsx +92 -0
- package/src/components/anyhub/anyhub-install-dialog.tsx +128 -0
- package/src/components/anyhub/anyhub-management-view.tsx +75 -0
- package/src/components/anyhub/anyhub-marketplace-view.tsx +151 -0
- package/src/components/anyhub/anyhub-permission-panel.tsx +125 -0
- package/src/components/anyhub/anyhub-provider.tsx +30 -0
- package/src/components/anyhub/anyhub-top-nav.tsx +117 -0
- package/src/components/auth/auth-brand-panel.tsx +60 -0
- package/src/components/auth/auth-header.tsx +38 -0
- package/src/components/auth/auth-layout.tsx +1 -0
- package/src/components/auth/auth-providers.tsx +34 -0
- package/src/components/auth/icon-input.tsx +46 -0
- package/src/components/auth/oauth-section.tsx +59 -0
- package/src/components/auth/password-input.tsx +68 -0
- package/src/components/auth/session-guard.tsx +47 -0
- package/src/components/auth/sso-section.tsx +55 -0
- package/src/components/billing/__tests__/feature-gate.test.tsx +65 -0
- package/src/components/billing/__tests__/seats-manager.test.tsx +130 -0
- package/src/components/billing/__tests__/use-feature.test.tsx +100 -0
- package/src/components/billing/__tests__/use-resource.test.tsx +63 -0
- package/src/components/billing/billing-panel.tsx +107 -0
- package/src/components/billing/checkout-redirect.ts +50 -0
- package/src/components/billing/currency-toggle.tsx +67 -0
- package/src/components/billing/feature-gate.tsx +70 -0
- package/src/components/billing/invoice-history.tsx +85 -0
- package/src/components/billing/login-prompt-dialog.tsx +89 -0
- package/src/components/billing/pricing-card.tsx +81 -0
- package/src/components/billing/pricing-page.tsx +54 -0
- package/src/components/billing/seats-manager.tsx +177 -0
- package/src/components/billing/subscription-card.tsx +100 -0
- package/src/components/billing/subscription-provider.tsx +111 -0
- package/src/components/billing/upgrade-prompt.tsx +49 -0
- package/src/components/billing/use-feature.ts +29 -0
- package/src/components/billing/use-resource.ts +47 -0
- package/src/components/chat/__tests__/ai-conversation.test.tsx +79 -0
- package/src/components/chat/ai-chat-history/components/conversation-group.tsx +97 -0
- package/src/components/chat/ai-chat-history/components/conversation-header.tsx +59 -0
- package/src/components/chat/ai-chat-history/components/conversation-item.tsx +282 -0
- package/src/components/chat/ai-chat-history/components/conversation-search.tsx +65 -0
- package/src/components/chat/ai-chat-history/components/empty-state.tsx +64 -0
- package/src/components/chat/ai-chat-history/index.tsx +209 -0
- package/src/components/chat/ai-chat-history/types.ts +40 -0
- package/src/components/chat/ai-chat-history/utils/group-conversations.ts +76 -0
- package/src/components/chat/ai-chat-history.tsx +19 -0
- package/src/components/chat/ai-citations/components/citation-item.tsx +182 -0
- package/src/components/chat/ai-citations/components/citations-list.tsx +151 -0
- package/src/components/chat/ai-citations/components/inline-citation.tsx +38 -0
- package/src/components/chat/ai-citations/components/source-components.tsx +256 -0
- package/src/components/chat/ai-citations/index.tsx +83 -0
- package/src/components/chat/ai-citations/types.ts +42 -0
- package/src/components/chat/ai-citations/utils.ts +59 -0
- package/src/components/chat/ai-citations.tsx +20 -0
- package/src/components/chat/ai-conversation.tsx +334 -0
- package/src/components/chat/ai-message/components/code-block.tsx +174 -0
- package/src/components/chat/ai-message/components/markdown-content.tsx +105 -0
- package/src/components/chat/ai-message/components/message-actions.tsx +129 -0
- package/src/components/chat/ai-message/components/streaming-indicator.tsx +37 -0
- package/src/components/chat/ai-message/hooks/use-streaming-text.ts +73 -0
- package/src/components/chat/ai-message/index.tsx +128 -0
- package/src/components/chat/ai-message/types.ts +25 -0
- package/src/components/chat/ai-message/utils/dom-utils.ts +73 -0
- package/src/components/chat/ai-message.tsx +19 -0
- package/src/components/chat/ai-prompt-input/components/action-buttons.tsx +206 -0
- package/src/components/chat/ai-prompt-input/components/agent-mode-select.tsx +51 -0
- package/src/components/chat/ai-prompt-input/components/context-badge.tsx +64 -0
- package/src/components/chat/ai-prompt-input/components/kb-context-selector.tsx +189 -0
- package/src/components/chat/ai-prompt-input/components/model-select.tsx +124 -0
- package/src/components/chat/ai-prompt-input/components/page-user-context-selector.tsx +190 -0
- package/src/components/chat/ai-prompt-input/constants.tsx +57 -0
- package/src/components/chat/ai-prompt-input/index.tsx +346 -0
- package/src/components/chat/ai-prompt-input/types.ts +38 -0
- package/src/components/chat/ai-prompt-input.tsx +20 -0
- package/src/components/chat/ai-thinking.tsx +227 -0
- package/src/components/chat/chat-thread-page.tsx +165 -0
- package/src/components/chat/interrupt-approval.tsx +122 -0
- package/src/components/command-palette.tsx +172 -0
- package/src/components/design/artboard-grid.tsx +64 -0
- package/src/components/design/project-card.tsx +64 -0
- package/src/components/design/sketch/canvas-preview.tsx +151 -0
- package/src/components/design/sketch/code-preview.tsx +81 -0
- package/src/components/design/sketch/export-panel.tsx +74 -0
- package/src/components/design/sketch/layer-tree.tsx +106 -0
- package/src/components/design/sketch/property-panel.tsx +120 -0
- package/src/components/design/sketch/spacing-calculator.ts +46 -0
- package/src/components/forms/app-array-field.tsx +92 -0
- package/src/components/forms/app-checkbox.tsx +60 -0
- package/src/components/forms/app-combobox.tsx +108 -0
- package/src/components/forms/app-date-picker.tsx +79 -0
- package/src/components/forms/app-field-error.tsx +27 -0
- package/src/components/forms/app-field.tsx +80 -0
- package/src/components/forms/app-form-dialog.tsx +115 -0
- package/src/components/forms/app-input.tsx +64 -0
- package/src/components/forms/app-section.tsx +39 -0
- package/src/components/forms/app-select.tsx +83 -0
- package/src/components/forms/app-submit.tsx +65 -0
- package/src/components/forms/app-switch.tsx +60 -0
- package/src/components/forms/app-textarea.tsx +64 -0
- package/src/components/forms/hooks/use-form-submit.ts +55 -0
- package/src/components/forms/index.ts +31 -0
- package/src/components/forms/schemas/common.ts +28 -0
- package/src/components/forms/types.ts +34 -0
- package/src/components/hotkeys/shortcut-badge.tsx +48 -0
- package/src/components/hotkeys/shortcuts-panel.tsx +91 -0
- package/src/components/kibo-ui/contribution-graph/index.tsx +534 -0
- package/src/components/knowledge/dialog/knowledge-form-dialog.tsx +184 -0
- package/src/components/knowledge/doc-properties.tsx +190 -0
- package/src/components/knowledge/editor/doc-header.tsx +243 -0
- package/src/components/knowledge/editor/editor-width-context.tsx +56 -0
- package/src/components/knowledge/editor/knowledge-doc-editor.tsx +308 -0
- package/src/components/knowledge/knowledge-homepage.tsx +99 -0
- package/src/components/knowledge/knowledge-icon.tsx +38 -0
- package/src/components/knowledge/knowledge-settings-panel.tsx +148 -0
- package/src/components/knowledge/knowledge-tag-input.tsx +87 -0
- package/src/components/knowledge/knowledge-toolbar.tsx +521 -0
- package/src/components/knowledge/knowledge-tree-item.tsx +342 -0
- package/src/components/knowledge/knowledge-tree.tsx +235 -0
- package/src/components/knowledge/schemas/knowledge-form.ts +26 -0
- package/src/components/knowledge-public/bookmark-card.tsx +254 -0
- package/src/components/knowledge-public/bookmark-form-dialog.tsx +259 -0
- package/src/components/knowledge-public/category-icon.tsx +66 -0
- package/src/components/knowledge-public/chip-utils.ts +24 -0
- package/src/components/knowledge-public/knowledge-card-grid.tsx +26 -0
- package/src/components/knowledge-public/knowledge-card.tsx +105 -0
- package/src/components/knowledge-public/knowledge-filters.tsx +77 -0
- package/src/components/knowledge-public/knowledge-form-dialog.tsx +524 -0
- package/src/components/knowledge-public/knowledge-search-bar.tsx +46 -0
- package/src/components/knowledge-public/legal-compliance-editor.tsx +290 -0
- package/src/components/knowledge-public/markdown-editor.tsx +59 -0
- package/src/components/knowledge-public/markdown-view.tsx +30 -0
- package/src/components/knowledge-public/sharers-avatar-group.tsx +81 -0
- package/src/components/knowledge-public/tag-filter.tsx +53 -0
- package/src/components/layout/sidebar-03/__tests__/nav-workspace.test.tsx +156 -0
- package/src/components/layout/sidebar-03/app-sidebar.tsx +109 -0
- package/src/components/layout/sidebar-03/index.tsx +64 -0
- package/src/components/layout/sidebar-03/logo.tsx +41 -0
- package/src/components/layout/sidebar-03/nav-anyhub.tsx +150 -0
- package/src/components/layout/sidebar-03/nav-knowledge.tsx +321 -0
- package/src/components/layout/sidebar-03/nav-main.tsx +256 -0
- package/src/components/layout/sidebar-03/nav-notifications.tsx +78 -0
- package/src/components/layout/sidebar-03/nav-workspace.tsx +160 -0
- package/src/components/layout/sidebar-03/sidebar-search-trigger.tsx +63 -0
- package/src/components/layout/sidebar-03/team-switcher.tsx +114 -0
- package/src/components/layout/sidebar-03/user-menu.tsx +188 -0
- package/src/components/magicui/animated-gradient-text.tsx +54 -0
- package/src/components/magicui/animated-grid-pattern.tsx +192 -0
- package/src/components/magicui/animated-theme-toggler.tsx +1 -0
- package/src/components/magicui/aurora-text.tsx +58 -0
- package/src/components/magicui/components/animate/avatar-group.tsx +85 -0
- package/src/components/magicui/dot-pattern.tsx +173 -0
- package/src/components/magicui/flickering-grid.tsx +213 -0
- package/src/components/magicui/glyph-matrix.tsx +176 -0
- package/src/components/magicui/grid-pattern.tsx +1 -0
- package/src/components/magicui/hexagon-pattern.tsx +328 -0
- package/src/components/magicui/interactive-grid-pattern.tsx +118 -0
- package/src/components/magicui/interactive-hover-button.tsx +47 -0
- package/src/components/magicui/light-rays.tsx +164 -0
- package/src/components/magicui/primitives/animate/avatar-group.tsx +160 -0
- package/src/components/magicui/primitives/animate/slot.tsx +112 -0
- package/src/components/magicui/primitives/animate/tooltip.tsx +590 -0
- package/src/components/magicui/rainbow-button.tsx +78 -0
- package/src/components/magicui/sparkles-text.tsx +166 -0
- package/src/components/magicui/striped-pattern.tsx +67 -0
- package/src/components/magicui/word-rotate.tsx +64 -0
- package/src/components/mindmap/mindmap-doc-editor.tsx +181 -0
- package/src/components/plugin-slots/__tests__/plugin-nav-items.test.tsx +16 -0
- package/src/components/plugin-slots/__tests__/plugin-settings-tabs.test.tsx +30 -0
- package/src/components/plugin-slots/plugin-nav-items.tsx +12 -0
- package/src/components/plugin-slots/plugin-settings-tabs.tsx +30 -0
- package/src/components/plugin-slots/plugin-widgets.tsx +13 -0
- package/src/components/project/create-project-dialog.tsx +258 -0
- package/src/components/project/invite-member-dialog.tsx +229 -0
- package/src/components/project/project-activity-list.tsx +114 -0
- package/src/components/project/project-animated-icon.tsx +73 -0
- package/src/components/project/project-icon.tsx +38 -0
- package/src/components/project/project-member-manager.tsx +251 -0
- package/src/components/project/project-module-card.tsx +67 -0
- package/src/components/project/schemas/create-project.ts +31 -0
- package/src/components/react-bits/light-rays.css +9 -0
- package/src/components/react-bits/light-rays.jsx +399 -0
- package/src/components/react-bits/liquid-ether.css +7 -0
- package/src/components/react-bits/liquid-ether.jsx +1168 -0
- package/src/components/settings/ai/api-key-field.tsx +141 -0
- package/src/components/settings/ai/create-custom-model-dialog.tsx +267 -0
- package/src/components/settings/ai/model-card.tsx +203 -0
- package/src/components/settings/ai/model-manager.tsx +353 -0
- package/src/components/settings/ai/provider-card.tsx +130 -0
- package/src/components/settings/ai/provider-detail-form.tsx +418 -0
- package/src/components/settings/ai/provider-grid.tsx +157 -0
- package/src/components/settings/ai/provider-icon.tsx +43 -0
- package/src/components/settings/ai/provider-logo.tsx +90 -0
- package/src/components/settings/ai/schemas/provider-detail.ts +25 -0
- package/src/components/settings/language-selector.tsx +49 -0
- package/src/components/settings/personal-team/account/account-client.tsx +135 -0
- package/src/components/settings/personal-team/account/avatar/avatar-config.ts +80 -0
- package/src/components/settings/personal-team/account/avatar/notion-avatar-editor.tsx +454 -0
- package/src/components/settings/personal-team/account/avatar/notion-avatar.tsx +20 -0
- package/src/components/settings/personal-team/account/settings-profile.tsx +530 -0
- package/src/components/settings/personal-team/team/team-client.tsx +431 -0
- package/src/components/settings/personal-team/team/team-invitations.tsx +552 -0
- package/src/components/settings/personal-team/team/team-member-list.tsx +468 -0
- package/src/components/shadcn-space/animations/marquee.tsx +139 -0
- package/src/components/shadcn-space/blocks/about-us-01/about-us.tsx +136 -0
- package/src/components/shadcn-space/blocks/about-us-01/index.tsx +62 -0
- package/src/components/shadcn-space/blocks/cta-01/cta.tsx +74 -0
- package/src/components/shadcn-space/blocks/faq-01/faq.tsx +100 -0
- package/src/components/shadcn-space/blocks/footer-01/footer.tsx +232 -0
- package/src/components/shadcn-space/blocks/hero-01/brand-slider.tsx +79 -0
- package/src/components/shadcn-space/blocks/hero-01/header.tsx +255 -0
- package/src/components/shadcn-space/blocks/hero-01/hero.tsx +111 -0
- package/src/components/shadcn-space/blocks/hero-01/index.tsx +127 -0
- package/src/components/shadcn-space/blocks/portfolio-01/portfolio.tsx +149 -0
- package/src/components/shadcn-space/blocks/pricing-01/pricing.tsx +189 -0
- package/src/components/shadcn-space/blocks/pricing-02/pricing.tsx +213 -0
- package/src/components/shadcn-space/blocks/services-01/services.tsx +178 -0
- package/src/components/shadcn-space/blocks/team-01/team.tsx +166 -0
- package/src/components/share/prd/prd-share-client.tsx +1 -0
- package/src/components/share/prd/share-annotation-overlay.tsx +1 -0
- package/src/components/share/prd/share-comment-panel.tsx +1 -0
- package/src/components/share/prd/share-comment-review-panel.tsx +1 -0
- package/src/components/share/prd/share-directory-tree.tsx +1 -0
- package/src/components/share/prd/share-doc-view.tsx +1 -0
- package/src/components/share/prd/share-layout.tsx +1 -0
- package/src/components/share/prd/share-nav-bar.tsx +1 -0
- package/src/components/share/prd/share-password-gate.tsx +1 -0
- package/src/components/share/prd/share-prototype-view.tsx +1 -0
- package/src/components/share/prd/share-review-panel.tsx +1 -0
- package/src/components/share/prd/share-sse-listener.tsx +1 -0
- package/src/components/share/prd/share-theme-toggle.tsx +1 -0
- package/src/components/share/prd/version-share-client.tsx +1 -0
- package/src/components/shared/component-preview.tsx +18 -0
- package/src/components/shared/contribution-graph-tooltip.tsx +104 -0
- package/src/components/shared/icon-packs/index.ts +1 -0
- package/src/components/shared/icon-packs/knowledge.ts +1 -0
- package/src/components/shared/icon-packs/prd.ts +1 -0
- package/src/components/shared/icon-packs/project.ts +1 -0
- package/src/components/shared/icon-picker.tsx +1 -0
- package/src/components/shared/language-switcher.tsx +67 -0
- package/src/components/shared/name-confirm-dialog.tsx +1 -0
- package/src/components/shared/nav-float-button.tsx +1 -0
- package/src/components/shared/placeholder-page.tsx +1 -0
- package/src/components/shared/theme-toggle.tsx +59 -0
- package/src/components/shared/timezone-bootstrap.tsx +52 -0
- package/src/components/shared/timezone-select.tsx +132 -0
- package/src/components/shared/translator-text.tsx +71 -0
- package/src/components/story/ai/__tests__/action-registry.test.ts +110 -0
- package/src/components/story/ai/__tests__/use-story-ai-model.test.ts +62 -0
- package/src/components/story/ai/__tests__/use-toolbar-overflow.test.ts +64 -0
- package/src/components/story/ai/action-registry.ts +110 -0
- package/src/components/story/ai/handlers/more-popover.tsx +137 -0
- package/src/components/story/ai/handlers/stream-text.ts +169 -0
- package/src/components/story/ai/prototype-dialog.tsx +156 -0
- package/src/components/story/ai/split-dialog.tsx +467 -0
- package/src/components/story/ai/story-ai-panel.tsx +413 -0
- package/src/components/story/ai/story-ai-preview-list.tsx +182 -0
- package/src/components/story/ai/story-ai-toolbar.tsx +290 -0
- package/src/components/story/ai/use-story-ai-model.ts +137 -0
- package/src/components/story/ai/use-toolbar-overflow.ts +187 -0
- package/src/components/story/columns.tsx +197 -0
- package/src/components/story/constants.ts +172 -0
- package/src/components/story/create-story-dialog.tsx +352 -0
- package/src/components/story/detail/__tests__/activity-timeline.test.tsx +151 -0
- package/src/components/story/detail/activity-tabs.tsx +92 -0
- package/src/components/story/detail/activity-timeline.tsx +540 -0
- package/src/components/story/detail/comment-input.tsx +108 -0
- package/src/components/story/detail/comment-item.tsx +198 -0
- package/src/components/story/detail/comment-thread.tsx +98 -0
- package/src/components/story/detail/emoji-picker.tsx +62 -0
- package/src/components/story/detail/reaction-bar.tsx +72 -0
- package/src/components/story/detail/story-detail-body.tsx +598 -0
- package/src/components/story/detail/story-detail-toolbar/attachments.tsx +73 -0
- package/src/components/story/detail/story-detail-toolbar/categories.tsx +74 -0
- package/src/components/story/detail/story-detail-toolbar/children.tsx +762 -0
- package/src/components/story/detail/story-detail-toolbar/dependencies.tsx +73 -0
- package/src/components/story/detail/story-detail-toolbar/knowledge.tsx +73 -0
- package/src/components/story/detail/story-detail-toolbar/links.tsx +73 -0
- package/src/components/story/detail/story-detail-toolbar.tsx +140 -0
- package/src/components/story/detail/story-properties.tsx +118 -0
- package/src/components/story/display/__tests__/display-dropdown-helpers.test.ts +103 -0
- package/src/components/story/display/__tests__/display-dropdown.test.tsx +246 -0
- package/src/components/story/display/__tests__/group-resolver.test.ts +97 -0
- package/src/components/story/display/__tests__/order-resolver.test.ts +102 -0
- package/src/components/story/display/__tests__/use-display-options-search.test.ts +41 -0
- package/src/components/story/display/__tests__/use-display-options.test.ts +148 -0
- package/src/components/story/display/__tests__/use-grouped-stories.test.ts +72 -0
- package/src/components/story/display/__tests__/use-paged-story-groups.test.ts +273 -0
- package/src/components/story/display/constants.ts +106 -0
- package/src/components/story/display/display-dropdown.tsx +500 -0
- package/src/components/story/display/group-fields.ts +52 -0
- package/src/components/story/display/group-resolver.tsx +149 -0
- package/src/components/story/display/order-resolver.ts +51 -0
- package/src/components/story/display/types.ts +85 -0
- package/src/components/story/display/use-display-options-search.ts +31 -0
- package/src/components/story/display/use-display-options.ts +82 -0
- package/src/components/story/display/use-grouped-stories.ts +43 -0
- package/src/components/story/display/use-paged-story-groups.ts +362 -0
- package/src/components/story/filters/add-filter-dropdown.tsx +71 -0
- package/src/components/story/filters/applied-filters.tsx +227 -0
- package/src/components/story/filters/filter-condition.tsx +159 -0
- package/src/components/story/filters/filter-row.tsx +117 -0
- package/src/components/story/filters/filter-toggle.tsx +61 -0
- package/src/components/story/filters/filter-types.ts +119 -0
- package/src/components/story/filters/filter-value-input.tsx +187 -0
- package/src/components/story/filters/index.tsx +22 -0
- package/src/components/story/infinite-scroll-sentinel.tsx +75 -0
- package/src/components/story/inline-editors/assignee-editor.tsx +179 -0
- package/src/components/story/inline-editors/date-editor.tsx +75 -0
- package/src/components/story/inline-editors/index.ts +24 -0
- package/src/components/story/inline-editors/inline-trigger.tsx +60 -0
- package/src/components/story/inline-editors/labels-editor.tsx +119 -0
- package/src/components/story/inline-editors/parent-story-editor.tsx +124 -0
- package/src/components/story/inline-editors/priority-editor.tsx +120 -0
- package/src/components/story/inline-editors/state-editor.tsx +122 -0
- package/src/components/story/inline-editors/story-select-dialog.tsx +662 -0
- package/src/components/story/inline-editors/title-editor.tsx +43 -0
- package/src/components/story/peek-panel.tsx +272 -0
- package/src/components/story/priority-icon.tsx +39 -0
- package/src/components/story/relation-badge.tsx +57 -0
- package/src/components/story/relations/attachments-panel.tsx +179 -0
- package/src/components/story/relations/dependency-panel.tsx +190 -0
- package/src/components/story/relations/hierarchy-panel.tsx +180 -0
- package/src/components/story/relations/knowledge-panel.tsx +284 -0
- package/src/components/story/relations/links-panel.tsx +240 -0
- package/src/components/story/relations/tab.tsx +212 -0
- package/src/components/story/schemas/story-create.ts +34 -0
- package/src/components/story/search-popover.tsx +130 -0
- package/src/components/story/story-list-table.tsx +172 -0
- package/src/components/story/story-list-view.tsx +572 -0
- package/src/components/story/story-panel-header.tsx +322 -0
- package/src/components/story/story-toolbar.tsx +283 -0
- package/src/components/story/transfer-story-popover.tsx +261 -0
- package/src/components/story/types.ts +195 -0
- package/src/components/story/views/__tests__/use-flat-rows.test.ts +76 -0
- package/src/components/story/views/__tests__/view-types.test.ts +87 -0
- package/src/components/story/views/calendar-view.tsx +280 -0
- package/src/components/story/views/create-view-dialog.tsx +323 -0
- package/src/components/story/views/kanban-board.tsx +466 -0
- package/src/components/story/views/kanban-card.tsx +102 -0
- package/src/components/story/views/story-list/__tests__/batch-toolbar.test.tsx +166 -0
- package/src/components/story/views/story-list/__tests__/group-select.test.ts +85 -0
- package/src/components/story/views/story-list/__tests__/move.test.ts +66 -0
- package/src/components/story/views/story-list/batch-preview-dialog.tsx +485 -0
- package/src/components/story/views/story-list/batch-toolbar.tsx +218 -0
- package/src/components/story/views/story-list/group-select.ts +50 -0
- package/src/components/story/views/story-list/group.tsx +239 -0
- package/src/components/story/views/story-list/index.tsx +475 -0
- package/src/components/story/views/story-list/inline-story-creator.tsx +114 -0
- package/src/components/story/views/story-list/move.ts +55 -0
- package/src/components/story/views/story-list/row.tsx +131 -0
- package/src/components/story/views/timeline-view.tsx +275 -0
- package/src/components/story/views/use-flat-rows.ts +163 -0
- package/src/components/story/views/view-list-section.tsx +175 -0
- package/src/components/story/views/view-selector-button.tsx +118 -0
- package/src/components/story/views/view-switcher.tsx +72 -0
- package/src/components/story/views/view-types.ts +133 -0
- package/src/components/ui/accordion.tsx +98 -0
- package/src/components/ui/alert-dialog.tsx +1 -0
- package/src/components/ui/alert.tsx +93 -0
- package/src/components/ui/avatar.tsx +129 -0
- package/src/components/ui/badge.tsx +1 -0
- package/src/components/ui/breadcrumb.tsx +139 -0
- package/src/components/ui/button-group.tsx +100 -0
- package/src/components/ui/button.tsx +1 -0
- package/src/components/ui/calendar.tsx +237 -0
- package/src/components/ui/card.tsx +1 -0
- package/src/components/ui/checkbox.tsx +1 -0
- package/src/components/ui/collapsible.tsx +50 -0
- package/src/components/ui/command.tsx +210 -0
- package/src/components/ui/context-menu.tsx +1 -0
- package/src/components/ui/dialog.tsx +1 -0
- package/src/components/ui/dropdown-menu.tsx +1 -0
- package/src/components/ui/empty.tsx +1 -0
- package/src/components/ui/field.tsx +255 -0
- package/src/components/ui/hover-card.tsx +61 -0
- package/src/components/ui/input-group.tsx +171 -0
- package/src/components/ui/input.tsx +1 -0
- package/src/components/ui/item.tsx +213 -0
- package/src/components/ui/kbd.tsx +33 -0
- package/src/components/ui/label.tsx +1 -0
- package/src/components/ui/navigation-menu.tsx +181 -0
- package/src/components/ui/popover.tsx +1 -0
- package/src/components/ui/progress.tsx +48 -0
- package/src/components/ui/radio-group.tsx +59 -0
- package/src/components/ui/resizable.tsx +1 -0
- package/src/components/ui/safari.tsx +255 -0
- package/src/components/ui/scroll-area.tsx +70 -0
- package/src/components/ui/select.tsx +1 -0
- package/src/components/ui/separator.tsx +45 -0
- package/src/components/ui/sheet.tsx +164 -0
- package/src/components/ui/sidebar.tsx +1 -0
- package/src/components/ui/skeleton.tsx +1 -0
- package/src/components/ui/sonner.tsx +1 -0
- package/src/components/ui/spinner.tsx +28 -0
- package/src/components/ui/switch.tsx +1 -0
- package/src/components/ui/table.tsx +133 -0
- package/src/components/ui/tabs.tsx +108 -0
- package/src/components/ui/textarea.tsx +1 -0
- package/src/components/ui/toggle.tsx +64 -0
- package/src/components/ui/tooltip.tsx +1 -0
- package/src/components/workspace/create-workspace-dialog.tsx +186 -0
- package/src/components/workspace/schemas/create-workspace.ts +27 -0
- package/src/config/sidebar-notifications.ts +50 -0
- package/src/config/sidebar-routes.tsx +104 -0
- package/src/config/sidebar-teams.ts +32 -0
- package/src/hooks/__tests__/use-commands.test.tsx +74 -0
- package/src/hooks/__tests__/use-entity-subscription.test.ts +89 -0
- package/src/hooks/use-commands.ts +78 -0
- package/src/hooks/use-entity-subscription.ts +39 -0
- package/src/hooks/use-mobile.ts +36 -0
- package/src/hooks/use-scrolling.ts +94 -0
- package/src/hooks/use-throttled-callback.ts +20 -0
- package/src/hooks/use-unmount.ts +38 -0
- package/src/hooks/usePolling.ts +129 -0
- package/src/hooks/useTranslator.ts +80 -0
- package/src/i18n/config.ts +20 -0
- package/src/lib/__tests__/ai-adapter.test.ts +92 -0
- package/src/lib/__tests__/cli-detector.test.ts +80 -0
- package/src/lib/__tests__/date-utils.test.ts +86 -0
- package/src/lib/__tests__/datetime.test.ts +74 -0
- package/src/lib/__tests__/desktop-detect.test.ts +19 -0
- package/src/lib/__tests__/desktop-guest.test.ts +28 -0
- package/src/lib/__tests__/embedding.test.ts +65 -0
- package/src/lib/__tests__/module-registry.test.ts +101 -0
- package/src/lib/__tests__/pacer.test.ts +118 -0
- package/src/lib/__tests__/pgvector.test.ts +94 -0
- package/src/lib/__tests__/project-display-id.test.ts +64 -0
- package/src/lib/__tests__/provider-router.test.ts +239 -0
- package/src/lib/__tests__/rag.test.ts +100 -0
- package/src/lib/__tests__/rate-limit.test.ts +80 -0
- package/src/lib/__tests__/sse-transport.test.ts +136 -0
- package/src/lib/ai/__tests__/story-ai-stream.test.ts +280 -0
- package/src/lib/ai/__tests__/story-jsonl.test.ts +186 -0
- package/src/lib/ai/__tests__/story-prompt.test.ts +78 -0
- package/src/lib/ai/story-ai-stream.ts +168 -0
- package/src/lib/ai/story-jsonl.ts +121 -0
- package/src/lib/analytics.ts +79 -0
- package/src/lib/annotation-template.ts +1 -0
- package/src/lib/anyhub/anyhub-message-bridge.ts +141 -0
- package/src/lib/anyhub/anyhub-store.ts +121 -0
- package/src/lib/anyhub/capabilities.ts +88 -0
- package/src/lib/anyhub/manager.ts +225 -0
- package/src/lib/anyhub/manifest.ts +122 -0
- package/src/lib/anyhub/permissions.ts +76 -0
- package/src/lib/anyhub/proxy.ts +134 -0
- package/src/lib/anyhub/types.ts +83 -0
- package/src/lib/auth/__tests__/sso-authorize.test.ts +53 -0
- package/src/lib/auth/auth-client.ts +1 -0
- package/src/lib/auth/auth.config.ts +383 -0
- package/src/lib/auth/sso-authorize.ts +47 -0
- package/src/lib/avatar.ts +41 -0
- package/src/lib/builtin-project.ts +20 -0
- package/src/lib/chat-handoff.ts +77 -0
- package/src/lib/collections/ai/ai-providers-collection.ts +31 -0
- package/src/lib/collections/ai/index.ts +18 -0
- package/src/lib/collections/index.ts +24 -0
- package/src/lib/collections/knowledge/index.ts +18 -0
- package/src/lib/collections/knowledge/knowledge-bases-collection.ts +31 -0
- package/src/lib/collections/reference/bookmark-categories-collection.ts +31 -0
- package/src/lib/collections/reference/labels-collection.ts +31 -0
- package/src/lib/collections/reference/projects-collection.ts +31 -0
- package/src/lib/collections/reference/users-brief-collection.ts +31 -0
- package/src/lib/collections/reference/workspaces-collection.ts +31 -0
- package/src/lib/commands/__tests__/command-palette-state.test.ts +68 -0
- package/src/lib/commands/__tests__/registry.test.ts +98 -0
- package/src/lib/commands/command-palette-state.ts +56 -0
- package/src/lib/commands/registry.ts +49 -0
- package/src/lib/commands/types.ts +32 -0
- package/src/lib/comment-utils.ts +1 -0
- package/src/lib/crypto/__tests__/api-key-cipher.test.ts +72 -0
- package/src/lib/crypto/api-key-cipher.ts +1 -0
- package/src/lib/date-utils.ts +107 -0
- package/src/lib/datetime.ts +6 -0
- package/src/lib/deploy-region.ts +21 -0
- package/src/lib/desktop-detect.ts +27 -0
- package/src/lib/get-strict-context.tsx +53 -0
- package/src/lib/github.ts +228 -0
- package/src/lib/hotkeys/__tests__/registry.test.ts +46 -0
- package/src/lib/hotkeys/registry.ts +109 -0
- package/src/lib/hotkeys/types.ts +29 -0
- package/src/lib/i18n/client.ts +1 -0
- package/src/lib/i18n/config.ts +1 -0
- package/src/lib/i18n/detect.ts +1 -0
- package/src/lib/i18n/server.ts +1 -0
- package/src/lib/i18n/types.ts +1 -0
- package/src/lib/openai-client.ts +62 -0
- package/src/lib/optimistic/use-optimistic-mutation.ts +63 -0
- package/src/lib/outline-utils.ts +1 -0
- package/src/lib/pacer.ts +11 -0
- package/src/lib/perf.ts +19 -0
- package/src/lib/pgvector.ts +22 -0
- package/src/lib/prd/__tests__/stack-layout.test.ts +63 -0
- package/src/lib/prd/stack-layout.ts +1 -0
- package/src/lib/prd-tree-utils.ts +1 -0
- package/src/lib/prisma.ts +18 -0
- package/src/lib/project-display-id.ts +39 -0
- package/src/lib/project-mock.ts +156 -0
- package/src/lib/prototype-registry.ts +1 -0
- package/src/lib/rag.ts +47 -0
- package/src/lib/rate-limit.ts +57 -0
- package/src/lib/redis.ts +51 -0
- package/src/lib/resource-errors.ts +20 -0
- package/src/lib/restore-version.ts +1 -0
- package/src/lib/router-context.ts +39 -0
- package/src/lib/session.ts +44 -0
- package/src/lib/share-events.ts +1 -0
- package/src/lib/share-utils.ts +1 -0
- package/src/lib/sidebar-utils.ts +1 -0
- package/src/lib/sse-transport.ts +78 -0
- package/src/lib/stores/index.ts +18 -0
- package/src/lib/stores/prd-canvas-store.ts +1 -0
- package/src/lib/story/__tests__/activity-grouper.test.ts +234 -0
- package/src/lib/story/__tests__/description-diff.test.ts +214 -0
- package/src/lib/story/activity-grouper.ts +173 -0
- package/src/lib/story/description-diff.ts +140 -0
- package/src/lib/tag-colors.ts +1 -0
- package/src/lib/time-format.ts +1 -0
- package/src/lib/utils.ts +18 -0
- package/src/lib/vector-store/__tests__/factory.test.ts +59 -0
- package/src/lib/vector-store/__tests__/sqlite-vec-store.test.ts +143 -0
- package/src/lib/vector-store/__tests__/vector-store.test.ts +50 -0
- package/src/lib/vector-store/index.ts +45 -0
- package/src/lib/vector-store/pg-vector-store.ts +85 -0
- package/src/lib/vector-store/sqlite-vec-store.ts +162 -0
- package/src/lib/vector-store/types.ts +42 -0
- package/src/plugins/.gen-manifest.json +13 -0
- package/src/plugins/.gitkeep +0 -0
- package/src/plugins/modules.gen.ts +20 -0
- package/src/plugins/plugins.gen.ts +20 -0
- package/src/plugins/ui.gen.ts +10 -0
- package/src/providers/index.tsx +86 -0
- package/src/providers/timezone-provider.tsx +1 -0
- package/src/routeTree.gen.ts +2583 -0
- package/src/router.tsx +73 -0
- package/src/routes/__desktop/onboarding/route.lazy.tsx +145 -0
- package/src/routes/__desktop/onboarding/route.tsx +11 -0
- package/src/routes/__root.tsx +153 -0
- package/src/routes/_login/forgot-password/route.lazy.tsx +102 -0
- package/src/routes/_login/forgot-password/route.tsx +20 -0
- package/src/routes/_login/login/route.lazy.tsx +241 -0
- package/src/routes/_login/login/route.tsx +30 -0
- package/src/routes/_login/register/route.lazy.tsx +173 -0
- package/src/routes/_login/register/route.tsx +23 -0
- package/src/routes/_login/reset-password/route.lazy.tsx +116 -0
- package/src/routes/_login/reset-password/route.tsx +23 -0
- package/src/routes/_login/route.tsx +22 -0
- package/src/routes/_login/schemas/-auth.ts +50 -0
- package/src/routes/_nav/acceptance-criteria/route.tsx +28 -0
- package/src/routes/_nav/agents/route.tsx +12 -0
- package/src/routes/_nav/apps/anyhub/$id/route.tsx +28 -0
- package/src/routes/_nav/apps/anyhub/route.tsx +33 -0
- package/src/routes/_nav/apps/route.tsx +22 -0
- package/src/routes/_nav/bugs/route.tsx +24 -0
- package/src/routes/_nav/chat/$threadId.tsx +31 -0
- package/src/routes/_nav/chat/route.lazy.tsx +428 -0
- package/src/routes/_nav/chat/route.tsx +23 -0
- package/src/routes/_nav/dashboard/-components/activity-feed.tsx +63 -0
- package/src/routes/_nav/dashboard/-components/avatar-group.tsx +54 -0
- package/src/routes/_nav/dashboard/-components/quick-actions.tsx +49 -0
- package/src/routes/_nav/dashboard/-components/stats-grid.tsx +54 -0
- package/src/routes/_nav/dashboard/route.lazy.tsx +106 -0
- package/src/routes/_nav/dashboard/route.tsx +39 -0
- package/src/routes/_nav/design/$projectId/$artboardId/route.lazy.tsx +89 -0
- package/src/routes/_nav/design/$projectId/$artboardId/route.tsx +26 -0
- package/src/routes/_nav/design/$projectId/route.lazy.tsx +50 -0
- package/src/routes/_nav/design/$projectId/route.tsx +26 -0
- package/src/routes/_nav/design/index.lazy.tsx +320 -0
- package/src/routes/_nav/design/index.tsx +26 -0
- package/src/routes/_nav/design/route.tsx +22 -0
- package/src/routes/_nav/inspiration/route.tsx +8 -0
- package/src/routes/_nav/knowledge/$kbId/doc/$docId/route.lazy.tsx +76 -0
- package/src/routes/_nav/knowledge/$kbId/doc/$docId/route.tsx +57 -0
- package/src/routes/_nav/knowledge/$kbId/index.lazy.tsx +30 -0
- package/src/routes/_nav/knowledge/$kbId/index.tsx +30 -0
- package/src/routes/_nav/knowledge/$kbId/route.lazy.tsx +190 -0
- package/src/routes/_nav/knowledge/$kbId/route.tsx +92 -0
- package/src/routes/_nav/knowledge/bookmarks/$id.lazy.tsx +286 -0
- package/src/routes/_nav/knowledge/bookmarks/index.lazy.tsx +179 -0
- package/src/routes/_nav/knowledge/bookmarks/route.tsx +20 -0
- package/src/routes/_nav/knowledge/compliance/$id.lazy.tsx +250 -0
- package/src/routes/_nav/knowledge/compliance/edit/$id.lazy.tsx +28 -0
- package/src/routes/_nav/knowledge/compliance/index.lazy.tsx +125 -0
- package/src/routes/_nav/knowledge/compliance/route.tsx +22 -0
- package/src/routes/_nav/knowledge/dictionaries/$id.lazy.tsx +106 -0
- package/src/routes/_nav/knowledge/dictionaries/index.lazy.tsx +108 -0
- package/src/routes/_nav/knowledge/dictionaries/route.tsx +22 -0
- package/src/routes/_nav/knowledge/index.lazy.tsx +115 -0
- package/src/routes/_nav/knowledge/index.tsx +24 -0
- package/src/routes/_nav/knowledge/laws/$id.lazy.tsx +264 -0
- package/src/routes/_nav/knowledge/laws/edit/$id.lazy.tsx +28 -0
- package/src/routes/_nav/knowledge/laws/index.lazy.tsx +115 -0
- package/src/routes/_nav/knowledge/laws/route.tsx +22 -0
- package/src/routes/_nav/knowledge/route.tsx +22 -0
- package/src/routes/_nav/knowledge/summary/index.lazy.tsx +251 -0
- package/src/routes/_nav/knowledge/summary/route.tsx +22 -0
- package/src/routes/_nav/notion-like/route.tsx +28 -0
- package/src/routes/_nav/prd/$id/route.tsx +9 -0
- package/src/routes/_nav/prd/index.tsx +9 -0
- package/src/routes/_nav/prd/route.tsx +8 -0
- package/src/routes/_nav/pricing-02/route.tsx +28 -0
- package/src/routes/_nav/projects/$projectId/$storyId/route.lazy.tsx +115 -0
- package/src/routes/_nav/projects/$projectId/$storyId/route.tsx +38 -0
- package/src/routes/_nav/projects/$projectId/index.lazy.tsx +171 -0
- package/src/routes/_nav/projects/$projectId/route.lazy.tsx +24 -0
- package/src/routes/_nav/projects/$projectId/route.tsx +36 -0
- package/src/routes/_nav/projects/$projectId/settings/route.lazy.tsx +305 -0
- package/src/routes/_nav/projects/$projectId/settings/route.tsx +32 -0
- package/src/routes/_nav/projects/route.tsx +27 -0
- package/src/routes/_nav/route.lazy.tsx +45 -0
- package/src/routes/_nav/route.tsx +165 -0
- package/src/routes/_nav/settings/-settings-tabs.tsx +135 -0
- package/src/routes/_nav/settings/account/route.lazy.tsx +51 -0
- package/src/routes/_nav/settings/account/route.tsx +37 -0
- package/src/routes/_nav/settings/agents/route.lazy.tsx +10 -0
- package/src/routes/_nav/settings/agents/route.tsx +20 -0
- package/src/routes/_nav/settings/ai/$providerId/route.lazy.tsx +35 -0
- package/src/routes/_nav/settings/ai/$providerId/route.tsx +37 -0
- package/src/routes/_nav/settings/ai/index/route.lazy.tsx +51 -0
- package/src/routes/_nav/settings/ai/route.lazy.tsx +26 -0
- package/src/routes/_nav/settings/ai/route.tsx +31 -0
- package/src/routes/_nav/settings/billing/route.lazy.tsx +42 -0
- package/src/routes/_nav/settings/billing/route.tsx +39 -0
- package/src/routes/_nav/settings/connection/route.lazy.tsx +60 -0
- package/src/routes/_nav/settings/connection/route.tsx +10 -0
- package/src/routes/_nav/settings/design/route.lazy.tsx +193 -0
- package/src/routes/_nav/settings/design/route.tsx +32 -0
- package/src/routes/_nav/settings/general/route.lazy.tsx +100 -0
- package/src/routes/_nav/settings/general/route.tsx +20 -0
- package/src/routes/_nav/settings/privacy/route.lazy.tsx +173 -0
- package/src/routes/_nav/settings/privacy/route.tsx +20 -0
- package/src/routes/_nav/settings/route.lazy.tsx +43 -0
- package/src/routes/_nav/settings/route.tsx +68 -0
- package/src/routes/_nav/settings/team/route.lazy.tsx +44 -0
- package/src/routes/_nav/settings/team/route.tsx +33 -0
- package/src/routes/_nav/stories/$storyId/route.lazy.tsx +136 -0
- package/src/routes/_nav/stories/$storyId/route.tsx +143 -0
- package/src/routes/_nav/stories/index.lazy.tsx +28 -0
- package/src/routes/_nav/stories/index.tsx +37 -0
- package/src/routes/_nav/stories/route.tsx +22 -0
- package/src/routes/_nav/tags/$id/route.tsx +8 -0
- package/src/routes/_nav/tags/index.tsx +8 -0
- package/src/routes/_nav/tags/route.tsx +8 -0
- package/src/routes/_nav/tags/settings/route.tsx +9 -0
- package/src/routes/_nav/test-cases/route.tsx +28 -0
- package/src/routes/_nav/workspaces/$workspaceId/route.lazy.tsx +142 -0
- package/src/routes/_nav/workspaces/$workspaceId/route.tsx +30 -0
- package/src/routes/_nav/workspaces/$workspaceId/settings/route.lazy.tsx +250 -0
- package/src/routes/_nav/workspaces/$workspaceId/settings/route.tsx +27 -0
- package/src/routes/_nav/workspaces/index.lazy.tsx +111 -0
- package/src/routes/_nav/workspaces/index.tsx +24 -0
- package/src/routes/_nav/workspaces/route.tsx +22 -0
- package/src/routes/_public/index/route.tsx +27 -0
- package/src/routes/_public/pricing/route.lazy.tsx +23 -0
- package/src/routes/_public/pricing/route.tsx +30 -0
- package/src/routes/_public/route.tsx +22 -0
- package/src/routes/api/auth/desktop-callback.ts +95 -0
- package/src/routes/api/billing-webhook.ts +49 -0
- package/src/routes/api/chat.ts +108 -0
- package/src/routes/api/design/upload.ts +160 -0
- package/src/routes/api/health.ts +34 -0
- package/src/routes/api/knowledge/sync-github.ts +48 -0
- package/src/routes/api/license/activate/route.ts +50 -0
- package/src/routes/api/license/heartbeat/route.ts +54 -0
- package/src/routes/api/share/prd/$prdId/events.ts +52 -0
- package/src/routes/api/story-ai.ts +40 -0
- package/src/routes/api.auth.$.ts +31 -0
- package/src/routes/design-files/$projectId/$artboardId/$filename.ts +60 -0
- package/src/routes/invite/$token/route.lazy.tsx +75 -0
- package/src/routes/invite/$token/route.tsx +29 -0
- package/src/routes/server/anyhub-proxy/$.ts +54 -0
- package/src/routes/server.ai-stream.ts +126 -0
- package/src/routes/server.ws.ts +61 -0
- package/src/routes/share/$versionId/route.lazy.tsx +68 -0
- package/src/routes/share/$versionId/route.tsx +31 -0
- package/src/routes/share/compliance/$id/route.lazy.tsx +104 -0
- package/src/routes/share/compliance/$id/route.tsx +30 -0
- package/src/routes/share/law/$id/route.lazy.tsx +107 -0
- package/src/routes/share/law/$id/route.tsx +30 -0
- package/src/routes/share/prd/$prdId/route.tsx +10 -0
- package/src/routes/share/route.tsx +22 -0
- package/src/routes/workspace.tsx +24 -0
- package/src/scss.d.ts +18 -0
- package/src/server/__tests__/agent-client-graph.test.ts +115 -0
- package/src/server/__tests__/agent-crud.test.ts +279 -0
- package/src/server/__tests__/assembly.test.ts +26 -0
- package/src/server/__tests__/audit-middleware.test.ts +70 -0
- package/src/server/__tests__/audit.test.ts +45 -0
- package/src/server/__tests__/builtin-project.test.ts +85 -0
- package/src/server/__tests__/chat-agent-resolve.test.ts +138 -0
- package/src/server/__tests__/chat-conversations.test.ts +223 -0
- package/src/server/__tests__/entitlements.license.test.ts +203 -0
- package/src/server/__tests__/entitlements.test.ts +187 -0
- package/src/server/__tests__/license-routes-oss.test.ts +35 -0
- package/src/server/__tests__/license-routes.test.ts +105 -0
- package/src/server/__tests__/permissions.test.ts +69 -0
- package/src/server/__tests__/pro-services.test.ts +63 -0
- package/src/server/__tests__/resource-registry.test.ts +51 -0
- package/src/server/__tests__/resources.agents.test.ts +132 -0
- package/src/server/__tests__/resources.license.test.ts +109 -0
- package/src/server/__tests__/resources.team-seats.test.ts +71 -0
- package/src/server/__tests__/resources.test.ts +179 -0
- package/src/server/__tests__/skill-crud.test.ts +263 -0
- package/src/server/__tests__/sso-domain.test.ts +86 -0
- package/src/server/__tests__/sso-tokens.test.ts +31 -0
- package/src/server/__tests__/start-client-graph.test.ts +83 -0
- package/src/server/ai-ports.ts +75 -0
- package/src/server/audit.ts +25 -0
- package/src/server/auth-helpers.ts +73 -0
- package/src/server/builtin-project.ts +56 -0
- package/src/server/design/sketch/annotation-parser.ts +160 -0
- package/src/server/design/sketch/code-generator.ts +180 -0
- package/src/server/design/sketch/file-storage.ts +71 -0
- package/src/server/desktop-guest.ts +29 -0
- package/src/server/email/sender.ts +21 -0
- package/src/server/entitlements-token-client.ts +32 -0
- package/src/server/entitlements-token.ts +137 -0
- package/src/server/entitlements.ts +211 -0
- package/src/server/keepalive/middleware.ts +44 -0
- package/src/server/knowledge-public/canonical-id.ts +60 -0
- package/src/server/knowledge-public/favicon.ts +74 -0
- package/src/server/knowledge-public/github-sync.ts +111 -0
- package/src/server/knowledge-public/share-merge.ts +92 -0
- package/src/server/middlewares/audit-recorder.ts +37 -0
- package/src/server/middlewares/audit.ts +20 -0
- package/src/server/middlewares/rate-limit-server-fn.ts +1 -0
- package/src/server/middlewares/request.ts +26 -0
- package/src/server/permissions.ts +44 -0
- package/src/server/pro-services.ts +24 -0
- package/src/server/references/engine.ts +104 -0
- package/src/server/remote-auth.ts +60 -0
- package/src/server/resources.ts +189 -0
- package/src/server/serverFns/__tests__/compliance.test.ts +138 -0
- package/src/server/serverFns/__tests__/project-team-assign.test.ts +90 -0
- package/src/server/serverFns/__tests__/team-accept.test.ts +103 -0
- package/src/server/serverFns/__tests__/team-invitation.test.ts +143 -0
- package/src/server/serverFns/__tests__/team-members.test.ts +201 -0
- package/src/server/serverFns/__tests__/update-seats.test.ts +171 -0
- package/src/server/serverFns/__tests__/workspace.test.ts +418 -0
- package/src/server/serverFns/activity.ts +114 -0
- package/src/server/serverFns/agents/agent-crud.ts +231 -0
- package/src/server/serverFns/agents/resolve-overrides.ts +66 -0
- package/src/server/serverFns/agents/skill-crud.ts +188 -0
- package/src/server/serverFns/ai/agent-conversations.ts +1 -0
- package/src/server/serverFns/ai/detect.ts +34 -0
- package/src/server/serverFns/ai/execute.ts +36 -0
- package/src/server/serverFns/ai/fill-annotation.ts +1 -0
- package/src/server/serverFns/ai/generate-prototype.ts +1 -0
- package/src/server/serverFns/ai/providers.ts +1 -0
- package/src/server/serverFns/analytics.ts +40 -0
- package/src/server/serverFns/anyhub/app.ts +68 -0
- package/src/server/serverFns/anyhub/index.ts +76 -0
- package/src/server/serverFns/anyhub/install.ts +57 -0
- package/src/server/serverFns/anyhub/permissions.ts +45 -0
- package/src/server/serverFns/anyhub/proxy.ts +44 -0
- package/src/server/serverFns/auth/forgot-password.ts +55 -0
- package/src/server/serverFns/auth/invitation.ts +48 -0
- package/src/server/serverFns/auth/providers.ts +27 -0
- package/src/server/serverFns/auth/register.ts +56 -0
- package/src/server/serverFns/auth/reset-password.ts +68 -0
- package/src/server/serverFns/auth/session.ts +126 -0
- package/src/server/serverFns/billing.ts +167 -0
- package/src/server/serverFns/chat/conversations.ts +134 -0
- package/src/server/serverFns/chat/list-messages.ts +36 -0
- package/src/server/serverFns/comments.ts +1 -0
- package/src/server/serverFns/compliance.ts +42 -0
- package/src/server/serverFns/components.ts +1 -0
- package/src/server/serverFns/design/settings.ts +72 -0
- package/src/server/serverFns/design.ts +109 -0
- package/src/server/serverFns/knowledge-index.ts +147 -0
- package/src/server/serverFns/knowledge-public/bookmarks/categories.ts +67 -0
- package/src/server/serverFns/knowledge-public/bookmarks/create.ts +86 -0
- package/src/server/serverFns/knowledge-public/bookmarks/delete.ts +36 -0
- package/src/server/serverFns/knowledge-public/bookmarks/detail.ts +63 -0
- package/src/server/serverFns/knowledge-public/bookmarks/favorite.ts +38 -0
- package/src/server/serverFns/knowledge-public/bookmarks/list.ts +128 -0
- package/src/server/serverFns/knowledge-public/bookmarks/refresh-favicon.ts +31 -0
- package/src/server/serverFns/knowledge-public/bookmarks/share.ts +74 -0
- package/src/server/serverFns/knowledge-public/bookmarks/sync-github.ts +31 -0
- package/src/server/serverFns/knowledge-public/bookmarks/unshare.ts +44 -0
- package/src/server/serverFns/knowledge-public/bookmarks/update.ts +90 -0
- package/src/server/serverFns/knowledge-public/compliance/create.ts +60 -0
- package/src/server/serverFns/knowledge-public/compliance/delete.ts +36 -0
- package/src/server/serverFns/knowledge-public/compliance/detail.ts +48 -0
- package/src/server/serverFns/knowledge-public/compliance/list.ts +95 -0
- package/src/server/serverFns/knowledge-public/compliance/public.ts +38 -0
- package/src/server/serverFns/knowledge-public/compliance/share.ts +62 -0
- package/src/server/serverFns/knowledge-public/compliance/unshare.ts +33 -0
- package/src/server/serverFns/knowledge-public/compliance/update.ts +59 -0
- package/src/server/serverFns/knowledge-public/dictionary/create.ts +55 -0
- package/src/server/serverFns/knowledge-public/dictionary/delete.ts +36 -0
- package/src/server/serverFns/knowledge-public/dictionary/detail.ts +43 -0
- package/src/server/serverFns/knowledge-public/dictionary/list.ts +83 -0
- package/src/server/serverFns/knowledge-public/dictionary/share.ts +60 -0
- package/src/server/serverFns/knowledge-public/dictionary/unshare.ts +33 -0
- package/src/server/serverFns/knowledge-public/dictionary/update.ts +56 -0
- package/src/server/serverFns/knowledge-public/entity-tags.ts +50 -0
- package/src/server/serverFns/knowledge-public/favorite.ts +54 -0
- package/src/server/serverFns/knowledge-public/legal/create.ts +64 -0
- package/src/server/serverFns/knowledge-public/legal/delete.ts +36 -0
- package/src/server/serverFns/knowledge-public/legal/detail.ts +48 -0
- package/src/server/serverFns/knowledge-public/legal/list.ts +97 -0
- package/src/server/serverFns/knowledge-public/legal/public.ts +38 -0
- package/src/server/serverFns/knowledge-public/legal/share.ts +64 -0
- package/src/server/serverFns/knowledge-public/legal/unshare.ts +33 -0
- package/src/server/serverFns/knowledge-public/legal/update.ts +61 -0
- package/src/server/serverFns/knowledge.ts +577 -0
- package/src/server/serverFns/locale.ts +8 -0
- package/src/server/serverFns/project.ts +575 -0
- package/src/server/serverFns/references/create.ts +40 -0
- package/src/server/serverFns/references/resolve.ts +36 -0
- package/src/server/serverFns/references/search.ts +37 -0
- package/src/server/serverFns/reviews.ts +1 -0
- package/src/server/serverFns/settings/account-team.ts +66 -0
- package/src/server/serverFns/share/prd/[prdId]/events.ts +33 -0
- package/src/server/serverFns/share/verify-password.ts +1 -0
- package/src/server/serverFns/share/version.ts +70 -0
- package/src/server/serverFns/share/versions.ts +1 -0
- package/src/server/serverFns/sso.ts +27 -0
- package/src/server/serverFns/story/__tests__/bulk.test.ts +156 -0
- package/src/server/serverFns/story/__tests__/story-groups.test.ts +329 -0
- package/src/server/serverFns/story/__tests__/story-list-query.test.ts +245 -0
- package/src/server/serverFns/story/index.ts +124 -0
- package/src/server/serverFns/story/story-assoc.ts +186 -0
- package/src/server/serverFns/story/story-attachments.ts +97 -0
- package/src/server/serverFns/story/story-children.ts +42 -0
- package/src/server/serverFns/story/story-comments.ts +174 -0
- package/src/server/serverFns/story/story-crud/activities.ts +76 -0
- package/src/server/serverFns/story/story-crud/archive.ts +79 -0
- package/src/server/serverFns/story/story-crud/bulk.ts +192 -0
- package/src/server/serverFns/story/story-crud/detail.ts +66 -0
- package/src/server/serverFns/story/story-crud/labels.ts +66 -0
- package/src/server/serverFns/story/story-crud.ts +384 -0
- package/src/server/serverFns/story/story-dependencies.ts +218 -0
- package/src/server/serverFns/story/story-groups.ts +279 -0
- package/src/server/serverFns/story/story-links.ts +90 -0
- package/src/server/serverFns/story/story-list-query.ts +222 -0
- package/src/server/serverFns/story/story-reactions.ts +135 -0
- package/src/server/serverFns/story/story-search.ts +74 -0
- package/src/server/serverFns/story/story-transfer.ts +409 -0
- package/src/server/serverFns/story/story-tree.ts +123 -0
- package/src/server/serverFns/story/types.ts +223 -0
- package/src/server/serverFns/story-display-options.ts +156 -0
- package/src/server/serverFns/story-view.ts +138 -0
- package/src/server/serverFns/team.ts +330 -0
- package/src/server/serverFns/translation.ts +50 -0
- package/src/server/serverFns/user/avatar.ts +40 -0
- package/src/server/serverFns/user/settings.ts +38 -0
- package/src/server/serverFns/user/update-locale.ts +18 -0
- package/src/server/serverFns/web-search.ts +69 -0
- package/src/server/serverFns/workspace.ts +231 -0
- package/src/server/serverFns/ws.ts +38 -0
- package/src/server/sso/tokens.ts +69 -0
- package/src/server/team-access.ts +16 -0
- package/src/start.ts +102 -0
- package/src/styles/_keyframe-animations.scss +91 -0
- package/src/styles/_variables.scss +294 -0
- package/src/styles/globals.css +477 -0
- package/src/types/jest-dom-vitest.d.ts +31 -0
- package/src/types/outline.ts +1 -0
- package/src/types/prd.ts +1 -0
- package/src/types/project.ts +103 -0
- package/src/types/prototype.ts +1 -0
- package/src/types/start-authjs.d.ts +33 -0
- package/src/types/workspace.ts +18 -0
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
|
+
// AllBlue - 理想之海
|
|
3
|
+
// Copyright (C) 2026 AllBlue Contributors
|
|
4
|
+
//
|
|
5
|
+
// This program is free software: you can redistribute it and/or modify
|
|
6
|
+
// it under the terms of the GNU Affero General Public License as published by
|
|
7
|
+
// the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
// (at your option) any later version.
|
|
9
|
+
//
|
|
10
|
+
// This program is distributed in the hope that it will be useful,
|
|
11
|
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
// GNU Affero General Public License for more details.
|
|
14
|
+
//
|
|
15
|
+
// You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
+
|
|
18
|
+
import { useMemo, useEffect, useRef, useState } from "react"
|
|
19
|
+
import {
|
|
20
|
+
Check, X, Loader2, Square,
|
|
21
|
+
Cpu, ChevronDown,
|
|
22
|
+
} from "lucide-react"
|
|
23
|
+
import { useTranslation } from "react-i18next"
|
|
24
|
+
import {
|
|
25
|
+
Popover,
|
|
26
|
+
PopoverContent,
|
|
27
|
+
PopoverTrigger,
|
|
28
|
+
} from "@/components/ui/popover"
|
|
29
|
+
import { Button } from "@/components/ui/button"
|
|
30
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip"
|
|
31
|
+
import { type StoryAiModelGroup } from "./use-story-ai-model"
|
|
32
|
+
import {
|
|
33
|
+
ACTION_REGISTRY,
|
|
34
|
+
getVisibleActions,
|
|
35
|
+
type StoryAIAction,
|
|
36
|
+
type ShowActionProps,
|
|
37
|
+
} from "./action-registry"
|
|
38
|
+
import { useStreamTextAction, type TiptapEditorRef } from "./handlers/stream-text"
|
|
39
|
+
import { useToolbarOverflow } from "./use-toolbar-overflow"
|
|
40
|
+
import { MorePopover } from "./handlers/more-popover"
|
|
41
|
+
import { StorySplitDialog } from "./split-dialog"
|
|
42
|
+
import { StoryPrototypeDialog } from "./prototype-dialog"
|
|
43
|
+
|
|
44
|
+
export type StoryDescriptionAIMode = "text" | "editor"
|
|
45
|
+
|
|
46
|
+
// 向后兼容:保留旧类型名导出
|
|
47
|
+
export type StoryDescriptionAIAction = "generate" | "expand" | "polish" | "acceptance"
|
|
48
|
+
|
|
49
|
+
export interface StoryAiToolbarProps extends ShowActionProps {
|
|
50
|
+
storyId?: string
|
|
51
|
+
description: string
|
|
52
|
+
title?: string
|
|
53
|
+
mode?: StoryDescriptionAIMode
|
|
54
|
+
editorRef?: React.RefObject<TiptapEditorRef | null>
|
|
55
|
+
onApply?: (description: string) => void
|
|
56
|
+
onGenerating?: (generating: boolean) => void
|
|
57
|
+
model?: string
|
|
58
|
+
groups?: StoryAiModelGroup[]
|
|
59
|
+
onModelChange?: (model: string) => void
|
|
60
|
+
showModelSelect?: boolean
|
|
61
|
+
/** 模型选择器位置与显隐:leading=左侧常显(默认),trailing=右侧常显,trailing-hover=右侧 hover 淡入 */
|
|
62
|
+
modelSelectVariant?: "leading" | "trailing" | "trailing-hover"
|
|
63
|
+
/** 是否撑满父容器(flex-grow)。弹窗中 false=内容宽度靠 mr-auto 右靠;详情页 true=撑满 wrapper */
|
|
64
|
+
fill?: boolean
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const GAP = 4
|
|
68
|
+
// 「更多」按钮宽度估值(图标 + 文案 + 计数徽章 + padding)
|
|
69
|
+
const MORE_WIDTH = 72
|
|
70
|
+
|
|
71
|
+
export function StoryAiToolbar(props: StoryAiToolbarProps) {
|
|
72
|
+
const {
|
|
73
|
+
storyId, description, title, mode = "text", editorRef, onApply, onGenerating,
|
|
74
|
+
model, groups = [], onModelChange, showModelSelect = true,
|
|
75
|
+
modelSelectVariant = "leading",
|
|
76
|
+
fill = false,
|
|
77
|
+
showGenerate = true, showExpand = true, showPolish = true, showAcceptance = true,
|
|
78
|
+
showSplit = false, showTestCase = false, showPrototype = false, showUi = false,
|
|
79
|
+
showCode = false,
|
|
80
|
+
} = props
|
|
81
|
+
const { t } = useTranslation("story")
|
|
82
|
+
|
|
83
|
+
const showProps: ShowActionProps = {
|
|
84
|
+
showGenerate, showExpand, showPolish, showAcceptance,
|
|
85
|
+
showSplit, showTestCase, showPrototype, showUi, showCode,
|
|
86
|
+
}
|
|
87
|
+
// 固定顺序:始终用 ACTION_REGISTRY 默认顺序(已移除用户自定义排序)
|
|
88
|
+
const order = useMemo(() => ACTION_REGISTRY.map((a) => a.type), [])
|
|
89
|
+
const visibleActions = getVisibleActions(showProps, order)
|
|
90
|
+
|
|
91
|
+
const stream = useStreamTextAction({
|
|
92
|
+
storyId, description, title, mode, editorRef, onApply, onGenerating, model, t,
|
|
93
|
+
})
|
|
94
|
+
const { action, draft, isGenerating, handle, stop, apply, discard } = stream
|
|
95
|
+
const [popoverOpen, setPopoverOpen] = useState(false)
|
|
96
|
+
const [splitOpen, setSplitOpen] = useState(false)
|
|
97
|
+
const [prototypeOpen, setPrototypeOpen] = useState(false)
|
|
98
|
+
|
|
99
|
+
useEffect(() => {
|
|
100
|
+
if (isGenerating && popoverOpen) setPopoverOpen(false)
|
|
101
|
+
}, [isGenerating, popoverOpen])
|
|
102
|
+
|
|
103
|
+
const isEditorMode = mode === "editor" && editorRef?.current
|
|
104
|
+
|
|
105
|
+
// 溢出检测:容器宽度由父级 flex 分配决定,收起按钮不影响容器宽度,从而可靠回展
|
|
106
|
+
const containerRef = useRef<HTMLDivElement>(null)
|
|
107
|
+
const measureRef = useRef<HTMLDivElement>(null)
|
|
108
|
+
const modelSelectRef = useRef<HTMLButtonElement>(null)
|
|
109
|
+
const isTrailing = modelSelectVariant === "trailing" || modelSelectVariant === "trailing-hover"
|
|
110
|
+
const { visibleCount, hasOverflow } = useToolbarOverflow({
|
|
111
|
+
containerRef, measureRef,
|
|
112
|
+
leadingRef: showModelSelect && !isTrailing ? modelSelectRef : undefined,
|
|
113
|
+
trailingRef: showModelSelect && isTrailing ? modelSelectRef : undefined,
|
|
114
|
+
gap: GAP, moreButtonWidth: MORE_WIDTH,
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
const visibleShown = hasOverflow ? visibleActions.slice(0, visibleCount) : visibleActions
|
|
118
|
+
const collapsedActions = hasOverflow ? visibleActions.slice(visibleCount) : []
|
|
119
|
+
|
|
120
|
+
const HAS_DRAFT_UI = new Set<StoryAIAction>(["expand", "polish", "acceptance"])
|
|
121
|
+
|
|
122
|
+
const onActionClick = (type: StoryAIAction) => {
|
|
123
|
+
const def = ACTION_REGISTRY.find((a) => a.type === type)
|
|
124
|
+
if (!def) return
|
|
125
|
+
if (def.mode === "stream-text") {
|
|
126
|
+
handle(type as "generate" | "expand" | "polish" | "acceptance")
|
|
127
|
+
return
|
|
128
|
+
}
|
|
129
|
+
if (def.mode === "reserved") {
|
|
130
|
+
import("sonner").then(({ toast }) =>
|
|
131
|
+
toast.info(t("storyAi.toolbar.underDevelopment")),
|
|
132
|
+
)
|
|
133
|
+
return
|
|
134
|
+
}
|
|
135
|
+
if (type === "split") {
|
|
136
|
+
setSplitOpen(true)
|
|
137
|
+
return
|
|
138
|
+
}
|
|
139
|
+
if (type === "prototype") {
|
|
140
|
+
setPrototypeOpen(true)
|
|
141
|
+
return
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const renderModelSelect = (variant: "leading" | "trailing" | "trailing-hover") => {
|
|
146
|
+
const isTrailingPos = variant !== "leading"
|
|
147
|
+
const isHover = variant === "trailing-hover"
|
|
148
|
+
// 收起后 trailing 模型按钮改用 hidden(display:none 彻底让位,空间留给可见按钮 + 更多),
|
|
149
|
+
// 模型选择移入「更多」按钮的右侧子菜单;overflow hook 用缓存宽度判断恢复(hysteresis)
|
|
150
|
+
const collapsed = isTrailingPos && hasOverflow
|
|
151
|
+
return (
|
|
152
|
+
<Popover open={popoverOpen} onOpenChange={setPopoverOpen}>
|
|
153
|
+
<PopoverTrigger asChild>
|
|
154
|
+
<Button
|
|
155
|
+
ref={modelSelectRef}
|
|
156
|
+
variant="ghost"
|
|
157
|
+
size="sm"
|
|
158
|
+
disabled={isGenerating}
|
|
159
|
+
className={
|
|
160
|
+
(isHover
|
|
161
|
+
? `ml-auto h-7 shrink-0 px-2 text-xs text-muted-foreground gap-0.5 transition-opacity duration-150 ${popoverOpen ? "opacity-100" : "opacity-0 group-hover:opacity-100"}`
|
|
162
|
+
: isTrailingPos
|
|
163
|
+
? "ml-auto h-7 shrink-0 px-2 text-xs text-muted-foreground gap-0.5"
|
|
164
|
+
: "h-7 shrink-0 px-2 text-xs text-muted-foreground gap-0.5"
|
|
165
|
+
) + (collapsed ? " hidden" : "")
|
|
166
|
+
}
|
|
167
|
+
>
|
|
168
|
+
<Cpu className="mr-1 size-3" />
|
|
169
|
+
{model ? model.split("/").pop() : t("storyAi.toolbar.model")}
|
|
170
|
+
<ChevronDown className="ml-0.5 size-3" />
|
|
171
|
+
</Button>
|
|
172
|
+
</PopoverTrigger>
|
|
173
|
+
<PopoverContent className="w-60 p-2" align={isTrailingPos ? "end" : "start"}>
|
|
174
|
+
{groups.length > 0 ? (
|
|
175
|
+
<div className="space-y-2 max-h-80 overflow-y-auto">
|
|
176
|
+
{groups.map((group) => (
|
|
177
|
+
<div key={group.label}>
|
|
178
|
+
<p className="mb-1 px-2 text-[10px] font-medium text-muted-foreground uppercase">{group.label}</p>
|
|
179
|
+
<div className="space-y-0.5">
|
|
180
|
+
{group.items.map((m) => (
|
|
181
|
+
<button
|
|
182
|
+
key={m.value}
|
|
183
|
+
type="button"
|
|
184
|
+
onClick={() => onModelChange?.(m.value)}
|
|
185
|
+
className={`flex w-full items-center justify-between rounded px-2 py-1.5 text-sm ${
|
|
186
|
+
model === m.value ? "bg-accent font-medium" : "hover:bg-muted"
|
|
187
|
+
}`}
|
|
188
|
+
>
|
|
189
|
+
<span>{m.label}</span>
|
|
190
|
+
{model === m.value && <Check className="size-3.5 shrink-0 text-primary" />}
|
|
191
|
+
</button>
|
|
192
|
+
))}
|
|
193
|
+
</div>
|
|
194
|
+
</div>
|
|
195
|
+
))}
|
|
196
|
+
</div>
|
|
197
|
+
) : (
|
|
198
|
+
<p className="px-2 text-xs text-muted-foreground">{t("storyAi.toolbar.noModels")}</p>
|
|
199
|
+
)}
|
|
200
|
+
</PopoverContent>
|
|
201
|
+
</Popover>
|
|
202
|
+
)
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
return (
|
|
206
|
+
<div ref={containerRef} className={`group relative flex items-center gap-1 min-w-0 flex-nowrap${fill ? " flex-[1_1_auto]" : ""}`}>
|
|
207
|
+
{showModelSelect && !isTrailing && renderModelSelect("leading")}
|
|
208
|
+
|
|
209
|
+
{/* 隐藏测量层:渲染全部按钮的天然宽度,供溢出计算使用 */}
|
|
210
|
+
<div ref={measureRef} aria-hidden className="absolute -z-10 invisible flex items-center gap-1 pointer-events-none">
|
|
211
|
+
{visibleActions.map((a) => (
|
|
212
|
+
<Button key={a.type} variant="ghost" size="sm" className="h-7 px-2 text-xs text-muted-foreground">
|
|
213
|
+
<a.icon className="mr-1 size-3" />{t(a.labelKey)}
|
|
214
|
+
</Button>
|
|
215
|
+
))}
|
|
216
|
+
</div>
|
|
217
|
+
|
|
218
|
+
{visibleShown.map((a, idx) => {
|
|
219
|
+
const isActive = action === a.type
|
|
220
|
+
const disabled =
|
|
221
|
+
isGenerating ||
|
|
222
|
+
(a.requiresTitle && !title?.trim()) ||
|
|
223
|
+
(a.requiresText && !description.trim())
|
|
224
|
+
return (
|
|
225
|
+
<Tooltip key={a.type}>
|
|
226
|
+
<TooltipTrigger asChild>
|
|
227
|
+
<span>
|
|
228
|
+
<Button
|
|
229
|
+
variant="ghost" size="sm"
|
|
230
|
+
className="h-7 shrink-0 px-2 text-xs text-muted-foreground"
|
|
231
|
+
disabled={disabled}
|
|
232
|
+
onClick={() => onActionClick(a.type)}
|
|
233
|
+
>
|
|
234
|
+
{isActive ? <Loader2 className="mr-1 size-3 animate-spin" /> : <a.icon className="mr-1 size-3" />}
|
|
235
|
+
{t(a.labelKey)}
|
|
236
|
+
</Button>
|
|
237
|
+
</span>
|
|
238
|
+
</TooltipTrigger>
|
|
239
|
+
<TooltipContent>{t(a.hintKey)}</TooltipContent>
|
|
240
|
+
</Tooltip>
|
|
241
|
+
)
|
|
242
|
+
})}
|
|
243
|
+
|
|
244
|
+
{hasOverflow && (
|
|
245
|
+
<MorePopover
|
|
246
|
+
collapsedActions={collapsedActions}
|
|
247
|
+
onActionClick={onActionClick}
|
|
248
|
+
disabled={isGenerating}
|
|
249
|
+
modelSelect={showModelSelect && isTrailing && onModelChange ? { model, groups, onModelChange } : undefined}
|
|
250
|
+
/>
|
|
251
|
+
)}
|
|
252
|
+
|
|
253
|
+
{isGenerating && (
|
|
254
|
+
<Button variant="ghost" size="sm" className="h-7 shrink-0 px-2 text-xs" onClick={stop}>
|
|
255
|
+
<Square className="mr-1 size-3" />
|
|
256
|
+
{t("storyAi.toolbar.stop")}
|
|
257
|
+
</Button>
|
|
258
|
+
)}
|
|
259
|
+
|
|
260
|
+
{action && !isGenerating && draft.trim() && !isEditorMode && HAS_DRAFT_UI.has(action as StoryAIAction) && (
|
|
261
|
+
<span className="ml-1 flex shrink-0 items-center gap-1">
|
|
262
|
+
<Button variant="default" size="sm" className="h-7 px-2 text-xs" onClick={apply}>
|
|
263
|
+
<Check className="mr-1 size-3" /> {t("storyAi.toolbar.replace")}
|
|
264
|
+
</Button>
|
|
265
|
+
<Button variant="outline" size="sm" className="h-7 px-2 text-xs" onClick={discard}>
|
|
266
|
+
<X className="mr-1 size-3" /> {t("storyAi.toolbar.discard")}
|
|
267
|
+
</Button>
|
|
268
|
+
</span>
|
|
269
|
+
)}
|
|
270
|
+
|
|
271
|
+
{showModelSelect && isTrailing && renderModelSelect(modelSelectVariant)}
|
|
272
|
+
|
|
273
|
+
<StorySplitDialog
|
|
274
|
+
storyId={storyId ?? ""}
|
|
275
|
+
storyName={title ?? t("storyAi.toolbar.currentStory")}
|
|
276
|
+
storyDescription={description}
|
|
277
|
+
open={splitOpen}
|
|
278
|
+
onOpenChange={setSplitOpen}
|
|
279
|
+
onComplete={() => { /* 拆解完成:split-dialog 内部已完成创建副作用,无需修改描述 */ }}
|
|
280
|
+
/>
|
|
281
|
+
|
|
282
|
+
<StoryPrototypeDialog
|
|
283
|
+
storyId={storyId ?? ""}
|
|
284
|
+
storyDescription={description}
|
|
285
|
+
open={prototypeOpen}
|
|
286
|
+
onOpenChange={setPrototypeOpen}
|
|
287
|
+
/>
|
|
288
|
+
</div>
|
|
289
|
+
)
|
|
290
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
|
+
// AllBlue - 理想之海
|
|
3
|
+
// Copyright (C) 2026 AllBlue Contributors
|
|
4
|
+
//
|
|
5
|
+
// This program is free software: you can redistribute it and/or modify
|
|
6
|
+
// it under the terms of the GNU Affero General Public License as published by
|
|
7
|
+
// the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
// (at your option) any later version.
|
|
9
|
+
//
|
|
10
|
+
// This program is distributed in the hope that it will be useful,
|
|
11
|
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
// GNU Affero General Public License for more details.
|
|
14
|
+
//
|
|
15
|
+
// You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
+
|
|
18
|
+
// apps/web/src/components/story/ai/use-story-ai-model.ts
|
|
19
|
+
import { useSession } from "@/lib/auth/auth-client"
|
|
20
|
+
import { listEnabledModelsFn } from "@/server/serverFns/ai/providers"
|
|
21
|
+
import { useCallback, useEffect, useMemo, useState } from "react"
|
|
22
|
+
|
|
23
|
+
const STORAGE_KEY = "story:descriptionAiModel"
|
|
24
|
+
|
|
25
|
+
export interface StoryAiModelGroup {
|
|
26
|
+
label: string
|
|
27
|
+
items: { value: string; label: string }[]
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* 把会话模型(如 `openai/gpt-4o-mini`,可能带 provider 前缀)规范化,
|
|
32
|
+
* 与列表中的模型 id(如 `gpt-4o-mini`,不带前缀)做匹配。
|
|
33
|
+
* 精确匹配优先,否则回退到去掉前缀后的尾部匹配。
|
|
34
|
+
*/
|
|
35
|
+
function resolveModelValue(preferred: string | undefined, values: string[]): string | undefined {
|
|
36
|
+
if (!preferred) return undefined
|
|
37
|
+
const preferredTail = preferred.split("/").pop()
|
|
38
|
+
return (
|
|
39
|
+
values.find((v) => v === preferred) ??
|
|
40
|
+
values.find((v) => v === preferredTail) ??
|
|
41
|
+
values.find((v) => v.split("/").pop() === preferredTail)
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* 模型选择 state,从已启用模型列表中选择。
|
|
47
|
+
* 默认使用用户对话模型(session.aiModel),
|
|
48
|
+
* 之后使用上次使用的模型(持久化到 localStorage)。
|
|
49
|
+
*/
|
|
50
|
+
export function useStoryAiModel(): {
|
|
51
|
+
model: string
|
|
52
|
+
setModel: (model: string) => void
|
|
53
|
+
groups: StoryAiModelGroup[]
|
|
54
|
+
isLoading: boolean
|
|
55
|
+
} {
|
|
56
|
+
const { data: session } = useSession()
|
|
57
|
+
const defaultModel = session?.user?.aiModel ?? "openai/gpt-4o-mini"
|
|
58
|
+
const [model, setModel] = useState<string>(
|
|
59
|
+
() =>
|
|
60
|
+
(typeof window !== "undefined" && localStorage.getItem(STORAGE_KEY)) ||
|
|
61
|
+
"",
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
// Fetch enabled models from server
|
|
65
|
+
const [rawModels, setRawModels] = useState<
|
|
66
|
+
Array<{
|
|
67
|
+
providerId: string
|
|
68
|
+
model: string
|
|
69
|
+
providerDisplayName: string
|
|
70
|
+
modelDisplayName: string
|
|
71
|
+
}>
|
|
72
|
+
>([])
|
|
73
|
+
const [isLoading, setIsLoading] = useState(true)
|
|
74
|
+
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
let cancelled = false
|
|
77
|
+
setIsLoading(true)
|
|
78
|
+
listEnabledModelsFn().then(
|
|
79
|
+
(result) => {
|
|
80
|
+
if (cancelled) return
|
|
81
|
+
setRawModels(result as any)
|
|
82
|
+
setIsLoading(false)
|
|
83
|
+
},
|
|
84
|
+
() => {
|
|
85
|
+
if (cancelled) return
|
|
86
|
+
setIsLoading(false)
|
|
87
|
+
},
|
|
88
|
+
)
|
|
89
|
+
return () => { cancelled = true }
|
|
90
|
+
}, [])
|
|
91
|
+
|
|
92
|
+
// Group by provider
|
|
93
|
+
const groups: StoryAiModelGroup[] = useMemo(() => {
|
|
94
|
+
if (rawModels.length === 0) return []
|
|
95
|
+
const map = new Map<string, StoryAiModelGroup>()
|
|
96
|
+
for (const m of rawModels) {
|
|
97
|
+
let group = map.get(m.providerDisplayName)
|
|
98
|
+
if (!group) {
|
|
99
|
+
group = { label: m.providerDisplayName, items: [] }
|
|
100
|
+
map.set(m.providerDisplayName, group)
|
|
101
|
+
}
|
|
102
|
+
group.items.push({ value: m.model, label: m.modelDisplayName || m.model })
|
|
103
|
+
}
|
|
104
|
+
return Array.from(map.values())
|
|
105
|
+
}, [rawModels])
|
|
106
|
+
|
|
107
|
+
// Sync localStorage
|
|
108
|
+
useEffect(() => {
|
|
109
|
+
if (typeof window !== "undefined" && model) {
|
|
110
|
+
localStorage.setItem(STORAGE_KEY, model)
|
|
111
|
+
}
|
|
112
|
+
}, [model])
|
|
113
|
+
|
|
114
|
+
// 模型列表就绪后校正当前选中值,保证选中项在下拉列表内可匹配(正确高亮/勾选):
|
|
115
|
+
// 1. 优先恢复上次使用(localStorage,且仍存在于启用列表)
|
|
116
|
+
// 2. 否则从 session.aiModel 规范化匹配
|
|
117
|
+
// 3. 再否则取列表第一个
|
|
118
|
+
const modelValues = useMemo(() => rawModels.map((m) => m.model), [rawModels])
|
|
119
|
+
useEffect(() => {
|
|
120
|
+
if (!session || modelValues.length === 0) return
|
|
121
|
+
const stored = typeof window !== "undefined" ? localStorage.getItem(STORAGE_KEY) : null
|
|
122
|
+
if (stored && modelValues.includes(stored)) {
|
|
123
|
+
if (model !== stored) setModel(stored)
|
|
124
|
+
return
|
|
125
|
+
}
|
|
126
|
+
const chosen =
|
|
127
|
+
resolveModelValue(defaultModel, modelValues) ?? modelValues[0]
|
|
128
|
+
if (chosen && model !== chosen) setModel(chosen)
|
|
129
|
+
}, [session, model, modelValues, defaultModel])
|
|
130
|
+
|
|
131
|
+
return {
|
|
132
|
+
model,
|
|
133
|
+
setModel: useCallback((m: string) => setModel(m), []),
|
|
134
|
+
groups,
|
|
135
|
+
isLoading,
|
|
136
|
+
}
|
|
137
|
+
}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
|
+
// AllBlue - 理想之海
|
|
3
|
+
// Copyright (C) 2026 AllBlue Contributors
|
|
4
|
+
//
|
|
5
|
+
// This program is free software: you can redistribute it and/or modify
|
|
6
|
+
// it under the terms of the GNU Affero General Public License as published by
|
|
7
|
+
// the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
// (at your option) any later version.
|
|
9
|
+
//
|
|
10
|
+
// This program is distributed in the hope that it will be useful,
|
|
11
|
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
// GNU Affero General Public License for more details.
|
|
14
|
+
//
|
|
15
|
+
// You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
+
|
|
18
|
+
import { useCallback, useEffect, useLayoutEffect, useRef, useState } from "react"
|
|
19
|
+
|
|
20
|
+
export interface OverflowResult {
|
|
21
|
+
visibleCount: number
|
|
22
|
+
hasOverflow: boolean
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* 贪心拟合:返回在 `available` 宽度内能放下的最大按钮数。
|
|
27
|
+
* 第一个按钮不前置 gap,后续按钮前置 gap。
|
|
28
|
+
*/
|
|
29
|
+
function fitCount(widths: number[], gap: number, available: number): number {
|
|
30
|
+
if (available <= 0) return 0
|
|
31
|
+
let acc = 0
|
|
32
|
+
for (let i = 0; i < widths.length; i++) {
|
|
33
|
+
const next = acc === 0 ? widths[i] : acc + gap + widths[i]
|
|
34
|
+
if (next > available) return i
|
|
35
|
+
acc = next
|
|
36
|
+
}
|
|
37
|
+
return widths.length
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* 无迟滞的纯函数溢出计算(向后兼容导出,供单元测试使用)。
|
|
42
|
+
*
|
|
43
|
+
* 注意:当前 hook 实现已改用带 hysteresis 的内联逻辑(见 useToolbarOverflow),
|
|
44
|
+
* 此函数仅保留为工具函数,不再被 hook 调用。
|
|
45
|
+
*/
|
|
46
|
+
export function computeOverflow(
|
|
47
|
+
widths: number[],
|
|
48
|
+
gap: number,
|
|
49
|
+
available: number,
|
|
50
|
+
moreButtonWidth: number,
|
|
51
|
+
): OverflowResult {
|
|
52
|
+
const total = widths.length
|
|
53
|
+
if (total === 0) return { visibleCount: 0, hasOverflow: false }
|
|
54
|
+
|
|
55
|
+
// 第一轮:不计「更多」按钮,看是否全部放得下
|
|
56
|
+
if (fitCount(widths, gap, available) >= total) {
|
|
57
|
+
return { visibleCount: total, hasOverflow: false }
|
|
58
|
+
}
|
|
59
|
+
// 第二轮:为「更多」按钮预留空间后再拟合
|
|
60
|
+
return { visibleCount: fitCount(widths, gap, available - moreButtonWidth), hasOverflow: true }
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface UseToolbarOverflowArgs {
|
|
64
|
+
/** 工具栏容器 ref —— 其 clientWidth 即按钮可用宽度(容器需 flex-grow 撑满,宽度由外部决定) */
|
|
65
|
+
containerRef: React.RefObject<HTMLElement | null>
|
|
66
|
+
/** 隐藏测量层 ref —— 内含全部按钮的「天然宽度」副本 */
|
|
67
|
+
measureRef: React.RefObject<HTMLElement | null>
|
|
68
|
+
/** 容器内位于按钮前方、始终占位的元素(如左侧模型选择器),其宽度需从可用宽度中扣除 */
|
|
69
|
+
leadingRef?: React.RefObject<HTMLElement | null>
|
|
70
|
+
/**
|
|
71
|
+
* 容器内位于按钮后方、可被收起隐藏的元素(如右侧模型选择器)。
|
|
72
|
+
* 未收起时占位并参与可用宽度扣减;收起后该元素应 display:none 让出空间,
|
|
73
|
+
* hook 用缓存的宽度判断何时恢复,形成 hysteresis 避免震荡。
|
|
74
|
+
*/
|
|
75
|
+
trailingRef?: React.RefObject<HTMLElement | null>
|
|
76
|
+
gap: number
|
|
77
|
+
moreButtonWidth: number
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* 工具栏溢出检测 hook(带 hysteresis 迟滞)。
|
|
82
|
+
*
|
|
83
|
+
* 设计要点:
|
|
84
|
+
* 1. 测量 + 计算放在 useLayoutEffect 中同步完成 —— 首帧即正确按钮数,无闪烁。
|
|
85
|
+
* 2. 只观察容器自身尺寸变化(ResizeObserver),rAF 合并防抖动。
|
|
86
|
+
* 3. 容器宽度必须由外部布局决定(flex-grow 撑满),收起按钮不影响容器宽度。
|
|
87
|
+
*
|
|
88
|
+
* **Hysteresis(解决 trailing 收起/展开震荡)**:
|
|
89
|
+
* - trailing 元素(如右侧模型选择器)在收起后由调用方隐藏(display:none),
|
|
90
|
+
* hook 通过缓存的 trailing 宽度判断何时恢复。
|
|
91
|
+
* - 未收起态:trailing 可见占位,available = container - trailing。
|
|
92
|
+
* - 收起态:trailing hidden 让位,available = container - more(可见按钮获得更多空间)。
|
|
93
|
+
* - 恢复条件:fitCount(全部按钮, container - trailing缓存) >= total,
|
|
94
|
+
* 即空间足够重新容纳 trailing 时才展开。
|
|
95
|
+
*/
|
|
96
|
+
export function useToolbarOverflow(args: UseToolbarOverflowArgs): OverflowResult {
|
|
97
|
+
const { containerRef, measureRef, leadingRef, trailingRef, gap, moreButtonWidth } = args
|
|
98
|
+
const [result, setResult] = useState<OverflowResult>({
|
|
99
|
+
visibleCount: Number.MAX_SAFE_INTEGER,
|
|
100
|
+
hasOverflow: false,
|
|
101
|
+
})
|
|
102
|
+
const resultRef = useRef(result)
|
|
103
|
+
const trailingWidthCacheRef = useRef(0)
|
|
104
|
+
|
|
105
|
+
const apply = useCallback((next: OverflowResult) => {
|
|
106
|
+
resultRef.current = next
|
|
107
|
+
setResult((prev) =>
|
|
108
|
+
prev.visibleCount === next.visibleCount && prev.hasOverflow === next.hasOverflow
|
|
109
|
+
? prev
|
|
110
|
+
: next,
|
|
111
|
+
)
|
|
112
|
+
}, [])
|
|
113
|
+
|
|
114
|
+
const measure = useCallback((): OverflowResult | null => {
|
|
115
|
+
const measureEl = measureRef.current
|
|
116
|
+
const container = containerRef.current
|
|
117
|
+
if (!measureEl || !container) return null
|
|
118
|
+
const widths = Array.from(measureEl.children).map((c) => (c as HTMLElement).offsetWidth)
|
|
119
|
+
const leading = leadingRef?.current
|
|
120
|
+
const leadingWidth = leading ? leading.offsetWidth + gap : 0
|
|
121
|
+
|
|
122
|
+
// trailing 宽度:可见时测量并缓存,隐藏时(display:none, offsetWidth=0)用缓存
|
|
123
|
+
const trailingEl = trailingRef?.current
|
|
124
|
+
let trailingWidth = 0
|
|
125
|
+
if (trailingEl) {
|
|
126
|
+
const w = trailingEl.offsetWidth
|
|
127
|
+
if (w > 0) {
|
|
128
|
+
trailingWidth = w + gap
|
|
129
|
+
trailingWidthCacheRef.current = trailingWidth
|
|
130
|
+
} else {
|
|
131
|
+
trailingWidth = trailingWidthCacheRef.current
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const total = widths.length
|
|
136
|
+
if (total === 0) return { visibleCount: 0, hasOverflow: false }
|
|
137
|
+
|
|
138
|
+
const baseWidth = container.clientWidth - leadingWidth
|
|
139
|
+
const prev = resultRef.current
|
|
140
|
+
|
|
141
|
+
if (!prev.hasOverflow) {
|
|
142
|
+
// 未收起态:trailing 可见占位
|
|
143
|
+
const avail = baseWidth - trailingWidth
|
|
144
|
+
if (fitCount(widths, gap, avail) >= total) {
|
|
145
|
+
return { visibleCount: total, hasOverflow: false }
|
|
146
|
+
}
|
|
147
|
+
// 触发收起:trailing 将隐藏让位,可用宽度不扣 trailing
|
|
148
|
+
const collapseAvail = baseWidth - moreButtonWidth
|
|
149
|
+
return { visibleCount: fitCount(widths, gap, collapseAvail), hasOverflow: true }
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// 收起态:判断是否恢复(需容纳全部按钮 + trailing)
|
|
153
|
+
const restoreAvail = baseWidth - trailingWidth
|
|
154
|
+
if (fitCount(widths, gap, restoreAvail) >= total) {
|
|
155
|
+
return { visibleCount: total, hasOverflow: false }
|
|
156
|
+
}
|
|
157
|
+
// 保持收起:trailing 不占位,空间全给可见按钮 + 更多
|
|
158
|
+
const collapseAvail = baseWidth - moreButtonWidth
|
|
159
|
+
return { visibleCount: fitCount(widths, gap, collapseAvail), hasOverflow: true }
|
|
160
|
+
}, [measureRef, containerRef, leadingRef, trailingRef, gap, moreButtonWidth])
|
|
161
|
+
|
|
162
|
+
useLayoutEffect(() => {
|
|
163
|
+
const next = measure()
|
|
164
|
+
if (next) apply(next)
|
|
165
|
+
})
|
|
166
|
+
|
|
167
|
+
useEffect(() => {
|
|
168
|
+
const container = containerRef.current
|
|
169
|
+
if (!container) return
|
|
170
|
+
let frame = 0
|
|
171
|
+
const ro = new ResizeObserver(() => {
|
|
172
|
+
cancelAnimationFrame(frame)
|
|
173
|
+
frame = requestAnimationFrame(() => {
|
|
174
|
+
const next = measure()
|
|
175
|
+
if (next) apply(next)
|
|
176
|
+
})
|
|
177
|
+
})
|
|
178
|
+
ro.observe(container)
|
|
179
|
+
return () => {
|
|
180
|
+
cancelAnimationFrame(frame)
|
|
181
|
+
ro.disconnect()
|
|
182
|
+
}
|
|
183
|
+
}, [containerRef, measure, apply])
|
|
184
|
+
|
|
185
|
+
return result
|
|
186
|
+
}
|
|
187
|
+
|