@dyrected/admin 2.5.64 → 2.5.65

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 CHANGED
@@ -3485,6 +3485,10 @@
3485
3485
  padding-top: 1.25rem;
3486
3486
  }
3487
3487
 
3488
+ .dy-pt-6{
3489
+ padding-top: 1.5rem;
3490
+ }
3491
+
3488
3492
  .dy-text-left{
3489
3493
  text-align: left;
3490
3494
  }
package/dist/index.mjs CHANGED
@@ -1038,7 +1038,7 @@ function isNewerVersion(latest, current) {
1038
1038
  return false;
1039
1039
  }
1040
1040
  function useUpdateCheck() {
1041
- const currentVersion = "2.5.63";
1041
+ const currentVersion = "2.5.65";
1042
1042
  const [updateInfo, setUpdateInfo] = useState(() => {
1043
1043
  if (typeof window === "undefined") return null;
1044
1044
  const cacheKey = "dyrected_latest_release";
@@ -1264,7 +1264,7 @@ function getStatusLabel(doc) {
1264
1264
  }
1265
1265
  function Dashboard() {
1266
1266
  const { client, components, user } = useDyrected();
1267
- const currentVersion = "2.5.63";
1267
+ const currentVersion = "2.5.65";
1268
1268
  const [latestVersion, setLatestVersion] = useState(() => {
1269
1269
  if (typeof window === "undefined") return null;
1270
1270
  return localStorage.getItem("dyrected_latest_release");
@@ -9798,6 +9798,7 @@ function FormEngineInner({ collection, fields, defaultValues = {}, onSubmit, onC
9798
9798
  });
9799
9799
  const topFields = visibleFields.filter((f) => !f.admin?.tab);
9800
9800
  const tabbedFields = visibleFields.filter((f) => !!f.admin?.tab);
9801
+ const showPasswordSection = hasPassword && passwordChangeMode !== null;
9801
9802
  let fieldsContent;
9802
9803
  const renderFieldColumn = (field) => /* @__PURE__ */ jsx("div", {
9803
9804
  className: "dy-min-w-0 dy-px-3 dy-w-full sm:dy-w-[var(--field-w)]",
@@ -9810,10 +9811,73 @@ function FormEngineInner({ collection, fields, defaultValues = {}, onSubmit, onC
9810
9811
  documentId
9811
9812
  })
9812
9813
  }, field.name);
9814
+ const renderChangePasswordSection = () => /* @__PURE__ */ jsxs("div", {
9815
+ className: "dy-rounded-lg dy-border dy-border-border dy-p-5 dy-space-y-4",
9816
+ children: [
9817
+ /* @__PURE__ */ jsxs("div", {
9818
+ className: "dy-flex dy-items-center dy-gap-2 dy-text-sm dy-font-semibold dy-text-muted-foreground dy-uppercase dy-tracking-wide",
9819
+ children: [/* @__PURE__ */ jsx(Lock, { className: "dy-h-4 dy-w-4" }), "Change Password"]
9820
+ }),
9821
+ /* @__PURE__ */ jsx("p", {
9822
+ className: "dy-text-xs dy-text-muted-foreground",
9823
+ children: passwordChangeMode === "admin" ? "As an admin, you can reset this user's password without their current password." : "Leave these fields blank to keep the current password unchanged."
9824
+ }),
9825
+ /* @__PURE__ */ jsxs("div", {
9826
+ className: "dy-grid dy-gap-4",
9827
+ children: [
9828
+ passwordChangeMode === "self" && /* @__PURE__ */ jsx(FormField, {
9829
+ control: form.control,
9830
+ name: "oldPassword",
9831
+ render: ({ field }) => /* @__PURE__ */ jsxs(FormItem, { children: [
9832
+ /* @__PURE__ */ jsx(FormLabel, { children: "Current Password" }),
9833
+ /* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(Input, {
9834
+ type: "password",
9835
+ placeholder: "Enter current password",
9836
+ autoComplete: "current-password",
9837
+ ...field,
9838
+ value: field.value ?? ""
9839
+ }) }),
9840
+ /* @__PURE__ */ jsx(FormMessage, {})
9841
+ ] })
9842
+ }),
9843
+ /* @__PURE__ */ jsx(FormField, {
9844
+ control: form.control,
9845
+ name: "newPassword",
9846
+ render: ({ field }) => /* @__PURE__ */ jsxs(FormItem, { children: [
9847
+ /* @__PURE__ */ jsx(FormLabel, { children: "New Password" }),
9848
+ /* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(Input, {
9849
+ type: "password",
9850
+ placeholder: "Min. 8 characters",
9851
+ autoComplete: "new-password",
9852
+ ...field,
9853
+ value: field.value ?? ""
9854
+ }) }),
9855
+ /* @__PURE__ */ jsx(FormMessage, {})
9856
+ ] })
9857
+ }),
9858
+ /* @__PURE__ */ jsx(FormField, {
9859
+ control: form.control,
9860
+ name: "confirmPassword",
9861
+ render: ({ field }) => /* @__PURE__ */ jsxs(FormItem, { children: [
9862
+ /* @__PURE__ */ jsx(FormLabel, { children: "Confirm New Password" }),
9863
+ /* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(Input, {
9864
+ type: "password",
9865
+ placeholder: "Repeat new password",
9866
+ autoComplete: "new-password",
9867
+ ...field,
9868
+ value: field.value ?? ""
9869
+ }) }),
9870
+ /* @__PURE__ */ jsx(FormMessage, {})
9871
+ ] })
9872
+ })
9873
+ ]
9874
+ })
9875
+ ]
9876
+ });
9813
9877
  const tabOrder = [];
9814
9878
  const tabGroups = /* @__PURE__ */ new Map();
9815
9879
  const defaultTab = defaultTabLabel || collection.charAt(0).toUpperCase() + collection.slice(1);
9816
- if (tabbedFields.length > 0 && topFields.length > 0) {
9880
+ if (tabbedFields.length > 0 && (topFields.length > 0 || showPasswordSection)) {
9817
9881
  tabGroups.set(defaultTab, [...topFields]);
9818
9882
  tabOrder.push(defaultTab);
9819
9883
  }
@@ -9881,12 +9945,15 @@ function FormEngineInner({ collection, fields, defaultValues = {}, onSubmit, onC
9881
9945
  }, tab);
9882
9946
  })
9883
9947
  })
9884
- }), tabOrder.map((tab) => /* @__PURE__ */ jsx(TabsContent, {
9948
+ }), tabOrder.map((tab) => /* @__PURE__ */ jsxs(TabsContent, {
9885
9949
  value: tab,
9886
- children: /* @__PURE__ */ jsx("div", {
9950
+ children: [/* @__PURE__ */ jsx("div", {
9887
9951
  className: "dy--mx-3 dy-flex dy-flex-wrap dy-gap-y-6 dy-pt-2",
9888
9952
  children: tabGroups.get(tab).map(renderFieldColumn)
9889
- })
9953
+ }), tab === defaultTab && showPasswordSection && /* @__PURE__ */ jsx("div", {
9954
+ className: "dy-pt-6",
9955
+ children: renderChangePasswordSection()
9956
+ })]
9890
9957
  }, tab))]
9891
9958
  })
9892
9959
  });
@@ -9956,69 +10023,7 @@ function FormEngineInner({ collection, fields, defaultValues = {}, onSubmit, onC
9956
10023
  })]
9957
10024
  }),
9958
10025
  fieldsContent,
9959
- hasPassword && passwordChangeMode !== null && /* @__PURE__ */ jsxs("div", {
9960
- className: "dy-rounded-lg dy-border dy-border-border dy-p-5 dy-space-y-4",
9961
- children: [
9962
- /* @__PURE__ */ jsxs("div", {
9963
- className: "dy-flex dy-items-center dy-gap-2 dy-text-sm dy-font-semibold dy-text-muted-foreground dy-uppercase dy-tracking-wide",
9964
- children: [/* @__PURE__ */ jsx(Lock, { className: "dy-h-4 dy-w-4" }), "Change Password"]
9965
- }),
9966
- /* @__PURE__ */ jsx("p", {
9967
- className: "dy-text-xs dy-text-muted-foreground",
9968
- children: passwordChangeMode === "admin" ? "As an admin, you can reset this user's password without their current password." : "Leave these fields blank to keep the current password unchanged."
9969
- }),
9970
- /* @__PURE__ */ jsxs("div", {
9971
- className: "dy-grid dy-gap-4",
9972
- children: [
9973
- passwordChangeMode === "self" && /* @__PURE__ */ jsx(FormField, {
9974
- control: form.control,
9975
- name: "oldPassword",
9976
- render: ({ field }) => /* @__PURE__ */ jsxs(FormItem, { children: [
9977
- /* @__PURE__ */ jsx(FormLabel, { children: "Current Password" }),
9978
- /* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(Input, {
9979
- type: "password",
9980
- placeholder: "Enter current password",
9981
- autoComplete: "current-password",
9982
- ...field,
9983
- value: field.value ?? ""
9984
- }) }),
9985
- /* @__PURE__ */ jsx(FormMessage, {})
9986
- ] })
9987
- }),
9988
- /* @__PURE__ */ jsx(FormField, {
9989
- control: form.control,
9990
- name: "newPassword",
9991
- render: ({ field }) => /* @__PURE__ */ jsxs(FormItem, { children: [
9992
- /* @__PURE__ */ jsx(FormLabel, { children: "New Password" }),
9993
- /* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(Input, {
9994
- type: "password",
9995
- placeholder: "Min. 8 characters",
9996
- autoComplete: "new-password",
9997
- ...field,
9998
- value: field.value ?? ""
9999
- }) }),
10000
- /* @__PURE__ */ jsx(FormMessage, {})
10001
- ] })
10002
- }),
10003
- /* @__PURE__ */ jsx(FormField, {
10004
- control: form.control,
10005
- name: "confirmPassword",
10006
- render: ({ field }) => /* @__PURE__ */ jsxs(FormItem, { children: [
10007
- /* @__PURE__ */ jsx(FormLabel, { children: "Confirm New Password" }),
10008
- /* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(Input, {
10009
- type: "password",
10010
- placeholder: "Repeat new password",
10011
- autoComplete: "new-password",
10012
- ...field,
10013
- value: field.value ?? ""
10014
- }) }),
10015
- /* @__PURE__ */ jsx(FormMessage, {})
10016
- ] })
10017
- })
10018
- ]
10019
- })
10020
- ]
10021
- }),
10026
+ showPasswordSection && tabbedFields.length === 0 && renderChangePasswordSection(),
10022
10027
  !hideSubmit && /* @__PURE__ */ jsx("div", {
10023
10028
  className: "dy-flex dy-justify-end dy-gap-4",
10024
10029
  children: !readOnly && /* @__PURE__ */ jsx(Button, {
@@ -14809,7 +14814,7 @@ function SetupPromptUI({ config }) {
14809
14814
  setCopied(true);
14810
14815
  window.setTimeout(() => setCopied(false), 1800);
14811
14816
  }
14812
- const currentVersion = "2.5.63";
14817
+ const currentVersion = "2.5.65";
14813
14818
  const [latestVersion, setLatestVersion] = useState(() => {
14814
14819
  if (typeof window === "undefined") return null;
14815
14820
  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.64",
3
+ "version": "2.5.65",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -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.64",
68
67
  "@dyrected/knowledge": "^0.2.15",
69
- "@dyrected/sdk": "^2.5.64"
68
+ "@dyrected/core": "^2.5.65",
69
+ "@dyrected/sdk": "^2.5.65"
70
70
  },
71
71
  "peerDependencies": {
72
72
  "@tanstack/react-query": "^5.0.0",