@rnaga/wp-next-ui 1.1.10 → 1.2.2

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 (54) hide show
  1. package/Button.js +1 -1
  2. package/DateTimePicker.d.ts.map +1 -1
  3. package/DateTimePicker.js +32 -25
  4. package/DraggableBox.d.ts +1 -1
  5. package/DraggableBox.d.ts.map +1 -1
  6. package/InputSearch.d.ts.map +1 -1
  7. package/InputSearch.js +3 -1
  8. package/Loading.d.ts +1 -1
  9. package/Loading.d.ts.map +1 -1
  10. package/LoadingBox.d.ts +1 -1
  11. package/LoadingBox.d.ts.map +1 -1
  12. package/MediaTag.d.ts +1 -1
  13. package/MediaTag.d.ts.map +1 -1
  14. package/MediaTag.js +1 -3
  15. package/README.md +91 -221
  16. package/SelectAutocomplete.d.ts +1109 -1077
  17. package/SelectAutocomplete.d.ts.map +1 -1
  18. package/SelectAutocomplete.js +1 -1
  19. package/SelectWPPost.d.ts.map +1 -1
  20. package/SelectWPPost.js +4 -1
  21. package/SelectWPTerm.d.ts.map +1 -1
  22. package/SelectWPTerm.js +4 -1
  23. package/SelectWPUser.d.ts.map +1 -1
  24. package/SelectWPUser.js +4 -1
  25. package/SortableList.js +1 -1
  26. package/Tabs.d.ts +1 -1
  27. package/Tabs.d.ts.map +1 -1
  28. package/ThemeRegistry.d.ts +2 -2
  29. package/ThemeRegistry.d.ts.map +1 -1
  30. package/Typography.d.ts +3 -2
  31. package/Typography.d.ts.map +1 -1
  32. package/Typography.js +23 -8
  33. package/font/import-fonts.d.ts +5 -0
  34. package/font/import-fonts.d.ts.map +1 -0
  35. package/font/import-fonts.js +4 -0
  36. package/hooks/use-form-data.d.ts +3 -3
  37. package/hooks/use-scheme-toggle.d.ts +1 -1
  38. package/list/ListTable.d.ts +3 -3
  39. package/list/ListTable.d.ts.map +1 -1
  40. package/list/Pagination.d.ts +1 -1
  41. package/list/Pagination.d.ts.map +1 -1
  42. package/media/MediaGridForm.d.ts +1 -1
  43. package/media/MediaGridForm.d.ts.map +1 -1
  44. package/media/MediaThumbnail.d.ts +1 -1
  45. package/media/MediaThumbnail.d.ts.map +1 -1
  46. package/media/MediaThumbnail.js +1 -3
  47. package/media/MediaUpload.js +1 -1
  48. package/media-selector/MediaSelectorList.js +1 -1
  49. package/media-selector/MediaSelectorPreview.d.ts +1 -1
  50. package/media-selector/MediaSelectorPreview.d.ts.map +1 -1
  51. package/media-selector/index.js +2 -1
  52. package/package.json +5 -4
  53. package/portal/use-portal.d.ts +1 -1
  54. package/portal/use-portal.d.ts.map +1 -1
package/Button.js CHANGED
@@ -5,7 +5,7 @@ import { useWPTheme } from "./ThemeRegistry";
5
5
  export const Button = (props) => {
6
6
  const { children, size, component, bold, loading, color, disabled, endIcon, ...rest } = props;
7
7
  const { wpTheme } = useWPTheme();
8
- return (_jsx(MuiButton, { ...rest, component: component, variant: "contained", size: "small", disableElevation: true, disabled: loading || disabled === true, sx: {
8
+ return (_jsx(MuiButton, { ...rest, ...(component !== undefined ? { component } : {}), variant: "contained", size: "small", disableElevation: true, disabled: loading || disabled === true, sx: {
9
9
  textTransform: "none",
10
10
  fontSize: size === "large" ? 16 : size === "medium" ? 14 : 12,
11
11
  ...(bold ? { fontWeight: "bold" } : {}),
@@ -1 +1 @@
1
- {"version":3,"file":"DateTimePicker.d.ts","sourceRoot":"","sources":["../src/DateTimePicker.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc,GAAI,OAAO;IACpC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC1C,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;CACrC,4CAiDA,CAAC"}
1
+ {"version":3,"file":"DateTimePicker.d.ts","sourceRoot":"","sources":["../src/DateTimePicker.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc,GAAI,OAAO;IACpC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC1C,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;CACrC,4CAkDA,CAAC"}
package/DateTimePicker.js CHANGED
@@ -7,39 +7,46 @@ import { useWPTheme } from "./ThemeRegistry";
7
7
  export const DateTimePicker = (props) => {
8
8
  const { value, onChange, size } = props;
9
9
  const { wpTheme } = useWPTheme();
10
- return (_jsx(LocalizationProvider, { dateAdapter: AdapterDayjs, children: _jsx(MuiDateTimePicker, { value: dayjs(value), onChange: (newValue) => {
10
+ const fontSize = size === "large" ? 16 : size === "medium" ? 14 : 12;
11
+ const height = size === "large" ? 36 : size === "medium" ? 32 : 24;
12
+ return (_jsx(LocalizationProvider, { dateAdapter: AdapterDayjs, children: _jsx(MuiDateTimePicker
13
+ /**
14
+ * Pass null for empty/invalid values — dayjs(undefined) returns "now"
15
+ * which misleads the picker when no date has been set.
16
+ */
17
+ , {
18
+ /**
19
+ * Pass null for empty/invalid values — dayjs(undefined) returns "now"
20
+ * which misleads the picker when no date has been set.
21
+ */
22
+ value: value ? dayjs(value) : null, onChange: (newValue) => {
11
23
  onChange && onChange(newValue?.toDate() || "");
12
24
  }, slotProps: {
13
- textField: {
14
- size: "small",
15
- slotProps: {
16
- input: { disableUnderline: true, sx: { fontSize: 0.1 } },
17
- },
25
+ /**
26
+ * In MUI X v9 the textField slot was removed; use field.sx instead.
27
+ * Targets MuiPickersOutlinedInput-root (replaces MuiOutlinedInput-root).
28
+ */
29
+ field: {
18
30
  sx: {
19
- "& .MuiInputBase-input": {
20
- py: 0.5,
21
- px: 1,
31
+ fontSize,
32
+ height,
33
+ border: `1px solid ${wpTheme.border.color}`,
34
+ borderRadius: 1,
35
+ "& .MuiPickersOutlinedInput-root": {
36
+ height: "100%",
37
+ fontSize,
38
+ "& fieldset": { border: "none" },
39
+ "&.Mui-focused fieldset": { border: "none" },
40
+ "&:hover fieldset": { border: "none" },
22
41
  },
23
- "& .MuiOutlinedInput-root": {
24
- fontSize: size === "large" ? 16 : size === "medium" ? 14 : 12,
25
- height: size === "large" ? 36 : size == "medium" ? 32 : 24,
26
- border: `1px solid ${wpTheme.border.color}`,
27
- "& fieldset": {
28
- border: "none",
29
- },
30
- "&.Mui-focused fieldset": {
31
- border: "none",
32
- },
33
- "&:hover fieldset": {
34
- border: "none",
35
- },
42
+ "& .MuiPickersSectionList-root": {
43
+ py: 0,
44
+ px: 1,
36
45
  },
37
46
  "& .MuiSvgIcon-root": {
38
47
  fontSize: size === "large" ? 26 : size === "medium" ? 22 : 18,
39
48
  },
40
49
  },
41
50
  },
42
- }, sx: {
43
- width: "100%",
44
- } }) }));
51
+ }, sx: { width: "100%" } }) }));
45
52
  };
package/DraggableBox.d.ts CHANGED
@@ -43,6 +43,6 @@ export declare const DraggableBox: (props: {
43
43
  placement?: "target" | "left";
44
44
  resizable?: boolean;
45
45
  onResize?: (width: number, height: number, event?: Event) => void;
46
- }) => import("react/jsx-runtime").JSX.Element;
46
+ }) => import("react/jsx-runtime").JSX.Element | null;
47
47
  export {};
48
48
  //# sourceMappingURL=DraggableBox.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DraggableBox.d.ts","sourceRoot":"","sources":["../src/DraggableBox.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,EACZ,SAAS,EAKV,MAAM,OAAO,CAAC;AACf,OAAO,EAAmB,OAAO,EAAE,MAAM,eAAe,CAAC;AAOzD,KAAK,WAAW,GAAG;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE;QACP,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,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AAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACzB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;CAC7E,4CA6CA,CAAC"}
1
+ {"version":3,"file":"InputSearch.d.ts","sourceRoot":"","sources":["../src/InputSearch.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAKxC,eAAO,MAAM,WAAW,GAAI,OAAO;IACjC,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,EAAE,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACzB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;CAC7E,4CA+CA,CAAC"}
package/InputSearch.js CHANGED
@@ -9,7 +9,9 @@ export const InputSearch = (props) => {
9
9
  const ref = useRef(null);
10
10
  const handleClear = () => {
11
11
  updateRouter({ search: "" });
12
- ref.current.value = "";
12
+ if (ref.current) {
13
+ ref.current.value = "";
14
+ }
13
15
  };
14
16
  const handleChange = (value, e) => {
15
17
  if (props.onChange) {
package/Loading.d.ts CHANGED
@@ -3,5 +3,5 @@ export declare const Loading: (props: {
3
3
  children?: React.ReactNode;
4
4
  loading: boolean;
5
5
  sx?: SxProps;
6
- }) => string | number | bigint | boolean | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode>> | import("react/jsx-runtime").JSX.Element;
6
+ }) => string | number | bigint | boolean | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
7
7
  //# sourceMappingURL=Loading.d.ts.map
package/Loading.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Loading.d.ts","sourceRoot":"","sources":["../src/Loading.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7D,eAAO,MAAM,OAAO,GAAI,OAAO;IAC7B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,EAAE,CAAC,EAAE,OAAO,CAAC;CACd,sUA+CA,CAAC"}
1
+ {"version":3,"file":"Loading.d.ts","sourceRoot":"","sources":["../src/Loading.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7D,eAAO,MAAM,OAAO,GAAI,OAAO;IAC7B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,EAAE,CAAC,EAAE,OAAO,CAAC;CACd,4WA+CA,CAAC"}
package/LoadingBox.d.ts CHANGED
@@ -8,5 +8,5 @@ export declare const LoadingBox: (props: {
8
8
  innerBox?: SxProps;
9
9
  progress?: SxProps;
10
10
  };
11
- }) => string | number | bigint | boolean | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode>> | import("react/jsx-runtime").JSX.Element;
11
+ }) => string | number | bigint | boolean | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
12
12
  //# sourceMappingURL=LoadingBox.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"LoadingBox.d.ts","sourceRoot":"","sources":["../src/LoadingBox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAyB,OAAO,EAAE,MAAM,eAAe,CAAC;AAE/D,eAAO,MAAM,UAAU,GAAI,OAAO;IAChC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC1B,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,WAAW,CAAC,EAAE;QACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB,CAAC;CACH,sUA+CA,CAAC"}
1
+ {"version":3,"file":"LoadingBox.d.ts","sourceRoot":"","sources":["../src/LoadingBox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAyB,OAAO,EAAE,MAAM,eAAe,CAAC;AAE/D,eAAO,MAAM,UAAU,GAAI,OAAO;IAChC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC1B,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,WAAW,CAAC,EAAE;QACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB,CAAC;CACH,4WA+CA,CAAC"}
package/MediaTag.d.ts CHANGED
@@ -5,5 +5,5 @@ export declare const MediaTag: <T extends wpCoreTypes.actions.Posts[number]>(pro
5
5
  slotSxProps?: {
6
6
  icon: SxProps;
7
7
  };
8
- }) => import("react/jsx-runtime").JSX.Element;
8
+ }) => import("react/jsx-runtime").JSX.Element | null;
9
9
  //# sourceMappingURL=MediaTag.d.ts.map
package/MediaTag.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"MediaTag.d.ts","sourceRoot":"","sources":["../src/MediaTag.tsx"],"names":[],"mappings":"AACA,OAAO,EAAQ,OAAO,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,WAAW,MAAM,2BAA2B,CAAC;AAIzD,eAAO,MAAM,QAAQ,GAAI,CAAC,SAAS,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,OAAO;IAC3E,IAAI,EAAE,CAAC,CAAC;IACR,WAAW,CAAC,EAAE;QACZ,IAAI,EAAE,OAAO,CAAC;KACf,CAAC;CACH,4CAsCA,CAAC"}
1
+ {"version":3,"file":"MediaTag.d.ts","sourceRoot":"","sources":["../src/MediaTag.tsx"],"names":[],"mappings":"AACA,OAAO,EAAQ,OAAO,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,WAAW,MAAM,2BAA2B,CAAC;AAIzD,eAAO,MAAM,QAAQ,GAAI,CAAC,SAAS,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,OAAO;IAC3E,IAAI,EAAE,CAAC,CAAC;IACR,WAAW,CAAC,EAAE;QACZ,IAAI,EAAE,OAAO,CAAC;KACf,CAAC;CACH,mDAsCA,CAAC"}
package/MediaTag.js CHANGED
@@ -9,9 +9,7 @@ export const MediaTag = (props) => {
9
9
  }
10
10
  const mimeType = getMimeType(post.guid);
11
11
  const mediaType = mimeType.split("/")[0];
12
- return mediaType == "image" ? (
13
- // eslint-disable-next-line @next/next/no-img-element
14
- _jsx("img", { "data-first-child": true, src: post.guid, loading: "lazy", alt: "", style: {
12
+ return mediaType == "image" ? (_jsx("img", { "data-first-child": true, src: post.guid, loading: "lazy", alt: "", style: {
15
13
  width: "100%",
16
14
  height: "auto",
17
15
  objectFit: "contain",
package/README.md CHANGED
@@ -1,291 +1,161 @@
1
1
  # WP-Next
2
2
 
3
- WP-Next is built with [Next.js](https://nextjs.org/) and [WP-Node](https://github.com/rnaga/wp-node). It provides a modern **React-based Admin Dashboard** and utilities for building applications that interact directly with a WordPress database — **no PHP required**.
3
+ ## 📖 [Full Documentation → rnaga.github.io/wp-next](https://rnaga.github.io/wp-next/)
4
4
 
5
- 👉 **View [Full Documentation](https://rnaga.github.io/wp-next/)**
5
+ > For guides, concepts, and examples, the documentation site is the best starting point.
6
6
 
7
- <a href="https://vimeo.com/1112693769?share=copy#t=0" target="_blank" rel="noopener">
8
- <img width="1200" height="699" alt="dashboard-vimeo" src="https://rnaga.github.io/wp-next/images/dashboard-vimeo.png" />
9
- </a>
10
-
11
- ## Quick Demo
12
-
13
- Run a ready-made WP-Next example using Docker:
14
-
15
- ```bash
16
- docker run --rm --init -it --name wp-next-example -p 3000:3000 \
17
- -v wp-next-example_public:/app/admin/public \
18
- -v wp-next-example_db:/var/lib/mysql \
19
- -v wp-next-example_html:/app/html \
20
- rnagat/wp-next-example:latest
21
- ```
22
-
23
- Visit [http://localhost:3000/admin](http://localhost:3000/admin) and log in with:
24
-
25
- ```text
26
- Username: wp
27
- Password: wp
28
- ```
29
-
30
- To stop and remove the running example container, use:
31
-
32
- ```sh
33
- docker stop wp-next-example
34
- ```
35
-
36
- ## Admin Dashboard
37
-
38
- The main feature of WP-Next is the **Admin Dashboard**, a headless CMS that serves as an alternative to the traditional WordPress Admin Dashboard.
7
+ **WP-Next** is a **TypeScript-first** toolkit for building **WordPress-powered Next.js applications** — with a visual drag-and-drop editor, a modern React admin dashboard, and **first-class AI support** built in from day one.
39
8
 
40
- Out of the box, it includes:
41
-
42
- - Posts & Pages
43
- - Media
44
- - Terms (Categories, Tags)
45
- - Comments
46
- - Profile & Settings
47
- - Users and Roles
48
- - Revisions
49
-
50
- In **multisite mode**, it also supports:
51
-
52
- - Sites
53
- - Blogs (per-site content such as posts, media, comments)
54
-
55
- ### Notes
56
-
57
- Since WP-Next is entirely written in TypeScript and React, some WordPress features are **not supported**, including:
9
+ <a href="https://vimeo.com/1185738064?share=copy#t=0" target="_blank" rel="noopener">
10
+ <img width="1200" height="699" alt="WP-Next Editor canvas demo" src="https://rnaga.github.io/wp-next/assets/editor/canvas/drag-drop-0.gif" />
11
+ </a>
58
12
 
59
- - WordPress Themes and appearance settings
60
- - WordPress Block Editor (Gutenberg)
61
- - WordPress template rendering APIs
62
- - WordPress plugins
13
+ <a href="https://vimeo.com/1112693769?share=copy#t=0" target="_blank" rel="noopener">
14
+ <img width="1200" height="699" alt="WP-Next Admin dashboard demo" src="https://rnaga.github.io/wp-next/images/dashboard-vimeo.png" />
15
+ </a>
63
16
 
64
- ## Core Libraries
17
+ ---
65
18
 
66
- - [`@rnaga/wp-node`](https://github.com/rnaga/wp-node) TypeScript-first WordPress database integration.
67
- - [`next`](https://nextjs.org/) — Next.js framework for SSR/SSG, routing, and APIs.
68
- - [`@mui/material`](https://mui.com/) — Material UI component library.
69
- - [`@tiptap/react`](https://tiptap.dev/), [`mui-tiptap`](https://github.com/sjdemartini/mui-tiptap) — TipTap rich-text editor with Material UI integration.
19
+ ## Two Products, One Stack
70
20
 
71
- ## Installation
21
+ WP-Next ships as two products you can use together or independently:
72
22
 
73
- ### Prerequisites
23
+ - **WP-Next Editor** — visual site builder with live preview, responsive breakpoints, dynamic WordPress data binding, and AI-powered template authoring. Includes Admin automatically.
24
+ - **WP-Next Admin** — standalone React admin dashboard you can adopt without the editor.
74
25
 
75
- WP-Next requires a running WordPress database. If you don’t already have WordPress installed, see the Prerequisites section in the WP-Node installation guide for instructions on running it with Docker:
26
+ Use both as one stack, or start with Admin alone.
76
27
 
77
- https://rnaga.github.io/wp-node/docs/getting-started/installation#prerequisites
28
+ ---
78
29
 
79
- ### Initialize Project (Admin Dashboard)
30
+ ## Quick Demo
80
31
 
81
- WP-Next provides a CLI tool to initialize the Admin Dashboard. Run the following command and follow the prompts:
32
+ Run a ready-made WP-Next Editor example using Docker. This is the recommended demo because it includes the editor and the admin dashboard in one setup:
82
33
 
83
34
  ```bash
84
- npx @rnaga/wp-next-cli -- initAdmin
35
+ docker run --rm --init -it --name wp-next-editor-example -p 3000:3000 \
36
+ -v wp-next-editor_public:/app/editor/public \
37
+ -v wp-next-editor_db:/var/lib/mysql \
38
+ rnagat/wp-next-editor-example:latest
85
39
  ```
86
40
 
87
- Example setup prompts you may see:
41
+ Log in with:
88
42
 
89
43
  ```text
90
- ✔ Enter your database hostname: · localhost
91
- ✔ Enter your database port: · 33306
92
- ✔ Enter your database username: · wp
93
- ✔ Enter your database password: · **
94
- ✔ Enter your database name: · wordpress
95
- ✔ Is it a multi-site? · No
96
- ✔ Enter your static assets path: · public
97
- ✔ Enter your Admin URL: · http://localhost:3000
98
- ✔ Enter project path (What is your project named?): · admin
44
+ Username: wp
45
+ Password: wp
99
46
  ```
100
47
 
101
- The CLI will automatically install and configure:
102
-
103
- - A Next.js project (App Router enabled) for the Admin Dashboard
104
- - Pages and layouts required by the Admin Dashboard
105
- - Configuration files and the `_wp/hooks` scaffolding
106
-
107
- ### Run and Build the Admin Dashboard
108
-
109
- Run in development mode:
110
-
111
- ```bash
112
- npm run dev
113
- ```
48
+ - Editor: [http://localhost:3000/admin/1/editor](http://localhost:3000/admin/1/editor)
49
+ - Admin Dashboard: [http://localhost:3000/admin](http://localhost:3000/admin)
114
50
 
115
- Build and start for production:
51
+ To stop the container:
116
52
 
117
53
  ```bash
118
- npm run build
119
- npm run start
54
+ docker stop wp-next-editor-example
120
55
  ```
121
56
 
122
- For more on production deployment, refer to the Next.js deployment guide:
123
-
124
- https://nextjs.org/docs/pages/getting-started/deploying
57
+ ## Prerequisites
125
58
 
126
- ## Hooks (Filter and Action)
59
+ Both products require a running WordPress database. If you don't already have WordPress installed, see the [WP-Node installation guide](https://rnaga.github.io/wp-node/docs/getting-started/installation#prerequisites).
127
60
 
128
- WP-Next uses [WP-Node](https://github.com/rnaga/wp-node) hook system which is inspired by WordPress hooks but designed for TypeScript and Node.js. The system supports both filters (which transform data) and actions (which run side effects). Because WP-Node is TypeScript-first, hooks are type-safe and can be asynchronous — they are not directly compatible with WordPress core PHP hooks.
61
+ ## Getting Started
129
62
 
130
- Key points:
63
+ Choose the setup that matches what you want to build:
131
64
 
132
- - Filters: transform and return data; they may be async.
133
- - Actions: perform side effects and do not return data.
134
- - Hooks can be registered either with TypeScript decorators (static / application lifecycle) or with the functional HookCommand utilities (runtime / dynamic).
65
+ ### Build WP-Next Editor + Admin
135
66
 
136
- ### Frontend vs Backend hooks
67
+ Use this if you want the full WP-Next experience. This installs both packages, with WP-Next Admin included as part of the editor setup.
137
68
 
138
- When initialized, WP-Next generates a `_wp/hooks` directory where you can add your own hooks:
139
-
140
- ```txt
141
- hooks/
142
- ├── client
143
- │   └── index.tsx
144
- └── server
145
- ├── admin-media.hook.ts
146
- ├── index.ts
147
- ├── nextauth-providers.hook.ts
148
- └── notifications.hook.ts
69
+ ```bash
70
+ npx @rnaga/wp-next-cli -- initEditor
149
71
  ```
150
72
 
151
- #### Frontend Hooks
73
+ See the [Editor Installation guide](https://rnaga.github.io/wp-next/docs/editor/installation) for the full setup walkthrough.
152
74
 
153
- Frontend hooks (place under `_wp/hooks/client/`) are bundled into the Admin UI and run in the browser. Use them to register UI extensions such as sidebar menus, custom admin pages, or client-side theming. Frontend hooks must contain only client-safe code (no direct access to the filesystem, process env secrets, or server-only Node APIs).
75
+ ### Build WP-Next Admin Only
154
76
 
155
- #### Backend Hooks
77
+ Run this only if you want to start up **WP-Next Admin** without the visual editor:
156
78
 
157
- Backend hooks (place under `_wp/hooks/server/`) run inside the server-side application/context. Use them for server responsibilities like media upload handling, authentication providers, email sending, or other integrations that require Node APIs, credentials, or synchronous server-side state.
158
-
159
- For more details about hooks, how they work, and usage examples, see the WP-Node hooks documentation:
79
+ ```bash
80
+ npx @rnaga/wp-next-cli -- initAdmin
81
+ ```
160
82
 
161
- https://rnaga.github.io/wp-node/docs/concepts-features/hooks
83
+ See the [Admin Getting Started guide](https://rnaga.github.io/wp-next/docs/admin/getting-started) for the full setup walkthrough.
162
84
 
163
- ## Custom Admin Pages
85
+ ## WP-Next Editor
164
86
 
165
- You can extend the Admin Dashboard by registering **custom pages**:
87
+ WP-Next Editor is a visual, drag-and-drop website builder for building public-facing WordPress sites directly connected to your WordPress database. Templates and pages are stored as structured [Lexical](https://lexical.dev/docs/intro) JSON in the WordPress database making them version-controllable, programmatically manipulable, and AI-ready.
166
88
 
167
- Below are minimal, illustrative examples (a page component and a frontend hook) you can copy into `_wp/hooks/client/` and adapt to your project.
89
+ ### Key Features
168
90
 
169
- 1. **Create a React component** (`CustomPage.tsx`) to render your page.
170
- 2. **Write a frontend hook** (`menu-custom.hook.tsx`) to add a sidebar menu and route.
171
- 3. **Register the hook** in `_wp/hooks/client/index.tsx`.
91
+ - **Drag-and-drop canvas** — build pages visually with a live preview. Select, resize, nest, and animate elements directly on the canvas.
92
+ - **Responsive design** set per-device breakpoints (desktop, tablet, mobile) and CSS states (hover, focus, etc.). Each device gets its own `@media` query at render time.
93
+ - **Dynamic data binding** pull posts, users, taxonomies, and options directly from the WordPress database into any element. No custom API endpoints required.
94
+ - **Widget system** — embed sub-templates (widgets) inside other templates for reusable headers, footers, and components. Widget variants let the same widget render different content per embedding.
95
+ - **CSS variables** — define design tokens at the template level and reference them across all elements for consistent theming.
96
+ - **Animations** — attach CSS keyframe animations (98 Animate.css presets) to any element, triggered by hover, click, scroll, and more.
97
+ - **JSON editor** — edit the raw Lexical JSON directly in a built-in code editor for precise control over template structure.
98
+ - **Save history** — create and manage template save points with preview and restore support.
172
99
 
173
- Example menu item route:
174
- `http://localhost:3000/admin/blog/custom`
100
+ ### AI-Powered Template Authoring — Built-in Agent Skills
175
101
 
176
- This allows you to build fully custom interfaces inside the Admin while reusing the WP-Next shell.
102
+ WP-Next Editor ships with a built-in **[Agent Skill](https://agentskills.io/home)** (`/wp-next-editor-template`) that lets you build and modify templates using natural-language prompts. All templates are stored as Lexical JSON, so AI agents can read, write, and transform them directly.
177
103
 
178
- Example code (illustrative example usage)
104
+ [Agent Skills](https://agentskills.io/home) is an open standard supported by Claude Code, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, VS Code, and more. Install the skill once and use it with whichever coding agent you prefer.
179
105
 
180
- These snippets show one way to implement `CustomPage.tsx` and `menu-custom.hook.tsx`. Adapt imports, types, and `capabilities` to your project; they are examples, not production-ready code.
106
+ The skill supports four modes:
181
107
 
182
- CustomPage.tsx
108
+ | Mode | What it does |
109
+ | --------- | ----------------------------------------------------------- |
110
+ | `create` | Scaffold a new template from a natural-language description |
111
+ | `update` | Modify an existing template based on a prompt |
112
+ | `convert` | Convert HTML/CSS into a Lexical JSON template |
113
+ | `help` | Describe available nodes, styles, and patterns |
183
114
 
184
- ```tsx
185
- import React from "react";
186
- import Box from "@mui/material/Box";
187
- import Typography from "@mui/material/Typography";
115
+ Install the skill with:
188
116
 
189
- export const CustomPage = () => {
190
- return (
191
- <Box sx={{ p: 2 }}>
192
- <Typography variant="h4" gutterBottom>
193
- Custom Page
194
- </Typography>
117
+ ```bash
118
+ npx @rnaga/wp-next-cli -- editor agentSkills add
119
+ ```
195
120
 
196
- <Typography paragraph>
197
- This is a simple custom admin page. Put your React UI here — forms,
198
- lists, editor components, etc.
199
- </Typography>
121
+ Example prompt:
200
122
 
201
- <ul>
202
- <li>Example item 1</li>
203
- <li>Example item 2</li>
204
- </ul>
205
- </Box>
206
- );
207
- };
208
123
  ```
209
-
210
- menu-custom.hook.tsx
211
-
212
- ```tsx
213
- "use client";
214
-
215
- import { filter as clientFilter } from "@rnaga/wp-next-core/decorators";
216
- import { hook } from "@rnaga/wp-node/decorators/hooks";
217
- import CircleIcon from "@mui/icons-material/Circle";
218
- import { CustomPage } from "./CustomPage";
219
-
220
- @hook("next_admin_custom_menu")
221
- export class MenuCustomHook {
222
- @clientFilter("next_admin_menu")
223
- hookFilter(adminMenus: any[] = [], segment?: string) {
224
- // Only show in blog/dashboard segments
225
- if (!["blog", "dashboard"].includes(segment || "")) {
226
- return adminMenus;
227
- }
228
-
229
- const blogMenu = [
230
- {
231
- icon: <CircleIcon />,
232
- displayOnSidebar: true,
233
- component: <CustomPage />,
234
- capabilities: ["read"], // control access
235
- label: "Custom Page",
236
- // final route: /admin/blog/custom
237
- path: `/${"blog"}/custom`,
238
- },
239
- ];
240
-
241
- return [...adminMenus, ...blogMenu];
242
- }
243
- }
124
+ /wp-next-editor-template create src/templates/home.json "A hero section with a full-width background image, centered headline, subtitle, and a CTA button"
244
125
  ```
245
126
 
246
- index.tsx (register hooks)
127
+ See [Using AI](https://rnaga.github.io/wp-next/docs/editor/concepts-features/using-ai) for installation details and more examples.
247
128
 
248
- ```ts
249
- import { getDefaultAdminHooks } from "@rnaga/wp-next-admin/client/utils";
250
- import { MenuCustomHook } from "./menu-custom.hook";
251
-
252
- // include defaults first, then your custom hook
253
- export const hooks = [...getDefaultAdminHooks(), MenuCustomHook];
254
- ```
129
+ ---
255
130
 
256
- Summary and quick how-to
131
+ ## WP-Next Admin
257
132
 
258
- - Prerequisite: WP-Next Admin initialized (project creates `_wp/hooks/` on first run).
133
+ WP-Next Admin is a **React-based Admin Dashboard** that serves as a modern alternative to the traditional WordPress Admin Dashboard. It can be used on its own, and it is also the admin layer that ships with WP-Next Editor.
259
134
 
260
- - Key files (place under `_wp/hooks/client/`):
135
+ ### Key Features
261
136
 
262
- - `CustomPage.tsx` — minimal React page component that renders when the route is visited.
263
- - `menu-custom.hook.tsx` — frontend hook that adds a sidebar menu entry and maps a path (e.g. `/admin/blog/custom`) to your component. Use the `@hook(...)` class decorator and a client filter such as `@clientFilter('next_admin_menu')` to contribute menu items.
264
- - `index.tsx` — export the frontend hooks array. Include defaults first, then your custom hook: `export const hooks = [...getDefaultAdminHooks(), MenuCustomHook];`
137
+ Out of the box, it includes:
265
138
 
266
- - Important notes:
139
+ - Posts & Pages
140
+ - Media
141
+ - Terms (Categories, Tags)
142
+ - Comments
143
+ - Profile & Settings
144
+ - Users and Roles
145
+ - Revisions
267
146
 
268
- - Admin routes are segmented (e.g. `dashboard`, `blog`). Hooks often check/normalize the current segment so the final URL becomes something like `/admin/blog/custom`.
269
- - Use `capabilities` on menu items (for example `['read']` or `['edit_posts']`) to restrict access.
270
- - Frontend hooks run in the browser bundle — avoid Node-only APIs, filesystem access, or secrets in client hooks.
147
+ In **multisite mode**, it also supports:
271
148
 
272
- - Quick steps:
149
+ - Sites
150
+ - Blogs (per-site content such as posts, media, comments)
273
151
 
274
- 1. Create `_wp/hooks/client/CustomPage.tsx` with your React UI.
275
- 2. Add `_wp/hooks/client/menu-custom.hook.tsx` to register the menu item and route (set `component`, `path`, and `capabilities`).
276
- 3. Add your hook to `_wp/hooks/client/index.tsx` so the Admin shell loads it.
277
- 4. Run in dev or build for production.
152
+ ### Extensibility
278
153
 
279
- - Run:
154
+ WP-Next Admin supports **custom pages** and a **hook system** (filters and actions) inspired by WordPress hooks but built for TypeScript and Node.js. Frontend hooks extend the Admin UI in the browser; backend hooks handle server-side concerns such as authentication, media uploads, and integrations.
280
155
 
281
- ```bash
282
- npm run dev
283
- # or for production
284
- npm run build
285
- npm run start
286
- ```
156
+ See [Hooks](https://rnaga.github.io/wp-next/docs/admin/concepts-features/hooks) and [Custom Admin Pages](https://rnaga.github.io/wp-next/docs/admin/concepts-features/custom-pages) in the documentation.
287
157
 
288
- Example menu route: `http://localhost:3000/admin/blog/custom`
158
+ ---
289
159
 
290
160
  ## License
291
161