@yimingliao/cms 0.0.92 → 0.0.93
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/client/index.js +264 -224
- package/package.json +1 -1
package/dist/client/index.js
CHANGED
|
@@ -475,48 +475,56 @@ function createSignInPage({
|
|
|
475
475
|
}),
|
|
476
476
|
{ onSuccess: (data) => setAdmin(data?.admin || null) }
|
|
477
477
|
);
|
|
478
|
-
return /* @__PURE__ */ jsx(
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
478
|
+
return /* @__PURE__ */ jsx(
|
|
479
|
+
Form,
|
|
480
|
+
{
|
|
481
|
+
className: "mx-auto w-96",
|
|
482
|
+
style: { marginTop: "56px" },
|
|
483
|
+
onSubmit: () => void execute(),
|
|
484
|
+
children: /* @__PURE__ */ jsxs(Card, { children: [
|
|
485
|
+
/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(CardTitle, { className: "mx-auto", children: t("auth.sign-in.text") }) }),
|
|
486
|
+
/* @__PURE__ */ jsxs(CardContent, { className: "relative flex flex-col gap-6", children: [
|
|
487
|
+
/* @__PURE__ */ jsx(Field, { htmlFor: "email", label: t("auth.sign-in.email.text"), children: /* @__PURE__ */ jsx(
|
|
488
|
+
Input,
|
|
489
|
+
{
|
|
490
|
+
id: "email",
|
|
491
|
+
type: "email",
|
|
492
|
+
placeholder: t("auth.sign-in.email.placeholder.text"),
|
|
493
|
+
autoComplete: "email",
|
|
494
|
+
fieldName: "email",
|
|
495
|
+
value: formData.email,
|
|
496
|
+
setFormData,
|
|
497
|
+
isDisabled: isRedirecting,
|
|
498
|
+
isError: errors.includes("email")
|
|
499
|
+
}
|
|
500
|
+
) }),
|
|
501
|
+
/* @__PURE__ */ jsx(Field, { htmlFor: "password", label: t("auth.sign-in.password.text"), children: /* @__PURE__ */ jsx(
|
|
502
|
+
PasswordInput,
|
|
503
|
+
{
|
|
504
|
+
id: "password",
|
|
505
|
+
placeholder: t("auth.sign-in.password.placeholder.text"),
|
|
506
|
+
fieldName: "password",
|
|
507
|
+
value: formData.password,
|
|
508
|
+
setFormData,
|
|
509
|
+
isDisabled: isRedirecting,
|
|
510
|
+
isError: errors.includes("password")
|
|
511
|
+
}
|
|
512
|
+
) }),
|
|
513
|
+
/* @__PURE__ */ jsx(
|
|
514
|
+
Button2,
|
|
515
|
+
{
|
|
516
|
+
size: "xs",
|
|
517
|
+
variant: "link",
|
|
518
|
+
className: "w-fit",
|
|
519
|
+
isDisabled: isRedirecting,
|
|
520
|
+
children: /* @__PURE__ */ jsx(Link, { href: PATHS.auth.forgotPassword.path, children: t("auth.sign-in.anchor.text") })
|
|
521
|
+
}
|
|
522
|
+
),
|
|
523
|
+
/* @__PURE__ */ jsx(Button2, { type: "submit", isLoading: isRedirecting, children: t("auth.sign-in.button.text") })
|
|
524
|
+
] })
|
|
525
|
+
] })
|
|
526
|
+
}
|
|
527
|
+
);
|
|
520
528
|
};
|
|
521
529
|
}
|
|
522
530
|
function createVerifyEmailPage({
|
|
@@ -576,33 +584,41 @@ function createEmailUnverifiedPage({
|
|
|
576
584
|
"\xA0",
|
|
577
585
|
t("auth.email-unverified.button.send-again.text")
|
|
578
586
|
] });
|
|
579
|
-
return /* @__PURE__ */ jsx(
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
587
|
+
return /* @__PURE__ */ jsx(
|
|
588
|
+
Form,
|
|
589
|
+
{
|
|
590
|
+
className: "mx-auto w-96",
|
|
591
|
+
style: { marginTop: "56px" },
|
|
592
|
+
onSubmit: () => void execute(),
|
|
593
|
+
children: /* @__PURE__ */ jsxs(Card, { children: [
|
|
594
|
+
/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(CardTitle, { className: "mx-auto", children: t("auth.email-unverified.text") }) }),
|
|
595
|
+
/* @__PURE__ */ jsxs(CardContent, { className: "relative flex flex-col gap-6", children: [
|
|
596
|
+
/* @__PURE__ */ jsxs(InputGroup, { children: [
|
|
597
|
+
/* @__PURE__ */ jsx(InputGroupAddon, { children: /* @__PURE__ */ jsx(Label, { htmlFor: "email", className: "text-foreground", children: /* @__PURE__ */ jsx(Mail, { className: "size-4" }) }) }),
|
|
598
|
+
isLoading ? /* @__PURE__ */ jsx("div", { className: "px-2", children: /* @__PURE__ */ jsx(Spinner, {}) }) : /* @__PURE__ */ jsx(
|
|
599
|
+
InputGroupInput,
|
|
600
|
+
{
|
|
601
|
+
id: "email",
|
|
602
|
+
placeholder: "shadcn@vercel.com",
|
|
603
|
+
disabled: true,
|
|
604
|
+
value: admin?.email
|
|
605
|
+
}
|
|
606
|
+
)
|
|
607
|
+
] }),
|
|
608
|
+
/* @__PURE__ */ jsx(CardDescription, { children: /* @__PURE__ */ jsx("p", { className: "text-sm whitespace-pre-line", children: t("auth.email-unverified.notice.text") }) }),
|
|
609
|
+
/* @__PURE__ */ jsx(
|
|
610
|
+
Button2,
|
|
611
|
+
{
|
|
612
|
+
type: "submit",
|
|
613
|
+
isLoading: isLoading || isPending,
|
|
614
|
+
isDisabled: isCounting,
|
|
615
|
+
children: buttonText
|
|
616
|
+
}
|
|
617
|
+
)
|
|
618
|
+
] })
|
|
619
|
+
] })
|
|
620
|
+
}
|
|
621
|
+
);
|
|
606
622
|
};
|
|
607
623
|
}
|
|
608
624
|
function createForgotPasswordPage({
|
|
@@ -627,35 +643,43 @@ function createForgotPasswordPage({
|
|
|
627
643
|
"\xA0",
|
|
628
644
|
t("auth.forgot-password.button.send-again.text")
|
|
629
645
|
] });
|
|
630
|
-
return /* @__PURE__ */ jsx(
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
646
|
+
return /* @__PURE__ */ jsx(
|
|
647
|
+
Form,
|
|
648
|
+
{
|
|
649
|
+
className: "mx-auto w-96",
|
|
650
|
+
style: { marginTop: "56px" },
|
|
651
|
+
onSubmit: () => void execute(),
|
|
652
|
+
children: /* @__PURE__ */ jsxs(Card, { children: [
|
|
653
|
+
/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(CardTitle, { className: "mx-auto", children: t("auth.forgot-password.text") }) }),
|
|
654
|
+
/* @__PURE__ */ jsxs(CardContent, { className: "relative flex flex-col gap-6", children: [
|
|
655
|
+
/* @__PURE__ */ jsx(Field, { htmlFor: "email", label: t("auth.forgot-password.email.text"), children: /* @__PURE__ */ jsx(
|
|
656
|
+
Input,
|
|
657
|
+
{
|
|
658
|
+
id: "email",
|
|
659
|
+
placeholder: t("auth.forgot-password.email.placeholder.text"),
|
|
660
|
+
autoComplete: "email",
|
|
661
|
+
fieldName: "email",
|
|
662
|
+
value: formData.email,
|
|
663
|
+
setFormData,
|
|
664
|
+
isDisabled: isPending || isCounting,
|
|
665
|
+
isError: errors.includes("email")
|
|
666
|
+
}
|
|
667
|
+
) }),
|
|
668
|
+
/* @__PURE__ */ jsx(
|
|
669
|
+
Button2,
|
|
670
|
+
{
|
|
671
|
+
size: "xs",
|
|
672
|
+
variant: "link",
|
|
673
|
+
className: "w-fit",
|
|
674
|
+
isDisabled: isPending,
|
|
675
|
+
children: /* @__PURE__ */ jsx(Link, { href: PATHS.auth.signIn.path, children: t("auth.forgot-password.anchor.text") })
|
|
676
|
+
}
|
|
677
|
+
),
|
|
678
|
+
/* @__PURE__ */ jsx(Button2, { type: "submit", isLoading: isPending, isDisabled: isCounting, children: buttonText })
|
|
679
|
+
] })
|
|
680
|
+
] })
|
|
681
|
+
}
|
|
682
|
+
);
|
|
659
683
|
};
|
|
660
684
|
}
|
|
661
685
|
function createResetPasswordPage({
|
|
@@ -674,64 +698,72 @@ function createResetPasswordPage({
|
|
|
674
698
|
() => resetPasswordAction({ formData: { passwordResetToken, ...formData } }),
|
|
675
699
|
{ onSuccess: () => router.push(PATHS.auth.signIn.path) }
|
|
676
700
|
);
|
|
677
|
-
return /* @__PURE__ */ jsx(
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
701
|
+
return /* @__PURE__ */ jsx(
|
|
702
|
+
Form,
|
|
703
|
+
{
|
|
704
|
+
className: "mx-auto w-96",
|
|
705
|
+
style: { marginTop: "56px" },
|
|
706
|
+
onSubmit: () => void execute(),
|
|
707
|
+
children: /* @__PURE__ */ jsxs(Card, { children: [
|
|
708
|
+
/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(CardTitle, { className: "mx-auto", children: t("auth.reset-password.text") }) }),
|
|
709
|
+
/* @__PURE__ */ jsxs(CardContent, { className: "relative flex flex-col gap-6", children: [
|
|
710
|
+
/* @__PURE__ */ jsx(
|
|
711
|
+
Field,
|
|
687
712
|
{
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
713
|
+
htmlFor: "newPassword",
|
|
714
|
+
label: t("auth.reset-password.new-password.text"),
|
|
715
|
+
children: /* @__PURE__ */ jsx(
|
|
716
|
+
PasswordInput,
|
|
717
|
+
{
|
|
718
|
+
id: "newPassword",
|
|
719
|
+
placeholder: t(
|
|
720
|
+
"auth.reset-password.new-password.placeholder.text"
|
|
721
|
+
),
|
|
722
|
+
fieldName: "newPassword",
|
|
723
|
+
value: formData.newPassword,
|
|
724
|
+
setFormData,
|
|
725
|
+
isDisabled: isRedirecting,
|
|
726
|
+
isError: errors.includes("newPassword")
|
|
727
|
+
}
|
|
728
|
+
)
|
|
697
729
|
}
|
|
698
|
-
)
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
/* @__PURE__ */ jsx(
|
|
702
|
-
Field,
|
|
703
|
-
{
|
|
704
|
-
htmlFor: "newPasswordConfirm",
|
|
705
|
-
label: t("auth.reset-password.new-password-confirm.text"),
|
|
706
|
-
children: /* @__PURE__ */ jsx(
|
|
707
|
-
PasswordInput,
|
|
730
|
+
),
|
|
731
|
+
/* @__PURE__ */ jsx(
|
|
732
|
+
Field,
|
|
708
733
|
{
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
734
|
+
htmlFor: "newPasswordConfirm",
|
|
735
|
+
label: t("auth.reset-password.new-password-confirm.text"),
|
|
736
|
+
children: /* @__PURE__ */ jsx(
|
|
737
|
+
PasswordInput,
|
|
738
|
+
{
|
|
739
|
+
id: "newPasswordConfirm",
|
|
740
|
+
placeholder: t(
|
|
741
|
+
`auth.reset-password.new-password-confirm.placeholder.text`
|
|
742
|
+
),
|
|
743
|
+
fieldName: "newPasswordConfirm",
|
|
744
|
+
value: formData.newPasswordConfirm,
|
|
745
|
+
setFormData,
|
|
746
|
+
isDisabled: isRedirecting,
|
|
747
|
+
isError: errors.includes("newPasswordConfirm")
|
|
748
|
+
}
|
|
749
|
+
)
|
|
750
|
+
}
|
|
751
|
+
),
|
|
752
|
+
/* @__PURE__ */ jsx(
|
|
753
|
+
Button2,
|
|
754
|
+
{
|
|
755
|
+
size: "xs",
|
|
756
|
+
variant: "link",
|
|
757
|
+
className: "w-fit",
|
|
716
758
|
isDisabled: isRedirecting,
|
|
717
|
-
|
|
759
|
+
children: /* @__PURE__ */ jsx(Link, { href: PATHS.auth.signIn.path, children: t("auth.reset-password.anchor.text") })
|
|
718
760
|
}
|
|
719
|
-
)
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
size: "xs",
|
|
726
|
-
variant: "link",
|
|
727
|
-
className: "w-fit",
|
|
728
|
-
isDisabled: isRedirecting,
|
|
729
|
-
children: /* @__PURE__ */ jsx(Link, { href: PATHS.auth.signIn.path, children: t("auth.reset-password.anchor.text") })
|
|
730
|
-
}
|
|
731
|
-
),
|
|
732
|
-
/* @__PURE__ */ jsx(Button2, { type: "submit", isLoading: isRedirecting, children: t("auth.reset-password.button.text") })
|
|
733
|
-
] })
|
|
734
|
-
] }) });
|
|
761
|
+
),
|
|
762
|
+
/* @__PURE__ */ jsx(Button2, { type: "submit", isLoading: isRedirecting, children: t("auth.reset-password.button.text") })
|
|
763
|
+
] })
|
|
764
|
+
] })
|
|
765
|
+
}
|
|
766
|
+
);
|
|
735
767
|
};
|
|
736
768
|
}
|
|
737
769
|
function createChangePasswordPage({
|
|
@@ -756,86 +788,94 @@ function createChangePasswordPage({
|
|
|
756
788
|
}),
|
|
757
789
|
{ onSuccess: () => router.push(PATHS.main.dashboard.path) }
|
|
758
790
|
);
|
|
759
|
-
return /* @__PURE__ */ jsx(
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
791
|
+
return /* @__PURE__ */ jsx(
|
|
792
|
+
Form,
|
|
793
|
+
{
|
|
794
|
+
className: "mx-auto w-96",
|
|
795
|
+
style: { marginTop: "56px" },
|
|
796
|
+
onSubmit: () => void execute(),
|
|
797
|
+
children: /* @__PURE__ */ jsxs(Card, { children: [
|
|
798
|
+
/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(CardTitle, { className: "mx-auto", children: t("auth.change-password.text") }) }),
|
|
799
|
+
/* @__PURE__ */ jsxs(CardContent, { className: "relative flex flex-col gap-6", children: [
|
|
800
|
+
/* @__PURE__ */ jsx(
|
|
801
|
+
Field,
|
|
769
802
|
{
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
803
|
+
htmlFor: "password",
|
|
804
|
+
label: t("auth.change-password.password.text"),
|
|
805
|
+
children: /* @__PURE__ */ jsx(
|
|
806
|
+
PasswordInput,
|
|
807
|
+
{
|
|
808
|
+
id: "password",
|
|
809
|
+
placeholder: t(
|
|
810
|
+
"auth.change-password.password.placeholder.text"
|
|
811
|
+
),
|
|
812
|
+
fieldName: "password",
|
|
813
|
+
value: formData.password,
|
|
814
|
+
setFormData,
|
|
815
|
+
isDisabled: isRedirecting,
|
|
816
|
+
isError: errors.includes("password")
|
|
817
|
+
}
|
|
818
|
+
)
|
|
779
819
|
}
|
|
780
|
-
)
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
/* @__PURE__ */ jsx(
|
|
784
|
-
Field,
|
|
785
|
-
{
|
|
786
|
-
htmlFor: "newPassword",
|
|
787
|
-
label: t("auth.change-password.new-password.text"),
|
|
788
|
-
children: /* @__PURE__ */ jsx(
|
|
789
|
-
PasswordInput,
|
|
820
|
+
),
|
|
821
|
+
/* @__PURE__ */ jsx(
|
|
822
|
+
Field,
|
|
790
823
|
{
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
824
|
+
htmlFor: "newPassword",
|
|
825
|
+
label: t("auth.change-password.new-password.text"),
|
|
826
|
+
children: /* @__PURE__ */ jsx(
|
|
827
|
+
PasswordInput,
|
|
828
|
+
{
|
|
829
|
+
id: "newPassword",
|
|
830
|
+
placeholder: t(
|
|
831
|
+
"auth.change-password.new-password.placeholder.text"
|
|
832
|
+
),
|
|
833
|
+
fieldName: "newPassword",
|
|
834
|
+
value: formData.newPassword,
|
|
835
|
+
setFormData,
|
|
836
|
+
isDisabled: isRedirecting,
|
|
837
|
+
isError: errors.includes("newPassword")
|
|
838
|
+
}
|
|
839
|
+
)
|
|
800
840
|
}
|
|
801
|
-
)
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
/* @__PURE__ */ jsx(
|
|
805
|
-
Field,
|
|
806
|
-
{
|
|
807
|
-
htmlFor: "newPasswordConfirm",
|
|
808
|
-
label: t("auth.change-password.new-password-confirm.text"),
|
|
809
|
-
children: /* @__PURE__ */ jsx(
|
|
810
|
-
PasswordInput,
|
|
841
|
+
),
|
|
842
|
+
/* @__PURE__ */ jsx(
|
|
843
|
+
Field,
|
|
811
844
|
{
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
845
|
+
htmlFor: "newPasswordConfirm",
|
|
846
|
+
label: t("auth.change-password.new-password-confirm.text"),
|
|
847
|
+
children: /* @__PURE__ */ jsx(
|
|
848
|
+
PasswordInput,
|
|
849
|
+
{
|
|
850
|
+
id: "newPasswordConfirm",
|
|
851
|
+
placeholder: t(
|
|
852
|
+
"auth.change-password.new-password-confirm.placeholder.text"
|
|
853
|
+
),
|
|
854
|
+
fieldName: "newPasswordConfirm",
|
|
855
|
+
value: formData.newPasswordConfirm,
|
|
856
|
+
setFormData,
|
|
857
|
+
isDisabled: isRedirecting,
|
|
858
|
+
isError: errors.includes("newPasswordConfirm")
|
|
859
|
+
}
|
|
860
|
+
)
|
|
861
|
+
}
|
|
862
|
+
),
|
|
863
|
+
/* @__PURE__ */ jsx(
|
|
864
|
+
Button2,
|
|
865
|
+
{
|
|
866
|
+
size: "xs",
|
|
867
|
+
variant: "link",
|
|
868
|
+
className: "w-fit",
|
|
819
869
|
isDisabled: isRedirecting,
|
|
820
|
-
|
|
870
|
+
children: /* @__PURE__ */ jsx(Link, { href: PATHS.main.dashboard.path, children: t("auth.change-password.anchor.text") })
|
|
821
871
|
}
|
|
822
|
-
)
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
variant: "link",
|
|
830
|
-
className: "w-fit",
|
|
831
|
-
isDisabled: isRedirecting,
|
|
832
|
-
children: /* @__PURE__ */ jsx(Link, { href: PATHS.main.dashboard.path, children: t("auth.change-password.anchor.text") })
|
|
833
|
-
}
|
|
834
|
-
),
|
|
835
|
-
/* @__PURE__ */ jsx(Button2, { type: "submit", isLoading: isRedirecting, children: t("auth.change-password.button.text") }),
|
|
836
|
-
" "
|
|
837
|
-
] })
|
|
838
|
-
] }) });
|
|
872
|
+
),
|
|
873
|
+
/* @__PURE__ */ jsx(Button2, { type: "submit", isLoading: isRedirecting, children: t("auth.change-password.button.text") }),
|
|
874
|
+
" "
|
|
875
|
+
] })
|
|
876
|
+
] })
|
|
877
|
+
}
|
|
878
|
+
);
|
|
839
879
|
};
|
|
840
880
|
}
|
|
841
881
|
|