@mccaskie-labs/workbench-contacts 0.1.0 → 0.2.0
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/CHANGELOG.md +12 -0
- package/dist/cli.js +0 -0
- package/dist/styles.js +11 -11
- package/dist/ui.d.ts +4 -0
- package/dist/ui.js +2 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @mccaskie-labs/workbench-contacts
|
|
2
2
|
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Every tool follows the project's look (docs/theming.md step 2, Robert, 24 November 2026). Each tool's colour, font and corner variables now default to the shared theme tokens with a Clean, light fallback (`--wb-booking-accent: var(--wb-accent, #2563eb)`), and tool colours with no token of their own (a recessed panel, a status mark, a tinted pill) are worked out from the tokens with `color-mix()`. So a page drawn with these tools takes the look in the project's workbench.css: light (Clean) by default, or whatever brand.json and project.css say. Breaking for a project page that relied on the old dark defaults: give brand.json the look you want, or set the tokens in project.css. Variable and class names are unchanged, so existing project.css overrides still win. workbench-ui: `styleProblems` refuses a tool's text, muted, surface, line, background, accent, focus, danger, success, warning, font or radius variable whose default doesn't read its token (email, PDF and image follow in step 3); the `wb-ui` class no longer forces dark, and Workbench's own pages (`STYLE`, `UI_CSS`) keep their dark values; `shell` with `stylesheets` (a project page) no longer says dark in its meta tag.
|
|
8
|
+
|
|
9
|
+
## 0.1.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- The owner's action helper no longer puts the database's or the settings check's own words in the answer it hands back. For `store_failed` and `bad_config` the body's `message` is now a fixed line; the full error is on the result's new `cause`, for the app's own log. The status and `error` code are unchanged.
|
|
14
|
+
|
|
3
15
|
## 0.1.0
|
|
4
16
|
|
|
5
17
|
- First version: simple customer records in the app's own database. `record()` from forms, bookings, payments, quotes, reviews and WhatsApp or Messenger messages (no SMS), matched by email, then phone, then Messenger id; search, a spreadsheet export, a person's own copy, opt-outs that stick, delete on request and a daily clean-up; the owner's Customers list and customer page with `wb-contact-*` classes; words in English, Tagalog and Taglish; `npx workbench-contacts init | generate | migration`.
|
package/dist/cli.js
CHANGED
|
File without changes
|
package/dist/styles.js
CHANGED
|
@@ -17,17 +17,17 @@ export const CONTACT_STYLES = {
|
|
|
17
17
|
title: "Customer records",
|
|
18
18
|
prefix: "wb-contact-",
|
|
19
19
|
variables: [
|
|
20
|
-
{ name: "--wb-contact-text", value: "#
|
|
21
|
-
{ name: "--wb-contact-muted", value: "#
|
|
22
|
-
{ name: "--wb-contact-surface", value: "#
|
|
23
|
-
{ name: "--wb-contact-sunk", value: "#
|
|
24
|
-
{ name: "--wb-contact-line", value: "#
|
|
25
|
-
{ name: "--wb-contact-accent", value: "#
|
|
26
|
-
{ name: "--wb-contact-on-accent", value: "#ffffff", about: "Text on a main button" },
|
|
27
|
-
{ name: "--wb-contact-yes", value: "#
|
|
28
|
-
{ name: "--wb-contact-danger", value: "#
|
|
29
|
-
{ name: "--wb-contact-focus", value: "rgba(
|
|
30
|
-
{ name: "--wb-contact-radius", value: "8px", about: "Corner rounding" },
|
|
20
|
+
{ name: "--wb-contact-text", value: "var(--wb-text, #1f2937)", about: "Text: names, details, labels" },
|
|
21
|
+
{ name: "--wb-contact-muted", value: "var(--wb-muted, #5b6472)", about: "Quieter text: when last in touch, hints, the empty list" },
|
|
22
|
+
{ name: "--wb-contact-surface", value: "var(--wb-surface, #f7f8f8)", about: "Background of each customer and of the page's panels" },
|
|
23
|
+
{ name: "--wb-contact-sunk", value: "color-mix(in srgb, var(--wb-background, #ffffff), var(--wb-text, #1f2937) 3%)", about: "Background of the list and of inputs" },
|
|
24
|
+
{ name: "--wb-contact-line", value: "var(--wb-line, #d7d8db)", about: "Borders" },
|
|
25
|
+
{ name: "--wb-contact-accent", value: "var(--wb-accent, #2563eb)", about: "Main buttons and links: Find, Save" },
|
|
26
|
+
{ name: "--wb-contact-on-accent", value: "var(--wb-on-accent, #ffffff)", about: "Text on a main button" },
|
|
27
|
+
{ name: "--wb-contact-yes", value: "var(--wb-success, #15803d)", about: "The said-yes-to-news badge" },
|
|
28
|
+
{ name: "--wb-contact-danger", value: "var(--wb-danger, #b42318)", about: "Delete customer" },
|
|
29
|
+
{ name: "--wb-contact-focus", value: "var(--wb-focus, rgba(37,99,235,0.4))", about: "The ring round a control with focus" },
|
|
30
|
+
{ name: "--wb-contact-radius", value: "var(--wb-radius, 8px)", about: "Corner rounding" },
|
|
31
31
|
],
|
|
32
32
|
classes: [
|
|
33
33
|
{ name: "wb-contact-list", element: "section", about: "The whole customer list", css: `display:grid;gap:.75rem;color:${v("text")};background:${v("sunk")};padding:.75rem;border-radius:${v("radius")}` },
|
package/dist/ui.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Contacts } from "./contacts.ts";
|
|
2
|
+
import { ContactsError } from "./errors.ts";
|
|
2
3
|
import type { Contact, ContactDetail, Lang, SearchResult } from "./types.ts";
|
|
3
4
|
/** The project's strings lookup: `t('ui.wbcontact.save')`. Undefined falls back to the words of `lang`. */
|
|
4
5
|
export type Words = (key: string, params?: Readonly<Record<string, string | number>>) => string | undefined;
|
|
@@ -45,6 +46,7 @@ export declare function renderContactList(r: SearchResult, o: ListOptions): stri
|
|
|
45
46
|
export declare function renderContact(c: ContactDetail, o: ContactPageOptions): string;
|
|
46
47
|
export interface ActionResult {
|
|
47
48
|
status: number;
|
|
49
|
+
/** What to answer with, as JSON. It never holds the database's or the settings check's own words. */
|
|
48
50
|
body: {
|
|
49
51
|
ok: true;
|
|
50
52
|
action: "save" | "stop_marketing" | "forget";
|
|
@@ -54,6 +56,8 @@ export interface ActionResult {
|
|
|
54
56
|
error: string;
|
|
55
57
|
message: string;
|
|
56
58
|
};
|
|
59
|
+
/** The error behind a refusal, for the app's own log. Never send it: for store_failed and bad_config its message is the database's or the settings check's. */
|
|
60
|
+
cause?: ContactsError;
|
|
57
61
|
}
|
|
58
62
|
/**
|
|
59
63
|
* The project's endpoint (behind the owner's sign-in) hands the posted form
|
package/dist/ui.js
CHANGED
|
@@ -113,7 +113,8 @@ export async function contactAction(contacts, body, account) {
|
|
|
113
113
|
catch (e) {
|
|
114
114
|
if (e instanceof ContactsError) {
|
|
115
115
|
const status = e.code === "unknown_contact" ? 404 : e.code === "taken" ? 409 : e.code === "store_failed" ? 502 : e.code === "bad_config" ? 500 : 400;
|
|
116
|
-
|
|
116
|
+
const message = e.code === "store_failed" || e.code === "bad_config" ? "contacts: it failed on the app's side (the detail is in the result's cause, for the log)" : e.message;
|
|
117
|
+
return { status, body: { ok: false, error: e.code, message }, cause: e };
|
|
117
118
|
}
|
|
118
119
|
throw e;
|
|
119
120
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mccaskie-labs/workbench-contacts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Simple customer records for Workbench apps: one list of the people a business deals with, kept in the app's own database and filled from its forms, bookings, payments, quotes, reviews and WhatsApp and Messenger messages, with search, a spreadsheet export, a person's own copy on request, opt-outs that stick, and a clean-up of people who haven't been back.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|