@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.
- package/Button.js +1 -1
- package/DateTimePicker.d.ts.map +1 -1
- package/DateTimePicker.js +32 -25
- package/DraggableBox.d.ts +1 -1
- package/DraggableBox.d.ts.map +1 -1
- package/InputSearch.d.ts.map +1 -1
- package/InputSearch.js +3 -1
- package/Loading.d.ts +1 -1
- package/Loading.d.ts.map +1 -1
- package/LoadingBox.d.ts +1 -1
- package/LoadingBox.d.ts.map +1 -1
- package/MediaTag.d.ts +1 -1
- package/MediaTag.d.ts.map +1 -1
- package/MediaTag.js +1 -3
- package/README.md +91 -221
- package/SelectAutocomplete.d.ts +1109 -1077
- package/SelectAutocomplete.d.ts.map +1 -1
- package/SelectAutocomplete.js +1 -1
- package/SelectWPPost.d.ts.map +1 -1
- package/SelectWPPost.js +4 -1
- package/SelectWPTerm.d.ts.map +1 -1
- package/SelectWPTerm.js +4 -1
- package/SelectWPUser.d.ts.map +1 -1
- package/SelectWPUser.js +4 -1
- package/SortableList.js +1 -1
- package/Tabs.d.ts +1 -1
- package/Tabs.d.ts.map +1 -1
- package/ThemeRegistry.d.ts +2 -2
- package/ThemeRegistry.d.ts.map +1 -1
- package/Typography.d.ts +3 -2
- package/Typography.d.ts.map +1 -1
- package/Typography.js +23 -8
- package/font/import-fonts.d.ts +5 -0
- package/font/import-fonts.d.ts.map +1 -0
- package/font/import-fonts.js +4 -0
- package/hooks/use-form-data.d.ts +3 -3
- package/hooks/use-scheme-toggle.d.ts +1 -1
- package/list/ListTable.d.ts +3 -3
- package/list/ListTable.d.ts.map +1 -1
- package/list/Pagination.d.ts +1 -1
- package/list/Pagination.d.ts.map +1 -1
- package/media/MediaGridForm.d.ts +1 -1
- package/media/MediaGridForm.d.ts.map +1 -1
- package/media/MediaThumbnail.d.ts +1 -1
- package/media/MediaThumbnail.d.ts.map +1 -1
- package/media/MediaThumbnail.js +1 -3
- package/media/MediaUpload.js +1 -1
- package/media-selector/MediaSelectorList.js +1 -1
- package/media-selector/MediaSelectorPreview.d.ts +1 -1
- package/media-selector/MediaSelectorPreview.d.ts.map +1 -1
- package/media-selector/index.js +2 -1
- package/package.json +5 -4
- package/portal/use-portal.d.ts +1 -1
- 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:
|
|
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" } : {}),
|
package/DateTimePicker.d.ts.map
CHANGED
|
@@ -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,
|
|
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
|
-
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
"& .
|
|
24
|
-
|
|
25
|
-
|
|
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
|
package/DraggableBox.d.ts.map
CHANGED
|
@@ -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,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AC"}
|
package/InputSearch.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,
|
|
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
|
|
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
|
|
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,
|
|
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
|
|
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
|
package/LoadingBox.d.ts.map
CHANGED
|
@@ -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,
|
|
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
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,
|
|
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
|
-
|
|
3
|
+
## 📖 [Full Documentation → rnaga.github.io/wp-next](https://rnaga.github.io/wp-next/)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
> For guides, concepts, and examples, the documentation site is the best starting point.
|
|
6
6
|
|
|
7
|
-
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
|
|
60
|
-
-
|
|
61
|
-
|
|
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
|
-
|
|
17
|
+
---
|
|
65
18
|
|
|
66
|
-
|
|
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
|
-
|
|
21
|
+
WP-Next ships as two products you can use together or independently:
|
|
72
22
|
|
|
73
|
-
|
|
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
|
-
|
|
26
|
+
Use both as one stack, or start with Admin alone.
|
|
76
27
|
|
|
77
|
-
|
|
28
|
+
---
|
|
78
29
|
|
|
79
|
-
|
|
30
|
+
## Quick Demo
|
|
80
31
|
|
|
81
|
-
WP-Next
|
|
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
|
-
|
|
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
|
-
|
|
41
|
+
Log in with:
|
|
88
42
|
|
|
89
43
|
```text
|
|
90
|
-
|
|
91
|
-
|
|
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
|
-
|
|
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
|
-
|
|
51
|
+
To stop the container:
|
|
116
52
|
|
|
117
53
|
```bash
|
|
118
|
-
|
|
119
|
-
npm run start
|
|
54
|
+
docker stop wp-next-editor-example
|
|
120
55
|
```
|
|
121
56
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
https://nextjs.org/docs/pages/getting-started/deploying
|
|
57
|
+
## Prerequisites
|
|
125
58
|
|
|
126
|
-
|
|
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
|
-
|
|
61
|
+
## Getting Started
|
|
129
62
|
|
|
130
|
-
|
|
63
|
+
Choose the setup that matches what you want to build:
|
|
131
64
|
|
|
132
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
73
|
+
See the [Editor Installation guide](https://rnaga.github.io/wp-next/docs/editor/installation) for the full setup walkthrough.
|
|
152
74
|
|
|
153
|
-
|
|
75
|
+
### Build WP-Next Admin Only
|
|
154
76
|
|
|
155
|
-
|
|
77
|
+
Run this only if you want to start up **WP-Next Admin** without the visual editor:
|
|
156
78
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
79
|
+
```bash
|
|
80
|
+
npx @rnaga/wp-next-cli -- initAdmin
|
|
81
|
+
```
|
|
160
82
|
|
|
161
|
-
https://rnaga.github.io/wp-
|
|
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
|
-
##
|
|
85
|
+
## WP-Next Editor
|
|
164
86
|
|
|
165
|
-
|
|
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
|
-
|
|
89
|
+
### Key Features
|
|
168
90
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
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
|
-
|
|
174
|
-
`http://localhost:3000/admin/blog/custom`
|
|
100
|
+
### AI-Powered Template Authoring — Built-in Agent Skills
|
|
175
101
|
|
|
176
|
-
|
|
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
|
-
|
|
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
|
-
|
|
106
|
+
The skill supports four modes:
|
|
181
107
|
|
|
182
|
-
|
|
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
|
-
|
|
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
|
-
|
|
190
|
-
|
|
191
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
131
|
+
## WP-Next Admin
|
|
257
132
|
|
|
258
|
-
-
|
|
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
|
-
|
|
135
|
+
### Key Features
|
|
261
136
|
|
|
262
|
-
|
|
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
|
-
-
|
|
139
|
+
- Posts & Pages
|
|
140
|
+
- Media
|
|
141
|
+
- Terms (Categories, Tags)
|
|
142
|
+
- Comments
|
|
143
|
+
- Profile & Settings
|
|
144
|
+
- Users and Roles
|
|
145
|
+
- Revisions
|
|
267
146
|
|
|
268
|
-
|
|
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
|
-
-
|
|
149
|
+
- Sites
|
|
150
|
+
- Blogs (per-site content such as posts, media, comments)
|
|
273
151
|
|
|
274
|
-
|
|
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
|
-
-
|
|
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
|
-
|
|
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
|
-
|
|
158
|
+
---
|
|
289
159
|
|
|
290
160
|
## License
|
|
291
161
|
|