create-erxes 0.1.5 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { mkdir, readFile, readdir, symlink, writeFile } from "node:fs/promises";
|
|
|
9
9
|
import { homedir } from "node:os";
|
|
10
10
|
import { fileURLToPath } from "node:url";
|
|
11
11
|
// package.json
|
|
12
|
-
var version = "0.1.
|
|
12
|
+
var version = "0.1.7";
|
|
13
13
|
// src/existing-plugins.ts
|
|
14
14
|
/** The old erxes plugins a new-core plugin can be migrated from (`backend/plugins/<name>_api`). */
|
|
15
15
|
const OLD_PLUGINS = [
|
|
@@ -38,6 +38,11 @@ a comment.
|
|
|
38
38
|
erxes-ui's `DisplayMenu list="<plugin>-<things>"` inside the `ListFilter`
|
|
39
39
|
switches table and board, and erxes-ui's `useListDisplay`, given the same list, reads the
|
|
40
40
|
choice, remembered in the browser.
|
|
41
|
+
- Records that move through stages (tasks by status) can also show as erxes-ui's
|
|
42
|
+
`RecordList`: rows grouped under sticky headers that fold away, with a
|
|
43
|
+
checkbox each and its `RecordList.useSelection` hook for the bulk command bar.
|
|
44
|
+
Give `DisplayMenu` and `useListDisplay` the same `displays`, such as
|
|
45
|
+
`['list', 'board', 'table']`; the first shows until the member picks another.
|
|
41
46
|
|
|
42
47
|
## Filter
|
|
43
48
|
|
|
@@ -96,12 +101,41 @@ gives it its fields, and `api/src/modules/items/itemFilter.ts` applies them.
|
|
|
96
101
|
under that field. Call `onCreated(id)` after Save, and the record takes the
|
|
97
102
|
draft's place.
|
|
98
103
|
- A form gets its own page only when it has several sections or a live
|
|
99
|
-
preview (a product editor, a page builder). That page
|
|
100
|
-
|
|
101
|
-
|
|
104
|
+
preview (a product editor, a page builder). That page is laid out like a
|
|
105
|
+
settings page (below), not with the side panel's rows: cards with a title
|
|
106
|
+
and a line about them, labels above the fields in responsive grids, one
|
|
107
|
+
form, and the sticky Discard / Save bar at the bottom. A live preview or a
|
|
108
|
+
summary sits in a narrower column beside the cards (`lg:grid-cols-[1fr_20rem]`);
|
|
109
|
+
a body editor (rich text, blocks) takes a card's full width.
|
|
110
|
+
- The side panel's rows (`PanelFormRow`, `PanelField`) are only for the side
|
|
111
|
+
panel: a record's `New` and `Detail`.
|
|
102
112
|
- `Dialog` is for confirming (`useConfirm`) and nothing else. Never a form in
|
|
103
113
|
a dialog.
|
|
104
114
|
|
|
115
|
+
## Settings
|
|
116
|
+
|
|
117
|
+
Settings are not records, so they don't use the side panel's rows. A settings
|
|
118
|
+
page looks like core's Settings › Profile (`apps/web/src/modules/settings/profile`):
|
|
119
|
+
|
|
120
|
+
- `PageContainer`, `PageHeader` with the breadcrumb, then a `ScrollArea` with
|
|
121
|
+
one centered column, `mx-auto w-full max-w-3xl flex flex-col gap-4 p-6`.
|
|
122
|
+
- The fields come in cards, one per topic: `section` with
|
|
123
|
+
`rounded-lg border bg-background p-5 space-y-4`, a title
|
|
124
|
+
(`text-base font-semibold`) and one line under it saying what the card is
|
|
125
|
+
for (`text-sm text-muted-foreground`).
|
|
126
|
+
- Inside a card, each field is erxes-ui's `Form.Item` with `Form.Label` above
|
|
127
|
+
the control and `Form.Message` under it, laid in `grid grid-cols-1 gap-4
|
|
128
|
+
sm:grid-cols-2` (or `sm:grid-cols-3` for short fields). On/off settings are a
|
|
129
|
+
`Switch` with its label and a hint beside it.
|
|
130
|
+
- One form for the page (react-hook-form with a zod schema), saved by a
|
|
131
|
+
sticky bar at the bottom: `sticky bottom-0 flex justify-end gap-2 border-t
|
|
132
|
+
bg-background/95 py-3 backdrop-blur` with Discard (ghost, off until
|
|
133
|
+
something changed) and Save. Not a Save per card, and not Save in the header.
|
|
134
|
+
- A settings list (stores, pipelines, payment methods) is still a list:
|
|
135
|
+
`RecordTable`, and each entry opens in core's side panel like a record.
|
|
136
|
+
- Several settings pages are separate routes in the plugin's settings
|
|
137
|
+
sidebar, not tabs.
|
|
138
|
+
|
|
105
139
|
## Record detail
|
|
106
140
|
|
|
107
141
|
- Clicking a row's name opens the record in core's side panel. Its title is
|
|
@@ -34,7 +34,8 @@ and renders `./__id__` (the `__Pascal__` export) under `/__id__/*`.
|
|
|
34
34
|
under them, for a picker of the plugin's own records.
|
|
35
35
|
- Pages look and behave like core's: follow the `ui-patterns` skill.
|
|
36
36
|
- Lists have core's bar (`src/modules/items/ItemsPage.tsx`): erxes-ui's `ViewBar` with
|
|
37
|
-
`ListFilter`, given the list's fields
|
|
37
|
+
`ListFilter`, given the list's fields and, for `member` fields, `members={memberQueries}`
|
|
38
|
+
(a `tags` query for `tags` fields). It draws the bar itself, in erxes or on its own. Its conditions and search live in the
|
|
38
39
|
address; `useListFilterParams()` hands them to the list's query, and the API
|
|
39
40
|
applies them (`api/src/modules/items/itemFilter.ts`). No search boxes, toggle
|
|
40
41
|
tabs or pickers in a row above the table.
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"@orpc/tanstack-query": "1.16.2",
|
|
14
14
|
"@tabler/icons-react": "3.34.0",
|
|
15
15
|
"@tanstack/react-query": "^5.107.1",
|
|
16
|
-
"erxes-ui": "npm:@erxes/ui@4.0.0-v2.
|
|
16
|
+
"erxes-ui": "npm:@erxes/ui@4.0.0-v2.9",
|
|
17
17
|
"jotai": "^3.0.2",
|
|
18
18
|
"nuqs": "^2.10.3",
|
|
19
19
|
"react": "19.3.1",
|