hazo_ihelp 2.1.0 → 2.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/README.md CHANGED
@@ -14,10 +14,19 @@ npm install hazo_ihelp
14
14
  |---------|----------|-------|
15
15
  | `react` | ^18 or ^19 | Required |
16
16
  | `react-dom` | ^18 or ^19 | Required |
17
- | `tailwindcss` | >=3.0.0 | Required for styling |
17
+ | `tailwindcss` | ^4.2.4 | Required for styling |
18
18
  | `@tailwindcss/typography` | >=0.5.0 | Required — `prose` classes for rich content rendering |
19
- | `next` | >=14.0.0 | Optional — needed for API handlers |
20
- | `hazo_connect` | >=2.4.0 | Optional — needed for API handlers |
19
+ | `hazo_core` | ^1.0.0 | Required — error classes, correlation IDs, config/logger |
20
+ | `hazo_ui` | ^3.1.3 | Required — shared UI primitives + `cn()` |
21
+ | `next` | ^14 or ^16 | Optional — needed for API handlers |
22
+ | `hazo_connect` | ^3.0.0 | Optional — needed for API handlers |
23
+ | `hazo_config` | ^2.1.6 | Optional — INI config loading |
24
+ | `hazo_logs` | ^2.0.2 | Optional — structured logging |
25
+ | `hazo_auth` | ^10.0.0 | Optional — multi-tenant scoping |
26
+ | `hazo_chat` | ^6.0.0 | Optional |
27
+ | `hazo_files` | ^3.0.0 | Optional — image upload handling |
28
+ | `hazo_llm_api` | ^2.0.0 | Optional |
29
+ | `hazo_notes` | ^2.0.0 | Optional |
21
30
 
22
31
  ## Tailwind v4 Setup (Required)
23
32
 
@@ -60,15 +69,14 @@ Tailwind v4 auto-detects installed plugins. For Tailwind v3, add it to your `tai
60
69
  Execute the SQL migration to create the required tables:
61
70
 
62
71
  ```bash
63
- # The migration file is included in the package
64
- cat node_modules/hazo_ihelp/migrations/001_create_ihelp_tables.sql
72
+ # The schema setup files are included in the package
73
+ cat node_modules/hazo_ihelp/db_setup_postgres.sql # PostgreSQL
74
+ cat node_modules/hazo_ihelp/db_setup_sqlite.sql # SQLite
65
75
  ```
66
76
 
67
- This creates two tables:
68
- - `hazo_ihelp_topics` — help topics with tags and context mappings stored as JSON columns
69
- - `hazo_config` — key-value configuration store (scoped)
77
+ This creates the `hazo_ihelp_topics` table — help topics with tags and context mappings stored as JSON columns. (The shared `hazo_config` table is owned by `hazo_config` and is not created here.)
70
78
 
71
- The migration file documents both **SQLite** and **PostgreSQL** variants:
79
+ The setup files document both **SQLite** and **PostgreSQL** variants:
72
80
 
73
81
  | Column | SQLite | PostgreSQL |
74
82
  |--------|--------|------------|
@@ -171,6 +179,24 @@ Context provider that supplies topics, search, and keyboard shortcuts to all chi
171
179
  </IhelpProvider>
172
180
  ```
173
181
 
182
+ ### IhelpFieldHelp
183
+
184
+ Inline help icon designed for use inside form field labels. Thin wrapper over `HoverHelpIcon` with defaults tuned for the field-label context: smaller icon (13 px), `aria_label` auto-derived from `title`.
185
+
186
+ ```tsx
187
+ import { IhelpFieldHelp } from 'hazo_ihelp';
188
+
189
+ <label className="flex items-center gap-1">
190
+ Tax File Number
191
+ <IhelpFieldHelp
192
+ title="Tax File Number"
193
+ body="Your 9-digit TFN issued by the ATO."
194
+ />
195
+ </label>
196
+ ```
197
+
198
+ Props: `title` (string), `body` (string or ReactNode), `size` (default 13), `side` (`"top"` | `"right"` | `"bottom"` | `"left"`, default `"top"`), `className`.
199
+
174
200
  ### IhelpIcon
175
201
 
176
202
  Small trigger button that opens the Help dialog for a specific context key.
@@ -208,7 +234,7 @@ Full CRUD editor for managing help topics (tags and context mappings are embedde
208
234
 
209
235
  | Import path | Contents |
210
236
  |-------------|----------|
211
- | `hazo_ihelp` | Client components: `IhelpProvider`, `IhelpIcon`, `IhelpSearchDialog`, `IhelpDetailPanel` |
237
+ | `hazo_ihelp` | Client components: `IhelpProvider`, `IhelpIcon`, `IhelpFieldHelp`, `IhelpSearchDialog`, `IhelpDetailPanel` |
212
238
  | `hazo_ihelp/api` | Server handlers: `createIhelpHandler`, `createImageUploadHandler`, `createConfigHandler` |
213
239
  | `hazo_ihelp/hooks` | Hooks: `use_ihelp`, `use_ihelp_search`, `use_ihelp_editor`, `use_ihelp_config` |
214
240
  | `hazo_ihelp/components` | All components including `IhelpEditor` and UI primitives |
@@ -0,0 +1,27 @@
1
+ import { type ReactNode } from "react";
2
+ export interface IhelpFieldHelpProps {
3
+ /** Field name/label — used as the hover card title. */
4
+ title: string;
5
+ /** Help body. String (multi-line supported) or ReactNode for rich content. */
6
+ body: ReactNode;
7
+ /** Icon size in px. Default 13. */
8
+ size?: number;
9
+ /** Hover card side. Default "top". */
10
+ side?: "top" | "right" | "bottom" | "left";
11
+ /** Extra className for the trigger button. */
12
+ className?: string;
13
+ }
14
+ /**
15
+ * Inline help icon for form field labels.
16
+ *
17
+ * Thin wrapper over HoverHelpIcon with defaults tuned for the field-label
18
+ * context: smaller icon, aria_label auto-derived from title.
19
+ *
20
+ * @example
21
+ * <label className="flex items-center gap-1">
22
+ * Tax File Number
23
+ * <IhelpFieldHelp title="Tax File Number" body="Your 9-digit TFN issued by the ATO." />
24
+ * </label>
25
+ */
26
+ export declare function IhelpFieldHelp({ title, body, size, side, className, }: IhelpFieldHelpProps): import("react/jsx-runtime").JSX.Element;
27
+ //# sourceMappingURL=ihelp_field_help.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ihelp_field_help.d.ts","sourceRoot":"","sources":["../../src/components/ihelp_field_help.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG9C,MAAM,WAAW,mBAAmB;IAClC,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC;IACd,8EAA8E;IAC9E,IAAI,EAAE,SAAS,CAAC;IAChB,mCAAmC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sCAAsC;IACtC,IAAI,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC3C,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,IAAI,EACJ,IAAS,EACT,IAAY,EACZ,SAAS,GACV,EAAE,mBAAmB,2CAWrB"}
@@ -0,0 +1,19 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { HoverHelpIcon } from "./hover_help_icon.js";
4
+ /**
5
+ * Inline help icon for form field labels.
6
+ *
7
+ * Thin wrapper over HoverHelpIcon with defaults tuned for the field-label
8
+ * context: smaller icon, aria_label auto-derived from title.
9
+ *
10
+ * @example
11
+ * <label className="flex items-center gap-1">
12
+ * Tax File Number
13
+ * <IhelpFieldHelp title="Tax File Number" body="Your 9-digit TFN issued by the ATO." />
14
+ * </label>
15
+ */
16
+ export function IhelpFieldHelp({ title, body, size = 13, side = "top", className, }) {
17
+ return (_jsx(HoverHelpIcon, { title: title, body: body, aria_label: `Help for ${title}`, size: size, side: side, className: className }));
18
+ }
19
+ //# sourceMappingURL=ihelp_field_help.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ihelp_field_help.js","sourceRoot":"","sources":["../../src/components/ihelp_field_help.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAerD;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,cAAc,CAAC,EAC7B,KAAK,EACL,IAAI,EACJ,IAAI,GAAG,EAAE,EACT,IAAI,GAAG,KAAK,EACZ,SAAS,GACW;IACpB,OAAO,CACL,KAAC,aAAa,IACZ,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,YAAY,KAAK,EAAE,EAC/B,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,GACpB,CACH,CAAC;AACJ,CAAC"}
@@ -5,4 +5,5 @@ export { IhelpDetailPanel } from './ihelp_detail_panel.js';
5
5
  export { IhelpSearchDialog } from './ihelp_search_dialog.js';
6
6
  export { IhelpRichEditor } from './ihelp_rich_editor.js';
7
7
  export { IhelpEditor } from './ihelp_editor.js';
8
+ export { IhelpFieldHelp, type IhelpFieldHelpProps } from './ihelp_field_help.js';
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -5,4 +5,5 @@ export { IhelpDetailPanel } from './ihelp_detail_panel.js';
5
5
  export { IhelpSearchDialog } from './ihelp_search_dialog.js';
6
6
  export { IhelpRichEditor } from './ihelp_rich_editor.js';
7
7
  export { IhelpEditor } from './ihelp_editor.js';
8
+ export { IhelpFieldHelp } from './ihelp_field_help.js';
8
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAA2B,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAA2B,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,cAAc,EAA4B,MAAM,uBAAuB,CAAC"}
@@ -19,20 +19,10 @@ declare const schema: z.ZodNullable<z.ZodObject<{
19
19
  general: z.ZodOptional<z.ZodObject<{
20
20
  env: z.ZodOptional<z.ZodString>;
21
21
  api_base_url: z.ZodOptional<z.ZodString>;
22
- }, "strip", z.ZodTypeAny, {
23
- api_base_url?: string | undefined;
24
- env?: string | undefined;
25
- }, {
26
- api_base_url?: string | undefined;
27
- env?: string | undefined;
28
- }>>;
22
+ }, z.core.$strip>>;
29
23
  log: z.ZodOptional<z.ZodObject<{
30
24
  overrides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
31
- }, "strip", z.ZodTypeAny, {
32
- overrides?: Record<string, string> | undefined;
33
- }, {
34
- overrides?: Record<string, string> | undefined;
35
- }>>;
25
+ }, z.core.$strip>>;
36
26
  image_upload: z.ZodOptional<z.ZodObject<{
37
27
  max_file_size_mb: z.ZodOptional<z.ZodString>;
38
28
  allowed_types: z.ZodOptional<z.ZodString>;
@@ -42,62 +32,8 @@ declare const schema: z.ZodNullable<z.ZodObject<{
42
32
  resize_max_width: z.ZodOptional<z.ZodString>;
43
33
  resize_max_height: z.ZodOptional<z.ZodString>;
44
34
  resize_quality: z.ZodOptional<z.ZodString>;
45
- }, "strip", z.ZodTypeAny, {
46
- max_file_size_mb?: string | undefined;
47
- allowed_types?: string | undefined;
48
- upload_dir?: string | undefined;
49
- upload_url_prefix?: string | undefined;
50
- resize_enabled?: string | undefined;
51
- resize_max_width?: string | undefined;
52
- resize_max_height?: string | undefined;
53
- resize_quality?: string | undefined;
54
- }, {
55
- max_file_size_mb?: string | undefined;
56
- allowed_types?: string | undefined;
57
- upload_dir?: string | undefined;
58
- upload_url_prefix?: string | undefined;
59
- resize_enabled?: string | undefined;
60
- resize_max_width?: string | undefined;
61
- resize_max_height?: string | undefined;
62
- resize_quality?: string | undefined;
63
- }>>;
64
- }, "strip", z.ZodTypeAny, {
65
- log?: {
66
- overrides?: Record<string, string> | undefined;
67
- } | undefined;
68
- image_upload?: {
69
- max_file_size_mb?: string | undefined;
70
- allowed_types?: string | undefined;
71
- upload_dir?: string | undefined;
72
- upload_url_prefix?: string | undefined;
73
- resize_enabled?: string | undefined;
74
- resize_max_width?: string | undefined;
75
- resize_max_height?: string | undefined;
76
- resize_quality?: string | undefined;
77
- } | undefined;
78
- general?: {
79
- api_base_url?: string | undefined;
80
- env?: string | undefined;
81
- } | undefined;
82
- }, {
83
- log?: {
84
- overrides?: Record<string, string> | undefined;
85
- } | undefined;
86
- image_upload?: {
87
- max_file_size_mb?: string | undefined;
88
- allowed_types?: string | undefined;
89
- upload_dir?: string | undefined;
90
- upload_url_prefix?: string | undefined;
91
- resize_enabled?: string | undefined;
92
- resize_max_width?: string | undefined;
93
- resize_max_height?: string | undefined;
94
- resize_quality?: string | undefined;
95
- } | undefined;
96
- general?: {
97
- api_base_url?: string | undefined;
98
- env?: string | undefined;
99
- } | undefined;
100
- }>>;
35
+ }, z.core.$strip>>;
36
+ }, z.core.$strip>>;
101
37
  export type IhelpStandardConfig = NonNullable<z.infer<typeof schema>>;
102
38
  export declare function getIhelpConfig(): IhelpStandardConfig;
103
39
  /** Reset the in-memory cache. Mainly for tests. */
@@ -1 +1 @@
1
- {"version":3,"file":"hazo_ihelp_config.d.ts","sourceRoot":"","sources":["../../../src/lib/config/hazo_ihelp_config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BC,CAAC;AAEd,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,CAAC,CAAC;AAItE,wBAAgB,cAAc,IAAI,mBAAmB,CAYpD;AAED,mDAAmD;AACnD,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C"}
1
+ {"version":3,"file":"hazo_ihelp_config.d.ts","sourceRoot":"","sources":["../../../src/lib/config/hazo_ihelp_config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;kBA0BC,CAAC;AAEd,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,CAAC,CAAC;AAItE,wBAAgB,cAAc,IAAI,mBAAmB,CAYpD;AAED,mDAAmD;AACnD,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hazo_ihelp",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.client.js",
6
6
  "module": "./dist/index.client.js",
@@ -77,19 +77,19 @@
77
77
  "react-resizable-panels": "^4.7.6",
78
78
  "sonner": "^2.0.7",
79
79
  "tailwind-merge": "^3.5.0",
80
- "zod": "^3.23.8"
80
+ "zod": "^4.1.12"
81
81
  },
82
82
  "peerDependencies": {
83
- "hazo_auth": "^9.0.0",
83
+ "hazo_auth": "^10.2.0",
84
84
  "hazo_chat": "^6.0.0",
85
- "hazo_config": "^2.1.5",
86
- "hazo_connect": "^3.0.0",
87
- "hazo_core": "^1.0.0",
88
- "hazo_files": "^3.0.0",
89
- "hazo_llm_api": "^2.0.0",
90
- "hazo_logs": "^2.0.0",
85
+ "hazo_config": "^2.1.11",
86
+ "hazo_connect": "^3.7.0",
87
+ "hazo_core": "^1.2.0",
88
+ "hazo_files": "^3.1.0",
89
+ "hazo_llm_api": "^2.1.0",
90
+ "hazo_logs": "^2.0.3",
91
91
  "hazo_notes": "^2.0.0",
92
- "hazo_ui": "^3.1.0",
92
+ "hazo_ui": "^4.0.0",
93
93
  "next": "^14.0.0 || ^16.0.0",
94
94
  "react": "^18.0.0 || ^19.0.0",
95
95
  "react-dom": "^18.0.0 || ^19.0.0",
@@ -137,16 +137,16 @@
137
137
  "@types/node": "^20.14.10",
138
138
  "@types/react": "^18.3.3",
139
139
  "@types/react-dom": "^18.3.0",
140
- "hazo_auth": "^9.0.0",
140
+ "hazo_auth": "^10.2.2",
141
141
  "hazo_chat": "^6.0.0",
142
- "hazo_config": "^2.1.6",
143
- "hazo_connect": "^3.0.0",
144
- "hazo_core": "^1.0.0",
145
- "hazo_files": "^3.0.0",
146
- "hazo_llm_api": "^2.0.0",
147
- "hazo_logs": "^2.0.1",
142
+ "hazo_config": "^2.1.11",
143
+ "hazo_connect": "^3.7.0",
144
+ "hazo_core": "^1.2.0",
145
+ "hazo_files": "^3.1.0",
146
+ "hazo_llm_api": "^2.1.0",
147
+ "hazo_logs": "^2.0.3",
148
148
  "hazo_notes": "^2.0.0",
149
- "hazo_ui": "^3.1.0",
149
+ "hazo_ui": "^4.2.0",
150
150
  "next": "^16.0.10",
151
151
  "typescript": "^5.7.2"
152
152
  },