@xeplr/cli 0.3.10 → 0.3.12

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.
@@ -52,7 +52,7 @@ function flowsSubstitutions(answers) {
52
52
  __WF_CLAUDE__: [
53
53
  '**Flows** — forms one after another, run by `@xeplr/workflow-api` INSIDE this API (bin/www starts it, workflow.js) in a database of its own (`DB_WORKFLOW`). Design them in Configure UI → Flows, never in code: a flow is data, reached through `/api/workflow/flows`, and walked at `/journey/<key>`. After a step, a flow goes to a screen, lets one of the app\'s `decide` functions choose, or finishes. Workflow follows this app\'s tenancy — it never creates companies or workspaces of its own.',
54
54
  '',
55
- '**Functions** — the code around a form\'s records lives in `api/functions/`, registered with `@xeplr/actions` under the event it is for, and is picked BY NAME: the screen\'s own events (`beforeLoad`, `beforeSave`, `afterSave`, `beforeDelete`, `onError`) in its `events` or Configure UI → Flows → Events; a flow step\'s `decide`; and its controls\' — `button` (a button\'s `action`), `buttonOptions` (a popup checklist\'s `optionsFrom`), `listRows` (a list\'s `rowsFrom`), `rowDetails` (a column\'s `details`), `recordDetails` (`detailsFrom`), `feedEntries` (`entriesFrom`), `suggest` (`suggestFrom`). There are no SERVER hook files — the browser\'s front-end hooks are the page\'s (`Edit<Form>.jsx`). A screen naming a function nobody registered is refused at publish. The full table, with what each gets and returns and where the designer picks it, is in `BUILDING.md`.',
55
+ '**Functions** — the code around a form\'s records lives in `api/functions/`, registered with `@xeplr/actions` under the event it is for, and is picked BY NAME: the screen\'s own events (`beforeLoad`, `beforeSave`, `afterSave`, `beforeDelete`, `onError`) in its `events` or the form designer\'s **Server rules** (nothing selected); a flow step\'s `decide`; and its controls\' — `button` (a button\'s `action`), `buttonOptions` (a popup checklist\'s `optionsFrom`), `listRows` (a list\'s `rowsFrom`), `rowDetails` (a column\'s `details`), `recordDetails` (`detailsFrom`), `feedEntries` (`entriesFrom`), `suggest` (`suggestFrom`). There are no SERVER hook files — the browser\'s front-end hooks are the page\'s (`Edit<Form>.jsx`). A screen naming a function nobody registered is refused at publish. The full table, with what each gets and returns and where the designer picks it, is in `BUILDING.md`.',
56
56
  ''
57
57
  ].join('\n')
58
58
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xeplr/cli",
3
- "version": "0.3.10",
3
+ "version": "0.3.12",
4
4
  "description": "Creates a working xeplr application — API, sign-in and UI — from a few answers.",
5
5
  "license": "MIT",
6
6
  "author": "xeppie <admin@xeplr.com>",
@@ -145,11 +145,11 @@ shows on that field.
145
145
  | **What is known about a record** — its products, contact, delivery | `recordDetails` | a **Details** control (Data → Details) → **Details from** | `ctx.record`, `ctx.id`, `ctx.query.more` | `{ sections: [{ title, rows: [{ label, text }] }] }` |
146
146
  | **Comments and history** on a record | `feedEntries` | a **Comments & history** control → **Entries from** | `ctx.record`, `ctx.id` | `[{ id, kind: 'comment' \| 'event', text, author?, at? }]` |
147
147
  | **Suggestions as someone types** — a product from the shop | `suggest` | an **Autocomplete** field → **Suggestions from** | `ctx.query.q` | `[{ value, label?, sub?, fill? }]` |
148
- | **A rule on save** — must / only if / check against, or work a value out | `beforeSave` | Configure UI → Flows → a flow with the form → its step → **Events & navigation** — saved to the form itself, so it runs everywhere | `ctx.values`, `ctx.isNew`, `ctx.previous` | the values to save; or `ctx.reject(…)` |
149
- | **Something after a save** — an email, another record | `afterSave` | the same place | `ctx.result` (the saved row), `ctx.isNew` | — |
150
- | **Only some rows** — a person sees their own | `beforeLoad` | the same place | `ctx.query` (narrow it) | — |
151
- | **A check before delete** | `beforeDelete` | the same place | `ctx.previous` | — (or `ctx.reject`) |
152
- | **When load / save / delete failed** | `onError` | the same place | `ctx.error` | — |
148
+ | **A rule on save** — must / only if / check against, or work a value out | `beforeSave` | the form's designer, nothing selected → **Server rules** → **Before save** — it runs wherever the form is used | `ctx.values`, `ctx.isNew`, `ctx.previous` | the values to save; or `ctx.reject(…)` |
149
+ | **Something after a save** — an email, another record | `afterSave` | Server rules → **After save** | `ctx.result` (the saved row), `ctx.isNew` | — |
150
+ | **Only some rows** — a person sees their own | `beforeLoad` | Server rules → **Before load** | `ctx.query` (narrow it) | — |
151
+ | **A check before delete** | `beforeDelete` | Server rules → **Before delete** | `ctx.previous` | — (or `ctx.reject`) |
152
+ | **When load / save / delete failed** | `onError` | Server rules → **On error** | `ctx.error` | — |
153
153
  | **Where a flow goes next** | `decide` | Configure UI → Flows → a step → **Let a function decide** | `ctx.values`, `ctx.targets` | one of `ctx.targets` |
154
154
 
155
155
  Every `ctx` also has `user`, `access` (`{ roles }`), `tenant`, `knex` (the
@@ -44,7 +44,7 @@ Then change only what the request asks for:
44
44
  | suggestions as someone types | an `autocomplete` field whose `suggestFrom` names a `suggest` function |
45
45
  | a checklist inside a button's popup | an `ask.fields` entry of `type: "checklist"` whose `optionsFrom` names a `buttonOptions` function |
46
46
  | hide / filter rows on screen, fill in a value before saving, check something before Next moves on | front-end hooks — `ui/src/pages/Edit<Form>.jsx` (`get`, `save`, `delete`, `step`). Browser only: say so if it matters on a phone |
47
- | must / only if / check against / email when / only managers see | a server function — registered in `api/screens/<form>/<form>.functions.js` with its `event`, then named in `<form>-edit.screen.json`'s `events` (or picked in Configure UI → Flows → Events). Register before naming: a screen naming an unregistered function is refused at publish |
47
+ | must / only if / check against / email when / only managers see | a server function — registered in `api/screens/<form>/<form>.functions.js` with its `event`, then named in `<form>-edit.screen.json`'s `events` (or picked in the form designer → Server rules). Register before naming: a screen naming an unregistered function is refused at publish |
48
48
  | store as / convert / comma-separated ↔ array / work out X from Y | server model — `api/screens/<form>/<form>.model.js` |
49
49
  | a query in your own server code | `factory.table('<forms table>')` — this company, active rows, the model applied |
50
50
 
@@ -8,8 +8,9 @@
8
8
  // description and what the event hands it — the code stays here, and runs on
9
9
  // the server. BUILDING.md, at the project's root, has a recipe for each.
10
10
  //
11
- // The screen's own events — picked in Configure UI → Flows → a step → Events
12
- // & navigation (or a screen's `events` in its .screen.json):
11
+ // The screen's own events — picked in the form's designer, nothing selected →
12
+ // Server rules (or in a flow step's Events & navigation, or a screen's `events`
13
+ // in its .screen.json):
13
14
  //
14
15
  // event runs ctx adds return
15
16
  // beforeLoad before records are read query (narrow it) nothing, or a new query
@@ -21,7 +21,7 @@
21
21
  "@xeplr/base-apis": "^3.0.4",
22
22
  "@xeplr/db": "^1.1.0",
23
23
  "@xeplr/factory": "^3.0.3",
24
- "@xeplr/ui-factory": "^1.8.9",
24
+ "@xeplr/ui-factory": "^1.18.0",
25
25
  "@xeplr/utils": "^1.1.0",
26
26
  "dotenv": "^17.4.2",
27
27
  "express": "^5.2.0",
@@ -14,7 +14,7 @@
14
14
  "@tanstack/react-table": "^8.21.3",
15
15
  "@xeplr/ui-account": "^1.5.2",
16
16
  "@xeplr/ui-canvas": "^1.1.3",
17
- "@xeplr/ui-factory": "^1.8.9",
17
+ "@xeplr/ui-factory": "^1.18.0",
18
18
  "@xeplr/ui-table": "^1.1.3",
19
19
  "react": "^19.2.4",
20
20
  "react-dom": "^19.2.4",
@@ -178,6 +178,7 @@ body { margin: 0; }
178
178
  cursor: pointer;
179
179
  }
180
180
  .app-btn:disabled { opacity: 0.55; cursor: default; }
181
+ a.app-btn { display: inline-block; text-decoration: none; line-height: normal; }
181
182
  .app-btn-quiet {
182
183
  background: transparent;
183
184
  border-color: var(--xeplr-border-primary);
@@ -301,7 +302,8 @@ body { margin: 0; }
301
302
  .app-forms-field { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 220px; font-size: 12px; color: var(--xeplr-text-muted); }
302
303
 
303
304
  .app-menu-label,
304
- .app-forms-new input {
305
+ .app-forms-new input,
306
+ .app-forms-new select {
305
307
  flex: 1;
306
308
  padding: 9px 11px;
307
309
  border-radius: 6px;
@@ -402,7 +404,7 @@ body { margin: 0; }
402
404
  .app-field-row { flex-direction: column; gap: 0; }
403
405
  .app-field input, .app-field textarea, .app-field select { font-size: 16px; min-height: 44px; }
404
406
  .app-forms-field { min-width: 0; flex-basis: 100%; }
405
- .app-menu-label, .app-forms-new input { font-size: 16px; min-height: 44px; box-sizing: border-box; }
407
+ .app-menu-label, .app-forms-new input, .app-forms-new select { font-size: 16px; min-height: 44px; box-sizing: border-box; }
406
408
  .app-btn { min-height: 44px; }
407
409
  .app-row-actions .app-btn { min-height: 40px; padding: 8px 12px; }
408
410
 
@@ -101,8 +101,8 @@ export default function Masters() {
101
101
  <td className="app-row-actions">
102
102
  {/* Its records: the list screen is what looking at a master
103
103
  means. Its design is where the flag was set. */}
104
- <Link to={`/forms/${m.key}`}>Open</Link>
105
- <Link to={`/configure/forms/${m.key}/design/form`}>Design</Link>
104
+ <Link className="app-btn app-btn-quiet" to={`/forms/${m.key}`}>Open</Link>
105
+ <Link className="app-btn app-btn-quiet" to={`/configure/forms/${m.key}/design/form`}>Design</Link>
106
106
  </td>
107
107
  </tr>
108
108
  ))}