@satoshibits/react-json-schema-builder 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs10.js +1 -1
- package/dist/index.cjs10.js.map +1 -1
- package/dist/index.cjs100.js +1 -1
- package/dist/index.cjs100.js.map +1 -1
- package/dist/index.cjs101.js +1 -38
- package/dist/index.cjs101.js.map +1 -1
- package/dist/index.cjs102.js +1 -1
- package/dist/index.cjs102.js.map +1 -1
- package/dist/index.cjs103.js +1 -1
- package/dist/index.cjs103.js.map +1 -1
- package/dist/index.cjs11.js +1 -1
- package/dist/index.cjs11.js.map +1 -1
- package/dist/index.cjs12.js +1 -1
- package/dist/index.cjs12.js.map +1 -1
- package/dist/index.cjs13.js +1 -1
- package/dist/index.cjs13.js.map +1 -1
- package/dist/index.cjs14.js +1 -1
- package/dist/index.cjs14.js.map +1 -1
- package/dist/index.cjs15.js +1 -1
- package/dist/index.cjs15.js.map +1 -1
- package/dist/index.cjs16.js +1 -1
- package/dist/index.cjs16.js.map +1 -1
- package/dist/index.cjs17.js +1 -1
- package/dist/index.cjs17.js.map +1 -1
- package/dist/index.cjs18.js +1 -1
- package/dist/index.cjs18.js.map +1 -1
- package/dist/index.cjs19.js +1 -1
- package/dist/index.cjs19.js.map +1 -1
- package/dist/index.cjs2.js +1 -1
- package/dist/index.cjs2.js.map +1 -1
- package/dist/index.cjs20.js +1 -1
- package/dist/index.cjs20.js.map +1 -1
- package/dist/index.cjs21.js +1 -1
- package/dist/index.cjs21.js.map +1 -1
- package/dist/index.cjs22.js +6 -1
- package/dist/index.cjs22.js.map +1 -1
- package/dist/index.cjs23.js +2 -2
- package/dist/index.cjs23.js.map +1 -1
- package/dist/index.cjs24.js +2 -2
- package/dist/index.cjs24.js.map +1 -1
- package/dist/index.cjs25.js +2 -2
- package/dist/index.cjs25.js.map +1 -1
- package/dist/index.cjs26.js +2 -2
- package/dist/index.cjs26.js.map +1 -1
- package/dist/index.cjs27.js +1 -6
- package/dist/index.cjs27.js.map +1 -1
- package/dist/index.cjs28.js +1 -1
- package/dist/index.cjs28.js.map +1 -1
- package/dist/index.cjs29.js +6 -1
- package/dist/index.cjs29.js.map +1 -1
- package/dist/index.cjs3.js +1 -1
- package/dist/index.cjs3.js.map +1 -1
- package/dist/index.cjs30.js +1 -6
- package/dist/index.cjs30.js.map +1 -1
- package/dist/index.cjs31.js +1 -1
- package/dist/index.cjs31.js.map +1 -1
- package/dist/index.cjs32.js +1 -1
- package/dist/index.cjs32.js.map +1 -1
- package/dist/index.cjs33.js +1 -9
- package/dist/index.cjs33.js.map +1 -1
- package/dist/index.cjs34.js +1 -22
- package/dist/index.cjs34.js.map +1 -1
- package/dist/index.cjs35.js +1 -1
- package/dist/index.cjs35.js.map +1 -1
- package/dist/index.cjs36.js +6 -1
- package/dist/index.cjs36.js.map +1 -1
- package/dist/index.cjs37.js +6 -1
- package/dist/index.cjs37.js.map +1 -1
- package/dist/index.cjs38.js +6 -1
- package/dist/index.cjs38.js.map +1 -1
- package/dist/index.cjs39.js +1 -1
- package/dist/index.cjs39.js.map +1 -1
- package/dist/index.cjs4.js +1 -1
- package/dist/index.cjs4.js.map +1 -1
- package/dist/index.cjs40.js +1 -1
- package/dist/index.cjs40.js.map +1 -1
- package/dist/index.cjs41.js +1 -1
- package/dist/index.cjs41.js.map +1 -1
- package/dist/index.cjs42.js +1 -6
- package/dist/index.cjs42.js.map +1 -1
- package/dist/index.cjs43.js +1 -6
- package/dist/index.cjs43.js.map +1 -1
- package/dist/index.cjs44.js +1 -6
- package/dist/index.cjs44.js.map +1 -1
- package/dist/index.cjs45.js +1 -1
- package/dist/index.cjs45.js.map +1 -1
- package/dist/index.cjs46.js +7 -1
- package/dist/index.cjs46.js.map +1 -1
- package/dist/index.cjs47.js +1 -1
- package/dist/index.cjs47.js.map +1 -1
- package/dist/index.cjs48.js +1 -1
- package/dist/index.cjs48.js.map +1 -1
- package/dist/index.cjs49.js +1 -1
- package/dist/index.cjs49.js.map +1 -1
- package/dist/index.cjs5.js +1 -1
- package/dist/index.cjs5.js.map +1 -1
- package/dist/index.cjs50.js +6 -1
- package/dist/index.cjs50.js.map +1 -1
- package/dist/index.cjs51.js +6 -7
- package/dist/index.cjs51.js.map +1 -1
- package/dist/index.cjs52.js +6 -1
- package/dist/index.cjs52.js.map +1 -1
- package/dist/index.cjs53.js +6 -1
- package/dist/index.cjs53.js.map +1 -1
- package/dist/index.cjs54.js +5 -1
- package/dist/index.cjs54.js.map +1 -1
- package/dist/index.cjs55.js +1 -6
- package/dist/index.cjs55.js.map +1 -1
- package/dist/index.cjs56.js +1 -6
- package/dist/index.cjs56.js.map +1 -1
- package/dist/index.cjs57.js +1 -6
- package/dist/index.cjs57.js.map +1 -1
- package/dist/index.cjs58.js +1 -6
- package/dist/index.cjs58.js.map +1 -1
- package/dist/index.cjs59.js +1 -1
- package/dist/index.cjs59.js.map +1 -1
- package/dist/index.cjs6.js +1 -1
- package/dist/index.cjs6.js.map +1 -1
- package/dist/index.cjs60.js +1 -1
- package/dist/index.cjs60.js.map +1 -1
- package/dist/index.cjs61.js +1 -5
- package/dist/index.cjs61.js.map +1 -1
- package/dist/index.cjs62.js +1 -1
- package/dist/index.cjs62.js.map +1 -1
- package/dist/index.cjs63.js +1 -1
- package/dist/index.cjs63.js.map +1 -1
- package/dist/index.cjs64.js +1 -1
- package/dist/index.cjs64.js.map +1 -1
- package/dist/index.cjs65.js +1 -1
- package/dist/index.cjs65.js.map +1 -1
- package/dist/index.cjs66.js +1 -1
- package/dist/index.cjs66.js.map +1 -1
- package/dist/index.cjs67.js +1 -1
- package/dist/index.cjs67.js.map +1 -1
- package/dist/index.cjs68.js +1 -1
- package/dist/index.cjs68.js.map +1 -1
- package/dist/index.cjs69.js +1 -1
- package/dist/index.cjs69.js.map +1 -1
- package/dist/index.cjs7.js +1 -1
- package/dist/index.cjs7.js.map +1 -1
- package/dist/index.cjs70.js +1 -1
- package/dist/index.cjs70.js.map +1 -1
- package/dist/index.cjs71.js +1 -1
- package/dist/index.cjs71.js.map +1 -1
- package/dist/index.cjs72.js +1 -1
- package/dist/index.cjs72.js.map +1 -1
- package/dist/index.cjs73.js +1 -1
- package/dist/index.cjs73.js.map +1 -1
- package/dist/index.cjs74.js +1 -1
- package/dist/index.cjs74.js.map +1 -1
- package/dist/index.cjs75.js +1 -1
- package/dist/index.cjs75.js.map +1 -1
- package/dist/index.cjs76.js +1 -1
- package/dist/index.cjs76.js.map +1 -1
- package/dist/index.cjs77.js +1 -1
- package/dist/index.cjs77.js.map +1 -1
- package/dist/index.cjs78.js +1 -1
- package/dist/index.cjs78.js.map +1 -1
- package/dist/index.cjs79.js +1 -1
- package/dist/index.cjs79.js.map +1 -1
- package/dist/index.cjs8.js +1 -1
- package/dist/index.cjs8.js.map +1 -1
- package/dist/index.cjs80.js +1 -1
- package/dist/index.cjs80.js.map +1 -1
- package/dist/index.cjs81.js +1 -1
- package/dist/index.cjs81.js.map +1 -1
- package/dist/index.cjs82.js +1 -1
- package/dist/index.cjs82.js.map +1 -1
- package/dist/index.cjs83.js +1 -1
- package/dist/index.cjs83.js.map +1 -1
- package/dist/index.cjs84.js +1 -1
- package/dist/index.cjs84.js.map +1 -1
- package/dist/index.cjs85.js +1 -1
- package/dist/index.cjs85.js.map +1 -1
- package/dist/index.cjs86.js +1 -1
- package/dist/index.cjs86.js.map +1 -1
- package/dist/index.cjs87.js +1 -1
- package/dist/index.cjs87.js.map +1 -1
- package/dist/index.cjs88.js +4 -1
- package/dist/index.cjs88.js.map +1 -1
- package/dist/index.cjs89.js +1 -1
- package/dist/index.cjs89.js.map +1 -1
- package/dist/index.cjs9.js +1 -1
- package/dist/index.cjs9.js.map +1 -1
- package/dist/index.cjs90.js +1 -1
- package/dist/index.cjs90.js.map +1 -1
- package/dist/index.cjs91.js +1 -1
- package/dist/index.cjs91.js.map +1 -1
- package/dist/index.cjs92.js +1 -1
- package/dist/index.cjs92.js.map +1 -1
- package/dist/index.cjs93.js +1 -1
- package/dist/index.cjs93.js.map +1 -1
- package/dist/index.cjs94.js +38 -1
- package/dist/index.cjs94.js.map +1 -1
- package/dist/index.cjs95.js +1 -4
- package/dist/index.cjs95.js.map +1 -1
- package/dist/index.cjs96.js +1 -1
- package/dist/index.cjs96.js.map +1 -1
- package/dist/index.cjs97.js +1 -1
- package/dist/index.cjs97.js.map +1 -1
- package/dist/index.cjs98.js +1 -1
- package/dist/index.cjs98.js.map +1 -1
- package/dist/index.cjs99.js +1 -1
- package/dist/index.cjs99.js.map +1 -1
- package/dist/index.es10.js +46 -22
- package/dist/index.es10.js.map +1 -1
- package/dist/index.es100.js +11 -63
- package/dist/index.es100.js.map +1 -1
- package/dist/index.es101.js +27 -68
- package/dist/index.es101.js.map +1 -1
- package/dist/index.es102.js +4 -8
- package/dist/index.es102.js.map +1 -1
- package/dist/index.es103.js +23 -14
- package/dist/index.es103.js.map +1 -1
- package/dist/index.es11.js +57 -39
- package/dist/index.es11.js.map +1 -1
- package/dist/index.es12.js +23 -61
- package/dist/index.es12.js.map +1 -1
- package/dist/index.es13.js +126 -21
- package/dist/index.es13.js.map +1 -1
- package/dist/index.es14.js +12 -126
- package/dist/index.es14.js.map +1 -1
- package/dist/index.es15.js +132 -17
- package/dist/index.es15.js.map +1 -1
- package/dist/index.es16.js +133 -130
- package/dist/index.es16.js.map +1 -1
- package/dist/index.es17.js +43 -117
- package/dist/index.es17.js.map +1 -1
- package/dist/index.es18.js +9 -62
- package/dist/index.es18.js.map +1 -1
- package/dist/index.es19.js +23 -11
- package/dist/index.es19.js.map +1 -1
- package/dist/index.es2.js +21 -20
- package/dist/index.es2.js.map +1 -1
- package/dist/index.es20.js +422 -20
- package/dist/index.es20.js.map +1 -1
- package/dist/index.es21.js +5 -424
- package/dist/index.es21.js.map +1 -1
- package/dist/index.es22.js +13 -6
- package/dist/index.es22.js.map +1 -1
- package/dist/index.es23.js +10 -7
- package/dist/index.es23.js.map +1 -1
- package/dist/index.es24.js +7 -10
- package/dist/index.es24.js.map +1 -1
- package/dist/index.es25.js +12 -6
- package/dist/index.es25.js.map +1 -1
- package/dist/index.es26.js +4 -13
- package/dist/index.es26.js.map +1 -1
- package/dist/index.es27.js +19 -10
- package/dist/index.es27.js.map +1 -1
- package/dist/index.es28.js +22 -18
- package/dist/index.es28.js.map +1 -1
- package/dist/index.es29.js +13 -23
- package/dist/index.es29.js.map +1 -1
- package/dist/index.es3.js +207 -206
- package/dist/index.es3.js.map +1 -1
- package/dist/index.es30.js +17 -13
- package/dist/index.es30.js.map +1 -1
- package/dist/index.es31.js +14 -7
- package/dist/index.es31.js.map +1 -1
- package/dist/index.es32.js +2477 -2
- package/dist/index.es32.js.map +1 -1
- package/dist/index.es33.js +39 -24
- package/dist/index.es33.js.map +1 -1
- package/dist/index.es34.js +33 -602
- package/dist/index.es34.js.map +1 -1
- package/dist/index.es35.js +832 -17
- package/dist/index.es35.js.map +1 -1
- package/dist/index.es36.js +10 -15
- package/dist/index.es36.js.map +1 -1
- package/dist/index.es37.js +10 -2477
- package/dist/index.es37.js.map +1 -1
- package/dist/index.es38.js +10 -41
- package/dist/index.es38.js.map +1 -1
- package/dist/index.es39.js +115 -32
- package/dist/index.es39.js.map +1 -1
- package/dist/index.es4.js +5 -5
- package/dist/index.es4.js.map +1 -1
- package/dist/index.es40.js +106 -108
- package/dist/index.es40.js.map +1 -1
- package/dist/index.es41.js +48 -824
- package/dist/index.es41.js.map +1 -1
- package/dist/index.es42.js +24 -10
- package/dist/index.es42.js.map +1 -1
- package/dist/index.es43.js +45 -10
- package/dist/index.es43.js.map +1 -1
- package/dist/index.es44.js +86 -10
- package/dist/index.es44.js.map +1 -1
- package/dist/index.es45.js +56 -110
- package/dist/index.es45.js.map +1 -1
- package/dist/index.es46.js +122 -55
- package/dist/index.es46.js.map +1 -1
- package/dist/index.es47.js +62 -23
- package/dist/index.es47.js.map +1 -1
- package/dist/index.es48.js +7 -44
- package/dist/index.es48.js.map +1 -1
- package/dist/index.es49.js +4 -85
- package/dist/index.es49.js.map +1 -1
- package/dist/index.es5.js +62 -62
- package/dist/index.es5.js.map +1 -1
- package/dist/index.es50.js +19 -58
- package/dist/index.es50.js.map +1 -1
- package/dist/index.es51.js +9 -123
- package/dist/index.es51.js.map +1 -1
- package/dist/index.es52.js +38 -63
- package/dist/index.es52.js.map +1 -1
- package/dist/index.es53.js +18 -2
- package/dist/index.es53.js.map +1 -1
- package/dist/index.es54.js +255 -2
- package/dist/index.es54.js.map +1 -1
- package/dist/index.es55.js +21 -20
- package/dist/index.es55.js.map +1 -1
- package/dist/index.es56.js +4 -9
- package/dist/index.es56.js.map +1 -1
- package/dist/index.es57.js +7 -38
- package/dist/index.es57.js.map +1 -1
- package/dist/index.es58.js +46 -18
- package/dist/index.es58.js.map +1 -1
- package/dist/index.es59.js +26 -7
- package/dist/index.es59.js.map +1 -1
- package/dist/index.es6.js +37 -37
- package/dist/index.es6.js.map +1 -1
- package/dist/index.es60.js +65 -4
- package/dist/index.es60.js.map +1 -1
- package/dist/index.es61.js +7 -254
- package/dist/index.es61.js.map +1 -1
- package/dist/index.es62.js +123 -20
- package/dist/index.es62.js.map +1 -1
- package/dist/index.es63.js +13 -25
- package/dist/index.es63.js.map +1 -1
- package/dist/index.es64.js +132 -5
- package/dist/index.es64.js.map +1 -1
- package/dist/index.es65.js +10 -65
- package/dist/index.es65.js.map +1 -1
- package/dist/index.es66.js +212 -26
- package/dist/index.es66.js.map +1 -1
- package/dist/index.es67.js +13 -6
- package/dist/index.es67.js.map +1 -1
- package/dist/index.es68.js +32 -24
- package/dist/index.es68.js.map +1 -1
- package/dist/index.es69.js +7 -32
- package/dist/index.es69.js.map +1 -1
- package/dist/index.es7.js +33 -33
- package/dist/index.es7.js.map +1 -1
- package/dist/index.es70.js +29 -3
- package/dist/index.es70.js.map +1 -1
- package/dist/index.es71.js +4 -46
- package/dist/index.es71.js.map +1 -1
- package/dist/index.es72.js +5 -7
- package/dist/index.es72.js.map +1 -1
- package/dist/index.es73.js +26 -123
- package/dist/index.es73.js.map +1 -1
- package/dist/index.es74.js +50 -15
- package/dist/index.es74.js.map +1 -1
- package/dist/index.es75.js +8 -133
- package/dist/index.es75.js.map +1 -1
- package/dist/index.es76.js +24 -10
- package/dist/index.es76.js.map +1 -1
- package/dist/index.es77.js +65 -213
- package/dist/index.es77.js.map +1 -1
- package/dist/index.es78.js +12 -13
- package/dist/index.es78.js.map +1 -1
- package/dist/index.es79.js +204 -7
- package/dist/index.es79.js.map +1 -1
- package/dist/index.es8.js +87 -87
- package/dist/index.es8.js.map +1 -1
- package/dist/index.es80.js +22 -4
- package/dist/index.es80.js.map +1 -1
- package/dist/index.es81.js +391 -26
- package/dist/index.es81.js.map +1 -1
- package/dist/index.es82.js +24 -49
- package/dist/index.es82.js.map +1 -1
- package/dist/index.es83.js +28 -8
- package/dist/index.es83.js.map +1 -1
- package/dist/index.es84.js +5 -68
- package/dist/index.es84.js.map +1 -1
- package/dist/index.es85.js +5 -12
- package/dist/index.es85.js.map +1 -1
- package/dist/index.es86.js +3 -205
- package/dist/index.es86.js.map +1 -1
- package/dist/index.es87.js +23 -21
- package/dist/index.es87.js.map +1 -1
- package/dist/index.es88.js +105 -388
- package/dist/index.es88.js.map +1 -1
- package/dist/index.es89.js +14 -23
- package/dist/index.es89.js.map +1 -1
- package/dist/index.es9.js +23 -3
- package/dist/index.es9.js.map +1 -1
- package/dist/index.es90.js +521 -27
- package/dist/index.es90.js.map +1 -1
- package/dist/index.es91.js +127 -5
- package/dist/index.es91.js.map +1 -1
- package/dist/index.es92.js +129 -5
- package/dist/index.es92.js.map +1 -1
- package/dist/index.es93.js +65 -3
- package/dist/index.es93.js.map +1 -1
- package/dist/index.es94.js +69 -24
- package/dist/index.es94.js.map +1 -1
- package/dist/index.es95.js +9 -110
- package/dist/index.es95.js.map +1 -1
- package/dist/index.es96.js +14 -16
- package/dist/index.es96.js.map +1 -1
- package/dist/index.es97.js +60 -521
- package/dist/index.es97.js.map +1 -1
- package/dist/index.es98.js +3 -126
- package/dist/index.es98.js.map +1 -1
- package/dist/index.es99.js +22 -128
- package/dist/index.es99.js.map +1 -1
- package/dist/packages/builder/context.d.ts +1 -0
- package/dist/packages/builder/context.d.ts.map +1 -1
- package/dist/packages/builder/schema-builder.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +3 -3
- package/dist/index.cjs104.js +0 -2
- package/dist/index.cjs104.js.map +0 -1
- package/dist/index.cjs105.js +0 -2
- package/dist/index.cjs105.js.map +0 -1
- package/dist/index.cjs106.js +0 -2
- package/dist/index.cjs106.js.map +0 -1
- package/dist/index.cjs107.js +0 -2
- package/dist/index.cjs107.js.map +0 -1
- package/dist/index.cjs108.js +0 -2
- package/dist/index.cjs108.js.map +0 -1
- package/dist/index.cjs109.js +0 -2
- package/dist/index.cjs109.js.map +0 -1
- package/dist/index.cjs110.js +0 -2
- package/dist/index.cjs110.js.map +0 -1
- package/dist/index.es104.js +0 -65
- package/dist/index.es104.js.map +0 -1
- package/dist/index.es105.js +0 -7
- package/dist/index.es105.js.map +0 -1
- package/dist/index.es106.js +0 -26
- package/dist/index.es106.js.map +0 -1
- package/dist/index.es107.js +0 -26
- package/dist/index.es107.js.map +0 -1
- package/dist/index.es108.js +0 -16
- package/dist/index.es108.js.map +0 -1
- package/dist/index.es109.js +0 -31
- package/dist/index.es109.js.map +0 -1
- package/dist/index.es110.js +0 -8
- package/dist/index.es110.js.map +0 -1
package/dist/index.es58.js
CHANGED
|
@@ -1,21 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
1
|
+
import n from "react";
|
|
2
|
+
import { createContextScope as O } from "./index.es60.js";
|
|
3
|
+
import { useComposedRefs as S } from "./index.es59.js";
|
|
4
|
+
import { Slot as x } from "./index.es33.js";
|
|
5
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
6
|
+
function h(s) {
|
|
7
|
+
const f = s + "CollectionProvider", [A, N] = O(f), [_, m] = A(
|
|
8
|
+
f,
|
|
9
|
+
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
10
|
+
), u = (c) => {
|
|
11
|
+
const { scope: e, children: l } = c, o = n.useRef(null), t = n.useRef(/* @__PURE__ */ new Map()).current;
|
|
12
|
+
return /* @__PURE__ */ d(_, { scope: e, itemMap: t, collectionRef: o, children: l });
|
|
13
|
+
};
|
|
14
|
+
u.displayName = f;
|
|
15
|
+
const a = s + "CollectionSlot", p = n.forwardRef(
|
|
16
|
+
(c, e) => {
|
|
17
|
+
const { scope: l, children: o } = c, t = m(a, l), r = S(e, t.collectionRef);
|
|
18
|
+
return /* @__PURE__ */ d(x, { ref: r, children: o });
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
p.displayName = a;
|
|
22
|
+
const C = s + "CollectionItemSlot", R = "data-radix-collection-item", M = n.forwardRef(
|
|
23
|
+
(c, e) => {
|
|
24
|
+
const { scope: l, children: o, ...t } = c, r = n.useRef(null), I = S(e, r), i = m(C, l);
|
|
25
|
+
return n.useEffect(() => (i.itemMap.set(r, { ref: r, ...t }), () => void i.itemMap.delete(r))), /* @__PURE__ */ d(x, { [R]: "", ref: I, children: o });
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
M.displayName = C;
|
|
29
|
+
function E(c) {
|
|
30
|
+
const e = m(s + "CollectionConsumer", c);
|
|
31
|
+
return n.useCallback(() => {
|
|
32
|
+
const o = e.collectionRef.current;
|
|
33
|
+
if (!o) return [];
|
|
34
|
+
const t = Array.from(o.querySelectorAll(`[${R}]`));
|
|
35
|
+
return Array.from(e.itemMap.values()).sort(
|
|
36
|
+
(i, T) => t.indexOf(i.ref.current) - t.indexOf(T.ref.current)
|
|
37
|
+
);
|
|
38
|
+
}, [e.collectionRef, e.itemMap]);
|
|
39
|
+
}
|
|
40
|
+
return [
|
|
41
|
+
{ Provider: u, Slot: p, ItemSlot: M },
|
|
42
|
+
E,
|
|
43
|
+
N
|
|
44
|
+
];
|
|
45
|
+
}
|
|
18
46
|
export {
|
|
19
|
-
|
|
47
|
+
h as createCollection
|
|
20
48
|
};
|
|
21
49
|
//# sourceMappingURL=index.es58.js.map
|
package/dist/index.es58.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es58.js","sources":["../../../node_modules/.pnpm
|
|
1
|
+
{"version":3,"file":"index.es58.js","sources":["../../../node_modules/.pnpm/@radix-ui+react-collection@1.1.2_@types+react-dom@18.3.5_@types+react@18.3.18__@types+r_f0ca6b954f28db1d942bcdb5b2347248/node_modules/@radix-ui/react-collection/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// packages/react/collection/src/collection.tsx\nimport React from \"react\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction createCollection(name) {\n const PROVIDER_NAME = name + \"CollectionProvider\";\n const [createCollectionContext, createCollectionScope] = createContextScope(PROVIDER_NAME);\n const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(\n PROVIDER_NAME,\n { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }\n );\n const CollectionProvider = (props) => {\n const { scope, children } = props;\n const ref = React.useRef(null);\n const itemMap = React.useRef(/* @__PURE__ */ new Map()).current;\n return /* @__PURE__ */ jsx(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });\n };\n CollectionProvider.displayName = PROVIDER_NAME;\n const COLLECTION_SLOT_NAME = name + \"CollectionSlot\";\n const CollectionSlot = React.forwardRef(\n (props, forwardedRef) => {\n const { scope, children } = props;\n const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);\n const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);\n return /* @__PURE__ */ jsx(Slot, { ref: composedRefs, children });\n }\n );\n CollectionSlot.displayName = COLLECTION_SLOT_NAME;\n const ITEM_SLOT_NAME = name + \"CollectionItemSlot\";\n const ITEM_DATA_ATTR = \"data-radix-collection-item\";\n const CollectionItemSlot = React.forwardRef(\n (props, forwardedRef) => {\n const { scope, children, ...itemData } = props;\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const context = useCollectionContext(ITEM_SLOT_NAME, scope);\n React.useEffect(() => {\n context.itemMap.set(ref, { ref, ...itemData });\n return () => void context.itemMap.delete(ref);\n });\n return /* @__PURE__ */ jsx(Slot, { ...{ [ITEM_DATA_ATTR]: \"\" }, ref: composedRefs, children });\n }\n );\n CollectionItemSlot.displayName = ITEM_SLOT_NAME;\n function useCollection(scope) {\n const context = useCollectionContext(name + \"CollectionConsumer\", scope);\n const getItems = React.useCallback(() => {\n const collectionNode = context.collectionRef.current;\n if (!collectionNode) return [];\n const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));\n const items = Array.from(context.itemMap.values());\n const orderedItems = items.sort(\n (a, b) => orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current)\n );\n return orderedItems;\n }, [context.collectionRef, context.itemMap]);\n return getItems;\n }\n return [\n { Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },\n useCollection,\n createCollectionScope\n ];\n}\nexport {\n createCollection\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["createCollection","name","PROVIDER_NAME","createCollectionContext","createCollectionScope","createContextScope","CollectionProviderImpl","useCollectionContext","CollectionProvider","props","scope","children","ref","React","itemMap","jsx","COLLECTION_SLOT_NAME","CollectionSlot","forwardedRef","context","composedRefs","useComposedRefs","Slot","ITEM_SLOT_NAME","ITEM_DATA_ATTR","CollectionItemSlot","itemData","useCollection","collectionNode","orderedNodes","a","b"],"mappings":";;;;;AAQA,SAASA,EAAiBC,GAAM;AAC9B,QAAMC,IAAgBD,IAAO,sBACvB,CAACE,GAAyBC,CAAqB,IAAIC,EAAmBH,CAAa,GACnF,CAACI,GAAwBC,CAAoB,IAAIJ;AAAA,IACrDD;AAAA,IACA,EAAE,eAAe,EAAE,SAAS,KAAI,GAAI,SAAyB,oBAAI,IAAK,EAAA;AAAA,EACvE,GACKM,IAAqB,CAACC,MAAU;AACpC,UAAM,EAAE,OAAAC,GAAO,UAAAC,EAAQ,IAAKF,GACtBG,IAAMC,EAAM,OAAO,IAAI,GACvBC,IAAUD,EAAM,OAAuB,oBAAI,IAAG,CAAE,EAAE;AACxD,WAAuB,gBAAAE,EAAIT,GAAwB,EAAE,OAAAI,GAAO,SAAAI,GAAS,eAAeF,GAAK,UAAAD,GAAU;AAAA,EACpG;AACD,EAAAH,EAAmB,cAAcN;AACjC,QAAMc,IAAuBf,IAAO,kBAC9BgB,IAAiBJ,EAAM;AAAA,IAC3B,CAACJ,GAAOS,MAAiB;AACvB,YAAM,EAAE,OAAAR,GAAO,UAAAC,EAAQ,IAAKF,GACtBU,IAAUZ,EAAqBS,GAAsBN,CAAK,GAC1DU,IAAeC,EAAgBH,GAAcC,EAAQ,aAAa;AACxE,aAAuB,gBAAAJ,EAAIO,GAAM,EAAE,KAAKF,GAAc,UAAAT,EAAQ,CAAE;AAAA,IACtE;AAAA,EACG;AACD,EAAAM,EAAe,cAAcD;AAC7B,QAAMO,IAAiBtB,IAAO,sBACxBuB,IAAiB,8BACjBC,IAAqBZ,EAAM;AAAA,IAC/B,CAACJ,GAAOS,MAAiB;AACvB,YAAM,EAAE,OAAAR,GAAO,UAAAC,GAAU,GAAGe,EAAU,IAAGjB,GACnCG,IAAMC,EAAM,OAAO,IAAI,GACvBO,IAAeC,EAAgBH,GAAcN,CAAG,GAChDO,IAAUZ,EAAqBgB,GAAgBb,CAAK;AAC1DG,aAAAA,EAAM,UAAU,OACdM,EAAQ,QAAQ,IAAIP,GAAK,EAAE,KAAAA,GAAK,GAAGc,GAAU,GACtC,MAAM,KAAKP,EAAQ,QAAQ,OAAOP,CAAG,EAC7C,GACsB,gBAAAG,EAAIO,GAAM,EAAO,CAACE,CAAc,GAAG,IAAM,KAAKJ,GAAc,UAAAT,GAAU;AAAA,IACnG;AAAA,EACG;AACD,EAAAc,EAAmB,cAAcF;AACjC,WAASI,EAAcjB,GAAO;AAC5B,UAAMS,IAAUZ,EAAqBN,IAAO,sBAAsBS,CAAK;AAWvE,WAViBG,EAAM,YAAY,MAAM;AACvC,YAAMe,IAAiBT,EAAQ,cAAc;AAC7C,UAAI,CAACS,EAAgB,QAAO,CAAE;AAC9B,YAAMC,IAAe,MAAM,KAAKD,EAAe,iBAAiB,IAAIJ,CAAc,GAAG,CAAC;AAKtF,aAJc,MAAM,KAAKL,EAAQ,QAAQ,QAAQ,EACtB;AAAA,QACzB,CAACW,GAAGC,MAAMF,EAAa,QAAQC,EAAE,IAAI,OAAO,IAAID,EAAa,QAAQE,EAAE,IAAI,OAAO;AAAA,MACnF;AAAA,IAEF,GAAE,CAACZ,EAAQ,eAAeA,EAAQ,OAAO,CAAC;AAAA,EAE/C;AACE,SAAO;AAAA,IACL,EAAE,UAAUX,GAAoB,MAAMS,GAAgB,UAAUQ,EAAoB;AAAA,IACpFE;AAAA,IACAvB;AAAA,EACD;AACH;","x_google_ignoreList":[0]}
|
package/dist/index.es59.js
CHANGED
|
@@ -1,11 +1,30 @@
|
|
|
1
|
-
import
|
|
2
|
-
function
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import * as f from "react";
|
|
2
|
+
function l(n, o) {
|
|
3
|
+
if (typeof n == "function")
|
|
4
|
+
return n(o);
|
|
5
|
+
n != null && (n.current = o);
|
|
6
|
+
}
|
|
7
|
+
function i(...n) {
|
|
8
|
+
return (o) => {
|
|
9
|
+
let u = !1;
|
|
10
|
+
const c = n.map((t) => {
|
|
11
|
+
const e = l(t, o);
|
|
12
|
+
return !u && typeof e == "function" && (u = !0), e;
|
|
13
|
+
});
|
|
14
|
+
if (u)
|
|
15
|
+
return () => {
|
|
16
|
+
for (let t = 0; t < c.length; t++) {
|
|
17
|
+
const e = c[t];
|
|
18
|
+
typeof e == "function" ? e() : l(n[t], null);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function s(...n) {
|
|
24
|
+
return f.useCallback(i(...n), n);
|
|
7
25
|
}
|
|
8
26
|
export {
|
|
9
|
-
|
|
27
|
+
i as composeRefs,
|
|
28
|
+
s as useComposedRefs
|
|
10
29
|
};
|
|
11
30
|
//# sourceMappingURL=index.es59.js.map
|
package/dist/index.es59.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es59.js","sources":["../../../node_modules/.pnpm
|
|
1
|
+
{"version":3,"file":"index.es59.js","sources":["../../../node_modules/.pnpm/@radix-ui+react-compose-refs@1.1.1_@types+react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-compose-refs/dist/index.mjs"],"sourcesContent":["// packages/react/compose-refs/src/composeRefs.tsx\nimport * as React from \"react\";\nfunction setRef(ref, value) {\n if (typeof ref === \"function\") {\n return ref(value);\n } else if (ref !== null && ref !== void 0) {\n ref.current = value;\n }\n}\nfunction composeRefs(...refs) {\n return (node) => {\n let hasCleanup = false;\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup == \"function\") {\n hasCleanup = true;\n }\n return cleanup;\n });\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup == \"function\") {\n cleanup();\n } else {\n setRef(refs[i], null);\n }\n }\n };\n }\n };\n}\nfunction useComposedRefs(...refs) {\n return React.useCallback(composeRefs(...refs), refs);\n}\nexport {\n composeRefs,\n useComposedRefs\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["setRef","ref","value","composeRefs","refs","node","hasCleanup","cleanups","cleanup","i","useComposedRefs","React"],"mappings":";AAEA,SAASA,EAAOC,GAAKC,GAAO;AAC1B,MAAI,OAAOD,KAAQ;AACjB,WAAOA,EAAIC,CAAK;AACX,EAAID,KAAQ,SACjBA,EAAI,UAAUC;AAElB;AACA,SAASC,KAAeC,GAAM;AAC5B,SAAO,CAACC,MAAS;AACf,QAAIC,IAAa;AACjB,UAAMC,IAAWH,EAAK,IAAI,CAACH,MAAQ;AACjC,YAAMO,IAAUR,EAAOC,GAAKI,CAAI;AAChC,aAAI,CAACC,KAAc,OAAOE,KAAW,eACnCF,IAAa,KAERE;AAAA,IACb,CAAK;AACD,QAAIF;AACF,aAAO,MAAM;AACX,iBAASG,IAAI,GAAGA,IAAIF,EAAS,QAAQE,KAAK;AACxC,gBAAMD,IAAUD,EAASE,CAAC;AAC1B,UAAI,OAAOD,KAAW,aACpBA,EAAS,IAETR,EAAOI,EAAKK,CAAC,GAAG,IAAI;AAAA,QAEhC;AAAA,MACO;AAAA,EAEJ;AACH;AACA,SAASC,KAAmBN,GAAM;AAChC,SAAOO,EAAM,YAAYR,EAAY,GAAGC,CAAI,GAAGA,CAAI;AACrD;","x_google_ignoreList":[0]}
|
package/dist/index.es6.js
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Input as
|
|
3
|
-
import { InputErrorWrapper as
|
|
4
|
-
import { Label as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { useConstraints as
|
|
7
|
-
import { Button as
|
|
8
|
-
import
|
|
1
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { Input as l } from "./index.es27.js";
|
|
3
|
+
import { InputErrorWrapper as p } from "./index.es28.js";
|
|
4
|
+
import { Label as f } from "./index.es14.js";
|
|
5
|
+
import { cn as b } from "./index.es21.js";
|
|
6
|
+
import { useConstraints as N } from "./index.es4.js";
|
|
7
|
+
import { Button as h } from "./index.es10.js";
|
|
8
|
+
import x from "./index.es29.js";
|
|
9
9
|
const t = ({
|
|
10
|
-
constraintName:
|
|
11
|
-
value:
|
|
12
|
-
onConstraintChange:
|
|
13
|
-
disabled:
|
|
10
|
+
constraintName: m,
|
|
11
|
+
value: o,
|
|
12
|
+
onConstraintChange: s,
|
|
13
|
+
disabled: c,
|
|
14
14
|
error: n,
|
|
15
|
-
onRemoveConstraint:
|
|
15
|
+
onRemoveConstraint: a
|
|
16
16
|
}) => {
|
|
17
|
-
const { getConstraintDefinition:
|
|
18
|
-
return
|
|
19
|
-
|
|
17
|
+
const { getConstraintDefinition: u } = N(), e = u(m);
|
|
18
|
+
return e ? /* @__PURE__ */ r(
|
|
19
|
+
p,
|
|
20
20
|
{
|
|
21
21
|
errorCode: n?.code,
|
|
22
22
|
errorDescription: n?.message,
|
|
23
23
|
showError: !!n,
|
|
24
|
-
children: /* @__PURE__ */
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
-
|
|
24
|
+
children: /* @__PURE__ */ i("div", { children: [
|
|
25
|
+
/* @__PURE__ */ r(f, { className: "mb-2", htmlFor: e.name, children: e.name }),
|
|
26
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
27
|
+
/* @__PURE__ */ r(
|
|
28
|
+
l,
|
|
29
29
|
{
|
|
30
|
-
id:
|
|
30
|
+
id: e.name,
|
|
31
31
|
type: "number",
|
|
32
|
-
value:
|
|
33
|
-
onChange: (
|
|
34
|
-
disabled:
|
|
35
|
-
className:
|
|
32
|
+
value: o,
|
|
33
|
+
onChange: (d) => s(Number(d.target.value)),
|
|
34
|
+
disabled: c,
|
|
35
|
+
className: b({ "border-destructive": n })
|
|
36
36
|
}
|
|
37
37
|
),
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
|
|
38
|
+
/* @__PURE__ */ r(
|
|
39
|
+
h,
|
|
40
40
|
{
|
|
41
41
|
type: "button",
|
|
42
42
|
variant: "ghost",
|
|
43
43
|
size: "icon",
|
|
44
|
-
onClick: () =>
|
|
45
|
-
children: /* @__PURE__ */
|
|
44
|
+
onClick: () => a(),
|
|
45
|
+
children: /* @__PURE__ */ r(x, { className: "size-4" })
|
|
46
46
|
}
|
|
47
47
|
)
|
|
48
48
|
] }),
|
|
49
|
-
|
|
49
|
+
e.description && /* @__PURE__ */ r("div", { className: "mt-2 text-sm text-gray-500", children: e.description })
|
|
50
50
|
] })
|
|
51
51
|
}
|
|
52
52
|
) : null;
|
|
53
|
-
},
|
|
53
|
+
}, j = t, z = t, I = t, k = t, w = t;
|
|
54
54
|
export {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
55
|
+
k as NumberExclusiveMaximumRenderer,
|
|
56
|
+
I as NumberExclusiveMinimumRenderer,
|
|
57
|
+
z as NumberMaximumRenderer,
|
|
58
|
+
j as NumberMinimumRenderer,
|
|
59
|
+
w as NumberMultipleOfRenderer
|
|
60
60
|
};
|
|
61
61
|
//# sourceMappingURL=index.es6.js.map
|
package/dist/index.es6.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es6.js","sources":["../src/packages/plugins/number.tsx"],"sourcesContent":["import { Input } from \"@/components/ui/input\";\nimport { InputErrorWrapper } from \"@/components/input-error\";\nimport { Label } from \"@/components/ui/label\";\nimport { cn } from \"@/lib/utils\";\nimport {\n BaseJSONSchemaPlugin,\n ConstraintRendererProps,\n useConstraints,\n} from \"@/packages/constraints/context\";\nimport { Button } from \"@/components/ui/button\";\nimport { X } from \"lucide-react\";\n\n// A generic number constraint renderer component to reduce code duplication\nconst NumberConstraintRenderer = ({\n constraintName,\n value,\n onConstraintChange,\n disabled,\n error,\n onRemoveConstraint,\n}: ConstraintRendererProps<number> & { disabled?: boolean }) => {\n const { getConstraintDefinition } = useConstraints();\n const constraintDef = getConstraintDefinition(constraintName);\n\n if (!constraintDef) {\n return null;\n }\n\n return (\n <InputErrorWrapper\n errorCode={error?.code}\n errorDescription={error?.message}\n showError={!!error}\n >\n <div>\n <Label className=\"mb-2\" htmlFor={constraintDef.name}>\n {constraintDef.name}\n </Label>\n <div className=\"flex items-center gap-2\">\n <Input\n id={constraintDef.name}\n type=\"number\"\n value={value}\n onChange={(e) => onConstraintChange(Number(e.target.value))}\n disabled={disabled}\n className={cn({ \"border-destructive\": error })}\n />\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n onClick={() => onRemoveConstraint()}\n >\n <X className=\"size-4\" />\n </Button>\n </div>\n {constraintDef.description && (\n <div className=\"mt-2 text-sm text-gray-500\">\n {constraintDef.description}\n </div>\n )}\n </div>\n </InputErrorWrapper>\n );\n};\n\n// Reuse the generic renderer for all number constraints\nexport const NumberMinimumRenderer = NumberConstraintRenderer;\nexport const NumberMaximumRenderer = NumberConstraintRenderer;\nexport const NumberExclusiveMinimumRenderer = NumberConstraintRenderer;\nexport const NumberExclusiveMaximumRenderer = NumberConstraintRenderer;\nexport const NumberMultipleOfRenderer = NumberConstraintRenderer;\n\nconst plugin: BaseJSONSchemaPlugin = {\n id: \"number-constraints\",\n hooks: {\n registerConstraints() {\n return [\n {\n name: \"minimum\",\n label: \"Minimum\",\n appliesTo: [\"number\", \"integer\"],\n schema: {\n type: \"number\",\n title: \"Minimum Constraint\",\n description: \"The minimum value for this constraint\",\n examples: [0, 1, 10],\n },\n description: \"Constrains a number or integer to a minimum value\",\n defaultValue: 0,\n },\n {\n name: \"maximum\",\n label: \"Maximum\",\n appliesTo: [\"number\", \"integer\"],\n schema: {\n type: \"number\",\n title: \"Maximum Constraint\",\n description: \"The maximum value for this constraint\",\n examples: [10, 100, 1000],\n },\n description: \"Constrains a number or integer to a maximum value\",\n defaultValue: 100,\n },\n {\n name: \"exclusiveMinimum\",\n label: \"Exclusive Minimum\",\n appliesTo: [\"number\", \"integer\"],\n schema: {\n type: \"number\",\n title: \"Exclusive Minimum Constraint\",\n description: \"The value must be strictly greater than this\",\n examples: [0, 1, 10],\n },\n description:\n \"Value must be strictly greater than (not equal to) this value\",\n defaultValue: 0,\n },\n {\n name: \"exclusiveMaximum\",\n label: \"Exclusive Maximum\",\n appliesTo: [\"number\", \"integer\"],\n schema: {\n type: \"number\",\n title: \"Exclusive Maximum Constraint\",\n description: \"The value must be strictly less than this\",\n examples: [10, 100, 1000],\n },\n description:\n \"Value must be strictly less than (not equal to) this value\",\n defaultValue: 100,\n },\n {\n name: \"multipleOf\",\n label: \"Multiple Of\",\n appliesTo: [\"number\", \"integer\"],\n schema: {\n type: \"number\",\n title: \"Multiple Of Constraint\",\n description: \"Value must be a multiple of this number\",\n examples: [2, 5, 10],\n exclusiveMinimum: 0,\n },\n description:\n \"Value must be divisible by this number (e.g., 5 for multiples of 5)\",\n defaultValue: 1,\n },\n ];\n },\n registerRenderers() {\n return {\n minimum: NumberMinimumRenderer,\n maximum: NumberMaximumRenderer,\n exclusiveMinimum: NumberExclusiveMinimumRenderer,\n exclusiveMaximum: NumberExclusiveMaximumRenderer,\n multipleOf: NumberMultipleOfRenderer,\n };\n },\n },\n};\n\nexport default plugin;\n"],"names":["NumberConstraintRenderer","constraintName","value","onConstraintChange","disabled","error","onRemoveConstraint","getConstraintDefinition","useConstraints","constraintDef","jsx","InputErrorWrapper","Label","jsxs","Input","e","cn","Button","X","NumberMinimumRenderer","NumberMaximumRenderer","NumberExclusiveMinimumRenderer","NumberExclusiveMaximumRenderer","NumberMultipleOfRenderer"],"mappings":";;;;;;;;AAaA,MAAMA,IAA2B,CAAC;AAAA,EAChC,gBAAAC;AAAA,EACA,OAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,oBAAAC;AACF,MAAgE;AACxD,QAAA,EAAE,yBAAAC,EAAwB,IAAIC,EAAe,GAC7CC,IAAgBF,EAAwBN,CAAc;AAE5D,SAAKQ,
|
|
1
|
+
{"version":3,"file":"index.es6.js","sources":["../src/packages/plugins/number.tsx"],"sourcesContent":["import { Input } from \"@/components/ui/input\";\nimport { InputErrorWrapper } from \"@/components/input-error\";\nimport { Label } from \"@/components/ui/label\";\nimport { cn } from \"@/lib/utils\";\nimport {\n BaseJSONSchemaPlugin,\n ConstraintRendererProps,\n useConstraints,\n} from \"@/packages/constraints/context\";\nimport { Button } from \"@/components/ui/button\";\nimport { X } from \"lucide-react\";\n\n// A generic number constraint renderer component to reduce code duplication\nconst NumberConstraintRenderer = ({\n constraintName,\n value,\n onConstraintChange,\n disabled,\n error,\n onRemoveConstraint,\n}: ConstraintRendererProps<number> & { disabled?: boolean }) => {\n const { getConstraintDefinition } = useConstraints();\n const constraintDef = getConstraintDefinition(constraintName);\n\n if (!constraintDef) {\n return null;\n }\n\n return (\n <InputErrorWrapper\n errorCode={error?.code}\n errorDescription={error?.message}\n showError={!!error}\n >\n <div>\n <Label className=\"mb-2\" htmlFor={constraintDef.name}>\n {constraintDef.name}\n </Label>\n <div className=\"flex items-center gap-2\">\n <Input\n id={constraintDef.name}\n type=\"number\"\n value={value}\n onChange={(e) => onConstraintChange(Number(e.target.value))}\n disabled={disabled}\n className={cn({ \"border-destructive\": error })}\n />\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n onClick={() => onRemoveConstraint()}\n >\n <X className=\"size-4\" />\n </Button>\n </div>\n {constraintDef.description && (\n <div className=\"mt-2 text-sm text-gray-500\">\n {constraintDef.description}\n </div>\n )}\n </div>\n </InputErrorWrapper>\n );\n};\n\n// Reuse the generic renderer for all number constraints\nexport const NumberMinimumRenderer = NumberConstraintRenderer;\nexport const NumberMaximumRenderer = NumberConstraintRenderer;\nexport const NumberExclusiveMinimumRenderer = NumberConstraintRenderer;\nexport const NumberExclusiveMaximumRenderer = NumberConstraintRenderer;\nexport const NumberMultipleOfRenderer = NumberConstraintRenderer;\n\nconst plugin: BaseJSONSchemaPlugin = {\n id: \"number-constraints\",\n hooks: {\n registerConstraints() {\n return [\n {\n name: \"minimum\",\n label: \"Minimum\",\n appliesTo: [\"number\", \"integer\"],\n schema: {\n type: \"number\",\n title: \"Minimum Constraint\",\n description: \"The minimum value for this constraint\",\n examples: [0, 1, 10],\n },\n description: \"Constrains a number or integer to a minimum value\",\n defaultValue: 0,\n },\n {\n name: \"maximum\",\n label: \"Maximum\",\n appliesTo: [\"number\", \"integer\"],\n schema: {\n type: \"number\",\n title: \"Maximum Constraint\",\n description: \"The maximum value for this constraint\",\n examples: [10, 100, 1000],\n },\n description: \"Constrains a number or integer to a maximum value\",\n defaultValue: 100,\n },\n {\n name: \"exclusiveMinimum\",\n label: \"Exclusive Minimum\",\n appliesTo: [\"number\", \"integer\"],\n schema: {\n type: \"number\",\n title: \"Exclusive Minimum Constraint\",\n description: \"The value must be strictly greater than this\",\n examples: [0, 1, 10],\n },\n description:\n \"Value must be strictly greater than (not equal to) this value\",\n defaultValue: 0,\n },\n {\n name: \"exclusiveMaximum\",\n label: \"Exclusive Maximum\",\n appliesTo: [\"number\", \"integer\"],\n schema: {\n type: \"number\",\n title: \"Exclusive Maximum Constraint\",\n description: \"The value must be strictly less than this\",\n examples: [10, 100, 1000],\n },\n description:\n \"Value must be strictly less than (not equal to) this value\",\n defaultValue: 100,\n },\n {\n name: \"multipleOf\",\n label: \"Multiple Of\",\n appliesTo: [\"number\", \"integer\"],\n schema: {\n type: \"number\",\n title: \"Multiple Of Constraint\",\n description: \"Value must be a multiple of this number\",\n examples: [2, 5, 10],\n exclusiveMinimum: 0,\n },\n description:\n \"Value must be divisible by this number (e.g., 5 for multiples of 5)\",\n defaultValue: 1,\n },\n ];\n },\n registerRenderers() {\n return {\n minimum: NumberMinimumRenderer,\n maximum: NumberMaximumRenderer,\n exclusiveMinimum: NumberExclusiveMinimumRenderer,\n exclusiveMaximum: NumberExclusiveMaximumRenderer,\n multipleOf: NumberMultipleOfRenderer,\n };\n },\n },\n};\n\nexport default plugin;\n"],"names":["NumberConstraintRenderer","constraintName","value","onConstraintChange","disabled","error","onRemoveConstraint","getConstraintDefinition","useConstraints","constraintDef","jsx","InputErrorWrapper","Label","jsxs","Input","e","cn","Button","X","NumberMinimumRenderer","NumberMaximumRenderer","NumberExclusiveMinimumRenderer","NumberExclusiveMaximumRenderer","NumberMultipleOfRenderer"],"mappings":";;;;;;;;AAaA,MAAMA,IAA2B,CAAC;AAAA,EAChC,gBAAAC;AAAA,EACA,OAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,oBAAAC;AACF,MAAgE;AACxD,QAAA,EAAE,yBAAAC,EAAwB,IAAIC,EAAe,GAC7CC,IAAgBF,EAAwBN,CAAc;AAE5D,SAAKQ,IAKH,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAWN,GAAO;AAAA,MAClB,kBAAkBA,GAAO;AAAA,MACzB,WAAW,CAAC,CAACA;AAAA,MAEb,4BAAC,OACC,EAAA,UAAA;AAAA,QAAA,gBAAAK,EAACE,KAAM,WAAU,QAAO,SAASH,EAAc,MAC5C,YAAc,KACjB,CAAA;AAAA,QACA,gBAAAI,EAAC,OAAI,EAAA,WAAU,2BACb,UAAA;AAAA,UAAA,gBAAAH;AAAA,YAACI;AAAA,YAAA;AAAA,cACC,IAAIL,EAAc;AAAA,cAClB,MAAK;AAAA,cACL,OAAAP;AAAA,cACA,UAAU,CAACa,MAAMZ,EAAmB,OAAOY,EAAE,OAAO,KAAK,CAAC;AAAA,cAC1D,UAAAX;AAAA,cACA,WAAWY,EAAG,EAAE,sBAAsBX,EAAO,CAAA;AAAA,YAAA;AAAA,UAC/C;AAAA,UACA,gBAAAK;AAAA,YAACO;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,SAAQ;AAAA,cACR,MAAK;AAAA,cACL,SAAS,MAAMX,EAAmB;AAAA,cAElC,UAAA,gBAAAI,EAACQ,GAAE,EAAA,WAAU,SAAS,CAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QACxB,GACF;AAAA,QACCT,EAAc,eACb,gBAAAC,EAAC,SAAI,WAAU,8BACZ,YAAc,YACjB,CAAA;AAAA,MAAA,EAEJ,CAAA;AAAA,IAAA;AAAA,EACF,IArCO;AAuCX,GAGaS,IAAwBnB,GACxBoB,IAAwBpB,GACxBqB,IAAiCrB,GACjCsB,IAAiCtB,GACjCuB,IAA2BvB;"}
|
package/dist/index.es60.js
CHANGED
|
@@ -1,8 +1,69 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import * as u from "react";
|
|
2
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
3
|
+
function $(t, c) {
|
|
4
|
+
const n = u.createContext(c), p = (r) => {
|
|
5
|
+
const { children: e, ...o } = r, s = u.useMemo(() => o, Object.values(o));
|
|
6
|
+
return /* @__PURE__ */ f(n.Provider, { value: s, children: e });
|
|
7
|
+
};
|
|
8
|
+
p.displayName = t + "Provider";
|
|
9
|
+
function i(r) {
|
|
10
|
+
const e = u.useContext(n);
|
|
11
|
+
if (e) return e;
|
|
12
|
+
if (c !== void 0) return c;
|
|
13
|
+
throw new Error(`\`${r}\` must be used within \`${t}\``);
|
|
14
|
+
}
|
|
15
|
+
return [p, i];
|
|
16
|
+
}
|
|
17
|
+
function w(t, c = []) {
|
|
18
|
+
let n = [];
|
|
19
|
+
function p(r, e) {
|
|
20
|
+
const o = u.createContext(e), s = n.length;
|
|
21
|
+
n = [...n, e];
|
|
22
|
+
const d = (x) => {
|
|
23
|
+
const { scope: m, children: v, ...a } = x, S = m?.[t]?.[s] || o, h = u.useMemo(() => a, Object.values(a));
|
|
24
|
+
return /* @__PURE__ */ f(S.Provider, { value: h, children: v });
|
|
25
|
+
};
|
|
26
|
+
d.displayName = r + "Provider";
|
|
27
|
+
function C(x, m) {
|
|
28
|
+
const v = m?.[t]?.[s] || o, a = u.useContext(v);
|
|
29
|
+
if (a) return a;
|
|
30
|
+
if (e !== void 0) return e;
|
|
31
|
+
throw new Error(`\`${x}\` must be used within \`${r}\``);
|
|
32
|
+
}
|
|
33
|
+
return [d, C];
|
|
34
|
+
}
|
|
35
|
+
const i = () => {
|
|
36
|
+
const r = n.map((e) => u.createContext(e));
|
|
37
|
+
return function(o) {
|
|
38
|
+
const s = o?.[t] || r;
|
|
39
|
+
return u.useMemo(
|
|
40
|
+
() => ({ [`__scope${t}`]: { ...o, [t]: s } }),
|
|
41
|
+
[o, s]
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
return i.scopeName = t, [p, P(i, ...c)];
|
|
46
|
+
}
|
|
47
|
+
function P(...t) {
|
|
48
|
+
const c = t[0];
|
|
49
|
+
if (t.length === 1) return c;
|
|
50
|
+
const n = () => {
|
|
51
|
+
const p = t.map((i) => ({
|
|
52
|
+
useScope: i(),
|
|
53
|
+
scopeName: i.scopeName
|
|
54
|
+
}));
|
|
55
|
+
return function(r) {
|
|
56
|
+
const e = p.reduce((o, { useScope: s, scopeName: d }) => {
|
|
57
|
+
const x = s(r)[`__scope${d}`];
|
|
58
|
+
return { ...o, ...x };
|
|
59
|
+
}, {});
|
|
60
|
+
return u.useMemo(() => ({ [`__scope${c.scopeName}`]: e }), [e]);
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
return n.scopeName = c.scopeName, n;
|
|
4
64
|
}
|
|
5
65
|
export {
|
|
6
|
-
|
|
66
|
+
$ as createContext,
|
|
67
|
+
w as createContextScope
|
|
7
68
|
};
|
|
8
69
|
//# sourceMappingURL=index.es60.js.map
|
package/dist/index.es60.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es60.js","sources":["../../../node_modules/.pnpm
|
|
1
|
+
{"version":3,"file":"index.es60.js","sources":["../../../node_modules/.pnpm/@radix-ui+react-context@1.1.1_@types+react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-context/dist/index.mjs"],"sourcesContent":["// packages/react/context/src/createContext.tsx\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction createContext2(rootComponentName, defaultContext) {\n const Context = React.createContext(defaultContext);\n const Provider = (props) => {\n const { children, ...context } = props;\n const value = React.useMemo(() => context, Object.values(context));\n return /* @__PURE__ */ jsx(Context.Provider, { value, children });\n };\n Provider.displayName = rootComponentName + \"Provider\";\n function useContext2(consumerName) {\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== void 0) return defaultContext;\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n return [Provider, useContext2];\n}\nfunction createContextScope(scopeName, createContextScopeDeps = []) {\n let defaultContexts = [];\n function createContext3(rootComponentName, defaultContext) {\n const BaseContext = React.createContext(defaultContext);\n const index = defaultContexts.length;\n defaultContexts = [...defaultContexts, defaultContext];\n const Provider = (props) => {\n const { scope, children, ...context } = props;\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n const value = React.useMemo(() => context, Object.values(context));\n return /* @__PURE__ */ jsx(Context.Provider, { value, children });\n };\n Provider.displayName = rootComponentName + \"Provider\";\n function useContext2(consumerName, scope) {\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== void 0) return defaultContext;\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n return [Provider, useContext2];\n }\n const createScope = () => {\n const scopeContexts = defaultContexts.map((defaultContext) => {\n return React.createContext(defaultContext);\n });\n return function useScope(scope) {\n const contexts = scope?.[scopeName] || scopeContexts;\n return React.useMemo(\n () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),\n [scope, contexts]\n );\n };\n };\n createScope.scopeName = scopeName;\n return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];\n}\nfunction composeContextScopes(...scopes) {\n const baseScope = scopes[0];\n if (scopes.length === 1) return baseScope;\n const createScope = () => {\n const scopeHooks = scopes.map((createScope2) => ({\n useScope: createScope2(),\n scopeName: createScope2.scopeName\n }));\n return function useComposedScopes(overrideScopes) {\n const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {\n const scopeProps = useScope(overrideScopes);\n const currentScope = scopeProps[`__scope${scopeName}`];\n return { ...nextScopes2, ...currentScope };\n }, {});\n return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);\n };\n };\n createScope.scopeName = baseScope.scopeName;\n return createScope;\n}\nexport {\n createContext2 as createContext,\n createContextScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["createContext2","rootComponentName","defaultContext","Context","React","Provider","props","children","context","value","jsx","useContext2","consumerName","createContextScope","scopeName","createContextScopeDeps","defaultContexts","createContext3","BaseContext","index","scope","createScope","scopeContexts","contexts","composeContextScopes","scopes","baseScope","scopeHooks","createScope2","overrideScopes","nextScopes","nextScopes2","useScope","currentScope"],"mappings":";;AAGA,SAASA,EAAeC,GAAmBC,GAAgB;AACzD,QAAMC,IAAUC,EAAM,cAAcF,CAAc,GAC5CG,IAAW,CAACC,MAAU;AAC1B,UAAM,EAAE,UAAAC,GAAU,GAAGC,EAAO,IAAKF,GAC3BG,IAAQL,EAAM,QAAQ,MAAMI,GAAS,OAAO,OAAOA,CAAO,CAAC;AACjE,WAAuB,gBAAAE,EAAIP,EAAQ,UAAU,EAAE,OAAAM,GAAO,UAAAF,EAAQ,CAAE;AAAA,EACjE;AACD,EAAAF,EAAS,cAAcJ,IAAoB;AAC3C,WAASU,EAAYC,GAAc;AACjC,UAAMJ,IAAUJ,EAAM,WAAWD,CAAO;AACxC,QAAIK,EAAS,QAAOA;AACpB,QAAIN,MAAmB,OAAQ,QAAOA;AACtC,UAAM,IAAI,MAAM,KAAKU,CAAY,4BAA4BX,CAAiB,IAAI;AAAA,EACtF;AACE,SAAO,CAACI,GAAUM,CAAW;AAC/B;AACA,SAASE,EAAmBC,GAAWC,IAAyB,IAAI;AAClE,MAAIC,IAAkB,CAAE;AACxB,WAASC,EAAehB,GAAmBC,GAAgB;AACzD,UAAMgB,IAAcd,EAAM,cAAcF,CAAc,GAChDiB,IAAQH,EAAgB;AAC9B,IAAAA,IAAkB,CAAC,GAAGA,GAAiBd,CAAc;AACrD,UAAMG,IAAW,CAACC,MAAU;AAC1B,YAAM,EAAE,OAAAc,GAAO,UAAAb,GAAU,GAAGC,EAAS,IAAGF,GAClCH,IAAUiB,IAAQN,CAAS,IAAIK,CAAK,KAAKD,GACzCT,IAAQL,EAAM,QAAQ,MAAMI,GAAS,OAAO,OAAOA,CAAO,CAAC;AACjE,aAAuB,gBAAAE,EAAIP,EAAQ,UAAU,EAAE,OAAAM,GAAO,UAAAF,EAAQ,CAAE;AAAA,IACjE;AACD,IAAAF,EAAS,cAAcJ,IAAoB;AAC3C,aAASU,EAAYC,GAAcQ,GAAO;AACxC,YAAMjB,IAAUiB,IAAQN,CAAS,IAAIK,CAAK,KAAKD,GACzCV,IAAUJ,EAAM,WAAWD,CAAO;AACxC,UAAIK,EAAS,QAAOA;AACpB,UAAIN,MAAmB,OAAQ,QAAOA;AACtC,YAAM,IAAI,MAAM,KAAKU,CAAY,4BAA4BX,CAAiB,IAAI;AAAA,IACxF;AACI,WAAO,CAACI,GAAUM,CAAW;AAAA,EACjC;AACE,QAAMU,IAAc,MAAM;AACxB,UAAMC,IAAgBN,EAAgB,IAAI,CAACd,MAClCE,EAAM,cAAcF,CAAc,CAC1C;AACD,WAAO,SAAkBkB,GAAO;AAC9B,YAAMG,IAAWH,IAAQN,CAAS,KAAKQ;AACvC,aAAOlB,EAAM;AAAA,QACX,OAAO,EAAE,CAAC,UAAUU,CAAS,EAAE,GAAG,EAAE,GAAGM,GAAO,CAACN,CAAS,GAAGS,EAAQ;QACnE,CAACH,GAAOG,CAAQ;AAAA,MACjB;AAAA,IACF;AAAA,EACF;AACD,SAAAF,EAAY,YAAYP,GACjB,CAACG,GAAgBO,EAAqBH,GAAa,GAAGN,CAAsB,CAAC;AACtF;AACA,SAASS,KAAwBC,GAAQ;AACvC,QAAMC,IAAYD,EAAO,CAAC;AAC1B,MAAIA,EAAO,WAAW,EAAG,QAAOC;AAChC,QAAML,IAAc,MAAM;AACxB,UAAMM,IAAaF,EAAO,IAAI,CAACG,OAAkB;AAAA,MAC/C,UAAUA,EAAc;AAAA,MACxB,WAAWA,EAAa;AAAA,IAC9B,EAAM;AACF,WAAO,SAA2BC,GAAgB;AAChD,YAAMC,IAAaH,EAAW,OAAO,CAACI,GAAa,EAAE,UAAAC,GAAU,WAAAlB,QAAgB;AAE7E,cAAMmB,IADaD,EAASH,CAAc,EACV,UAAUf,CAAS,EAAE;AACrD,eAAO,EAAE,GAAGiB,GAAa,GAAGE,EAAc;AAAA,MAC3C,GAAE,EAAE;AACL,aAAO7B,EAAM,QAAQ,OAAO,EAAE,CAAC,UAAUsB,EAAU,SAAS,EAAE,GAAGI,EAAU,IAAK,CAACA,CAAU,CAAC;AAAA,IAC7F;AAAA,EACF;AACD,SAAAT,EAAY,YAAYK,EAAU,WAC3BL;AACT;","x_google_ignoreList":[0]}
|
package/dist/index.es61.js
CHANGED
|
@@ -1,258 +1,11 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import { DismissableLayer as q } from "./index.es73.js";
|
|
8
|
-
import { FocusScope as K } from "./index.es75.js";
|
|
9
|
-
import { Portal as U } from "./index.es78.js";
|
|
10
|
-
import { Presence as R } from "./index.es84.js";
|
|
11
|
-
import { Primitive as g } from "./index.es69.js";
|
|
12
|
-
import { useFocusGuards as Y } from "./index.es74.js";
|
|
13
|
-
import Z from "./index.es83.js";
|
|
14
|
-
import { hideOthers as z } from "./index.es82.js";
|
|
15
|
-
import { Slot as J } from "./index.es38.js";
|
|
16
|
-
import { j as i } from "./index.es9.js";
|
|
17
|
-
var _ = "Dialog", [P, _e] = B(_), [Q, u] = P(_), y = (e) => {
|
|
18
|
-
const {
|
|
19
|
-
__scopeDialog: t,
|
|
20
|
-
children: n,
|
|
21
|
-
open: a,
|
|
22
|
-
defaultOpen: r,
|
|
23
|
-
onOpenChange: o,
|
|
24
|
-
modal: l = !0
|
|
25
|
-
} = e, c = s.useRef(null), f = s.useRef(null), [D = !1, v] = V({
|
|
26
|
-
prop: a,
|
|
27
|
-
defaultProp: r,
|
|
28
|
-
onChange: o
|
|
29
|
-
});
|
|
30
|
-
return /* @__PURE__ */ i.jsx(
|
|
31
|
-
Q,
|
|
32
|
-
{
|
|
33
|
-
scope: t,
|
|
34
|
-
triggerRef: c,
|
|
35
|
-
contentRef: f,
|
|
36
|
-
contentId: x(),
|
|
37
|
-
titleId: x(),
|
|
38
|
-
descriptionId: x(),
|
|
39
|
-
open: D,
|
|
40
|
-
onOpenChange: v,
|
|
41
|
-
onOpenToggle: s.useCallback(() => v(($) => !$), [v]),
|
|
42
|
-
modal: l,
|
|
43
|
-
children: n
|
|
44
|
-
}
|
|
45
|
-
);
|
|
46
|
-
};
|
|
47
|
-
y.displayName = _;
|
|
48
|
-
var I = "DialogTrigger", O = s.forwardRef(
|
|
49
|
-
(e, t) => {
|
|
50
|
-
const { __scopeDialog: n, ...a } = e, r = u(I, n), o = C(t, r.triggerRef);
|
|
51
|
-
return /* @__PURE__ */ i.jsx(
|
|
52
|
-
g.button,
|
|
53
|
-
{
|
|
54
|
-
type: "button",
|
|
55
|
-
"aria-haspopup": "dialog",
|
|
56
|
-
"aria-expanded": r.open,
|
|
57
|
-
"aria-controls": r.contentId,
|
|
58
|
-
"data-state": N(r.open),
|
|
59
|
-
...a,
|
|
60
|
-
ref: o,
|
|
61
|
-
onClick: p(e.onClick, r.onOpenToggle)
|
|
62
|
-
}
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
);
|
|
66
|
-
O.displayName = I;
|
|
67
|
-
var h = "DialogPortal", [X, A] = P(h, {
|
|
68
|
-
forceMount: void 0
|
|
69
|
-
}), j = (e) => {
|
|
70
|
-
const { __scopeDialog: t, forceMount: n, children: a, container: r } = e, o = u(h, t);
|
|
71
|
-
return /* @__PURE__ */ i.jsx(X, { scope: t, forceMount: n, children: s.Children.map(a, (l) => /* @__PURE__ */ i.jsx(R, { present: n || o.open, children: /* @__PURE__ */ i.jsx(U, { asChild: !0, container: r, children: l }) })) });
|
|
72
|
-
};
|
|
73
|
-
j.displayName = h;
|
|
74
|
-
var m = "DialogOverlay", T = s.forwardRef(
|
|
75
|
-
(e, t) => {
|
|
76
|
-
const n = A(m, e.__scopeDialog), { forceMount: a = n.forceMount, ...r } = e, o = u(m, e.__scopeDialog);
|
|
77
|
-
return o.modal ? /* @__PURE__ */ i.jsx(R, { present: a || o.open, children: /* @__PURE__ */ i.jsx(ee, { ...r, ref: t }) }) : null;
|
|
78
|
-
}
|
|
79
|
-
);
|
|
80
|
-
T.displayName = m;
|
|
81
|
-
var ee = s.forwardRef(
|
|
82
|
-
(e, t) => {
|
|
83
|
-
const { __scopeDialog: n, ...a } = e, r = u(m, n);
|
|
84
|
-
return (
|
|
85
|
-
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
86
|
-
// ie. when `Overlay` and `Content` are siblings
|
|
87
|
-
/* @__PURE__ */ i.jsx(Z, { as: J, allowPinchZoom: !0, shards: [r.contentRef], children: /* @__PURE__ */ i.jsx(
|
|
88
|
-
g.div,
|
|
89
|
-
{
|
|
90
|
-
"data-state": N(r.open),
|
|
91
|
-
...a,
|
|
92
|
-
ref: t,
|
|
93
|
-
style: { pointerEvents: "auto", ...a.style }
|
|
94
|
-
}
|
|
95
|
-
) })
|
|
96
|
-
);
|
|
97
|
-
}
|
|
98
|
-
), d = "DialogContent", b = s.forwardRef(
|
|
99
|
-
(e, t) => {
|
|
100
|
-
const n = A(d, e.__scopeDialog), { forceMount: a = n.forceMount, ...r } = e, o = u(d, e.__scopeDialog);
|
|
101
|
-
return /* @__PURE__ */ i.jsx(R, { present: a || o.open, children: o.modal ? /* @__PURE__ */ i.jsx(oe, { ...r, ref: t }) : /* @__PURE__ */ i.jsx(te, { ...r, ref: t }) });
|
|
102
|
-
}
|
|
103
|
-
);
|
|
104
|
-
b.displayName = d;
|
|
105
|
-
var oe = s.forwardRef(
|
|
106
|
-
(e, t) => {
|
|
107
|
-
const n = u(d, e.__scopeDialog), a = s.useRef(null), r = C(t, n.contentRef, a);
|
|
108
|
-
return s.useEffect(() => {
|
|
109
|
-
const o = a.current;
|
|
110
|
-
if (o) return z(o);
|
|
111
|
-
}, []), /* @__PURE__ */ i.jsx(
|
|
112
|
-
M,
|
|
113
|
-
{
|
|
114
|
-
...e,
|
|
115
|
-
ref: r,
|
|
116
|
-
trapFocus: n.open,
|
|
117
|
-
disableOutsidePointerEvents: !0,
|
|
118
|
-
onCloseAutoFocus: p(e.onCloseAutoFocus, (o) => {
|
|
119
|
-
o.preventDefault(), n.triggerRef.current?.focus();
|
|
120
|
-
}),
|
|
121
|
-
onPointerDownOutside: p(e.onPointerDownOutside, (o) => {
|
|
122
|
-
const l = o.detail.originalEvent, c = l.button === 0 && l.ctrlKey === !0;
|
|
123
|
-
(l.button === 2 || c) && o.preventDefault();
|
|
124
|
-
}),
|
|
125
|
-
onFocusOutside: p(
|
|
126
|
-
e.onFocusOutside,
|
|
127
|
-
(o) => o.preventDefault()
|
|
128
|
-
)
|
|
129
|
-
}
|
|
130
|
-
);
|
|
131
|
-
}
|
|
132
|
-
), te = s.forwardRef(
|
|
133
|
-
(e, t) => {
|
|
134
|
-
const n = u(d, e.__scopeDialog), a = s.useRef(!1), r = s.useRef(!1);
|
|
135
|
-
return /* @__PURE__ */ i.jsx(
|
|
136
|
-
M,
|
|
137
|
-
{
|
|
138
|
-
...e,
|
|
139
|
-
ref: t,
|
|
140
|
-
trapFocus: !1,
|
|
141
|
-
disableOutsidePointerEvents: !1,
|
|
142
|
-
onCloseAutoFocus: (o) => {
|
|
143
|
-
e.onCloseAutoFocus?.(o), o.defaultPrevented || (a.current || n.triggerRef.current?.focus(), o.preventDefault()), a.current = !1, r.current = !1;
|
|
144
|
-
},
|
|
145
|
-
onInteractOutside: (o) => {
|
|
146
|
-
e.onInteractOutside?.(o), o.defaultPrevented || (a.current = !0, o.detail.originalEvent.type === "pointerdown" && (r.current = !0));
|
|
147
|
-
const l = o.target;
|
|
148
|
-
n.triggerRef.current?.contains(l) && o.preventDefault(), o.detail.originalEvent.type === "focusin" && r.current && o.preventDefault();
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
);
|
|
152
|
-
}
|
|
153
|
-
), M = s.forwardRef(
|
|
154
|
-
(e, t) => {
|
|
155
|
-
const { __scopeDialog: n, trapFocus: a, onOpenAutoFocus: r, onCloseAutoFocus: o, ...l } = e, c = u(d, n), f = s.useRef(null), D = C(t, f);
|
|
156
|
-
return Y(), /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
157
|
-
/* @__PURE__ */ i.jsx(
|
|
158
|
-
K,
|
|
159
|
-
{
|
|
160
|
-
asChild: !0,
|
|
161
|
-
loop: !0,
|
|
162
|
-
trapped: a,
|
|
163
|
-
onMountAutoFocus: r,
|
|
164
|
-
onUnmountAutoFocus: o,
|
|
165
|
-
children: /* @__PURE__ */ i.jsx(
|
|
166
|
-
q,
|
|
167
|
-
{
|
|
168
|
-
role: "dialog",
|
|
169
|
-
id: c.contentId,
|
|
170
|
-
"aria-describedby": c.descriptionId,
|
|
171
|
-
"aria-labelledby": c.titleId,
|
|
172
|
-
"data-state": N(c.open),
|
|
173
|
-
...l,
|
|
174
|
-
ref: D,
|
|
175
|
-
onDismiss: () => c.onOpenChange(!1)
|
|
176
|
-
}
|
|
177
|
-
)
|
|
178
|
-
}
|
|
179
|
-
),
|
|
180
|
-
/* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
181
|
-
/* @__PURE__ */ i.jsx(re, { titleId: c.titleId }),
|
|
182
|
-
/* @__PURE__ */ i.jsx(ae, { contentRef: f, descriptionId: c.descriptionId })
|
|
183
|
-
] })
|
|
184
|
-
] });
|
|
185
|
-
}
|
|
186
|
-
), E = "DialogTitle", w = s.forwardRef(
|
|
187
|
-
(e, t) => {
|
|
188
|
-
const { __scopeDialog: n, ...a } = e, r = u(E, n);
|
|
189
|
-
return /* @__PURE__ */ i.jsx(g.h2, { id: r.titleId, ...a, ref: t });
|
|
190
|
-
}
|
|
191
|
-
);
|
|
192
|
-
w.displayName = E;
|
|
193
|
-
var F = "DialogDescription", S = s.forwardRef(
|
|
194
|
-
(e, t) => {
|
|
195
|
-
const { __scopeDialog: n, ...a } = e, r = u(F, n);
|
|
196
|
-
return /* @__PURE__ */ i.jsx(g.p, { id: r.descriptionId, ...a, ref: t });
|
|
197
|
-
}
|
|
198
|
-
);
|
|
199
|
-
S.displayName = F;
|
|
200
|
-
var W = "DialogClose", k = s.forwardRef(
|
|
201
|
-
(e, t) => {
|
|
202
|
-
const { __scopeDialog: n, ...a } = e, r = u(W, n);
|
|
203
|
-
return /* @__PURE__ */ i.jsx(
|
|
204
|
-
g.button,
|
|
205
|
-
{
|
|
206
|
-
type: "button",
|
|
207
|
-
...a,
|
|
208
|
-
ref: t,
|
|
209
|
-
onClick: p(e.onClick, () => r.onOpenChange(!1))
|
|
210
|
-
}
|
|
211
|
-
);
|
|
212
|
-
}
|
|
213
|
-
);
|
|
214
|
-
k.displayName = W;
|
|
215
|
-
function N(e) {
|
|
216
|
-
return e ? "open" : "closed";
|
|
1
|
+
import * as t from "react";
|
|
2
|
+
import "react/jsx-runtime";
|
|
3
|
+
var r = t.createContext(void 0);
|
|
4
|
+
function n(o) {
|
|
5
|
+
const e = t.useContext(r);
|
|
6
|
+
return o || e || "ltr";
|
|
217
7
|
}
|
|
218
|
-
var G = "DialogTitleWarning", [he, L] = H(G, {
|
|
219
|
-
contentName: d,
|
|
220
|
-
titleName: E,
|
|
221
|
-
docsSlug: "dialog"
|
|
222
|
-
}), re = ({ titleId: e }) => {
|
|
223
|
-
const t = L(G), n = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
224
|
-
|
|
225
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
226
|
-
|
|
227
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;
|
|
228
|
-
return s.useEffect(() => {
|
|
229
|
-
e && (document.getElementById(e) || console.error(n));
|
|
230
|
-
}, [n, e]), null;
|
|
231
|
-
}, ne = "DialogDescriptionWarning", ae = ({ contentRef: e, descriptionId: t }) => {
|
|
232
|
-
const a = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${L(ne).contentName}}.`;
|
|
233
|
-
return s.useEffect(() => {
|
|
234
|
-
const r = e.current?.getAttribute("aria-describedby");
|
|
235
|
-
t && r && (document.getElementById(t) || console.warn(a));
|
|
236
|
-
}, [a, e, t]), null;
|
|
237
|
-
}, Ee = y, Ne = O, Pe = j, ye = T, Ie = b, Oe = w, Ae = S, je = k;
|
|
238
8
|
export {
|
|
239
|
-
|
|
240
|
-
Ie as Content,
|
|
241
|
-
Ae as Description,
|
|
242
|
-
y as Dialog,
|
|
243
|
-
k as DialogClose,
|
|
244
|
-
b as DialogContent,
|
|
245
|
-
S as DialogDescription,
|
|
246
|
-
T as DialogOverlay,
|
|
247
|
-
j as DialogPortal,
|
|
248
|
-
w as DialogTitle,
|
|
249
|
-
O as DialogTrigger,
|
|
250
|
-
ye as Overlay,
|
|
251
|
-
Pe as Portal,
|
|
252
|
-
Ee as Root,
|
|
253
|
-
Oe as Title,
|
|
254
|
-
Ne as Trigger,
|
|
255
|
-
he as WarningProvider,
|
|
256
|
-
_e as createDialogScope
|
|
9
|
+
n as useDirection
|
|
257
10
|
};
|
|
258
11
|
//# sourceMappingURL=index.es61.js.map
|