@hanzo/ui 8.0.23 → 8.0.25

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.
Files changed (60) hide show
  1. package/README.md +59 -0
  2. package/dist/chunk-3NG33DV2.cjs +607 -0
  3. package/dist/chunk-3NG33DV2.cjs.map +1 -0
  4. package/dist/chunk-5CZOYONP.js +343 -0
  5. package/dist/chunk-5CZOYONP.js.map +1 -0
  6. package/dist/{chunk-P2P6ST6J.js → chunk-7ZNK6JSS.js} +9 -394
  7. package/dist/chunk-7ZNK6JSS.js.map +1 -0
  8. package/dist/chunk-GVCOAJLO.js +397 -0
  9. package/dist/chunk-GVCOAJLO.js.map +1 -0
  10. package/dist/chunk-GWNNLYX4.cjs +353 -0
  11. package/dist/chunk-GWNNLYX4.cjs.map +1 -0
  12. package/dist/{chunk-NBZDIMP3.cjs → chunk-ONVERVFG.cjs} +33 -438
  13. package/dist/chunk-ONVERVFG.cjs.map +1 -0
  14. package/dist/chunk-P2QU5MN5.js +555 -0
  15. package/dist/chunk-P2QU5MN5.js.map +1 -0
  16. package/dist/chunk-WHJR5S4L.cjs +418 -0
  17. package/dist/chunk-WHJR5S4L.cjs.map +1 -0
  18. package/dist/framework/CollectionBuilder.d.ts +12 -0
  19. package/dist/framework/CollectionsBrowser.d.ts +26 -19
  20. package/dist/framework/DocTypeRecords.d.ts +31 -11
  21. package/dist/framework/MediaGrid.d.ts +42 -0
  22. package/dist/framework/RecordCards.d.ts +35 -0
  23. package/dist/framework/builder-logic.d.ts +76 -0
  24. package/dist/framework/client.d.ts +31 -44
  25. package/dist/framework/core.cjs +213 -0
  26. package/dist/framework/core.cjs.map +1 -0
  27. package/dist/framework/core.d.ts +6 -0
  28. package/dist/framework/core.js +4 -0
  29. package/dist/framework/core.js.map +1 -0
  30. package/dist/framework/data.d.ts +2 -2
  31. package/dist/framework/fields.d.ts +47 -4
  32. package/dist/framework/index.cjs +1340 -0
  33. package/dist/framework/index.cjs.map +1 -0
  34. package/dist/framework/index.d.ts +9 -23
  35. package/dist/framework/index.js +1119 -0
  36. package/dist/framework/index.js.map +1 -0
  37. package/dist/framework/media.d.ts +53 -0
  38. package/dist/framework/parts.d.ts +74 -0
  39. package/dist/framework/responsive.d.ts +41 -0
  40. package/dist/framework/types.d.ts +13 -7
  41. package/dist/product/SelectMenu.d.ts +13 -1
  42. package/dist/product/index.cjs +2061 -336
  43. package/dist/product/index.cjs.map +1 -1
  44. package/dist/product/index.js +1909 -3
  45. package/dist/product/index.js.map +1 -1
  46. package/dist/product/social/index.cjs +17 -16
  47. package/dist/product/social/index.js +3 -2
  48. package/package.json +11 -5
  49. package/dist/chunk-2BM42AZR.cjs +0 -2301
  50. package/dist/chunk-2BM42AZR.cjs.map +0 -1
  51. package/dist/chunk-7P7R7FC5.js +0 -2231
  52. package/dist/chunk-7P7R7FC5.js.map +0 -1
  53. package/dist/chunk-NBZDIMP3.cjs.map +0 -1
  54. package/dist/chunk-P2P6ST6J.js.map +0 -1
  55. package/dist/framework/Loader.d.ts +0 -4
  56. package/dist/framework.cjs +0 -757
  57. package/dist/framework.cjs.map +0 -1
  58. package/dist/framework.d.ts +0 -1
  59. package/dist/framework.js +0 -727
  60. package/dist/framework.js.map +0 -1
@@ -0,0 +1,213 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ var chunk3NG33DV2_cjs = require('../chunk-3NG33DV2.cjs');
5
+
6
+
7
+
8
+ Object.defineProperty(exports, "BUILDER_FIELD_TYPES", {
9
+ enumerable: true,
10
+ get: function () { return chunk3NG33DV2_cjs.BUILDER_FIELD_TYPES; }
11
+ });
12
+ Object.defineProperty(exports, "CANCELLED", {
13
+ enumerable: true,
14
+ get: function () { return chunk3NG33DV2_cjs.CANCELLED; }
15
+ });
16
+ Object.defineProperty(exports, "DRAFT", {
17
+ enumerable: true,
18
+ get: function () { return chunk3NG33DV2_cjs.DRAFT; }
19
+ });
20
+ Object.defineProperty(exports, "PROJECT_FIELD", {
21
+ enumerable: true,
22
+ get: function () { return chunk3NG33DV2_cjs.PROJECT_FIELD; }
23
+ });
24
+ Object.defineProperty(exports, "REDACTED_MARKER", {
25
+ enumerable: true,
26
+ get: function () { return chunk3NG33DV2_cjs.REDACTED_MARKER; }
27
+ });
28
+ Object.defineProperty(exports, "SUBMITTED", {
29
+ enumerable: true,
30
+ get: function () { return chunk3NG33DV2_cjs.SUBMITTED; }
31
+ });
32
+ Object.defineProperty(exports, "autonameSource", {
33
+ enumerable: true,
34
+ get: function () { return chunk3NG33DV2_cjs.autonameSource; }
35
+ });
36
+ Object.defineProperty(exports, "blankField", {
37
+ enumerable: true,
38
+ get: function () { return chunk3NG33DV2_cjs.blankField; }
39
+ });
40
+ Object.defineProperty(exports, "cardFields", {
41
+ enumerable: true,
42
+ get: function () { return chunk3NG33DV2_cjs.cardFields; }
43
+ });
44
+ Object.defineProperty(exports, "createFrameworkClient", {
45
+ enumerable: true,
46
+ get: function () { return chunk3NG33DV2_cjs.createFrameworkClient; }
47
+ });
48
+ Object.defineProperty(exports, "createMediaUploader", {
49
+ enumerable: true,
50
+ get: function () { return chunk3NG33DV2_cjs.createMediaUploader; }
51
+ });
52
+ Object.defineProperty(exports, "docTypeToFields", {
53
+ enumerable: true,
54
+ get: function () { return chunk3NG33DV2_cjs.docTypeToFields; }
55
+ });
56
+ Object.defineProperty(exports, "enrichLinks", {
57
+ enumerable: true,
58
+ get: function () { return chunk3NG33DV2_cjs.enrichLinks; }
59
+ });
60
+ Object.defineProperty(exports, "fieldNameFromLabel", {
61
+ enumerable: true,
62
+ get: function () { return chunk3NG33DV2_cjs.fieldNameFromLabel; }
63
+ });
64
+ Object.defineProperty(exports, "fieldNeedsOptions", {
65
+ enumerable: true,
66
+ get: function () { return chunk3NG33DV2_cjs.fieldNeedsOptions; }
67
+ });
68
+ Object.defineProperty(exports, "fieldTypeLabel", {
69
+ enumerable: true,
70
+ get: function () { return chunk3NG33DV2_cjs.fieldTypeLabel; }
71
+ });
72
+ Object.defineProperty(exports, "fieldsFromDocType", {
73
+ enumerable: true,
74
+ get: function () { return chunk3NG33DV2_cjs.fieldsFromDocType; }
75
+ });
76
+ Object.defineProperty(exports, "hasProjectField", {
77
+ enumerable: true,
78
+ get: function () { return chunk3NG33DV2_cjs.hasProjectField; }
79
+ });
80
+ Object.defineProperty(exports, "humanize", {
81
+ enumerable: true,
82
+ get: function () { return chunk3NG33DV2_cjs.humanize; }
83
+ });
84
+ Object.defineProperty(exports, "imageDimensions", {
85
+ enumerable: true,
86
+ get: function () { return chunk3NG33DV2_cjs.imageDimensions; }
87
+ });
88
+ Object.defineProperty(exports, "isDraft", {
89
+ enumerable: true,
90
+ get: function () { return chunk3NG33DV2_cjs.isDraft; }
91
+ });
92
+ Object.defineProperty(exports, "isMediaDoctype", {
93
+ enumerable: true,
94
+ get: function () { return chunk3NG33DV2_cjs.isMediaDoctype; }
95
+ });
96
+ Object.defineProperty(exports, "isRef", {
97
+ enumerable: true,
98
+ get: function () { return chunk3NG33DV2_cjs.isRef; }
99
+ });
100
+ Object.defineProperty(exports, "isValidDoctypeName", {
101
+ enumerable: true,
102
+ get: function () { return chunk3NG33DV2_cjs.isValidDoctypeName; }
103
+ });
104
+ Object.defineProperty(exports, "joinKey", {
105
+ enumerable: true,
106
+ get: function () { return chunk3NG33DV2_cjs.joinKey; }
107
+ });
108
+ Object.defineProperty(exports, "linkFields", {
109
+ enumerable: true,
110
+ get: function () { return chunk3NG33DV2_cjs.linkFields; }
111
+ });
112
+ Object.defineProperty(exports, "listHiddenFields", {
113
+ enumerable: true,
114
+ get: function () { return chunk3NG33DV2_cjs.listHiddenFields; }
115
+ });
116
+ Object.defineProperty(exports, "listQuery", {
117
+ enumerable: true,
118
+ get: function () { return chunk3NG33DV2_cjs.listQuery; }
119
+ });
120
+ Object.defineProperty(exports, "listedFieldNames", {
121
+ enumerable: true,
122
+ get: function () { return chunk3NG33DV2_cjs.listedFieldNames; }
123
+ });
124
+ Object.defineProperty(exports, "loadLinkOptions", {
125
+ enumerable: true,
126
+ get: function () { return chunk3NG33DV2_cjs.loadLinkOptions; }
127
+ });
128
+ Object.defineProperty(exports, "looksLikeImage", {
129
+ enumerable: true,
130
+ get: function () { return chunk3NG33DV2_cjs.looksLikeImage; }
131
+ });
132
+ Object.defineProperty(exports, "makeFieldOptions", {
133
+ enumerable: true,
134
+ get: function () { return chunk3NG33DV2_cjs.makeFieldOptions; }
135
+ });
136
+ Object.defineProperty(exports, "mediaDocPayload", {
137
+ enumerable: true,
138
+ get: function () { return chunk3NG33DV2_cjs.mediaDocPayload; }
139
+ });
140
+ Object.defineProperty(exports, "mediaFileField", {
141
+ enumerable: true,
142
+ get: function () { return chunk3NG33DV2_cjs.mediaFileField; }
143
+ });
144
+ Object.defineProperty(exports, "mediaKey", {
145
+ enumerable: true,
146
+ get: function () { return chunk3NG33DV2_cjs.mediaKey; }
147
+ });
148
+ Object.defineProperty(exports, "mediaRef", {
149
+ enumerable: true,
150
+ get: function () { return chunk3NG33DV2_cjs.mediaRef; }
151
+ });
152
+ Object.defineProperty(exports, "moduleDoctypes", {
153
+ enumerable: true,
154
+ get: function () { return chunk3NG33DV2_cjs.moduleDoctypes; }
155
+ });
156
+ Object.defineProperty(exports, "moveField", {
157
+ enumerable: true,
158
+ get: function () { return chunk3NG33DV2_cjs.moveField; }
159
+ });
160
+ Object.defineProperty(exports, "newDraft", {
161
+ enumerable: true,
162
+ get: function () { return chunk3NG33DV2_cjs.newDraft; }
163
+ });
164
+ Object.defineProperty(exports, "newKey", {
165
+ enumerable: true,
166
+ get: function () { return chunk3NG33DV2_cjs.newKey; }
167
+ });
168
+ Object.defineProperty(exports, "parseRef", {
169
+ enumerable: true,
170
+ get: function () { return chunk3NG33DV2_cjs.parseRef; }
171
+ });
172
+ Object.defineProperty(exports, "rows", {
173
+ enumerable: true,
174
+ get: function () { return chunk3NG33DV2_cjs.rows; }
175
+ });
176
+ Object.defineProperty(exports, "savePayload", {
177
+ enumerable: true,
178
+ get: function () { return chunk3NG33DV2_cjs.savePayload; }
179
+ });
180
+ Object.defineProperty(exports, "slugify", {
181
+ enumerable: true,
182
+ get: function () { return chunk3NG33DV2_cjs.slugify; }
183
+ });
184
+ Object.defineProperty(exports, "starterFields", {
185
+ enumerable: true,
186
+ get: function () { return chunk3NG33DV2_cjs.starterFields; }
187
+ });
188
+ Object.defineProperty(exports, "statusField", {
189
+ enumerable: true,
190
+ get: function () { return chunk3NG33DV2_cjs.statusField; }
191
+ });
192
+ Object.defineProperty(exports, "titleOf", {
193
+ enumerable: true,
194
+ get: function () { return chunk3NG33DV2_cjs.titleOf; }
195
+ });
196
+ Object.defineProperty(exports, "toDocField", {
197
+ enumerable: true,
198
+ get: function () { return chunk3NG33DV2_cjs.toDocField; }
199
+ });
200
+ Object.defineProperty(exports, "toDocType", {
201
+ enumerable: true,
202
+ get: function () { return chunk3NG33DV2_cjs.toDocType; }
203
+ });
204
+ Object.defineProperty(exports, "toRecord", {
205
+ enumerable: true,
206
+ get: function () { return chunk3NG33DV2_cjs.toRecord; }
207
+ });
208
+ Object.defineProperty(exports, "validateBuilder", {
209
+ enumerable: true,
210
+ get: function () { return chunk3NG33DV2_cjs.validateBuilder; }
211
+ });
212
+ //# sourceMappingURL=core.cjs.map
213
+ //# sourceMappingURL=core.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"core.cjs"}
@@ -0,0 +1,6 @@
1
+ export * from './types';
2
+ export * from './client';
3
+ export * from './fields';
4
+ export * from './builder-logic';
5
+ export * from './media';
6
+ export * from './data';
@@ -0,0 +1,4 @@
1
+ 'use client';
2
+ export { BUILDER_FIELD_TYPES, CANCELLED, DRAFT, PROJECT_FIELD, REDACTED_MARKER, SUBMITTED, autonameSource, blankField, cardFields, createFrameworkClient, createMediaUploader, docTypeToFields, enrichLinks, fieldNameFromLabel, fieldNeedsOptions, fieldTypeLabel, fieldsFromDocType, hasProjectField, humanize, imageDimensions, isDraft, isMediaDoctype, isRef, isValidDoctypeName, joinKey, linkFields, listHiddenFields, listQuery, listedFieldNames, loadLinkOptions, looksLikeImage, makeFieldOptions, mediaDocPayload, mediaFileField, mediaKey, mediaRef, moduleDoctypes, moveField, newDraft, newKey, parseRef, rows, savePayload, slugify, starterFields, statusField, titleOf, toDocField, toDocType, toRecord, validateBuilder } from '../chunk-P2QU5MN5.js';
3
+ //# sourceMappingURL=core.js.map
4
+ //# sourceMappingURL=core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"core.js"}
@@ -2,8 +2,8 @@
2
2
  * Shared, non-React data helpers for the generic DocType renderer. A relation
3
3
  * (Link) field is a picker over the TARGET doctype's records, so before a view
4
4
  * can render or edit one it must load those records (+ the target's schema for
5
- * the human label). This is the ONE place that does it, used by both the records
6
- * list and the record detail — no per-view duplication.
5
+ * the human label). This is the ONE place that does it, used by the records list,
6
+ * the mobile card list and the record detail — no per-view duplication.
7
7
  */
8
8
  import type { SelectOption, FieldDefinition } from '@hanzo/data';
9
9
  import type { DocType } from './types';
@@ -2,8 +2,9 @@
2
2
  * Pure mapping between the Hanzo Framework DocType metadata and @hanzo/data's
3
3
  * render model — the brain of the generic DocType renderer. It is the ONE place
4
4
  * that translates the engine's Frappe field vocabulary into @hanzo/data's, so
5
- * EVERY app lane (CMS/ERP/CRM/Helpdesk) renders list/form/detail identically with
6
- * zero per-doctype code. A new DocType — or a whole new lane — "just works".
5
+ * EVERY app lane (CMS / ERP / CRM / Helpdesk) renders list, card, form and detail
6
+ * identically with zero per-doctype code. A new DocType — or a whole new lane —
7
+ * "just works".
7
8
  *
8
9
  * No I/O, no React — data in, data out, trivially testable (the @hanzo/data
9
10
  * imports are `import type`, erased at build, so the unit test runs in plain Node).
@@ -27,24 +28,66 @@ export interface FieldMapOpts {
27
28
  export declare function docTypeToFields(dt: DocType, opts?: FieldMapOpts): FieldDefinition[];
28
29
  /** The status field a publishable content type uses (a Select including "Published"). */
29
30
  export declare function statusField(dt: DocType): string;
30
- /** Fields shown as table columns: the `inListView` subset (all, if none flagged). */
31
+ /**
32
+ * Field names hidden from the table grid: everything NOT flagged `inListView`
33
+ * (when the DocType flags any). This is the engine's own column projection —
34
+ * an ERP Sales Order declares 4 list columns out of 12 fields, so honoring it is
35
+ * what keeps a wide DocType from becoming a horizontally-scrolling wall.
36
+ */
31
37
  export declare function listHiddenFields(dt: DocType): string[];
38
+ /**
39
+ * The fields shown on a MOBILE card, in order: the DocType's declared list columns
40
+ * (`inListView`), else the first few visible fields. The title is rendered by the
41
+ * card itself, so it is excluded here. Capped, because a card is a summary — the
42
+ * full record is one tap away.
43
+ */
44
+ export declare function cardFields(dt: DocType, fields: FieldDefinition[], max?: number): FieldDefinition[];
45
+ /** The `inListView` field names (empty when the DocType flags none). */
46
+ export declare function listedFieldNames(dt: DocType): string[];
32
47
  /** True when a DocType is a media/asset library (a required Attach) → grid view. */
33
48
  export declare function isMediaDoctype(dt: DocType): boolean;
34
49
  /** The primary Attach field name (the asset URL) of a media doctype. */
35
50
  export declare function mediaFileField(dt: DocType): string;
51
+ /** The uploaded-asset facts a media DocType may want stored alongside the file. */
52
+ export interface MediaFacts {
53
+ /** The `file`-field value (an object reference or URL). */
54
+ fileRef: string;
55
+ filename: string;
56
+ mime: string;
57
+ size: number;
58
+ width: number;
59
+ height: number;
60
+ }
61
+ /**
62
+ * The create body for a media document — METADATA-DRIVEN, not a hardcoded CMS
63
+ * schema. The file lands on the DocType's own Attach field, the filename on its
64
+ * declared `titleField` (else `title` if it has one), and each optional fact
65
+ * (`mime`/`size`/`width`/`height`) is written ONLY when the DocType actually
66
+ * declares that field. A media collection that names its label `caption` gets a
67
+ * captioned row instead of an untitled one, and a lane whose media DocType has no
68
+ * dimensions never ships dead keys.
69
+ */
70
+ export declare function mediaDocPayload(dt: DocType, facts: MediaFacts): Record<string, unknown>;
36
71
  /** DocTypes belonging to an app lane (module) — a CMS "collection" is one of these. */
37
72
  export declare function moduleDoctypes(dts: DocType[], module: string): DocType[];
38
73
  /** The conventional field a collection uses to scope documents to a project. */
39
74
  export declare const PROJECT_FIELD = "project";
40
75
  /** True when a DocType declares the `project` scope field (→ project filtering works). */
41
76
  export declare function hasProjectField(dt: DocType): boolean;
77
+ /**
78
+ * The engine refuses to edit or delete a document that is no longer a draft
79
+ * (`ops.go`: "document is not a draft (docstatus %d); cannot edit" and "submitted
80
+ * document must be cancelled before deletion"). So the views ASK before offering
81
+ * the affordance — a submitted invoice shows no Edit button rather than a full
82
+ * form that errors on Save.
83
+ */
84
+ export declare function isDraft(record: Record<string, unknown> | null | undefined): boolean;
42
85
  /** A record's human title — the DocType's titleField, else its name. */
43
86
  export declare function titleOf(doc: Record<string, unknown>, dt: DocType): string;
44
87
  /**
45
88
  * URL-safe slug from arbitrary text: lower-case, any run of non-alphanumerics
46
89
  * collapsed to a single dash, ends trimmed. Guarantees a no-space, `%`-free
47
- * document name (the engine and the console's own proxy path both require it).
90
+ * document name (the engine and a host's proxy path both require it).
48
91
  */
49
92
  export declare function slugify(s: unknown): string;
50
93
  /** Valid Pascal/slug DocType name (letters/digits/dash/underscore, alnum-led, no space). */