@dyrected/admin 2.5.58 → 2.5.60
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/admin.css +95 -107
- package/dist/components/ui/calendar.d.ts +7 -7
- package/dist/hooks/use-debounced-value.d.ts +6 -0
- package/dist/index.mjs +151 -147
- package/package.json +5 -5
package/dist/admin.css
CHANGED
|
@@ -1122,6 +1122,10 @@
|
|
|
1122
1122
|
left: 0px;
|
|
1123
1123
|
}
|
|
1124
1124
|
|
|
1125
|
+
.dy-left-1{
|
|
1126
|
+
left: 0.25rem;
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1125
1129
|
.dy-left-1\/2{
|
|
1126
1130
|
left: 50%;
|
|
1127
1131
|
}
|
|
@@ -1491,11 +1495,6 @@
|
|
|
1491
1495
|
height: 1rem;
|
|
1492
1496
|
}
|
|
1493
1497
|
|
|
1494
|
-
.dy-size-\[--cell-size\]{
|
|
1495
|
-
width: var(--cell-size);
|
|
1496
|
-
height: var(--cell-size);
|
|
1497
|
-
}
|
|
1498
|
-
|
|
1499
1498
|
.dy-h-1\.5{
|
|
1500
1499
|
height: 0.375rem;
|
|
1501
1500
|
}
|
|
@@ -1580,10 +1579,6 @@
|
|
|
1580
1579
|
height: 2.25rem;
|
|
1581
1580
|
}
|
|
1582
1581
|
|
|
1583
|
-
.dy-h-\[--cell-size\]{
|
|
1584
|
-
height: var(--cell-size);
|
|
1585
|
-
}
|
|
1586
|
-
|
|
1587
1582
|
.dy-h-\[15px\]{
|
|
1588
1583
|
height: 15px;
|
|
1589
1584
|
}
|
|
@@ -1912,10 +1907,6 @@
|
|
|
1912
1907
|
width: 24rem;
|
|
1913
1908
|
}
|
|
1914
1909
|
|
|
1915
|
-
.dy-w-\[--cell-size\]{
|
|
1916
|
-
width: var(--cell-size);
|
|
1917
|
-
}
|
|
1918
|
-
|
|
1919
1910
|
.dy-w-\[--radix-dropdown-menu-trigger-width\]{
|
|
1920
1911
|
width: var(--radix-dropdown-menu-trigger-width);
|
|
1921
1912
|
}
|
|
@@ -2021,10 +2012,6 @@
|
|
|
2021
2012
|
min-width: 2.25rem;
|
|
2022
2013
|
}
|
|
2023
2014
|
|
|
2024
|
-
.dy-min-w-\[--cell-size\]{
|
|
2025
|
-
min-width: var(--cell-size);
|
|
2026
|
-
}
|
|
2027
|
-
|
|
2028
2015
|
.dy-min-w-\[100px\]{
|
|
2029
2016
|
min-width: 100px;
|
|
2030
2017
|
}
|
|
@@ -2458,6 +2445,12 @@
|
|
|
2458
2445
|
row-gap: 1.5rem;
|
|
2459
2446
|
}
|
|
2460
2447
|
|
|
2448
|
+
.dy-space-x-1 > :not([hidden]) ~ :not([hidden]){
|
|
2449
|
+
--tw-space-x-reverse: 0;
|
|
2450
|
+
margin-right: calc(0.25rem * var(--tw-space-x-reverse));
|
|
2451
|
+
margin-left: calc(0.25rem * calc(1 - var(--tw-space-x-reverse)));
|
|
2452
|
+
}
|
|
2453
|
+
|
|
2461
2454
|
.dy-space-y-0 > :not([hidden]) ~ :not([hidden]){
|
|
2462
2455
|
--tw-space-y-reverse: 0;
|
|
2463
2456
|
margin-top: calc(0px * calc(1 - var(--tw-space-y-reverse)));
|
|
@@ -2608,10 +2601,6 @@
|
|
|
2608
2601
|
border-radius: calc(var(--radius) - 2px);
|
|
2609
2602
|
}
|
|
2610
2603
|
|
|
2611
|
-
.dy-rounded-none{
|
|
2612
|
-
border-radius: 0px;
|
|
2613
|
-
}
|
|
2614
|
-
|
|
2615
2604
|
.dy-rounded-sm{
|
|
2616
2605
|
border-radius: calc(var(--radius) - 4px);
|
|
2617
2606
|
}
|
|
@@ -2625,16 +2614,6 @@
|
|
|
2625
2614
|
border-bottom-left-radius: calc(var(--radius) - 2px);
|
|
2626
2615
|
}
|
|
2627
2616
|
|
|
2628
|
-
.dy-rounded-l-md{
|
|
2629
|
-
border-top-left-radius: calc(var(--radius) - 2px);
|
|
2630
|
-
border-bottom-left-radius: calc(var(--radius) - 2px);
|
|
2631
|
-
}
|
|
2632
|
-
|
|
2633
|
-
.dy-rounded-r-md{
|
|
2634
|
-
border-top-right-radius: calc(var(--radius) - 2px);
|
|
2635
|
-
border-bottom-right-radius: calc(var(--radius) - 2px);
|
|
2636
|
-
}
|
|
2637
|
-
|
|
2638
2617
|
.dy-rounded-t-md{
|
|
2639
2618
|
border-top-left-radius: calc(var(--radius) - 2px);
|
|
2640
2619
|
border-top-right-radius: calc(var(--radius) - 2px);
|
|
@@ -3289,11 +3268,6 @@
|
|
|
3289
3268
|
padding-right: 2rem;
|
|
3290
3269
|
}
|
|
3291
3270
|
|
|
3292
|
-
.dy-px-\[--cell-size\]{
|
|
3293
|
-
padding-left: var(--cell-size);
|
|
3294
|
-
padding-right: var(--cell-size);
|
|
3295
|
-
}
|
|
3296
|
-
|
|
3297
3271
|
.dy-py-0{
|
|
3298
3272
|
padding-top: 0px;
|
|
3299
3273
|
padding-bottom: 0px;
|
|
@@ -3446,6 +3420,10 @@
|
|
|
3446
3420
|
padding-top: 0.125rem;
|
|
3447
3421
|
}
|
|
3448
3422
|
|
|
3423
|
+
.dy-pt-1{
|
|
3424
|
+
padding-top: 0.25rem;
|
|
3425
|
+
}
|
|
3426
|
+
|
|
3449
3427
|
.dy-pt-2{
|
|
3450
3428
|
padding-top: 0.5rem;
|
|
3451
3429
|
}
|
|
@@ -4286,10 +4264,6 @@
|
|
|
4286
4264
|
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
|
4287
4265
|
}
|
|
4288
4266
|
|
|
4289
|
-
.\[--cell-size\:2\.25rem\]{
|
|
4290
|
-
--cell-size: 2.25rem;
|
|
4291
|
-
}
|
|
4292
|
-
|
|
4293
4267
|
.\[appearance\:textfield\]{
|
|
4294
4268
|
-webkit-appearance: textfield;
|
|
4295
4269
|
-moz-appearance: textfield;
|
|
@@ -4747,6 +4721,14 @@
|
|
|
4747
4721
|
border-bottom-width: 0px;
|
|
4748
4722
|
}
|
|
4749
4723
|
|
|
4724
|
+
.focus-within\:dy-relative:focus-within{
|
|
4725
|
+
position: relative;
|
|
4726
|
+
}
|
|
4727
|
+
|
|
4728
|
+
.focus-within\:dy-z-20:focus-within{
|
|
4729
|
+
z-index: 20;
|
|
4730
|
+
}
|
|
4731
|
+
|
|
4750
4732
|
.hover\:dy-scale-\[1\.02\]:hover{
|
|
4751
4733
|
--tw-scale-x: 1.02;
|
|
4752
4734
|
--tw-scale-y: 1.02;
|
|
@@ -4841,6 +4823,10 @@
|
|
|
4841
4823
|
background-color: hsl(var(--muted) / 0.8);
|
|
4842
4824
|
}
|
|
4843
4825
|
|
|
4826
|
+
.hover\:dy-bg-primary:hover{
|
|
4827
|
+
background-color: hsl(var(--primary));
|
|
4828
|
+
}
|
|
4829
|
+
|
|
4844
4830
|
.hover\:dy-bg-primary\/10:hover{
|
|
4845
4831
|
background-color: hsl(var(--primary) / 0.1);
|
|
4846
4832
|
}
|
|
@@ -4897,6 +4883,10 @@
|
|
|
4897
4883
|
color: hsl(var(--primary));
|
|
4898
4884
|
}
|
|
4899
4885
|
|
|
4886
|
+
.hover\:dy-text-primary-foreground:hover{
|
|
4887
|
+
color: hsl(var(--primary-foreground));
|
|
4888
|
+
}
|
|
4889
|
+
|
|
4900
4890
|
.hover\:dy-text-sidebar-accent-foreground:hover{
|
|
4901
4891
|
color: hsl(var(--sidebar-accent-foreground));
|
|
4902
4892
|
}
|
|
@@ -4950,6 +4940,10 @@
|
|
|
4950
4940
|
background-color: hsl(var(--destructive) / 0.1);
|
|
4951
4941
|
}
|
|
4952
4942
|
|
|
4943
|
+
.focus\:dy-bg-primary:focus{
|
|
4944
|
+
background-color: hsl(var(--primary));
|
|
4945
|
+
}
|
|
4946
|
+
|
|
4953
4947
|
.focus\:dy-text-accent-foreground:focus{
|
|
4954
4948
|
color: hsl(var(--accent-foreground));
|
|
4955
4949
|
}
|
|
@@ -4958,6 +4952,10 @@
|
|
|
4958
4952
|
color: hsl(var(--destructive));
|
|
4959
4953
|
}
|
|
4960
4954
|
|
|
4955
|
+
.focus\:dy-text-primary-foreground:focus{
|
|
4956
|
+
color: hsl(var(--primary-foreground));
|
|
4957
|
+
}
|
|
4958
|
+
|
|
4961
4959
|
.focus\:dy-opacity-100:focus{
|
|
4962
4960
|
opacity: 1;
|
|
4963
4961
|
}
|
|
@@ -5202,8 +5200,28 @@
|
|
|
5202
5200
|
opacity: 0.5;
|
|
5203
5201
|
}
|
|
5204
5202
|
|
|
5205
|
-
.aria-selected\:dy-
|
|
5206
|
-
color: hsl(var(--
|
|
5203
|
+
.aria-selected\:dy-bg-accent[aria-selected="true"]{
|
|
5204
|
+
background-color: hsl(var(--accent));
|
|
5205
|
+
}
|
|
5206
|
+
|
|
5207
|
+
.aria-selected\:dy-bg-accent\/50[aria-selected="true"]{
|
|
5208
|
+
background-color: hsl(var(--accent) / 0.5);
|
|
5209
|
+
}
|
|
5210
|
+
|
|
5211
|
+
.aria-selected\:dy-text-accent-foreground[aria-selected="true"]{
|
|
5212
|
+
color: hsl(var(--accent-foreground));
|
|
5213
|
+
}
|
|
5214
|
+
|
|
5215
|
+
.aria-selected\:dy-text-muted-foreground[aria-selected="true"]{
|
|
5216
|
+
color: hsl(var(--muted-foreground));
|
|
5217
|
+
}
|
|
5218
|
+
|
|
5219
|
+
.aria-selected\:dy-opacity-100[aria-selected="true"]{
|
|
5220
|
+
opacity: 1;
|
|
5221
|
+
}
|
|
5222
|
+
|
|
5223
|
+
.aria-selected\:dy-opacity-30[aria-selected="true"]{
|
|
5224
|
+
opacity: 0.3;
|
|
5207
5225
|
}
|
|
5208
5226
|
|
|
5209
5227
|
.data-\[disabled\=true\]\:dy-pointer-events-none[data-disabled="true"]{
|
|
@@ -5244,24 +5262,6 @@
|
|
|
5244
5262
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
5245
5263
|
}
|
|
5246
5264
|
|
|
5247
|
-
.data-\[range-middle\=true\]\:dy-rounded-none[data-range-middle="true"]{
|
|
5248
|
-
border-radius: 0px;
|
|
5249
|
-
}
|
|
5250
|
-
|
|
5251
|
-
.data-\[selected-single\=true\]\:dy-rounded-full[data-selected-single="true"]{
|
|
5252
|
-
border-radius: 9999px;
|
|
5253
|
-
}
|
|
5254
|
-
|
|
5255
|
-
.data-\[range-end\=true\]\:dy-rounded-r-md[data-range-end="true"]{
|
|
5256
|
-
border-top-right-radius: calc(var(--radius) - 2px);
|
|
5257
|
-
border-bottom-right-radius: calc(var(--radius) - 2px);
|
|
5258
|
-
}
|
|
5259
|
-
|
|
5260
|
-
.data-\[range-start\=true\]\:dy-rounded-l-md[data-range-start="true"]{
|
|
5261
|
-
border-top-left-radius: calc(var(--radius) - 2px);
|
|
5262
|
-
border-bottom-left-radius: calc(var(--radius) - 2px);
|
|
5263
|
-
}
|
|
5264
|
-
|
|
5265
5265
|
.data-\[state\=checked\]\:dy-border-primary[data-state="checked"]{
|
|
5266
5266
|
border-color: hsl(var(--primary));
|
|
5267
5267
|
}
|
|
@@ -5270,22 +5270,6 @@
|
|
|
5270
5270
|
background-color: hsl(var(--sidebar-accent));
|
|
5271
5271
|
}
|
|
5272
5272
|
|
|
5273
|
-
.data-\[range-end\=true\]\:dy-bg-primary[data-range-end="true"]{
|
|
5274
|
-
background-color: hsl(var(--primary));
|
|
5275
|
-
}
|
|
5276
|
-
|
|
5277
|
-
.data-\[range-middle\=true\]\:dy-bg-accent[data-range-middle="true"]{
|
|
5278
|
-
background-color: hsl(var(--accent));
|
|
5279
|
-
}
|
|
5280
|
-
|
|
5281
|
-
.data-\[range-start\=true\]\:dy-bg-primary[data-range-start="true"]{
|
|
5282
|
-
background-color: hsl(var(--primary));
|
|
5283
|
-
}
|
|
5284
|
-
|
|
5285
|
-
.data-\[selected-single\=true\]\:dy-bg-primary[data-selected-single="true"]{
|
|
5286
|
-
background-color: hsl(var(--primary));
|
|
5287
|
-
}
|
|
5288
|
-
|
|
5289
5273
|
.data-\[selected\=\'true\'\]\:dy-bg-accent[data-selected='true']{
|
|
5290
5274
|
background-color: hsl(var(--accent));
|
|
5291
5275
|
}
|
|
@@ -5334,22 +5318,6 @@
|
|
|
5334
5318
|
color: hsl(var(--muted-foreground));
|
|
5335
5319
|
}
|
|
5336
5320
|
|
|
5337
|
-
.data-\[range-end\=true\]\:dy-text-primary-foreground[data-range-end="true"]{
|
|
5338
|
-
color: hsl(var(--primary-foreground));
|
|
5339
|
-
}
|
|
5340
|
-
|
|
5341
|
-
.data-\[range-middle\=true\]\:dy-text-accent-foreground[data-range-middle="true"]{
|
|
5342
|
-
color: hsl(var(--accent-foreground));
|
|
5343
|
-
}
|
|
5344
|
-
|
|
5345
|
-
.data-\[range-start\=true\]\:dy-text-primary-foreground[data-range-start="true"]{
|
|
5346
|
-
color: hsl(var(--primary-foreground));
|
|
5347
|
-
}
|
|
5348
|
-
|
|
5349
|
-
.data-\[selected-single\=true\]\:dy-text-primary-foreground[data-selected-single="true"]{
|
|
5350
|
-
color: hsl(var(--primary-foreground));
|
|
5351
|
-
}
|
|
5352
|
-
|
|
5353
5321
|
.data-\[selected\=true\]\:dy-text-accent-foreground[data-selected="true"]{
|
|
5354
5322
|
color: hsl(var(--accent-foreground));
|
|
5355
5323
|
}
|
|
@@ -5382,12 +5350,6 @@
|
|
|
5382
5350
|
opacity: 1;
|
|
5383
5351
|
}
|
|
5384
5352
|
|
|
5385
|
-
.data-\[selected-single\=true\]\:dy-shadow-lg[data-selected-single="true"]{
|
|
5386
|
-
--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
|
|
5387
|
-
--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);
|
|
5388
|
-
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
|
5389
|
-
}
|
|
5390
|
-
|
|
5391
5353
|
.data-\[state\=active\]\:dy-shadow-sm[data-state="active"]{
|
|
5392
5354
|
--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
|
5393
5355
|
--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);
|
|
@@ -5815,6 +5777,18 @@
|
|
|
5815
5777
|
margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));
|
|
5816
5778
|
}
|
|
5817
5779
|
|
|
5780
|
+
.sm\:dy-space-x-4 > :not([hidden]) ~ :not([hidden]){
|
|
5781
|
+
--tw-space-x-reverse: 0;
|
|
5782
|
+
margin-right: calc(1rem * var(--tw-space-x-reverse));
|
|
5783
|
+
margin-left: calc(1rem * calc(1 - var(--tw-space-x-reverse)));
|
|
5784
|
+
}
|
|
5785
|
+
|
|
5786
|
+
.sm\:dy-space-y-0 > :not([hidden]) ~ :not([hidden]){
|
|
5787
|
+
--tw-space-y-reverse: 0;
|
|
5788
|
+
margin-top: calc(0px * calc(1 - var(--tw-space-y-reverse)));
|
|
5789
|
+
margin-bottom: calc(0px * var(--tw-space-y-reverse));
|
|
5790
|
+
}
|
|
5791
|
+
|
|
5818
5792
|
.sm\:dy-space-y-10 > :not([hidden]) ~ :not([hidden]){
|
|
5819
5793
|
--tw-space-y-reverse: 0;
|
|
5820
5794
|
margin-top: calc(2.5rem * calc(1 - var(--tw-space-y-reverse)));
|
|
@@ -6288,6 +6262,29 @@
|
|
|
6288
6262
|
appearance: none;
|
|
6289
6263
|
}
|
|
6290
6264
|
|
|
6265
|
+
.\[\&\:has\(\[aria-selected\]\)\]\:dy-bg-accent:has([aria-selected]){
|
|
6266
|
+
background-color: hsl(var(--accent));
|
|
6267
|
+
}
|
|
6268
|
+
|
|
6269
|
+
.first\:\[\&\:has\(\[aria-selected\]\)\]\:dy-rounded-l-md:has([aria-selected]):first-child{
|
|
6270
|
+
border-top-left-radius: calc(var(--radius) - 2px);
|
|
6271
|
+
border-bottom-left-radius: calc(var(--radius) - 2px);
|
|
6272
|
+
}
|
|
6273
|
+
|
|
6274
|
+
.last\:\[\&\:has\(\[aria-selected\]\)\]\:dy-rounded-r-md:has([aria-selected]):last-child{
|
|
6275
|
+
border-top-right-radius: calc(var(--radius) - 2px);
|
|
6276
|
+
border-bottom-right-radius: calc(var(--radius) - 2px);
|
|
6277
|
+
}
|
|
6278
|
+
|
|
6279
|
+
.\[\&\:has\(\[aria-selected\]\.day-outside\)\]\:dy-bg-accent\/50:has([aria-selected].day-outside){
|
|
6280
|
+
background-color: hsl(var(--accent) / 0.5);
|
|
6281
|
+
}
|
|
6282
|
+
|
|
6283
|
+
.\[\&\:has\(\[aria-selected\]\.day-range-end\)\]\:dy-rounded-r-md:has([aria-selected].day-range-end){
|
|
6284
|
+
border-top-right-radius: calc(var(--radius) - 2px);
|
|
6285
|
+
border-bottom-right-radius: calc(var(--radius) - 2px);
|
|
6286
|
+
}
|
|
6287
|
+
|
|
6291
6288
|
.\[\&\:has\(\[role\=checkbox\]\)\]\:dy-pr-0:has([role=checkbox]){
|
|
6292
6289
|
padding-right: 0px;
|
|
6293
6290
|
}
|
|
@@ -6309,11 +6306,6 @@
|
|
|
6309
6306
|
-webkit-line-clamp: 1;
|
|
6310
6307
|
}
|
|
6311
6308
|
|
|
6312
|
-
.\[\&\>svg\]\:dy-size-3\.5>svg{
|
|
6313
|
-
width: 0.875rem;
|
|
6314
|
-
height: 0.875rem;
|
|
6315
|
-
}
|
|
6316
|
-
|
|
6317
6309
|
.\[\&\>svg\]\:dy-size-4>svg{
|
|
6318
6310
|
width: 1rem;
|
|
6319
6311
|
height: 1rem;
|
|
@@ -6323,10 +6315,6 @@
|
|
|
6323
6315
|
flex-shrink: 0;
|
|
6324
6316
|
}
|
|
6325
6317
|
|
|
6326
|
-
.\[\&\>svg\]\:dy-text-muted-foreground>svg{
|
|
6327
|
-
color: hsl(var(--muted-foreground));
|
|
6328
|
-
}
|
|
6329
|
-
|
|
6330
6318
|
.\[\&\>svg\]\:dy-text-sidebar-accent-foreground>svg{
|
|
6331
6319
|
color: hsl(var(--sidebar-accent-foreground));
|
|
6332
6320
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Button } from '../../components/ui/button';
|
|
1
|
+
import { DayPicker } from 'react-day-picker';
|
|
3
2
|
import * as React from "react";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
export type CalendarProps = React.ComponentProps<typeof DayPicker>;
|
|
4
|
+
declare function Calendar({ className, classNames, showOutsideDays, ...props }: CalendarProps): React.JSX.Element;
|
|
5
|
+
declare namespace Calendar {
|
|
6
|
+
var displayName: string;
|
|
7
|
+
}
|
|
8
|
+
export { Calendar };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a debounced copy of `value` that only updates after `delayMs` have
|
|
3
|
+
* elapsed without a further change. Use it to throttle server requests driven
|
|
4
|
+
* by fast-changing input, such as a search box.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useDebouncedValue<T>(value: T, delayMs?: number): T;
|
package/dist/index.mjs
CHANGED
|
@@ -2,10 +2,10 @@ import * as React$1 from "react";
|
|
|
2
2
|
import React, { Component, StrictMode, createContext, createElement, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
3
3
|
import { createRoot } from "react-dom/client";
|
|
4
4
|
import { HashRouter, Link, MemoryRouter, Route, Routes, useLocation, useNavigate, useParams, useSearchParams } from "react-router-dom";
|
|
5
|
-
import { QueryClient, QueryClientProvider, useInfiniteQuery, useMutation, useQueries, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
5
|
+
import { QueryClient, QueryClientProvider, keepPreviousData, useInfiniteQuery, useMutation, useQueries, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
6
6
|
import { createClient } from "@dyrected/sdk";
|
|
7
7
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
-
import { AlertCircle, AlertTriangle, AlignCenter, AlignLeft, AlignRight, Archive, ArrowDown, ArrowLeft, ArrowRight, ArrowUp, ArrowUpDown, ArrowUpRight, Bold, Braces, Calendar, Check, CheckCircle, CheckCircle2, ChevronDown,
|
|
8
|
+
import { AlertCircle, AlertTriangle, AlignCenter, AlignLeft, AlignRight, Archive, ArrowDown, ArrowLeft, ArrowRight, ArrowUp, ArrowUpDown, ArrowUpRight, Bold, Braces, Calendar, Check, CheckCircle, CheckCircle2, ChevronDown, ChevronLeft, ChevronLeftIcon, ChevronRight, ChevronRightIcon, ChevronUp, ChevronsUpDown, Circle, Clock, Clock3, Code, Copy, Database, Download, ExternalLink, Eye, EyeOff, FileDown, FileIcon, FileText, FileUp, Filter, Globe, GripVertical, Heading1, Heading2, Heading3, Heading4, Heading5, Heading6, Home, Image as Image$1, Info, Italic, KeyRound, Layers, LayoutDashboard, LayoutGrid, Library, Link as Link$1, List, ListOrdered, Loader2, Lock, LogOut, Mail, Menu, Monitor, Moon, MoreHorizontal, MousePointer2, PanelLeftClose, PanelLeftOpen, Pencil, Play, Plus, Quote, RotateCcw, Save, Scissors, Search, Settings, Settings2, Share2, Shield, Smartphone, Sparkles, Strikethrough, Sun, Table, Trash2, Underline, Undo2, Upload, UploadCloud, Users, Video, Volume2, Workflow, X, XCircle, icons } from "lucide-react";
|
|
9
9
|
import { clsx } from "clsx";
|
|
10
10
|
import { extendTailwindMerge } from "tailwind-merge";
|
|
11
11
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
@@ -44,7 +44,7 @@ import { zodResolver } from "@hookform/resolvers/zod";
|
|
|
44
44
|
import * as z from "zod";
|
|
45
45
|
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
46
46
|
import { format } from "date-fns";
|
|
47
|
-
import { DayPicker
|
|
47
|
+
import { DayPicker } from "react-day-picker";
|
|
48
48
|
import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio";
|
|
49
49
|
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
50
50
|
import { Blurhash } from "react-blurhash";
|
|
@@ -965,7 +965,7 @@ function isNewerVersion(latest, current) {
|
|
|
965
965
|
return false;
|
|
966
966
|
}
|
|
967
967
|
function useUpdateCheck() {
|
|
968
|
-
const currentVersion = "2.5.
|
|
968
|
+
const currentVersion = "2.5.59";
|
|
969
969
|
const [updateInfo, setUpdateInfo] = useState(() => {
|
|
970
970
|
if (typeof window === "undefined") return null;
|
|
971
971
|
const cacheKey = "dyrected_latest_release";
|
|
@@ -1219,7 +1219,7 @@ function getStatusLabel(doc) {
|
|
|
1219
1219
|
}
|
|
1220
1220
|
function Dashboard() {
|
|
1221
1221
|
const { client, components, user } = useDyrected();
|
|
1222
|
-
const currentVersion = "2.5.
|
|
1222
|
+
const currentVersion = "2.5.59";
|
|
1223
1223
|
const [latestVersion, setLatestVersion] = useState(() => {
|
|
1224
1224
|
if (typeof window === "undefined") return null;
|
|
1225
1225
|
return localStorage.getItem("dyrected_latest_release");
|
|
@@ -6029,7 +6029,9 @@ function TextField({ schema, field, disabled }) {
|
|
|
6029
6029
|
...field,
|
|
6030
6030
|
value: field.value ?? "",
|
|
6031
6031
|
placeholder: schema.admin?.placeholder || "0",
|
|
6032
|
-
disabled
|
|
6032
|
+
disabled,
|
|
6033
|
+
min: getMin(schema),
|
|
6034
|
+
max: getMax(schema)
|
|
6033
6035
|
});
|
|
6034
6036
|
case "email": return /* @__PURE__ */ jsx(Input, {
|
|
6035
6037
|
type: "email",
|
|
@@ -6092,6 +6094,14 @@ function getMaxWords(schema) {
|
|
|
6092
6094
|
if (schema.type !== "text") return;
|
|
6093
6095
|
return schema.maxWords ?? schema.admin?.maxWords;
|
|
6094
6096
|
}
|
|
6097
|
+
function getMin(schema) {
|
|
6098
|
+
if (schema.type !== "number") return;
|
|
6099
|
+
return schema.min ?? schema.admin?.min;
|
|
6100
|
+
}
|
|
6101
|
+
function getMax(schema) {
|
|
6102
|
+
if (schema.type !== "number") return;
|
|
6103
|
+
return schema.max ?? schema.admin?.max;
|
|
6104
|
+
}
|
|
6095
6105
|
//#endregion
|
|
6096
6106
|
//#region src/components/forms/fields/text-area-field.tsx
|
|
6097
6107
|
function TextAreaField({ schema, field, disabled }) {
|
|
@@ -6161,6 +6171,21 @@ function CheckboxField({ field, disabled }) {
|
|
|
6161
6171
|
});
|
|
6162
6172
|
}
|
|
6163
6173
|
//#endregion
|
|
6174
|
+
//#region src/hooks/use-debounced-value.ts
|
|
6175
|
+
/**
|
|
6176
|
+
* Returns a debounced copy of `value` that only updates after `delayMs` have
|
|
6177
|
+
* elapsed without a further change. Use it to throttle server requests driven
|
|
6178
|
+
* by fast-changing input, such as a search box.
|
|
6179
|
+
*/
|
|
6180
|
+
function useDebouncedValue(value, delayMs = 250) {
|
|
6181
|
+
const [debounced, setDebounced] = React$1.useState(value);
|
|
6182
|
+
React$1.useEffect(() => {
|
|
6183
|
+
const timer = setTimeout(() => setDebounced(value), delayMs);
|
|
6184
|
+
return () => clearTimeout(timer);
|
|
6185
|
+
}, [value, delayMs]);
|
|
6186
|
+
return debounced;
|
|
6187
|
+
}
|
|
6188
|
+
//#endregion
|
|
6164
6189
|
//#region src/components/forms/fields/select-field.tsx
|
|
6165
6190
|
/**
|
|
6166
6191
|
* SelectField Component
|
|
@@ -6179,18 +6204,21 @@ function SelectField({ schema, field, disabled, collection, siblingValues }) {
|
|
|
6179
6204
|
const [searchVal, setSearchVal] = React$1.useState("");
|
|
6180
6205
|
const label = schema.label || schema.name.charAt(0).toUpperCase() + schema.name.slice(1);
|
|
6181
6206
|
const isDynamic = !!(schema.options && typeof schema.options === "object" && "_dynamic" in schema.options);
|
|
6182
|
-
const
|
|
6207
|
+
const debouncedSearch = useDebouncedValue(searchVal.trim(), 250);
|
|
6208
|
+
const { data: dynamicOptions, isLoading, isFetching } = useQuery({
|
|
6183
6209
|
queryKey: [
|
|
6184
6210
|
"options",
|
|
6185
6211
|
collection,
|
|
6186
6212
|
schema.name,
|
|
6187
|
-
siblingValues
|
|
6213
|
+
siblingValues,
|
|
6214
|
+
debouncedSearch
|
|
6188
6215
|
],
|
|
6189
6216
|
queryFn: async () => {
|
|
6190
6217
|
const q = new URLSearchParams();
|
|
6191
6218
|
if (siblingValues) Object.entries(siblingValues).forEach(([k, v]) => {
|
|
6192
6219
|
if (typeof v === "string" || typeof v === "number" || typeof v === "boolean") q.append(k, String(v));
|
|
6193
6220
|
});
|
|
6221
|
+
if (debouncedSearch) q.append("search", debouncedSearch);
|
|
6194
6222
|
const url = `${client?.getBaseUrl() || ""}/api/dyrected/options/${collection}/${schema.name}?${q.toString()}`;
|
|
6195
6223
|
const authHeaders = {};
|
|
6196
6224
|
const token = typeof window !== "undefined" ? localStorage.getItem("dyrected_token") : null;
|
|
@@ -6202,7 +6230,8 @@ function SelectField({ schema, field, disabled, collection, siblingValues }) {
|
|
|
6202
6230
|
if (!res.ok) throw new Error("Failed to fetch options");
|
|
6203
6231
|
return res.json();
|
|
6204
6232
|
},
|
|
6205
|
-
enabled: !!client && isDynamic && !!collection && !!schema.name
|
|
6233
|
+
enabled: !!client && isDynamic && !!collection && !!schema.name,
|
|
6234
|
+
placeholderData: keepPreviousData
|
|
6206
6235
|
});
|
|
6207
6236
|
const options = normalizeOptions(isDynamic ? dynamicOptions || [] : schema.options).map((opt) => ({
|
|
6208
6237
|
label: opt.label,
|
|
@@ -6254,41 +6283,48 @@ function SelectField({ schema, field, disabled, collection, siblingValues }) {
|
|
|
6254
6283
|
}), /* @__PURE__ */ jsx(PopoverContent, {
|
|
6255
6284
|
className: "dy-w-[var(--radix-popover-trigger-width)] dy-p-0 dy-rounded-xl dy-border-border/40 dy-shadow-xl",
|
|
6256
6285
|
align: "start",
|
|
6257
|
-
children: /* @__PURE__ */ jsxs(Command$1, {
|
|
6258
|
-
|
|
6259
|
-
|
|
6260
|
-
|
|
6261
|
-
|
|
6262
|
-
|
|
6263
|
-
|
|
6264
|
-
|
|
6265
|
-
|
|
6286
|
+
children: /* @__PURE__ */ jsxs(Command$1, {
|
|
6287
|
+
shouldFilter: !isDynamic,
|
|
6288
|
+
children: [/* @__PURE__ */ jsx(CommandInput, {
|
|
6289
|
+
placeholder: `Search ${label.toLowerCase()}...`,
|
|
6290
|
+
value: searchVal,
|
|
6291
|
+
onValueChange: setSearchVal
|
|
6292
|
+
}), /* @__PURE__ */ jsxs(CommandList, { children: [
|
|
6293
|
+
isDynamic && isFetching && /* @__PURE__ */ jsx("div", {
|
|
6294
|
+
className: "dy-py-6 dy-text-center dy-text-sm dy-text-muted-foreground",
|
|
6295
|
+
children: "Searching…"
|
|
6296
|
+
}),
|
|
6297
|
+
showCustomOption && /* @__PURE__ */ jsx(CommandGroup, {
|
|
6298
|
+
heading: "Custom Value",
|
|
6299
|
+
children: /* @__PURE__ */ jsxs(CommandItem, {
|
|
6300
|
+
value: searchVal,
|
|
6301
|
+
onSelect: () => {
|
|
6302
|
+
field.onChange(trimmedSearch);
|
|
6303
|
+
handleOpenChange(false);
|
|
6304
|
+
},
|
|
6305
|
+
className: "dy-rounded-lg dy-py-2.5 dy-text-primary dy-font-medium",
|
|
6306
|
+
children: [/* @__PURE__ */ jsx(Plus, { className: "dy-mr-2 dy-h-4 dy-w-4" }), /* @__PURE__ */ jsxs("span", { children: [
|
|
6307
|
+
"Use \"",
|
|
6308
|
+
trimmedSearch,
|
|
6309
|
+
"\""
|
|
6310
|
+
] })]
|
|
6311
|
+
})
|
|
6312
|
+
}),
|
|
6313
|
+
/* @__PURE__ */ jsx(CommandEmpty, { children: "No option found." }),
|
|
6314
|
+
/* @__PURE__ */ jsx(CommandGroup, { children: options.map((opt) => /* @__PURE__ */ jsxs(CommandItem, {
|
|
6315
|
+
value: `${opt.label} ${opt.value}`,
|
|
6266
6316
|
onSelect: () => {
|
|
6267
|
-
field.onChange(
|
|
6317
|
+
field.onChange(opt.value);
|
|
6268
6318
|
handleOpenChange(false);
|
|
6269
6319
|
},
|
|
6270
|
-
className: "dy-rounded-lg dy-py-2.5
|
|
6271
|
-
children: [/* @__PURE__ */ jsx(
|
|
6272
|
-
|
|
6273
|
-
|
|
6274
|
-
|
|
6275
|
-
|
|
6276
|
-
|
|
6277
|
-
|
|
6278
|
-
/* @__PURE__ */ jsx(CommandEmpty, { children: "No option found." }),
|
|
6279
|
-
/* @__PURE__ */ jsx(CommandGroup, { children: options.map((opt) => /* @__PURE__ */ jsxs(CommandItem, {
|
|
6280
|
-
value: `${opt.label} ${opt.value}`,
|
|
6281
|
-
onSelect: () => {
|
|
6282
|
-
field.onChange(opt.value);
|
|
6283
|
-
handleOpenChange(false);
|
|
6284
|
-
},
|
|
6285
|
-
className: "dy-rounded-lg dy-py-2.5",
|
|
6286
|
-
children: [/* @__PURE__ */ jsx(Check, { className: cn("dy-mr-2 dy-h-4 dy-w-4", currentValue === opt.value ? "dy-opacity-100" : "dy-opacity-0") }), /* @__PURE__ */ jsx("span", {
|
|
6287
|
-
className: "dy-truncate",
|
|
6288
|
-
children: opt.label
|
|
6289
|
-
})]
|
|
6290
|
-
}, opt.value || "__empty")) })
|
|
6291
|
-
] })] })
|
|
6320
|
+
className: "dy-rounded-lg dy-py-2.5",
|
|
6321
|
+
children: [/* @__PURE__ */ jsx(Check, { className: cn("dy-mr-2 dy-h-4 dy-w-4", currentValue === opt.value ? "dy-opacity-100" : "dy-opacity-0") }), /* @__PURE__ */ jsx("span", {
|
|
6322
|
+
className: "dy-truncate",
|
|
6323
|
+
children: opt.label
|
|
6324
|
+
})]
|
|
6325
|
+
}, opt.value || "__empty")) })
|
|
6326
|
+
] })]
|
|
6327
|
+
})
|
|
6292
6328
|
})]
|
|
6293
6329
|
});
|
|
6294
6330
|
}
|
|
@@ -6387,19 +6423,23 @@ function RadioField({ schema, field, disabled, collection, siblingValues }) {
|
|
|
6387
6423
|
function MultiSelect({ options, value = [], onChange, label, placeholder = "Select options...", disabled, collection, siblingValues, schema }) {
|
|
6388
6424
|
const { client } = useDyrected();
|
|
6389
6425
|
const [open, setOpen] = React$1.useState(false);
|
|
6426
|
+
const [searchVal, setSearchVal] = React$1.useState("");
|
|
6390
6427
|
const isDynamic = !!(schema?.options && typeof schema.options === "object" && "_dynamic" in schema.options);
|
|
6391
|
-
const
|
|
6428
|
+
const debouncedSearch = useDebouncedValue(searchVal.trim(), 250);
|
|
6429
|
+
const { data: dynamicOptions, isLoading, isFetching } = useQuery({
|
|
6392
6430
|
queryKey: [
|
|
6393
6431
|
"options",
|
|
6394
6432
|
collection,
|
|
6395
6433
|
schema?.name,
|
|
6396
|
-
siblingValues
|
|
6434
|
+
siblingValues,
|
|
6435
|
+
debouncedSearch
|
|
6397
6436
|
],
|
|
6398
6437
|
queryFn: async () => {
|
|
6399
6438
|
const q = new URLSearchParams();
|
|
6400
6439
|
if (siblingValues) Object.entries(siblingValues).forEach(([k, v]) => {
|
|
6401
6440
|
if (typeof v === "string" || typeof v === "number" || typeof v === "boolean") q.append(k, String(v));
|
|
6402
6441
|
});
|
|
6442
|
+
if (debouncedSearch) q.append("search", debouncedSearch);
|
|
6403
6443
|
const url = `${client?.getBaseUrl() || ""}/api/dyrected/options/${collection}/${schema?.name}?${q.toString()}`;
|
|
6404
6444
|
const authHeaders = {};
|
|
6405
6445
|
const token = typeof window !== "undefined" ? localStorage.getItem("dyrected_token") : null;
|
|
@@ -6411,7 +6451,8 @@ function MultiSelect({ options, value = [], onChange, label, placeholder = "Sele
|
|
|
6411
6451
|
if (!res.ok) throw new Error("Failed to fetch options");
|
|
6412
6452
|
return res.json();
|
|
6413
6453
|
},
|
|
6414
|
-
enabled: !!client && isDynamic && !!collection && !!schema?.name
|
|
6454
|
+
enabled: !!client && isDynamic && !!collection && !!schema?.name,
|
|
6455
|
+
placeholderData: keepPreviousData
|
|
6415
6456
|
});
|
|
6416
6457
|
const rawOptions = isDynamic ? dynamicOptions || [] : options;
|
|
6417
6458
|
const normalizedOpts = (Array.isArray(rawOptions) ? rawOptions : []).map((opt) => {
|
|
@@ -6494,127 +6535,88 @@ function MultiSelect({ options, value = [], onChange, label, placeholder = "Sele
|
|
|
6494
6535
|
}), /* @__PURE__ */ jsx(PopoverContent, {
|
|
6495
6536
|
className: "dy-w-[var(--radix-popover-trigger-width)] dy-p-0 dy-rounded-xl dy-border-border/40 dy-shadow-xl",
|
|
6496
6537
|
align: "start",
|
|
6497
|
-
children: /* @__PURE__ */ jsxs(Command$1, {
|
|
6498
|
-
|
|
6499
|
-
|
|
6500
|
-
|
|
6501
|
-
|
|
6502
|
-
|
|
6503
|
-
|
|
6504
|
-
|
|
6505
|
-
|
|
6538
|
+
children: /* @__PURE__ */ jsxs(Command$1, {
|
|
6539
|
+
shouldFilter: !isDynamic,
|
|
6540
|
+
children: [/* @__PURE__ */ jsx(CommandInput, {
|
|
6541
|
+
placeholder: "Search options...",
|
|
6542
|
+
value: searchVal,
|
|
6543
|
+
onValueChange: setSearchVal
|
|
6544
|
+
}), /* @__PURE__ */ jsxs(CommandList, { children: [
|
|
6545
|
+
isDynamic && isFetching && /* @__PURE__ */ jsx("div", {
|
|
6546
|
+
className: "dy-py-6 dy-text-center dy-text-sm dy-text-muted-foreground",
|
|
6547
|
+
children: "Searching…"
|
|
6548
|
+
}),
|
|
6549
|
+
/* @__PURE__ */ jsx(CommandEmpty, { children: "No option found." }),
|
|
6550
|
+
/* @__PURE__ */ jsx(CommandGroup, { children: normalizedOpts.map((option) => {
|
|
6551
|
+
const isSelected = value.includes(option.value);
|
|
6552
|
+
return /* @__PURE__ */ jsxs(CommandItem, {
|
|
6553
|
+
value: `${option.label} ${option.value}`,
|
|
6554
|
+
onSelect: () => handleSelect(option.value),
|
|
6555
|
+
className: "dy-rounded-lg dy-py-2.5",
|
|
6556
|
+
children: [/* @__PURE__ */ jsx(Check, { className: cn("dy-mr-2 dy-h-4 dy-w-4", isSelected ? "dy-opacity-100" : "dy-opacity-0") }), option.label]
|
|
6557
|
+
}, option.value);
|
|
6558
|
+
}) })
|
|
6559
|
+
] })]
|
|
6560
|
+
})
|
|
6506
6561
|
})]
|
|
6507
6562
|
})]
|
|
6508
6563
|
});
|
|
6509
6564
|
}
|
|
6510
6565
|
//#endregion
|
|
6511
6566
|
//#region src/components/ui/calendar.tsx
|
|
6512
|
-
function Calendar$1({ className, classNames, showOutsideDays = true,
|
|
6513
|
-
const defaultClassNames = getDefaultClassNames();
|
|
6567
|
+
function Calendar$1({ className, classNames, showOutsideDays = true, ...props }) {
|
|
6514
6568
|
return /* @__PURE__ */ jsx(DayPicker, {
|
|
6515
6569
|
showOutsideDays,
|
|
6516
|
-
className: cn("dy-
|
|
6517
|
-
captionLayout,
|
|
6518
|
-
formatters: {
|
|
6519
|
-
formatMonthDropdown: (date) => date.toLocaleString("default", { month: "short" }),
|
|
6520
|
-
...formatters
|
|
6521
|
-
},
|
|
6570
|
+
className: cn("dy-p-3 dy-bg-background dy-rounded-xl dy-border dy-border-border/40 dy-shadow-sm", className),
|
|
6522
6571
|
classNames: {
|
|
6523
|
-
|
|
6524
|
-
|
|
6525
|
-
|
|
6526
|
-
|
|
6527
|
-
|
|
6528
|
-
|
|
6529
|
-
|
|
6530
|
-
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
|
|
6534
|
-
|
|
6535
|
-
|
|
6536
|
-
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
|
|
6540
|
-
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
|
|
6544
|
-
today: cn("dy-bg-accent/50 dy-text-accent-foreground dy-font-bold dy-rounded-md", defaultClassNames.today),
|
|
6545
|
-
outside: cn("dy-text-muted-foreground/40 aria-selected:dy-text-muted-foreground/40 dy-opacity-50", defaultClassNames.outside),
|
|
6546
|
-
disabled: cn("dy-text-muted-foreground dy-opacity-50", defaultClassNames.disabled),
|
|
6547
|
-
hidden: cn("dy-invisible", defaultClassNames.hidden),
|
|
6572
|
+
months: "dy-flex dy-flex-col sm:dy-flex-row dy-space-y-4 sm:dy-space-x-4 sm:dy-space-y-0",
|
|
6573
|
+
month: "dy-space-y-4",
|
|
6574
|
+
caption: "dy-flex dy-justify-center dy-pt-1 dy-relative dy-items-center",
|
|
6575
|
+
caption_label: "dy-text-sm dy-font-semibold dy-tracking-tight",
|
|
6576
|
+
nav: "dy-space-x-1 dy-flex dy-items-center",
|
|
6577
|
+
nav_button: cn(buttonVariants({ variant: "outline" }), "dy-h-7 dy-w-7 dy-bg-transparent dy-p-0 dy-opacity-50 hover:dy-opacity-100"),
|
|
6578
|
+
nav_button_previous: "dy-absolute dy-left-1",
|
|
6579
|
+
nav_button_next: "dy-absolute dy-right-1",
|
|
6580
|
+
table: "dy-w-full dy-border-collapse dy-space-y-1",
|
|
6581
|
+
head_row: "dy-flex",
|
|
6582
|
+
head_cell: "dy-text-muted-foreground dy-rounded-md dy-w-9 dy-font-medium dy-text-[0.8rem]",
|
|
6583
|
+
row: "dy-flex dy-w-full dy-mt-2",
|
|
6584
|
+
cell: "dy-h-9 dy-w-9 dy-text-center dy-text-sm dy-p-0 dy-relative [&:has([aria-selected].day-range-end)]:dy-rounded-r-md [&:has([aria-selected].day-outside)]:dy-bg-accent/50 [&:has([aria-selected])]:dy-bg-accent first:[&:has([aria-selected])]:dy-rounded-l-md last:[&:has([aria-selected])]:dy-rounded-r-md focus-within:dy-relative focus-within:dy-z-20",
|
|
6585
|
+
day: cn(buttonVariants({ variant: "ghost" }), "dy-h-9 dy-w-9 dy-p-0 dy-font-normal aria-selected:dy-opacity-100"),
|
|
6586
|
+
day_range_end: "dy-day-range-end",
|
|
6587
|
+
day_selected: "dy-bg-primary dy-text-primary-foreground hover:dy-bg-primary hover:dy-text-primary-foreground focus:dy-bg-primary focus:dy-text-primary-foreground",
|
|
6588
|
+
day_today: "dy-bg-accent dy-text-accent-foreground",
|
|
6589
|
+
day_outside: "dy-day-outside dy-text-muted-foreground dy-opacity-50 aria-selected:dy-bg-accent/50 aria-selected:dy-text-muted-foreground aria-selected:dy-opacity-30",
|
|
6590
|
+
day_disabled: "dy-text-muted-foreground dy-opacity-50",
|
|
6591
|
+
day_range_middle: "aria-selected:dy-bg-accent aria-selected:dy-text-accent-foreground",
|
|
6592
|
+
day_hidden: "dy-invisible",
|
|
6548
6593
|
...classNames
|
|
6549
6594
|
},
|
|
6550
6595
|
components: {
|
|
6551
|
-
|
|
6552
|
-
|
|
6553
|
-
|
|
6554
|
-
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
}
|
|
6559
|
-
Chevron: ({ className, orientation, ...props }) => {
|
|
6560
|
-
if (orientation === "left") return /* @__PURE__ */ jsx(ChevronLeftIcon, {
|
|
6561
|
-
className: cn("dy-size-4", className),
|
|
6562
|
-
...props
|
|
6563
|
-
});
|
|
6564
|
-
if (orientation === "right") return /* @__PURE__ */ jsx(ChevronRightIcon, {
|
|
6565
|
-
className: cn("dy-size-4", className),
|
|
6566
|
-
...props
|
|
6567
|
-
});
|
|
6568
|
-
return /* @__PURE__ */ jsx(ChevronDownIcon, {
|
|
6569
|
-
className: cn("dy-size-4", className),
|
|
6570
|
-
...props
|
|
6571
|
-
});
|
|
6572
|
-
},
|
|
6573
|
-
DayButton: CalendarDayButton,
|
|
6574
|
-
WeekNumber: ({ children, ...props }) => {
|
|
6575
|
-
return /* @__PURE__ */ jsx("td", {
|
|
6576
|
-
...props,
|
|
6577
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
6578
|
-
className: "dy-flex dy-size-[--cell-size] dy-items-center dy-justify-center dy-text-center",
|
|
6579
|
-
children
|
|
6580
|
-
})
|
|
6581
|
-
});
|
|
6582
|
-
},
|
|
6583
|
-
...components
|
|
6596
|
+
IconLeft: ({ ...props }) => /* @__PURE__ */ jsx(ChevronLeftIcon, {
|
|
6597
|
+
...props,
|
|
6598
|
+
className: "dy-h-4 dy-w-4"
|
|
6599
|
+
}),
|
|
6600
|
+
IconRight: ({ ...props }) => /* @__PURE__ */ jsx(ChevronRightIcon, {
|
|
6601
|
+
...props,
|
|
6602
|
+
className: "dy-h-4 dy-w-4"
|
|
6603
|
+
})
|
|
6584
6604
|
},
|
|
6585
6605
|
...props
|
|
6586
6606
|
});
|
|
6587
6607
|
}
|
|
6588
|
-
|
|
6589
|
-
const ref = React$1.useRef(null);
|
|
6590
|
-
React$1.useEffect(() => {
|
|
6591
|
-
if (!modifiers.focused) return;
|
|
6592
|
-
const frame = requestAnimationFrame(() => ref.current?.focus());
|
|
6593
|
-
return () => cancelAnimationFrame(frame);
|
|
6594
|
-
}, [modifiers.focused]);
|
|
6595
|
-
return /* @__PURE__ */ jsx(Button, {
|
|
6596
|
-
ref,
|
|
6597
|
-
variant: "ghost",
|
|
6598
|
-
size: "icon",
|
|
6599
|
-
"data-day": day.date.toLocaleDateString(),
|
|
6600
|
-
"data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
|
|
6601
|
-
"data-range-start": modifiers.range_start,
|
|
6602
|
-
"data-range-end": modifiers.range_end,
|
|
6603
|
-
"data-range-middle": modifiers.range_middle,
|
|
6604
|
-
className: cn("dy-flex dy-items-center dy-justify-center dy-h-[--cell-size] dy-w-full dy-min-w-[--cell-size] dy-p-0 dy-font-normal dy-transition-all", "hover:dy-bg-accent hover:dy-text-accent-foreground", "data-[selected-single=true]:dy-bg-primary data-[selected-single=true]:dy-text-primary-foreground data-[selected-single=true]:dy-rounded-full data-[selected-single=true]:dy-shadow-lg", "data-[range-middle=true]:dy-bg-accent data-[range-middle=true]:dy-text-accent-foreground data-[range-middle=true]:dy-rounded-none", "data-[range-start=true]:dy-bg-primary data-[range-start=true]:dy-text-primary-foreground data-[range-start=true]:dy-rounded-l-md", "data-[range-end=true]:dy-bg-primary data-[range-end=true]:dy-text-primary-foreground data-[range-end=true]:dy-rounded-r-md", "dy-group-data-[focused=true]/day:dy-ring-2 dy-group-data-[focused=true]/day:dy-ring-ring dy-group-data-[focused=true]/day:dy-relative dy-group-data-[focused=true]/day:dy-z-10", className),
|
|
6605
|
-
...props
|
|
6606
|
-
});
|
|
6607
|
-
}
|
|
6608
|
+
Calendar$1.displayName = "Calendar";
|
|
6608
6609
|
//#endregion
|
|
6609
6610
|
//#region src/components/forms/fields/date-picker.tsx
|
|
6610
6611
|
function InlinePicker({ open, setOpen, triggerRef, children }) {
|
|
6611
6612
|
React$1.useEffect(() => {
|
|
6612
6613
|
if (!open) return;
|
|
6613
6614
|
const handle = (e) => {
|
|
6615
|
+
if (e.target && !document.contains(e.target)) return;
|
|
6614
6616
|
if (triggerRef.current && !triggerRef.current.contains(e.target)) setOpen(false);
|
|
6615
6617
|
};
|
|
6616
|
-
document.addEventListener("
|
|
6617
|
-
return () => document.removeEventListener("
|
|
6618
|
+
document.addEventListener("pointerdown", handle, { capture: true });
|
|
6619
|
+
return () => document.removeEventListener("pointerdown", handle, { capture: true });
|
|
6618
6620
|
}, [
|
|
6619
6621
|
open,
|
|
6620
6622
|
setOpen,
|
|
@@ -6622,7 +6624,7 @@ function InlinePicker({ open, setOpen, triggerRef, children }) {
|
|
|
6622
6624
|
]);
|
|
6623
6625
|
return /* @__PURE__ */ jsx("div", {
|
|
6624
6626
|
className: cn("dy-absolute dy-left-0 dy-top-full dy-z-50 dy-mt-1 dy-rounded-xl dy-border dy-border-border/50 dy-bg-popover dy-shadow-2xl dy-transition-[opacity,transform] dy-duration-100 dy-origin-top-left", open ? "dy-opacity-100 dy-scale-100 dy-pointer-events-auto" : "dy-opacity-0 dy-scale-95 dy-pointer-events-none dy-invisible"),
|
|
6625
|
-
|
|
6627
|
+
inert: !open ? true : void 0,
|
|
6626
6628
|
children
|
|
6627
6629
|
});
|
|
6628
6630
|
}
|
|
@@ -8790,6 +8792,8 @@ function FormFieldRenderer({ schema, basePath, control, collection, documentId }
|
|
|
8790
8792
|
const condition = schema.admin?.condition;
|
|
8791
8793
|
const readAccess = schema.access?.read;
|
|
8792
8794
|
const updateAccess = schema.access?.update;
|
|
8795
|
+
const createAccess = schema.access?.create;
|
|
8796
|
+
const writeAccess = documentId ? updateAccess : createAccess ?? updateAccess;
|
|
8793
8797
|
const compiledCondition = React$1.useMemo(() => {
|
|
8794
8798
|
if (typeof condition !== "string") return null;
|
|
8795
8799
|
try {
|
|
@@ -8820,10 +8824,10 @@ function FormFieldRenderer({ schema, basePath, control, collection, documentId }
|
|
|
8820
8824
|
}
|
|
8821
8825
|
}, [readAccess]);
|
|
8822
8826
|
const compiledUpdateAccess = React$1.useMemo(() => {
|
|
8823
|
-
if (typeof
|
|
8827
|
+
if (typeof writeAccess !== "string") return null;
|
|
8824
8828
|
try {
|
|
8825
8829
|
return {
|
|
8826
|
-
expr: jexl.compile(
|
|
8830
|
+
expr: jexl.compile(writeAccess),
|
|
8827
8831
|
error: null
|
|
8828
8832
|
};
|
|
8829
8833
|
} catch (e) {
|
|
@@ -8832,7 +8836,7 @@ function FormFieldRenderer({ schema, basePath, control, collection, documentId }
|
|
|
8832
8836
|
error: `Update access compile error: ${e.message || String(e)}`
|
|
8833
8837
|
};
|
|
8834
8838
|
}
|
|
8835
|
-
}, [
|
|
8839
|
+
}, [writeAccess]);
|
|
8836
8840
|
if (schema.admin?.hidden) return null;
|
|
8837
8841
|
let isVisible = true;
|
|
8838
8842
|
let jexlError = null;
|
|
@@ -8860,7 +8864,7 @@ function FormFieldRenderer({ schema, basePath, control, collection, documentId }
|
|
|
8860
8864
|
}
|
|
8861
8865
|
if (!canRead && !jexlError) return null;
|
|
8862
8866
|
let canUpdate = true;
|
|
8863
|
-
if (
|
|
8867
|
+
if (writeAccess === false) canUpdate = false;
|
|
8864
8868
|
else if (compiledUpdateAccess) {
|
|
8865
8869
|
if (compiledUpdateAccess.error) jexlError = jexlError ? `${jexlError} | ${compiledUpdateAccess.error}` : compiledUpdateAccess.error;
|
|
8866
8870
|
else if (compiledUpdateAccess.expr) try {
|
|
@@ -13968,7 +13972,7 @@ function SetupPromptUI({ config }) {
|
|
|
13968
13972
|
setCopied(true);
|
|
13969
13973
|
window.setTimeout(() => setCopied(false), 1800);
|
|
13970
13974
|
}
|
|
13971
|
-
const currentVersion = "2.5.
|
|
13975
|
+
const currentVersion = "2.5.59";
|
|
13972
13976
|
const [latestVersion, setLatestVersion] = useState(() => {
|
|
13973
13977
|
if (typeof window === "undefined") return null;
|
|
13974
13978
|
return localStorage.getItem("dyrected_latest_release");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dyrected/admin",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.60",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"papaparse": "^5.5.4",
|
|
57
57
|
"react-blurhash": "^0.3.0",
|
|
58
58
|
"react-datasheet-grid": "^4.1.2",
|
|
59
|
-
"react-day-picker": "^
|
|
59
|
+
"react-day-picker": "^8.10.1",
|
|
60
60
|
"react-dropzone": "^15.0.0",
|
|
61
61
|
"react-hook-form": "^7.75.0",
|
|
62
62
|
"react-image-crop": "^11.0.10",
|
|
@@ -64,9 +64,9 @@
|
|
|
64
64
|
"tailwind-merge": "^3.5.0",
|
|
65
65
|
"tailwindcss-animate": "^1.0.7",
|
|
66
66
|
"zod": "^3.25.76",
|
|
67
|
-
"@dyrected/core": "^2.5.
|
|
68
|
-
"@dyrected/knowledge": "^0.2.
|
|
69
|
-
"@dyrected/sdk": "^2.5.
|
|
67
|
+
"@dyrected/core": "^2.5.60",
|
|
68
|
+
"@dyrected/knowledge": "^0.2.12",
|
|
69
|
+
"@dyrected/sdk": "^2.5.60"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
72
|
"@tanstack/react-query": "^5.0.0",
|