@rpcbase/ui 0.183.0 → 0.185.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/dist/index10.js +25 -24
- package/dist/index10.js.map +1 -1
- package/dist/index100.js +107 -5
- package/dist/index100.js.map +1 -1
- package/dist/index101.js +262 -4
- package/dist/index101.js.map +1 -1
- package/dist/index102.js +9 -4
- package/dist/index102.js.map +1 -1
- package/dist/index103.js +42 -6
- package/dist/index103.js.map +1 -1
- package/dist/index104.js +4 -145
- package/dist/index104.js.map +1 -1
- package/dist/index105.js +45 -38
- package/dist/index105.js.map +1 -1
- package/dist/index106.js +52 -5
- package/dist/index106.js.map +1 -1
- package/dist/index107.js +4 -7
- package/dist/index107.js.map +1 -1
- package/dist/index108.js +3 -12
- package/dist/index108.js.map +1 -1
- package/dist/index109.js +15 -13
- package/dist/index109.js.map +1 -1
- package/dist/index11.js +34 -66
- package/dist/index11.js.map +1 -1
- package/dist/index110.js +5 -7
- package/dist/index110.js.map +1 -1
- package/dist/index111.js +7 -31
- package/dist/index111.js.map +1 -1
- package/dist/index112.js +16 -10
- package/dist/index112.js.map +1 -1
- package/dist/index113.js +4 -10
- package/dist/index113.js.map +1 -1
- package/dist/index114.js +4 -8
- package/dist/index114.js.map +1 -1
- package/dist/index115.js +5 -13
- package/dist/index115.js.map +1 -1
- package/dist/index116.js +5 -101
- package/dist/index116.js.map +1 -1
- package/dist/index117.js +5 -20
- package/dist/index117.js.map +1 -1
- package/dist/index118.js +4 -53
- package/dist/index118.js.map +1 -1
- package/dist/index119.js +6 -72
- package/dist/index119.js.map +1 -1
- package/dist/index12.js +556 -525
- package/dist/index12.js.map +1 -1
- package/dist/index120.js +24 -9
- package/dist/index120.js.map +1 -1
- package/dist/index121.js +6 -20
- package/dist/index121.js.map +1 -1
- package/dist/index122.js +4 -16
- package/dist/index122.js.map +1 -1
- package/dist/index123.js +6 -23
- package/dist/index123.js.map +1 -1
- package/dist/index124.js +5 -6
- package/dist/index124.js.map +1 -1
- package/dist/index125.js +4 -5
- package/dist/index125.js.map +1 -1
- package/dist/index126.js +5 -23
- package/dist/index126.js.map +1 -1
- package/dist/index127.js +5 -35
- package/dist/index127.js.map +1 -1
- package/dist/index128.js +9 -16
- package/dist/index128.js.map +1 -1
- package/dist/index129.js +5 -6
- package/dist/index129.js.map +1 -1
- package/dist/index13.js +128 -118
- package/dist/index13.js.map +1 -1
- package/dist/index130.js +4 -4
- package/dist/index130.js.map +1 -1
- package/dist/index131.js +4 -4
- package/dist/index131.js.map +1 -1
- package/dist/index132.js +6 -4
- package/dist/index132.js.map +1 -1
- package/dist/index133.js +145 -4
- package/dist/index133.js.map +1 -1
- package/dist/index134.js +39 -3
- package/dist/index134.js.map +1 -1
- package/dist/index135.js +4 -6
- package/dist/index135.js.map +1 -1
- package/dist/index136.js +8 -24
- package/dist/index136.js.map +1 -1
- package/dist/index137.js +13 -7
- package/dist/index137.js.map +1 -1
- package/dist/index138.js +13 -6
- package/dist/index138.js.map +1 -1
- package/dist/index139.js +7 -5
- package/dist/index139.js.map +1 -1
- package/dist/index14.js +74 -74
- package/dist/index14.js.map +1 -1
- package/dist/index140.js +31 -3
- package/dist/index140.js.map +1 -1
- package/dist/index141.js +10 -3
- package/dist/index141.js.map +1 -1
- package/dist/index142.js +10 -4
- package/dist/index142.js.map +1 -1
- package/dist/index143.js +8 -3
- package/dist/index143.js.map +1 -1
- package/dist/index144.js +13 -4
- package/dist/index144.js.map +1 -1
- package/dist/index145.js +101 -3
- package/dist/index145.js.map +1 -1
- package/dist/index146.js +20 -4
- package/dist/index146.js.map +1 -1
- package/dist/index147.js +53 -3
- package/dist/index147.js.map +1 -1
- package/dist/index148.js +71 -45
- package/dist/index148.js.map +1 -1
- package/dist/index149.js +9 -205
- package/dist/index149.js.map +1 -1
- package/dist/index15.js +763 -624
- package/dist/index15.js.map +1 -1
- package/dist/index150.js +20 -21
- package/dist/index150.js.map +1 -1
- package/dist/index151.js +16 -24
- package/dist/index151.js.map +1 -1
- package/dist/index152.js +23 -399
- package/dist/index152.js.map +1 -1
- package/dist/index153.js +6 -46
- package/dist/index153.js.map +1 -1
- package/dist/index154.js +5 -605
- package/dist/index154.js.map +1 -1
- package/dist/index155.js +23 -5
- package/dist/index155.js.map +1 -1
- package/dist/index156.js +34 -68
- package/dist/index156.js.map +1 -1
- package/dist/index157.js +16 -2
- package/dist/index157.js.map +1 -1
- package/dist/index158.js +6 -363
- package/dist/index158.js.map +1 -1
- package/dist/index159.js +4 -261
- package/dist/index159.js.map +1 -1
- package/dist/index16.js +20 -22
- package/dist/index16.js.map +1 -1
- package/dist/index160.js +4 -60
- package/dist/index160.js.map +1 -1
- package/dist/index161.js +4 -46
- package/dist/index161.js.map +1 -1
- package/dist/index162.js +4 -169
- package/dist/index162.js.map +1 -1
- package/dist/index163.js +3 -109
- package/dist/index163.js.map +1 -1
- package/dist/index164.js +6 -24
- package/dist/index164.js.map +1 -1
- package/dist/index165.js +24 -8
- package/dist/index165.js.map +1 -1
- package/dist/index166.js +7 -4
- package/dist/index166.js.map +1 -1
- package/dist/index167.js +6 -5
- package/dist/index167.js.map +1 -1
- package/dist/index168.js +5 -4
- package/dist/index168.js.map +1 -1
- package/dist/index169.js +3 -466
- package/dist/index169.js.map +1 -1
- package/dist/index17.js +17 -17
- package/dist/index17.js.map +1 -1
- package/dist/index170.js +3 -185
- package/dist/index170.js.map +1 -1
- package/dist/index171.js +4 -107
- package/dist/index171.js.map +1 -1
- package/dist/index172.js +3 -262
- package/dist/index172.js.map +1 -1
- package/dist/index173.js +4 -9
- package/dist/index173.js.map +1 -1
- package/dist/index174.js +3 -42
- package/dist/index174.js.map +1 -1
- package/dist/index175.js +3 -4
- package/dist/index175.js.map +1 -1
- package/dist/index176.js +3 -58
- package/dist/index176.js.map +1 -1
- package/dist/index177.js +46 -8
- package/dist/index177.js.map +1 -1
- package/dist/index178.js +201 -62
- package/dist/index178.js.map +1 -1
- package/dist/index179.js +22 -20
- package/dist/index179.js.map +1 -1
- package/dist/index18.js +411 -341
- package/dist/index18.js.map +1 -1
- package/dist/index180.js +24 -16
- package/dist/index180.js.map +1 -1
- package/dist/index181.js +398 -4
- package/dist/index181.js.map +1 -1
- package/dist/index182.js +604 -4
- package/dist/index182.js.map +1 -1
- package/dist/index183.js +13 -6
- package/dist/index183.js.map +1 -1
- package/dist/index184.js +154 -4
- package/dist/index184.js.map +1 -1
- package/dist/index185.js +30 -7
- package/dist/index185.js.map +1 -1
- package/dist/index186.js +9 -17
- package/dist/index186.js.map +1 -1
- package/dist/index187.js +47 -5
- package/dist/index187.js.map +1 -1
- package/dist/index188.js +11 -5
- package/dist/index188.js.map +1 -1
- package/dist/index189.js +44 -13
- package/dist/index189.js.map +1 -1
- package/dist/index19.js +626 -660
- package/dist/index19.js.map +1 -1
- package/dist/index190.js +95 -10
- package/dist/index190.js.map +1 -1
- package/dist/index191.js +86 -14
- package/dist/index191.js.map +1 -1
- package/dist/index192.js +105 -14
- package/dist/index192.js.map +1 -1
- package/dist/index193.js +52 -5
- package/dist/index193.js.map +1 -1
- package/dist/index194.js +11 -6
- package/dist/index194.js.map +1 -1
- package/dist/index195.js +37 -7
- package/dist/index195.js.map +1 -1
- package/dist/index196.js +8 -6
- package/dist/index196.js.map +1 -1
- package/dist/index197.js +116 -9
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +17 -5
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +15 -5
- package/dist/index199.js.map +1 -1
- package/dist/index20.js +442 -634
- package/dist/index20.js.map +1 -1
- package/dist/index200.js +3 -9
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +36 -5
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +20 -5
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +9 -4
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +8 -11
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +19 -10
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +28 -10
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +16 -11
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +58 -11
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +8 -10
- package/dist/index209.js.map +1 -1
- package/dist/index21.js +254 -200
- package/dist/index21.js.map +1 -1
- package/dist/index210.js +66 -7
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +19 -6
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +16 -5
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +5 -6
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +5 -7
- package/dist/index214.js.map +1 -1
- package/dist/index215.js +6 -6
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +4 -55
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +7 -16
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +17 -7
- package/dist/index218.js.map +1 -1
- package/dist/index219.js +5 -10
- package/dist/index219.js.map +1 -1
- package/dist/index22.js +1 -1
- package/dist/index22.js.map +1 -1
- package/dist/index220.js +5 -10
- package/dist/index220.js.map +1 -1
- package/dist/index221.js +13 -21
- package/dist/index221.js.map +1 -1
- package/dist/index222.js +10 -10
- package/dist/index222.js.map +1 -1
- package/dist/index223.js +14 -9
- package/dist/index223.js.map +1 -1
- package/dist/index224.js +14 -9
- package/dist/index224.js.map +1 -1
- package/dist/index225.js +5 -4
- package/dist/index225.js.map +1 -1
- package/dist/index226.js +6 -5
- package/dist/index226.js.map +1 -1
- package/dist/index227.js +7 -16
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +6 -9
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +9 -18
- package/dist/index229.js.map +1 -1
- package/dist/index23.js +27 -34
- package/dist/index23.js.map +1 -1
- package/dist/index230.js +5 -15
- package/dist/index230.js.map +1 -1
- package/dist/index231.js +5 -12
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +9 -29
- package/dist/index232.js.map +1 -1
- package/dist/index233.js +5 -12
- package/dist/index233.js.map +1 -1
- package/dist/index234.js +5 -25
- package/dist/index234.js.map +1 -1
- package/dist/index235.js +4 -5
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +11 -24
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +10 -28
- package/dist/index237.js.map +1 -1
- package/dist/index238.js +11 -5
- package/dist/index238.js.map +1 -1
- package/dist/index239.js +11 -67
- package/dist/index239.js.map +1 -1
- package/dist/index24.js +219 -222
- package/dist/index24.js.map +1 -1
- package/dist/index240.js +11 -180
- package/dist/index240.js.map +1 -1
- package/dist/index241.js +10 -46
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +7 -13
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +6 -154
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +5 -30
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +6 -9
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +7 -47
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +6 -11
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +54 -43
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +13 -92
- package/dist/index249.js.map +1 -1
- package/dist/index25.js +46 -50
- package/dist/index25.js.map +1 -1
- package/dist/index250.js +7 -86
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +8 -103
- package/dist/index251.js.map +1 -1
- package/dist/index252.js +9 -51
- package/dist/index252.js.map +1 -1
- package/dist/index253.js +21 -11
- package/dist/index253.js.map +1 -1
- package/dist/index254.js +10 -37
- package/dist/index254.js.map +1 -1
- package/dist/index255.js +8 -7
- package/dist/index255.js.map +1 -1
- package/dist/index256.js +9 -116
- package/dist/index256.js.map +1 -1
- package/dist/index257.js +4 -17
- package/dist/index257.js.map +1 -1
- package/dist/index258.js +5 -15
- package/dist/index258.js.map +1 -1
- package/dist/index259.js +16 -3
- package/dist/index259.js.map +1 -1
- package/dist/index260.js +9 -36
- package/dist/index260.js.map +1 -1
- package/dist/index261.js +18 -20
- package/dist/index261.js.map +1 -1
- package/dist/index262.js +15 -9
- package/dist/index262.js.map +1 -1
- package/dist/index263.js +12 -8
- package/dist/index263.js.map +1 -1
- package/dist/index264.js +28 -18
- package/dist/index264.js.map +1 -1
- package/dist/index265.js +11 -27
- package/dist/index265.js.map +1 -1
- package/dist/index266.js +23 -14
- package/dist/index266.js.map +1 -1
- package/dist/index267.js +5 -4
- package/dist/index267.js.map +1 -1
- package/dist/index268.js +24 -18
- package/dist/index268.js.map +1 -1
- package/dist/index269.js +29 -13
- package/dist/index269.js.map +1 -1
- package/dist/index270.js +5 -5
- package/dist/index270.js.map +1 -1
- package/dist/index271.js +68 -3
- package/dist/index271.js.map +1 -1
- package/dist/index272.js +179 -22
- package/dist/index272.js.map +1 -1
- package/dist/index273.js +43 -109
- package/dist/index273.js.map +1 -1
- package/dist/index274.js +20 -15
- package/dist/index274.js.map +1 -1
- package/dist/index275.js +4 -524
- package/dist/index275.js.map +1 -1
- package/dist/index276.js +18 -127
- package/dist/index276.js.map +1 -1
- package/dist/index277.js +12 -133
- package/dist/index277.js.map +1 -1
- package/dist/index278.js +5 -21
- package/dist/index278.js.map +1 -1
- package/dist/index279.js +3 -6
- package/dist/index279.js.map +1 -1
- package/dist/index28.js +3 -37
- package/dist/index28.js.map +1 -1
- package/dist/index280.js +23 -5
- package/dist/index280.js.map +1 -1
- package/dist/index281.js +113 -4
- package/dist/index281.js.map +1 -1
- package/dist/index282.js +15 -15
- package/dist/index282.js.map +1 -1
- package/dist/index283.js +524 -8
- package/dist/index283.js.map +1 -1
- package/dist/index284.js +127 -5
- package/dist/index284.js.map +1 -1
- package/dist/index285.js +133 -4
- package/dist/index285.js.map +1 -1
- package/dist/index286.js +5 -545
- package/dist/index286.js.map +1 -1
- package/dist/index287.js +6 -47
- package/dist/index287.js.map +1 -1
- package/dist/index288.js +4 -18
- package/dist/index288.js.map +1 -1
- package/dist/index289.js +15 -6
- package/dist/index289.js.map +1 -1
- package/dist/index29.js +37 -3
- package/dist/index29.js.map +1 -1
- package/dist/index290.js +8 -8
- package/dist/index290.js.map +1 -1
- package/dist/index291.js +5 -7
- package/dist/index291.js.map +1 -1
- package/dist/index292.js +4 -8
- package/dist/index292.js.map +1 -1
- package/dist/index293.js +545 -12
- package/dist/index293.js.map +1 -1
- package/dist/index294.js +47 -10
- package/dist/index294.js.map +1 -1
- package/dist/index295.js +17 -13
- package/dist/index295.js.map +1 -1
- package/dist/index296.js +7 -69
- package/dist/index296.js.map +1 -1
- package/dist/index297.js +9 -9
- package/dist/index297.js.map +1 -1
- package/dist/index298.js +8 -14
- package/dist/index298.js.map +1 -1
- package/dist/index299.js +9 -66
- package/dist/index299.js.map +1 -1
- package/dist/index3.js.map +1 -1
- package/dist/index30.js +3 -125
- package/dist/index30.js.map +1 -1
- package/dist/index300.js +12 -64
- package/dist/index300.js.map +1 -1
- package/dist/index301.js +9 -4
- package/dist/index301.js.map +1 -1
- package/dist/index302.js +14 -56
- package/dist/index302.js.map +1 -1
- package/dist/index303.js +65 -68
- package/dist/index303.js.map +1 -1
- package/dist/index304.js +68 -30
- package/dist/index304.js.map +1 -1
- package/dist/index305.js +9 -9
- package/dist/index305.js.map +1 -1
- package/dist/index306.js +13 -152
- package/dist/index306.js.map +1 -1
- package/dist/index307.js +65 -107
- package/dist/index307.js.map +1 -1
- package/dist/index308.js +4 -3
- package/dist/index308.js.map +1 -1
- package/dist/index309.js +56 -23
- package/dist/index309.js.map +1 -1
- package/dist/index31.js +120 -227
- package/dist/index31.js.map +1 -1
- package/dist/index310.js +68 -16
- package/dist/index310.js.map +1 -1
- package/dist/index311.js +31 -29
- package/dist/index311.js.map +1 -1
- package/dist/index312.js +9 -13
- package/dist/index312.js.map +1 -1
- package/dist/index313.js +153 -7
- package/dist/index313.js.map +1 -1
- package/dist/index314.js +107 -22
- package/dist/index314.js.map +1 -1
- package/dist/index315.js +4 -13
- package/dist/index315.js.map +1 -1
- package/dist/index316.js +22 -27
- package/dist/index316.js.map +1 -1
- package/dist/index317.js +16 -5
- package/dist/index317.js.map +1 -1
- package/dist/index318.js +32 -0
- package/dist/index318.js.map +1 -0
- package/dist/index319.js +16 -0
- package/dist/index319.js.map +1 -0
- package/dist/index32.js +229 -21
- package/dist/index32.js.map +1 -1
- package/dist/index320.js +10 -0
- package/dist/index320.js.map +1 -0
- package/dist/index321.js +26 -0
- package/dist/index321.js.map +1 -0
- package/dist/index322.js +16 -0
- package/dist/index322.js.map +1 -0
- package/dist/index323.js +31 -0
- package/dist/index323.js.map +1 -0
- package/dist/index324.js +8 -0
- package/dist/index324.js.map +1 -0
- package/dist/index33.js +23 -50
- package/dist/index33.js.map +1 -1
- package/dist/index34.js +50 -2640
- package/dist/index34.js.map +1 -1
- package/dist/index35.js +2598 -351
- package/dist/index35.js.map +1 -1
- package/dist/index36.js +375 -214
- package/dist/index36.js.map +1 -1
- package/dist/index37.js +230 -19
- package/dist/index37.js.map +1 -1
- package/dist/index38.js +18 -138
- package/dist/index38.js.map +1 -1
- package/dist/index39.js +113 -170
- package/dist/index39.js.map +1 -1
- package/dist/index4.js +17 -15
- package/dist/index4.js.map +1 -1
- package/dist/index40.js +209 -64
- package/dist/index40.js.map +1 -1
- package/dist/index41.js +86 -94
- package/dist/index41.js.map +1 -1
- package/dist/index42.js +118 -5
- package/dist/index42.js.map +1 -1
- package/dist/index43.js +5 -843
- package/dist/index43.js.map +1 -1
- package/dist/index44.js +832 -54
- package/dist/index44.js.map +1 -1
- package/dist/index45.js +57 -8
- package/dist/index45.js.map +1 -1
- package/dist/index46.js +8 -2
- package/dist/index46.js.map +1 -1
- package/dist/index47.js +2 -24
- package/dist/index47.js.map +1 -1
- package/dist/index48.js +11 -233
- package/dist/index48.js.map +1 -1
- package/dist/index49.js +19 -205
- package/dist/index49.js.map +1 -1
- package/dist/index5.js +34 -34
- package/dist/index5.js.map +1 -1
- package/dist/index50.js +7 -3
- package/dist/index50.js.map +1 -1
- package/dist/index51.js +2 -7
- package/dist/index51.js.map +1 -1
- package/dist/index52.js +22 -46
- package/dist/index52.js.map +1 -1
- package/dist/index53.js +232 -25
- package/dist/index53.js.map +1 -1
- package/dist/index54.js +50 -47
- package/dist/index54.js.map +1 -1
- package/dist/index55.js +2 -8
- package/dist/index55.js.map +1 -1
- package/dist/index56.js +2 -15
- package/dist/index56.js.map +1 -1
- package/dist/index57.js +5 -133
- package/dist/index57.js.map +1 -1
- package/dist/index58.js +7 -10
- package/dist/index58.js.map +1 -1
- package/dist/index59.js +5 -216
- package/dist/index59.js.map +1 -1
- package/dist/index6.js +154 -120
- package/dist/index6.js.map +1 -1
- package/dist/index60.js +2 -13
- package/dist/index60.js.map +1 -1
- package/dist/index61.js +2 -34
- package/dist/index61.js.map +1 -1
- package/dist/index62.js +6 -46
- package/dist/index62.js.map +1 -1
- package/dist/index63.js +33 -7
- package/dist/index63.js.map +1 -1
- package/dist/index64.js +24 -47
- package/dist/index64.js.map +1 -1
- package/dist/index65.js +8 -4
- package/dist/index65.js.map +1 -1
- package/dist/index66.js +11 -5
- package/dist/index66.js.map +1 -1
- package/dist/index67.js +202 -25
- package/dist/index67.js.map +1 -1
- package/dist/index68.js +4 -50
- package/dist/index68.js.map +1 -1
- package/dist/index69.js +48 -9
- package/dist/index69.js.map +1 -1
- package/dist/index7.js +29 -24
- package/dist/index7.js.map +1 -1
- package/dist/index70.js +49 -10
- package/dist/index70.js.map +1 -1
- package/dist/index71.js +7 -53
- package/dist/index71.js.map +1 -1
- package/dist/index72.js +14 -5
- package/dist/index72.js.map +1 -1
- package/dist/index73.js +133 -7
- package/dist/index73.js.map +1 -1
- package/dist/index74.js +10 -5
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +217 -2
- package/dist/index75.js.map +1 -1
- package/dist/index76.js +13 -2
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +47 -52
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +49 -4
- package/dist/index78.js.map +1 -1
- package/dist/index79.js +4 -5
- package/dist/index79.js.map +1 -1
- package/dist/index8.js +21 -24
- package/dist/index8.js.map +1 -1
- package/dist/index80.js +5 -15
- package/dist/index80.js.map +1 -1
- package/dist/index81.js +28 -6
- package/dist/index81.js.map +1 -1
- package/dist/index82.js +50 -8
- package/dist/index82.js.map +1 -1
- package/dist/index83.js +9 -17
- package/dist/index83.js.map +1 -1
- package/dist/index84.js +5 -4
- package/dist/index84.js.map +1 -1
- package/dist/index85.js +68 -4
- package/dist/index85.js.map +1 -1
- package/dist/index86.js +2 -6
- package/dist/index86.js.map +1 -1
- package/dist/index87.js +363 -5
- package/dist/index87.js.map +1 -1
- package/dist/index88.js +261 -4
- package/dist/index88.js.map +1 -1
- package/dist/index89.js +60 -4
- package/dist/index89.js.map +1 -1
- package/dist/index9.js +138 -187
- package/dist/index9.js.map +1 -1
- package/dist/index90.js +46 -6
- package/dist/index90.js.map +1 -1
- package/dist/index91.js +169 -24
- package/dist/index91.js.map +1 -1
- package/dist/index92.js +109 -6
- package/dist/index92.js.map +1 -1
- package/dist/index93.js +24 -4
- package/dist/index93.js.map +1 -1
- package/dist/index94.js +8 -7
- package/dist/index94.js.map +1 -1
- package/dist/index95.js +4 -5
- package/dist/index95.js.map +1 -1
- package/dist/index96.js +5 -4
- package/dist/index96.js.map +1 -1
- package/dist/index97.js +4 -5
- package/dist/index97.js.map +1 -1
- package/dist/index98.js +466 -4
- package/dist/index98.js.map +1 -1
- package/dist/index99.js +185 -8
- package/dist/index99.js.map +1 -1
- package/package.json +1 -1
package/dist/index24.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index24.js","sources":["../src/components/Notifications/NotificationsDrawer.tsx"],"sourcesContent":["import { createContext, useCallback, useContext, useEffect, useMemo, useState, type Context } from \"react\"\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\"\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\"\nimport { Loader2, MoreVertical, X } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport type { NotificationItem, NotificationsRealtimeState } from \"./types\"\n\n\ntype ListResponse = {\n ok?: boolean\n error?: string\n notifications?: NotificationItem[]\n unreadCount?: number\n unseenCount?: number\n}\n\ntype DayGroup = {\n key: string\n label: string\n items: NotificationItem[]\n}\n\nconst toMs = (iso: string): number => {\n const ms = Date.parse(iso)\n return Number.isFinite(ms) ? ms : 0\n}\n\nconst getDayKey = (iso: string): string => {\n const date = new Date(toMs(iso))\n if (!Number.isFinite(date.getTime())) return \"unknown\"\n\n const year = date.getFullYear()\n const month = String(date.getMonth() + 1).padStart(2, \"0\")\n const day = String(date.getDate()).padStart(2, \"0\")\n\n return `${year}-${month}-${day}`\n}\n\nconst formatDayLabel = (key: string): string => {\n if (key === \"unknown\") return \"Unknown date\"\n const [yearRaw, monthRaw, dayRaw] = key.split(\"-\")\n const year = Number(yearRaw)\n const month = Number(monthRaw)\n const day = Number(dayRaw)\n\n if (!Number.isFinite(year) || !Number.isFinite(month) || !Number.isFinite(day)) return \"Unknown date\"\n\n const date = new Date(year, month - 1, day)\n if (!Number.isFinite(date.getTime())) return \"Unknown date\"\n\n const now = new Date()\n const includeYear = now.getFullYear() !== year\n return date.toLocaleDateString(undefined, includeYear\n ? { weekday: \"short\", month: \"short\", day: \"numeric\", year: \"numeric\" }\n : { weekday: \"short\", month: \"short\", day: \"numeric\" })\n}\n\nconst groupByDay = (items: NotificationItem[]): DayGroup[] => {\n const groups: DayGroup[] = []\n let currentKey: string | null = null\n\n for (const item of items) {\n const key = getDayKey(item.createdAt)\n if (key !== currentKey) {\n currentKey = key\n groups.push({ key, label: formatDayLabel(key), items: [] })\n }\n groups[groups.length - 1]!.items.push(item)\n }\n\n return groups\n}\n\nconst EmptyRealtimeContext = createContext<NotificationsRealtimeState | null>(null)\n\nexport function NotificationsDrawer({\n open,\n onOpenChange,\n className,\n limit = 50,\n defaultUnreadOnly = false,\n realtimeContext,\n}: {\n open: boolean\n onOpenChange: (open: boolean) => void\n className?: string\n limit?: number\n defaultUnreadOnly?: boolean\n realtimeContext?: Context<NotificationsRealtimeState | null>\n}) {\n const realtime = useContext(realtimeContext ?? EmptyRealtimeContext)\n\n const [items, setItems] = useState<NotificationItem[]>([])\n const [unreadCount, setUnreadCount] = useState<number>(0)\n const [unseenCount, setUnseenCount] = useState<number>(0)\n const [loading, setLoading] = useState(false)\n const [error, setError] = useState<string | null>(null)\n const [unreadOnly, setUnreadOnly] = useState<boolean>(defaultUnreadOnly)\n\n const mergedItems = realtime?.notifications ?? items\n const mergedUnreadCount = realtime?.unreadCount ?? unreadCount\n const mergedUnseenCount = realtime?.unseenCount ?? unseenCount\n const mergedLoading = realtime?.loading ?? loading\n const mergedError = realtime?.error\n ? (realtime.error instanceof Error ? realtime.error.message : String(realtime.error))\n : error\n\n const visibleItems = useMemo(() => mergedItems.slice(0, limit), [limit, mergedItems])\n\n const unread = useMemo(() => visibleItems.filter((n) => !n.readAt), [visibleItems])\n const read = useMemo(() => visibleItems.filter((n) => Boolean(n.readAt)), [visibleItems])\n const unreadGroups = useMemo(() => groupByDay(unread), [unread])\n const readGroups = useMemo(() => groupByDay(read), [read])\n\n const refresh = useCallback(async ({ unreadOnly, markSeen }: { unreadOnly: boolean; markSeen: boolean }) => {\n setLoading(true)\n setError(null)\n\n try {\n const res = await fetch(\"/api/rb/notifications\", {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n credentials: \"include\",\n body: JSON.stringify({ limit, unreadOnly, markSeen }),\n })\n\n const json = (await res.json().catch(() => null)) as ListResponse | null\n if (!res.ok || !json?.ok) {\n setError(json?.error || \"Unable to load notifications.\")\n return\n }\n\n const nextItems = Array.isArray(json.notifications) ? json.notifications : []\n setItems(nextItems)\n setUnreadCount(Number.isFinite(json.unreadCount) ? Math.max(0, Math.floor(json.unreadCount ?? 0)) : 0)\n setUnseenCount(Number.isFinite(json.unseenCount) ? Math.max(0, Math.floor(json.unseenCount ?? 0)) : 0)\n } catch {\n setError(\"Unable to load notifications.\")\n } finally {\n setLoading(false)\n }\n }, [limit])\n\n useEffect(() => {\n if (!open) return\n if (realtime) {\n void (async () => {\n try {\n await fetch(\"/api/rb/notifications\", {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n credentials: \"include\",\n keepalive: true,\n body: JSON.stringify({ limit: 1, markSeen: true }),\n })\n } catch {\n return\n }\n })()\n return\n }\n void refresh({ unreadOnly, markSeen: true })\n }, [open, realtime, refresh, unreadOnly])\n\n useEffect(() => {\n if (!open) return\n if (realtime) return\n void refresh({ unreadOnly, markSeen: false })\n }, [open, realtime, refresh, unreadOnly])\n\n const markAsRead = async (id: string) => {\n try {\n const res = await fetch(`/api/rb/notifications/${encodeURIComponent(id)}/read`, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n credentials: \"include\",\n keepalive: true,\n body: \"{}\",\n })\n\n const json = (await res.json().catch(() => null)) as { ok?: boolean } | null\n if (!res.ok || !json?.ok) return\n\n const nowIso = new Date().toISOString()\n if (realtime) return\n setItems((current) => {\n const target = current.find((n) => n.id === id)\n if (target && !target.readAt) {\n setUnreadCount((count) => Math.max(0, count - 1))\n }\n if (target && !target.seenAt) {\n setUnseenCount((count) => Math.max(0, count - 1))\n }\n return current.map((n) => (n.id === id && !n.readAt ? { ...n, readAt: nowIso, ...(n.seenAt ? {} : { seenAt: nowIso }) } : n))\n })\n } catch {\n return\n }\n }\n\n const archive = async (id: string) => {\n try {\n const res = await fetch(`/api/rb/notifications/${encodeURIComponent(id)}/archive`, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n credentials: \"include\",\n body: \"{}\",\n })\n\n const json = (await res.json().catch(() => null)) as { ok?: boolean } | null\n if (!res.ok || !json?.ok) return\n\n if (realtime) return\n setItems((current) => {\n const target = current.find((n) => n.id === id)\n if (target && !target.readAt) {\n setUnreadCount((count) => Math.max(0, count - 1))\n }\n if (target && !target.seenAt) {\n setUnseenCount((count) => Math.max(0, count - 1))\n }\n return current.filter((n) => n.id !== id)\n })\n } catch {\n return\n }\n }\n\n return (\n <DialogPrimitive.Root open={open} onOpenChange={onOpenChange}>\n <DialogPrimitive.Portal>\n <DialogPrimitive.Overlay className=\"fixed inset-0 z-50 bg-black/50\" />\n <DialogPrimitive.Content\n className={cn(\n \"fixed right-0 top-0 z-50 flex h-full w-full max-w-md flex-col border-l bg-background shadow-xl outline-none\",\n className,\n )}\n >\n <header className=\"flex items-center justify-between gap-2 border-b px-4 py-3\">\n <div className=\"flex min-w-0 flex-col\">\n <DialogPrimitive.Title className=\"text-sm font-semibold\">Notifications</DialogPrimitive.Title>\n <span className=\"text-xs text-muted-foreground\">\n {mergedUnreadCount > 0 ? `${mergedUnreadCount} unread` : mergedUnseenCount > 0 ? `${mergedUnseenCount} new` : \"All caught up\"}\n </span>\n </div>\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={() => setUnreadOnly((v) => !v)}\n className={cn(\n \"rounded-md border px-2 py-1 text-xs\",\n unreadOnly ? \"bg-accent text-foreground\" : \"bg-background text-muted-foreground hover:bg-accent\",\n )}\n >\n {unreadOnly ? \"Unread\" : \"All\"}\n </button>\n <DialogPrimitive.Close asChild>\n <button type=\"button\" className=\"inline-flex h-8 w-8 items-center justify-center rounded-md hover:bg-accent\">\n <X className=\"h-4 w-4\" />\n </button>\n </DialogPrimitive.Close>\n </div>\n </header>\n\n <div className=\"flex-1 overflow-y-auto px-4 pb-3\">\n {mergedLoading ? (\n <div className=\"flex items-center justify-center py-10 text-muted-foreground\">\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n </div>\n ) : mergedError ? (\n <div className=\"py-10 text-center text-sm text-muted-foreground\">{mergedError}</div>\n ) : visibleItems.length === 0 ? (\n <div className=\"py-10 text-center text-sm text-muted-foreground\">No notifications.</div>\n ) : (\n <div className=\"flex flex-col gap-4\">\n <div>\n <div className=\"sticky top-0 z-20 -mx-4 flex h-8 items-center border-b bg-background px-4 text-xs font-semibold text-muted-foreground\">\n Unread notifications\n </div>\n {unreadGroups.length === 0 ? (\n <div className=\"py-6 text-center text-sm text-muted-foreground\">No unread notifications.</div>\n ) : (\n unreadGroups.map((group) => (\n <div key={`unread:${group.key}`}>\n <div className=\"sticky top-8 z-10 -mx-4 flex h-7 items-center bg-background px-4 text-[11px] font-semibold text-muted-foreground\">\n {group.label}\n </div>\n <div className=\"-mx-4 flex flex-col divide-y divide-border\">\n {group.items.map((n) => (\n <NotificationRow\n key={n.id}\n notification={n}\n onMarkRead={markAsRead}\n onArchive={archive}\n />\n ))}\n </div>\n </div>\n ))\n )}\n </div>\n\n {unreadOnly ? null : (\n <div>\n <div className=\"sticky top-0 z-20 -mx-4 flex h-8 items-center border-b bg-background px-4 text-xs font-semibold text-muted-foreground\">\n Previous notifications\n </div>\n {readGroups.length === 0 ? (\n <div className=\"py-6 text-center text-sm text-muted-foreground\">No previous notifications.</div>\n ) : (\n readGroups.map((group) => (\n <div key={`previous:${group.key}`}>\n <div className=\"sticky top-8 z-10 -mx-4 flex h-7 items-center bg-background px-4 text-[11px] font-semibold text-muted-foreground\">\n {group.label}\n </div>\n <div className=\"-mx-4 flex flex-col divide-y divide-border\">\n {group.items.map((n) => (\n <NotificationRow\n key={n.id}\n notification={n}\n onMarkRead={markAsRead}\n onArchive={archive}\n />\n ))}\n </div>\n </div>\n ))\n )}\n </div>\n )}\n </div>\n )}\n </div>\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n </DialogPrimitive.Root>\n )\n}\n\nfunction NotificationRow({\n notification,\n onMarkRead,\n onArchive,\n}: {\n notification: NotificationItem\n onMarkRead: (id: string) => void\n onArchive: (id: string) => void\n}) {\n const isUnread = !notification.readAt\n const createdAtLabel = (() => {\n const date = new Date(toMs(notification.createdAt))\n if (!Number.isFinite(date.getTime())) return \"\"\n return date.toLocaleString()\n })()\n\n return (\n <div\n className={cn(\n \"group flex w-full gap-3 px-4 py-3 hover:bg-accent/40\",\n isUnread ? \"bg-primary/5\" : \"bg-background\",\n )}\n >\n <button\n type=\"button\"\n className=\"min-w-0 flex-1 text-left\"\n onClick={() => {\n if (isUnread) {\n void onMarkRead(notification.id)\n }\n if (notification.url) {\n window.location.href = notification.url\n }\n }}\n >\n <div className=\"min-w-0\">\n <div className=\"truncate text-sm font-semibold\">{notification.title}</div>\n {notification.body ? (\n <div className=\"mt-0.5 line-clamp-2 text-xs text-muted-foreground\">{notification.body}</div>\n ) : null}\n </div>\n {notification.url ? <div className=\"mt-2 truncate text-xs text-primary\">{notification.url}</div> : null}\n {createdAtLabel ? (\n <div className=\"mt-2 text-[11px] text-muted-foreground\">{createdAtLabel}</div>\n ) : null}\n </button>\n <div className=\"flex items-start\">\n <DropdownMenuPrimitive.Root>\n <DropdownMenuPrimitive.Trigger asChild>\n <button\n type=\"button\"\n className=\"inline-flex h-8 w-8 items-center justify-center rounded-md hover:bg-accent\"\n aria-label=\"Notification options\"\n >\n <MoreVertical className=\"h-4 w-4\" />\n </button>\n </DropdownMenuPrimitive.Trigger>\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n align=\"end\"\n sideOffset={6}\n className={cn(\n \"z-50 min-w-[10rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md\",\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95\",\n \"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n )}\n >\n <DropdownMenuPrimitive.Item\n className=\"relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\"\n onSelect={() => onArchive(notification.id)}\n >\n Archive\n </DropdownMenuPrimitive.Item>\n <DropdownMenuPrimitive.Item\n className=\"relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\"\n disabled={!isUnread}\n onSelect={() => onMarkRead(notification.id)}\n >\n Mark as read\n </DropdownMenuPrimitive.Item>\n </DropdownMenuPrimitive.Content>\n </DropdownMenuPrimitive.Portal>\n </DropdownMenuPrimitive.Root>\n </div>\n </div>\n )\n}\n"],"names":["toMs","iso","ms","getDayKey","date","year","month","day","formatDayLabel","key","yearRaw","monthRaw","dayRaw","includeYear","groupByDay","items","groups","currentKey","item","EmptyRealtimeContext","createContext","NotificationsDrawer","open","onOpenChange","className","limit","defaultUnreadOnly","realtimeContext","realtime","useContext","setItems","useState","unreadCount","setUnreadCount","unseenCount","setUnseenCount","loading","setLoading","error","setError","unreadOnly","setUnreadOnly","mergedItems","mergedUnreadCount","mergedUnseenCount","mergedLoading","mergedError","visibleItems","useMemo","unread","read","unreadGroups","readGroups","refresh","useCallback","markSeen","res","json","nextItems","useEffect","markAsRead","id","nowIso","current","target","n","count","archive","jsx","DialogPrimitive","jsxs","cn","v","X","Loader2","group","NotificationRow","notification","onMarkRead","onArchive","isUnread","createdAtLabel","DropdownMenuPrimitive.Root","DropdownMenuPrimitive.Trigger","MoreVertical","DropdownMenuPrimitive.Portal","DropdownMenuPrimitive.Content","DropdownMenuPrimitive.Item"],"mappings":";;;;;;AAwBA,MAAMA,IAAO,CAACC,MAAwB;AACpC,QAAMC,IAAK,KAAK,MAAMD,CAAG;AACzB,SAAO,OAAO,SAASC,CAAE,IAAIA,IAAK;AACpC,GAEMC,KAAY,CAACF,MAAwB;AACzC,QAAMG,IAAO,IAAI,KAAKJ,EAAKC,CAAG,CAAC;AAC/B,MAAI,CAAC,OAAO,SAASG,EAAK,QAAA,CAAS,EAAG,QAAO;AAE7C,QAAMC,IAAOD,EAAK,YAAA,GACZE,IAAQ,OAAOF,EAAK,SAAA,IAAa,CAAC,EAAE,SAAS,GAAG,GAAG,GACnDG,IAAM,OAAOH,EAAK,QAAA,CAAS,EAAE,SAAS,GAAG,GAAG;AAElD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;AAAA,cACC,MAAK;AAAA,cACL,WAAU;AAAA,cACV,cAAW;AAAA,cAEX,UAAAA,gBAAAA,EAAAA,IAACgB,IAAA,EAAa,WAAU,UAAA,CAAU;AAAA,YAAA;AAAA,UAAA,GAEtC;AAAA,UACAhB,gBAAAA,MAACiB,IAAA,EACC,UAAAf,gBAAAA,EAAAA;AAAAA,YAACgB;AAAAA,YAAA;AAAA,cACC,OAAM;AAAA,cACN,YAAY;AAAA,cACZ,WAAWf;AAAA,gBACT;AAAA,gBACA;AAAA,gBACA;AAAA,cAAA;AAAA,cAGF,UAAA;AAAA,gBAAAH,gBAAAA,EAAAA;AAAAA,kBAACmB;AAAAA,kBAAA;AAAA,oBACC,WAAU;AAAA,oBACV,UAAU,MAAMR,EAAUF,EAAa,EAAE;AAAA,oBAC1C,UAAA;AAAA,kBAAA;AAAA,gBAAA;AAAA,gBAGDT,gBAAAA,EAAAA;AAAAA,kBAACmB;AAAAA,kBAAA;AAAA,oBACC,WAAU;AAAA,oBACV,UAAU,CAACP;AAAA,oBACX,UAAU,MAAMF,EAAWD,EAAa,EAAE;AAAA,oBAC3C,UAAA;AAAA,kBAAA;AAAA,gBAAA;AAAA,cAED;AAAA,YAAA;AAAA,UAAA,EACF,CACF;AAAA,QAAA,EAAA,CACF,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
1
|
+
{"version":3,"file":"index24.js","sources":["../src/components/Notifications/NotificationsDrawer.tsx"],"sourcesContent":["import { createContext, useCallback, useContext, useEffect, useMemo, useState, type Context } from \"react\"\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\"\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\"\nimport { Loader2, MoreVertical, X } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport type { NotificationItem, NotificationsRealtimeState } from \"./types\"\n\n\ntype ListResponse = {\n ok?: boolean\n error?: string\n notifications?: NotificationItem[]\n unreadCount?: number\n unseenCount?: number\n}\n\ntype DayGroup = {\n key: string\n label: string\n items: NotificationItem[]\n}\n\nconst toMs = (iso: string): number => {\n const ms = Date.parse(iso)\n return Number.isFinite(ms) ? ms : 0\n}\n\nconst getDayKey = (iso: string): string => {\n const date = new Date(toMs(iso))\n if (!Number.isFinite(date.getTime())) return \"unknown\"\n\n const year = date.getFullYear()\n const month = String(date.getMonth() + 1).padStart(2, \"0\")\n const day = String(date.getDate()).padStart(2, \"0\")\n\n return `${year}-${month}-${day}`\n}\n\nconst formatDayLabel = (key: string): string => {\n if (key === \"unknown\") return \"Unknown date\"\n const [yearRaw, monthRaw, dayRaw] = key.split(\"-\")\n const year = Number(yearRaw)\n const month = Number(monthRaw)\n const day = Number(dayRaw)\n\n if (!Number.isFinite(year) || !Number.isFinite(month) || !Number.isFinite(day)) return \"Unknown date\"\n\n const date = new Date(year, month - 1, day)\n if (!Number.isFinite(date.getTime())) return \"Unknown date\"\n\n const now = new Date()\n const includeYear = now.getFullYear() !== year\n return date.toLocaleDateString(undefined, includeYear\n ? { weekday: \"short\", month: \"short\", day: \"numeric\", year: \"numeric\" }\n : { weekday: \"short\", month: \"short\", day: \"numeric\" })\n}\n\nconst groupByDay = (items: NotificationItem[]): DayGroup[] => {\n const groups: DayGroup[] = []\n let currentKey: string | null = null\n\n for (const item of items) {\n const key = getDayKey(item.createdAt)\n if (key !== currentKey) {\n currentKey = key\n groups.push({ key, label: formatDayLabel(key), items: [] })\n }\n groups[groups.length - 1]!.items.push(item)\n }\n\n return groups\n}\n\nconst EmptyRealtimeContext = createContext<NotificationsRealtimeState | null>(null)\n\nexport function NotificationsDrawer({\n open,\n onOpenChange,\n className,\n limit = 50,\n defaultUnreadOnly = false,\n realtimeContext,\n}: {\n open: boolean\n onOpenChange: (open: boolean) => void\n className?: string\n limit?: number\n defaultUnreadOnly?: boolean\n realtimeContext?: Context<NotificationsRealtimeState | null>\n}) {\n const realtime = useContext(realtimeContext ?? EmptyRealtimeContext)\n\n const [items, setItems] = useState<NotificationItem[]>([])\n const [unreadCount, setUnreadCount] = useState<number>(0)\n const [unseenCount, setUnseenCount] = useState<number>(0)\n const [loading, setLoading] = useState(false)\n const [error, setError] = useState<string | null>(null)\n const [unreadOnly, setUnreadOnly] = useState<boolean>(defaultUnreadOnly)\n\n const mergedItems = realtime?.notifications ?? items\n const mergedUnreadCount = realtime?.unreadCount ?? unreadCount\n const mergedUnseenCount = realtime?.unseenCount ?? unseenCount\n const mergedLoading = realtime?.loading ?? loading\n const mergedError = realtime?.error\n ? (realtime.error instanceof Error ? realtime.error.message : String(realtime.error))\n : error\n\n const visibleItems = useMemo(() => mergedItems.slice(0, limit), [limit, mergedItems])\n\n const unread = useMemo(() => visibleItems.filter((n) => !n.readAt), [visibleItems])\n const read = useMemo(() => visibleItems.filter((n) => Boolean(n.readAt)), [visibleItems])\n const unreadGroups = useMemo(() => groupByDay(unread), [unread])\n const readGroups = useMemo(() => groupByDay(read), [read])\n\n const refresh = useCallback(async ({ unreadOnly, markSeen }: { unreadOnly: boolean; markSeen: boolean }) => {\n setLoading(true)\n setError(null)\n\n try {\n const res = await fetch(\"/api/rb/notifications\", {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n credentials: \"include\",\n body: JSON.stringify({ limit, unreadOnly, markSeen }),\n })\n\n const json = (await res.json().catch(() => null)) as ListResponse | null\n if (!res.ok || !json?.ok) {\n setError(json?.error || \"Unable to load notifications.\")\n return\n }\n\n const nextItems = Array.isArray(json.notifications) ? json.notifications : []\n setItems(nextItems)\n setUnreadCount(Number.isFinite(json.unreadCount) ? Math.max(0, Math.floor(json.unreadCount ?? 0)) : 0)\n setUnseenCount(Number.isFinite(json.unseenCount) ? Math.max(0, Math.floor(json.unseenCount ?? 0)) : 0)\n } catch {\n setError(\"Unable to load notifications.\")\n } finally {\n setLoading(false)\n }\n }, [limit])\n\n useEffect(() => {\n if (!open) return\n if (realtime) {\n void (async () => {\n try {\n await fetch(\"/api/rb/notifications\", {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n credentials: \"include\",\n keepalive: true,\n body: JSON.stringify({ limit: 1, markSeen: true }),\n })\n } catch {\n return\n }\n })()\n return\n }\n void refresh({ unreadOnly, markSeen: true })\n }, [open, realtime, refresh, unreadOnly])\n\n useEffect(() => {\n if (!open) return\n if (realtime) return\n void refresh({ unreadOnly, markSeen: false })\n }, [open, realtime, refresh, unreadOnly])\n\n const markAsRead = async (id: string) => {\n try {\n const res = await fetch(`/api/rb/notifications/${encodeURIComponent(id)}/read`, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n credentials: \"include\",\n keepalive: true,\n body: \"{}\",\n })\n\n const json = (await res.json().catch(() => null)) as { ok?: boolean } | null\n if (!res.ok || !json?.ok) return\n\n const nowIso = new Date().toISOString()\n if (realtime) return\n setItems((current) => {\n const target = current.find((n) => n.id === id)\n if (target && !target.readAt) {\n setUnreadCount((count) => Math.max(0, count - 1))\n }\n if (target && !target.seenAt) {\n setUnseenCount((count) => Math.max(0, count - 1))\n }\n return current.map((n) => (n.id === id && !n.readAt ? { ...n, readAt: nowIso, ...(n.seenAt ? {} : { seenAt: nowIso }) } : n))\n })\n } catch {\n return\n }\n }\n\n const archive = async (id: string) => {\n try {\n const res = await fetch(`/api/rb/notifications/${encodeURIComponent(id)}/archive`, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n credentials: \"include\",\n body: \"{}\",\n })\n\n const json = (await res.json().catch(() => null)) as { ok?: boolean } | null\n if (!res.ok || !json?.ok) return\n\n if (realtime) return\n setItems((current) => {\n const target = current.find((n) => n.id === id)\n if (target && !target.readAt) {\n setUnreadCount((count) => Math.max(0, count - 1))\n }\n if (target && !target.seenAt) {\n setUnseenCount((count) => Math.max(0, count - 1))\n }\n return current.filter((n) => n.id !== id)\n })\n } catch {\n return\n }\n }\n\n return (\n <DialogPrimitive.Root open={open} onOpenChange={onOpenChange}>\n <DialogPrimitive.Portal>\n <DialogPrimitive.Overlay className=\"fixed inset-0 z-50 bg-black/50\" />\n <DialogPrimitive.Content\n className={cn(\n \"fixed right-0 top-0 z-50 flex h-full w-full max-w-md flex-col border-l bg-background shadow-xl outline-none\",\n className,\n )}\n >\n <header className=\"flex items-center justify-between gap-2 border-b px-4 py-3\">\n <div className=\"flex min-w-0 flex-col\">\n <DialogPrimitive.Title className=\"text-sm font-semibold\">Notifications</DialogPrimitive.Title>\n <span className=\"text-xs text-muted-foreground\">\n {mergedUnreadCount > 0 ? `${mergedUnreadCount} unread` : mergedUnseenCount > 0 ? `${mergedUnseenCount} new` : \"All caught up\"}\n </span>\n </div>\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={() => setUnreadOnly((v) => !v)}\n className={cn(\n \"rounded-md border px-2 py-1 text-xs\",\n unreadOnly ? \"bg-accent text-foreground\" : \"bg-background text-muted-foreground hover:bg-accent\",\n )}\n >\n {unreadOnly ? \"Unread\" : \"All\"}\n </button>\n <DialogPrimitive.Close asChild>\n <button type=\"button\" className=\"inline-flex h-8 w-8 items-center justify-center rounded-md hover:bg-accent\">\n <X className=\"h-4 w-4\" />\n </button>\n </DialogPrimitive.Close>\n </div>\n </header>\n\n <div className=\"flex-1 overflow-y-auto px-4 pb-3\">\n {mergedLoading ? (\n <div className=\"flex items-center justify-center py-10 text-muted-foreground\">\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n </div>\n ) : mergedError ? (\n <div className=\"py-10 text-center text-sm text-muted-foreground\">{mergedError}</div>\n ) : visibleItems.length === 0 ? (\n <div className=\"py-10 text-center text-sm text-muted-foreground\">No notifications.</div>\n ) : (\n <div className=\"flex flex-col gap-4\">\n <div>\n <div className=\"sticky top-0 z-20 -mx-4 flex h-8 items-center border-b bg-background px-4 text-xs font-semibold text-muted-foreground\">\n Unread notifications\n </div>\n {unreadGroups.length === 0 ? (\n <div className=\"py-6 text-center text-sm text-muted-foreground\">No unread notifications.</div>\n ) : (\n unreadGroups.map((group) => (\n <div key={`unread:${group.key}`}>\n <div className=\"sticky top-8 z-10 -mx-4 flex h-7 items-center bg-background px-4 text-[11px] font-semibold text-muted-foreground\">\n {group.label}\n </div>\n <div className=\"-mx-4 flex flex-col divide-y divide-border\">\n {group.items.map((n) => (\n <NotificationRow\n key={n.id}\n notification={n}\n onMarkRead={markAsRead}\n onArchive={archive}\n />\n ))}\n </div>\n </div>\n ))\n )}\n </div>\n\n {unreadOnly ? null : (\n <div>\n <div className=\"sticky top-0 z-20 -mx-4 flex h-8 items-center border-b bg-background px-4 text-xs font-semibold text-muted-foreground\">\n Previous notifications\n </div>\n {readGroups.length === 0 ? (\n <div className=\"py-6 text-center text-sm text-muted-foreground\">No previous notifications.</div>\n ) : (\n readGroups.map((group) => (\n <div key={`previous:${group.key}`}>\n <div className=\"sticky top-8 z-10 -mx-4 flex h-7 items-center bg-background px-4 text-[11px] font-semibold text-muted-foreground\">\n {group.label}\n </div>\n <div className=\"-mx-4 flex flex-col divide-y divide-border\">\n {group.items.map((n) => (\n <NotificationRow\n key={n.id}\n notification={n}\n onMarkRead={markAsRead}\n onArchive={archive}\n />\n ))}\n </div>\n </div>\n ))\n )}\n </div>\n )}\n </div>\n )}\n </div>\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n </DialogPrimitive.Root>\n )\n}\n\nfunction NotificationRow({\n notification,\n onMarkRead,\n onArchive,\n}: {\n notification: NotificationItem\n onMarkRead: (id: string) => void\n onArchive: (id: string) => void\n}) {\n const isUnread = !notification.readAt\n const createdAtLabel = (() => {\n const date = new Date(toMs(notification.createdAt))\n if (!Number.isFinite(date.getTime())) return \"\"\n return date.toLocaleString()\n })()\n\n return (\n <div\n className={cn(\n \"group flex w-full gap-3 px-4 py-3 hover:bg-accent/40\",\n isUnread ? \"bg-primary/5\" : \"bg-background\",\n )}\n >\n <button\n type=\"button\"\n className=\"min-w-0 flex-1 text-left\"\n onClick={() => {\n if (isUnread) {\n void onMarkRead(notification.id)\n }\n if (notification.url) {\n window.location.href = notification.url\n }\n }}\n >\n <div className=\"min-w-0\">\n <div className=\"truncate text-sm font-semibold\">{notification.title}</div>\n {notification.body ? (\n <div className=\"mt-0.5 line-clamp-2 text-xs text-muted-foreground\">{notification.body}</div>\n ) : null}\n </div>\n {notification.url ? <div className=\"mt-2 truncate text-xs text-primary\">{notification.url}</div> : null}\n {createdAtLabel ? (\n <div className=\"mt-2 text-[11px] text-muted-foreground\">{createdAtLabel}</div>\n ) : null}\n </button>\n <div className=\"flex items-start\">\n <DropdownMenuPrimitive.Root>\n <DropdownMenuPrimitive.Trigger asChild>\n <button\n type=\"button\"\n className=\"inline-flex h-8 w-8 items-center justify-center rounded-md hover:bg-accent\"\n aria-label=\"Notification options\"\n >\n <MoreVertical className=\"h-4 w-4\" />\n </button>\n </DropdownMenuPrimitive.Trigger>\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n align=\"end\"\n sideOffset={6}\n className={cn(\n \"z-50 min-w-[10rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md\",\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95\",\n \"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n )}\n >\n <DropdownMenuPrimitive.Item\n className=\"relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\"\n onSelect={() => onArchive(notification.id)}\n >\n Archive\n </DropdownMenuPrimitive.Item>\n <DropdownMenuPrimitive.Item\n className=\"relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\"\n disabled={!isUnread}\n onSelect={() => onMarkRead(notification.id)}\n >\n Mark as read\n </DropdownMenuPrimitive.Item>\n </DropdownMenuPrimitive.Content>\n </DropdownMenuPrimitive.Portal>\n </DropdownMenuPrimitive.Root>\n </div>\n </div>\n )\n}\n"],"names":["toMs","iso","ms","Date","parse","Number","isFinite","getDayKey","date","getTime","year","getFullYear","month","String","getMonth","padStart","day","getDate","formatDayLabel","key","yearRaw","monthRaw","dayRaw","split","includeYear","toLocaleDateString","undefined","weekday","groupByDay","items","groups","currentKey","item","createdAt","push","label","length","EmptyRealtimeContext","createContext","NotificationsDrawer","open","onOpenChange","className","limit","defaultUnreadOnly","realtimeContext","realtime","useContext","setItems","useState","unreadCount","setUnreadCount","unseenCount","setUnseenCount","loading","setLoading","error","setError","unreadOnly","setUnreadOnly","mergedItems","notifications","mergedUnreadCount","mergedUnseenCount","mergedLoading","mergedError","Error","message","visibleItems","useMemo","slice","unread","filter","n","readAt","read","Boolean","unreadGroups","readGroups","refresh","useCallback","markSeen","res","fetch","method","headers","credentials","body","JSON","stringify","json","catch","ok","nextItems","Array","isArray","Math","max","floor","useEffect","keepalive","markAsRead","id","encodeURIComponent","nowIso","toISOString","current","target","find","count","seenAt","map","archive","jsx","DialogPrimitive","jsxs","cn","v","X","Loader2","group","NotificationRow","t0","$","_c","notification","onMarkRead","onArchive","isUnread","t1","bb0","toLocaleString","createdAtLabel","t2","t3","t4","url","window","location","href","t5","title","t6","t7","t8","t9","t10","t11","Symbol","for","DropdownMenuPrimitive.Trigger","MoreVertical","t12","t13","t14","t15","t16","t17","DropdownMenuPrimitive.Root","DropdownMenuPrimitive.Content","t18"],"mappings":";;;;;;;AAwBA,MAAMA,IAAOA,CAACC,MAAwB;AACpC,QAAMC,IAAKC,KAAKC,MAAMH,CAAG;AACzB,SAAOI,OAAOC,SAASJ,CAAE,IAAIA,IAAK;AACpC,GAEMK,KAAYA,CAACN,MAAwB;AACzC,QAAMO,IAAO,IAAIL,KAAKH,EAAKC,CAAG,CAAC;AAC/B,MAAI,CAACI,OAA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AAuB,GAAAvB,QAAAkC,GAAAlC,QAAAW,GAAAX,QAAAqC,KAAAA,IAAArC,EAAA,EAAA,GAnENqC;AAmEM;"}
|
package/dist/index240.js
CHANGED
|
@@ -1,184 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import { useDirection as W } from "./index55.js";
|
|
11
|
-
import { j as d } from "./index29.js";
|
|
12
|
-
var _ = "rovingFocusGroup.onEntryFocus", X = { bubbles: !1, cancelable: !0 }, I = "RovingFocusGroup", [y, N, Z] = H(I), [$, Fe] = z(
|
|
13
|
-
I,
|
|
14
|
-
[Z]
|
|
15
|
-
), [ee, oe] = $(I), O = s.forwardRef(
|
|
16
|
-
(e, r) => /* @__PURE__ */ d.jsx(y.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ d.jsx(y.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ d.jsx(te, { ...e, ref: r }) }) })
|
|
17
|
-
);
|
|
18
|
-
O.displayName = I;
|
|
19
|
-
var te = s.forwardRef((e, r) => {
|
|
20
|
-
const {
|
|
21
|
-
__scopeRovingFocusGroup: c,
|
|
22
|
-
orientation: o,
|
|
23
|
-
loop: T = !1,
|
|
24
|
-
dir: w,
|
|
25
|
-
currentTabStopId: v,
|
|
26
|
-
defaultCurrentTabStopId: C,
|
|
27
|
-
onCurrentTabStopIdChange: S,
|
|
28
|
-
onEntryFocus: m,
|
|
29
|
-
preventScrollOnEntryFocus: u = !1,
|
|
30
|
-
...b
|
|
31
|
-
} = e, F = s.useRef(null), g = V(r, F), R = W(w), [E, t] = Q({
|
|
32
|
-
prop: v,
|
|
33
|
-
defaultProp: C ?? null,
|
|
34
|
-
onChange: S,
|
|
35
|
-
caller: I
|
|
36
|
-
}), [i, h] = s.useState(!1), a = J(m), l = N(c), x = s.useRef(!1), [k, D] = s.useState(0);
|
|
37
|
-
return s.useEffect(() => {
|
|
38
|
-
const n = F.current;
|
|
39
|
-
if (n)
|
|
40
|
-
return n.addEventListener(_, a), () => n.removeEventListener(_, a);
|
|
41
|
-
}, [a]), /* @__PURE__ */ d.jsx(
|
|
42
|
-
ee,
|
|
43
|
-
{
|
|
44
|
-
scope: c,
|
|
45
|
-
orientation: o,
|
|
46
|
-
dir: R,
|
|
47
|
-
loop: T,
|
|
48
|
-
currentTabStopId: E,
|
|
49
|
-
onItemFocus: s.useCallback(
|
|
50
|
-
(n) => t(n),
|
|
51
|
-
[t]
|
|
52
|
-
),
|
|
53
|
-
onItemShiftTab: s.useCallback(() => h(!0), []),
|
|
54
|
-
onFocusableItemAdd: s.useCallback(
|
|
55
|
-
() => D((n) => n + 1),
|
|
56
|
-
[]
|
|
57
|
-
),
|
|
58
|
-
onFocusableItemRemove: s.useCallback(
|
|
59
|
-
() => D((n) => n - 1),
|
|
60
|
-
[]
|
|
61
|
-
),
|
|
62
|
-
children: /* @__PURE__ */ d.jsx(
|
|
63
|
-
G.div,
|
|
64
|
-
{
|
|
65
|
-
tabIndex: i || k === 0 ? -1 : 0,
|
|
66
|
-
"data-orientation": o,
|
|
67
|
-
...b,
|
|
68
|
-
ref: g,
|
|
69
|
-
style: { outline: "none", ...e.style },
|
|
70
|
-
onMouseDown: p(e.onMouseDown, () => {
|
|
71
|
-
x.current = !0;
|
|
72
|
-
}),
|
|
73
|
-
onFocus: p(e.onFocus, (n) => {
|
|
74
|
-
const L = !x.current;
|
|
75
|
-
if (n.target === n.currentTarget && L && !i) {
|
|
76
|
-
const P = new CustomEvent(_, X);
|
|
77
|
-
if (n.currentTarget.dispatchEvent(P), !P.defaultPrevented) {
|
|
78
|
-
const A = l().filter((f) => f.focusable), U = A.find((f) => f.active), B = A.find((f) => f.id === E), Y = [U, B, ...A].filter(
|
|
79
|
-
Boolean
|
|
80
|
-
).map((f) => f.ref.current);
|
|
81
|
-
M(Y, u);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
x.current = !1;
|
|
85
|
-
}),
|
|
86
|
-
onBlur: p(e.onBlur, () => h(!1))
|
|
87
|
-
}
|
|
88
|
-
)
|
|
89
|
-
}
|
|
90
|
-
);
|
|
91
|
-
}), K = "RovingFocusGroupItem", j = s.forwardRef(
|
|
92
|
-
(e, r) => {
|
|
93
|
-
const {
|
|
94
|
-
__scopeRovingFocusGroup: c,
|
|
95
|
-
focusable: o = !0,
|
|
96
|
-
active: T = !1,
|
|
97
|
-
tabStopId: w,
|
|
98
|
-
children: v,
|
|
99
|
-
...C
|
|
100
|
-
} = e, S = q(), m = w || S, u = oe(K, c), b = u.currentTabStopId === m, F = N(c), { onFocusableItemAdd: g, onFocusableItemRemove: R, currentTabStopId: E } = u;
|
|
101
|
-
return s.useEffect(() => {
|
|
102
|
-
if (o)
|
|
103
|
-
return g(), () => R();
|
|
104
|
-
}, [o, g, R]), /* @__PURE__ */ d.jsx(
|
|
105
|
-
y.ItemSlot,
|
|
106
|
-
{
|
|
107
|
-
scope: c,
|
|
108
|
-
id: m,
|
|
109
|
-
focusable: o,
|
|
110
|
-
active: T,
|
|
111
|
-
children: /* @__PURE__ */ d.jsx(
|
|
112
|
-
G.span,
|
|
113
|
-
{
|
|
114
|
-
tabIndex: b ? 0 : -1,
|
|
115
|
-
"data-orientation": u.orientation,
|
|
116
|
-
...C,
|
|
117
|
-
ref: r,
|
|
118
|
-
onMouseDown: p(e.onMouseDown, (t) => {
|
|
119
|
-
o ? u.onItemFocus(m) : t.preventDefault();
|
|
120
|
-
}),
|
|
121
|
-
onFocus: p(e.onFocus, () => u.onItemFocus(m)),
|
|
122
|
-
onKeyDown: p(e.onKeyDown, (t) => {
|
|
123
|
-
if (t.key === "Tab" && t.shiftKey) {
|
|
124
|
-
u.onItemShiftTab();
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
if (t.target !== t.currentTarget) return;
|
|
128
|
-
const i = se(t, u.orientation, u.dir);
|
|
129
|
-
if (i !== void 0) {
|
|
130
|
-
if (t.metaKey || t.ctrlKey || t.altKey || t.shiftKey) return;
|
|
131
|
-
t.preventDefault();
|
|
132
|
-
let a = F().filter((l) => l.focusable).map((l) => l.ref.current);
|
|
133
|
-
if (i === "last") a.reverse();
|
|
134
|
-
else if (i === "prev" || i === "next") {
|
|
135
|
-
i === "prev" && a.reverse();
|
|
136
|
-
const l = a.indexOf(t.currentTarget);
|
|
137
|
-
a = u.loop ? ce(a, l + 1) : a.slice(l + 1);
|
|
138
|
-
}
|
|
139
|
-
setTimeout(() => M(a));
|
|
140
|
-
}
|
|
141
|
-
}),
|
|
142
|
-
children: typeof v == "function" ? v({ isCurrentTabStop: b, hasTabStop: E != null }) : v
|
|
143
|
-
}
|
|
144
|
-
)
|
|
145
|
-
}
|
|
146
|
-
);
|
|
147
|
-
}
|
|
148
|
-
);
|
|
149
|
-
j.displayName = K;
|
|
150
|
-
var re = {
|
|
151
|
-
ArrowLeft: "prev",
|
|
152
|
-
ArrowUp: "prev",
|
|
153
|
-
ArrowRight: "next",
|
|
154
|
-
ArrowDown: "next",
|
|
155
|
-
PageUp: "first",
|
|
156
|
-
Home: "first",
|
|
157
|
-
PageDown: "last",
|
|
158
|
-
End: "last"
|
|
159
|
-
};
|
|
160
|
-
function ne(e, r) {
|
|
161
|
-
return r !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
|
|
162
|
-
}
|
|
163
|
-
function se(e, r, c) {
|
|
164
|
-
const o = ne(e.key, c);
|
|
165
|
-
if (!(r === "vertical" && ["ArrowLeft", "ArrowRight"].includes(o)) && !(r === "horizontal" && ["ArrowUp", "ArrowDown"].includes(o)))
|
|
166
|
-
return re[o];
|
|
167
|
-
}
|
|
168
|
-
function M(e, r = !1) {
|
|
169
|
-
const c = document.activeElement;
|
|
170
|
-
for (const o of e)
|
|
171
|
-
if (o === c || (o.focus({ preventScroll: r }), document.activeElement !== c)) return;
|
|
172
|
-
}
|
|
173
|
-
function ce(e, r) {
|
|
174
|
-
return e.map((c, o) => e[(r + o) % e.length]);
|
|
1
|
+
import { constructFrom as e } from "./index286.js";
|
|
2
|
+
import { toDate as c } from "./index287.js";
|
|
3
|
+
function u(i, f) {
|
|
4
|
+
let t, o = f?.in;
|
|
5
|
+
return i.forEach((r) => {
|
|
6
|
+
!o && typeof r == "object" && (o = e.bind(null, r));
|
|
7
|
+
const n = c(r, o);
|
|
8
|
+
(!t || t > n || isNaN(+n)) && (t = n);
|
|
9
|
+
}), e(o, t || NaN);
|
|
175
10
|
}
|
|
176
|
-
var ge = O, Re = j;
|
|
177
11
|
export {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
O as RovingFocusGroup,
|
|
181
|
-
j as RovingFocusGroupItem,
|
|
182
|
-
Fe as createRovingFocusGroupScope
|
|
12
|
+
u as default,
|
|
13
|
+
u as min
|
|
183
14
|
};
|
|
184
15
|
//# sourceMappingURL=index240.js.map
|
package/dist/index240.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index240.js","sources":["../../../node_modules/@radix-ui/react-roving-focus/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/roving-focus-group.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { createCollection } from \"@radix-ui/react-collection\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useId } from \"@radix-ui/react-id\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { useDirection } from \"@radix-ui/react-direction\";\nimport { jsx } from \"react/jsx-runtime\";\nvar ENTRY_FOCUS = \"rovingFocusGroup.onEntryFocus\";\nvar EVENT_OPTIONS = { bubbles: false, cancelable: true };\nvar GROUP_NAME = \"RovingFocusGroup\";\nvar [Collection, useCollection, createCollectionScope] = createCollection(GROUP_NAME);\nvar [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(\n GROUP_NAME,\n [createCollectionScope]\n);\nvar [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);\nvar RovingFocusGroup = React.forwardRef(\n (props, forwardedRef) => {\n return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) });\n }\n);\nRovingFocusGroup.displayName = GROUP_NAME;\nvar RovingFocusGroupImpl = React.forwardRef((props, forwardedRef) => {\n const {\n __scopeRovingFocusGroup,\n orientation,\n loop = false,\n dir,\n currentTabStopId: currentTabStopIdProp,\n defaultCurrentTabStopId,\n onCurrentTabStopIdChange,\n onEntryFocus,\n preventScrollOnEntryFocus = false,\n ...groupProps\n } = props;\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const direction = useDirection(dir);\n const [currentTabStopId, setCurrentTabStopId] = useControllableState({\n prop: currentTabStopIdProp,\n defaultProp: defaultCurrentTabStopId ?? null,\n onChange: onCurrentTabStopIdChange,\n caller: GROUP_NAME\n });\n const [isTabbingBackOut, setIsTabbingBackOut] = React.useState(false);\n const handleEntryFocus = useCallbackRef(onEntryFocus);\n const getItems = useCollection(__scopeRovingFocusGroup);\n const isClickFocusRef = React.useRef(false);\n const [focusableItemsCount, setFocusableItemsCount] = React.useState(0);\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n node.addEventListener(ENTRY_FOCUS, handleEntryFocus);\n return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);\n }\n }, [handleEntryFocus]);\n return /* @__PURE__ */ jsx(\n RovingFocusProvider,\n {\n scope: __scopeRovingFocusGroup,\n orientation,\n dir: direction,\n loop,\n currentTabStopId,\n onItemFocus: React.useCallback(\n (tabStopId) => setCurrentTabStopId(tabStopId),\n [setCurrentTabStopId]\n ),\n onItemShiftTab: React.useCallback(() => setIsTabbingBackOut(true), []),\n onFocusableItemAdd: React.useCallback(\n () => setFocusableItemsCount((prevCount) => prevCount + 1),\n []\n ),\n onFocusableItemRemove: React.useCallback(\n () => setFocusableItemsCount((prevCount) => prevCount - 1),\n []\n ),\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,\n \"data-orientation\": orientation,\n ...groupProps,\n ref: composedRefs,\n style: { outline: \"none\", ...props.style },\n onMouseDown: composeEventHandlers(props.onMouseDown, () => {\n isClickFocusRef.current = true;\n }),\n onFocus: composeEventHandlers(props.onFocus, (event) => {\n const isKeyboardFocus = !isClickFocusRef.current;\n if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {\n const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);\n event.currentTarget.dispatchEvent(entryFocusEvent);\n if (!entryFocusEvent.defaultPrevented) {\n const items = getItems().filter((item) => item.focusable);\n const activeItem = items.find((item) => item.active);\n const currentItem = items.find((item) => item.id === currentTabStopId);\n const candidateItems = [activeItem, currentItem, ...items].filter(\n Boolean\n );\n const candidateNodes = candidateItems.map((item) => item.ref.current);\n focusFirst(candidateNodes, preventScrollOnEntryFocus);\n }\n }\n isClickFocusRef.current = false;\n }),\n onBlur: composeEventHandlers(props.onBlur, () => setIsTabbingBackOut(false))\n }\n )\n }\n );\n});\nvar ITEM_NAME = \"RovingFocusGroupItem\";\nvar RovingFocusGroupItem = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeRovingFocusGroup,\n focusable = true,\n active = false,\n tabStopId,\n children,\n ...itemProps\n } = props;\n const autoId = useId();\n const id = tabStopId || autoId;\n const context = useRovingFocusContext(ITEM_NAME, __scopeRovingFocusGroup);\n const isCurrentTabStop = context.currentTabStopId === id;\n const getItems = useCollection(__scopeRovingFocusGroup);\n const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;\n React.useEffect(() => {\n if (focusable) {\n onFocusableItemAdd();\n return () => onFocusableItemRemove();\n }\n }, [focusable, onFocusableItemAdd, onFocusableItemRemove]);\n return /* @__PURE__ */ jsx(\n Collection.ItemSlot,\n {\n scope: __scopeRovingFocusGroup,\n id,\n focusable,\n active,\n children: /* @__PURE__ */ jsx(\n Primitive.span,\n {\n tabIndex: isCurrentTabStop ? 0 : -1,\n \"data-orientation\": context.orientation,\n ...itemProps,\n ref: forwardedRef,\n onMouseDown: composeEventHandlers(props.onMouseDown, (event) => {\n if (!focusable) event.preventDefault();\n else context.onItemFocus(id);\n }),\n onFocus: composeEventHandlers(props.onFocus, () => context.onItemFocus(id)),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n if (event.key === \"Tab\" && event.shiftKey) {\n context.onItemShiftTab();\n return;\n }\n if (event.target !== event.currentTarget) return;\n const focusIntent = getFocusIntent(event, context.orientation, context.dir);\n if (focusIntent !== void 0) {\n if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;\n event.preventDefault();\n const items = getItems().filter((item) => item.focusable);\n let candidateNodes = items.map((item) => item.ref.current);\n if (focusIntent === \"last\") candidateNodes.reverse();\n else if (focusIntent === \"prev\" || focusIntent === \"next\") {\n if (focusIntent === \"prev\") candidateNodes.reverse();\n const currentIndex = candidateNodes.indexOf(event.currentTarget);\n candidateNodes = context.loop ? wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);\n }\n setTimeout(() => focusFirst(candidateNodes));\n }\n }),\n children: typeof children === \"function\" ? children({ isCurrentTabStop, hasTabStop: currentTabStopId != null }) : children\n }\n )\n }\n );\n }\n);\nRovingFocusGroupItem.displayName = ITEM_NAME;\nvar MAP_KEY_TO_FOCUS_INTENT = {\n ArrowLeft: \"prev\",\n ArrowUp: \"prev\",\n ArrowRight: \"next\",\n ArrowDown: \"next\",\n PageUp: \"first\",\n Home: \"first\",\n PageDown: \"last\",\n End: \"last\"\n};\nfunction getDirectionAwareKey(key, dir) {\n if (dir !== \"rtl\") return key;\n return key === \"ArrowLeft\" ? \"ArrowRight\" : key === \"ArrowRight\" ? \"ArrowLeft\" : key;\n}\nfunction getFocusIntent(event, orientation, dir) {\n const key = getDirectionAwareKey(event.key, dir);\n if (orientation === \"vertical\" && [\"ArrowLeft\", \"ArrowRight\"].includes(key)) return void 0;\n if (orientation === \"horizontal\" && [\"ArrowUp\", \"ArrowDown\"].includes(key)) return void 0;\n return MAP_KEY_TO_FOCUS_INTENT[key];\n}\nfunction focusFirst(candidates, preventScroll = false) {\n const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n for (const candidate of candidates) {\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate.focus({ preventScroll });\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n}\nfunction wrapArray(array, startIndex) {\n return array.map((_, index) => array[(startIndex + index) % array.length]);\n}\nvar Root = RovingFocusGroup;\nvar Item = RovingFocusGroupItem;\nexport {\n Item,\n Root,\n RovingFocusGroup,\n RovingFocusGroupItem,\n createRovingFocusGroupScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["ENTRY_FOCUS","EVENT_OPTIONS","GROUP_NAME","Collection","useCollection","createCollectionScope","createCollection","createRovingFocusGroupContext","createRovingFocusGroupScope","createContextScope","RovingFocusProvider","useRovingFocusContext","RovingFocusGroup","React","props","forwardedRef","jsx","RovingFocusGroupImpl","__scopeRovingFocusGroup","orientation","loop","dir","currentTabStopIdProp","defaultCurrentTabStopId","onCurrentTabStopIdChange","onEntryFocus","preventScrollOnEntryFocus","groupProps","ref","composedRefs","useComposedRefs","direction","useDirection","currentTabStopId","setCurrentTabStopId","useControllableState","isTabbingBackOut","setIsTabbingBackOut","handleEntryFocus","useCallbackRef","getItems","isClickFocusRef","focusableItemsCount","setFocusableItemsCount","node","tabStopId","prevCount","Primitive","composeEventHandlers","event","isKeyboardFocus","entryFocusEvent","items","item","activeItem","currentItem","candidateNodes","focusFirst","ITEM_NAME","RovingFocusGroupItem","focusable","active","children","itemProps","autoId","useId","id","context","isCurrentTabStop","onFocusableItemAdd","onFocusableItemRemove","focusIntent","getFocusIntent","currentIndex","wrapArray","MAP_KEY_TO_FOCUS_INTENT","getDirectionAwareKey","key","candidates","preventScroll","PREVIOUSLY_FOCUSED_ELEMENT","candidate","array","startIndex","_","index","Root","Item"],"mappings":";;;;;;;;;;;AAcA,IAAIA,IAAc,iCACdC,IAAgB,EAAE,SAAS,IAAO,YAAY,GAAI,GAClDC,IAAa,oBACb,CAACC,GAAYC,GAAeC,CAAqB,IAAIC,EAAiBJ,CAAU,GAChF,CAACK,GAA+BC,EAA2B,IAAIC;AAAA,EACjEP;AAAA,EACA,CAACG,CAAqB;AACxB,GACI,CAACK,IAAqBC,EAAqB,IAAIJ,EAA8BL,CAAU,GACvFU,IAAmBC,EAAM;AAAA,EAC3B,CAACC,GAAOC,MACiBC,gBAAAA,MAAIb,EAAW,UAAU,EAAE,OAAOW,EAAM,yBAAyB,UAA0BE,gBAAAA,MAAIb,EAAW,MAAM,EAAE,OAAOW,EAAM,yBAAyB,UAA0BE,gBAAAA,EAAAA,IAAIC,IAAsB,EAAE,GAAGH,GAAO,KAAKC,GAAc,EAAC,CAAE,EAAC,CAAE;AAE5Q;AACAH,EAAiB,cAAcV;AAC/B,IAAIe,KAAuBJ,EAAM,WAAW,CAACC,GAAOC,MAAiB;AACnE,QAAM;AAAA,IACJ,yBAAAG;AAAA,IACA,aAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,KAAAC;AAAA,IACA,kBAAkBC;AAAA,IAClB,yBAAAC;AAAA,IACA,0BAAAC;AAAA,IACA,cAAAC;AAAA,IACA,2BAAAC,IAA4B;AAAA,IAC5B,GAAGC;AAAA,EACP,IAAMb,GACEc,IAAMf,EAAM,OAAO,IAAI,GACvBgB,IAAeC,EAAgBf,GAAca,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EAAWqB,GAAYC,IAAgB,IAAO;AACrD,QAAMC,IAA6B,SAAS;AAC5C,aAAWC,KAAaH;AAGtB,QAFIG,MAAcD,MAClBC,EAAU,MAAM,EAAE,eAAAF,GAAe,GAC7B,SAAS,kBAAkBC,GAA4B;AAE/D;AACA,SAASN,GAAUQ,GAAOC,GAAY;AACpC,SAAOD,EAAM,IAAI,CAACE,GAAGC,MAAUH,GAAOC,IAAaE,KAASH,EAAM,MAAM,CAAC;AAC3E;AACG,IAACI,KAAO1E,GACP2E,KAAO5B;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index240.js","sources":["../../../node_modules/date-fns/min.js"],"sourcesContent":["import { constructFrom } from \"./constructFrom.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link min} function options.\n */\n\n/**\n * @name min\n * @category Common Helpers\n * @summary Returns the earliest of the given dates.\n *\n * @description\n * Returns the earliest of the given dates.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param dates - The dates to compare\n *\n * @returns The earliest of the dates\n *\n * @example\n * // Which of these dates is the earliest?\n * const result = min([\n * new Date(1989, 6, 10),\n * new Date(1987, 1, 11),\n * new Date(1995, 6, 2),\n * new Date(1990, 0, 1)\n * ])\n * //=> Wed Feb 11 1987 00:00:00\n */\nexport function min(dates, options) {\n let result;\n let context = options?.in;\n\n dates.forEach((date) => {\n // Use the first date object as the context function\n if (!context && typeof date === \"object\")\n context = constructFrom.bind(null, date);\n\n const date_ = toDate(date, context);\n if (!result || result > date_ || isNaN(+date_)) result = date_;\n });\n\n return constructFrom(context, result || NaN);\n}\n\n// Fallback for modularized imports:\nexport default min;\n"],"names":["min","dates","options","result","context","date","constructFrom","date_","toDate"],"mappings":";;AAgCO,SAASA,EAAIC,GAAOC,GAAS;AAClC,MAAIC,GACAC,IAAUF,GAAS;AAEvB,SAAAD,EAAM,QAAQ,CAACI,MAAS;AAEtB,IAAI,CAACD,KAAW,OAAOC,KAAS,aAC9BD,IAAUE,EAAc,KAAK,MAAMD,CAAI;AAEzC,UAAME,IAAQC,EAAOH,GAAMD,CAAO;AAClC,KAAI,CAACD,KAAUA,IAASI,KAAS,MAAM,CAACA,CAAK,OAAGJ,IAASI;AAAA,EAC3D,CAAC,GAEMD,EAAcF,GAASD,KAAU,GAAG;AAC7C;","x_google_ignoreList":[0]}
|
package/dist/index241.js
CHANGED
|
@@ -1,50 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const f = a.props.children, d = s.map((p) => p === a ? l.Children.count(f) > 1 ? l.Children.only(null) : l.isValidElement(f) ? f.props.children : null : p);
|
|
10
|
-
return /* @__PURE__ */ u.jsx(r, { ...c, ref: n, children: l.isValidElement(f) ? l.cloneElement(f, void 0, d) : null });
|
|
11
|
-
}
|
|
12
|
-
return /* @__PURE__ */ u.jsx(r, { ...c, ref: n, children: i });
|
|
13
|
-
});
|
|
14
|
-
return t.displayName = `${e}.Slot`, t;
|
|
15
|
-
}
|
|
16
|
-
// @__NO_SIDE_EFFECTS__
|
|
17
|
-
function y(e) {
|
|
18
|
-
const r = l.forwardRef((t, o) => {
|
|
19
|
-
const { children: n, ...i } = t;
|
|
20
|
-
if (l.isValidElement(n)) {
|
|
21
|
-
const c = R(n), s = C(i, n.props);
|
|
22
|
-
return n.type !== l.Fragment && (s.ref = o ? m(o, c) : c), l.cloneElement(n, s);
|
|
23
|
-
}
|
|
24
|
-
return l.Children.count(n) > 1 ? l.Children.only(null) : null;
|
|
25
|
-
});
|
|
26
|
-
return r.displayName = `${e}.SlotClone`, r;
|
|
27
|
-
}
|
|
28
|
-
var E = /* @__PURE__ */ Symbol("radix.slottable");
|
|
29
|
-
function g(e) {
|
|
30
|
-
return l.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === E;
|
|
31
|
-
}
|
|
32
|
-
function C(e, r) {
|
|
33
|
-
const t = { ...r };
|
|
34
|
-
for (const o in r) {
|
|
35
|
-
const n = e[o], i = r[o];
|
|
36
|
-
/^on[A-Z]/.test(o) ? n && i ? t[o] = (...s) => {
|
|
37
|
-
const a = i(...s);
|
|
38
|
-
return n(...s), a;
|
|
39
|
-
} : n && (t[o] = n) : o === "style" ? t[o] = { ...n, ...i } : o === "className" && (t[o] = [n, i].filter(Boolean).join(" "));
|
|
40
|
-
}
|
|
41
|
-
return { ...e, ...t };
|
|
42
|
-
}
|
|
43
|
-
function R(e) {
|
|
44
|
-
let r = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, t = r && "isReactWarning" in r && r.isReactWarning;
|
|
45
|
-
return t ? e.ref : (r = Object.getOwnPropertyDescriptor(e, "ref")?.get, t = r && "isReactWarning" in r && r.isReactWarning, t ? e.props.ref : e.props.ref || e.ref);
|
|
1
|
+
import { constructFrom as m } from "./index286.js";
|
|
2
|
+
import { getDaysInMonth as i } from "./index298.js";
|
|
3
|
+
import { toDate as u } from "./index287.js";
|
|
4
|
+
function l(n, e, r) {
|
|
5
|
+
const t = u(n, r?.in), s = t.getFullYear(), a = t.getDate(), o = m(n, 0);
|
|
6
|
+
o.setFullYear(s, e, 15), o.setHours(0, 0, 0, 0);
|
|
7
|
+
const c = i(o);
|
|
8
|
+
return t.setMonth(e, Math.min(a, c)), t;
|
|
46
9
|
}
|
|
47
10
|
export {
|
|
48
|
-
|
|
11
|
+
l as default,
|
|
12
|
+
l as setMonth
|
|
49
13
|
};
|
|
50
14
|
//# sourceMappingURL=index241.js.map
|
package/dist/index241.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index241.js","sources":["../../../node_modules
|
|
1
|
+
{"version":3,"file":"index241.js","sources":["../../../node_modules/date-fns/setMonth.js"],"sourcesContent":["import { constructFrom } from \"./constructFrom.js\";\nimport { getDaysInMonth } from \"./getDaysInMonth.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link setMonth} function options.\n */\n\n/**\n * @name setMonth\n * @category Month Helpers\n * @summary Set the month to the given date.\n *\n * @description\n * Set the month to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param month - The month index to set (0-11)\n * @param options - The options\n *\n * @returns The new date with the month set\n *\n * @example\n * // Set February to 1 September 2014:\n * const result = setMonth(new Date(2014, 8, 1), 1)\n * //=> Sat Feb 01 2014 00:00:00\n */\nexport function setMonth(date, month, options) {\n const _date = toDate(date, options?.in);\n const year = _date.getFullYear();\n const day = _date.getDate();\n\n const midMonth = constructFrom(options?.in || date, 0);\n midMonth.setFullYear(year, month, 15);\n midMonth.setHours(0, 0, 0, 0);\n const daysInMonth = getDaysInMonth(midMonth);\n\n // Set the earlier date, allows to wrap Jan 31 to Feb 28\n _date.setMonth(month, Math.min(day, daysInMonth));\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setMonth;\n"],"names":["setMonth","date","month","options","_date","toDate","year","day","midMonth","constructFrom","daysInMonth","getDaysInMonth"],"mappings":";;;AA8BO,SAASA,EAASC,GAAMC,GAAOC,GAAS;AAC7C,QAAMC,IAAQC,EAAOJ,GAAME,GAAS,EAAE,GAChCG,IAAOF,EAAM,YAAW,GACxBG,IAAMH,EAAM,QAAO,GAEnBI,IAAWC,EAA6BR,GAAM,CAAC;AACrD,EAAAO,EAAS,YAAYF,GAAMJ,GAAO,EAAE,GACpCM,EAAS,SAAS,GAAG,GAAG,GAAG,CAAC;AAC5B,QAAME,IAAcC,EAAeH,CAAQ;AAG3C,SAAAJ,EAAM,SAASF,GAAO,KAAK,IAAIK,GAAKG,CAAW,CAAC,GACzCN;AACT;","x_google_ignoreList":[0]}
|
package/dist/index242.js
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
r && (e = new h(e.metadata), e.selectNumberingPlan(r));
|
|
7
|
-
var f = e.type(u), n = f && f.possibleLengths() || e.possibleLengths();
|
|
8
|
-
if (!n)
|
|
9
|
-
return "IS_POSSIBLE";
|
|
10
|
-
var t = i.length, l = n[0];
|
|
11
|
-
return l === t ? "IS_POSSIBLE" : l > t ? "TOO_SHORT" : n[n.length - 1] < t ? "TOO_LONG" : n.indexOf(t, 1) >= 0 ? "IS_POSSIBLE" : "INVALID_LENGTH";
|
|
1
|
+
import { constructFrom as a } from "./index286.js";
|
|
2
|
+
import { toDate as n } from "./index287.js";
|
|
3
|
+
function u(r, o, e) {
|
|
4
|
+
const t = n(r, e?.in);
|
|
5
|
+
return isNaN(+t) ? a(r, NaN) : (t.setFullYear(o), t);
|
|
12
6
|
}
|
|
13
7
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
u as default,
|
|
9
|
+
u as setYear
|
|
16
10
|
};
|
|
17
11
|
//# sourceMappingURL=index242.js.map
|
package/dist/index242.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index242.js","sources":["../../../node_modules/
|
|
1
|
+
{"version":3,"file":"index242.js","sources":["../../../node_modules/date-fns/setYear.js"],"sourcesContent":["import { constructFrom } from \"./constructFrom.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link setYear} function options.\n */\n\n/**\n * @name setYear\n * @category Year Helpers\n * @summary Set the year to the given date.\n *\n * @description\n * Set the year to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param year - The year of the new date\n * @param options - An object with options.\n *\n * @returns The new date with the year set\n *\n * @example\n * // Set year 2013 to 1 September 2014:\n * const result = setYear(new Date(2014, 8, 1), 2013)\n * //=> Sun Sep 01 2013 00:00:00\n */\nexport function setYear(date, year, options) {\n const date_ = toDate(date, options?.in);\n\n // Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date\n if (isNaN(+date_)) return constructFrom(options?.in || date, NaN);\n\n date_.setFullYear(year);\n return date_;\n}\n\n// Fallback for modularized imports:\nexport default setYear;\n"],"names":["setYear","date","year","options","date_","toDate","constructFrom"],"mappings":";;AA6BO,SAASA,EAAQC,GAAMC,GAAMC,GAAS;AAC3C,QAAMC,IAAQC,EAAOJ,GAAME,GAAS,EAAE;AAGtC,SAAI,MAAM,CAACC,CAAK,IAAUE,EAA6BL,GAAM,GAAG,KAEhEG,EAAM,YAAYF,CAAI,GACfE;AACT;","x_google_ignoreList":[0]}
|