@rnaga/wp-next-admin 1.1.2 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/client/components/RootLayout.d.ts +4 -0
  2. package/client/components/RootLayout.d.ts.map +1 -1
  3. package/client/components/RootLayout.js +2 -2
  4. package/client/components/WrapperRootLayout.d.ts +4 -0
  5. package/client/components/WrapperRootLayout.d.ts.map +1 -1
  6. package/client/components/contents/blogs/Edit.d.ts.map +1 -1
  7. package/client/components/contents/blogs/Edit.js +0 -1
  8. package/client/components/contents/dashboard/index.d.ts.map +1 -1
  9. package/client/components/contents/dashboard/index.js +1 -18
  10. package/client/components/contents/revisions/List/History.d.ts.map +1 -1
  11. package/client/components/contents/revisions/List/History.js +0 -1
  12. package/client/components/contents/settings/index.d.ts.map +1 -1
  13. package/client/components/contents/settings/index.js +1 -1
  14. package/client/components/contents/sites/Delete.d.ts.map +1 -1
  15. package/client/components/contents/sites/Delete.js +0 -1
  16. package/client/components/contents/sites/Edit.d.ts.map +1 -1
  17. package/client/components/contents/sites/Edit.js +1 -7
  18. package/client/components/contents/users/Edit/Roles/Edit.d.ts.map +1 -1
  19. package/client/components/contents/users/Edit/Roles/Edit.js +0 -1
  20. package/client/components/contents/users/Edit/index.d.ts.map +1 -1
  21. package/client/components/contents/users/Edit/index.js +0 -1
  22. package/client/components/utils/post/settings/Summary.d.ts.map +1 -1
  23. package/client/components/utils/post/settings/Summary.js +0 -1
  24. package/package.json +1 -1
  25. package/server/actions/dashboard.d.ts +1 -1
  26. package/server/components/RootLayout.d.ts.map +1 -1
  27. package/server/components/RootLayout.js +6 -5
@@ -8,6 +8,10 @@ export declare const RootLayout: (props: {
8
8
  adminUser: types.client.AdminUser;
9
9
  defaultMenuSegment: types.client.AdminPageSegment;
10
10
  session: Session;
11
+ logging?: {
12
+ enabled?: boolean;
13
+ level?: "debug" | "info" | "warn" | "error";
14
+ };
11
15
  }) => import("react/jsx-runtime").JSX.Element;
12
16
  export default RootLayout;
13
17
  //# sourceMappingURL=RootLayout.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RootLayout.d.ts","sourceRoot":"","sources":["../../../src/client/components/RootLayout.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,OAAO,KAAK,KAAK,WAAW,MAAM,2BAA2B,CAAC;AAE9D,OAAO,KAAK,KAAK,KAAK,MAAM,aAAa,CAAC;AAE1C,eAAO,MAAM,UAAU,GAAI,OAAO;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC;IAC7B,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC;IAC9B,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC;IAClC,kBAAkB,EAAE,KAAK,CAAC,MAAM,CAAC,gBAAgB,CAAC;IAClD,OAAO,EAAE,OAAO,CAAC;CAClB,4CAiBA,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"RootLayout.d.ts","sourceRoot":"","sources":["../../../src/client/components/RootLayout.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,OAAO,KAAK,KAAK,WAAW,MAAM,2BAA2B,CAAC;AAE9D,OAAO,KAAK,KAAK,KAAK,MAAM,aAAa,CAAC;AAE1C,eAAO,MAAM,UAAU,GAAI,OAAO;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC;IAC7B,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC;IAC9B,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC;IAClC,kBAAkB,EAAE,KAAK,CAAC,MAAM,CAAC,gBAAgB,CAAC;IAClD,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE;QACR,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;KAC7C,CAAC;CACH,4CAwBA,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -5,7 +5,7 @@ import { WPProvider } from "@rnaga/wp-next-core/client/wp";
5
5
  import { WPAdminProvider } from "../wp-admin";
6
6
  import { initialState } from "../wp-admin/initial-global-state";
7
7
  export const RootLayout = (props) => {
8
- const { site, user, adminUser, children, session, defaultMenuSegment } = props;
9
- return (_jsx(SessionProvider, { session: session, children: _jsx(WPProvider, { initialState: initialState, user: user, children: _jsx(WPAdminProvider, { site: site, adminUser: adminUser, defaultMenuSegment: defaultMenuSegment, children: children }) }) }));
8
+ const { site, user, adminUser, children, session, defaultMenuSegment, logging, } = props;
9
+ return (_jsx(SessionProvider, { session: session, children: _jsx(WPProvider, { initialState: initialState, user: user, logging: logging, children: _jsx(WPAdminProvider, { site: site, adminUser: adminUser, defaultMenuSegment: defaultMenuSegment, children: children }) }) }));
10
10
  };
11
11
  export default RootLayout;
@@ -5,5 +5,9 @@ export declare const WrapperRootLayout: import("react").ComponentType<{
5
5
  adminUser: import("../../types/client").AdminUser;
6
6
  defaultMenuSegment: import("../../types/client").AdminPageSegment;
7
7
  session: import("next-auth").Session;
8
+ logging?: {
9
+ enabled?: boolean;
10
+ level?: "debug" | "info" | "warn" | "error";
11
+ };
8
12
  }>;
9
13
  //# sourceMappingURL=WrapperRootLayout.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"WrapperRootLayout.d.ts","sourceRoot":"","sources":["../../../src/client/components/WrapperRootLayout.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,iBAAiB;;;;;;;EAK7B,CAAC"}
1
+ {"version":3,"file":"WrapperRootLayout.d.ts","sourceRoot":"","sources":["../../../src/client/components/WrapperRootLayout.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,iBAAiB;;;;;;;;eAMwc,CAAC;aAAoB,CAAC;;EAD3f,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Edit.d.ts","sourceRoot":"","sources":["../../../../../src/client/components/contents/blogs/Edit.tsx"],"names":[],"mappings":"AAsBA,eAAO,MAAM,IAAI,sDA2RhB,CAAC"}
1
+ {"version":3,"file":"Edit.d.ts","sourceRoot":"","sources":["../../../../../src/client/components/contents/blogs/Edit.tsx"],"names":[],"mappings":"AAsBA,eAAO,MAAM,IAAI,sDA0RhB,CAAC"}
@@ -57,7 +57,6 @@ export const Edit = () => {
57
57
  }
58
58
  const newAttributes = [];
59
59
  Object.entries(formData).forEach(([key, value]) => {
60
- console.log(key, value);
61
60
  if (validAttributeKeys.includes(key) && value === 1) {
62
61
  newAttributes.push(key);
63
62
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/client/components/contents/dashboard/index.tsx"],"names":[],"mappings":"AAgDA,eAAO,MAAM,SAAS,+CA6QrB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/client/components/contents/dashboard/index.tsx"],"names":[],"mappings":"AAgDA,eAAO,MAAM,SAAS,+CAoQrB,CAAC"}
@@ -52,7 +52,6 @@ export const Dashboard = () => {
52
52
  fetchActivity();
53
53
  }, [refreshValue().content]);
54
54
  const handleSubmit = async (data) => {
55
- console.log(formData);
56
55
  formData.post_author = user?.ID;
57
56
  formData.post_title = data.post_title;
58
57
  formData.post_content = data.post_content;
@@ -94,23 +93,7 @@ export const Dashboard = () => {
94
93
  format: "MMM Do YY, h:mm a",
95
94
  }) }), _jsx(Td, { children: _jsx(PostEditLink, { post: post }) })] }, `posts-${post.ID}`))) }) }), _jsx(Divider, {}), _jsx(Typography, { size: "medium", bold: true, children: "Recent Comments" }), _jsx(Table, { stripe: "even", ariaLabel: "table variants", sx: { borderCollapse: "inherit" }, children: _jsx("tbody", { children: dashboard?.activity.comments.map((comment) => (_jsx(Tr, { children: _jsx(Td, { children: _jsxs(Stack, { spacing: 0.5, children: [_jsxs(Typography, { children: ["From ", _jsx("b", { children: comment.comment_author }), " on", " ", _jsx("b", { children: comment.post_title })] }), _jsx(Typography, { sx: {
96
95
  p: 1,
97
- }, children: comment.comment_content }), userCan("edit_comment", comment) && (_jsx(Comments.ActionLink, { comment: comment }))] }) }) }, `comments-${comment.comment_ID}`))) }) })] })] }) }), userCan("edit_posts") && (_jsx(Grid, { size: { xs: 12, md: 6 }, children: _jsxs(Card, { variant: "outlined", children: [_jsx(Typography, { size: "large", bold: true, children: "Quick Drafts" }), _jsx(Divider, {}), _jsx("form", { onSubmit: submit(handleSubmit), children: _jsxs(Stack, { spacing: 1, sx: { display: "grid", gridTemplateColumns: "1fr" }, children: [_jsxs(FormControl, { children: [_jsx(FormLabel, { children: _jsx(Typography, { size: "medium", children: "Title" }) }), _jsx(Input, { size: "medium", name: "post_title" })] }), _jsxs(FormControl, { children: [_jsx(FormLabel, { children: _jsx(Typography, { size: "medium", children: "Content" }) }), _jsx(LightEditor
98
- //editorKey="post-draft"
99
- //initialValue=""
100
- // minHeight={200}
101
- // onChange={(content) => {
102
- // console.log(content);
103
- // setFormData({ post_content: content });
104
- // }}
105
- , {
106
- //editorKey="post-draft"
107
- //initialValue=""
108
- // minHeight={200}
109
- // onChange={(content) => {
110
- // console.log(content);
111
- // setFormData({ post_content: content });
112
- // }}
113
- minHeight: 200, onUpdate: (editor, transaction) => {
96
+ }, children: comment.comment_content }), userCan("edit_comment", comment) && (_jsx(Comments.ActionLink, { comment: comment }))] }) }) }, `comments-${comment.comment_ID}`))) }) })] })] }) }), userCan("edit_posts") && (_jsx(Grid, { size: { xs: 12, md: 6 }, children: _jsxs(Card, { variant: "outlined", children: [_jsx(Typography, { size: "large", bold: true, children: "Quick Drafts" }), _jsx(Divider, {}), _jsx("form", { onSubmit: submit(handleSubmit), children: _jsxs(Stack, { spacing: 1, sx: { display: "grid", gridTemplateColumns: "1fr" }, children: [_jsxs(FormControl, { children: [_jsx(FormLabel, { children: _jsx(Typography, { size: "medium", children: "Title" }) }), _jsx(Input, { size: "medium", name: "post_title" })] }), _jsxs(FormControl, { children: [_jsx(FormLabel, { children: _jsx(Typography, { size: "medium", children: "Content" }) }), _jsx(LightEditor, { minHeight: 200, onUpdate: (editor, transaction) => {
114
97
  setFormData({ post_content: editor.getHTML() });
115
98
  } })] }), _jsx(Button, { type: "submit", children: "Save Draft" })] }) }), _jsx(Divider, {}), _jsx(Typography, { size: "medium", children: "Your Recent Drafts" }), _jsx(Table, { children: _jsx("tbody", { children: dashboard?.postDrafts.map((post) => (_jsx(Tr, { children: _jsxs(Td, { children: [_jsxs(Typography, { display: "block", children: [_jsx(PostEditLink, { post: post }), " ", formatting.date(post.post_date, {
116
99
  format: "MMM Do YY",
@@ -1 +1 @@
1
- {"version":3,"file":"History.d.ts","sourceRoot":"","sources":["../../../../../../src/client/components/contents/revisions/List/History.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,WAAW,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,GAAG,CAAC;AAO1C,eAAO,MAAM,OAAO,GAAI,OAAO;IAC7B,SAAS,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC;IAC1C,OAAO,EAAE,CAAC,QAAQ,EAAE,gBAAgB,KAAK,IAAI,CAAC;CAC/C,mDA+DA,CAAC"}
1
+ {"version":3,"file":"History.d.ts","sourceRoot":"","sources":["../../../../../../src/client/components/contents/revisions/List/History.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,WAAW,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,GAAG,CAAC;AAO1C,eAAO,MAAM,OAAO,GAAI,OAAO;IAC7B,SAAS,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC;IAC1C,OAAO,EAAE,CAAC,QAAQ,EAAE,gBAAgB,KAAK,IAAI,CAAC;CAC/C,mDA8DA,CAAC"}
@@ -11,7 +11,6 @@ export const History = (props) => {
11
11
  setSelectedId(revisions?.[0]?.ID);
12
12
  }, []);
13
13
  const handleClick = (revision) => {
14
- console.log("revision.target?.ID", revision.target?.ID, selectedId);
15
14
  setSelectedId(revision.target?.ID);
16
15
  onClick(revision);
17
16
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/client/components/contents/settings/index.tsx"],"names":[],"mappings":"AAoBA,eAAO,MAAM,QAAQ,sDAwLpB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/client/components/contents/settings/index.tsx"],"names":[],"mappings":"AAoBA,eAAO,MAAM,QAAQ,sDAuLpB,CAAC"}
@@ -55,7 +55,7 @@ export const Settings = () => {
55
55
  }, value: options.timezone_string || "Etc/UTC", items: moment.tz.names().map((name) => ({
56
56
  label: name,
57
57
  value: name,
58
- })), disableClearable: true })] }), _jsxs(FormControl, { children: [_jsx(FormLabel, { children: "Default Post Category" }), _jsx(SelectWPTerm, { size: "medium", taxonomy: "category", defaultValue: options.default_category, onChange: (term) => setFormData({ default_category: term.term_id }) })] }), !site.isMultiSite && (_jsxs(FormControl, { children: [_jsx(FormLabel, { children: "Membership" }), _jsx(Checkbox, { size: "medium", defaultChecked: options.users_can_register == "1", onChange: handleCheckbox("users_can_register"), label: "Anyone can register" })] })), _jsxs(Stack, { spacing: 1.5, children: [_jsx(FormLabel, { children: "Comments Settings" }), _jsx(Checkbox, { size: "medium", defaultChecked: options.require_name_email == "1", onChange: handleCheckbox("require_name_email"), label: "Comment author must fill out name and email" }), _jsx(Checkbox, { size: "medium", value: 1, name: "comment_registration", defaultChecked: options.comment_registration == "1", onChange: (e) => console.log(e.target.checked), label: "Users must be registered and logged in to comment" }), _jsx(Checkbox, { size: "medium", value: 1, defaultChecked: options.comment_moderation == "1", onChange: handleCheckbox("comment_moderation"), label: "Comment must be manually approved" }), _jsx(Checkbox, { size: "medium", value: 1, defaultChecked: options.comment_previously_approved == "1", onChange: handleCheckbox("comment_previously_approved"), label: "Comment author must have a previously approved comment" }), _jsx(FormLabel, { children: "Comment Moderation" }), _jsx(InputMultiple, { size: "medium", onChange: (value) => {
58
+ })), disableClearable: true })] }), _jsxs(FormControl, { children: [_jsx(FormLabel, { children: "Default Post Category" }), _jsx(SelectWPTerm, { size: "medium", taxonomy: "category", defaultValue: options.default_category, onChange: (term) => setFormData({ default_category: term.term_id }) })] }), !site.isMultiSite && (_jsxs(FormControl, { children: [_jsx(FormLabel, { children: "Membership" }), _jsx(Checkbox, { size: "medium", defaultChecked: options.users_can_register == "1", onChange: handleCheckbox("users_can_register"), label: "Anyone can register" })] })), _jsxs(Stack, { spacing: 1.5, children: [_jsx(FormLabel, { children: "Comments Settings" }), _jsx(Checkbox, { size: "medium", defaultChecked: options.require_name_email == "1", onChange: handleCheckbox("require_name_email"), label: "Comment author must fill out name and email" }), _jsx(Checkbox, { size: "medium", value: 1, name: "comment_registration", defaultChecked: options.comment_registration == "1", label: "Users must be registered and logged in to comment" }), _jsx(Checkbox, { size: "medium", value: 1, defaultChecked: options.comment_moderation == "1", onChange: handleCheckbox("comment_moderation"), label: "Comment must be manually approved" }), _jsx(Checkbox, { size: "medium", value: 1, defaultChecked: options.comment_previously_approved == "1", onChange: handleCheckbox("comment_previously_approved"), label: "Comment author must have a previously approved comment" }), _jsx(FormLabel, { children: "Comment Moderation" }), _jsx(InputMultiple, { size: "medium", onChange: (value) => {
59
59
  setFormData({ moderation_keys: value.join("\n") });
60
60
  }, value: 0 >= options?.moderation_keys.length
61
61
  ? undefined
@@ -1 +1 @@
1
- {"version":3,"file":"Delete.d.ts","sourceRoot":"","sources":["../../../../../src/client/components/contents/sites/Delete.tsx"],"names":[],"mappings":"AAwBA,eAAO,MAAM,MAAM,sDAmOlB,CAAC"}
1
+ {"version":3,"file":"Delete.d.ts","sourceRoot":"","sources":["../../../../../src/client/components/contents/sites/Delete.tsx"],"names":[],"mappings":"AAwBA,eAAO,MAAM,MAAM,sDAkOlB,CAAC"}
@@ -75,7 +75,6 @@ export const Delete = () => {
75
75
  setFormData({ deleteAll: false, newSiteId });
76
76
  };
77
77
  const handleChangeRadio = (v) => {
78
- console.log(v);
79
78
  setFormData({ deleteAll: v === "delete" });
80
79
  };
81
80
  const validate = (data) => {
@@ -1 +1 @@
1
- {"version":3,"file":"Edit.d.ts","sourceRoot":"","sources":["../../../../../src/client/components/contents/sites/Edit.tsx"],"names":[],"mappings":"AAoBA,eAAO,MAAM,IAAI,sDAwOhB,CAAC"}
1
+ {"version":3,"file":"Edit.d.ts","sourceRoot":"","sources":["../../../../../src/client/components/contents/sites/Edit.tsx"],"names":[],"mappings":"AAoBA,eAAO,MAAM,IAAI,sDAkOhB,CAAC"}
@@ -53,7 +53,6 @@ export const Edit = () => {
53
53
  });
54
54
  }, [siteId]);
55
55
  const handleFormMetaChange = (key, value) => {
56
- console.log("handleFormMetaChange", key, value);
57
56
  setFormData({
58
57
  ...formData,
59
58
  meta_input: {
@@ -63,7 +62,6 @@ export const Edit = () => {
63
62
  });
64
63
  };
65
64
  const handleSubmit = async (data) => {
66
- console.log("data", data);
67
65
  const result = await execute(actions.site.update(siteId, data)).then(safeParse);
68
66
  if (!result.success) {
69
67
  overlay.snackbar.open("error", result.error);
@@ -87,9 +85,7 @@ export const Edit = () => {
87
85
  ? [true]
88
86
  : [false, "Value can only contain lowercase letters (a-z) and numbers"];
89
87
  };
90
- useEffect(() => {
91
- console.log("Edit useEffect", formData);
92
- }, [formData]);
88
+ useEffect(() => { }, [formData]);
93
89
  if (!site) {
94
90
  return null;
95
91
  }
@@ -98,7 +94,6 @@ export const Edit = () => {
98
94
  justifyContent: "flex-end",
99
95
  gap: 1.5,
100
96
  }, children: [_jsx(Button, { size: "medium", type: "submit", children: "Save" }), siteId > 1 && (_jsx(IconButtonDelete, { title: "Delete Site", onClick: handleDelete }))] }), _jsxs(Stack, { spacing: 2, sx: { rowGap: 1, display: "flex" }, children: [_jsxs(FormControl, { children: [_jsx(FormLabel, { children: "Site Name" }), _jsx(Input, { size: "medium", value: formData.meta_input?.["site_name"], placeholder: "Site Name", onChange: (value) => handleFormMetaChange("site_name", value) })] }), _jsxs(FormControl, { children: [_jsx(FormLabel, { children: "Site Admin Email" }), _jsx(Input, { size: "medium", value: formData.meta_input?.["admin_email"], placeholder: "Site Admin Email", onChange: (value) => handleFormMetaChange("admin_email", value) })] }), _jsxs(Box, { sx: { display: "grid", gap: 1.5, gridTemplateColumns: "1fr 1fr" }, children: [_jsxs(FormControl, { children: [_jsx(FormLabel, { children: "Domain" }), _jsx(Input, { size: "medium", value: site.domain })] }), _jsxs(FormControl, { children: [_jsx(FormLabel, { children: "Path" }), _jsx(Input, { size: "medium", name: "path", value: site.path })] })] }), _jsxs(FormControl, { children: [_jsx(FormLabel, { children: "Add New Users" }), _jsx(Checkbox, { size: "medium", defaultChecked: site.site_meta.add_new_users == "1", onChange: (e) => {
101
- console.log(e.target.checked);
102
97
  handleFormMetaChange("add_new_users", e.target.checked ? 1 : 0);
103
98
  }, label: "Allow administrators to add new users" })] }), _jsxs(FormControl, { children: [_jsx(FormLabel, { children: "Allow new registrations" }), _jsx(Select, { size: "medium", value: formData.meta_input?.["registration"] || "none", onChange: (value) => handleFormMetaChange("registration", value), enum: [
104
99
  { value: "none", label: "Registration is disabled" },
@@ -112,7 +107,6 @@ export const Edit = () => {
112
107
  label: "Both sites and user accounts can be registered",
113
108
  },
114
109
  ] })] }), _jsxs(FormControl, { children: [_jsx(FormLabel, { children: "Banned Names" }), _jsx(InputMultiple, { onChange: (value) => handleFormMetaChange("illegal_names", value), validate: validateName, value: formData.meta_input?.["illegal_names"] || [], limitTags: 15 })] }), _jsxs(Box, { sx: { display: "grid", gap: 1.5, gridTemplateColumns: "1fr 1fr" }, children: [_jsxs(FormControl, { children: [_jsx(FormLabel, { children: "Limited Email Registrations" }), _jsx(InputMultiple, { size: "medium", onChange: (value) => {
115
- console.log("value", value);
116
110
  handleFormMetaChange("limited_email_domains", value);
117
111
  }, value: formData.meta_input?.["limited_email_domains"] || [], validate: validateDomain, limitTags: 5 })] }), _jsxs(FormControl, { children: [_jsx(FormLabel, { children: "Banned Email Domains" }), _jsx(InputMultiple, { size: "medium", onChange: (value) => {
118
112
  handleFormMetaChange("banned_email_domains", value);
@@ -1 +1 @@
1
- {"version":3,"file":"Edit.d.ts","sourceRoot":"","sources":["../../../../../../../src/client/components/contents/users/Edit/Roles/Edit.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAarD,eAAO,MAAM,IAAI,GAAI,OAAO;IAC1B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,CAAC;CACrC,mDAoFA,CAAC"}
1
+ {"version":3,"file":"Edit.d.ts","sourceRoot":"","sources":["../../../../../../../src/client/components/contents/users/Edit/Roles/Edit.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAarD,eAAO,MAAM,IAAI,GAAI,OAAO;IAC1B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,CAAC;CACrC,mDAmFA,CAAC"}
@@ -46,7 +46,6 @@ export const Edit = (props) => {
46
46
  })), value: selectedRoleNames, onChange: (items) => {
47
47
  const newRoleNames = items.map((item) => item.id);
48
48
  setValues(newRoleNames);
49
- console.log("onChange", items);
50
49
  }, slotSxProps: {
51
50
  input: { minWidth: "300px", minHeight: "28px" },
52
51
  }, limitTags: 5 }), _jsx(Tooltip, { title: "Update Roles", placement: "top", children: _jsx(IconButton, { color: "success", size: "small", onClick: handleUpdateRole, children: _jsx(DoneIcon, {}) }) }), _jsx(Tooltip, { title: "Cancel", placement: "top", children: _jsx(IconButton, { color: "error", size: "small", onClick: onCancelEdit, children: _jsx(CancelIcon, {}) }) })] }));
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/client/components/contents/users/Edit/index.tsx"],"names":[],"mappings":"AAcA,eAAO,MAAM,IAAI,GAAI,QAAQ;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,mDA4FpE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/client/components/contents/users/Edit/index.tsx"],"names":[],"mappings":"AAcA,eAAO,MAAM,IAAI,GAAI,QAAQ;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,mDA2FpE,CAAC"}
@@ -29,7 +29,6 @@ export const Edit = (props) => {
29
29
  .can("edit_user", userId)
30
30
  .then(safeParse);
31
31
  if (!response.success) {
32
- console.info(response.error);
33
32
  setCanEditUser(false);
34
33
  return;
35
34
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Summary.d.ts","sourceRoot":"","sources":["../../../../../../src/client/components/utils/post/settings/Summary.tsx"],"names":[],"mappings":"AAsCA,eAAO,MAAM,OAAO,+CAqFnB,CAAC"}
1
+ {"version":3,"file":"Summary.d.ts","sourceRoot":"","sources":["../../../../../../src/client/components/utils/post/settings/Summary.tsx"],"names":[],"mappings":"AAsCA,eAAO,MAAM,OAAO,+CAoFnB,CAAC"}
@@ -42,7 +42,6 @@ export const Summary = () => {
42
42
  { label: "Pending", value: "pending" },
43
43
  { label: "Future", value: "future" },
44
44
  ], value: formData?.post_status ?? "publish", onChange: (value) => {
45
- console.log("Selected weight:", value);
46
45
  setFormData({ post_status: value });
47
46
  } }) }), _jsx(FormContent, { label: "Publish Date", children: _jsxs(Box, { children: [_jsx(DateTimePicker, { size: "medium", value: formData.post_date, onChange: (newValue) => {
48
47
  setFormData({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rnaga/wp-next-admin",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "license": "MIT",
5
5
  "description": "Admin interface for WP Next",
6
6
  "author": "Ryohei Nagatsuka",
@@ -108,6 +108,7 @@ export declare const activity: () => Promise<import("@rnaga/wp-next-core/types/s
108
108
  post_parent: string;
109
109
  post_name: string;
110
110
  post_title: string;
111
+ menu_order: string;
111
112
  post_date_gmt: string;
112
113
  post_content: string;
113
114
  post_excerpt: string;
@@ -120,7 +121,6 @@ export declare const activity: () => Promise<import("@rnaga/wp-next-core/types/s
120
121
  post_modified_gmt: string;
121
122
  post_content_filtered: string;
122
123
  guid: string;
123
- menu_order: string;
124
124
  post_type: string;
125
125
  post_mime_type: string;
126
126
  comment_count: string;
@@ -1 +1 @@
1
- {"version":3,"file":"RootLayout.d.ts","sourceRoot":"","sources":["../../../src/server/components/RootLayout.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,eAAO,MAAM,UAAU,GAAU,OAAO;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,qDAqGpE,CAAC"}
1
+ {"version":3,"file":"RootLayout.d.ts","sourceRoot":"","sources":["../../../src/server/components/RootLayout.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B,eAAO,MAAM,UAAU,GAAU,OAAO;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,qDAsGpE,CAAC"}
@@ -1,19 +1,20 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { redirect } from "next/navigation";
3
- import { WrapperRootLayout as ClientRootLayout } from "../../client/components/WrapperRootLayout";
4
- import * as actionsAdminUser from "@rnaga/wp-next-core/server/actions/admin-user";
5
3
  import { AuthError } from "@rnaga/wp-next-core/client/components/auth";
4
+ import * as actionsAdminUser from "@rnaga/wp-next-core/server/actions/admin-user";
5
+ import { getLoggingConfig, logger, } from "@rnaga/wp-next-core/server/utils/logger";
6
+ import { WrapperRootLayout as ClientRootLayout } from "../../client/components/WrapperRootLayout";
6
7
  import { WPAdmin } from "../wp-admin";
7
8
  export const RootLayout = async (props) => {
8
9
  const { children } = props;
9
10
  const { wp, session, paths, basePath, blogBasePath, blogId, siteId, pageSegment, } = await WPAdmin();
10
11
  const blogName = (await wp.options.get("blogname")) ?? "";
11
12
  if (!wp.current.user || !wp.current.user.props) {
12
- console.info("User not found. If this occurs even after a successful login,", "check if all the necessary hooks are installed and activated.", "Specifically, check if NextCoreInit is properly added by getAdminHooks().");
13
+ logger.info("User not found. If this occurs even after a successful login,", "check if all the necessary hooks are installed and activated.", "Specifically, check if NextCoreInit is properly added by getAdminHooks().");
13
14
  return (_jsx(AuthError, { error: "User not found. Please login again.", showLogoutLink: true }));
14
15
  }
15
16
  if (!process.env.BASE_URL) {
16
- console.info("Base URL not found. Check if the environment variable BASE_URL is set.");
17
+ logger.info("Base URL not found. Check if the environment variable BASE_URL is set.");
17
18
  return (_jsx(AuthError, { error: "Base URL not found. Check if the environment variable BASE_URL is set." }));
18
19
  }
19
20
  const baseUrl = process.env.BASE_URL;
@@ -53,5 +54,5 @@ export const RootLayout = async (props) => {
53
54
  names: new Set(role.names),
54
55
  capabilities: new Set(responseAdminUser.data.role.capabilities),
55
56
  },
56
- }, adminUser: currentAdminUser, session: session, children: children }));
57
+ }, adminUser: currentAdminUser, session: session, logging: getLoggingConfig(), children: children }));
57
58
  };