create-erxes 0.1.6 → 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.6";
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 = [
@@ -101,12 +101,41 @@ gives it its fields, and `api/src/modules/items/itemFilter.ts` applies them.
101
101
  under that field. Call `onCreated(id)` after Save, and the record takes the
102
102
  draft's place.
103
103
  - A form gets its own page only when it has several sections or a live
104
- preview (a product editor, a page builder). That page keeps the same
105
- header and breadcrumb, puts sections in one column of the same rows, and
106
- has Save in `PageHeader.End`.
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`.
107
112
  - `Dialog` is for confirming (`useConfirm`) and nothing else. Never a form in
108
113
  a dialog.
109
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
+
110
139
  ## Record detail
111
140
 
112
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. Its conditions and search live in the
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.8",
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",
@@ -129,6 +129,7 @@ export const ItemsPage = () => {
129
129
  <ListFilter
130
130
  id="__id__-items"
131
131
  fields={fields}
132
+ members={memberQueries}
132
133
  totalCount={isPending ? undefined : list.length}
133
134
  totalCapped={hasNextPage}
134
135
  />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-erxes",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "private": false,
5
5
  "description": "Create an erxes plugin for the new core, or migrate an old erxes plugin onto it: pnpm create erxes",
6
6
  "license": "MIT",