@rnaga/wp-next-admin 1.0.1
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/README.md +292 -0
- package/client/components/RootLayout.d.ts +13 -0
- package/client/components/RootLayout.d.ts.map +1 -0
- package/client/components/RootLayout.js +13 -0
- package/client/components/WrapperRootLayout.d.ts +9 -0
- package/client/components/WrapperRootLayout.d.ts.map +1 -0
- package/client/components/WrapperRootLayout.js +5 -0
- package/client/components/contents/blogs/Create.d.ts +2 -0
- package/client/components/contents/blogs/Create.d.ts.map +1 -0
- package/client/components/contents/blogs/Create.js +67 -0
- package/client/components/contents/blogs/Edit.d.ts +2 -0
- package/client/components/contents/blogs/Edit.d.ts.map +1 -0
- package/client/components/contents/blogs/Edit.js +144 -0
- package/client/components/contents/blogs/List.d.ts +2 -0
- package/client/components/contents/blogs/List.d.ts.map +1 -0
- package/client/components/contents/blogs/List.js +56 -0
- package/client/components/contents/blogs/index.d.ts +6 -0
- package/client/components/contents/blogs/index.d.ts.map +1 -0
- package/client/components/contents/blogs/index.js +8 -0
- package/client/components/contents/comments/ActionLink.d.ts +5 -0
- package/client/components/contents/comments/ActionLink.d.ts.map +1 -0
- package/client/components/contents/comments/ActionLink.js +67 -0
- package/client/components/contents/comments/List/Reply.d.ts +5 -0
- package/client/components/contents/comments/List/Reply.d.ts.map +1 -0
- package/client/components/contents/comments/List/Reply.js +33 -0
- package/client/components/contents/comments/List/Row.d.ts +5 -0
- package/client/components/contents/comments/List/Row.d.ts.map +1 -0
- package/client/components/contents/comments/List/Row.js +30 -0
- package/client/components/contents/comments/List/Toolbar.d.ts +8 -0
- package/client/components/contents/comments/List/Toolbar.d.ts.map +1 -0
- package/client/components/contents/comments/List/Toolbar.js +14 -0
- package/client/components/contents/comments/List/index.d.ts +5 -0
- package/client/components/contents/comments/List/index.d.ts.map +1 -0
- package/client/components/contents/comments/List/index.js +38 -0
- package/client/components/contents/comments/index.d.ts +7 -0
- package/client/components/contents/comments/index.d.ts.map +1 -0
- package/client/components/contents/comments/index.js +6 -0
- package/client/components/contents/dashboard/index.d.ts +2 -0
- package/client/components/contents/dashboard/index.d.ts.map +1 -0
- package/client/components/contents/dashboard/index.js +123 -0
- package/client/components/contents/index.d.ts +46 -0
- package/client/components/contents/index.d.ts.map +1 -0
- package/client/components/contents/index.js +28 -0
- package/client/components/contents/media/Edit.d.ts +2 -0
- package/client/components/contents/media/Edit.d.ts.map +1 -0
- package/client/components/contents/media/Edit.js +86 -0
- package/client/components/contents/media/List/ActionLink.d.ts +5 -0
- package/client/components/contents/media/List/ActionLink.d.ts.map +1 -0
- package/client/components/contents/media/List/ActionLink.js +24 -0
- package/client/components/contents/media/List/Table.d.ts +5 -0
- package/client/components/contents/media/List/Table.d.ts.map +1 -0
- package/client/components/contents/media/List/Table.js +38 -0
- package/client/components/contents/media/List/Thumbnail.d.ts +5 -0
- package/client/components/contents/media/List/Thumbnail.d.ts.map +1 -0
- package/client/components/contents/media/List/Thumbnail.js +28 -0
- package/client/components/contents/media/List/index.d.ts +2 -0
- package/client/components/contents/media/List/index.d.ts.map +1 -0
- package/client/components/contents/media/List/index.js +66 -0
- package/client/components/contents/media/index.d.ts +5 -0
- package/client/components/contents/media/index.d.ts.map +1 -0
- package/client/components/contents/media/index.js +6 -0
- package/client/components/contents/pages/Edit/Settings.d.ts +2 -0
- package/client/components/contents/pages/Edit/Settings.d.ts.map +1 -0
- package/client/components/contents/pages/Edit/Settings.js +17 -0
- package/client/components/contents/pages/Edit/Toolbar.d.ts +2 -0
- package/client/components/contents/pages/Edit/Toolbar.d.ts.map +1 -0
- package/client/components/contents/pages/Edit/Toolbar.js +72 -0
- package/client/components/contents/pages/Edit/index.d.ts +2 -0
- package/client/components/contents/pages/Edit/index.d.ts.map +1 -0
- package/client/components/contents/pages/Edit/index.js +43 -0
- package/client/components/contents/pages/List/ActionLink.d.ts +5 -0
- package/client/components/contents/pages/List/ActionLink.d.ts.map +1 -0
- package/client/components/contents/pages/List/ActionLink.js +12 -0
- package/client/components/contents/pages/List/Statuses.d.ts +2 -0
- package/client/components/contents/pages/List/Statuses.d.ts.map +1 -0
- package/client/components/contents/pages/List/Statuses.js +24 -0
- package/client/components/contents/pages/List/Toolbar.d.ts +8 -0
- package/client/components/contents/pages/List/Toolbar.d.ts.map +1 -0
- package/client/components/contents/pages/List/Toolbar.js +14 -0
- package/client/components/contents/pages/List/index.d.ts +2 -0
- package/client/components/contents/pages/List/index.d.ts.map +1 -0
- package/client/components/contents/pages/List/index.js +45 -0
- package/client/components/contents/pages/index.d.ts +5 -0
- package/client/components/contents/pages/index.d.ts.map +1 -0
- package/client/components/contents/pages/index.js +6 -0
- package/client/components/contents/posts/Edit/Settings.d.ts +2 -0
- package/client/components/contents/posts/Edit/Settings.d.ts.map +1 -0
- package/client/components/contents/posts/Edit/Settings.js +19 -0
- package/client/components/contents/posts/Edit/Toolbar.d.ts +2 -0
- package/client/components/contents/posts/Edit/Toolbar.d.ts.map +1 -0
- package/client/components/contents/posts/Edit/Toolbar.js +72 -0
- package/client/components/contents/posts/Edit/index.d.ts +2 -0
- package/client/components/contents/posts/Edit/index.d.ts.map +1 -0
- package/client/components/contents/posts/Edit/index.js +43 -0
- package/client/components/contents/posts/List/ActionLink.d.ts +5 -0
- package/client/components/contents/posts/List/ActionLink.d.ts.map +1 -0
- package/client/components/contents/posts/List/ActionLink.js +12 -0
- package/client/components/contents/posts/List/Statuses.d.ts +2 -0
- package/client/components/contents/posts/List/Statuses.d.ts.map +1 -0
- package/client/components/contents/posts/List/Statuses.js +32 -0
- package/client/components/contents/posts/List/Toolbar.d.ts +8 -0
- package/client/components/contents/posts/List/Toolbar.d.ts.map +1 -0
- package/client/components/contents/posts/List/Toolbar.js +14 -0
- package/client/components/contents/posts/List/index.d.ts +2 -0
- package/client/components/contents/posts/List/index.d.ts.map +1 -0
- package/client/components/contents/posts/List/index.js +46 -0
- package/client/components/contents/posts/index.d.ts +5 -0
- package/client/components/contents/posts/index.d.ts.map +1 -0
- package/client/components/contents/posts/index.js +6 -0
- package/client/components/contents/profile/index.d.ts +2 -0
- package/client/components/contents/profile/index.d.ts.map +1 -0
- package/client/components/contents/profile/index.js +7 -0
- package/client/components/contents/revisions/List/History.d.ts +7 -0
- package/client/components/contents/revisions/List/History.d.ts.map +1 -0
- package/client/components/contents/revisions/List/History.js +37 -0
- package/client/components/contents/revisions/List/diff2html.css +11 -0
- package/client/components/contents/revisions/List/index.d.ts +9 -0
- package/client/components/contents/revisions/List/index.d.ts.map +1 -0
- package/client/components/contents/revisions/List/index.js +145 -0
- package/client/components/contents/revisions/index.d.ts +2 -0
- package/client/components/contents/revisions/index.d.ts.map +1 -0
- package/client/components/contents/revisions/index.js +1 -0
- package/client/components/contents/roles/List/EditModal.d.ts +8 -0
- package/client/components/contents/roles/List/EditModal.d.ts.map +1 -0
- package/client/components/contents/roles/List/EditModal.js +153 -0
- package/client/components/contents/roles/List/index.d.ts +7 -0
- package/client/components/contents/roles/List/index.d.ts.map +1 -0
- package/client/components/contents/roles/List/index.js +111 -0
- package/client/components/contents/roles/index.d.ts +2 -0
- package/client/components/contents/roles/index.d.ts.map +1 -0
- package/client/components/contents/roles/index.js +1 -0
- package/client/components/contents/settings/index.d.ts +2 -0
- package/client/components/contents/settings/index.d.ts.map +1 -0
- package/client/components/contents/settings/index.js +67 -0
- package/client/components/contents/sites/Create.d.ts +2 -0
- package/client/components/contents/sites/Create.d.ts.map +1 -0
- package/client/components/contents/sites/Create.js +53 -0
- package/client/components/contents/sites/Delete.d.ts +2 -0
- package/client/components/contents/sites/Delete.d.ts.map +1 -0
- package/client/components/contents/sites/Delete.js +125 -0
- package/client/components/contents/sites/Edit.d.ts +2 -0
- package/client/components/contents/sites/Edit.d.ts.map +1 -0
- package/client/components/contents/sites/Edit.js +120 -0
- package/client/components/contents/sites/List.d.ts +2 -0
- package/client/components/contents/sites/List.d.ts.map +1 -0
- package/client/components/contents/sites/List.js +33 -0
- package/client/components/contents/sites/index.d.ts +7 -0
- package/client/components/contents/sites/index.d.ts.map +1 -0
- package/client/components/contents/sites/index.js +10 -0
- package/client/components/contents/terms/List/ActionLink.d.ts +5 -0
- package/client/components/contents/terms/List/ActionLink.d.ts.map +1 -0
- package/client/components/contents/terms/List/ActionLink.js +44 -0
- package/client/components/contents/terms/List/Toolbar.d.ts +8 -0
- package/client/components/contents/terms/List/Toolbar.d.ts.map +1 -0
- package/client/components/contents/terms/List/Toolbar.js +20 -0
- package/client/components/contents/terms/List/index.d.ts +18 -0
- package/client/components/contents/terms/List/index.d.ts.map +1 -0
- package/client/components/contents/terms/List/index.js +94 -0
- package/client/components/contents/terms/index.d.ts +2 -0
- package/client/components/contents/terms/index.d.ts.map +1 -0
- package/client/components/contents/terms/index.js +1 -0
- package/client/components/contents/users/Create.d.ts +2 -0
- package/client/components/contents/users/Create.d.ts.map +1 -0
- package/client/components/contents/users/Create.js +47 -0
- package/client/components/contents/users/Delete.d.ts +2 -0
- package/client/components/contents/users/Delete.d.ts.map +1 -0
- package/client/components/contents/users/Delete.js +113 -0
- package/client/components/contents/users/Edit/Profile/GenerateResetLinkModal.d.ts +6 -0
- package/client/components/contents/users/Edit/Profile/GenerateResetLinkModal.d.ts.map +1 -0
- package/client/components/contents/users/Edit/Profile/GenerateResetLinkModal.js +40 -0
- package/client/components/contents/users/Edit/Profile/ResetPasswordModal.d.ts +6 -0
- package/client/components/contents/users/Edit/Profile/ResetPasswordModal.d.ts.map +1 -0
- package/client/components/contents/users/Edit/Profile/ResetPasswordModal.js +41 -0
- package/client/components/contents/users/Edit/Profile/index.d.ts +4 -0
- package/client/components/contents/users/Edit/Profile/index.d.ts.map +1 -0
- package/client/components/contents/users/Edit/Profile/index.js +111 -0
- package/client/components/contents/users/Edit/Roles/ActionLink.d.ts +6 -0
- package/client/components/contents/users/Edit/Roles/ActionLink.d.ts.map +1 -0
- package/client/components/contents/users/Edit/Roles/ActionLink.js +63 -0
- package/client/components/contents/users/Edit/Roles/Add.d.ts +5 -0
- package/client/components/contents/users/Edit/Roles/Add.d.ts.map +1 -0
- package/client/components/contents/users/Edit/Roles/Add.js +60 -0
- package/client/components/contents/users/Edit/Roles/Edit.d.ts +8 -0
- package/client/components/contents/users/Edit/Roles/Edit.d.ts.map +1 -0
- package/client/components/contents/users/Edit/Roles/Edit.js +53 -0
- package/client/components/contents/users/Edit/Roles/Roles.d.ts +4 -0
- package/client/components/contents/users/Edit/Roles/Roles.d.ts.map +1 -0
- package/client/components/contents/users/Edit/Roles/Roles.js +41 -0
- package/client/components/contents/users/Edit/Roles/context.d.ts +9 -0
- package/client/components/contents/users/Edit/Roles/context.d.ts.map +1 -0
- package/client/components/contents/users/Edit/Roles/context.js +2 -0
- package/client/components/contents/users/Edit/Roles/index.d.ts +3 -0
- package/client/components/contents/users/Edit/Roles/index.d.ts.map +1 -0
- package/client/components/contents/users/Edit/Roles/index.js +2 -0
- package/client/components/contents/users/Edit/index.d.ts +4 -0
- package/client/components/contents/users/Edit/index.d.ts.map +1 -0
- package/client/components/contents/users/Edit/index.js +66 -0
- package/client/components/contents/users/List/CountRoles.d.ts +2 -0
- package/client/components/contents/users/List/CountRoles.d.ts.map +1 -0
- package/client/components/contents/users/List/CountRoles.js +68 -0
- package/client/components/contents/users/List/Toolbar.d.ts +10 -0
- package/client/components/contents/users/List/Toolbar.d.ts.map +1 -0
- package/client/components/contents/users/List/Toolbar.js +32 -0
- package/client/components/contents/users/List/index.d.ts +2 -0
- package/client/components/contents/users/List/index.d.ts.map +1 -0
- package/client/components/contents/users/List/index.js +30 -0
- package/client/components/contents/users/index.d.ts +9 -0
- package/client/components/contents/users/index.d.ts.map +1 -0
- package/client/components/contents/users/index.js +10 -0
- package/client/components/layout/Layout.d.ts +3 -0
- package/client/components/layout/Layout.d.ts.map +1 -0
- package/client/components/layout/Layout.js +69 -0
- package/client/components/layout/Main.d.ts +2 -0
- package/client/components/layout/Main.d.ts.map +1 -0
- package/client/components/layout/Main.js +12 -0
- package/client/components/layout/Overlay.d.ts +2 -0
- package/client/components/layout/Overlay.d.ts.map +1 -0
- package/client/components/layout/Overlay.js +49 -0
- package/client/components/layout/Title.d.ts +2 -0
- package/client/components/layout/Title.d.ts.map +1 -0
- package/client/components/layout/Title.js +19 -0
- package/client/components/layout/WrapperLayout.d.ts +2 -0
- package/client/components/layout/WrapperLayout.d.ts.map +1 -0
- package/client/components/layout/WrapperLayout.js +5 -0
- package/client/components/layout/header/Profile.d.ts +2 -0
- package/client/components/layout/header/Profile.d.ts.map +1 -0
- package/client/components/layout/header/Profile.js +66 -0
- package/client/components/layout/header/index.d.ts +2 -0
- package/client/components/layout/header/index.d.ts.map +1 -0
- package/client/components/layout/header/index.js +176 -0
- package/client/components/layout/sidebar/Collapse.d.ts +4 -0
- package/client/components/layout/sidebar/Collapse.d.ts.map +1 -0
- package/client/components/layout/sidebar/Collapse.js +53 -0
- package/client/components/layout/sidebar/Menus.d.ts +5 -0
- package/client/components/layout/sidebar/Menus.d.ts.map +1 -0
- package/client/components/layout/sidebar/Menus.js +76 -0
- package/client/components/layout/sidebar/index.d.ts +2 -0
- package/client/components/layout/sidebar/index.d.ts.map +1 -0
- package/client/components/layout/sidebar/index.js +86 -0
- package/client/components/utils/ErrorFallback.d.ts +6 -0
- package/client/components/utils/ErrorFallback.d.ts.map +1 -0
- package/client/components/utils/ErrorFallback.js +36 -0
- package/client/components/utils/dropdown/SelectWPAvailableSite.d.ts +7 -0
- package/client/components/utils/dropdown/SelectWPAvailableSite.d.ts.map +1 -0
- package/client/components/utils/dropdown/SelectWPAvailableSite.js +58 -0
- package/client/components/utils/dropdown/SelectWPSite.d.ts +5 -0
- package/client/components/utils/dropdown/SelectWPSite.d.ts.map +1 -0
- package/client/components/utils/dropdown/SelectWPSite.js +27 -0
- package/client/components/utils/dropdown/index.d.ts +2 -0
- package/client/components/utils/dropdown/index.d.ts.map +1 -0
- package/client/components/utils/dropdown/index.js +1 -0
- package/client/components/utils/index.d.ts +2 -0
- package/client/components/utils/index.d.ts.map +1 -0
- package/client/components/utils/index.js +1 -0
- package/client/components/utils/link/AdminLink.d.ts +46 -0
- package/client/components/utils/link/AdminLink.d.ts.map +1 -0
- package/client/components/utils/link/AdminLink.js +61 -0
- package/client/components/utils/link/index.d.ts +2 -0
- package/client/components/utils/link/index.d.ts.map +1 -0
- package/client/components/utils/link/index.js +2 -0
- package/client/components/utils/modal/CommentModal.d.ts +2 -0
- package/client/components/utils/modal/CommentModal.d.ts.map +1 -0
- package/client/components/utils/modal/CommentModal.js +53 -0
- package/client/components/utils/modal/TermModal.d.ts +10 -0
- package/client/components/utils/modal/TermModal.d.ts.map +1 -0
- package/client/components/utils/modal/TermModal.js +70 -0
- package/client/components/utils/modal/index.d.ts +3 -0
- package/client/components/utils/modal/index.d.ts.map +1 -0
- package/client/components/utils/modal/index.js +2 -0
- package/client/components/utils/post/PostPanel.d.ts +15 -0
- package/client/components/utils/post/PostPanel.d.ts.map +1 -0
- package/client/components/utils/post/PostPanel.js +70 -0
- package/client/components/utils/post/index.d.ts +4 -0
- package/client/components/utils/post/index.d.ts.map +1 -0
- package/client/components/utils/post/index.js +3 -0
- package/client/components/utils/post/link/PostActionLink.d.ts +9 -0
- package/client/components/utils/post/link/PostActionLink.d.ts.map +1 -0
- package/client/components/utils/post/link/PostActionLink.js +90 -0
- package/client/components/utils/post/link/PostRowLinks.d.ts +8 -0
- package/client/components/utils/post/link/PostRowLinks.d.ts.map +1 -0
- package/client/components/utils/post/link/PostRowLinks.js +30 -0
- package/client/components/utils/post/link/index.d.ts +3 -0
- package/client/components/utils/post/link/index.d.ts.map +1 -0
- package/client/components/utils/post/link/index.js +2 -0
- package/client/components/utils/post/settings/Categories.d.ts +2 -0
- package/client/components/utils/post/settings/Categories.d.ts.map +1 -0
- package/client/components/utils/post/settings/Categories.js +23 -0
- package/client/components/utils/post/settings/Discussion.d.ts +2 -0
- package/client/components/utils/post/settings/Discussion.d.ts.map +1 -0
- package/client/components/utils/post/settings/Discussion.js +25 -0
- package/client/components/utils/post/settings/Excerpt.d.ts +2 -0
- package/client/components/utils/post/settings/Excerpt.d.ts.map +1 -0
- package/client/components/utils/post/settings/Excerpt.js +9 -0
- package/client/components/utils/post/settings/FeaturedImage.d.ts +2 -0
- package/client/components/utils/post/settings/FeaturedImage.d.ts.map +1 -0
- package/client/components/utils/post/settings/FeaturedImage.js +63 -0
- package/client/components/utils/post/settings/PageAttributes.d.ts +2 -0
- package/client/components/utils/post/settings/PageAttributes.d.ts.map +1 -0
- package/client/components/utils/post/settings/PageAttributes.js +23 -0
- package/client/components/utils/post/settings/Revisions.d.ts +2 -0
- package/client/components/utils/post/settings/Revisions.d.ts.map +1 -0
- package/client/components/utils/post/settings/Revisions.js +44 -0
- package/client/components/utils/post/settings/Summary.d.ts +2 -0
- package/client/components/utils/post/settings/Summary.d.ts.map +1 -0
- package/client/components/utils/post/settings/Summary.js +58 -0
- package/client/components/utils/post/settings/Tags.d.ts +2 -0
- package/client/components/utils/post/settings/Tags.d.ts.map +1 -0
- package/client/components/utils/post/settings/Tags.js +11 -0
- package/client/components/utils/post/settings/index.d.ts +9 -0
- package/client/components/utils/post/settings/index.d.ts.map +1 -0
- package/client/components/utils/post/settings/index.js +8 -0
- package/client/hooks/index.d.ts +6 -0
- package/client/hooks/index.d.ts.map +1 -0
- package/client/hooks/index.js +5 -0
- package/client/hooks/use-admin-navigation.d.ts +39 -0
- package/client/hooks/use-admin-navigation.d.ts.map +1 -0
- package/client/hooks/use-admin-navigation.js +61 -0
- package/client/hooks/use-admin-server-actions.d.ts +49 -0
- package/client/hooks/use-admin-server-actions.d.ts.map +1 -0
- package/client/hooks/use-admin-server-actions.js +13 -0
- package/client/hooks/use-admin-user.d.ts +130 -0
- package/client/hooks/use-admin-user.d.ts.map +1 -0
- package/client/hooks/use-admin-user.js +19 -0
- package/client/hooks/use-current-menu.d.ts +3 -0
- package/client/hooks/use-current-menu.d.ts.map +1 -0
- package/client/hooks/use-current-menu.js +37 -0
- package/client/hooks/use-sidebar.d.ts +27 -0
- package/client/hooks/use-sidebar.d.ts.map +1 -0
- package/client/hooks/use-sidebar.js +51 -0
- package/client/hooks/use-sites.d.ts +136 -0
- package/client/hooks/use-sites.d.ts.map +1 -0
- package/client/hooks/use-sites.js +43 -0
- package/client/utils/get-default-admin-hooks.d.ts +3 -0
- package/client/utils/get-default-admin-hooks.d.ts.map +1 -0
- package/client/utils/get-default-admin-hooks.js +3 -0
- package/client/utils/index.d.ts +2 -0
- package/client/utils/index.d.ts.map +1 -0
- package/client/utils/index.js +1 -0
- package/client/wp-admin/initial-global-state.d.ts +5 -0
- package/client/wp-admin/initial-global-state.d.ts.map +1 -0
- package/client/wp-admin/initial-global-state.js +46 -0
- package/client/wp-admin/use-comment.d.ts +55 -0
- package/client/wp-admin/use-comment.d.ts.map +1 -0
- package/client/wp-admin/use-comment.js +32 -0
- package/client/wp-admin/use-overlay.d.ts +28 -0
- package/client/wp-admin/use-overlay.d.ts.map +1 -0
- package/client/wp-admin/use-overlay.js +89 -0
- package/client/wp-admin.d.ts +27 -0
- package/client/wp-admin.d.ts.map +1 -0
- package/client/wp-admin.js +49 -0
- package/client/wp-hooks/index.d.ts +5 -0
- package/client/wp-hooks/index.d.ts.map +1 -0
- package/client/wp-hooks/index.js +5 -0
- package/client/wp-hooks/menu-blog.hook.d.ts +11 -0
- package/client/wp-hooks/menu-blog.hook.d.ts.map +1 -0
- package/client/wp-hooks/menu-blog.hook.js +236 -0
- package/client/wp-hooks/menu-site.hook.d.ts +11 -0
- package/client/wp-hooks/menu-site.hook.d.ts.map +1 -0
- package/client/wp-hooks/menu-site.hook.js +171 -0
- package/client/wp-hooks/preload-modal.hook.d.ts +10 -0
- package/client/wp-hooks/preload-modal.hook.d.ts.map +1 -0
- package/client/wp-hooks/preload-modal.hook.js +45 -0
- package/client/wp-hooks/themes.hook.d.ts +9 -0
- package/client/wp-hooks/themes.hook.d.ts.map +1 -0
- package/client/wp-hooks/themes.hook.js +32 -0
- package/package.json +64 -0
- package/server/actions/dashboard.d.ts +141 -0
- package/server/actions/dashboard.d.ts.map +1 -0
- package/server/actions/dashboard.js +52 -0
- package/server/components/Page.d.ts +2 -0
- package/server/components/Page.d.ts.map +1 -0
- package/server/components/Page.js +3 -0
- package/server/components/RootLayout.d.ts +5 -0
- package/server/components/RootLayout.d.ts.map +1 -0
- package/server/components/RootLayout.js +57 -0
- package/server/components/RootPage.d.ts +2 -0
- package/server/components/RootPage.d.ts.map +1 -0
- package/server/components/RootPage.js +19 -0
- package/server/utils/get-default-admin-hooks.d.ts +3 -0
- package/server/utils/get-default-admin-hooks.d.ts.map +1 -0
- package/server/utils/get-default-admin-hooks.js +4 -0
- package/server/utils/index.d.ts +2 -0
- package/server/utils/index.d.ts.map +1 -0
- package/server/utils/index.js +1 -0
- package/server/wp-admin.d.ts +40 -0
- package/server/wp-admin.d.ts.map +1 -0
- package/server/wp-admin.js +58 -0
- package/server/wp-hooks/index.d.ts +3 -0
- package/server/wp-hooks/index.d.ts.map +1 -0
- package/server/wp-hooks/index.js +3 -0
- package/server/wp-hooks/next-admin-init.hook.d.ts +15 -0
- package/server/wp-hooks/next-admin-init.hook.d.ts.map +1 -0
- package/server/wp-hooks/next-admin-init.hook.js +65 -0
- package/types/client/form-data.d.ts +27 -0
- package/types/client/global-ref.d.ts +7 -0
- package/types/client/global-state.d.ts +78 -0
- package/types/client/index.d.ts +5 -0
- package/types/client/menus.d.ts +39 -0
- package/types/client.d.ts +40 -0
- package/types/hooks/actions.d.ts +4 -0
- package/types/hooks/filters.d.ts +39 -0
- package/types/hooks/index.d.ts +2 -0
- package/types/index.d.ts +4 -0
- package/types/server-actions.d.ts +21 -0
- package/types/theme.d.ts +33 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../../../../src/client/components/contents/media/List/Table.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAK,KAAK,WAAW,MAAM,2BAA2B,CAAC;AAC9D,eAAO,MAAM,KAAK,GAAI,OAAO;IAC3B,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,KAAK,GAAG,SAAS,CAAC;CAC9C,mDAgGA,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { AccordionDetails } from "@mui/material";
|
|
4
|
+
import { useUser } from "@rnaga/wp-next-core/client/hooks/use-user";
|
|
5
|
+
import { Accordion, AccordionSummary } from "@rnaga/wp-next-ui/Accordion";
|
|
6
|
+
import { CardImage } from "@rnaga/wp-next-ui/CardImage";
|
|
7
|
+
import { Viewport } from "@rnaga/wp-next-ui/Viewport";
|
|
8
|
+
import { formatting } from "@rnaga/wp-node/common/formatting";
|
|
9
|
+
import { AdminLink } from "../../../../components/utils/link";
|
|
10
|
+
import { ActionTd, ListGrid, ListGridItem, SortableTh, Table as TableList, Td, Th, THead, Tr, } from "@rnaga/wp-next-ui/list";
|
|
11
|
+
import { PostRowLinks } from "../../../../components/utils/post";
|
|
12
|
+
import { useWPAdmin } from "../../../../wp-admin";
|
|
13
|
+
import { ActionLink } from "./ActionLink";
|
|
14
|
+
export const Table = (props) => {
|
|
15
|
+
const { posts } = props;
|
|
16
|
+
const { wp: { viewport, globalState }, } = useWPAdmin();
|
|
17
|
+
const { user } = useUser();
|
|
18
|
+
const handleClick = (post) => () => {
|
|
19
|
+
globalState.set({
|
|
20
|
+
"media-edit-modal": {
|
|
21
|
+
open: true,
|
|
22
|
+
},
|
|
23
|
+
"media-target-item": {
|
|
24
|
+
post,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
const canEdit = (post) => user?.ID == post.author.ID ||
|
|
29
|
+
user?.role.capabilities.has("edit_others_posts");
|
|
30
|
+
if (!posts) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
return (_jsxs(TableList, { children: [_jsxs(THead, { children: [_jsx(Th, { style: { width: "25%" }, children: "File" }), _jsx(SortableTh, { style: { width: viewport.isDesktop ? "35%" : "75%" }, name: "Title", orderby: "post_name" }), _jsx(Th, { viewport: "desktop", children: "Author" }), _jsx(Th, { viewport: "desktop", children: " " }), _jsx(SortableTh, { viewport: "desktop", name: "Date", orderby: "post_date" })] }), _jsx("tbody", { children: posts.map((post) => (_jsxs(Tr, { children: [_jsx(Td, { children: _jsx(CardImage, { src: post.guid, alt: post.post_title, sx: {
|
|
34
|
+
minWidth: 150,
|
|
35
|
+
maxWidth: 200,
|
|
36
|
+
cursor: canEdit(post) ? "pointer" : "inherit",
|
|
37
|
+
}, onClick: canEdit(post) ? handleClick(post) : undefined }) }), _jsxs(ActionTd, { children: [_jsx(Viewport, { device: "desktop", children: post.post_title }), _jsx(Viewport, { device: "desktop", children: _jsx(ActionLink, { post: post }) })] }), _jsx(Td, { viewport: "mobile", children: _jsxs(Accordion, { disableGutters: true, elevation: 0, square: true, expanded: true, children: [_jsxs(AccordionSummary, { children: [" ", _jsx(AdminLink, { subPage: "/edit", queryParams: { id: post.ID }, disabled: !canEdit(post), children: post.post_title })] }), _jsxs(AccordionDetails, { children: [_jsx(ActionLink, { post: post }), _jsxs(ListGrid, { children: [_jsx(ListGridItem, { title: "Author", children: _jsx(PostRowLinks, { row: post, field: "actor" }) }), _jsx(ListGridItem, { title: "Date", children: formatting.date(post.post_date) })] })] })] }) }), _jsx(Td, { viewport: "desktop", children: _jsx(PostRowLinks, { row: post, field: "actor" }) }), _jsx(Td, { viewport: "desktop", children: post.comment_count }), _jsx(Td, { viewport: "desktop", children: formatting.date(post.post_date) })] }, post.ID))) })] }));
|
|
38
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Thumbnail.d.ts","sourceRoot":"","sources":["../../../../../../src/client/components/contents/media/List/Thumbnail.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,KAAK,WAAW,MAAM,2BAA2B,CAAC;AAE9D,eAAO,MAAM,SAAS,GAAI,OAAO;IAC/B,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,KAAK,GAAG,SAAS,CAAC;CAC9C,4CAyCA,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Grid } from "@mui/material";
|
|
4
|
+
import { useUser } from "@rnaga/wp-next-core/client/hooks/use-user";
|
|
5
|
+
import { CardImage } from "@rnaga/wp-next-ui/CardImage";
|
|
6
|
+
import { useWPAdmin } from "../../../../wp-admin";
|
|
7
|
+
export const Thumbnail = (props) => {
|
|
8
|
+
const { posts } = props;
|
|
9
|
+
const { wp: { globalState }, } = useWPAdmin();
|
|
10
|
+
const { user } = useUser();
|
|
11
|
+
const handleClick = (post) => () => {
|
|
12
|
+
globalState.set({
|
|
13
|
+
"media-edit-modal": {
|
|
14
|
+
open: true,
|
|
15
|
+
},
|
|
16
|
+
"media-target-item": {
|
|
17
|
+
post,
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
const canEdit = (post) => user?.ID == post.author.ID ||
|
|
22
|
+
user?.role.capabilities.has("edit_others_posts");
|
|
23
|
+
return (_jsx(Grid, { container: true, spacing: 1, columns: { xs: 2, sm: 12, md: 12, xl: 12 }, children: posts?.map((post) => (_jsx(Grid, { gap: 0, size: { xs: 1, sm: 4, md: 3, xl: 2 }, children: _jsx(CardImage, { src: post.guid, alt: post.post_title, sx: {
|
|
24
|
+
width: "100%",
|
|
25
|
+
maxHeight: 150,
|
|
26
|
+
cursor: canEdit(post) ? "pointer" : "inherit",
|
|
27
|
+
}, onClick: canEdit(post) ? handleClick(post) : undefined }) }, post.ID))) }));
|
|
28
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/client/components/contents/media/List/index.tsx"],"names":[],"mappings":"AAuBA,eAAO,MAAM,IAAI,+CAmHhB,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useState, useTransition } from "react";
|
|
4
|
+
import FileUploadIcon from "@mui/icons-material/FileUpload";
|
|
5
|
+
import SearchIcon from "@mui/icons-material/Search";
|
|
6
|
+
import TableViewIcon from "@mui/icons-material/TableView";
|
|
7
|
+
import ViewListIcon from "@mui/icons-material/ViewList";
|
|
8
|
+
import { Box, IconButton, Stack } from "@mui/material";
|
|
9
|
+
import { useUser } from "@rnaga/wp-next-core/client/hooks/use-user";
|
|
10
|
+
import { Button } from "@rnaga/wp-next-ui/Button";
|
|
11
|
+
import { Input } from "@rnaga/wp-next-ui/Input";
|
|
12
|
+
import { Pagination } from "@rnaga/wp-next-ui/list/Pagination";
|
|
13
|
+
import { Loading } from "@rnaga/wp-next-ui/Loading";
|
|
14
|
+
import { MediaUpload } from "@rnaga/wp-next-ui/media/MediaUpload";
|
|
15
|
+
import { useAdminNavigation } from "../../../../hooks/use-admin-navigation";
|
|
16
|
+
import { useAdminServerActions } from "../../../../hooks/use-admin-server-actions";
|
|
17
|
+
import { useWPAdmin } from "../../../../wp-admin";
|
|
18
|
+
import { Table } from "./Table";
|
|
19
|
+
import { Thumbnail } from "./Thumbnail";
|
|
20
|
+
export const List = () => {
|
|
21
|
+
const { wp: { viewport, globalState }, } = useWPAdmin();
|
|
22
|
+
const { user } = useUser();
|
|
23
|
+
const { actions, parse } = useAdminServerActions();
|
|
24
|
+
const { updateRouter, queryObject, navigationStatus, refreshValue, refresh } = useAdminNavigation();
|
|
25
|
+
const { overlay } = useWPAdmin();
|
|
26
|
+
const [listType, setListType] = useState("thumbnail");
|
|
27
|
+
const mediaTargetItemState = globalState.get("media-target-item");
|
|
28
|
+
const mediaUploadState = globalState.get("media-upload");
|
|
29
|
+
const [{ posts, info }, setPosts] = useState({
|
|
30
|
+
posts: undefined,
|
|
31
|
+
info: undefined,
|
|
32
|
+
});
|
|
33
|
+
const [loading, startTransition] = useTransition();
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
startTransition(async () => {
|
|
36
|
+
const [posts, info] = await actions.post
|
|
37
|
+
.list({ ...queryObject, status: ["inherit"], per_page: 20 }, { postTypes: ["attachment"] })
|
|
38
|
+
.then(parse);
|
|
39
|
+
setPosts({ posts, info });
|
|
40
|
+
});
|
|
41
|
+
}, [navigationStatus, refreshValue().content]);
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
if (!mediaTargetItemState?.post || !posts) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
for (const [index, post] of Object.entries(posts)) {
|
|
47
|
+
if (post.ID === mediaTargetItemState.post.ID) {
|
|
48
|
+
posts[parseInt(index)] = {
|
|
49
|
+
...post,
|
|
50
|
+
...mediaTargetItemState.post,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
setPosts({ posts, info });
|
|
55
|
+
}, [mediaTargetItemState?.post]);
|
|
56
|
+
return (_jsxs(Stack, { spacing: 2, children: [user?.role.capabilities.has("upload_files") && (_jsx(Box, { children: _jsx(Button, { startIcon: _jsx(FileUploadIcon, {}), onClick: () => {
|
|
57
|
+
globalState.set("media-upload", {
|
|
58
|
+
open: !mediaUploadState?.open,
|
|
59
|
+
});
|
|
60
|
+
}, children: "Upload Media File" }) })), globalState.get("media-upload")?.open && (_jsx(MediaUpload, { showCloseButton: true, onUploadComplete: () => {
|
|
61
|
+
overlay.snackbar.open("success", "New media has been successfully added");
|
|
62
|
+
refresh(["main"]);
|
|
63
|
+
} })), _jsxs(Box, { sx: { display: "flex", alignItems: "center" }, children: [_jsxs(Box, { sx: { flexGrow: 1 }, children: [_jsx(IconButton, { onClick: () => setListType("thumbnail"), children: _jsx(ViewListIcon, {}) }), _jsx(IconButton, { onClick: () => setListType("table"), children: _jsx(TableViewIcon, {}) })] }), _jsx(Input, { size: "medium", placeholder: "Search", startAdornment: _jsx(SearchIcon, { sx: {
|
|
64
|
+
opacity: 0.5,
|
|
65
|
+
} }), sx: { flexGrow: viewport.isMobile ? 1 : 0, mr: 1 }, onChange: (value) => updateRouter({ search: value, page: 1 }) }), _jsx(Pagination, { pagination: info?.pagination })] }), _jsx(Loading, { loading: loading, children: listType == "thumbnail" ? (_jsx(Thumbnail, { posts: posts })) : (_jsx(Table, { posts: posts })) })] }));
|
|
66
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/client/components/contents/media/index.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK;;;CAGjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Settings.d.ts","sourceRoot":"","sources":["../../../../../../src/client/components/contents/pages/Edit/Settings.tsx"],"names":[],"mappings":"AAaA,eAAO,MAAM,QAAQ,+CAqBpB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Box } from "@mui/material";
|
|
4
|
+
import { Accordions } from "@rnaga/wp-next-ui/Accordions";
|
|
5
|
+
import { Discussion, FeaturedImage, PageAttributes, Revisions, Summary, } from "../../../../components/utils/post/settings/";
|
|
6
|
+
export const Settings = () => {
|
|
7
|
+
return (_jsx(Box, { sx: {
|
|
8
|
+
height: "95%",
|
|
9
|
+
overflowY: "auto",
|
|
10
|
+
}, children: _jsx(Accordions, { size: "medium", defaultExpanded: [0], items: [
|
|
11
|
+
{ title: "Summary", content: _jsx(Summary, {}) },
|
|
12
|
+
{ title: "Revisions", content: _jsx(Revisions, {}) },
|
|
13
|
+
{ title: "Feature Image", content: _jsx(FeaturedImage, {}) },
|
|
14
|
+
{ title: "Discussion", content: _jsx(Discussion, {}) },
|
|
15
|
+
{ title: "Page Attributes", content: _jsx(PageAttributes, {}) },
|
|
16
|
+
] }) }));
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../../../../../src/client/components/contents/pages/Edit/Toolbar.tsx"],"names":[],"mappings":"AAkBA,eAAO,MAAM,OAAO,+CA4FnB,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import SettingIcon from "@mui/icons-material/Settings";
|
|
4
|
+
import { Box, IconButton, Tooltip } from "@mui/material";
|
|
5
|
+
import { useServerActions } from "@rnaga/wp-next-core/client/hooks/use-server-actions";
|
|
6
|
+
import { useUser } from "@rnaga/wp-next-core/client/hooks/use-user";
|
|
7
|
+
import { Button } from "@rnaga/wp-next-ui/Button";
|
|
8
|
+
import { useFormDataContext } from "@rnaga/wp-next-ui/hooks/use-form-data";
|
|
9
|
+
import { IconButtonDelete } from "@rnaga/wp-next-ui/IconButtonDelete";
|
|
10
|
+
import { Input } from "@rnaga/wp-next-ui/Input";
|
|
11
|
+
import { formatting } from "@rnaga/wp-node/common/formatting";
|
|
12
|
+
import { usePanelContext } from "../../../../components/utils/post";
|
|
13
|
+
import { useAdminNavigation } from "../../../../hooks";
|
|
14
|
+
import { useWPAdmin } from "../../../../wp-admin";
|
|
15
|
+
export const Toolbar = () => {
|
|
16
|
+
const { overlay } = useWPAdmin();
|
|
17
|
+
const { user } = useUser();
|
|
18
|
+
const { formData, setFormData } = useFormDataContext("post");
|
|
19
|
+
const { router, gotoPath, refresh } = useAdminNavigation();
|
|
20
|
+
const { actions, safeParse, parse } = useServerActions();
|
|
21
|
+
const { toggle, ref: panelRef } = usePanelContext();
|
|
22
|
+
const [iconVarient, setIconVarient] = useState("solid");
|
|
23
|
+
const postId = formData.ID;
|
|
24
|
+
const handleSave = async () => {
|
|
25
|
+
if (!formData.post_author) {
|
|
26
|
+
formData.post_author = user?.ID;
|
|
27
|
+
}
|
|
28
|
+
// Covert Date object to string
|
|
29
|
+
formData.post_date = formatting.dateMySQL(formData.post_date, {
|
|
30
|
+
withGMTOffset: true,
|
|
31
|
+
});
|
|
32
|
+
formData.post_date_gmt = formatting.dateMySQL(formData.post_date);
|
|
33
|
+
const serverAction = postId
|
|
34
|
+
? actions.post.update(postId, formData)
|
|
35
|
+
: actions.post.create({ ...formData, post_type: "page" });
|
|
36
|
+
const result = await overlay.circular.promise(serverAction).then(safeParse);
|
|
37
|
+
if (!result.success) {
|
|
38
|
+
overlay.snackbar.open("error", result.error);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
overlay.snackbar.open("success", "Page has been saved");
|
|
42
|
+
// After saving, the post may have changed (e.g., post_status could be "future" if the date is in the future).
|
|
43
|
+
// Fetch the latest post data to ensure formData reflects any updates from the server.
|
|
44
|
+
if (formData.ID) {
|
|
45
|
+
// Get the updated post data
|
|
46
|
+
const [updatedPost] = await actions.post.get(result.data).then(parse);
|
|
47
|
+
setFormData(updatedPost);
|
|
48
|
+
refresh(["content"]);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
// If it's a new post, redirect to the edit page with the new post ID
|
|
52
|
+
gotoPath("/pages/edit", {
|
|
53
|
+
segment: "blog",
|
|
54
|
+
queryParams: {
|
|
55
|
+
id: result.data,
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
const handleTrash = async () => {
|
|
60
|
+
if (!postId) {
|
|
61
|
+
overlay.snackbar.open("error", "Invalid post");
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
await overlay.circular.promise(actions.post.trash(postId)).then(parse);
|
|
65
|
+
router.back();
|
|
66
|
+
};
|
|
67
|
+
const handleToggle = () => {
|
|
68
|
+
toggle();
|
|
69
|
+
setIconVarient(iconVarient === "plain" ? "solid" : "plain");
|
|
70
|
+
};
|
|
71
|
+
return (_jsxs(Box, { sx: { display: "flex", gap: 2 }, children: [_jsx(Input, { size: "large", value: formData?.post_title, onChange: (value) => setFormData({ post_title: value }), placeholder: "Title", sx: { fontWeight: 500, flexGrow: 1 } }, formData?.ID ?? 0), _jsx(Button, { onClick: handleSave, children: "Save" }), formData.ID && _jsx(IconButtonDelete, { onClick: handleTrash }), _jsx(Tooltip, { title: "Settings", placement: "top", children: _jsx(IconButton, { onClick: handleToggle, children: _jsx(SettingIcon, {}) }) })] }));
|
|
72
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/client/components/contents/pages/Edit/index.tsx"],"names":[],"mappings":"AAkBA,eAAO,MAAM,IAAI,sDAsDhB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect } from "react";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
import { Divider, Stack } from "@mui/material";
|
|
6
|
+
import { useServerActions } from "@rnaga/wp-next-core/client/hooks/use-server-actions";
|
|
7
|
+
import { Tiptap } from "@rnaga/wp-next-rte/tiptap/Tiptap";
|
|
8
|
+
import { useFormData } from "@rnaga/wp-next-ui/hooks/use-form-data";
|
|
9
|
+
import { PostPanel, PostPanelWrapper } from "../../../../components/utils/post";
|
|
10
|
+
import { useAdminNavigation } from "../../../../hooks/use-admin-navigation";
|
|
11
|
+
import { useWPAdmin } from "../../../../wp-admin";
|
|
12
|
+
import { Settings } from "./Settings";
|
|
13
|
+
import { Toolbar } from "./Toolbar";
|
|
14
|
+
export const Edit = () => {
|
|
15
|
+
const { overlay, wp: { error }, } = useWPAdmin();
|
|
16
|
+
const { actions, parse } = useServerActions();
|
|
17
|
+
const { formData, setFormData, setFormReady, formReady } = useFormData("post");
|
|
18
|
+
const { searchParams } = useAdminNavigation();
|
|
19
|
+
const parsed = z
|
|
20
|
+
.string()
|
|
21
|
+
.transform((v) => parseInt(v))
|
|
22
|
+
.safeParse(searchParams.get("id"));
|
|
23
|
+
const postId = parsed.success ? parsed.data : undefined;
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
if (!postId) {
|
|
26
|
+
setFormReady(true);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
overlay.circular.promise(actions.post.get(postId)).then((response) => {
|
|
30
|
+
const [post] = parse(response);
|
|
31
|
+
if (post?.post_status === "trash") {
|
|
32
|
+
error.throw("You cannot edit this item because it is in the Trash. Please restore it and try again.");
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
setFormData(post, { ready: true });
|
|
36
|
+
});
|
|
37
|
+
}, []);
|
|
38
|
+
if (!formReady)
|
|
39
|
+
return null;
|
|
40
|
+
return (_jsx(Stack, { spacing: 1, children: _jsxs(PostPanelWrapper, { children: [_jsx(Toolbar, {}), _jsx(Divider, {}), _jsxs(PostPanel, { children: [_jsx(Tiptap, { defaultContent: formData?.post_content, onUpdate: (editor) => {
|
|
41
|
+
setFormData({ post_content: editor.getHTML() });
|
|
42
|
+
} }), _jsx(Settings, {})] })] }) }));
|
|
43
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionLink.d.ts","sourceRoot":"","sources":["../../../../../../src/client/components/contents/pages/List/ActionLink.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,WAAW,MAAM,2BAA2B,CAAC;AAE9D,eAAO,MAAM,UAAU,GAAI,OAAO;IAChC,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;CACzC,mDAiBA,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { PostActionLink } from "../../../../components/utils/post/link";
|
|
3
|
+
import { useUser } from "@rnaga/wp-next-core/client/hooks/use-user";
|
|
4
|
+
export const ActionLink = (props) => {
|
|
5
|
+
const { post } = props;
|
|
6
|
+
const { userCan } = useUser();
|
|
7
|
+
// Check if user has permission to edit other posts
|
|
8
|
+
if (!userCan("edit_page", post)) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
return (_jsx(PostActionLink, { actionLinks: post.post_status === "trash" ? ["restore", "delete"] : ["edit", "trash"], post: post }));
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Statuses.d.ts","sourceRoot":"","sources":["../../../../../../src/client/components/contents/pages/List/Statuses.tsx"],"names":[],"mappings":"AAUA,eAAO,MAAM,QAAQ,+CAoDpB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment, useEffect, useState } from "react";
|
|
3
|
+
import { useServerActions } from "@rnaga/wp-next-core/client/hooks/use-server-actions";
|
|
4
|
+
import { Link } from "@rnaga/wp-next-ui/Link";
|
|
5
|
+
import { useAdminNavigation } from "../../../../hooks/use-admin-navigation";
|
|
6
|
+
import { Typography } from "@rnaga/wp-next-ui/Typography";
|
|
7
|
+
export const Statuses = () => {
|
|
8
|
+
const { actions } = useServerActions();
|
|
9
|
+
const { pushRouter, searchParams, refreshValue } = useAdminNavigation();
|
|
10
|
+
const [countStatuses, setCountStatuses] = useState();
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
actions.post.countByStatuses("page").then((response) => {
|
|
13
|
+
setCountStatuses(response.info?.countGroupBy ?? []);
|
|
14
|
+
});
|
|
15
|
+
}, [refreshValue().content]);
|
|
16
|
+
if (!countStatuses) {
|
|
17
|
+
return _jsx(Typography, { children: "Loading..." });
|
|
18
|
+
}
|
|
19
|
+
const totalCount = countStatuses.reduce((total, item) => total + (item.count || 0), 0);
|
|
20
|
+
const createLink = (status, count) => {
|
|
21
|
+
return searchParams.get("status") === status ? (_jsxs(_Fragment, { children: [status, " (", count, ")"] })) : (_jsxs(Link, { onClick: () => pushRouter({ status: [status], page: 1 }), children: [status, " (", count, ")"] }));
|
|
22
|
+
};
|
|
23
|
+
return (_jsxs(Typography, { size: "medium", children: [searchParams.size > 0 ? (_jsxs(Link, { component: "button", onClick: () => pushRouter({}), children: ["All (", totalCount, ")"] })) : (_jsxs(_Fragment, { children: ["All (", totalCount, ")"] })), " ", countStatuses.map((status, index) => (_jsxs(Fragment, { children: [" | ", createLink(status.post_status ?? "Unknown", status.count ?? 0)] }, index)))] }));
|
|
24
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import type * as wpCoreTypes from "@rnaga/wp-next-core/types";
|
|
3
|
+
export declare const Toolbar: (props: {
|
|
4
|
+
posts?: wpCoreTypes.actions.Posts;
|
|
5
|
+
info?: wpCoreTypes.actions.PostsInfo;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=Toolbar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../../../../../src/client/components/contents/pages/List/Toolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOlC,OAAO,KAAK,KAAK,WAAW,MAAM,2BAA2B,CAAC;AAG9D,eAAO,MAAM,OAAO,GAAI,OAAO;IAC7B,KAAK,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC;IAClC,IAAI,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC;IACrC,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,4CAqBA,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from "@mui/material";
|
|
3
|
+
import { Pagination } from "@rnaga/wp-next-ui/list/Pagination";
|
|
4
|
+
import { useWPAdmin } from "../../../../wp-admin";
|
|
5
|
+
import { InputSearch } from "@rnaga/wp-next-ui/InputSearch";
|
|
6
|
+
export const Toolbar = (props) => {
|
|
7
|
+
const { info, children } = props;
|
|
8
|
+
const { wp: { viewport }, } = useWPAdmin();
|
|
9
|
+
return (_jsxs(_Fragment, { children: [children, _jsxs(Box, { sx: {
|
|
10
|
+
display: "grid",
|
|
11
|
+
gap: 1,
|
|
12
|
+
gridTemplateColumns: viewport.isMobile ? "1fr" : "repeat(2, 1fr)",
|
|
13
|
+
}, children: [_jsx(InputSearch, { size: "medium", sx: { flexGrow: 1 } }), _jsx(Pagination, { pagination: info?.pagination })] })] }));
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/client/components/contents/pages/List/index.tsx"],"names":[],"mappings":"AAoCA,eAAO,MAAM,IAAI,+CAmGhB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
/* eslint-disable jsx-a11y/anchor-is-valid */
|
|
4
|
+
import { useCallback, useEffect, useState, useTransition } from "react";
|
|
5
|
+
import CommentIcon from "@mui/icons-material/Comment";
|
|
6
|
+
import { AccordionDetails, Box, Stack } from "@mui/material";
|
|
7
|
+
import { useServerActions } from "@rnaga/wp-next-core/client/hooks/use-server-actions";
|
|
8
|
+
import { useUser } from "@rnaga/wp-next-core/client/hooks/use-user";
|
|
9
|
+
import { Accordion } from "@rnaga/wp-next-ui/Accordion";
|
|
10
|
+
import { Chip } from "@rnaga/wp-next-ui/Chip";
|
|
11
|
+
import { ActionTd, ListGrid, ListGridItem, ListGridTitle, SortableTh, Table, Td, Th, THead, Tr, } from "@rnaga/wp-next-ui/list";
|
|
12
|
+
import { Loading } from "@rnaga/wp-next-ui/Loading";
|
|
13
|
+
import { Typography } from "@rnaga/wp-next-ui/Typography";
|
|
14
|
+
import { formatting } from "@rnaga/wp-node/common/formatting";
|
|
15
|
+
import { AdminLink } from "../../../../components/utils/link";
|
|
16
|
+
import { PostRowLinks } from "../../../../components/utils/post/link";
|
|
17
|
+
import { useAdminNavigation } from "../../../../hooks/use-admin-navigation";
|
|
18
|
+
import { useWPAdmin } from "../../../../wp-admin";
|
|
19
|
+
import { ActionLink } from "./ActionLink";
|
|
20
|
+
import { Statuses } from "./Statuses";
|
|
21
|
+
import { Toolbar } from "./Toolbar";
|
|
22
|
+
export const List = () => {
|
|
23
|
+
const { wp: { viewport }, } = useWPAdmin();
|
|
24
|
+
const { userCan } = useUser();
|
|
25
|
+
const { actions, parse } = useServerActions();
|
|
26
|
+
const [loading, startTransition] = useTransition();
|
|
27
|
+
const { navigationStatus, queryObject, refreshValue } = useAdminNavigation();
|
|
28
|
+
const [{ posts, info }, setPosts] = useState({
|
|
29
|
+
posts: undefined,
|
|
30
|
+
info: undefined,
|
|
31
|
+
});
|
|
32
|
+
const fetchPosts = useCallback(async () => {
|
|
33
|
+
const [posts, info] = await actions.post
|
|
34
|
+
.list(queryObject, { postTypes: ["page"] })
|
|
35
|
+
.then(parse);
|
|
36
|
+
setPosts({ posts, info });
|
|
37
|
+
}, [navigationStatus, refreshValue().content]);
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
startTransition(fetchPosts);
|
|
40
|
+
}, [navigationStatus]);
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
fetchPosts();
|
|
43
|
+
}, [refreshValue().content]);
|
|
44
|
+
return (_jsxs(Stack, { spacing: 2, children: [_jsx(Toolbar, { posts: posts, info: info, children: _jsx(Statuses, {}) }), _jsx(Loading, { loading: loading, children: _jsxs(Table, { children: [_jsxs(THead, { children: [_jsx(SortableTh, { name: "Title", orderby: "post_name" }), _jsx(Th, { viewport: "desktop", children: "Author" }), _jsx(Th, { viewport: "desktop", style: { width: "40px" }, children: _jsx(Box, { sx: { display: "flex", alignItems: "center" }, children: _jsx(CommentIcon, { fontSize: "small" }) }) }), _jsx(SortableTh, { show: viewport.isDesktop, name: "Date", orderby: "post_date" })] }), _jsx("tbody", { children: posts?.map((post) => (_jsxs(Tr, { children: [_jsxs(ActionTd, { viewport: "desktop", children: [_jsx(AdminLink, { subPage: "/edit", queryParams: { id: post.ID }, disabled: !userCan("edit_post", post), children: post.post_title }), _jsx(ActionLink, { post: post })] }), _jsx(Td, { viewport: "mobile", children: _jsxs(Accordion, { children: [_jsx(ListGridTitle, { title: post.post_title }), _jsxs(AccordionDetails, { children: [_jsx(ActionLink, { post: post }), _jsxs(ListGrid, { children: [_jsx(ListGridItem, { title: "Author", children: _jsx(PostRowLinks, { row: post, field: "actor" }) }), _jsx(ListGridItem, { title: "Date", children: _jsx(Typography, { children: formatting.date(post.post_date) }) })] })] })] }) }), _jsx(Td, { viewport: "desktop", children: _jsx(PostRowLinks, { row: post, field: "actor" }) }), _jsx(Td, { viewport: "desktop", children: _jsx(Chip, { label: post.comment_count }) }), _jsx(Td, { viewport: "desktop", children: formatting.date(post.post_date) })] }, `${post.ID}`))) })] }) })] }));
|
|
45
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/client/components/contents/pages/index.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK;;;CAGjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Settings.d.ts","sourceRoot":"","sources":["../../../../../../src/client/components/contents/posts/Edit/Settings.tsx"],"names":[],"mappings":"AAcA,eAAO,MAAM,QAAQ,+CAuBpB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Accordions } from "@rnaga/wp-next-ui/Accordions";
|
|
4
|
+
import { Categories, Discussion, Excerpt, FeaturedImage, Revisions, Summary, Tags, } from "../../../../components/utils/post/settings/";
|
|
5
|
+
import { Box } from "@mui/material";
|
|
6
|
+
export const Settings = () => {
|
|
7
|
+
return (_jsx(Box, { sx: {
|
|
8
|
+
height: "95%",
|
|
9
|
+
overflowY: "auto",
|
|
10
|
+
}, children: _jsx(Accordions, { size: "medium", defaultExpanded: [0], items: [
|
|
11
|
+
{ title: "Summary", content: _jsx(Summary, {}) },
|
|
12
|
+
{ title: "Revisions", content: _jsx(Revisions, {}) },
|
|
13
|
+
{ title: "Categories", content: _jsx(Categories, {}) },
|
|
14
|
+
{ title: "Tags", content: _jsx(Tags, {}) },
|
|
15
|
+
{ title: "Feature Image", content: _jsx(FeaturedImage, {}) },
|
|
16
|
+
{ title: "Excerpt", content: _jsx(Excerpt, {}) },
|
|
17
|
+
{ title: "Discussion", content: _jsx(Discussion, {}) },
|
|
18
|
+
] }) }));
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../../../../../src/client/components/contents/posts/Edit/Toolbar.tsx"],"names":[],"mappings":"AAkBA,eAAO,MAAM,OAAO,+CA+FnB,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import SettingIcon from "@mui/icons-material/Settings";
|
|
4
|
+
import { Box, IconButton, Tooltip } from "@mui/material";
|
|
5
|
+
import { useServerActions } from "@rnaga/wp-next-core/client/hooks/use-server-actions";
|
|
6
|
+
import { useUser } from "@rnaga/wp-next-core/client/hooks/use-user";
|
|
7
|
+
import { Button } from "@rnaga/wp-next-ui/Button";
|
|
8
|
+
import { useFormDataContext } from "@rnaga/wp-next-ui/hooks/use-form-data";
|
|
9
|
+
import { IconButtonDelete } from "@rnaga/wp-next-ui/IconButtonDelete";
|
|
10
|
+
import { Input } from "@rnaga/wp-next-ui/Input";
|
|
11
|
+
import { formatting } from "@rnaga/wp-node/common/formatting";
|
|
12
|
+
import { usePanelContext } from "../../../../components/utils/post";
|
|
13
|
+
import { useAdminNavigation } from "../../../../hooks";
|
|
14
|
+
import { useWPAdmin } from "../../../../wp-admin";
|
|
15
|
+
export const Toolbar = () => {
|
|
16
|
+
const { overlay } = useWPAdmin();
|
|
17
|
+
const { user } = useUser();
|
|
18
|
+
const { formData, setFormData } = useFormDataContext("post");
|
|
19
|
+
const { router, gotoPath, refresh } = useAdminNavigation();
|
|
20
|
+
const { actions, safeParse, parse } = useServerActions();
|
|
21
|
+
const { toggle } = usePanelContext();
|
|
22
|
+
const [iconVarient, setIconVarient] = useState("solid");
|
|
23
|
+
const postId = formData.ID;
|
|
24
|
+
const handleSave = async () => {
|
|
25
|
+
if (!formData.post_author) {
|
|
26
|
+
formData.post_author = user?.ID;
|
|
27
|
+
}
|
|
28
|
+
// Covert Date object to string
|
|
29
|
+
formData.post_date = formatting.dateMySQL(formData.post_date, {
|
|
30
|
+
withGMTOffset: true,
|
|
31
|
+
});
|
|
32
|
+
formData.post_date_gmt = formatting.dateMySQL(formData.post_date);
|
|
33
|
+
const serverAction = postId
|
|
34
|
+
? actions.post.update(postId, formData)
|
|
35
|
+
: actions.post.create({ ...formData, post_type: "post" });
|
|
36
|
+
const result = await overlay.circular.promise(serverAction).then(safeParse);
|
|
37
|
+
if (!result.success) {
|
|
38
|
+
overlay.snackbar.open("error", result.error);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
overlay.snackbar.open("success", "Post has been saved");
|
|
42
|
+
// After saving, the post may have changed (e.g., post_status could be "future" if the date is in the future).
|
|
43
|
+
// Fetch the latest post data to ensure formData reflects any updates from the server.
|
|
44
|
+
if (formData.ID) {
|
|
45
|
+
// Get the updated post data
|
|
46
|
+
const [updatedPost] = await actions.post.get(result.data).then(parse);
|
|
47
|
+
setFormData(updatedPost);
|
|
48
|
+
refresh(["content"]);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
// If it's a new post, we navigate to the edit page with the new post ID
|
|
52
|
+
gotoPath("/posts/edit", {
|
|
53
|
+
segment: "blog",
|
|
54
|
+
queryParams: {
|
|
55
|
+
id: result.data,
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
const handleTrash = async () => {
|
|
60
|
+
if (!postId) {
|
|
61
|
+
overlay.snackbar.open("error", "Invalid post");
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
await overlay.circular.promise(actions.post.trash(postId)).then(parse);
|
|
65
|
+
router.back();
|
|
66
|
+
};
|
|
67
|
+
const handleToggle = () => {
|
|
68
|
+
toggle();
|
|
69
|
+
setIconVarient(iconVarient === "plain" ? "solid" : "plain");
|
|
70
|
+
};
|
|
71
|
+
return (_jsxs(Box, { sx: { display: "flex", gap: 2 }, children: [_jsx(Input, { size: "large", value: formData?.post_title ?? "", onChange: (value) => setFormData({ post_title: value }), placeholder: "Title", removeBorderOnFocus: true, sx: { fontWeight: 500, flexGrow: 1 } }, formData?.ID ?? 0), _jsx(Button, { onClick: handleSave, size: "medium", children: "Save" }), formData.ID && _jsx(IconButtonDelete, { onClick: handleTrash }), _jsx(Tooltip, { title: "Settings", placement: "top", children: _jsx(IconButton, { onClick: handleToggle, children: _jsx(SettingIcon, {}) }) })] }));
|
|
72
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/client/components/contents/posts/Edit/index.tsx"],"names":[],"mappings":"AAmBA,eAAO,MAAM,IAAI,sDA+DhB,CAAC"}
|