@mulmoclaude/collection-plugin 0.5.8 → 0.5.11
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/style.css +15 -248
- package/dist/vue/collectionViewMode.d.ts +10 -1
- package/dist/vue/collectionViewMode.d.ts.map +1 -1
- package/dist/vue/components/CollectionCalendarView.vue.d.ts +1 -2
- package/dist/vue/components/CollectionCalendarView.vue.d.ts.map +1 -1
- package/dist/vue/components/CollectionCustomView.vue.d.ts +1 -1
- package/dist/vue/components/CollectionCustomView.vue.d.ts.map +1 -1
- package/dist/vue/components/CollectionDayView.vue.d.ts +1 -2
- package/dist/vue/components/CollectionDayView.vue.d.ts.map +1 -1
- package/dist/vue/components/CollectionEmbedView.vue.d.ts +1 -1
- package/dist/vue/components/CollectionEmbedView.vue.d.ts.map +1 -1
- package/dist/vue/components/CollectionKanbanView.vue.d.ts +1 -2
- package/dist/vue/components/CollectionKanbanView.vue.d.ts.map +1 -1
- package/dist/vue/components/CollectionRecordPanel.vue.d.ts +5 -6
- package/dist/vue/components/CollectionRecordPanel.vue.d.ts.map +1 -1
- package/dist/vue/components/CollectionView.vue.d.ts +18 -3
- package/dist/vue/components/CollectionView.vue.d.ts.map +1 -1
- package/dist/vue/components/CollectionViewConfigModal.vue.d.ts +1 -1
- package/dist/vue/components/CollectionViewConfigModal.vue.d.ts.map +1 -1
- package/dist/vue/index.d.ts +2 -2
- package/dist/vue/index.d.ts.map +1 -1
- package/dist/vue/lang/de.d.ts.map +1 -1
- package/dist/vue/lang/en.d.ts +1 -0
- package/dist/vue/lang/en.d.ts.map +1 -1
- package/dist/vue/lang/es.d.ts.map +1 -1
- package/dist/vue/lang/fr.d.ts.map +1 -1
- package/dist/vue/lang/index.d.ts +1 -0
- package/dist/vue/lang/index.d.ts.map +1 -1
- package/dist/vue/lang/ja.d.ts.map +1 -1
- package/dist/vue/lang/ko.d.ts.map +1 -1
- package/dist/vue/lang/ptBR.d.ts.map +1 -1
- package/dist/vue/lang/zh.d.ts.map +1 -1
- package/dist/vue/uiContext.d.ts +7 -3
- package/dist/vue/uiContext.d.ts.map +1 -1
- package/dist/vue/useCollectionRendering.d.ts +1 -2
- package/dist/vue/useCollectionRendering.d.ts.map +1 -1
- package/dist/vue.cjs +296 -219
- package/dist/vue.cjs.map +1 -1
- package/dist/vue.js +213 -159
- package/dist/vue.js.map +1 -1
- package/package.json +10 -20
- package/dist/chunk-CKQMccvm.cjs +0 -28
- package/dist/core/actionVisible.d.ts +0 -35
- package/dist/core/actionVisible.d.ts.map +0 -1
- package/dist/core/calendarGrid.d.ts +0 -121
- package/dist/core/calendarGrid.d.ts.map +0 -1
- package/dist/core/deriveAll.d.ts +0 -39
- package/dist/core/deriveAll.d.ts.map +0 -1
- package/dist/core/derivedFormula.d.ts +0 -19
- package/dist/core/derivedFormula.d.ts.map +0 -1
- package/dist/core/draft.d.ts +0 -19
- package/dist/core/draft.d.ts.map +0 -1
- package/dist/core/enumColors.d.ts +0 -34
- package/dist/core/enumColors.d.ts.map +0 -1
- package/dist/core/errorMessage.d.ts +0 -5
- package/dist/core/errorMessage.d.ts.map +0 -1
- package/dist/core/itemLabel.d.ts +0 -13
- package/dist/core/itemLabel.d.ts.map +0 -1
- package/dist/core/presentCollection.d.ts +0 -14
- package/dist/core/presentCollection.d.ts.map +0 -1
- package/dist/core/promptSafety.d.ts +0 -2
- package/dist/core/promptSafety.d.ts.map +0 -1
- package/dist/core/schema.d.ts +0 -356
- package/dist/core/schema.d.ts.map +0 -1
- package/dist/core/shortHexId.d.ts +0 -9
- package/dist/core/shortHexId.d.ts.map +0 -1
- package/dist/core/sortItems.d.ts +0 -30
- package/dist/core/sortItems.d.ts.map +0 -1
- package/dist/core/uiTypes.d.ts +0 -107
- package/dist/core/uiTypes.d.ts.map +0 -1
- package/dist/deriveAll-BHcs1erT.js +0 -342
- package/dist/deriveAll-BHcs1erT.js.map +0 -1
- package/dist/deriveAll-BJ0Lvm1Q.cjs +0 -359
- package/dist/deriveAll-BJ0Lvm1Q.cjs.map +0 -1
- package/dist/index.cjs +0 -57
- package/dist/index.d.ts +0 -15
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -4
- package/dist/promptSafety-B0pPJkfQ.cjs +0 -1020
- package/dist/promptSafety-B0pPJkfQ.cjs.map +0 -1
- package/dist/promptSafety-DIQ2yDca.js +0 -739
- package/dist/promptSafety-DIQ2yDca.js.map +0 -1
- package/dist/schema-5P5ZJPrY.cjs +0 -42
- package/dist/schema-5P5ZJPrY.cjs.map +0 -1
- package/dist/schema-BcnitlL8.js +0 -25
- package/dist/schema-BcnitlL8.js.map +0 -1
- package/dist/server/atomic.d.ts +0 -2
- package/dist/server/atomic.d.ts.map +0 -1
- package/dist/server/delete.d.ts +0 -39
- package/dist/server/delete.d.ts.map +0 -1
- package/dist/server/derive.d.ts +0 -9
- package/dist/server/derive.d.ts.map +0 -1
- package/dist/server/discoveredCollection.d.ts +0 -19
- package/dist/server/discoveredCollection.d.ts.map +0 -1
- package/dist/server/discovery.d.ts +0 -228
- package/dist/server/discovery.d.ts.map +0 -1
- package/dist/server/host.d.ts +0 -78
- package/dist/server/host.d.ts.map +0 -1
- package/dist/server/index.d.ts +0 -12
- package/dist/server/index.d.ts.map +0 -1
- package/dist/server/io.d.ts +0 -115
- package/dist/server/io.d.ts.map +0 -1
- package/dist/server/paths.d.ts +0 -53
- package/dist/server/paths.d.ts.map +0 -1
- package/dist/server/spawn.d.ts +0 -56
- package/dist/server/spawn.d.ts.map +0 -1
- package/dist/server/templatePath.d.ts +0 -26
- package/dist/server/templatePath.d.ts.map +0 -1
- package/dist/server/util.d.ts +0 -4
- package/dist/server/util.d.ts.map +0 -1
- package/dist/server/validate.d.ts +0 -20
- package/dist/server/validate.d.ts.map +0 -1
- package/dist/server/views.d.ts +0 -21
- package/dist/server/views.d.ts.map +0 -1
- package/dist/server.cjs +0 -1759
- package/dist/server.cjs.map +0 -1
- package/dist/server.js +0 -1709
- package/dist/server.js.map +0 -1
package/dist/vue.cjs
CHANGED
|
@@ -1,11 +1,31 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
//#region \0rolldown/runtime.js
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
|
+
get: ((k) => from[k]).bind(null, key),
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
20
|
+
value: mod,
|
|
21
|
+
enumerable: true
|
|
22
|
+
}) : target, mod));
|
|
23
|
+
//#endregion
|
|
24
|
+
let _mulmoclaude_core_collection = require("@mulmoclaude/core/collection");
|
|
5
25
|
let vue = require("vue");
|
|
6
26
|
let vue_i18n = require("vue-i18n");
|
|
7
27
|
let vuedraggable = require("vuedraggable");
|
|
8
|
-
vuedraggable =
|
|
28
|
+
vuedraggable = __toESM(vuedraggable, 1);
|
|
9
29
|
//#region src/vue/uiContext.ts
|
|
10
30
|
var current = null;
|
|
11
31
|
/** Wire the collection view layer to a host. Call once at app startup. */
|
|
@@ -64,6 +84,7 @@ var i18n = (0, vue_i18n.createI18n)({
|
|
|
64
84
|
chat: "Chat",
|
|
65
85
|
refreshFeed: "Refresh",
|
|
66
86
|
refreshFailed: "Refresh failed: {error}",
|
|
87
|
+
refreshDispatched: "Refresh started in the background.",
|
|
67
88
|
feedChatSeed: "The \"{slug}\" feed is defined by the schema at `feeds/{slug}/schema.json` and its records live in `{dataPath}/` (one `<id>.json` per record). Using that schema and data, respond to this request: {message}",
|
|
68
89
|
feedsTitle: "Data-source feeds",
|
|
69
90
|
feedsEmpty: "No feeds registered yet.",
|
|
@@ -167,6 +188,7 @@ var i18n = (0, vue_i18n.createI18n)({
|
|
|
167
188
|
chat: "チャット",
|
|
168
189
|
refreshFeed: "更新",
|
|
169
190
|
refreshFailed: "更新に失敗しました: {error}",
|
|
191
|
+
refreshDispatched: "バックグラウンドで更新を開始しました。",
|
|
170
192
|
feedChatSeed: "フィード「{slug}」はスキーマ `feeds/{slug}/schema.json` で定義され、レコードは `{dataPath}/`(1 レコードにつき `<id>.json` 1 ファイル)に保存されています。このスキーマとデータを使って、次のリクエストに応えてください: {message}",
|
|
171
193
|
feedsTitle: "データソースフィード",
|
|
172
194
|
feedsEmpty: "登録されたフィードはありません。",
|
|
@@ -270,6 +292,7 @@ var i18n = (0, vue_i18n.createI18n)({
|
|
|
270
292
|
chat: "对话",
|
|
271
293
|
refreshFeed: "刷新",
|
|
272
294
|
refreshFailed: "刷新失败:{error}",
|
|
295
|
+
refreshDispatched: "已在后台开始刷新。",
|
|
273
296
|
feedChatSeed: "订阅源“{slug}”由 schema `feeds/{slug}/schema.json` 定义,其记录保存在 `{dataPath}/`(每条记录一个 `<id>.json` 文件)。请使用该 schema 和数据来响应以下请求:{message}",
|
|
274
297
|
feedsTitle: "数据源订阅",
|
|
275
298
|
feedsEmpty: "尚未注册任何订阅源。",
|
|
@@ -373,6 +396,7 @@ var i18n = (0, vue_i18n.createI18n)({
|
|
|
373
396
|
chat: "채팅",
|
|
374
397
|
refreshFeed: "새로고침",
|
|
375
398
|
refreshFailed: "새로고침 실패: {error}",
|
|
399
|
+
refreshDispatched: "백그라운드에서 새로고침을 시작했습니다.",
|
|
376
400
|
feedChatSeed: "“{slug}” 피드는 스키마 `feeds/{slug}/schema.json`로 정의되며, 레코드는 `{dataPath}/`(레코드당 `<id>.json` 파일 하나)에 저장됩니다. 이 스키마와 데이터를 사용하여 다음 요청에 응답하세요: {message}",
|
|
377
401
|
feedsTitle: "데이터 소스 피드",
|
|
378
402
|
feedsEmpty: "등록된 피드가 없습니다.",
|
|
@@ -476,6 +500,7 @@ var i18n = (0, vue_i18n.createI18n)({
|
|
|
476
500
|
chat: "Chat",
|
|
477
501
|
refreshFeed: "Actualizar",
|
|
478
502
|
refreshFailed: "Error al actualizar: {error}",
|
|
503
|
+
refreshDispatched: "Actualización iniciada en segundo plano.",
|
|
479
504
|
feedChatSeed: "El feed «{slug}» está definido por el esquema `feeds/{slug}/schema.json` y sus registros se guardan en `{dataPath}/` (un archivo `<id>.json` por registro). Usa ese esquema y esos datos para responder a esta solicitud: {message}",
|
|
480
505
|
feedsTitle: "Fuentes de datos",
|
|
481
506
|
feedsEmpty: "Aún no hay fuentes registradas.",
|
|
@@ -579,6 +604,7 @@ var i18n = (0, vue_i18n.createI18n)({
|
|
|
579
604
|
chat: "Chat",
|
|
580
605
|
refreshFeed: "Atualizar",
|
|
581
606
|
refreshFailed: "Falha ao atualizar: {error}",
|
|
607
|
+
refreshDispatched: "Atualização iniciada em segundo plano.",
|
|
582
608
|
feedChatSeed: "O feed \"{slug}\" é definido pelo esquema `feeds/{slug}/schema.json` e seus registros ficam em `{dataPath}/` (um arquivo `<id>.json` por registro). Use esse esquema e esses dados para responder a esta solicitação: {message}",
|
|
583
609
|
feedsTitle: "Feeds de dados",
|
|
584
610
|
feedsEmpty: "Nenhum feed registrado ainda.",
|
|
@@ -682,6 +708,7 @@ var i18n = (0, vue_i18n.createI18n)({
|
|
|
682
708
|
chat: "Discussion",
|
|
683
709
|
refreshFeed: "Actualiser",
|
|
684
710
|
refreshFailed: "Échec de l'actualisation : {error}",
|
|
711
|
+
refreshDispatched: "Actualisation lancée en arrière-plan.",
|
|
685
712
|
feedChatSeed: "Le flux « {slug} » est défini par le schéma `feeds/{slug}/schema.json` et ses enregistrements se trouvent dans `{dataPath}/` (un fichier `<id>.json` par enregistrement). Utilise ce schéma et ces données pour répondre à cette demande : {message}",
|
|
686
713
|
feedsTitle: "Flux de données",
|
|
687
714
|
feedsEmpty: "Aucun flux enregistré pour le moment.",
|
|
@@ -785,6 +812,7 @@ var i18n = (0, vue_i18n.createI18n)({
|
|
|
785
812
|
chat: "Chat",
|
|
786
813
|
refreshFeed: "Aktualisieren",
|
|
787
814
|
refreshFailed: "Aktualisierung fehlgeschlagen: {error}",
|
|
815
|
+
refreshDispatched: "Aktualisierung im Hintergrund gestartet.",
|
|
788
816
|
feedChatSeed: "Der Feed {slug} ist durch das Schema `feeds/{slug}/schema.json` definiert und seine Datensätze liegen in `{dataPath}/` (eine `<id>.json`-Datei pro Datensatz). Nutze dieses Schema und diese Daten, um auf die folgende Anfrage zu antworten: {message}",
|
|
789
817
|
feedsTitle: "Datenquellen-Feeds",
|
|
790
818
|
feedsEmpty: "Noch keine Feeds registriert.",
|
|
@@ -1001,29 +1029,29 @@ var CollectionCalendarView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
1001
1029
|
const now = /* @__PURE__ */ new Date();
|
|
1002
1030
|
const viewYear = (0, vue.ref)(now.getFullYear());
|
|
1003
1031
|
const viewMonth = (0, vue.ref)(now.getMonth() + 1);
|
|
1004
|
-
const todayKey =
|
|
1032
|
+
const todayKey = (0, _mulmoclaude_core_collection.ymdKey)({
|
|
1005
1033
|
year: now.getFullYear(),
|
|
1006
1034
|
month: now.getMonth() + 1,
|
|
1007
1035
|
day: now.getDate()
|
|
1008
1036
|
});
|
|
1009
|
-
const grid = (0, vue.computed)(() =>
|
|
1010
|
-
const bucketed = (0, vue.computed)(() =>
|
|
1011
|
-
const labelField = (0, vue.computed)(() =>
|
|
1037
|
+
const grid = (0, vue.computed)(() => (0, _mulmoclaude_core_collection.buildMonthGrid)(viewYear.value, viewMonth.value));
|
|
1038
|
+
const bucketed = (0, vue.computed)(() => (0, _mulmoclaude_core_collection.bucketRecords)(props.items, props.anchorField, props.endField, props.timeField));
|
|
1039
|
+
const labelField = (0, vue.computed)(() => (0, _mulmoclaude_core_collection.labelFieldFor)(props.schema));
|
|
1012
1040
|
function colorOf(item) {
|
|
1013
|
-
return props.colorField ?
|
|
1041
|
+
return props.colorField ? (0, _mulmoclaude_core_collection.resolveEnumColor)(props.schema, props.colorField, item[props.colorField]) : null;
|
|
1014
1042
|
}
|
|
1015
1043
|
function sliceStartKey(slice) {
|
|
1016
|
-
return slice.kind === "allDay" ?
|
|
1044
|
+
return slice.kind === "allDay" ? _mulmoclaude_core_collection.MINUTES_PER_DAY + 1 : slice.startMin;
|
|
1017
1045
|
}
|
|
1018
1046
|
/** Records whose span covers a given day, ordered by start time so the month
|
|
1019
1047
|
* grid stacks chips the same way the day (time-allocation) view does. */
|
|
1020
1048
|
function recordsOnDay(day) {
|
|
1021
1049
|
return bucketed.value.spans.map((span) => ({
|
|
1022
1050
|
span,
|
|
1023
|
-
slice:
|
|
1051
|
+
slice: (0, _mulmoclaude_core_collection.daySlice)(span, day)
|
|
1024
1052
|
})).filter((pair) => pair.slice !== null).sort((left, right) => sliceStartKey(left.slice) - sliceStartKey(right.slice)).map(({ span }) => ({
|
|
1025
|
-
id:
|
|
1026
|
-
label:
|
|
1053
|
+
id: (0, _mulmoclaude_core_collection.itemIdOf)(span.item, props.schema),
|
|
1054
|
+
label: (0, _mulmoclaude_core_collection.itemLabelOf)(span.item, props.schema, labelField.value),
|
|
1027
1055
|
color: colorOf(span.item)
|
|
1028
1056
|
}));
|
|
1029
1057
|
}
|
|
@@ -1034,8 +1062,8 @@ var CollectionCalendarView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
1034
1062
|
entries: recordsOnDay(cell.ymd)
|
|
1035
1063
|
})));
|
|
1036
1064
|
const undatedEntries = (0, vue.computed)(() => bucketed.value.noDate.map((item) => ({
|
|
1037
|
-
id:
|
|
1038
|
-
label:
|
|
1065
|
+
id: (0, _mulmoclaude_core_collection.itemIdOf)(item, props.schema),
|
|
1066
|
+
label: (0, _mulmoclaude_core_collection.itemLabelOf)(item, props.schema, labelField.value),
|
|
1039
1067
|
color: colorOf(item)
|
|
1040
1068
|
})));
|
|
1041
1069
|
function chipClass(entry, uncolored) {
|
|
@@ -1228,7 +1256,7 @@ var CollectionDayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
1228
1256
|
const PX_PER_MIN = HOUR_PX / 60;
|
|
1229
1257
|
const scrollEl = (0, vue.ref)(null);
|
|
1230
1258
|
const dialogEl = (0, vue.ref)(null);
|
|
1231
|
-
const dayKey = (0, vue.computed)(() =>
|
|
1259
|
+
const dayKey = (0, vue.computed)(() => (0, _mulmoclaude_core_collection.ymdKey)(props.day));
|
|
1232
1260
|
const dayLabel = (0, vue.computed)(() => {
|
|
1233
1261
|
try {
|
|
1234
1262
|
return new Intl.DateTimeFormat(locale.value, {
|
|
@@ -1245,8 +1273,8 @@ var CollectionDayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
1245
1273
|
function hourLabel(hour) {
|
|
1246
1274
|
return `${String(hour).padStart(2, "0")}:00`;
|
|
1247
1275
|
}
|
|
1248
|
-
const labelField = (0, vue.computed)(() =>
|
|
1249
|
-
const CHIP_SKIP_TYPES = new Set([
|
|
1276
|
+
const labelField = (0, vue.computed)(() => (0, _mulmoclaude_core_collection.labelFieldFor)(props.schema));
|
|
1277
|
+
const CHIP_SKIP_TYPES = /* @__PURE__ */ new Set([
|
|
1250
1278
|
"date",
|
|
1251
1279
|
"datetime",
|
|
1252
1280
|
"table",
|
|
@@ -1269,17 +1297,17 @@ var CollectionDayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
1269
1297
|
return out;
|
|
1270
1298
|
}
|
|
1271
1299
|
function colorOf(item) {
|
|
1272
|
-
return props.colorField ?
|
|
1300
|
+
return props.colorField ? (0, _mulmoclaude_core_collection.resolveEnumColor)(props.schema, props.colorField, item[props.colorField]) : null;
|
|
1273
1301
|
}
|
|
1274
1302
|
const dayEntries = (0, vue.computed)(() => {
|
|
1275
|
-
const { spans } =
|
|
1303
|
+
const { spans } = (0, _mulmoclaude_core_collection.bucketRecords)(props.items, props.anchorField, props.endField, props.timeField);
|
|
1276
1304
|
const entries = [];
|
|
1277
1305
|
for (const span of spans) {
|
|
1278
|
-
const slice =
|
|
1306
|
+
const slice = (0, _mulmoclaude_core_collection.daySlice)(span, props.day);
|
|
1279
1307
|
if (!slice) continue;
|
|
1280
1308
|
entries.push({
|
|
1281
|
-
id:
|
|
1282
|
-
label:
|
|
1309
|
+
id: (0, _mulmoclaude_core_collection.itemIdOf)(span.item, props.schema),
|
|
1310
|
+
label: (0, _mulmoclaude_core_collection.itemLabelOf)(span.item, props.schema, labelField.value),
|
|
1283
1311
|
secondary: secondaryFieldsOf(span.item),
|
|
1284
1312
|
color: colorOf(span.item),
|
|
1285
1313
|
slice
|
|
@@ -1290,7 +1318,7 @@ var CollectionDayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
1290
1318
|
const allDayEntries = (0, vue.computed)(() => dayEntries.value.filter((entry) => entry.slice.kind === "allDay"));
|
|
1291
1319
|
const timedEntries = (0, vue.computed)(() => {
|
|
1292
1320
|
const timed = dayEntries.value.filter((entry) => entry.slice.kind !== "allDay");
|
|
1293
|
-
const lanes =
|
|
1321
|
+
const lanes = (0, _mulmoclaude_core_collection.assignLanes)(timed.map((entry) => ({
|
|
1294
1322
|
startMin: entry.slice.startMin,
|
|
1295
1323
|
endMin: Math.max(entry.slice.endMin, entry.slice.startMin + LANE_MIN_MINUTES)
|
|
1296
1324
|
})));
|
|
@@ -1328,8 +1356,8 @@ var CollectionDayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
1328
1356
|
(0, vue.onMounted)(async () => {
|
|
1329
1357
|
await (0, vue.nextTick)();
|
|
1330
1358
|
dialogEl.value?.focus();
|
|
1331
|
-
const earliest = timedEntries.value.reduce((min, entry) => Math.min(min, entry.slice.startMin),
|
|
1332
|
-
if (earliest >=
|
|
1359
|
+
const earliest = timedEntries.value.reduce((min, entry) => Math.min(min, entry.slice.startMin), _mulmoclaude_core_collection.MINUTES_PER_DAY);
|
|
1360
|
+
if (earliest >= _mulmoclaude_core_collection.MINUTES_PER_DAY) return;
|
|
1333
1361
|
if (scrollEl.value) scrollEl.value.scrollTop = Math.max(0, (earliest - 60) * PX_PER_MIN);
|
|
1334
1362
|
});
|
|
1335
1363
|
return (_ctx, _cache) => {
|
|
@@ -1502,7 +1530,7 @@ var CollectionKanbanView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
1502
1530
|
const value = String(raw);
|
|
1503
1531
|
return (groupSpec.value?.values ?? []).includes(value) ? value : UNCATEGORIZED;
|
|
1504
1532
|
}
|
|
1505
|
-
const visibleItems = (0, vue.computed)(() => groupSpec.value ? props.items.filter((item) =>
|
|
1533
|
+
const visibleItems = (0, vue.computed)(() => groupSpec.value ? props.items.filter((item) => (0, _mulmoclaude_core_collection.fieldVisible)(groupSpec.value, item)) : []);
|
|
1506
1534
|
const itemsByColumnMap = (0, vue.computed)(() => {
|
|
1507
1535
|
const map = /* @__PURE__ */ new Map();
|
|
1508
1536
|
for (const column of columns.value) map.set(column.value, []);
|
|
@@ -1539,7 +1567,7 @@ var CollectionKanbanView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
1539
1567
|
key: column.value,
|
|
1540
1568
|
"data-testid": `collection-kanban-column-${column.value || "uncategorized"}`,
|
|
1541
1569
|
class: "w-72 shrink-0 flex flex-col bg-slate-100 rounded-lg"
|
|
1542
|
-
}, [(0, vue.createElementVNode)("div", _hoisted_4$8, [(0, vue.createElementVNode)("div", _hoisted_5$7, [(0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)(["w-2 h-2 rounded-full shrink-0", (0, vue.unref)(
|
|
1570
|
+
}, [(0, vue.createElementVNode)("div", _hoisted_4$8, [(0, vue.createElementVNode)("div", _hoisted_5$7, [(0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)(["w-2 h-2 rounded-full shrink-0", (0, vue.unref)(_mulmoclaude_core_collection.resolveEnumColor)(__props.schema, __props.groupField, column.value).dot]) }, null, 2), (0, vue.createElementVNode)("span", {
|
|
1543
1571
|
class: "font-semibold text-xs text-slate-600 truncate",
|
|
1544
1572
|
title: column.label
|
|
1545
1573
|
}, (0, vue.toDisplayString)(column.label), 9, _hoisted_6$6)]), (0, vue.createElementVNode)("span", _hoisted_7$6, (0, vue.toDisplayString)(itemsByColumn(column.value).length), 1)]), (0, vue.createVNode)((0, vue.unref)(vuedraggable.default), {
|
|
@@ -1910,7 +1938,7 @@ var _hoisted_74$1 = ["disabled"];
|
|
|
1910
1938
|
//#region src/vue/components/CollectionRecordPanel.vue
|
|
1911
1939
|
var CollectionRecordPanel_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
1912
1940
|
__name: "CollectionRecordPanel",
|
|
1913
|
-
props:
|
|
1941
|
+
props: /*@__PURE__*/ (0, vue.mergeModels)({
|
|
1914
1942
|
collection: {},
|
|
1915
1943
|
viewing: {},
|
|
1916
1944
|
saving: { type: Boolean },
|
|
@@ -1928,7 +1956,7 @@ var CollectionRecordPanel_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
1928
1956
|
"editing": { required: true },
|
|
1929
1957
|
"editingModifiers": {}
|
|
1930
1958
|
}),
|
|
1931
|
-
emits:
|
|
1959
|
+
emits: /*@__PURE__*/ (0, vue.mergeModels)([
|
|
1932
1960
|
"submit",
|
|
1933
1961
|
"cancel",
|
|
1934
1962
|
"edit",
|
|
@@ -1994,7 +2022,7 @@ var CollectionRecordPanel_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
1994
2022
|
* creating. */
|
|
1995
2023
|
function cellVisible(field) {
|
|
1996
2024
|
if (field.primary && editing.value?.mode !== "create") return false;
|
|
1997
|
-
return
|
|
2025
|
+
return (0, _mulmoclaude_core_collection.fieldVisible)(field, detailRecord.value);
|
|
1998
2026
|
}
|
|
1999
2027
|
/** Mirror of the create-mode primary-key carve-out: drop the HTML5
|
|
2000
2028
|
* `required` flag on the primary field while creating so the browser
|
|
@@ -2008,7 +2036,7 @@ var CollectionRecordPanel_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
2008
2036
|
* value's colour (palette, or notification red/amber/grey when the field is
|
|
2009
2037
|
* the schema's notifyWhen target). */
|
|
2010
2038
|
function enumControlClass(fieldKey, value) {
|
|
2011
|
-
const cls =
|
|
2039
|
+
const cls = (0, _mulmoclaude_core_collection.resolveEnumColor)(props.collection.schema, fieldKey, value);
|
|
2012
2040
|
return `${cls.badge} ${cls.border}`;
|
|
2013
2041
|
}
|
|
2014
2042
|
function markBoolTouched(key) {
|
|
@@ -2020,7 +2048,7 @@ var CollectionRecordPanel_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
2020
2048
|
function addTableRow(key, subFields) {
|
|
2021
2049
|
if (!editing.value) return;
|
|
2022
2050
|
const rows = editing.value.table[key] ?? [];
|
|
2023
|
-
rows.push(
|
|
2051
|
+
rows.push((0, _mulmoclaude_core_collection.emptyRow)(subFields));
|
|
2024
2052
|
editing.value.table[key] = rows;
|
|
2025
2053
|
}
|
|
2026
2054
|
function removeTableRow(key, index) {
|
|
@@ -2373,7 +2401,7 @@ var CollectionViewConfigModal_default = /* @__PURE__ */ (0, vue.defineComponent)
|
|
|
2373
2401
|
}
|
|
2374
2402
|
emit("changed");
|
|
2375
2403
|
} catch (err) {
|
|
2376
|
-
error.value =
|
|
2404
|
+
error.value = (0, _mulmoclaude_core_collection.errorMessage)(err);
|
|
2377
2405
|
} finally {
|
|
2378
2406
|
deleting.value = null;
|
|
2379
2407
|
}
|
|
@@ -2431,7 +2459,7 @@ var _hoisted_3$4 = {
|
|
|
2431
2459
|
var _hoisted_4$4 = ["title", "srcdoc"];
|
|
2432
2460
|
var REMINT_LEAD_MS = 6e4;
|
|
2433
2461
|
var MIN_REMINT_DELAY_MS = 1e4;
|
|
2434
|
-
var CollectionCustomView_vue_vue_type_script_setup_true_lang_default =
|
|
2462
|
+
var CollectionCustomView_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0, vue.defineComponent)({
|
|
2435
2463
|
__name: "CollectionCustomView",
|
|
2436
2464
|
props: {
|
|
2437
2465
|
slug: {},
|
|
@@ -2488,7 +2516,7 @@ var CollectionCustomView_vue_vue_type_script_setup_true_lang_default = /* @__PUR
|
|
|
2488
2516
|
origin: window.location.origin
|
|
2489
2517
|
});
|
|
2490
2518
|
} catch (err) {
|
|
2491
|
-
if (!stale()) error.value =
|
|
2519
|
+
if (!stale()) error.value = (0, _mulmoclaude_core_collection.errorMessage)(err);
|
|
2492
2520
|
} finally {
|
|
2493
2521
|
if (!stale()) loading.value = false;
|
|
2494
2522
|
}
|
|
@@ -2560,7 +2588,7 @@ var _plugin_vue_export_helper_default = (sfc, props) => {
|
|
|
2560
2588
|
};
|
|
2561
2589
|
//#endregion
|
|
2562
2590
|
//#region src/vue/components/CollectionCustomView.vue
|
|
2563
|
-
var CollectionCustomView_default =
|
|
2591
|
+
var CollectionCustomView_default = /*#__PURE__*/ _plugin_vue_export_helper_default(CollectionCustomView_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-aa6e6c2d"]]);
|
|
2564
2592
|
//#endregion
|
|
2565
2593
|
//#region src/vue/useCollectionRendering.ts
|
|
2566
2594
|
function stepForFieldType(type) {
|
|
@@ -2609,14 +2637,14 @@ function useCollectionRendering(collection, locale) {
|
|
|
2609
2637
|
const map = {};
|
|
2610
2638
|
for (const item of detail.items) {
|
|
2611
2639
|
const slugRaw = item[schema.primaryKey];
|
|
2612
|
-
if (typeof slugRaw === "string" && slugRaw.length > 0) map[slugRaw] =
|
|
2640
|
+
if (typeof slugRaw === "string" && slugRaw.length > 0) map[slugRaw] = (0, _mulmoclaude_core_collection.deriveAll)(schema, item, {});
|
|
2613
2641
|
}
|
|
2614
2642
|
return map;
|
|
2615
2643
|
}
|
|
2616
2644
|
async function loadLinkedCollections(schema, expectedSlug) {
|
|
2617
2645
|
const refTargets = new Set(uniqueRefTargets(schema));
|
|
2618
2646
|
const embedTargets = new Set(uniqueEmbedTargets(schema));
|
|
2619
|
-
const allTargets = [
|
|
2647
|
+
const allTargets = [.../* @__PURE__ */ new Set([...refTargets, ...embedTargets])];
|
|
2620
2648
|
if (allTargets.length === 0) return;
|
|
2621
2649
|
const binding = collectionUi();
|
|
2622
2650
|
const results = await Promise.all(allTargets.map(async (target) => {
|
|
@@ -2784,7 +2812,7 @@ function useCollectionRendering(collection, locale) {
|
|
|
2784
2812
|
const stepFor = stepForFieldType;
|
|
2785
2813
|
function evaluateDerivedAgainstItem(field, fieldKey, item) {
|
|
2786
2814
|
if (!field.formula || !collection.value) return null;
|
|
2787
|
-
const result =
|
|
2815
|
+
const result = (0, _mulmoclaude_core_collection.deriveAll)(collection.value.schema, item, refRecordCache.value)[fieldKey];
|
|
2788
2816
|
return typeof result === "number" && Number.isFinite(result) ? result : null;
|
|
2789
2817
|
}
|
|
2790
2818
|
function derivedDisplay(field, computedValue, record) {
|
|
@@ -2814,13 +2842,31 @@ function useCollectionRendering(collection, locale) {
|
|
|
2814
2842
|
formatSubCell,
|
|
2815
2843
|
inputTypeFor,
|
|
2816
2844
|
stepFor,
|
|
2817
|
-
deriveAll:
|
|
2845
|
+
deriveAll: _mulmoclaude_core_collection.deriveAll,
|
|
2818
2846
|
evaluateDerivedAgainstItem,
|
|
2819
2847
|
derivedDisplay
|
|
2820
2848
|
};
|
|
2821
2849
|
}
|
|
2822
2850
|
//#endregion
|
|
2823
2851
|
//#region src/vue/collectionViewMode.ts
|
|
2852
|
+
/** Build the `custom:<id>` selector key for a custom view. */
|
|
2853
|
+
function customViewKey(viewId) {
|
|
2854
|
+
return `custom:${viewId}`;
|
|
2855
|
+
}
|
|
2856
|
+
/** Every view mode a schema can render, in selector order: `table`
|
|
2857
|
+
* always, `calendar` when a `date`/`datetime` field exists, `kanban`
|
|
2858
|
+
* when an `enum` field exists, then each declared custom view. Mirrors
|
|
2859
|
+
* the field-derived gating inside `CollectionView` (hasCalendar /
|
|
2860
|
+
* hasKanban / customViews) so callers outside that component — e.g. the
|
|
2861
|
+
* dashboard's per-tile view picker — offer exactly the same choices. */
|
|
2862
|
+
function applicableViewModes(schema) {
|
|
2863
|
+
const modes = ["table"];
|
|
2864
|
+
const fields = Object.values(schema.fields);
|
|
2865
|
+
if (fields.some((field) => field.type === "date" || field.type === "datetime")) modes.push("calendar");
|
|
2866
|
+
if (fields.some((field) => field.type === "enum")) modes.push("kanban");
|
|
2867
|
+
for (const view of schema.views ?? []) modes.push(customViewKey(view.id));
|
|
2868
|
+
return modes;
|
|
2869
|
+
}
|
|
2824
2870
|
var STORAGE_KEY = "collection_view_modes";
|
|
2825
2871
|
var SORT_STORAGE_KEY = "collection_sorts";
|
|
2826
2872
|
var BUILT_IN_MODES = [
|
|
@@ -2889,7 +2935,10 @@ function writeCollectionSort(slug, sort) {
|
|
|
2889
2935
|
//#endregion
|
|
2890
2936
|
//#region src/vue/components/CollectionView.vue?vue&type=script&setup=true&lang.ts
|
|
2891
2937
|
var _hoisted_1$4 = { class: "h-full flex flex-col bg-slate-50/30" };
|
|
2892
|
-
var _hoisted_2$3 = {
|
|
2938
|
+
var _hoisted_2$3 = {
|
|
2939
|
+
key: 0,
|
|
2940
|
+
class: "flex items-center gap-3 px-6 py-2 border-b border-slate-200 bg-white"
|
|
2941
|
+
};
|
|
2893
2942
|
var _hoisted_3$3 = ["title", "aria-label"];
|
|
2894
2943
|
var _hoisted_4$3 = {
|
|
2895
2944
|
key: 1,
|
|
@@ -2916,186 +2965,192 @@ var _hoisted_12$2 = {
|
|
|
2916
2965
|
var _hoisted_13$2 = ["title", "aria-label"];
|
|
2917
2966
|
var _hoisted_14$2 = ["title", "aria-label"];
|
|
2918
2967
|
var _hoisted_15$2 = {
|
|
2919
|
-
key:
|
|
2968
|
+
key: 1,
|
|
2969
|
+
class: "mx-6 mt-2 rounded-lg border border-indigo-200 bg-indigo-50/60 px-4 py-2 text-sm text-indigo-800 flex items-center gap-2",
|
|
2970
|
+
"data-testid": "collections-refresh-note"
|
|
2971
|
+
};
|
|
2972
|
+
var _hoisted_16$1 = { class: "flex-1" };
|
|
2973
|
+
var _hoisted_17$1 = {
|
|
2974
|
+
key: 2,
|
|
2920
2975
|
class: "px-6 py-3 bg-white border-b border-slate-100 flex items-center justify-between gap-4"
|
|
2921
2976
|
};
|
|
2922
|
-
var
|
|
2977
|
+
var _hoisted_18$1 = {
|
|
2923
2978
|
key: 0,
|
|
2924
2979
|
class: "relative flex-1 max-w-md"
|
|
2925
2980
|
};
|
|
2926
|
-
var
|
|
2927
|
-
var _hoisted_18$1 = ["aria-label"];
|
|
2928
|
-
var _hoisted_19$1 = { class: "flex items-center gap-2" };
|
|
2981
|
+
var _hoisted_19$1 = ["placeholder", "aria-label"];
|
|
2929
2982
|
var _hoisted_20$1 = ["aria-label"];
|
|
2930
|
-
var _hoisted_21$1 =
|
|
2931
|
-
var _hoisted_22$1 = ["aria-
|
|
2983
|
+
var _hoisted_21$1 = { class: "flex items-center gap-2" };
|
|
2984
|
+
var _hoisted_22$1 = ["aria-label"];
|
|
2932
2985
|
var _hoisted_23$1 = ["aria-pressed"];
|
|
2933
|
-
var _hoisted_24 = [
|
|
2986
|
+
var _hoisted_24 = ["aria-pressed"];
|
|
2987
|
+
var _hoisted_25 = ["aria-pressed"];
|
|
2988
|
+
var _hoisted_26 = [
|
|
2934
2989
|
"aria-pressed",
|
|
2935
2990
|
"data-testid",
|
|
2936
2991
|
"onClick"
|
|
2937
2992
|
];
|
|
2938
|
-
var
|
|
2939
|
-
var
|
|
2940
|
-
var
|
|
2941
|
-
var _hoisted_28 = ["value", "aria-label"];
|
|
2942
|
-
var _hoisted_29 = ["value"];
|
|
2993
|
+
var _hoisted_27 = { class: "material-icons text-sm" };
|
|
2994
|
+
var _hoisted_28 = ["title", "aria-label"];
|
|
2995
|
+
var _hoisted_29 = ["title", "aria-label"];
|
|
2943
2996
|
var _hoisted_30 = ["value", "aria-label"];
|
|
2944
2997
|
var _hoisted_31 = ["value"];
|
|
2945
|
-
var _hoisted_32 =
|
|
2998
|
+
var _hoisted_32 = ["value", "aria-label"];
|
|
2999
|
+
var _hoisted_33 = ["value"];
|
|
3000
|
+
var _hoisted_34 = {
|
|
2946
3001
|
key: 3,
|
|
2947
3002
|
class: "text-[10px] text-slate-400 font-bold uppercase tracking-wider select-none"
|
|
2948
3003
|
};
|
|
2949
|
-
var
|
|
2950
|
-
key:
|
|
3004
|
+
var _hoisted_35 = {
|
|
3005
|
+
key: 3,
|
|
2951
3006
|
class: "mx-6 mt-4 rounded-xl border border-amber-200 bg-amber-50/60 p-4 text-sm text-amber-900 shadow-sm flex items-center gap-3",
|
|
2952
3007
|
"data-testid": "collections-data-issues"
|
|
2953
3008
|
};
|
|
2954
|
-
var
|
|
2955
|
-
var
|
|
2956
|
-
var
|
|
3009
|
+
var _hoisted_36 = { class: "flex-1" };
|
|
3010
|
+
var _hoisted_37 = { class: "flex-1 overflow-auto" };
|
|
3011
|
+
var _hoisted_38 = {
|
|
2957
3012
|
key: 0,
|
|
2958
3013
|
class: "flex flex-col items-center justify-center py-20 text-sm text-slate-500 gap-3"
|
|
2959
3014
|
};
|
|
2960
|
-
var
|
|
3015
|
+
var _hoisted_39 = {
|
|
2961
3016
|
key: 1,
|
|
2962
3017
|
class: "m-6 rounded-xl border border-red-200 bg-red-50/50 p-4 text-sm text-red-800 shadow-sm flex items-center gap-3"
|
|
2963
3018
|
};
|
|
2964
|
-
var
|
|
2965
|
-
var
|
|
3019
|
+
var _hoisted_40 = { key: 2 };
|
|
3020
|
+
var _hoisted_41 = {
|
|
2966
3021
|
key: 3,
|
|
2967
3022
|
class: "p-4"
|
|
2968
3023
|
};
|
|
2969
|
-
var
|
|
3024
|
+
var _hoisted_42 = {
|
|
2970
3025
|
key: 4,
|
|
2971
3026
|
class: "h-full flex flex-col"
|
|
2972
3027
|
};
|
|
2973
|
-
var
|
|
3028
|
+
var _hoisted_43 = {
|
|
2974
3029
|
key: 0,
|
|
2975
3030
|
class: "m-3 mb-0 rounded-xl border border-red-200 bg-red-50/50 p-4 text-sm text-red-800 shadow-sm flex items-center gap-3",
|
|
2976
3031
|
"data-testid": "collections-inline-error"
|
|
2977
3032
|
};
|
|
2978
|
-
var
|
|
2979
|
-
var
|
|
2980
|
-
var
|
|
2981
|
-
var
|
|
3033
|
+
var _hoisted_44 = { class: "flex-1" };
|
|
3034
|
+
var _hoisted_45 = ["aria-label"];
|
|
3035
|
+
var _hoisted_46 = { class: "flex-1 min-h-0 px-3 py-2" };
|
|
3036
|
+
var _hoisted_47 = {
|
|
2982
3037
|
key: 5,
|
|
2983
3038
|
class: "h-full",
|
|
2984
3039
|
"data-testid": "collection-custom-view-body"
|
|
2985
3040
|
};
|
|
2986
|
-
var
|
|
3041
|
+
var _hoisted_48 = {
|
|
2987
3042
|
key: 6,
|
|
2988
3043
|
class: "flex flex-col items-center justify-center py-20 text-sm text-slate-400 gap-2"
|
|
2989
3044
|
};
|
|
2990
|
-
var
|
|
2991
|
-
var
|
|
3045
|
+
var _hoisted_49 = { class: "font-semibold text-slate-600" };
|
|
3046
|
+
var _hoisted_50 = {
|
|
2992
3047
|
key: 7,
|
|
2993
3048
|
class: "flex flex-col items-center justify-center py-20 text-sm text-slate-400 gap-2"
|
|
2994
3049
|
};
|
|
2995
|
-
var
|
|
2996
|
-
var
|
|
3050
|
+
var _hoisted_51 = { class: "font-semibold text-slate-600" };
|
|
3051
|
+
var _hoisted_52 = {
|
|
2997
3052
|
key: 8,
|
|
2998
3053
|
class: "overflow-x-auto [container-type:inline-size]"
|
|
2999
3054
|
};
|
|
3000
|
-
var
|
|
3055
|
+
var _hoisted_53 = {
|
|
3001
3056
|
key: 0,
|
|
3002
3057
|
class: "m-4 rounded-xl border border-red-200 bg-red-50/50 p-4 text-sm text-red-800 shadow-sm flex items-center gap-3",
|
|
3003
3058
|
"data-testid": "collections-inline-error"
|
|
3004
3059
|
};
|
|
3005
|
-
var
|
|
3006
|
-
var
|
|
3007
|
-
var
|
|
3008
|
-
var
|
|
3009
|
-
var
|
|
3010
|
-
var
|
|
3011
|
-
var
|
|
3012
|
-
var
|
|
3060
|
+
var _hoisted_54 = { class: "flex-1" };
|
|
3061
|
+
var _hoisted_55 = ["aria-label"];
|
|
3062
|
+
var _hoisted_56 = { class: "min-w-full text-xs" };
|
|
3063
|
+
var _hoisted_57 = { class: "bg-slate-50 border-b border-slate-200" };
|
|
3064
|
+
var _hoisted_58 = ["aria-sort"];
|
|
3065
|
+
var _hoisted_59 = { class: "flex items-center gap-1" };
|
|
3066
|
+
var _hoisted_60 = ["title"];
|
|
3067
|
+
var _hoisted_61 = [
|
|
3013
3068
|
"data-testid",
|
|
3014
3069
|
"aria-label",
|
|
3015
3070
|
"onClick",
|
|
3016
3071
|
"onPointerenter"
|
|
3017
3072
|
];
|
|
3018
|
-
var
|
|
3019
|
-
var
|
|
3020
|
-
var
|
|
3073
|
+
var _hoisted_62 = { class: "material-icons text-base align-middle" };
|
|
3074
|
+
var _hoisted_63 = { class: "divide-y divide-slate-100 bg-white" };
|
|
3075
|
+
var _hoisted_64 = [
|
|
3021
3076
|
"aria-label",
|
|
3022
3077
|
"data-testid",
|
|
3023
3078
|
"onClick",
|
|
3024
3079
|
"onKeydown"
|
|
3025
3080
|
];
|
|
3026
|
-
var
|
|
3081
|
+
var _hoisted_65 = [
|
|
3027
3082
|
"checked",
|
|
3028
3083
|
"disabled",
|
|
3029
3084
|
"data-testid",
|
|
3030
3085
|
"aria-label",
|
|
3031
3086
|
"onChange"
|
|
3032
3087
|
];
|
|
3033
|
-
var
|
|
3088
|
+
var _hoisted_66 = [
|
|
3034
3089
|
"checked",
|
|
3035
3090
|
"disabled",
|
|
3036
3091
|
"data-testid",
|
|
3037
3092
|
"aria-label",
|
|
3038
3093
|
"onChange"
|
|
3039
3094
|
];
|
|
3040
|
-
var
|
|
3095
|
+
var _hoisted_67 = {
|
|
3041
3096
|
key: 2,
|
|
3042
3097
|
class: "block truncate"
|
|
3043
3098
|
};
|
|
3044
|
-
var
|
|
3099
|
+
var _hoisted_68 = [
|
|
3045
3100
|
"href",
|
|
3046
3101
|
"tabindex",
|
|
3047
3102
|
"data-testid",
|
|
3048
3103
|
"onClick",
|
|
3049
3104
|
"onKeydown"
|
|
3050
3105
|
];
|
|
3051
|
-
var
|
|
3106
|
+
var _hoisted_69 = [
|
|
3052
3107
|
"value",
|
|
3053
3108
|
"disabled",
|
|
3054
3109
|
"data-testid",
|
|
3055
3110
|
"aria-label",
|
|
3056
3111
|
"onChange"
|
|
3057
3112
|
];
|
|
3058
|
-
var
|
|
3113
|
+
var _hoisted_70 = {
|
|
3059
3114
|
key: 0,
|
|
3060
3115
|
value: ""
|
|
3061
3116
|
};
|
|
3062
|
-
var
|
|
3063
|
-
var
|
|
3117
|
+
var _hoisted_71 = ["value"];
|
|
3118
|
+
var _hoisted_72 = {
|
|
3064
3119
|
key: 4,
|
|
3065
3120
|
class: "block truncate tabular-nums font-semibold text-slate-900"
|
|
3066
3121
|
};
|
|
3067
|
-
var
|
|
3122
|
+
var _hoisted_73 = {
|
|
3068
3123
|
key: 5,
|
|
3069
3124
|
class: "inline-flex items-center gap-1 px-2 py-0.5 rounded-lg text-[10px] font-bold bg-slate-100 text-slate-600 border border-slate-200/40"
|
|
3070
3125
|
};
|
|
3071
|
-
var
|
|
3126
|
+
var _hoisted_74 = {
|
|
3072
3127
|
key: 6,
|
|
3073
3128
|
class: "inline-block truncate tabular-nums font-bold text-indigo-900 bg-indigo-50/50 px-1.5 py-0.5 rounded border border-indigo-100/50"
|
|
3074
3129
|
};
|
|
3075
|
-
var
|
|
3076
|
-
var
|
|
3077
|
-
var
|
|
3130
|
+
var _hoisted_75 = ["href", "data-testid"];
|
|
3131
|
+
var _hoisted_76 = ["href", "data-testid"];
|
|
3132
|
+
var _hoisted_77 = [
|
|
3078
3133
|
"href",
|
|
3079
3134
|
"data-testid",
|
|
3080
3135
|
"onClick"
|
|
3081
3136
|
];
|
|
3082
|
-
var
|
|
3137
|
+
var _hoisted_78 = {
|
|
3083
3138
|
key: 10,
|
|
3084
3139
|
class: "block truncate text-slate-600"
|
|
3085
3140
|
};
|
|
3086
|
-
var
|
|
3087
|
-
var
|
|
3088
|
-
var
|
|
3089
|
-
var
|
|
3141
|
+
var _hoisted_79 = { class: "bg-white rounded-2xl shadow-2xl w-full max-w-xl flex flex-col border border-slate-200 overflow-hidden" };
|
|
3142
|
+
var _hoisted_80 = { class: "px-6 py-4 border-b border-slate-100 flex items-center gap-3 bg-slate-50/50" };
|
|
3143
|
+
var _hoisted_81 = { class: "flex-1" };
|
|
3144
|
+
var _hoisted_82 = {
|
|
3090
3145
|
id: "collections-chat-title",
|
|
3091
3146
|
class: "text-sm font-bold text-slate-800 uppercase tracking-wide"
|
|
3092
3147
|
};
|
|
3093
|
-
var
|
|
3094
|
-
var
|
|
3095
|
-
var
|
|
3096
|
-
var
|
|
3097
|
-
var
|
|
3098
|
-
var
|
|
3148
|
+
var _hoisted_83 = { class: "text-xs text-slate-400 font-semibold" };
|
|
3149
|
+
var _hoisted_84 = ["aria-label"];
|
|
3150
|
+
var _hoisted_85 = { class: "px-6 py-5" };
|
|
3151
|
+
var _hoisted_86 = ["placeholder", "onKeydown"];
|
|
3152
|
+
var _hoisted_87 = { class: "px-6 py-3.5 border-t border-slate-100 flex items-center justify-end gap-2 bg-slate-50/50" };
|
|
3153
|
+
var _hoisted_88 = ["disabled"];
|
|
3099
3154
|
/** `slug` / `selected` are supplied only in EMBEDDED mode (the
|
|
3100
3155
|
* `presentCollection` chat card mounts this component and drives both
|
|
3101
3156
|
* from the tool result). In standalone route mode (the
|
|
@@ -3117,7 +3172,10 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
3117
3172
|
sendTextMessage: { type: Function },
|
|
3118
3173
|
initialView: {},
|
|
3119
3174
|
initialAnchorField: {},
|
|
3120
|
-
initialGroupField: {}
|
|
3175
|
+
initialGroupField: {},
|
|
3176
|
+
hideViewToggle: { type: Boolean },
|
|
3177
|
+
hideHeader: { type: Boolean },
|
|
3178
|
+
hideSearch: { type: Boolean }
|
|
3121
3179
|
},
|
|
3122
3180
|
emits: ["select", "viewStateChange"],
|
|
3123
3181
|
setup(__props, { emit: __emit }) {
|
|
@@ -3155,6 +3213,11 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
3155
3213
|
});
|
|
3156
3214
|
/** True while a feed collection's manual refresh is in flight. */
|
|
3157
3215
|
const refreshing = (0, vue.ref)(false);
|
|
3216
|
+
/** Transient note shown after an agent-ingest Refresh dispatches a background
|
|
3217
|
+
* worker (records update asynchronously, so there's nothing to show inline).
|
|
3218
|
+
* Auto-clears; `refreshNoteTimer` cancels a pending clear on re-trigger. */
|
|
3219
|
+
const refreshNote = (0, vue.ref)(null);
|
|
3220
|
+
let refreshNoteTimer;
|
|
3158
3221
|
/** Slug already auto-refreshed on first open — prevents a reload loop
|
|
3159
3222
|
* (the auto-refresh reloads the view, which would re-trigger otherwise). */
|
|
3160
3223
|
const autoRefreshedSlug = (0, vue.ref)(null);
|
|
@@ -3221,11 +3284,11 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
3221
3284
|
* click's state; otherwise show the column's actual state. */
|
|
3222
3285
|
function effectiveSortDir(key) {
|
|
3223
3286
|
const current = sortDirectionFor(key);
|
|
3224
|
-
return hoveredSortKey.value === key ?
|
|
3287
|
+
return hoveredSortKey.value === key ? (0, _mulmoclaude_core_collection.nextSortDirection)(current) : current;
|
|
3225
3288
|
}
|
|
3226
3289
|
/** Cycle a column none → asc → desc → none; activating one clears the rest. */
|
|
3227
3290
|
function cycleSort(key) {
|
|
3228
|
-
const next =
|
|
3291
|
+
const next = (0, _mulmoclaude_core_collection.nextSortDirection)(sortDirectionFor(key));
|
|
3229
3292
|
sortState.value = next ? {
|
|
3230
3293
|
field: key,
|
|
3231
3294
|
direction: next
|
|
@@ -3246,19 +3309,19 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
3246
3309
|
function scalarSortValue(field, raw) {
|
|
3247
3310
|
switch (field.type) {
|
|
3248
3311
|
case "number":
|
|
3249
|
-
case "money": return
|
|
3312
|
+
case "money": return (0, _mulmoclaude_core_collection.numericSortValue)(raw);
|
|
3250
3313
|
case "date":
|
|
3251
|
-
case "datetime": return
|
|
3252
|
-
case "enum": return
|
|
3253
|
-
case "boolean": return
|
|
3254
|
-
case "ref": return field.to && typeof raw === "string" && raw ?
|
|
3255
|
-
default: return
|
|
3314
|
+
case "datetime": return (0, _mulmoclaude_core_collection.dateSortValue)(raw);
|
|
3315
|
+
case "enum": return (0, _mulmoclaude_core_collection.enumSortValue)(field.values, raw);
|
|
3316
|
+
case "boolean": return (0, _mulmoclaude_core_collection.boolSortValue)(raw === true);
|
|
3317
|
+
case "ref": return field.to && typeof raw === "string" && raw ? (0, _mulmoclaude_core_collection.stringSortValue)(refDisplay(field.to, raw)) : (0, _mulmoclaude_core_collection.stringSortValue)(raw);
|
|
3318
|
+
default: return (0, _mulmoclaude_core_collection.stringSortValue)(raw);
|
|
3256
3319
|
}
|
|
3257
3320
|
}
|
|
3258
3321
|
/** Comparable value for one row under the active field. Toggle and derived
|
|
3259
3322
|
* need the whole record; every other type keys off the raw cell. */
|
|
3260
3323
|
function sortValueOf(field, key, item) {
|
|
3261
|
-
if (field.type === "toggle") return
|
|
3324
|
+
if (field.type === "toggle") return (0, _mulmoclaude_core_collection.boolSortValue)(toggleChecked(item, field));
|
|
3262
3325
|
if (field.type === "derived") return derivedSortValue(field, key, item);
|
|
3263
3326
|
return scalarSortValue(field, item[key]);
|
|
3264
3327
|
}
|
|
@@ -3266,16 +3329,16 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
3266
3329
|
* date/datetime → epoch, anything else → the enriched value as a string. */
|
|
3267
3330
|
function derivedSortValue(field, key, item) {
|
|
3268
3331
|
const { display } = field;
|
|
3269
|
-
if (display === void 0 || display === "number" || display === "money") return
|
|
3332
|
+
if (display === void 0 || display === "number" || display === "money") return (0, _mulmoclaude_core_collection.numericSortValue)(evaluateDerivedAgainstItem(field, key, item));
|
|
3270
3333
|
const enriched = collection.value ? render.deriveAll(collection.value.schema, item, render.refRecordCache.value) : item;
|
|
3271
|
-
if (display === "date" || display === "datetime") return
|
|
3272
|
-
return
|
|
3334
|
+
if (display === "date" || display === "datetime") return (0, _mulmoclaude_core_collection.dateSortValue)(enriched[key]);
|
|
3335
|
+
return (0, _mulmoclaude_core_collection.stringSortValue)(enriched[key]);
|
|
3273
3336
|
}
|
|
3274
3337
|
const sortedItems = (0, vue.computed)(() => {
|
|
3275
3338
|
const state = sortState.value;
|
|
3276
3339
|
const field = state ? collection.value?.schema.fields[state.field] : void 0;
|
|
3277
3340
|
if (!state || !field) return filteredItems.value;
|
|
3278
|
-
return
|
|
3341
|
+
return (0, _mulmoclaude_core_collection.sortItems)(filteredItems.value, state.direction, (item) => sortValueOf(field, state.field, item));
|
|
3279
3342
|
});
|
|
3280
3343
|
/** Stringified primary-key value for a row (the row's stable identity). */
|
|
3281
3344
|
function rowId(item) {
|
|
@@ -3309,7 +3372,7 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
3309
3372
|
function enumControlClass(fieldKey, value) {
|
|
3310
3373
|
const schema = collection.value?.schema;
|
|
3311
3374
|
if (!schema) return "";
|
|
3312
|
-
const cls =
|
|
3375
|
+
const cls = (0, _mulmoclaude_core_collection.resolveEnumColor)(schema, fieldKey, value);
|
|
3313
3376
|
return `${cls.badge} ${cls.border}`;
|
|
3314
3377
|
}
|
|
3315
3378
|
/** This row is the one open in read-only detail. */
|
|
@@ -3337,7 +3400,21 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
3337
3400
|
return;
|
|
3338
3401
|
}
|
|
3339
3402
|
await loadCollection(current.slug);
|
|
3340
|
-
if (result.data.errors.length > 0)
|
|
3403
|
+
if (result.data.errors.length > 0) {
|
|
3404
|
+
inlineError.value = t("collectionsView.refreshFailed", { error: result.data.errors.join("; ") });
|
|
3405
|
+
return;
|
|
3406
|
+
}
|
|
3407
|
+
if (result.data.dispatched) if (result.data.chatId && cui.navigate) cui.navigate(`/chat/${result.data.chatId}`);
|
|
3408
|
+
else showRefreshNote(t("collectionsView.refreshDispatched"));
|
|
3409
|
+
}
|
|
3410
|
+
/** Show a transient refresh note, replacing any pending auto-clear. */
|
|
3411
|
+
function showRefreshNote(message) {
|
|
3412
|
+
refreshNote.value = message;
|
|
3413
|
+
if (refreshNoteTimer !== void 0) clearTimeout(refreshNoteTimer);
|
|
3414
|
+
refreshNoteTimer = setTimeout(() => {
|
|
3415
|
+
refreshNote.value = null;
|
|
3416
|
+
refreshNoteTimer = void 0;
|
|
3417
|
+
}, 6e3);
|
|
3341
3418
|
}
|
|
3342
3419
|
/** Collection-level header actions. No `when` predicate (no record). */
|
|
3343
3420
|
const collectionActions = (0, vue.computed)(() => collection.value?.schema.collectionActions ?? []);
|
|
@@ -3369,7 +3446,7 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
3369
3446
|
function repairCollection() {
|
|
3370
3447
|
const current = collection.value;
|
|
3371
3448
|
if (!current || dataIssues.value.length === 0) return;
|
|
3372
|
-
const lines = dataIssues.value.map((issue) => `- ${
|
|
3449
|
+
const lines = dataIssues.value.map((issue) => `- ${(0, _mulmoclaude_core_collection.defangForPrompt)(issue.file)}: ${(0, _mulmoclaude_core_collection.defangForPrompt)(issue.problem)}`).join("\n");
|
|
3373
3450
|
const prompt = t("collectionsView.repairPrompt", {
|
|
3374
3451
|
title: current.title,
|
|
3375
3452
|
count: dataIssues.value.length,
|
|
@@ -3387,7 +3464,7 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
3387
3464
|
const visibleActions = (0, vue.computed)(() => {
|
|
3388
3465
|
const record = viewing.value;
|
|
3389
3466
|
if (!record) return [];
|
|
3390
|
-
return (collection.value?.schema.actions ?? []).filter((action) =>
|
|
3467
|
+
return (collection.value?.schema.actions ?? []).filter((action) => (0, _mulmoclaude_core_collection.actionVisible)(action, record));
|
|
3391
3468
|
});
|
|
3392
3469
|
/** Run a schema-declared action on the open record: ask the server to
|
|
3393
3470
|
* assemble the seed prompt, then start a new chat in the action's
|
|
@@ -3430,11 +3507,11 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
3430
3507
|
* (`feeds/<slug>/schema.json` and `<dataPath>/`) and let it act on the
|
|
3431
3508
|
* request directly. */
|
|
3432
3509
|
function buildChatSeed(slug, message, itemId) {
|
|
3433
|
-
const
|
|
3434
|
-
if (
|
|
3510
|
+
const current = collection.value;
|
|
3511
|
+
if (current?.source !== "feed") return itemId ? `/${slug} id=${itemId} ${message}` : `/${slug} ${message}`;
|
|
3435
3512
|
return t("collectionsView.feedChatSeed", {
|
|
3436
3513
|
slug,
|
|
3437
|
-
dataPath: schema.dataPath ?? `data/feeds/${slug}`,
|
|
3514
|
+
dataPath: current.schema.dataPath ?? `data/feeds/${slug}`,
|
|
3438
3515
|
message: itemId ? `(for record \`${itemId}\`) ${message}` : message
|
|
3439
3516
|
});
|
|
3440
3517
|
}
|
|
@@ -3518,7 +3595,7 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
3518
3595
|
function maybeAutoRefreshFeed(slug) {
|
|
3519
3596
|
if (embedded.value) return;
|
|
3520
3597
|
const current = collection.value;
|
|
3521
|
-
if (current?.slug !== slug ||
|
|
3598
|
+
if (current?.slug !== slug || current.source !== "feed") return;
|
|
3522
3599
|
if (items.value.length > 0 || autoRefreshedSlug.value === slug) return;
|
|
3523
3600
|
autoRefreshedSlug.value = slug;
|
|
3524
3601
|
refreshFeed();
|
|
@@ -3542,7 +3619,7 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
3542
3619
|
if (!current) return false;
|
|
3543
3620
|
return current.source === "project" && !current.slug.startsWith("mc-");
|
|
3544
3621
|
});
|
|
3545
|
-
const isFeed = (0, vue.computed)(() =>
|
|
3622
|
+
const isFeed = (0, vue.computed)(() => collection.value?.source === "feed");
|
|
3546
3623
|
const canDeleteFeed = (0, vue.computed)(() => isFeed.value && !embedded.value);
|
|
3547
3624
|
const isFeedRoute = (0, vue.computed)(() => !embedded.value && cui.isFeedRoute());
|
|
3548
3625
|
/** The view to open with: the embedded card's restored `initialView` if
|
|
@@ -3605,7 +3682,7 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
3605
3682
|
function addCustomView() {
|
|
3606
3683
|
const current = collection.value;
|
|
3607
3684
|
if (!current) return;
|
|
3608
|
-
const base = current.
|
|
3685
|
+
const base = current.source === "feed" ? `feeds/${current.slug}` : `data/skills/${current.slug}`;
|
|
3609
3686
|
const prompt = t("collectionsView.addViewPrompt", {
|
|
3610
3687
|
title: current.title,
|
|
3611
3688
|
base
|
|
@@ -3663,18 +3740,14 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
3663
3740
|
function setCustomView(viewId) {
|
|
3664
3741
|
view.value = `custom:${viewId}`;
|
|
3665
3742
|
}
|
|
3666
|
-
/** Selector-key for a custom view, for active-state comparison in the template. */
|
|
3667
|
-
function customViewKey(viewId) {
|
|
3668
|
-
return `custom:${viewId}`;
|
|
3669
|
-
}
|
|
3670
3743
|
/** A short, slug-safe id not already used by a loaded record. Collisions
|
|
3671
3744
|
* are astronomically unlikely (32 bits), but we still re-roll a few
|
|
3672
3745
|
* times against the in-memory set before giving up and using the last
|
|
3673
3746
|
* candidate (the server's overwrite guard is the final backstop). */
|
|
3674
3747
|
function generateUniqueItemId(primaryKey) {
|
|
3675
3748
|
const existing = new Set(items.value.map((item) => String(item[primaryKey] ?? "")));
|
|
3676
|
-
let candidate =
|
|
3677
|
-
for (let attempt = 0; attempt < 8 && existing.has(candidate); attempt++) candidate =
|
|
3749
|
+
let candidate = (0, _mulmoclaude_core_collection.shortHexId)();
|
|
3750
|
+
for (let attempt = 0; attempt < 8 && existing.has(candidate); attempt++) candidate = (0, _mulmoclaude_core_collection.shortHexId)();
|
|
3678
3751
|
return candidate;
|
|
3679
3752
|
}
|
|
3680
3753
|
function openCreate() {
|
|
@@ -3720,7 +3793,7 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
3720
3793
|
boolTouched[key] = false;
|
|
3721
3794
|
} else if (field.type === "table" && field.of) {
|
|
3722
3795
|
const sub = field.of;
|
|
3723
|
-
table[key] = (Array.isArray(raw) ? raw : []).filter((row) => Boolean(row) && typeof row === "object" && !Array.isArray(row)).map((row) =>
|
|
3796
|
+
table[key] = (Array.isArray(raw) ? raw : []).filter((row) => Boolean(row) && typeof row === "object" && !Array.isArray(row)).map((row) => (0, _mulmoclaude_core_collection.rowFromItem)(row, sub));
|
|
3724
3797
|
} else if (field.type !== "derived" && field.type !== "embed" && field.type !== "toggle") text[key] = raw === void 0 || raw === null ? "" : String(raw);
|
|
3725
3798
|
}
|
|
3726
3799
|
const primaryRaw = item[collection.value.schema.primaryKey];
|
|
@@ -3840,7 +3913,7 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
3840
3913
|
* the user edits line items. */
|
|
3841
3914
|
const liveRecord = (0, vue.computed)(() => {
|
|
3842
3915
|
if (!collection.value || !editing.value) return null;
|
|
3843
|
-
return
|
|
3916
|
+
return (0, _mulmoclaude_core_collection.draftToRecord)(editing.value, collection.value.schema);
|
|
3844
3917
|
});
|
|
3845
3918
|
/** Live record with derived fields resolved (drives the form's
|
|
3846
3919
|
* read-only derived inputs). Derivation lives in the shared
|
|
@@ -3862,13 +3935,13 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
3862
3935
|
const { slug, schema } = collection.value;
|
|
3863
3936
|
const draft = editing.value;
|
|
3864
3937
|
saveError.value = null;
|
|
3865
|
-
const missing =
|
|
3938
|
+
const missing = (0, _mulmoclaude_core_collection.firstMissingRequiredField)(draft, schema);
|
|
3866
3939
|
if (missing) {
|
|
3867
3940
|
saveError.value = `${missing}: ${t("collectionsView.requiredField")}`;
|
|
3868
3941
|
return;
|
|
3869
3942
|
}
|
|
3870
3943
|
saving.value = true;
|
|
3871
|
-
const record =
|
|
3944
|
+
const record = (0, _mulmoclaude_core_collection.draftToRecord)(draft, schema);
|
|
3872
3945
|
const result = draft.mode === "create" ? await cui.createItem(slug, record) : await cui.updateItem(slug, draft.originalId ?? "", record);
|
|
3873
3946
|
saving.value = false;
|
|
3874
3947
|
if (!result.ok) {
|
|
@@ -3903,11 +3976,11 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
3903
3976
|
const itemId = rowId(item);
|
|
3904
3977
|
if (!itemId || inlineSavingRows.value.has(itemId)) return;
|
|
3905
3978
|
const previous = item[key];
|
|
3906
|
-
const coerced =
|
|
3979
|
+
const coerced = (0, _mulmoclaude_core_collection.coerceInlineValue)(field, raw);
|
|
3907
3980
|
applyInlineValue(item, key, coerced);
|
|
3908
3981
|
inlineError.value = null;
|
|
3909
3982
|
inlineSavingRows.value.add(itemId);
|
|
3910
|
-
const result = await cui.updateItem(slug, itemId,
|
|
3983
|
+
const result = await cui.updateItem(slug, itemId, (0, _mulmoclaude_core_collection.buildUpdatedRecord)(item, key, coerced));
|
|
3911
3984
|
inlineSavingRows.value.delete(itemId);
|
|
3912
3985
|
if (!result.ok) {
|
|
3913
3986
|
applyInlineValue(item, key, previous);
|
|
@@ -4004,7 +4077,7 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4004
4077
|
/** The civil day a record sits on, from its calendar anchor field (handles
|
|
4005
4078
|
* both `date` and `datetime`). Null for undated records. */
|
|
4006
4079
|
function dayOfItem(item) {
|
|
4007
|
-
return
|
|
4080
|
+
return (0, _mulmoclaude_core_collection.dateOf)(item[calendarAnchorField.value]);
|
|
4008
4081
|
}
|
|
4009
4082
|
/** Mirror the open record into the `?selected=<id>` query (standalone mode)
|
|
4010
4083
|
* so the calendar's day-view + selection is a copy-pasteable link. In-app
|
|
@@ -4144,6 +4217,7 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4144
4217
|
changeUnsub?.();
|
|
4145
4218
|
changeUnsub = null;
|
|
4146
4219
|
clearLiveRefreshTimer();
|
|
4220
|
+
if (refreshNoteTimer !== void 0) clearTimeout(refreshNoteTimer);
|
|
4147
4221
|
});
|
|
4148
4222
|
(0, vue.watch)([
|
|
4149
4223
|
activeView,
|
|
@@ -4169,7 +4243,7 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4169
4243
|
});
|
|
4170
4244
|
return (_ctx, _cache) => {
|
|
4171
4245
|
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$4, [
|
|
4172
|
-
(0, vue.
|
|
4246
|
+
!__props.hideHeader ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("header", _hoisted_2$3, [
|
|
4173
4247
|
!embedded.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
|
|
4174
4248
|
key: 0,
|
|
4175
4249
|
type: "button",
|
|
@@ -4243,25 +4317,26 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4243
4317
|
"data-testid": "feeds-delete",
|
|
4244
4318
|
onClick: confirmFeedDelete
|
|
4245
4319
|
}, [..._cache[27] || (_cache[27] = [(0, vue.createElementVNode)("span", { class: "material-icons text-sm" }, "delete_forever", -1)])], 8, _hoisted_14$2)) : (0, vue.createCommentVNode)("", true)
|
|
4246
|
-
]),
|
|
4247
|
-
|
|
4248
|
-
|
|
4320
|
+
])) : (0, vue.createCommentVNode)("", true),
|
|
4321
|
+
refreshNote.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_15$2, [_cache[28] || (_cache[28] = (0, vue.createElementVNode)("span", { class: "material-icons text-base text-indigo-600" }, "hourglass_top", -1)), (0, vue.createElementVNode)("span", _hoisted_16$1, (0, vue.toDisplayString)(refreshNote.value), 1)])) : (0, vue.createCommentVNode)("", true),
|
|
4322
|
+
collection.value && (!__props.hideSearch && items.value.length > 0 || !__props.hideViewToggle && (hasCalendar.value || hasKanban.value || hasCustomViews.value || canAddCustomView.value)) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_17$1, [!__props.hideSearch && items.value.length > 0 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_18$1, [
|
|
4323
|
+
_cache[30] || (_cache[30] = (0, vue.createElementVNode)("span", { class: "absolute inset-y-0 left-0 flex items-center pl-3 text-slate-400 pointer-events-none" }, [(0, vue.createElementVNode)("span", { class: "material-icons text-lg" }, "search")], -1)),
|
|
4249
4324
|
(0, vue.withDirectives)((0, vue.createElementVNode)("input", {
|
|
4250
4325
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => searchQuery.value = $event),
|
|
4251
4326
|
type: "text",
|
|
4252
4327
|
placeholder: (0, vue.unref)(t)("collectionsView.searchPlaceholder"),
|
|
4253
4328
|
"aria-label": (0, vue.unref)(t)("collectionsView.searchPlaceholder"),
|
|
4254
4329
|
class: "w-full bg-slate-50 border border-slate-200/80 rounded-xl pl-9 pr-8 py-1.5 text-xs placeholder-slate-400 focus:outline-none focus:ring-2 focus:ring-indigo-500/20 focus:border-indigo-500 focus:bg-white transition-all font-medium"
|
|
4255
|
-
}, null, 8,
|
|
4330
|
+
}, null, 8, _hoisted_19$1), [[vue.vModelText, searchQuery.value]]),
|
|
4256
4331
|
searchQuery.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
|
|
4257
4332
|
key: 0,
|
|
4258
4333
|
type: "button",
|
|
4259
4334
|
"aria-label": (0, vue.unref)(t)("collectionsView.clearSearch"),
|
|
4260
4335
|
class: "absolute inset-y-0 right-0 flex items-center pr-2.5 text-slate-400 hover:text-slate-600",
|
|
4261
4336
|
onClick: _cache[1] || (_cache[1] = ($event) => searchQuery.value = "")
|
|
4262
|
-
}, [..._cache[
|
|
4263
|
-
])) : (0, vue.createCommentVNode)("", true), (0, vue.createElementVNode)("div",
|
|
4264
|
-
hasCalendar.value || hasKanban.value || hasCustomViews.value || canAddCustomView.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
|
|
4337
|
+
}, [..._cache[29] || (_cache[29] = [(0, vue.createElementVNode)("span", { class: "material-icons text-sm" }, "close", -1)])], 8, _hoisted_20$1)) : (0, vue.createCommentVNode)("", true)
|
|
4338
|
+
])) : (0, vue.createCommentVNode)("", true), (0, vue.createElementVNode)("div", _hoisted_21$1, [
|
|
4339
|
+
!__props.hideViewToggle && (hasCalendar.value || hasKanban.value || hasCustomViews.value || canAddCustomView.value) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
|
|
4265
4340
|
key: 0,
|
|
4266
4341
|
class: "flex gap-0.5",
|
|
4267
4342
|
role: "group",
|
|
@@ -4273,7 +4348,7 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4273
4348
|
"aria-pressed": activeView.value === "table",
|
|
4274
4349
|
"data-testid": "collection-view-toggle-table",
|
|
4275
4350
|
onClick: _cache[2] || (_cache[2] = ($event) => setView("table"))
|
|
4276
|
-
}, [_cache[
|
|
4351
|
+
}, [_cache[31] || (_cache[31] = (0, vue.createElementVNode)("span", { class: "material-icons text-sm" }, "table_rows", -1)), (0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.viewTable")), 1)], 10, _hoisted_23$1),
|
|
4277
4352
|
hasCalendar.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
|
|
4278
4353
|
key: 0,
|
|
4279
4354
|
type: "button",
|
|
@@ -4281,7 +4356,7 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4281
4356
|
"aria-pressed": activeView.value === "calendar",
|
|
4282
4357
|
"data-testid": "collection-view-toggle-calendar",
|
|
4283
4358
|
onClick: _cache[3] || (_cache[3] = ($event) => setView("calendar"))
|
|
4284
|
-
}, [_cache[
|
|
4359
|
+
}, [_cache[32] || (_cache[32] = (0, vue.createElementVNode)("span", { class: "material-icons text-sm" }, "calendar_month", -1)), (0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.viewCalendar")), 1)], 10, _hoisted_24)) : (0, vue.createCommentVNode)("", true),
|
|
4285
4360
|
hasKanban.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
|
|
4286
4361
|
key: 1,
|
|
4287
4362
|
type: "button",
|
|
@@ -4289,16 +4364,16 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4289
4364
|
"aria-pressed": activeView.value === "kanban",
|
|
4290
4365
|
"data-testid": "collection-view-toggle-kanban",
|
|
4291
4366
|
onClick: _cache[4] || (_cache[4] = ($event) => setView("kanban"))
|
|
4292
|
-
}, [_cache[
|
|
4367
|
+
}, [_cache[33] || (_cache[33] = (0, vue.createElementVNode)("span", { class: "material-icons text-sm" }, "view_kanban", -1)), (0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.viewKanban")), 1)], 10, _hoisted_25)) : (0, vue.createCommentVNode)("", true),
|
|
4293
4368
|
((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(customViews.value, (cv) => {
|
|
4294
4369
|
return (0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
|
|
4295
4370
|
key: cv.id,
|
|
4296
4371
|
type: "button",
|
|
4297
|
-
class: (0, vue.normalizeClass)(["h-8 px-2.5 flex items-center gap-1 rounded text-xs font-bold transition-colors", activeView.value === customViewKey(cv.id) ? "bg-indigo-600 text-white" : "bg-white text-slate-500 border border-slate-200 hover:bg-slate-50"]),
|
|
4298
|
-
"aria-pressed": activeView.value === customViewKey(cv.id),
|
|
4372
|
+
class: (0, vue.normalizeClass)(["h-8 px-2.5 flex items-center gap-1 rounded text-xs font-bold transition-colors", activeView.value === (0, vue.unref)(customViewKey)(cv.id) ? "bg-indigo-600 text-white" : "bg-white text-slate-500 border border-slate-200 hover:bg-slate-50"]),
|
|
4373
|
+
"aria-pressed": activeView.value === (0, vue.unref)(customViewKey)(cv.id),
|
|
4299
4374
|
"data-testid": `collection-view-custom-${cv.id}`,
|
|
4300
4375
|
onClick: ($event) => setCustomView(cv.id)
|
|
4301
|
-
}, [(0, vue.createElementVNode)("span",
|
|
4376
|
+
}, [(0, vue.createElementVNode)("span", _hoisted_27, (0, vue.toDisplayString)(cv.icon || "dashboard_customize"), 1), (0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)(cv.label), 1)], 10, _hoisted_26);
|
|
4302
4377
|
}), 128)),
|
|
4303
4378
|
canAddCustomView.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
|
|
4304
4379
|
key: 2,
|
|
@@ -4308,7 +4383,7 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4308
4383
|
"aria-label": (0, vue.unref)(t)("collectionsView.addView"),
|
|
4309
4384
|
"data-testid": "collection-view-add",
|
|
4310
4385
|
onClick: addCustomView
|
|
4311
|
-
}, [..._cache[
|
|
4386
|
+
}, [..._cache[34] || (_cache[34] = [(0, vue.createElementVNode)("span", { class: "material-icons text-sm" }, "add", -1)])], 8, _hoisted_28)) : (0, vue.createCommentVNode)("", true),
|
|
4312
4387
|
canConfigureViews.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
|
|
4313
4388
|
key: 3,
|
|
4314
4389
|
type: "button",
|
|
@@ -4317,8 +4392,8 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4317
4392
|
"aria-label": (0, vue.unref)(t)("collectionsView.config.open"),
|
|
4318
4393
|
"data-testid": "collection-config-open",
|
|
4319
4394
|
onClick: _cache[5] || (_cache[5] = ($event) => configOpen.value = true)
|
|
4320
|
-
}, [..._cache[
|
|
4321
|
-
], 8,
|
|
4395
|
+
}, [..._cache[35] || (_cache[35] = [(0, vue.createElementVNode)("span", { class: "material-icons text-sm" }, "settings", -1)])], 8, _hoisted_29)) : (0, vue.createCommentVNode)("", true)
|
|
4396
|
+
], 8, _hoisted_22$1)) : (0, vue.createCommentVNode)("", true),
|
|
4322
4397
|
calendarActive.value && dateFields.value.length > 1 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("select", {
|
|
4323
4398
|
key: 1,
|
|
4324
4399
|
value: calendarAnchorField.value,
|
|
@@ -4330,8 +4405,8 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4330
4405
|
return (0, vue.openBlock)(), (0, vue.createElementBlock)("option", {
|
|
4331
4406
|
key,
|
|
4332
4407
|
value: key
|
|
4333
|
-
}, (0, vue.toDisplayString)(collection.value?.schema.fields[key]?.label ?? key), 9,
|
|
4334
|
-
}), 128))], 40,
|
|
4408
|
+
}, (0, vue.toDisplayString)(collection.value?.schema.fields[key]?.label ?? key), 9, _hoisted_31);
|
|
4409
|
+
}), 128))], 40, _hoisted_30)) : (0, vue.createCommentVNode)("", true),
|
|
4335
4410
|
kanbanActive.value && enumFields.value.length > 1 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("select", {
|
|
4336
4411
|
key: 2,
|
|
4337
4412
|
value: kanbanGroupField.value,
|
|
@@ -4343,24 +4418,24 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4343
4418
|
return (0, vue.openBlock)(), (0, vue.createElementBlock)("option", {
|
|
4344
4419
|
key,
|
|
4345
4420
|
value: key
|
|
4346
|
-
}, (0, vue.toDisplayString)(collection.value?.schema.fields[key]?.label ?? key), 9,
|
|
4347
|
-
}), 128))], 40,
|
|
4348
|
-
items.value.length > 0 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div",
|
|
4421
|
+
}, (0, vue.toDisplayString)(collection.value?.schema.fields[key]?.label ?? key), 9, _hoisted_33);
|
|
4422
|
+
}), 128))], 40, _hoisted_32)) : (0, vue.createCommentVNode)("", true),
|
|
4423
|
+
items.value.length > 0 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_34, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.searchSummary", {
|
|
4349
4424
|
shown: filteredItems.value.length,
|
|
4350
4425
|
total: items.value.length
|
|
4351
4426
|
})), 1)) : (0, vue.createCommentVNode)("", true)
|
|
4352
4427
|
])])) : (0, vue.createCommentVNode)("", true),
|
|
4353
|
-
collection.value && dataIssues.value.length > 0 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div",
|
|
4354
|
-
_cache[
|
|
4355
|
-
(0, vue.createElementVNode)("span",
|
|
4428
|
+
collection.value && dataIssues.value.length > 0 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_35, [
|
|
4429
|
+
_cache[37] || (_cache[37] = (0, vue.createElementVNode)("span", { class: "material-icons text-amber-600" }, "warning", -1)),
|
|
4430
|
+
(0, vue.createElementVNode)("span", _hoisted_36, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.dataIssuesDetected", { count: dataIssues.value.length })), 1),
|
|
4356
4431
|
(0, vue.createElementVNode)("button", {
|
|
4357
4432
|
type: "button",
|
|
4358
4433
|
class: "h-8 px-2.5 flex items-center gap-1 rounded border border-amber-300 bg-white hover:bg-amber-100 text-amber-700 font-bold text-xs transition-colors",
|
|
4359
4434
|
"data-testid": "collections-repair",
|
|
4360
4435
|
onClick: repairCollection
|
|
4361
|
-
}, [_cache[
|
|
4436
|
+
}, [_cache[36] || (_cache[36] = (0, vue.createElementVNode)("span", { class: "material-icons text-sm" }, "build", -1)), (0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.repair")), 1)])
|
|
4362
4437
|
])) : (0, vue.createCommentVNode)("", true),
|
|
4363
|
-
(0, vue.createElementVNode)("div",
|
|
4438
|
+
(0, vue.createElementVNode)("div", _hoisted_37, [loading.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_38, [_cache[38] || (_cache[38] = (0, vue.createElementVNode)("div", { class: "h-8 w-8 border-2 border-indigo-600/20 border-t-indigo-600 rounded-full animate-spin" }, null, -1)), (0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)((0, vue.unref)(t)("common.loading")), 1)])) : loadError.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_39, [_cache[39] || (_cache[39] = (0, vue.createElementVNode)("span", { class: "material-icons text-red-600" }, "error", -1)), (0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)(loadError.value === "not-found" ? (0, vue.unref)(t)("collectionsView.notFound") : `${(0, vue.unref)(t)("collectionsView.loadFailed")}: ${loadError.value}`), 1)])) : !collection.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_40)) : calendarActive.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_41, [(0, vue.createVNode)(CollectionCalendarView_default, {
|
|
4364
4439
|
schema: collection.value.schema,
|
|
4365
4440
|
items: filteredItems.value,
|
|
4366
4441
|
"anchor-field": calendarAnchorField.value,
|
|
@@ -4445,16 +4520,16 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4445
4520
|
"selected",
|
|
4446
4521
|
"can-create",
|
|
4447
4522
|
"show-detail"
|
|
4448
|
-
])) : (0, vue.createCommentVNode)("", true)])) : kanbanActive.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div",
|
|
4449
|
-
_cache[
|
|
4450
|
-
(0, vue.createElementVNode)("span",
|
|
4523
|
+
])) : (0, vue.createCommentVNode)("", true)])) : kanbanActive.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_42, [inlineError.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_43, [
|
|
4524
|
+
_cache[41] || (_cache[41] = (0, vue.createElementVNode)("span", { class: "material-icons text-red-600" }, "error", -1)),
|
|
4525
|
+
(0, vue.createElementVNode)("span", _hoisted_44, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.inlineSaveFailed", { error: inlineError.value })), 1),
|
|
4451
4526
|
(0, vue.createElementVNode)("button", {
|
|
4452
4527
|
type: "button",
|
|
4453
4528
|
class: "h-8 w-8 flex items-center justify-center rounded text-red-600 hover:bg-red-100",
|
|
4454
4529
|
"aria-label": (0, vue.unref)(t)("common.close"),
|
|
4455
4530
|
onClick: _cache[10] || (_cache[10] = ($event) => inlineError.value = null)
|
|
4456
|
-
}, [..._cache[
|
|
4457
|
-
])) : (0, vue.createCommentVNode)("", true), (0, vue.createElementVNode)("div",
|
|
4531
|
+
}, [..._cache[40] || (_cache[40] = [(0, vue.createElementVNode)("span", { class: "material-icons text-base" }, "close", -1)])], 8, _hoisted_45)
|
|
4532
|
+
])) : (0, vue.createCommentVNode)("", true), (0, vue.createElementVNode)("div", _hoisted_46, [(0, vue.createVNode)(CollectionKanbanView_default, {
|
|
4458
4533
|
schema: collection.value.schema,
|
|
4459
4534
|
items: filteredItems.value,
|
|
4460
4535
|
"group-field": kanbanGroupField.value,
|
|
@@ -4468,37 +4543,37 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4468
4543
|
"group-field",
|
|
4469
4544
|
"selected",
|
|
4470
4545
|
"notified"
|
|
4471
|
-
])])])) : activeCustomView.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div",
|
|
4546
|
+
])])])) : activeCustomView.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_47, [(0, vue.createVNode)(CollectionCustomView_default, {
|
|
4472
4547
|
slug: collection.value.slug,
|
|
4473
4548
|
view: activeCustomView.value,
|
|
4474
4549
|
onOpenItem: onCustomViewOpenItem,
|
|
4475
4550
|
onStartChat: onCustomViewStartChat
|
|
4476
|
-
}, null, 8, ["slug", "view"])])) : items.value.length === 0 && editing.value?.mode !== "create" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div",
|
|
4477
|
-
_cache[
|
|
4478
|
-
(0, vue.createElementVNode)("p",
|
|
4551
|
+
}, null, 8, ["slug", "view"])])) : items.value.length === 0 && editing.value?.mode !== "create" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_48, [_cache[42] || (_cache[42] = (0, vue.createElementVNode)("span", { class: "material-icons text-4xl text-slate-300" }, "folder_open", -1)), (0, vue.createElementVNode)("p", _hoisted_49, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.itemsEmpty")), 1)])) : filteredItems.value.length === 0 && editing.value?.mode !== "create" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_50, [
|
|
4552
|
+
_cache[43] || (_cache[43] = (0, vue.createElementVNode)("span", { class: "material-icons text-4xl text-slate-300" }, "search_off", -1)),
|
|
4553
|
+
(0, vue.createElementVNode)("p", _hoisted_51, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.noMatchingItems")), 1),
|
|
4479
4554
|
(0, vue.createElementVNode)("button", {
|
|
4480
4555
|
type: "button",
|
|
4481
4556
|
class: "text-xs text-indigo-600 font-semibold hover:underline",
|
|
4482
4557
|
onClick: _cache[11] || (_cache[11] = ($event) => searchQuery.value = "")
|
|
4483
4558
|
}, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.clearSearch")), 1)
|
|
4484
|
-
])) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("div",
|
|
4485
|
-
_cache[
|
|
4486
|
-
(0, vue.createElementVNode)("span",
|
|
4559
|
+
])) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_52, [inlineError.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_53, [
|
|
4560
|
+
_cache[45] || (_cache[45] = (0, vue.createElementVNode)("span", { class: "material-icons text-red-600" }, "error", -1)),
|
|
4561
|
+
(0, vue.createElementVNode)("span", _hoisted_54, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.inlineSaveFailed", { error: inlineError.value })), 1),
|
|
4487
4562
|
(0, vue.createElementVNode)("button", {
|
|
4488
4563
|
type: "button",
|
|
4489
4564
|
class: "h-8 w-8 flex items-center justify-center rounded text-red-600 hover:bg-red-100",
|
|
4490
4565
|
"aria-label": (0, vue.unref)(t)("common.close"),
|
|
4491
4566
|
onClick: _cache[12] || (_cache[12] = ($event) => inlineError.value = null)
|
|
4492
|
-
}, [..._cache[
|
|
4493
|
-
])) : (0, vue.createCommentVNode)("", true), (0, vue.createElementVNode)("table",
|
|
4567
|
+
}, [..._cache[44] || (_cache[44] = [(0, vue.createElementVNode)("span", { class: "material-icons text-base" }, "close", -1)])], 8, _hoisted_55)
|
|
4568
|
+
])) : (0, vue.createCommentVNode)("", true), (0, vue.createElementVNode)("table", _hoisted_56, [(0, vue.createElementVNode)("thead", null, [(0, vue.createElementVNode)("tr", _hoisted_57, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(listColumnFields.value, ([key, field]) => {
|
|
4494
4569
|
return (0, vue.openBlock)(), (0, vue.createElementBlock)("th", {
|
|
4495
4570
|
key,
|
|
4496
|
-
"aria-sort": (0, vue.unref)(
|
|
4571
|
+
"aria-sort": (0, vue.unref)(_mulmoclaude_core_collection.isSortableField)(field) ? sortAriaValue(key) : void 0,
|
|
4497
4572
|
class: "px-5 py-3 font-bold text-slate-500 text-left uppercase tracking-wider whitespace-nowrap"
|
|
4498
|
-
}, [(0, vue.createElementVNode)("div",
|
|
4573
|
+
}, [(0, vue.createElementVNode)("div", _hoisted_59, [(0, vue.createElementVNode)("span", {
|
|
4499
4574
|
class: "truncate max-w-[14rem]",
|
|
4500
4575
|
title: field.label
|
|
4501
|
-
}, (0, vue.toDisplayString)(field.label), 9,
|
|
4576
|
+
}, (0, vue.toDisplayString)(field.label), 9, _hoisted_60), (0, vue.unref)(_mulmoclaude_core_collection.isSortableField)(field) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
|
|
4502
4577
|
key: 0,
|
|
4503
4578
|
type: "button",
|
|
4504
4579
|
class: (0, vue.normalizeClass)(["inline-flex items-center justify-center rounded p-0.5 -my-1 leading-none transition-colors", sortButtonClass(key)]),
|
|
@@ -4507,8 +4582,8 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4507
4582
|
onClick: (0, vue.withModifiers)(($event) => cycleSort(key), ["stop"]),
|
|
4508
4583
|
onPointerenter: ($event) => hoveredSortKey.value = key,
|
|
4509
4584
|
onPointerleave: _cache[13] || (_cache[13] = ($event) => hoveredSortKey.value = null)
|
|
4510
|
-
}, [(0, vue.createElementVNode)("span",
|
|
4511
|
-
}), 128))])]), (0, vue.createElementVNode)("tbody",
|
|
4585
|
+
}, [(0, vue.createElementVNode)("span", _hoisted_62, (0, vue.toDisplayString)(sortIconName(key)), 1)], 42, _hoisted_61)) : (0, vue.createCommentVNode)("", true)])], 8, _hoisted_58);
|
|
4586
|
+
}), 128))])]), (0, vue.createElementVNode)("tbody", _hoisted_63, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(sortedItems.value, (item) => {
|
|
4512
4587
|
return (0, vue.openBlock)(), (0, vue.createElementBlock)("tr", {
|
|
4513
4588
|
key: String(item[collection.value.schema.primaryKey] ?? ""),
|
|
4514
4589
|
class: (0, vue.normalizeClass)(["hover:bg-slate-50/70 cursor-pointer transition-colors focus:outline-none focus:bg-indigo-50/30", isRowOpen(item) || isEditingRow(item) ? "bg-indigo-50/40" : ""]),
|
|
@@ -4522,7 +4597,7 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4522
4597
|
return (0, vue.openBlock)(), (0, vue.createElementBlock)("td", {
|
|
4523
4598
|
key,
|
|
4524
4599
|
class: "px-5 py-2 text-slate-700 align-middle max-w-xs font-medium"
|
|
4525
|
-
}, [(0, vue.unref)(
|
|
4600
|
+
}, [(0, vue.unref)(_mulmoclaude_core_collection.fieldVisible)(field, item) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, [field.type === "toggle" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("input", {
|
|
4526
4601
|
key: 0,
|
|
4527
4602
|
type: "checkbox",
|
|
4528
4603
|
checked: toggleChecked(item, field),
|
|
@@ -4532,7 +4607,7 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4532
4607
|
"aria-label": field.label,
|
|
4533
4608
|
onClick: _cache[14] || (_cache[14] = (0, vue.withModifiers)(() => {}, ["stop"])),
|
|
4534
4609
|
onChange: ($event) => commitToggle(item, field)
|
|
4535
|
-
}, null, 40,
|
|
4610
|
+
}, null, 40, _hoisted_65)) : field.type === "boolean" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("input", {
|
|
4536
4611
|
key: 1,
|
|
4537
4612
|
type: "checkbox",
|
|
4538
4613
|
checked: item[key] === true,
|
|
@@ -4542,7 +4617,7 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4542
4617
|
"aria-label": field.label,
|
|
4543
4618
|
onClick: _cache[15] || (_cache[15] = (0, vue.withModifiers)(() => {}, ["stop"])),
|
|
4544
4619
|
onChange: ($event) => commitInlineEdit(item, String(key), field, $event.target.checked)
|
|
4545
|
-
}, null, 40,
|
|
4620
|
+
}, null, 40, _hoisted_66)) : field.type === "ref" && field.to && typeof item[key] === "string" && item[key] ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_67, [(0, vue.createElementVNode)("a", {
|
|
4546
4621
|
href: (0, vue.unref)(cui).recordHref?.(field.to, String(item[key])),
|
|
4547
4622
|
tabindex: (0, vue.unref)(cui).recordHref?.(field.to, String(item[key])) ? void 0 : 0,
|
|
4548
4623
|
role: "link",
|
|
@@ -4550,7 +4625,7 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4550
4625
|
"data-testid": `collections-ref-link-${key}-${item[key]}`,
|
|
4551
4626
|
onClick: ($event) => (0, vue.unref)(activateRefLink)($event, field.to, String(item[key]), true),
|
|
4552
4627
|
onKeydown: [(0, vue.withKeys)(($event) => (0, vue.unref)(activateRefLink)($event, field.to, String(item[key]), true), ["enter"]), (0, vue.withKeys)(($event) => (0, vue.unref)(activateRefLink)($event, field.to, String(item[key]), true), ["space"])]
|
|
4553
|
-
}, (0, vue.toDisplayString)((0, vue.unref)(refDisplay)(field.to, String(item[key]))), 41,
|
|
4628
|
+
}, (0, vue.toDisplayString)((0, vue.unref)(refDisplay)(field.to, String(item[key]))), 41, _hoisted_68)])) : field.type === "enum" && Array.isArray(field.values) && field.values.length > 0 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("select", {
|
|
4554
4629
|
key: 3,
|
|
4555
4630
|
value: item[key] == null ? "" : String(item[key]),
|
|
4556
4631
|
disabled: isRowInlineSaving(item),
|
|
@@ -4559,12 +4634,12 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4559
4634
|
"aria-label": field.label,
|
|
4560
4635
|
onClick: _cache[16] || (_cache[16] = (0, vue.withModifiers)(() => {}, ["stop"])),
|
|
4561
4636
|
onChange: ($event) => commitInlineEdit(item, String(key), field, $event.target.value)
|
|
4562
|
-
}, [showEnumPlaceholder(item, String(key)) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("option",
|
|
4637
|
+
}, [showEnumPlaceholder(item, String(key)) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("option", _hoisted_70, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.selectPlaceholder")), 1)) : (0, vue.createCommentVNode)("", true), ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(field.values, (value) => {
|
|
4563
4638
|
return (0, vue.openBlock)(), (0, vue.createElementBlock)("option", {
|
|
4564
4639
|
key: value,
|
|
4565
4640
|
value
|
|
4566
|
-
}, (0, vue.toDisplayString)(value), 9,
|
|
4567
|
-
}), 128))], 42,
|
|
4641
|
+
}, (0, vue.toDisplayString)(value), 9, _hoisted_71);
|
|
4642
|
+
}), 128))], 42, _hoisted_69)) : field.type === "money" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_72, (0, vue.toDisplayString)((0, vue.unref)(formatMoney)(item[key], (0, vue.unref)(resolveCurrency)(field, item), (0, vue.unref)(locale))), 1)) : field.type === "table" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_73, [_cache[46] || (_cache[46] = (0, vue.createElementVNode)("span", { class: "material-icons text-[11px]" }, "list", -1)), (0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)(tableSummary(item[key])), 1)])) : field.type === "derived" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_74, (0, vue.toDisplayString)((0, vue.unref)(derivedDisplay)(field, (0, vue.unref)(evaluateDerivedAgainstItem)(field, String(key), item), item)), 1)) : field.type !== "file" && (0, vue.unref)(isExternalUrl)(item[key]) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("a", {
|
|
4568
4643
|
key: 7,
|
|
4569
4644
|
href: String(item[key]),
|
|
4570
4645
|
target: "_blank",
|
|
@@ -4572,7 +4647,7 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4572
4647
|
class: "block truncate text-blue-600 hover:text-blue-800 hover:underline font-semibold",
|
|
4573
4648
|
"data-testid": `collections-url-link-${key}-${item[collection.value.schema.primaryKey]}`,
|
|
4574
4649
|
onClick: _cache[17] || (_cache[17] = (0, vue.withModifiers)(() => {}, ["stop"]))
|
|
4575
|
-
}, (0, vue.toDisplayString)(String(item[key])), 9,
|
|
4650
|
+
}, (0, vue.toDisplayString)(String(item[key])), 9, _hoisted_75)) : field.type === "file" && (0, vue.unref)(artifactUrl)(item[key]) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("a", {
|
|
4576
4651
|
key: 8,
|
|
4577
4652
|
href: (0, vue.unref)(artifactUrl)(item[key]) ?? void 0,
|
|
4578
4653
|
target: "_blank",
|
|
@@ -4580,17 +4655,17 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4580
4655
|
class: "block truncate text-blue-600 hover:text-blue-800 hover:underline font-semibold",
|
|
4581
4656
|
"data-testid": `collections-file-link-${key}-${item[collection.value.schema.primaryKey]}`,
|
|
4582
4657
|
onClick: _cache[18] || (_cache[18] = (0, vue.withModifiers)(() => {}, ["stop"]))
|
|
4583
|
-
}, (0, vue.toDisplayString)(String(item[key])), 9,
|
|
4658
|
+
}, (0, vue.toDisplayString)(String(item[key])), 9, _hoisted_76)) : field.type === "file" && (0, vue.unref)(fileRoutePath)(item[key]) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("a", {
|
|
4584
4659
|
key: 9,
|
|
4585
4660
|
href: (0, vue.unref)(fileRoutePath)(item[key]) ?? void 0,
|
|
4586
4661
|
class: "block truncate text-blue-600 hover:text-blue-800 hover:underline font-semibold",
|
|
4587
4662
|
"data-testid": `collections-file-link-${key}-${item[collection.value.schema.primaryKey]}`,
|
|
4588
4663
|
onClick: ($event) => (0, vue.unref)(activatePathLink)($event, (0, vue.unref)(fileRoutePath)(item[key]) ?? "", true)
|
|
4589
|
-
}, (0, vue.toDisplayString)(String(item[key])), 9,
|
|
4590
|
-
}), 128))], 42,
|
|
4664
|
+
}, (0, vue.toDisplayString)(String(item[key])), 9, _hoisted_77)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_78, (0, vue.toDisplayString)((0, vue.unref)(formatCell)(item[key], field.type)), 1))], 64)) : (0, vue.createCommentVNode)("", true)]);
|
|
4665
|
+
}), 128))], 42, _hoisted_64);
|
|
4591
4666
|
}), 128))])])]))]),
|
|
4592
4667
|
collection.value && (viewing.value || editing.value) && !(calendarActive.value && openDay.value) ? ((0, vue.openBlock)(), (0, vue.createBlock)(CollectionRecordModal_default, {
|
|
4593
|
-
key:
|
|
4668
|
+
key: 4,
|
|
4594
4669
|
onClose: closeRecordModal
|
|
4595
4670
|
}, {
|
|
4596
4671
|
default: (0, vue.withCtx)(() => [(0, vue.createVNode)(CollectionRecordPanel_default, {
|
|
@@ -4635,7 +4710,7 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4635
4710
|
_: 1
|
|
4636
4711
|
})) : (0, vue.createCommentVNode)("", true),
|
|
4637
4712
|
configOpen.value && collection.value ? ((0, vue.openBlock)(), (0, vue.createBlock)(CollectionViewConfigModal_default, {
|
|
4638
|
-
key:
|
|
4713
|
+
key: 5,
|
|
4639
4714
|
slug: collection.value.slug,
|
|
4640
4715
|
title: collection.value.title,
|
|
4641
4716
|
views: customViews.value,
|
|
@@ -4647,7 +4722,7 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4647
4722
|
"views"
|
|
4648
4723
|
])) : (0, vue.createCommentVNode)("", true),
|
|
4649
4724
|
chatOpen.value && collection.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
|
|
4650
|
-
key:
|
|
4725
|
+
key: 6,
|
|
4651
4726
|
class: "fixed inset-0 z-30 flex items-center justify-center bg-slate-900/60 backdrop-blur-sm p-4 transition-all duration-300",
|
|
4652
4727
|
role: "dialog",
|
|
4653
4728
|
"aria-modal": "true",
|
|
@@ -4655,19 +4730,19 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4655
4730
|
"data-testid": "collections-chat-modal",
|
|
4656
4731
|
onClick: (0, vue.withModifiers)(closeChat, ["self"]),
|
|
4657
4732
|
onKeydown: (0, vue.withKeys)(closeChat, ["esc"])
|
|
4658
|
-
}, [(0, vue.createElementVNode)("div",
|
|
4659
|
-
(0, vue.createElementVNode)("header",
|
|
4660
|
-
_cache[
|
|
4661
|
-
(0, vue.createElementVNode)("div",
|
|
4733
|
+
}, [(0, vue.createElementVNode)("div", _hoisted_79, [
|
|
4734
|
+
(0, vue.createElementVNode)("header", _hoisted_80, [
|
|
4735
|
+
_cache[48] || (_cache[48] = (0, vue.createElementVNode)("div", { class: "h-9 w-9 flex items-center justify-center rounded-xl bg-indigo-50 text-indigo-600 border border-indigo-100/50" }, [(0, vue.createElementVNode)("span", { class: "material-icons text-lg" }, "forum")], -1)),
|
|
4736
|
+
(0, vue.createElementVNode)("div", _hoisted_81, [(0, vue.createElementVNode)("h2", _hoisted_82, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.chatTitle")), 1), (0, vue.createElementVNode)("span", _hoisted_83, (0, vue.toDisplayString)(collection.value.title), 1)]),
|
|
4662
4737
|
(0, vue.createElementVNode)("button", {
|
|
4663
4738
|
type: "button",
|
|
4664
4739
|
class: "h-8 w-8 flex items-center justify-center rounded text-slate-400 hover:bg-slate-200/50 hover:text-slate-600 transition-colors",
|
|
4665
4740
|
"aria-label": (0, vue.unref)(t)("common.close"),
|
|
4666
4741
|
"data-testid": "collections-chat-close",
|
|
4667
4742
|
onClick: closeChat
|
|
4668
|
-
}, [..._cache[
|
|
4743
|
+
}, [..._cache[47] || (_cache[47] = [(0, vue.createElementVNode)("span", { class: "material-icons text-lg" }, "close", -1)])], 8, _hoisted_84)
|
|
4669
4744
|
]),
|
|
4670
|
-
(0, vue.createElementVNode)("div",
|
|
4745
|
+
(0, vue.createElementVNode)("div", _hoisted_85, [(0, vue.withDirectives)((0, vue.createElementVNode)("textarea", {
|
|
4671
4746
|
ref_key: "chatInputEl",
|
|
4672
4747
|
ref: chatInputEl,
|
|
4673
4748
|
"onUpdate:modelValue": _cache[22] || (_cache[22] = ($event) => chatMessage.value = $event),
|
|
@@ -4676,8 +4751,8 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4676
4751
|
class: "w-full bg-slate-50 border border-slate-200/80 rounded-xl px-3 py-2.5 text-sm placeholder-slate-400 focus:outline-none focus:ring-2 focus:ring-indigo-500/20 focus:border-indigo-500 focus:bg-white transition-all resize-none",
|
|
4677
4752
|
"data-testid": "collections-chat-input",
|
|
4678
4753
|
onKeydown: [(0, vue.withKeys)((0, vue.withModifiers)(submitChat, ["meta"]), ["enter"]), (0, vue.withKeys)((0, vue.withModifiers)(submitChat, ["ctrl"]), ["enter"])]
|
|
4679
|
-
}, null, 40,
|
|
4680
|
-
(0, vue.createElementVNode)("footer",
|
|
4754
|
+
}, null, 40, _hoisted_86), [[vue.vModelText, chatMessage.value]])]),
|
|
4755
|
+
(0, vue.createElementVNode)("footer", _hoisted_87, [(0, vue.createElementVNode)("button", {
|
|
4681
4756
|
type: "button",
|
|
4682
4757
|
class: "h-8 px-2.5 rounded text-xs font-bold text-slate-500 hover:bg-slate-200/50 transition-colors",
|
|
4683
4758
|
"data-testid": "collections-chat-cancel",
|
|
@@ -4688,7 +4763,7 @@ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
4688
4763
|
disabled: !chatMessage.value.trim(),
|
|
4689
4764
|
"data-testid": "collections-chat-send",
|
|
4690
4765
|
onClick: submitChat
|
|
4691
|
-
}, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.chatStart")), 9,
|
|
4766
|
+
}, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.chatStart")), 9, _hoisted_88)])
|
|
4692
4767
|
])], 32)) : (0, vue.createCommentVNode)("", true)
|
|
4693
4768
|
]);
|
|
4694
4769
|
};
|
|
@@ -5112,8 +5187,8 @@ var FeedsView_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
5112
5187
|
//#endregion
|
|
5113
5188
|
//#region src/vue/index.ts
|
|
5114
5189
|
var plugin = {
|
|
5115
|
-
toolDefinition:
|
|
5116
|
-
execute:
|
|
5190
|
+
toolDefinition: _mulmoclaude_core_collection.TOOL_DEFINITION,
|
|
5191
|
+
execute: _mulmoclaude_core_collection.executePresentCollection,
|
|
5117
5192
|
generatingMessage: "Loading collection...",
|
|
5118
5193
|
isEnabled: () => true,
|
|
5119
5194
|
viewComponent: View_default,
|
|
@@ -5133,8 +5208,10 @@ exports.CollectionsIndexView = CollectionsIndexView_default;
|
|
|
5133
5208
|
exports.FeedsView = FeedsView_default;
|
|
5134
5209
|
exports.PresentCollectionPreview = Preview_default;
|
|
5135
5210
|
exports.PresentCollectionView = View_default;
|
|
5211
|
+
exports.applicableViewModes = applicableViewModes;
|
|
5136
5212
|
exports.collectionUi = collectionUi;
|
|
5137
5213
|
exports.configureCollectionUi = configureCollectionUi;
|
|
5214
|
+
exports.customViewKey = customViewKey;
|
|
5138
5215
|
exports.plugin = plugin;
|
|
5139
5216
|
exports.readCollectionSort = readCollectionSort;
|
|
5140
5217
|
exports.readCollectionViewMode = readCollectionViewMode;
|