@odla-ai/crm 0.8.0 → 0.9.1
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/chunk-7LH3WGSU.js +1279 -0
- package/dist/chunk-7LH3WGSU.js.map +1 -0
- package/dist/client-CMYE9fpt.d.ts +566 -0
- package/dist/gallery/index.d.ts +17 -0
- package/dist/gallery/index.js +1080 -0
- package/dist/gallery/index.js.map +1 -0
- package/dist/index.cjs +28 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +28 -8
- package/dist/index.js.map +1 -1
- package/dist/ui/index.d.ts +1 -565
- package/dist/ui/index.js +20 -1255
- package/dist/ui/index.js.map +1 -1
- package/package.json +6 -2
package/dist/ui/index.js
CHANGED
|
@@ -1,1258 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
setError(null);
|
|
22
|
-
setLoading(false);
|
|
23
|
-
},
|
|
24
|
-
(failure) => {
|
|
25
|
-
if (seq.current !== mine) return;
|
|
26
|
-
setError(failure instanceof Error ? failure.message : String(failure));
|
|
27
|
-
setLoading(false);
|
|
28
|
-
}
|
|
29
|
-
);
|
|
30
|
-
}, [client, params, tick]);
|
|
31
|
-
const update = useCallback((patch) => {
|
|
32
|
-
setParams((prev) => ({ ...prev, ...patch, offset: 0 }));
|
|
33
|
-
}, []);
|
|
34
|
-
const setOffset = useCallback((offset) => {
|
|
35
|
-
setParams((prev) => ({ ...prev, offset }));
|
|
36
|
-
}, []);
|
|
37
|
-
const setSort = useCallback((sort) => update({ sort }), [update]);
|
|
38
|
-
const setSearch = useCallback((search) => update({ search }), [update]);
|
|
39
|
-
const refresh = useCallback(() => setTick((t) => t + 1), []);
|
|
40
|
-
return useMemo(
|
|
41
|
-
() => ({ params, page, loading, error, update, setOffset, setSort, setSearch, refresh }),
|
|
42
|
-
[params, page, loading, error, update, setOffset, setSort, setSearch, refresh]
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
function useCrmRecord(client, id) {
|
|
46
|
-
const [detail, setDetail] = useState(null);
|
|
47
|
-
const [loading, setLoading] = useState(Boolean(id));
|
|
48
|
-
const [error, setError] = useState(null);
|
|
49
|
-
const [tick, setTick] = useState(0);
|
|
50
|
-
const seq = useRef(0);
|
|
51
|
-
useEffect(() => {
|
|
52
|
-
const mine = ++seq.current;
|
|
53
|
-
if (!id) {
|
|
54
|
-
setDetail(null);
|
|
55
|
-
setLoading(false);
|
|
56
|
-
setError(null);
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
setLoading(true);
|
|
60
|
-
client.getRecord(id).then(
|
|
61
|
-
(result) => {
|
|
62
|
-
if (seq.current !== mine) return;
|
|
63
|
-
setDetail(result);
|
|
64
|
-
setError(null);
|
|
65
|
-
setLoading(false);
|
|
66
|
-
},
|
|
67
|
-
(failure) => {
|
|
68
|
-
if (seq.current !== mine) return;
|
|
69
|
-
setError(failure instanceof Error ? failure.message : String(failure));
|
|
70
|
-
setLoading(false);
|
|
71
|
-
}
|
|
72
|
-
);
|
|
73
|
-
}, [client, id, tick]);
|
|
74
|
-
const refresh = useCallback(() => setTick((t) => t + 1), []);
|
|
75
|
-
return useMemo(() => ({ detail, loading, error, refresh }), [detail, loading, error, refresh]);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// src/constants.ts
|
|
79
|
-
var CRM_NS = {
|
|
80
|
-
record: "crm_record",
|
|
81
|
-
tag: "crm_tag",
|
|
82
|
-
link: "crm_link",
|
|
83
|
-
activity: "crm_activity",
|
|
84
|
-
channel: "crm_contact_channel",
|
|
85
|
-
emailLog: "crm_email_log",
|
|
86
|
-
view: "crm_view",
|
|
87
|
-
config: "crm_config",
|
|
88
|
-
origin: "crm_record_origin",
|
|
89
|
-
delivery: "crm_record_delivery"
|
|
90
|
-
};
|
|
91
|
-
var CRM_SLOTS = ["s1", "s2", "s3", "s4", "n1", "n2", "n3", "d1", "d2"];
|
|
92
|
-
var SORTABLE_COLUMNS = [
|
|
93
|
-
"name",
|
|
94
|
-
"primaryEmail",
|
|
95
|
-
"stageIndex",
|
|
96
|
-
"stageChangedAt",
|
|
97
|
-
"rank",
|
|
98
|
-
"score",
|
|
99
|
-
"emailStatus",
|
|
100
|
-
"billingStatus",
|
|
101
|
-
"renewalAt",
|
|
102
|
-
"createdAt",
|
|
103
|
-
"updatedAt"
|
|
104
|
-
];
|
|
105
|
-
var RESERVED_FIELDS = /* @__PURE__ */ new Set([
|
|
106
|
-
"id",
|
|
107
|
-
"type",
|
|
108
|
-
"primaryEmail",
|
|
109
|
-
"stage",
|
|
110
|
-
"stageIndex",
|
|
111
|
-
"stageChangedAt",
|
|
112
|
-
"rank",
|
|
113
|
-
"score",
|
|
114
|
-
"ownerId",
|
|
115
|
-
"emailStatus",
|
|
116
|
-
"clerkUserId",
|
|
117
|
-
"stripeCustomerId",
|
|
118
|
-
"subscriptionId",
|
|
119
|
-
"billingStatus",
|
|
120
|
-
"renewalAt",
|
|
121
|
-
"mrr",
|
|
122
|
-
"fields",
|
|
123
|
-
"searchText",
|
|
124
|
-
"archived",
|
|
125
|
-
"createdAt",
|
|
126
|
-
"updatedAt",
|
|
127
|
-
"archivedAt",
|
|
128
|
-
...CRM_SLOTS
|
|
129
|
-
]);
|
|
130
|
-
|
|
131
|
-
// src/schema.ts
|
|
132
|
-
var a = (type, o = {}) => ({
|
|
133
|
-
type,
|
|
134
|
-
unique: false,
|
|
135
|
-
indexed: false,
|
|
136
|
-
optional: false,
|
|
137
|
-
...o
|
|
138
|
-
});
|
|
139
|
-
var uniq = (type) => a(type, { unique: true, indexed: true });
|
|
140
|
-
var idx = (type, optional = false) => a(type, { indexed: true, optional });
|
|
141
|
-
var opt = (type) => a(type, { optional: true });
|
|
142
|
-
var CRM_SCHEMA = {
|
|
143
|
-
entities: {
|
|
144
|
-
[CRM_NS.record]: {
|
|
145
|
-
attrs: {
|
|
146
|
-
// Entity ids are not attributes in odla-db, so `where: { id }` matches
|
|
147
|
-
// nothing unless the id is mirrored as a written attr — the getRecord /
|
|
148
|
-
// tag-filter / neighbor reads all filter by id. Mirror it as unique.
|
|
149
|
-
id: uniq("string"),
|
|
150
|
-
type: idx("string"),
|
|
151
|
-
name: idx("string"),
|
|
152
|
-
primaryEmail: idx("string", true),
|
|
153
|
-
stage: idx("string", true),
|
|
154
|
-
stageIndex: idx("number", true),
|
|
155
|
-
stageChangedAt: idx("date", true),
|
|
156
|
-
rank: idx("number", true),
|
|
157
|
-
score: idx("number", true),
|
|
158
|
-
ownerId: idx("string", true),
|
|
159
|
-
emailStatus: idx("string", true),
|
|
160
|
-
clerkUserId: a("string", { unique: true, indexed: true, optional: true }),
|
|
161
|
-
stripeCustomerId: idx("string", true),
|
|
162
|
-
subscriptionId: opt("string"),
|
|
163
|
-
billingStatus: idx("string", true),
|
|
164
|
-
renewalAt: idx("date", true),
|
|
165
|
-
mrr: opt("number"),
|
|
166
|
-
s1: idx("string", true),
|
|
167
|
-
s2: idx("string", true),
|
|
168
|
-
s3: idx("string", true),
|
|
169
|
-
s4: idx("string", true),
|
|
170
|
-
n1: idx("number", true),
|
|
171
|
-
n2: idx("number", true),
|
|
172
|
-
n3: idx("number", true),
|
|
173
|
-
d1: idx("date", true),
|
|
174
|
-
d2: idx("date", true),
|
|
175
|
-
fields: a("json"),
|
|
176
|
-
searchText: a("string"),
|
|
177
|
-
archived: idx("boolean"),
|
|
178
|
-
createdAt: idx("date"),
|
|
179
|
-
updatedAt: idx("date"),
|
|
180
|
-
archivedAt: opt("date")
|
|
181
|
-
}
|
|
182
|
-
},
|
|
183
|
-
[CRM_NS.tag]: {
|
|
184
|
-
attrs: {
|
|
185
|
-
key: uniq("string"),
|
|
186
|
-
// `${recordId}:${tag}`
|
|
187
|
-
recordId: idx("string"),
|
|
188
|
-
tag: idx("string"),
|
|
189
|
-
createdAt: idx("date")
|
|
190
|
-
}
|
|
191
|
-
},
|
|
192
|
-
[CRM_NS.link]: {
|
|
193
|
-
attrs: {
|
|
194
|
-
key: uniq("string"),
|
|
195
|
-
// `${fromId}:${relation}:${toId}`
|
|
196
|
-
fromId: idx("string"),
|
|
197
|
-
toId: idx("string"),
|
|
198
|
-
relation: idx("string"),
|
|
199
|
-
createdAt: idx("date")
|
|
200
|
-
}
|
|
201
|
-
},
|
|
202
|
-
[CRM_NS.activity]: {
|
|
203
|
-
attrs: {
|
|
204
|
-
id: uniq("string"),
|
|
205
|
-
// mirrored so updateTask can read one by id
|
|
206
|
-
recordId: idx("string"),
|
|
207
|
-
kind: idx("string"),
|
|
208
|
-
body: a("string"),
|
|
209
|
-
status: idx("string", true),
|
|
210
|
-
// tasks: open | waiting | done
|
|
211
|
-
dueAt: idx("date", true),
|
|
212
|
-
waitingOn: opt("string"),
|
|
213
|
-
assigneeId: idx("string", true),
|
|
214
|
-
authorId: idx("string"),
|
|
215
|
-
createdAt: idx("date"),
|
|
216
|
-
completedAt: opt("date"),
|
|
217
|
-
meta: opt("json")
|
|
218
|
-
}
|
|
219
|
-
},
|
|
220
|
-
[CRM_NS.channel]: {
|
|
221
|
-
attrs: {
|
|
222
|
-
key: uniq("string"),
|
|
223
|
-
// `${recordId}:${kind}:${value}`
|
|
224
|
-
recordId: idx("string"),
|
|
225
|
-
kind: a("string"),
|
|
226
|
-
// email | phone
|
|
227
|
-
value: idx("string"),
|
|
228
|
-
// emails lowercased
|
|
229
|
-
isPrimary: a("boolean"),
|
|
230
|
-
consent: idx("string"),
|
|
231
|
-
consentAt: idx("date"),
|
|
232
|
-
consentSource: opt("string"),
|
|
233
|
-
unsubscribeToken: uniq("string"),
|
|
234
|
-
createdAt: idx("date")
|
|
235
|
-
}
|
|
236
|
-
},
|
|
237
|
-
[CRM_NS.emailLog]: {
|
|
238
|
-
attrs: {
|
|
239
|
-
recordId: idx("string", true),
|
|
240
|
-
channelId: opt("string"),
|
|
241
|
-
to: a("string"),
|
|
242
|
-
templateId: idx("string"),
|
|
243
|
-
subject: a("string"),
|
|
244
|
-
transport: a("string"),
|
|
245
|
-
// sent | log-only
|
|
246
|
-
redirected: opt("boolean"),
|
|
247
|
-
dedupeKey: idx("string", true),
|
|
248
|
-
messageId: opt("string"),
|
|
249
|
-
error: opt("string"),
|
|
250
|
-
sentAt: idx("date")
|
|
251
|
-
}
|
|
252
|
-
},
|
|
253
|
-
[CRM_NS.view]: {
|
|
254
|
-
attrs: {
|
|
255
|
-
id: uniq("string"),
|
|
256
|
-
// mirrored so getView/updateView can read one by id
|
|
257
|
-
name: a("string"),
|
|
258
|
-
type: idx("string"),
|
|
259
|
-
ownerId: idx("string", true),
|
|
260
|
-
shared: idx("boolean"),
|
|
261
|
-
filters: a("json"),
|
|
262
|
-
sort: a("json"),
|
|
263
|
-
columns: a("json"),
|
|
264
|
-
createdAt: idx("date"),
|
|
265
|
-
updatedAt: idx("date")
|
|
266
|
-
}
|
|
267
|
-
},
|
|
268
|
-
[CRM_NS.config]: {
|
|
269
|
-
attrs: {
|
|
270
|
-
key: uniq("string"),
|
|
271
|
-
// CONFIG_KEY singleton
|
|
272
|
-
notificationEmail: opt("string"),
|
|
273
|
-
replyTo: opt("string"),
|
|
274
|
-
debugEmail: opt("string"),
|
|
275
|
-
emailTemplates: a("json"),
|
|
276
|
-
// Record<templateId, {subject, text, enabled}>
|
|
277
|
-
settings: a("json"),
|
|
278
|
-
updatedAt: idx("date")
|
|
279
|
-
}
|
|
280
|
-
},
|
|
281
|
-
[CRM_NS.origin]: {
|
|
282
|
-
attrs: {
|
|
283
|
-
// One upstream record maps to one local record. The structured source
|
|
284
|
-
// survives tag edits and supports more than one upstream site.
|
|
285
|
-
key: uniq("string"),
|
|
286
|
-
// `${sourceId}:${sourceRecordId}`
|
|
287
|
-
recordId: idx("string"),
|
|
288
|
-
sourceId: idx("string"),
|
|
289
|
-
sourceRecordId: idx("string"),
|
|
290
|
-
sourceUrl: opt("string"),
|
|
291
|
-
payloadVersion: idx("number"),
|
|
292
|
-
firstReceivedAt: idx("date"),
|
|
293
|
-
lastReceivedAt: idx("date")
|
|
294
|
-
}
|
|
295
|
-
},
|
|
296
|
-
[CRM_NS.delivery]: {
|
|
297
|
-
attrs: {
|
|
298
|
-
// The latest delivery state for one local record → target edge.
|
|
299
|
-
key: uniq("string"),
|
|
300
|
-
// `${recordId}:${targetId}`
|
|
301
|
-
recordId: idx("string"),
|
|
302
|
-
targetId: idx("string"),
|
|
303
|
-
remoteRecordId: idx("string", true),
|
|
304
|
-
status: idx("string"),
|
|
305
|
-
attempts: idx("number"),
|
|
306
|
-
payloadVersion: idx("number"),
|
|
307
|
-
lastAttemptAt: idx("date"),
|
|
308
|
-
deliveredAt: idx("date", true),
|
|
309
|
-
error: opt("string")
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
},
|
|
313
|
-
links: {}
|
|
314
|
-
};
|
|
315
|
-
|
|
316
|
-
// src/time.ts
|
|
317
|
-
var DATE_FIELDS = new Map(
|
|
318
|
-
Object.entries(CRM_SCHEMA.entities).map(([ns, entity]) => [
|
|
319
|
-
ns,
|
|
320
|
-
new Set(
|
|
321
|
-
Object.entries(entity.attrs).filter(([, attr]) => attr.type === "date").map(([label]) => label)
|
|
322
|
-
)
|
|
323
|
-
])
|
|
324
|
-
);
|
|
325
|
-
function epochOf(value) {
|
|
326
|
-
if (typeof value === "number") return Number.isFinite(value) ? value : void 0;
|
|
327
|
-
if (typeof value !== "string") return void 0;
|
|
328
|
-
const parsed = Date.parse(value);
|
|
329
|
-
return Number.isNaN(parsed) ? void 0 : parsed;
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
// src/ui/columns.tsx
|
|
333
|
-
var dateText = (value) => {
|
|
334
|
-
const ms = epochOf(value);
|
|
335
|
-
return ms === void 0 ? "\u2014" : new Date(ms).toISOString().slice(0, 10);
|
|
336
|
-
};
|
|
337
|
-
var PROMOTED = {
|
|
338
|
-
name: { header: "Name", cell: (r) => r.name },
|
|
339
|
-
primaryEmail: { header: "Email", cell: (r) => r.primaryEmail ?? "\u2014" },
|
|
340
|
-
stage: { header: "Stage", cell: (r) => r.stage ?? "\u2014" },
|
|
341
|
-
emailStatus: { header: "Contactable", cell: (r) => r.emailStatus ?? "\u2014" },
|
|
342
|
-
billingStatus: { header: "Billing", cell: (r) => r.billingStatus ?? "\u2014" },
|
|
343
|
-
renewalAt: { header: "Renews", cell: (r) => dateText(r.renewalAt) },
|
|
344
|
-
score: { header: "Score", cell: (r) => r.score != null ? String(r.score) : "\u2014" },
|
|
345
|
-
rank: { header: "Rank", cell: (r) => r.rank != null ? String(r.rank) : "\u2014" },
|
|
346
|
-
createdAt: { header: "Created", cell: (r) => dateText(r.createdAt) },
|
|
347
|
-
updatedAt: { header: "Updated", cell: (r) => dateText(r.updatedAt) }
|
|
348
|
-
};
|
|
349
|
-
var SORT_ALIAS = { stage: "stageIndex" };
|
|
350
|
-
function fieldCell(field, name) {
|
|
351
|
-
return (record) => {
|
|
352
|
-
const value = record.fields[name];
|
|
353
|
-
if (value == null || value === "") return "\u2014";
|
|
354
|
-
if (field.type === "date") return dateText(value);
|
|
355
|
-
if (field.type === "boolean") return value ? "yes" : "no";
|
|
356
|
-
if (field.type === "json") return JSON.stringify(value);
|
|
357
|
-
return String(value);
|
|
358
|
-
};
|
|
359
|
-
}
|
|
360
|
-
var fieldSortAs = (field) => {
|
|
361
|
-
if (!field.slot) return void 0;
|
|
362
|
-
if (field.type === "number") return "number";
|
|
363
|
-
if (field.type === "date") return "date";
|
|
364
|
-
return "string";
|
|
365
|
-
};
|
|
366
|
-
function sortFieldFor(crm, type, key) {
|
|
367
|
-
if (SORT_ALIAS[key]) return SORT_ALIAS[key];
|
|
368
|
-
if (SORTABLE_COLUMNS.includes(key)) return key;
|
|
369
|
-
return crm.type(type).fields[key]?.slot ? key : null;
|
|
370
|
-
}
|
|
371
|
-
function columnsFor(crm, type, keys) {
|
|
372
|
-
const def = crm.type(type);
|
|
373
|
-
const columns = [];
|
|
374
|
-
for (const key of keys) {
|
|
375
|
-
const promoted = PROMOTED[key];
|
|
376
|
-
if (promoted) {
|
|
377
|
-
const sortable = sortFieldFor(crm, type, key) != null;
|
|
378
|
-
const cell = key === "stage" ? (record) => {
|
|
379
|
-
if (!record.stage) return "\u2014";
|
|
380
|
-
const stage = def.pipeline?.stages.find((candidate) => candidate.id === record.stage);
|
|
381
|
-
return stage?.label ?? stage?.id ?? record.stage;
|
|
382
|
-
} : promoted.cell;
|
|
383
|
-
columns.push({
|
|
384
|
-
key,
|
|
385
|
-
header: promoted.header,
|
|
386
|
-
cell,
|
|
387
|
-
...sortable ? { sortAs: key === "name" || key === "primaryEmail" ? "string" : "number" } : {}
|
|
388
|
-
});
|
|
389
|
-
continue;
|
|
390
|
-
}
|
|
391
|
-
const field = def.fields[key];
|
|
392
|
-
if (!field) continue;
|
|
393
|
-
const sortAs = fieldSortAs(field);
|
|
394
|
-
columns.push({
|
|
395
|
-
key,
|
|
396
|
-
header: field.label ?? key,
|
|
397
|
-
cell: fieldCell(field, key),
|
|
398
|
-
...sortAs ? { sortAs } : {}
|
|
399
|
-
});
|
|
400
|
-
}
|
|
401
|
-
return columns;
|
|
402
|
-
}
|
|
403
|
-
function defaultColumns(crm, type) {
|
|
404
|
-
const def = crm.type(type);
|
|
405
|
-
const keys = ["name"];
|
|
406
|
-
if (def.pipeline) keys.push("stage");
|
|
407
|
-
if (def.emailField) keys.push("primaryEmail", "emailStatus");
|
|
408
|
-
for (const [name, field] of Object.entries(def.fields)) {
|
|
409
|
-
if (field.slot && name !== def.emailField && name !== (def.nameField ?? "name"))
|
|
410
|
-
keys.push(name);
|
|
411
|
-
}
|
|
412
|
-
keys.push("updatedAt");
|
|
413
|
-
return keys;
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
// src/ui/crm-list.tsx
|
|
417
|
-
import { DataTable, FilterChips, Pagination } from "@odla-ai/ui/components";
|
|
418
|
-
import { jsx, jsxs } from "preact/jsx-runtime";
|
|
419
|
-
function CrmList({
|
|
420
|
-
crm,
|
|
421
|
-
type,
|
|
422
|
-
query,
|
|
423
|
-
columns,
|
|
424
|
-
onOpenRecord,
|
|
425
|
-
hrefForRecord,
|
|
426
|
-
selectable = false,
|
|
427
|
-
selected,
|
|
428
|
-
onSelectionChange,
|
|
429
|
-
toolbar
|
|
430
|
-
}) {
|
|
431
|
-
const def = crm.type(type);
|
|
432
|
-
const keys = columns ?? defaultColumns(crm, type);
|
|
433
|
-
const tableColumns = columnsFor(crm, type, keys).map(
|
|
434
|
-
(column) => (onOpenRecord || hrefForRecord) && column.key === "name" ? {
|
|
435
|
-
...column,
|
|
436
|
-
cell: (record) => {
|
|
437
|
-
const href = hrefForRecord?.(record);
|
|
438
|
-
return href ? /* @__PURE__ */ jsx("a", { className: "crm-record-open", href, onClick: () => onOpenRecord?.(record), children: record.name }) : /* @__PURE__ */ jsx("button", { type: "button", className: "crm-record-open", onClick: () => onOpenRecord?.(record), children: record.name });
|
|
439
|
-
}
|
|
440
|
-
} : column
|
|
441
|
-
);
|
|
442
|
-
const limit = query.page?.limit ?? query.params.limit ?? 50;
|
|
443
|
-
const sort = query.params.sort ? { key: query.params.sort.field, dir: query.params.sort.dir } : null;
|
|
444
|
-
return /* @__PURE__ */ jsxs("div", { className: "crm-list", children: [
|
|
445
|
-
(def.pipeline || toolbar) && /* @__PURE__ */ jsxs("div", { className: "crm-list-toolbar", children: [
|
|
446
|
-
def.pipeline && /* @__PURE__ */ jsx(
|
|
447
|
-
FilterChips,
|
|
448
|
-
{
|
|
449
|
-
ariaLabel: "Stage",
|
|
450
|
-
allLabel: "All stages",
|
|
451
|
-
chips: def.pipeline.stages.map((stage) => ({
|
|
452
|
-
value: stage.id,
|
|
453
|
-
label: stage.label ?? stage.id
|
|
454
|
-
})),
|
|
455
|
-
value: query.params.stage ?? [],
|
|
456
|
-
onValueChange: (stage) => query.update({ stage })
|
|
457
|
-
}
|
|
458
|
-
),
|
|
459
|
-
toolbar
|
|
460
|
-
] }),
|
|
461
|
-
/* @__PURE__ */ jsx(
|
|
462
|
-
DataTable,
|
|
463
|
-
{
|
|
464
|
-
manual: true,
|
|
465
|
-
filterable: true,
|
|
466
|
-
rows: query.page?.records ?? [],
|
|
467
|
-
rowKey: (record) => record.id,
|
|
468
|
-
columns: tableColumns,
|
|
469
|
-
loading: query.loading && !query.page,
|
|
470
|
-
sort,
|
|
471
|
-
onSortChange: (next) => {
|
|
472
|
-
const field = sortFieldFor(crm, type, next.key);
|
|
473
|
-
if (field) query.setSort({ field, dir: next.dir });
|
|
474
|
-
},
|
|
475
|
-
filter: query.params.search ?? "",
|
|
476
|
-
onFilterChange: (search) => query.setSearch(search),
|
|
477
|
-
filterPlaceholder: "Search records\u2026",
|
|
478
|
-
selectable,
|
|
479
|
-
selected,
|
|
480
|
-
onSelectionChange,
|
|
481
|
-
emptyState: query.error ?? "No records yet",
|
|
482
|
-
ariaLabel: `${def.labelPlural ?? def.label} list`
|
|
483
|
-
}
|
|
484
|
-
),
|
|
485
|
-
/* @__PURE__ */ jsx(
|
|
486
|
-
Pagination,
|
|
487
|
-
{
|
|
488
|
-
offset: query.params.offset ?? 0,
|
|
489
|
-
limit,
|
|
490
|
-
total: query.page?.total,
|
|
491
|
-
count: query.page?.records.length,
|
|
492
|
-
onOffsetChange: (offset) => query.setOffset(offset),
|
|
493
|
-
disabled: query.loading
|
|
494
|
-
}
|
|
495
|
-
)
|
|
496
|
-
] });
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
// src/ui/crm-shell.tsx
|
|
500
|
-
import { AppShell, Sidebar, SidebarItem, SidebarSection } from "@odla-ai/ui/components";
|
|
501
|
-
import { jsx as jsx2, jsxs as jsxs2 } from "preact/jsx-runtime";
|
|
502
|
-
function CrmShell({ crm, active, views = [], onNavigate, onOpenSettings, header, children }) {
|
|
503
|
-
return /* @__PURE__ */ jsx2(
|
|
504
|
-
AppShell,
|
|
505
|
-
{
|
|
506
|
-
header,
|
|
507
|
-
sidebar: /* @__PURE__ */ jsxs2(Sidebar, { "aria-label": "CRM navigation", children: [
|
|
508
|
-
/* @__PURE__ */ jsx2(SidebarSection, { label: "Records", children: Object.entries(crm.config.types).map(([type, def]) => /* @__PURE__ */ jsx2(
|
|
509
|
-
SidebarItem,
|
|
510
|
-
{
|
|
511
|
-
active: active.type === type && !active.viewId,
|
|
512
|
-
onClick: () => onNavigate({ type }),
|
|
513
|
-
children: def.labelPlural ?? def.label
|
|
514
|
-
},
|
|
515
|
-
type
|
|
516
|
-
)) }),
|
|
517
|
-
views.length > 0 && /* @__PURE__ */ jsx2(SidebarSection, { label: "Views", children: views.map((view) => /* @__PURE__ */ jsxs2(
|
|
518
|
-
SidebarItem,
|
|
519
|
-
{
|
|
520
|
-
active: active.viewId === view.id,
|
|
521
|
-
onClick: () => onNavigate({ type: view.type, viewId: view.id }),
|
|
522
|
-
children: [
|
|
523
|
-
view.name,
|
|
524
|
-
view.shared ? " \xB7shared" : ""
|
|
525
|
-
]
|
|
526
|
-
},
|
|
527
|
-
view.id
|
|
528
|
-
)) }),
|
|
529
|
-
onOpenSettings && /* @__PURE__ */ jsx2(SidebarSection, { label: "Manage", children: /* @__PURE__ */ jsx2(SidebarItem, { onClick: onOpenSettings, children: "Settings" }) })
|
|
530
|
-
] }),
|
|
531
|
-
children
|
|
532
|
-
}
|
|
533
|
-
);
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
// src/ui/record-panel.tsx
|
|
537
|
-
import { Tabs } from "@odla-ai/ui/components";
|
|
538
|
-
|
|
539
|
-
// src/ui/cards.tsx
|
|
540
|
-
import { Button } from "@odla-ai/ui/components";
|
|
541
|
-
import { jsx as jsx3, jsxs as jsxs3 } from "preact/jsx-runtime";
|
|
542
|
-
var dateText2 = (value) => value != null ? new Date(value).toISOString().slice(0, 10) : "\u2014";
|
|
543
|
-
function IdentityCard({ record, onLink, linking = false }) {
|
|
544
|
-
return /* @__PURE__ */ jsxs3("section", { className: "crm-card", "aria-label": "Identity", children: [
|
|
545
|
-
/* @__PURE__ */ jsx3("h3", { className: "crm-card-title", children: "Identity" }),
|
|
546
|
-
record.clerkUserId ? /* @__PURE__ */ jsxs3("p", { children: [
|
|
547
|
-
"Linked account: ",
|
|
548
|
-
/* @__PURE__ */ jsx3("code", { children: record.clerkUserId })
|
|
549
|
-
] }) : /* @__PURE__ */ jsxs3("p", { className: "crm-card-empty", children: [
|
|
550
|
-
"No linked account.",
|
|
551
|
-
onLink && /* @__PURE__ */ jsx3(Button, { mini: true, onClick: onLink, disabled: linking, children: "Find by email" })
|
|
552
|
-
] })
|
|
553
|
-
] });
|
|
554
|
-
}
|
|
555
|
-
function BillingCard({ record }) {
|
|
556
|
-
return /* @__PURE__ */ jsxs3("section", { className: "crm-card", "aria-label": "Billing", children: [
|
|
557
|
-
/* @__PURE__ */ jsx3("h3", { className: "crm-card-title", children: "Billing" }),
|
|
558
|
-
record.stripeCustomerId ? /* @__PURE__ */ jsxs3("dl", { className: "crm-card-facts", children: [
|
|
559
|
-
/* @__PURE__ */ jsx3("dt", { children: "Status" }),
|
|
560
|
-
/* @__PURE__ */ jsx3("dd", { children: record.billingStatus ?? "\u2014" }),
|
|
561
|
-
/* @__PURE__ */ jsx3("dt", { children: "Renews" }),
|
|
562
|
-
/* @__PURE__ */ jsx3("dd", { children: dateText2(record.renewalAt) }),
|
|
563
|
-
/* @__PURE__ */ jsx3("dt", { children: "Customer" }),
|
|
564
|
-
/* @__PURE__ */ jsx3("dd", { children: /* @__PURE__ */ jsx3("code", { children: record.stripeCustomerId }) })
|
|
565
|
-
] }) : /* @__PURE__ */ jsx3("p", { className: "crm-card-empty", children: "No billing on file." })
|
|
566
|
-
] });
|
|
567
|
-
}
|
|
568
|
-
function ChannelsCard({ channels }) {
|
|
569
|
-
return /* @__PURE__ */ jsxs3("section", { className: "crm-card", "aria-label": "Contact channels", children: [
|
|
570
|
-
/* @__PURE__ */ jsx3("h3", { className: "crm-card-title", children: "Contact" }),
|
|
571
|
-
channels.length === 0 ? /* @__PURE__ */ jsx3("p", { className: "crm-card-empty", children: "No channels." }) : /* @__PURE__ */ jsx3("ul", { className: "crm-channel-list", children: channels.map((channel) => /* @__PURE__ */ jsxs3("li", { children: [
|
|
572
|
-
/* @__PURE__ */ jsx3("span", { children: channel.value }),
|
|
573
|
-
channel.isPrimary && /* @__PURE__ */ jsx3("span", { className: "crm-badge", children: "primary" }),
|
|
574
|
-
/* @__PURE__ */ jsx3("span", { className: `crm-badge consent-${channel.consent}`, children: channel.consent })
|
|
575
|
-
] }, channel.id)) })
|
|
576
|
-
] });
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
// src/ui/fields-form.tsx
|
|
580
|
-
import { useState as useState2 } from "preact/hooks";
|
|
581
|
-
import { Button as Button2, Checkbox, Field, Input, Select, Textarea } from "@odla-ai/ui/components";
|
|
582
|
-
import { jsx as jsx4, jsxs as jsxs4 } from "preact/jsx-runtime";
|
|
583
|
-
var dateInput = (value) => {
|
|
584
|
-
const ms = epochOf(value);
|
|
585
|
-
return ms === void 0 ? "" : new Date(ms).toISOString().slice(0, 10);
|
|
586
|
-
};
|
|
587
|
-
function initialDraft(def, record) {
|
|
588
|
-
const draft = {};
|
|
589
|
-
for (const [name, field] of Object.entries(def)) {
|
|
590
|
-
const value = record?.fields[name];
|
|
591
|
-
if (field.type === "boolean") draft[name] = value === true;
|
|
592
|
-
else if (field.type === "date") draft[name] = dateInput(value);
|
|
593
|
-
else if (field.type === "json") draft[name] = value == null ? "" : JSON.stringify(value);
|
|
594
|
-
else draft[name] = value == null ? "" : String(value);
|
|
595
|
-
}
|
|
596
|
-
return draft;
|
|
597
|
-
}
|
|
598
|
-
function parseDraft(field, raw) {
|
|
599
|
-
if (field.type === "boolean") return raw === true;
|
|
600
|
-
const text = String(raw).trim();
|
|
601
|
-
if (text === "") return null;
|
|
602
|
-
if (field.type === "number") return Number(text);
|
|
603
|
-
if (field.type === "date") return Date.parse(text);
|
|
604
|
-
if (field.type === "json") {
|
|
605
|
-
try {
|
|
606
|
-
return JSON.parse(text);
|
|
607
|
-
} catch {
|
|
608
|
-
return text;
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
|
-
return text;
|
|
612
|
-
}
|
|
613
|
-
function FieldsForm({
|
|
614
|
-
crm,
|
|
615
|
-
type,
|
|
616
|
-
record,
|
|
617
|
-
onSubmit,
|
|
618
|
-
submitting = false,
|
|
619
|
-
errors = {},
|
|
620
|
-
submitLabel
|
|
621
|
-
}) {
|
|
622
|
-
const fields = crm.type(type).fields;
|
|
623
|
-
const [draft, setDraft] = useState2(() => initialDraft(fields, record));
|
|
624
|
-
const set = (name, value) => setDraft((prev) => ({ ...prev, [name]: value }));
|
|
625
|
-
const submit = () => {
|
|
626
|
-
const input = {};
|
|
627
|
-
for (const [name, field] of Object.entries(fields)) input[name] = parseDraft(field, draft[name]);
|
|
628
|
-
onSubmit(input);
|
|
629
|
-
};
|
|
630
|
-
return /* @__PURE__ */ jsxs4(
|
|
631
|
-
"form",
|
|
632
|
-
{
|
|
633
|
-
className: "crm-fields-form",
|
|
634
|
-
onSubmit: (event) => {
|
|
635
|
-
event.preventDefault();
|
|
636
|
-
submit();
|
|
637
|
-
},
|
|
638
|
-
children: [
|
|
639
|
-
Object.entries(fields).map(([name, field]) => {
|
|
640
|
-
const label = field.label ?? name;
|
|
641
|
-
const error = errors[name];
|
|
642
|
-
const common = { invalid: Boolean(error) };
|
|
643
|
-
return /* @__PURE__ */ jsx4(Field, { label: field.type === "boolean" ? void 0 : label, error, children: field.type === "enum" ? /* @__PURE__ */ jsx4(
|
|
644
|
-
Select,
|
|
645
|
-
{
|
|
646
|
-
...common,
|
|
647
|
-
value: String(draft[name] ?? ""),
|
|
648
|
-
onChange: (event) => set(name, event.currentTarget.value),
|
|
649
|
-
options: [
|
|
650
|
-
{ value: "", label: "\u2014" },
|
|
651
|
-
...(field.options ?? []).map((option) => ({ value: option, label: option }))
|
|
652
|
-
]
|
|
653
|
-
}
|
|
654
|
-
) : field.type === "boolean" ? /* @__PURE__ */ jsx4(
|
|
655
|
-
Checkbox,
|
|
656
|
-
{
|
|
657
|
-
checked: draft[name] === true,
|
|
658
|
-
onChange: (event) => set(name, event.currentTarget.checked),
|
|
659
|
-
label
|
|
660
|
-
}
|
|
661
|
-
) : field.type === "json" ? /* @__PURE__ */ jsx4(
|
|
662
|
-
Textarea,
|
|
663
|
-
{
|
|
664
|
-
...common,
|
|
665
|
-
value: String(draft[name] ?? ""),
|
|
666
|
-
rows: 3,
|
|
667
|
-
onInput: (event) => set(name, event.currentTarget.value)
|
|
668
|
-
}
|
|
669
|
-
) : /* @__PURE__ */ jsx4(
|
|
670
|
-
Input,
|
|
671
|
-
{
|
|
672
|
-
...common,
|
|
673
|
-
type: field.type === "number" ? "number" : field.type === "date" ? "date" : field.type === "email" ? "email" : field.type === "url" ? "url" : "text",
|
|
674
|
-
value: String(draft[name] ?? ""),
|
|
675
|
-
onInput: (event) => set(name, event.currentTarget.value)
|
|
676
|
-
}
|
|
677
|
-
) }, name);
|
|
678
|
-
}),
|
|
679
|
-
/* @__PURE__ */ jsx4(Button2, { type: "submit", disabled: submitting, children: submitLabel ?? (record ? "Save" : "Create") })
|
|
680
|
-
]
|
|
681
|
-
}
|
|
682
|
-
);
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
// src/ui/stage-control.tsx
|
|
686
|
-
import { useState as useState3 } from "preact/hooks";
|
|
687
|
-
import { Button as Button3, Field as Field2, Select as Select2 } from "@odla-ai/ui/components";
|
|
688
|
-
import { jsx as jsx5, jsxs as jsxs5 } from "preact/jsx-runtime";
|
|
689
|
-
function StageControl({ crm, record, onMove, disabled = false }) {
|
|
690
|
-
const pipeline = crm.type(record.type).pipeline;
|
|
691
|
-
const [target, setTarget] = useState3("");
|
|
692
|
-
const [busy, setBusy] = useState3(false);
|
|
693
|
-
const [error, setError] = useState3(null);
|
|
694
|
-
if (!pipeline) return null;
|
|
695
|
-
const move = async () => {
|
|
696
|
-
if (!target) return;
|
|
697
|
-
setBusy(true);
|
|
698
|
-
setError(null);
|
|
699
|
-
try {
|
|
700
|
-
await onMove(target);
|
|
701
|
-
setTarget("");
|
|
702
|
-
} catch (failure) {
|
|
703
|
-
setError(failure instanceof Error ? failure.message : String(failure));
|
|
704
|
-
} finally {
|
|
705
|
-
setBusy(false);
|
|
706
|
-
}
|
|
707
|
-
};
|
|
708
|
-
return /* @__PURE__ */ jsx5(Field2, { label: "Stage", error, className: "crm-stage-control", children: /* @__PURE__ */ jsxs5("div", { className: "crm-stage-row", children: [
|
|
709
|
-
/* @__PURE__ */ jsx5("span", { className: "crm-stage-current", children: record.stage ?? "\u2014" }),
|
|
710
|
-
/* @__PURE__ */ jsx5(
|
|
711
|
-
Select2,
|
|
712
|
-
{
|
|
713
|
-
"aria-label": "Move to stage",
|
|
714
|
-
value: target,
|
|
715
|
-
onChange: (event) => setTarget(event.currentTarget.value),
|
|
716
|
-
options: [
|
|
717
|
-
{ value: "", label: "Move to\u2026" },
|
|
718
|
-
...pipeline.stages.filter((stage) => stage.id !== record.stage).map((stage) => ({ value: stage.id, label: stage.label ?? stage.id }))
|
|
719
|
-
]
|
|
720
|
-
}
|
|
721
|
-
),
|
|
722
|
-
/* @__PURE__ */ jsx5(Button3, { mini: true, onClick: move, disabled: disabled || busy || !target, children: "Move" })
|
|
723
|
-
] }) });
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
// src/ui/tag-editor.tsx
|
|
727
|
-
import { Combobox } from "@odla-ai/ui/components";
|
|
728
|
-
import { jsx as jsx6, jsxs as jsxs6 } from "preact/jsx-runtime";
|
|
729
|
-
function TagEditor({ tags, onAdd, onRemove, suggest, disabled = false }) {
|
|
730
|
-
return /* @__PURE__ */ jsxs6("div", { className: "crm-tag-editor", children: [
|
|
731
|
-
/* @__PURE__ */ jsx6("div", { className: "chips", role: "group", "aria-label": "Tags", children: tags.map((tag) => /* @__PURE__ */ jsxs6("span", { className: "chip crm-tag-chip", children: [
|
|
732
|
-
tag.tag,
|
|
733
|
-
/* @__PURE__ */ jsx6(
|
|
734
|
-
"button",
|
|
735
|
-
{
|
|
736
|
-
type: "button",
|
|
737
|
-
className: "crm-tag-remove",
|
|
738
|
-
"aria-label": `Remove tag ${tag.tag}`,
|
|
739
|
-
disabled,
|
|
740
|
-
onClick: () => onRemove(tag.tag),
|
|
741
|
-
children: "\xD7"
|
|
742
|
-
}
|
|
743
|
-
)
|
|
744
|
-
] }, tag.id)) }),
|
|
745
|
-
/* @__PURE__ */ jsx6(
|
|
746
|
-
Combobox,
|
|
747
|
-
{
|
|
748
|
-
ariaLabel: "Add tag",
|
|
749
|
-
placeholder: "Add tag\u2026",
|
|
750
|
-
freeText: true,
|
|
751
|
-
disabled,
|
|
752
|
-
search: suggest ?? (() => []),
|
|
753
|
-
onPick: (value) => onAdd(value)
|
|
754
|
-
}
|
|
755
|
-
)
|
|
756
|
-
] });
|
|
757
|
-
}
|
|
758
|
-
|
|
759
|
-
// src/ui/record-panel.tsx
|
|
760
|
-
import { jsx as jsx7, jsxs as jsxs7 } from "preact/jsx-runtime";
|
|
761
|
-
function RecordPanel({
|
|
762
|
-
crm,
|
|
763
|
-
detail,
|
|
764
|
-
onSaveFields,
|
|
765
|
-
onMoveStage,
|
|
766
|
-
onAddTag,
|
|
767
|
-
onRemoveTag,
|
|
768
|
-
onLinkIdentity,
|
|
769
|
-
saving = false,
|
|
770
|
-
fieldErrors,
|
|
771
|
-
activitySlot,
|
|
772
|
-
stagePlacement = "header",
|
|
773
|
-
facetPlacement = "cards",
|
|
774
|
-
tabs,
|
|
775
|
-
extendTabs,
|
|
776
|
-
tab,
|
|
777
|
-
defaultTab = "profile",
|
|
778
|
-
onTabChange,
|
|
779
|
-
hrefForTab,
|
|
780
|
-
header,
|
|
781
|
-
headerActions,
|
|
782
|
-
mount = "active"
|
|
783
|
-
}) {
|
|
784
|
-
const { record, tags, channels, links } = detail;
|
|
785
|
-
const def = crm.type(record.type);
|
|
786
|
-
const facets = def.facets ?? {};
|
|
787
|
-
const identity = facets.identity ? /* @__PURE__ */ jsx7(IdentityCard, { record, onLink: onLinkIdentity, linking: saving }) : null;
|
|
788
|
-
const billing = facets.billing ? /* @__PURE__ */ jsx7(BillingCard, { record }) : null;
|
|
789
|
-
const channelsCard = facets.email !== false && channels.length > 0 ? /* @__PURE__ */ jsx7(ChannelsCard, { channels }) : null;
|
|
790
|
-
const profile = /* @__PURE__ */ jsxs7("div", { className: "crm-panel-profile", children: [
|
|
791
|
-
/* @__PURE__ */ jsx7(
|
|
792
|
-
FieldsForm,
|
|
793
|
-
{
|
|
794
|
-
crm,
|
|
795
|
-
type: record.type,
|
|
796
|
-
record,
|
|
797
|
-
onSubmit: onSaveFields,
|
|
798
|
-
submitting: saving,
|
|
799
|
-
errors: fieldErrors
|
|
800
|
-
},
|
|
801
|
-
record.id + String(record.updatedAt)
|
|
802
|
-
),
|
|
803
|
-
facetPlacement === "tabs" && (identity || channelsCard) ? /* @__PURE__ */ jsxs7("div", { className: "crm-panel-cards", children: [
|
|
804
|
-
identity,
|
|
805
|
-
channelsCard
|
|
806
|
-
] }) : null
|
|
807
|
-
] });
|
|
808
|
-
const connections = /* @__PURE__ */ jsxs7("div", { className: "crm-panel-connections", children: [
|
|
809
|
-
/* @__PURE__ */ jsx7(TagEditor, { tags, onAdd: onAddTag, onRemove: onRemoveTag, disabled: saving }),
|
|
810
|
-
/* @__PURE__ */ jsx7("ul", { className: "crm-link-list", "aria-label": "Linked records", children: links.map((link) => /* @__PURE__ */ jsxs7("li", { children: [
|
|
811
|
-
link.relation,
|
|
812
|
-
": ",
|
|
813
|
-
/* @__PURE__ */ jsx7("code", { children: link.fromId === record.id ? link.toId : link.fromId })
|
|
814
|
-
] }, link.id)) })
|
|
815
|
-
] });
|
|
816
|
-
const stage = def.pipeline ? /* @__PURE__ */ jsx7("div", { className: "crm-panel-stage", children: /* @__PURE__ */ jsx7(StageControl, { crm, record, onMove: onMoveStage, disabled: saving }) }) : null;
|
|
817
|
-
const network = detail.origins?.length || detail.deliveries?.length ? /* @__PURE__ */ jsxs7("div", { className: "crm-panel-connections", children: [
|
|
818
|
-
detail.origins?.length ? /* @__PURE__ */ jsxs7("section", { children: [
|
|
819
|
-
/* @__PURE__ */ jsx7("h3", { children: "Received from" }),
|
|
820
|
-
/* @__PURE__ */ jsx7("ul", { className: "crm-link-list", children: detail.origins.map((origin) => /* @__PURE__ */ jsxs7("li", { children: [
|
|
821
|
-
/* @__PURE__ */ jsx7("strong", { children: origin.sourceId }),
|
|
822
|
-
" ",
|
|
823
|
-
/* @__PURE__ */ jsx7("code", { children: origin.sourceRecordId }),
|
|
824
|
-
/* @__PURE__ */ jsxs7("span", { children: [
|
|
825
|
-
" \xB7 ",
|
|
826
|
-
new Date(origin.lastReceivedAt).toLocaleString()
|
|
827
|
-
] })
|
|
828
|
-
] }, origin.key)) })
|
|
829
|
-
] }) : null,
|
|
830
|
-
detail.deliveries?.length ? /* @__PURE__ */ jsxs7("section", { children: [
|
|
831
|
-
/* @__PURE__ */ jsx7("h3", { children: "Shared with" }),
|
|
832
|
-
/* @__PURE__ */ jsx7("ul", { className: "crm-link-list", children: detail.deliveries.map((delivery) => /* @__PURE__ */ jsxs7("li", { children: [
|
|
833
|
-
/* @__PURE__ */ jsx7("strong", { children: delivery.targetId }),
|
|
834
|
-
" ",
|
|
835
|
-
/* @__PURE__ */ jsx7("span", { className: "crm-badge", children: delivery.status }),
|
|
836
|
-
/* @__PURE__ */ jsxs7("span", { children: [
|
|
837
|
-
" \xB7 ",
|
|
838
|
-
new Date(delivery.lastAttemptAt).toLocaleString()
|
|
839
|
-
] }),
|
|
840
|
-
delivery.error ? /* @__PURE__ */ jsxs7("span", { children: [
|
|
841
|
-
" \xB7 ",
|
|
842
|
-
delivery.error
|
|
843
|
-
] }) : null
|
|
844
|
-
] }, delivery.key)) })
|
|
845
|
-
] }) : null
|
|
846
|
-
] }) : null;
|
|
847
|
-
const builtInTabs = [
|
|
848
|
-
...stagePlacement === "tab" && stage ? [{ id: "stage", label: "Stage", panel: stage }] : [],
|
|
849
|
-
{ id: "profile", label: "Profile", panel: profile },
|
|
850
|
-
...activitySlot ? [{ id: "activity", label: "Activity", panel: activitySlot }] : [],
|
|
851
|
-
...facetPlacement === "tabs" && billing ? [{ id: "billing", label: "Billing", panel: billing }] : [],
|
|
852
|
-
{ id: "connections", label: "Connections", panel: connections },
|
|
853
|
-
...network ? [{ id: "network", label: "Network", panel: network }] : []
|
|
854
|
-
];
|
|
855
|
-
const configuredTabs = tabs ?? extendTabs?.(builtInTabs) ?? builtInTabs;
|
|
856
|
-
const resolvedTabs = configuredTabs.filter((item) => typeof item.visible === "function" ? item.visible(detail) : item.visible !== false).map((item) => ({
|
|
857
|
-
...item,
|
|
858
|
-
disabled: typeof item.disabled === "function" ? item.disabled(detail) : item.disabled
|
|
859
|
-
}));
|
|
860
|
-
return /* @__PURE__ */ jsxs7("div", { className: "crm-record-panel", "aria-label": record.name, children: [
|
|
861
|
-
header !== void 0 ? header : /* @__PURE__ */ jsxs7("header", { className: "crm-panel-header", children: [
|
|
862
|
-
/* @__PURE__ */ jsx7("h2", { children: record.name }),
|
|
863
|
-
stagePlacement === "header" ? stage : null,
|
|
864
|
-
headerActions
|
|
865
|
-
] }),
|
|
866
|
-
facetPlacement === "cards" && (identity || billing || channelsCard) ? /* @__PURE__ */ jsxs7("div", { className: "crm-panel-cards", children: [
|
|
867
|
-
identity,
|
|
868
|
-
billing,
|
|
869
|
-
channelsCard
|
|
870
|
-
] }) : null,
|
|
871
|
-
/* @__PURE__ */ jsx7(
|
|
872
|
-
Tabs,
|
|
873
|
-
{
|
|
874
|
-
ariaLabel: "Record detail",
|
|
875
|
-
items: resolvedTabs.map((item) => ({
|
|
876
|
-
value: item.id,
|
|
877
|
-
label: item.label,
|
|
878
|
-
panel: item.panel,
|
|
879
|
-
disabled: item.disabled,
|
|
880
|
-
href: item.href ?? hrefForTab?.(item.id)
|
|
881
|
-
})),
|
|
882
|
-
value: tab,
|
|
883
|
-
defaultValue: defaultTab,
|
|
884
|
-
onValueChange: onTabChange,
|
|
885
|
-
mount
|
|
886
|
-
}
|
|
887
|
-
)
|
|
888
|
-
] });
|
|
889
|
-
}
|
|
890
|
-
|
|
891
|
-
// src/ui/crm-workspace.tsx
|
|
892
|
-
import { useState as useState4 } from "preact/hooks";
|
|
893
|
-
import { MasterDetail } from "@odla-ai/ui/components";
|
|
894
|
-
import { jsx as jsx8, jsxs as jsxs8 } from "preact/jsx-runtime";
|
|
895
|
-
function CrmWorkspace({
|
|
896
|
-
crm,
|
|
897
|
-
client,
|
|
898
|
-
type,
|
|
899
|
-
recordId,
|
|
900
|
-
defaultRecordId = null,
|
|
901
|
-
onRecordIdChange,
|
|
902
|
-
hrefForRecord,
|
|
903
|
-
hrefForList,
|
|
904
|
-
detailTab,
|
|
905
|
-
defaultDetailTab,
|
|
906
|
-
onDetailTabChange,
|
|
907
|
-
hrefForDetailTab,
|
|
908
|
-
extendRecordTabs,
|
|
909
|
-
renderMaster,
|
|
910
|
-
renderSummary,
|
|
911
|
-
renderDetailHeader,
|
|
912
|
-
renderDetail,
|
|
913
|
-
renderEmptyDetail,
|
|
914
|
-
collapseClosedDetail = true,
|
|
915
|
-
lifecycle,
|
|
916
|
-
requireLifecycleAdapter = false,
|
|
917
|
-
stagePlacement = "tab",
|
|
918
|
-
facetPlacement = "tabs",
|
|
919
|
-
columns,
|
|
920
|
-
toolbar,
|
|
921
|
-
emptyDetail
|
|
922
|
-
}) {
|
|
923
|
-
const query = useCrmQuery(client, type);
|
|
924
|
-
const [internalId, setInternalId] = useState4(defaultRecordId);
|
|
925
|
-
const selectedId = recordId === void 0 ? internalId : recordId;
|
|
926
|
-
const record = useCrmRecord(client, selectedId);
|
|
927
|
-
const [saving, setSaving] = useState4(false);
|
|
928
|
-
const select = (id, opened) => {
|
|
929
|
-
if (recordId === void 0) setInternalId(id);
|
|
930
|
-
onRecordIdChange?.(id, opened);
|
|
931
|
-
};
|
|
932
|
-
const refresh = () => {
|
|
933
|
-
record.refresh();
|
|
934
|
-
query.refresh();
|
|
935
|
-
};
|
|
936
|
-
const saveFields = async (input) => {
|
|
937
|
-
if (!selectedId) return;
|
|
938
|
-
setSaving(true);
|
|
939
|
-
try {
|
|
940
|
-
await client.updateRecord(selectedId, { input });
|
|
941
|
-
refresh();
|
|
942
|
-
} finally {
|
|
943
|
-
setSaving(false);
|
|
944
|
-
}
|
|
945
|
-
};
|
|
946
|
-
const moveStage = async (to) => {
|
|
947
|
-
if (!selectedId || !record.detail) return;
|
|
948
|
-
if (requireLifecycleAdapter && !lifecycle) {
|
|
949
|
-
throw new Error("This collection requires a lifecycle adapter for stage transitions.");
|
|
950
|
-
}
|
|
951
|
-
setSaving(true);
|
|
952
|
-
try {
|
|
953
|
-
if (lifecycle) {
|
|
954
|
-
await lifecycle.transitionStage({
|
|
955
|
-
record: record.detail.record,
|
|
956
|
-
detail: record.detail,
|
|
957
|
-
from: record.detail.record.stage ?? null,
|
|
958
|
-
to,
|
|
959
|
-
client,
|
|
960
|
-
refreshRecord: record.refresh,
|
|
961
|
-
refreshList: query.refresh
|
|
962
|
-
});
|
|
963
|
-
} else {
|
|
964
|
-
await client.setStage(selectedId, to);
|
|
965
|
-
}
|
|
966
|
-
refresh();
|
|
967
|
-
} finally {
|
|
968
|
-
setSaving(false);
|
|
969
|
-
}
|
|
970
|
-
};
|
|
971
|
-
const addTag = async (tag) => {
|
|
972
|
-
if (!selectedId) return;
|
|
973
|
-
await client.addTag(selectedId, tag);
|
|
974
|
-
record.refresh();
|
|
975
|
-
};
|
|
976
|
-
const removeTag = async (tag) => {
|
|
977
|
-
if (!selectedId) return;
|
|
978
|
-
await client.removeTag(selectedId, tag);
|
|
979
|
-
record.refresh();
|
|
980
|
-
};
|
|
981
|
-
const linkIdentity = async () => {
|
|
982
|
-
if (!selectedId) return;
|
|
983
|
-
setSaving(true);
|
|
984
|
-
try {
|
|
985
|
-
await client.linkIdentity(selectedId);
|
|
986
|
-
refresh();
|
|
987
|
-
} finally {
|
|
988
|
-
setSaving(false);
|
|
989
|
-
}
|
|
990
|
-
};
|
|
991
|
-
const defaultMaster = /* @__PURE__ */ jsx8(
|
|
992
|
-
CrmList,
|
|
993
|
-
{
|
|
994
|
-
crm,
|
|
995
|
-
type,
|
|
996
|
-
query,
|
|
997
|
-
columns,
|
|
998
|
-
toolbar,
|
|
999
|
-
hrefForRecord,
|
|
1000
|
-
onOpenRecord: (opened) => select(opened.id, opened)
|
|
1001
|
-
}
|
|
1002
|
-
);
|
|
1003
|
-
const masterContext = {
|
|
1004
|
-
crm,
|
|
1005
|
-
client,
|
|
1006
|
-
type,
|
|
1007
|
-
query,
|
|
1008
|
-
selectedRecordId: selectedId,
|
|
1009
|
-
defaultMaster,
|
|
1010
|
-
openRecord: (opened) => select(opened.id, opened),
|
|
1011
|
-
closeRecord: () => select(null),
|
|
1012
|
-
...hrefForRecord ? { hrefForRecord } : {}
|
|
1013
|
-
};
|
|
1014
|
-
const recordContext = record.detail ? {
|
|
1015
|
-
crm,
|
|
1016
|
-
type,
|
|
1017
|
-
detail: record.detail,
|
|
1018
|
-
client,
|
|
1019
|
-
query,
|
|
1020
|
-
saving,
|
|
1021
|
-
refreshRecord: record.refresh,
|
|
1022
|
-
refreshList: query.refresh,
|
|
1023
|
-
saveFields,
|
|
1024
|
-
moveStage,
|
|
1025
|
-
addTag,
|
|
1026
|
-
removeTag,
|
|
1027
|
-
linkIdentity
|
|
1028
|
-
} : null;
|
|
1029
|
-
const defaultDetail = record.detail && recordContext ? /* @__PURE__ */ jsx8(
|
|
1030
|
-
RecordPanel,
|
|
1031
|
-
{
|
|
1032
|
-
crm,
|
|
1033
|
-
detail: record.detail,
|
|
1034
|
-
onSaveFields: saveFields,
|
|
1035
|
-
onMoveStage: moveStage,
|
|
1036
|
-
onAddTag: addTag,
|
|
1037
|
-
onRemoveTag: removeTag,
|
|
1038
|
-
onLinkIdentity: linkIdentity,
|
|
1039
|
-
saving,
|
|
1040
|
-
stagePlacement,
|
|
1041
|
-
facetPlacement,
|
|
1042
|
-
tab: detailTab,
|
|
1043
|
-
defaultTab: defaultDetailTab,
|
|
1044
|
-
onTabChange: onDetailTabChange,
|
|
1045
|
-
hrefForTab: hrefForDetailTab,
|
|
1046
|
-
header: renderDetailHeader?.(recordContext),
|
|
1047
|
-
extendTabs: extendRecordTabs ? (base) => extendRecordTabs(base, recordContext) : void 0
|
|
1048
|
-
}
|
|
1049
|
-
) : null;
|
|
1050
|
-
const detail = defaultDetail && recordContext ? renderDetail ? renderDetail(recordContext, defaultDetail) : defaultDetail : selectedId ? /* @__PURE__ */ jsx8("div", { className: "crm-workspace-state", role: record.error ? "alert" : "status", children: record.error ?? "Loading record\u2026" }) : null;
|
|
1051
|
-
return /* @__PURE__ */ jsxs8("div", { className: "crm-workspace", children: [
|
|
1052
|
-
renderSummary ? /* @__PURE__ */ jsx8("div", { className: "crm-workspace-summary", children: renderSummary(masterContext) }) : null,
|
|
1053
|
-
/* @__PURE__ */ jsx8(
|
|
1054
|
-
MasterDetail,
|
|
1055
|
-
{
|
|
1056
|
-
master: renderMaster?.(masterContext) ?? defaultMaster,
|
|
1057
|
-
detail,
|
|
1058
|
-
detailOpen: selectedId != null,
|
|
1059
|
-
emptyDetail: renderEmptyDetail?.(masterContext) ?? emptyDetail,
|
|
1060
|
-
collapseClosedDetail,
|
|
1061
|
-
masterLabel: `${crm.type(type).labelPlural ?? crm.type(type).label} list`,
|
|
1062
|
-
detailLabel: record.detail ? `${record.detail.record.name} details` : "Record details",
|
|
1063
|
-
closeHref: hrefForList,
|
|
1064
|
-
onClose: () => select(null)
|
|
1065
|
-
}
|
|
1066
|
-
)
|
|
1067
|
-
] });
|
|
1068
|
-
}
|
|
1069
|
-
|
|
1070
|
-
// src/ui/activity-feed.tsx
|
|
1071
|
-
import { useEffect as useEffect2, useRef as useRef2, useState as useState5 } from "preact/hooks";
|
|
1072
|
-
import { Button as Button4, Checkbox as Checkbox2, Input as Input2, Segmented, Textarea as Textarea2 } from "@odla-ai/ui/components";
|
|
1073
|
-
import { Fragment, jsx as jsx9, jsxs as jsxs9 } from "preact/jsx-runtime";
|
|
1074
|
-
var when = (at) => new Date(at).toISOString().replace("T", " ").slice(0, 16);
|
|
1075
|
-
function ActivityFeed({
|
|
1076
|
-
activities,
|
|
1077
|
-
onAddNote,
|
|
1078
|
-
onAddTask,
|
|
1079
|
-
onToggleTask,
|
|
1080
|
-
busy = false,
|
|
1081
|
-
focusedActivityId
|
|
1082
|
-
}) {
|
|
1083
|
-
const [mode, setMode] = useState5("note");
|
|
1084
|
-
const [body, setBody] = useState5("");
|
|
1085
|
-
const [dueAt, setDueAt] = useState5("");
|
|
1086
|
-
const [waitingOn, setWaitingOn] = useState5("");
|
|
1087
|
-
const focused = useRef2(null);
|
|
1088
|
-
useEffect2(() => {
|
|
1089
|
-
if (!focusedActivityId || !focused.current) return;
|
|
1090
|
-
focused.current.focus({ preventScroll: true });
|
|
1091
|
-
focused.current.scrollIntoView?.({ block: "center" });
|
|
1092
|
-
}, [activities, focusedActivityId]);
|
|
1093
|
-
const submit = () => {
|
|
1094
|
-
const text = body.trim();
|
|
1095
|
-
if (!text) return;
|
|
1096
|
-
if (mode === "note") onAddNote(text);
|
|
1097
|
-
else
|
|
1098
|
-
onAddTask({
|
|
1099
|
-
body: text,
|
|
1100
|
-
...dueAt ? { dueAt: Date.parse(dueAt) } : {},
|
|
1101
|
-
...waitingOn.trim() ? { waitingOn: waitingOn.trim() } : {}
|
|
1102
|
-
});
|
|
1103
|
-
setBody("");
|
|
1104
|
-
setDueAt("");
|
|
1105
|
-
setWaitingOn("");
|
|
1106
|
-
};
|
|
1107
|
-
return /* @__PURE__ */ jsxs9("div", { className: "crm-activity-feed", children: [
|
|
1108
|
-
/* @__PURE__ */ jsxs9("div", { className: "crm-activity-composer", children: [
|
|
1109
|
-
/* @__PURE__ */ jsx9(
|
|
1110
|
-
Segmented,
|
|
1111
|
-
{
|
|
1112
|
-
ariaLabel: "Entry kind",
|
|
1113
|
-
value: mode,
|
|
1114
|
-
onValueChange: (value) => setMode(value),
|
|
1115
|
-
options: [
|
|
1116
|
-
{ value: "note", label: "Note" },
|
|
1117
|
-
{ value: "task", label: "Follow-up" }
|
|
1118
|
-
]
|
|
1119
|
-
}
|
|
1120
|
-
),
|
|
1121
|
-
/* @__PURE__ */ jsx9(
|
|
1122
|
-
Textarea2,
|
|
1123
|
-
{
|
|
1124
|
-
"aria-label": mode === "note" ? "New note" : "New follow-up",
|
|
1125
|
-
value: body,
|
|
1126
|
-
rows: 2,
|
|
1127
|
-
placeholder: mode === "note" ? "What happened?" : "What needs doing?",
|
|
1128
|
-
onInput: (event) => setBody(event.currentTarget.value)
|
|
1129
|
-
}
|
|
1130
|
-
),
|
|
1131
|
-
mode === "task" && /* @__PURE__ */ jsxs9("div", { className: "crm-activity-task-row", children: [
|
|
1132
|
-
/* @__PURE__ */ jsx9(
|
|
1133
|
-
Input2,
|
|
1134
|
-
{
|
|
1135
|
-
type: "date",
|
|
1136
|
-
"aria-label": "Due date",
|
|
1137
|
-
value: dueAt,
|
|
1138
|
-
onInput: (event) => setDueAt(event.currentTarget.value)
|
|
1139
|
-
}
|
|
1140
|
-
),
|
|
1141
|
-
/* @__PURE__ */ jsx9(
|
|
1142
|
-
Input2,
|
|
1143
|
-
{
|
|
1144
|
-
"aria-label": "Waiting on",
|
|
1145
|
-
placeholder: "Waiting on\u2026",
|
|
1146
|
-
value: waitingOn,
|
|
1147
|
-
onInput: (event) => setWaitingOn(event.currentTarget.value)
|
|
1148
|
-
}
|
|
1149
|
-
)
|
|
1150
|
-
] }),
|
|
1151
|
-
/* @__PURE__ */ jsx9(Button4, { mini: true, onClick: submit, disabled: busy || !body.trim(), children: "Add" })
|
|
1152
|
-
] }),
|
|
1153
|
-
/* @__PURE__ */ jsx9("ul", { className: "crm-activity-list", children: activities.map((activity) => /* @__PURE__ */ jsxs9(
|
|
1154
|
-
"li",
|
|
1155
|
-
{
|
|
1156
|
-
className: `crm-activity kind-${activity.kind}`,
|
|
1157
|
-
ref: activity.id === focusedActivityId ? focused : void 0,
|
|
1158
|
-
tabIndex: activity.id === focusedActivityId ? -1 : void 0,
|
|
1159
|
-
"aria-current": activity.id === focusedActivityId ? "true" : void 0,
|
|
1160
|
-
children: [
|
|
1161
|
-
activity.kind === "task" ? /* @__PURE__ */ jsx9(
|
|
1162
|
-
Checkbox2,
|
|
1163
|
-
{
|
|
1164
|
-
checked: activity.status === "done",
|
|
1165
|
-
disabled: busy,
|
|
1166
|
-
onChange: (event) => onToggleTask(activity, event.currentTarget.checked),
|
|
1167
|
-
label: /* @__PURE__ */ jsxs9(Fragment, { children: [
|
|
1168
|
-
activity.body,
|
|
1169
|
-
activity.dueAt != null && /* @__PURE__ */ jsxs9("span", { className: "crm-activity-due", children: [
|
|
1170
|
-
" \xB7 due ",
|
|
1171
|
-
when(activity.dueAt).slice(0, 10)
|
|
1172
|
-
] }),
|
|
1173
|
-
activity.waitingOn && /* @__PURE__ */ jsxs9("span", { className: "crm-activity-waiting", children: [
|
|
1174
|
-
" \xB7 waiting on ",
|
|
1175
|
-
activity.waitingOn
|
|
1176
|
-
] })
|
|
1177
|
-
] })
|
|
1178
|
-
}
|
|
1179
|
-
) : /* @__PURE__ */ jsx9("p", { children: activity.body }),
|
|
1180
|
-
/* @__PURE__ */ jsxs9("span", { className: "crm-activity-meta", children: [
|
|
1181
|
-
activity.kind,
|
|
1182
|
-
" \xB7 ",
|
|
1183
|
-
when(activity.createdAt)
|
|
1184
|
-
] })
|
|
1185
|
-
]
|
|
1186
|
-
},
|
|
1187
|
-
activity.id
|
|
1188
|
-
)) })
|
|
1189
|
-
] });
|
|
1190
|
-
}
|
|
1191
|
-
|
|
1192
|
-
// src/ui/bulk-bar.tsx
|
|
1193
|
-
import { Button as Button5 } from "@odla-ai/ui/components";
|
|
1194
|
-
import { jsx as jsx10, jsxs as jsxs10 } from "preact/jsx-runtime";
|
|
1195
|
-
function BulkBar({ selected, actions, onClear, busy = false }) {
|
|
1196
|
-
if (selected.length === 0) return null;
|
|
1197
|
-
return /* @__PURE__ */ jsxs10("div", { className: "crm-bulk-bar", role: "toolbar", "aria-label": "Bulk actions", children: [
|
|
1198
|
-
/* @__PURE__ */ jsxs10("span", { className: "crm-bulk-count", children: [
|
|
1199
|
-
selected.length,
|
|
1200
|
-
" selected"
|
|
1201
|
-
] }),
|
|
1202
|
-
actions.map((action) => /* @__PURE__ */ jsx10(Button5, { mini: true, disabled: busy, onClick: () => void action.run(selected), children: action.label }, action.id)),
|
|
1203
|
-
/* @__PURE__ */ jsx10(Button5, { mini: true, variant: "ghost", onClick: onClear, disabled: busy, children: "Clear" })
|
|
1204
|
-
] });
|
|
1205
|
-
}
|
|
1206
|
-
|
|
1207
|
-
// src/ui/view-editor.tsx
|
|
1208
|
-
import { useState as useState6 } from "preact/hooks";
|
|
1209
|
-
import { Button as Button6, Checkbox as Checkbox3, Input as Input3 } from "@odla-ai/ui/components";
|
|
1210
|
-
import { jsx as jsx11, jsxs as jsxs11 } from "preact/jsx-runtime";
|
|
1211
|
-
function ViewEditor({ current, onSave }) {
|
|
1212
|
-
const [open, setOpen] = useState6(false);
|
|
1213
|
-
const [name, setName] = useState6("");
|
|
1214
|
-
const [shared, setShared] = useState6(false);
|
|
1215
|
-
const [busy, setBusy] = useState6(false);
|
|
1216
|
-
const [error, setError] = useState6(null);
|
|
1217
|
-
if (!open)
|
|
1218
|
-
return /* @__PURE__ */ jsx11(Button6, { mini: true, variant: "ghost", onClick: () => setOpen(true), children: "Save view\u2026" });
|
|
1219
|
-
const save = async () => {
|
|
1220
|
-
setBusy(true);
|
|
1221
|
-
setError(null);
|
|
1222
|
-
try {
|
|
1223
|
-
await onSave({ ...current, name: name.trim(), shared });
|
|
1224
|
-
setOpen(false);
|
|
1225
|
-
setName("");
|
|
1226
|
-
setShared(false);
|
|
1227
|
-
} catch (failure) {
|
|
1228
|
-
setError(failure instanceof Error ? failure.message : String(failure));
|
|
1229
|
-
} finally {
|
|
1230
|
-
setBusy(false);
|
|
1231
|
-
}
|
|
1232
|
-
};
|
|
1233
|
-
return /* @__PURE__ */ jsxs11("div", { className: "crm-view-editor", role: "group", "aria-label": "Save view", children: [
|
|
1234
|
-
/* @__PURE__ */ jsx11(
|
|
1235
|
-
Input3,
|
|
1236
|
-
{
|
|
1237
|
-
"aria-label": "View name",
|
|
1238
|
-
placeholder: "View name",
|
|
1239
|
-
value: name,
|
|
1240
|
-
onInput: (event) => setName(event.currentTarget.value)
|
|
1241
|
-
}
|
|
1242
|
-
),
|
|
1243
|
-
/* @__PURE__ */ jsx11(
|
|
1244
|
-
Checkbox3,
|
|
1245
|
-
{
|
|
1246
|
-
checked: shared,
|
|
1247
|
-
onChange: (event) => setShared(event.currentTarget.checked),
|
|
1248
|
-
label: "Shared"
|
|
1249
|
-
}
|
|
1250
|
-
),
|
|
1251
|
-
/* @__PURE__ */ jsx11(Button6, { mini: true, onClick: save, disabled: busy || !name.trim(), children: "Save" }),
|
|
1252
|
-
/* @__PURE__ */ jsx11(Button6, { mini: true, variant: "ghost", onClick: () => setOpen(false), disabled: busy, children: "Cancel" }),
|
|
1253
|
-
error && /* @__PURE__ */ jsx11("span", { className: "crm-view-error", children: error })
|
|
1254
|
-
] });
|
|
1255
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
ActivityFeed,
|
|
3
|
+
BillingCard,
|
|
4
|
+
BulkBar,
|
|
5
|
+
ChannelsCard,
|
|
6
|
+
CrmList,
|
|
7
|
+
CrmShell,
|
|
8
|
+
CrmWorkspace,
|
|
9
|
+
FieldsForm,
|
|
10
|
+
IdentityCard,
|
|
11
|
+
RecordPanel,
|
|
12
|
+
StageControl,
|
|
13
|
+
TagEditor,
|
|
14
|
+
ViewEditor,
|
|
15
|
+
columnsFor,
|
|
16
|
+
defaultColumns,
|
|
17
|
+
sortFieldFor,
|
|
18
|
+
useCrmQuery,
|
|
19
|
+
useCrmRecord
|
|
20
|
+
} from "../chunk-7LH3WGSU.js";
|
|
1256
21
|
export {
|
|
1257
22
|
ActivityFeed,
|
|
1258
23
|
BillingCard,
|