@mulmoclaude/collection-plugin 0.3.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/errorMessage.d.ts +5 -0
- package/dist/core/errorMessage.d.ts.map +1 -0
- package/dist/core/promptSafety.d.ts +2 -0
- package/dist/core/promptSafety.d.ts.map +1 -0
- package/dist/core/shortHexId.d.ts +9 -0
- package/dist/core/shortHexId.d.ts.map +1 -0
- package/dist/core/uiTypes.d.ts +26 -1
- package/dist/core/uiTypes.d.ts.map +1 -1
- package/dist/index.cjs +45 -126
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -86
- package/dist/index.js.map +1 -1
- package/dist/{calendarGrid-DZeLwBj9.cjs → promptSafety-BSO2gdsg.cjs} +184 -1
- package/dist/promptSafety-BSO2gdsg.cjs.map +1 -0
- package/dist/{calendarGrid-ggmFTZju.js → promptSafety-DShN_VCG.js} +113 -2
- package/dist/promptSafety-DShN_VCG.js.map +1 -0
- package/dist/style.css +544 -1
- package/dist/vue/collectionViewMode.d.ts +12 -0
- package/dist/vue/collectionViewMode.d.ts.map +1 -0
- package/dist/vue/components/CollectionCustomView.vue.d.ts +9 -0
- package/dist/vue/components/CollectionCustomView.vue.d.ts.map +1 -0
- package/dist/vue/components/CollectionEmbedView.vue.d.ts.map +1 -1
- package/dist/vue/components/CollectionView.vue.d.ts +41 -0
- package/dist/vue/components/CollectionView.vue.d.ts.map +1 -0
- package/dist/vue/components/CollectionViewConfigModal.vue.d.ts +16 -0
- package/dist/vue/components/CollectionViewConfigModal.vue.d.ts.map +1 -0
- package/dist/vue/components/CollectionsIndexView.vue.d.ts +4 -0
- package/dist/vue/components/CollectionsIndexView.vue.d.ts.map +1 -0
- package/dist/vue/components/FeedsView.vue.d.ts +4 -0
- package/dist/vue/components/FeedsView.vue.d.ts.map +1 -0
- package/dist/vue/index.d.ts +7 -1
- package/dist/vue/index.d.ts.map +1 -1
- package/dist/vue/lang/de.d.ts +4 -0
- package/dist/vue/lang/de.d.ts.map +1 -0
- package/dist/vue/lang/en.d.ts +99 -0
- package/dist/vue/lang/en.d.ts.map +1 -0
- package/dist/vue/lang/es.d.ts +4 -0
- package/dist/vue/lang/es.d.ts.map +1 -0
- package/dist/vue/lang/fr.d.ts +4 -0
- package/dist/vue/lang/fr.d.ts.map +1 -0
- package/dist/vue/lang/index.d.ts +112 -0
- package/dist/vue/lang/index.d.ts.map +1 -0
- package/dist/vue/lang/ja.d.ts +4 -0
- package/dist/vue/lang/ja.d.ts.map +1 -0
- package/dist/vue/lang/ko.d.ts +4 -0
- package/dist/vue/lang/ko.d.ts.map +1 -0
- package/dist/vue/lang/ptBR.d.ts +4 -0
- package/dist/vue/lang/ptBR.d.ts.map +1 -0
- package/dist/vue/lang/zh.d.ts +4 -0
- package/dist/vue/lang/zh.d.ts.map +1 -0
- package/dist/vue/uiContext.d.ts +143 -4
- package/dist/vue/uiContext.d.ts.map +1 -1
- package/dist/vue/useCollectionRendering.d.ts.map +1 -1
- package/dist/vue.cjs +3335 -238
- package/dist/vue.cjs.map +1 -1
- package/dist/vue.js +3305 -217
- package/dist/vue.js.map +1 -1
- package/package.json +1 -1
- package/dist/calendarGrid-DZeLwBj9.cjs.map +0 -1
- package/dist/calendarGrid-ggmFTZju.js.map +0 -1
package/dist/vue.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { M as
|
|
1
|
+
import { A as buildUpdatedRecord, C as dateSortValue, D as numericSortValue, E as nextSortDirection, F as rowFromItem, I as actionVisible, L as fieldVisible, M as draftToRecord, N as emptyRow, O as sortItems, P as firstMissingRequiredField, T as isSortableField, W as resolveEnumColor, _ as ymdKey, a as assignLanes, b as labelFieldFor, i as MINUTES_PER_DAY, j as coerceInlineValue, k as stringSortValue, l as dateOf, n as shortHexId, o as bucketRecords, r as errorMessage, s as buildMonthGrid, t as defangForPrompt, u as daySlice, v as itemIdOf, w as enumSortValue, x as boolSortValue, y as itemLabelOf } from "./promptSafety-DShN_VCG.js";
|
|
2
2
|
import { t as deriveAll } from "./deriveAll-BHcs1erT.js";
|
|
3
|
-
import { Fragment, Teleport, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeModels, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, openBlock, ref, renderList, renderSlot, resolveComponent, resolveDynamicComponent, toDisplayString, unref, useModel, vModelCheckbox, vModelDynamic, vModelSelect, vModelText, withCtx, withDirectives, withKeys, withModifiers } from "vue";
|
|
4
|
-
import {
|
|
3
|
+
import { Fragment, Teleport, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, effectScope, mergeModels, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, openBlock, ref, renderList, renderSlot, resolveComponent, resolveDynamicComponent, toDisplayString, unref, useModel, vModelCheckbox, vModelDynamic, vModelSelect, vModelText, watch, watchEffect, withCtx, withDirectives, withKeys, withModifiers } from "vue";
|
|
4
|
+
import { createI18n } from "vue-i18n";
|
|
5
5
|
import draggable from "vuedraggable";
|
|
6
6
|
//#region src/vue/uiContext.ts
|
|
7
7
|
var current = null;
|
|
@@ -66,10 +66,20 @@ function useCollectionRendering(collection, locale) {
|
|
|
66
66
|
const embedTargets = new Set(uniqueEmbedTargets(schema));
|
|
67
67
|
const allTargets = [...new Set([...refTargets, ...embedTargets])];
|
|
68
68
|
if (allTargets.length === 0) return;
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
69
|
+
const binding = collectionUi();
|
|
70
|
+
const results = await Promise.all(allTargets.map(async (target) => {
|
|
71
|
+
try {
|
|
72
|
+
return {
|
|
73
|
+
target,
|
|
74
|
+
result: await binding.fetchCollectionDetail(target)
|
|
75
|
+
};
|
|
76
|
+
} catch {
|
|
77
|
+
return {
|
|
78
|
+
target,
|
|
79
|
+
result: { ok: false }
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
}));
|
|
73
83
|
if (collection.value?.slug !== expectedSlug) return;
|
|
74
84
|
const nextRef = {};
|
|
75
85
|
const nextRefRecords = {};
|
|
@@ -256,6 +266,73 @@ function useCollectionRendering(collection, locale) {
|
|
|
256
266
|
};
|
|
257
267
|
}
|
|
258
268
|
//#endregion
|
|
269
|
+
//#region src/vue/collectionViewMode.ts
|
|
270
|
+
var STORAGE_KEY = "collection_view_modes";
|
|
271
|
+
var SORT_STORAGE_KEY = "collection_sorts";
|
|
272
|
+
var BUILT_IN_MODES = [
|
|
273
|
+
"table",
|
|
274
|
+
"calendar",
|
|
275
|
+
"kanban"
|
|
276
|
+
];
|
|
277
|
+
/** A persisted mode is valid if it's a known built-in OR any `custom:<id>`
|
|
278
|
+
* key (the id is validated against the live schema at render time, so an
|
|
279
|
+
* unknown custom id simply collapses to the table there). Takes `unknown`
|
|
280
|
+
* and type-guards `string` first: a corrupted localStorage entry could hold a
|
|
281
|
+
* number/object, and calling `.startsWith` on that would throw. */
|
|
282
|
+
function isValidViewMode(value) {
|
|
283
|
+
return typeof value === "string" && (BUILT_IN_MODES.includes(value) || value.startsWith("custom:"));
|
|
284
|
+
}
|
|
285
|
+
function readAll() {
|
|
286
|
+
try {
|
|
287
|
+
const raw = localStorage.getItem(STORAGE_KEY);
|
|
288
|
+
if (!raw) return {};
|
|
289
|
+
const parsed = JSON.parse(raw);
|
|
290
|
+
return parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : {};
|
|
291
|
+
} catch {
|
|
292
|
+
return {};
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
function readCollectionViewMode(slug) {
|
|
296
|
+
const stored = readAll()[slug];
|
|
297
|
+
return isValidViewMode(stored) ? stored : null;
|
|
298
|
+
}
|
|
299
|
+
function writeCollectionViewMode(slug, view) {
|
|
300
|
+
try {
|
|
301
|
+
const all = readAll();
|
|
302
|
+
all[slug] = view;
|
|
303
|
+
localStorage.setItem(STORAGE_KEY, JSON.stringify(all));
|
|
304
|
+
} catch {}
|
|
305
|
+
}
|
|
306
|
+
function isSortState(value) {
|
|
307
|
+
if (!value || typeof value !== "object") return false;
|
|
308
|
+
const rec = value;
|
|
309
|
+
return typeof rec.field === "string" && (rec.direction === "asc" || rec.direction === "desc");
|
|
310
|
+
}
|
|
311
|
+
function readAllSorts() {
|
|
312
|
+
try {
|
|
313
|
+
const raw = localStorage.getItem(SORT_STORAGE_KEY);
|
|
314
|
+
if (!raw) return {};
|
|
315
|
+
const parsed = JSON.parse(raw);
|
|
316
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return {};
|
|
317
|
+
const out = {};
|
|
318
|
+
for (const [slug, value] of Object.entries(parsed)) if (isSortState(value)) out[slug] = value;
|
|
319
|
+
return out;
|
|
320
|
+
} catch {
|
|
321
|
+
return {};
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
function readCollectionSort(slug) {
|
|
325
|
+
return readAllSorts()[slug] ?? null;
|
|
326
|
+
}
|
|
327
|
+
/** Persist (or, when `sort` is null, clear) the slug's active column sort. */
|
|
328
|
+
function writeCollectionSort(slug, sort) {
|
|
329
|
+
try {
|
|
330
|
+
const all = Object.fromEntries(Object.entries(readAllSorts()).filter(([key]) => key !== slug));
|
|
331
|
+
if (sort) all[slug] = sort;
|
|
332
|
+
localStorage.setItem(SORT_STORAGE_KEY, JSON.stringify(all));
|
|
333
|
+
} catch {}
|
|
334
|
+
}
|
|
335
|
+
//#endregion
|
|
259
336
|
//#region src/vue/components/CollectionRecordModal.vue
|
|
260
337
|
var CollectionRecordModal_default = /* @__PURE__ */ defineComponent({
|
|
261
338
|
__name: "CollectionRecordModal",
|
|
@@ -326,31 +403,834 @@ var CollectionRecordModal_default = /* @__PURE__ */ defineComponent({
|
|
|
326
403
|
}
|
|
327
404
|
});
|
|
328
405
|
//#endregion
|
|
406
|
+
//#region src/vue/lang/index.ts
|
|
407
|
+
var i18n = createI18n({
|
|
408
|
+
legacy: false,
|
|
409
|
+
locale: "en",
|
|
410
|
+
fallbackLocale: "en",
|
|
411
|
+
messages: {
|
|
412
|
+
en: {
|
|
413
|
+
collectionsView: {
|
|
414
|
+
addCollectionLabel: "Collection",
|
|
415
|
+
addCollectionPrompt: "Help me create a new collection. First read `config/helps/collection-skills.md` for the schema-driven collection conventions. Then use the `presentForm` tool (do not use AskUserQuestion) to ask me what kind of data I want to track, and author the schema.json and SKILL.md from my answers.",
|
|
416
|
+
addFeedTitle: "Add a feed",
|
|
417
|
+
addFeedHint: "Paste a feed or API URL — I'll fetch it and work out the title and fields for you.",
|
|
418
|
+
addFeedPrompt: "Add a new data-source feed from this URL: {url}\n\nFirst Read `config/helps/feeds.md` and follow it exactly. Fetch that URL yourself, inspect the response to infer a sensible title and fields, then author `feeds/<slug>/schema.json` as the help describes — do NOT ask me any questions; work it all out from the data. Opening the feed loads its items automatically; when you're done, tell me it's registered (no need to mention Refresh).",
|
|
419
|
+
title: "Collections",
|
|
420
|
+
backToIndex: "Back to collections",
|
|
421
|
+
indexEmpty: "No collections installed. Star a skill that ships a schema from the Skills page to see it here.",
|
|
422
|
+
editItem: "Edit",
|
|
423
|
+
openItem: "Open {id}",
|
|
424
|
+
confirmDelete: "Delete this item? This cannot be undone.",
|
|
425
|
+
deleteFeed: "Delete feed",
|
|
426
|
+
confirmDeleteFeed: "Delete the \"{title}\" feed and all its fetched records? This cannot be undone.",
|
|
427
|
+
deleteCollection: "Delete collection",
|
|
428
|
+
confirmDeleteCollection: "Delete the entire \"{title}\" collection, including all its records? A restorable backup is archived first.",
|
|
429
|
+
itemsEmpty: "No items yet. Click + to add one.",
|
|
430
|
+
notFound: "Collection not found",
|
|
431
|
+
loadFailed: "Failed to load",
|
|
432
|
+
requiredField: "This field is required",
|
|
433
|
+
selectPlaceholder: "Select…",
|
|
434
|
+
inlineSaveFailed: "Couldn't save change: {error}",
|
|
435
|
+
addRow: "Add row",
|
|
436
|
+
removeRow: "Remove row",
|
|
437
|
+
noRows: "No rows yet",
|
|
438
|
+
tableSummary: "{count} items",
|
|
439
|
+
embedMissing: "No “{id}” record found in {collection}.",
|
|
440
|
+
embedCreate: "Set it up",
|
|
441
|
+
searchPlaceholder: "Search records…",
|
|
442
|
+
searchSummary: "Showing {shown} of {total}",
|
|
443
|
+
noMatchingItems: "No matching items",
|
|
444
|
+
clearSearch: "Clear search",
|
|
445
|
+
sortBy: "Sort by {field}",
|
|
446
|
+
openCollection: "Open {title}",
|
|
447
|
+
createTitle: "Add new",
|
|
448
|
+
derivedLabel: "Derived",
|
|
449
|
+
embedMissingTitle: "Embedded reference missing",
|
|
450
|
+
chat: "Chat",
|
|
451
|
+
refreshFeed: "Refresh",
|
|
452
|
+
refreshFailed: "Refresh failed: {error}",
|
|
453
|
+
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}",
|
|
454
|
+
feedsTitle: "Data-source feeds",
|
|
455
|
+
feedsEmpty: "No feeds registered yet.",
|
|
456
|
+
chatTitle: "Start a chat",
|
|
457
|
+
chatPlaceholder: "Describe what you want to do with this collection…",
|
|
458
|
+
chatStart: "Start chat",
|
|
459
|
+
viewToggle: "View",
|
|
460
|
+
viewTable: "Table",
|
|
461
|
+
viewCalendar: "Calendar",
|
|
462
|
+
calendarFieldLabel: "Calendar date field",
|
|
463
|
+
calendarPrevMonth: "Previous month",
|
|
464
|
+
calendarNextMonth: "Next month",
|
|
465
|
+
calendarToday: "Today",
|
|
466
|
+
calendarNoDate: "No date",
|
|
467
|
+
calendarCreateOn: "Create on {date}",
|
|
468
|
+
dayViewOpen: "Open day view for {date}",
|
|
469
|
+
dayViewAllDay: "All day",
|
|
470
|
+
dayViewEmpty: "No items on this day",
|
|
471
|
+
dayViewClose: "Close day view",
|
|
472
|
+
viewKanban: "Kanban",
|
|
473
|
+
kanbanFieldLabel: "Kanban group field",
|
|
474
|
+
kanbanUncategorized: "Uncategorized",
|
|
475
|
+
kanbanOpenCard: "Open {label}",
|
|
476
|
+
addView: "Add view",
|
|
477
|
+
config: {
|
|
478
|
+
open: "Collection settings",
|
|
479
|
+
title: "{title} · settings",
|
|
480
|
+
viewsHeading: "Custom views",
|
|
481
|
+
deleteView: "Delete {label}",
|
|
482
|
+
confirmDelete: "Delete the \"{label}\" view? This removes its HTML file and unregisters it.",
|
|
483
|
+
empty: "No custom views yet."
|
|
484
|
+
},
|
|
485
|
+
customViewLoading: "Loading view…",
|
|
486
|
+
customViewError: "Couldn't load this view: {error}",
|
|
487
|
+
addViewPrompt: "I want to add a custom view to the \"{title}\" collection. Ask me what I want to see or edit, then author the HTML view file at {base}/views/your-view.html and register it in {base}/schema.json under `views[]` (capabilities [\"read\"] for a read-only view, [\"read\",\"write\"] if it edits records). Follow the custom-view help for the data contract.",
|
|
488
|
+
repair: "Repair",
|
|
489
|
+
dataIssuesDetected: "{count} record file(s) have data problems and may be missing from this view.",
|
|
490
|
+
repairPrompt: "The \"{title}\" collection has {count} record file(s) with data problems that keep them from appearing. Fix each one — Read the file, correct it, then Write it back:\n{issues}\n\nWhen you're done, call presentCollection to confirm the records load.",
|
|
491
|
+
source: {
|
|
492
|
+
user: "User",
|
|
493
|
+
project: "Project"
|
|
494
|
+
}
|
|
495
|
+
},
|
|
496
|
+
common: {
|
|
497
|
+
close: "Close",
|
|
498
|
+
add: "Add",
|
|
499
|
+
cancel: "Cancel",
|
|
500
|
+
loading: "Loading...",
|
|
501
|
+
no: "No",
|
|
502
|
+
remove: "Remove",
|
|
503
|
+
save: "Save",
|
|
504
|
+
saving: "Saving...",
|
|
505
|
+
yes: "Yes"
|
|
506
|
+
}
|
|
507
|
+
},
|
|
508
|
+
ja: {
|
|
509
|
+
collectionsView: {
|
|
510
|
+
addCollectionLabel: "コレクション",
|
|
511
|
+
addCollectionPrompt: "新しいコレクションを作成したいです。まず `config/helps/collection-skills.md` を読んでスキーマ駆動コレクションの規約を確認してください。次に `presentForm` ツールを使って(AskUserQuestion は使わないで)どんなデータを管理したいか質問し、その回答をもとに schema.json と SKILL.md を作成してください。",
|
|
512
|
+
addFeedTitle: "フィードを追加",
|
|
513
|
+
addFeedHint: "フィードまたは API の URL を貼り付けてください。取得してタイトルとフィールドを自動で判断します。",
|
|
514
|
+
addFeedPrompt: "次の URL からデータソースフィードを追加してください: {url}\n\nまず `config/helps/feeds.md` を読み、その指示に正確に従ってください。その URL を自分で取得してレスポンスを調べ、ふさわしいタイトルとフィールドを推測し、ヘルプの説明どおりに `feeds/<slug>/schema.json` を作成してください。私には質問せず、データからすべて判断してください。フィードを開くとアイテムは自動で読み込まれます。完了したら登録できたことを伝えてください(Refresh を押すよう案内する必要はありません)。",
|
|
515
|
+
title: "コレクション",
|
|
516
|
+
backToIndex: "コレクション一覧に戻る",
|
|
517
|
+
indexEmpty: "インストール済みのコレクションがありません。スキーマを含むスキルを Skills ページからスター付けすると、ここに表示されます。",
|
|
518
|
+
editItem: "編集",
|
|
519
|
+
openItem: "{id} を開く",
|
|
520
|
+
confirmDelete: "この項目を削除しますか?元に戻せません。",
|
|
521
|
+
deleteFeed: "フィードを削除",
|
|
522
|
+
confirmDeleteFeed: "フィード「{title}」と取得済みのすべてのレコードを削除しますか?この操作は取り消せません。",
|
|
523
|
+
deleteCollection: "コレクションを削除",
|
|
524
|
+
confirmDeleteCollection: "コレクション「{title}」とそのすべてのレコードを削除しますか?削除前に復元可能なバックアップが保存されます。",
|
|
525
|
+
itemsEmpty: "まだ項目がありません。+ を押して追加してください。",
|
|
526
|
+
notFound: "コレクションが見つかりません",
|
|
527
|
+
loadFailed: "読み込みに失敗しました",
|
|
528
|
+
requiredField: "この項目は必須です",
|
|
529
|
+
selectPlaceholder: "選択…",
|
|
530
|
+
inlineSaveFailed: "変更を保存できませんでした: {error}",
|
|
531
|
+
addRow: "行を追加",
|
|
532
|
+
removeRow: "行を削除",
|
|
533
|
+
noRows: "行がありません",
|
|
534
|
+
tableSummary: "{count}件",
|
|
535
|
+
embedMissing: "{collection} に「{id}」のレコードが見つかりません。",
|
|
536
|
+
embedCreate: "設定する",
|
|
537
|
+
searchPlaceholder: "レコードを検索…",
|
|
538
|
+
searchSummary: "{total} 件中 {shown} 件を表示",
|
|
539
|
+
noMatchingItems: "一致する項目がありません",
|
|
540
|
+
clearSearch: "検索をクリア",
|
|
541
|
+
sortBy: "{field}で並べ替え",
|
|
542
|
+
openCollection: "{title} を開く",
|
|
543
|
+
createTitle: "新規追加",
|
|
544
|
+
derivedLabel: "計算値",
|
|
545
|
+
embedMissingTitle: "埋め込み参照が見つかりません",
|
|
546
|
+
chat: "チャット",
|
|
547
|
+
refreshFeed: "更新",
|
|
548
|
+
refreshFailed: "更新に失敗しました: {error}",
|
|
549
|
+
feedChatSeed: "フィード「{slug}」はスキーマ `feeds/{slug}/schema.json` で定義され、レコードは `{dataPath}/`(1 レコードにつき `<id>.json` 1 ファイル)に保存されています。このスキーマとデータを使って、次のリクエストに応えてください: {message}",
|
|
550
|
+
feedsTitle: "データソースフィード",
|
|
551
|
+
feedsEmpty: "登録されたフィードはありません。",
|
|
552
|
+
chatTitle: "チャットを開始",
|
|
553
|
+
chatPlaceholder: "このコレクションで行いたいことを入力してください…",
|
|
554
|
+
chatStart: "チャットを開始",
|
|
555
|
+
viewToggle: "表示",
|
|
556
|
+
viewTable: "テーブル",
|
|
557
|
+
viewCalendar: "カレンダー",
|
|
558
|
+
calendarFieldLabel: "カレンダーの日付フィールド",
|
|
559
|
+
calendarPrevMonth: "前の月",
|
|
560
|
+
calendarNextMonth: "次の月",
|
|
561
|
+
calendarToday: "今日",
|
|
562
|
+
calendarNoDate: "日付なし",
|
|
563
|
+
calendarCreateOn: "{date} に作成",
|
|
564
|
+
dayViewOpen: "{date} の日表示を開く",
|
|
565
|
+
dayViewAllDay: "終日",
|
|
566
|
+
dayViewEmpty: "この日の項目はありません",
|
|
567
|
+
dayViewClose: "日表示を閉じる",
|
|
568
|
+
viewKanban: "カンバン",
|
|
569
|
+
kanbanFieldLabel: "カンバンのグループフィールド",
|
|
570
|
+
kanbanUncategorized: "未分類",
|
|
571
|
+
kanbanOpenCard: "{label} を開く",
|
|
572
|
+
addView: "ビューを追加",
|
|
573
|
+
config: {
|
|
574
|
+
open: "コレクション設定",
|
|
575
|
+
title: "{title} · 設定",
|
|
576
|
+
viewsHeading: "カスタムビュー",
|
|
577
|
+
deleteView: "{label} を削除",
|
|
578
|
+
confirmDelete: "ビュー「{label}」を削除しますか? HTML ファイルを削除し、登録を解除します。",
|
|
579
|
+
empty: "カスタムビューはまだありません。"
|
|
580
|
+
},
|
|
581
|
+
customViewLoading: "ビューを読み込み中…",
|
|
582
|
+
customViewError: "このビューを読み込めませんでした: {error}",
|
|
583
|
+
addViewPrompt: "「{title}」コレクションにカスタムビューを追加したい。何を見たい/編集したいか質問してから、HTML ビューファイルを {base}/views/your-view.html に作成し、{base}/schema.json の `views[]` に登録して(読み取り専用なら capabilities [\"read\"]、レコードを編集するなら [\"read\",\"write\"])。データ契約は custom-view ヘルプに従ってください。",
|
|
584
|
+
repair: "修復",
|
|
585
|
+
dataIssuesDetected: "{count} 件のレコードファイルにデータの問題があり、この表示に出てこない可能性があります。",
|
|
586
|
+
repairPrompt: "コレクション「{title}」に、表示されない原因となるデータの問題を持つレコードファイルが {count} 件あります。それぞれを修正してください — ファイルを Read し、修正してから Write し直します:\n{issues}\n\n完了したら presentCollection を呼び出して、レコードが読み込めることを確認してください。",
|
|
587
|
+
source: {
|
|
588
|
+
user: "ユーザー",
|
|
589
|
+
project: "プロジェクト"
|
|
590
|
+
}
|
|
591
|
+
},
|
|
592
|
+
common: {
|
|
593
|
+
close: "閉じる",
|
|
594
|
+
add: "追加",
|
|
595
|
+
cancel: "キャンセル",
|
|
596
|
+
loading: "読み込み中...",
|
|
597
|
+
no: "いいえ",
|
|
598
|
+
remove: "削除",
|
|
599
|
+
save: "保存",
|
|
600
|
+
saving: "保存中...",
|
|
601
|
+
yes: "はい"
|
|
602
|
+
}
|
|
603
|
+
},
|
|
604
|
+
zh: {
|
|
605
|
+
collectionsView: {
|
|
606
|
+
addCollectionLabel: "集合",
|
|
607
|
+
addCollectionPrompt: "帮我创建一个新的集合。请先阅读 `config/helps/collection-skills.md` 了解基于 schema 的集合约定。然后使用 `presentForm` 工具(不要使用 AskUserQuestion)询问我想跟踪哪种数据,并根据我的回答编写 schema.json 和 SKILL.md。",
|
|
608
|
+
addFeedTitle: "添加订阅源",
|
|
609
|
+
addFeedHint: "粘贴订阅源或 API 的 URL,我会抓取并自动推断标题和字段。",
|
|
610
|
+
addFeedPrompt: "从以下 URL 添加一个数据源订阅:{url}\n\n请先阅读 `config/helps/feeds.md` 并严格按其说明操作。自己抓取该 URL 并检查响应,推断合适的标题和字段,然后按帮助说明编写 `feeds/<slug>/schema.json`。不要向我提问——完全根据数据判断。打开订阅源会自动加载条目。完成后告诉我已注册(无需提示点击 Refresh)。",
|
|
611
|
+
title: "集合",
|
|
612
|
+
backToIndex: "返回集合列表",
|
|
613
|
+
indexEmpty: "尚未安装任何集合。在「技能」页面对带有 schema 的技能加星即可在此显示。",
|
|
614
|
+
editItem: "编辑",
|
|
615
|
+
openItem: "打开 {id}",
|
|
616
|
+
confirmDelete: "删除此项?此操作无法撤销。",
|
|
617
|
+
deleteFeed: "删除订阅源",
|
|
618
|
+
confirmDeleteFeed: "删除订阅源「{title}」及其所有已抓取的记录?此操作无法撤销。",
|
|
619
|
+
deleteCollection: "删除集合",
|
|
620
|
+
confirmDeleteCollection: "删除整个“{title}”集合及其所有记录?删除前会先归档一份可恢复的备份。",
|
|
621
|
+
itemsEmpty: "暂无项目。点击 + 添加一个。",
|
|
622
|
+
notFound: "未找到集合",
|
|
623
|
+
loadFailed: "加载失败",
|
|
624
|
+
requiredField: "此字段为必填项",
|
|
625
|
+
selectPlaceholder: "请选择…",
|
|
626
|
+
inlineSaveFailed: "无法保存更改:{error}",
|
|
627
|
+
addRow: "添加行",
|
|
628
|
+
removeRow: "删除行",
|
|
629
|
+
noRows: "暂无行",
|
|
630
|
+
tableSummary: "{count} 项",
|
|
631
|
+
embedMissing: "在 {collection} 中找不到「{id}」记录。",
|
|
632
|
+
embedCreate: "去设置",
|
|
633
|
+
searchPlaceholder: "搜索记录…",
|
|
634
|
+
searchSummary: "显示 {total} 条中的 {shown} 条",
|
|
635
|
+
noMatchingItems: "没有匹配的项目",
|
|
636
|
+
clearSearch: "清除搜索",
|
|
637
|
+
sortBy: "按{field}排序",
|
|
638
|
+
openCollection: "打开 {title}",
|
|
639
|
+
createTitle: "新增",
|
|
640
|
+
derivedLabel: "派生",
|
|
641
|
+
embedMissingTitle: "缺少嵌入引用",
|
|
642
|
+
chat: "对话",
|
|
643
|
+
refreshFeed: "刷新",
|
|
644
|
+
refreshFailed: "刷新失败:{error}",
|
|
645
|
+
feedChatSeed: "订阅源“{slug}”由 schema `feeds/{slug}/schema.json` 定义,其记录保存在 `{dataPath}/`(每条记录一个 `<id>.json` 文件)。请使用该 schema 和数据来响应以下请求:{message}",
|
|
646
|
+
feedsTitle: "数据源订阅",
|
|
647
|
+
feedsEmpty: "尚未注册任何订阅源。",
|
|
648
|
+
chatTitle: "开始对话",
|
|
649
|
+
chatPlaceholder: "描述你想对这个集合做什么…",
|
|
650
|
+
chatStart: "开始对话",
|
|
651
|
+
viewToggle: "视图",
|
|
652
|
+
viewTable: "表格",
|
|
653
|
+
viewCalendar: "日历",
|
|
654
|
+
calendarFieldLabel: "日历日期字段",
|
|
655
|
+
calendarPrevMonth: "上个月",
|
|
656
|
+
calendarNextMonth: "下个月",
|
|
657
|
+
calendarToday: "今天",
|
|
658
|
+
calendarNoDate: "无日期",
|
|
659
|
+
calendarCreateOn: "在 {date} 创建",
|
|
660
|
+
dayViewOpen: "打开 {date} 的日视图",
|
|
661
|
+
dayViewAllDay: "全天",
|
|
662
|
+
dayViewEmpty: "当天没有项目",
|
|
663
|
+
dayViewClose: "关闭日视图",
|
|
664
|
+
viewKanban: "看板",
|
|
665
|
+
kanbanFieldLabel: "看板分组字段",
|
|
666
|
+
kanbanUncategorized: "未分类",
|
|
667
|
+
kanbanOpenCard: "打开 {label}",
|
|
668
|
+
addView: "添加视图",
|
|
669
|
+
config: {
|
|
670
|
+
open: "集合设置",
|
|
671
|
+
title: "{title} · 设置",
|
|
672
|
+
viewsHeading: "自定义视图",
|
|
673
|
+
deleteView: "删除 {label}",
|
|
674
|
+
confirmDelete: "删除视图“{label}”?这将删除其 HTML 文件并取消注册。",
|
|
675
|
+
empty: "暂无自定义视图。"
|
|
676
|
+
},
|
|
677
|
+
customViewLoading: "正在加载视图…",
|
|
678
|
+
customViewError: "无法加载此视图:{error}",
|
|
679
|
+
addViewPrompt: "我想为“{title}”集合添加一个自定义视图。先问我想查看或编辑什么,然后在 {base}/views/your-view.html 创建 HTML 视图文件,并在 {base}/schema.json 的 `views[]` 中注册(只读视图用 capabilities [\"read\"],需要编辑记录则用 [\"read\",\"write\"])。数据契约请遵循 custom-view 帮助文档。",
|
|
680
|
+
repair: "修复",
|
|
681
|
+
dataIssuesDetected: "有 {count} 个记录文件存在数据问题,可能未显示在此视图中。",
|
|
682
|
+
repairPrompt: "集合 {title} 有 {count} 个记录文件存在导致无法显示的数据问题。请逐一修复——用 Read 读取该文件,更正后再用 Write 写回:\n{issues}\n\n完成后,调用 presentCollection 确认记录可以正常加载。",
|
|
683
|
+
source: {
|
|
684
|
+
user: "用户",
|
|
685
|
+
project: "项目"
|
|
686
|
+
}
|
|
687
|
+
},
|
|
688
|
+
common: {
|
|
689
|
+
close: "关闭",
|
|
690
|
+
add: "添加",
|
|
691
|
+
cancel: "取消",
|
|
692
|
+
loading: "加载中...",
|
|
693
|
+
no: "否",
|
|
694
|
+
remove: "移除",
|
|
695
|
+
save: "保存",
|
|
696
|
+
saving: "保存中...",
|
|
697
|
+
yes: "是"
|
|
698
|
+
}
|
|
699
|
+
},
|
|
700
|
+
ko: {
|
|
701
|
+
collectionsView: {
|
|
702
|
+
addCollectionLabel: "컬렉션",
|
|
703
|
+
addCollectionPrompt: "새 컬렉션을 만들고 싶어요. 먼저 `config/helps/collection-skills.md`를 읽고 스키마 기반 컬렉션 규칙을 확인하세요. 그런 다음 `presentForm` 도구를 사용해(AskUserQuestion은 사용하지 말고) 어떤 데이터를 관리하고 싶은지 물어보고, 제 답변을 바탕으로 schema.json과 SKILL.md를 작성해 주세요.",
|
|
704
|
+
addFeedTitle: "피드 추가",
|
|
705
|
+
addFeedHint: "피드 또는 API URL을 붙여넣으세요. 가져와서 제목과 필드를 자동으로 추론합니다.",
|
|
706
|
+
addFeedPrompt: "다음 URL에서 데이터 소스 피드를 추가하세요: {url}\n\n먼저 `config/helps/feeds.md`를 읽고 그대로 따르세요. 해당 URL을 직접 가져와 응답을 살펴보고 적절한 제목과 필드를 추론한 다음, 도움말 설명대로 `feeds/<slug>/schema.json`을 작성하세요. 저에게 질문하지 말고 데이터에서 모두 판단하세요. 피드를 열면 항목이 자동으로 로드됩니다. 완료되면 등록되었다고 알려주세요(Refresh를 누르라고 안내할 필요 없음).",
|
|
707
|
+
title: "컬렉션",
|
|
708
|
+
backToIndex: "컬렉션 목록으로 돌아가기",
|
|
709
|
+
indexEmpty: "설치된 컬렉션이 없습니다. Skills 페이지에서 스키마를 포함한 스킬에 별표를 추가하면 여기에 표시됩니다.",
|
|
710
|
+
editItem: "편집",
|
|
711
|
+
openItem: "{id} 열기",
|
|
712
|
+
confirmDelete: "이 항목을 삭제하시겠습니까? 되돌릴 수 없습니다.",
|
|
713
|
+
deleteFeed: "피드 삭제",
|
|
714
|
+
confirmDeleteFeed: "\"{title}\" 피드와 가져온 모든 레코드를 삭제하시겠습니까? 이 작업은 되돌릴 수 없습니다.",
|
|
715
|
+
deleteCollection: "컬렉션 삭제",
|
|
716
|
+
confirmDeleteCollection: "\"{title}\" 컬렉션과 모든 레코드를 삭제하시겠습니까? 삭제 전에 복원 가능한 백업이 보관됩니다.",
|
|
717
|
+
itemsEmpty: "아직 항목이 없습니다. + 를 눌러 추가하세요.",
|
|
718
|
+
notFound: "컬렉션을 찾을 수 없습니다",
|
|
719
|
+
loadFailed: "불러오기에 실패했습니다",
|
|
720
|
+
requiredField: "이 필드는 필수입니다",
|
|
721
|
+
selectPlaceholder: "선택…",
|
|
722
|
+
inlineSaveFailed: "변경 사항을 저장하지 못했습니다: {error}",
|
|
723
|
+
addRow: "행 추가",
|
|
724
|
+
removeRow: "행 삭제",
|
|
725
|
+
noRows: "행이 없습니다",
|
|
726
|
+
tableSummary: "{count}개",
|
|
727
|
+
embedMissing: "{collection}에 '{id}' 레코드가 없습니다.",
|
|
728
|
+
embedCreate: "설정하기",
|
|
729
|
+
searchPlaceholder: "레코드 검색…",
|
|
730
|
+
searchSummary: "{total}개 중 {shown}개 표시",
|
|
731
|
+
noMatchingItems: "일치하는 항목이 없습니다",
|
|
732
|
+
clearSearch: "검색 지우기",
|
|
733
|
+
sortBy: "{field} 기준 정렬",
|
|
734
|
+
openCollection: "{title} 열기",
|
|
735
|
+
createTitle: "새로 추가",
|
|
736
|
+
derivedLabel: "파생",
|
|
737
|
+
embedMissingTitle: "임베드된 참조 없음",
|
|
738
|
+
chat: "채팅",
|
|
739
|
+
refreshFeed: "새로고침",
|
|
740
|
+
refreshFailed: "새로고침 실패: {error}",
|
|
741
|
+
feedChatSeed: "“{slug}” 피드는 스키마 `feeds/{slug}/schema.json`로 정의되며, 레코드는 `{dataPath}/`(레코드당 `<id>.json` 파일 하나)에 저장됩니다. 이 스키마와 데이터를 사용하여 다음 요청에 응답하세요: {message}",
|
|
742
|
+
feedsTitle: "데이터 소스 피드",
|
|
743
|
+
feedsEmpty: "등록된 피드가 없습니다.",
|
|
744
|
+
chatTitle: "채팅 시작",
|
|
745
|
+
chatPlaceholder: "이 컬렉션으로 하고 싶은 작업을 설명하세요…",
|
|
746
|
+
chatStart: "채팅 시작",
|
|
747
|
+
viewToggle: "보기",
|
|
748
|
+
viewTable: "표",
|
|
749
|
+
viewCalendar: "캘린더",
|
|
750
|
+
calendarFieldLabel: "캘린더 날짜 필드",
|
|
751
|
+
calendarPrevMonth: "이전 달",
|
|
752
|
+
calendarNextMonth: "다음 달",
|
|
753
|
+
calendarToday: "오늘",
|
|
754
|
+
calendarNoDate: "날짜 없음",
|
|
755
|
+
calendarCreateOn: "{date}에 생성",
|
|
756
|
+
dayViewOpen: "{date} 일 보기 열기",
|
|
757
|
+
dayViewAllDay: "종일",
|
|
758
|
+
dayViewEmpty: "이 날에는 항목이 없습니다",
|
|
759
|
+
dayViewClose: "일 보기 닫기",
|
|
760
|
+
viewKanban: "칸반",
|
|
761
|
+
kanbanFieldLabel: "칸반 그룹 필드",
|
|
762
|
+
kanbanUncategorized: "미분류",
|
|
763
|
+
kanbanOpenCard: "{label} 열기",
|
|
764
|
+
addView: "보기 추가",
|
|
765
|
+
config: {
|
|
766
|
+
open: "컬렉션 설정",
|
|
767
|
+
title: "{title} · 설정",
|
|
768
|
+
viewsHeading: "사용자 지정 보기",
|
|
769
|
+
deleteView: "{label} 삭제",
|
|
770
|
+
confirmDelete: "“{label}” 보기를 삭제할까요? HTML 파일을 삭제하고 등록을 해제합니다.",
|
|
771
|
+
empty: "아직 사용자 지정 보기가 없습니다."
|
|
772
|
+
},
|
|
773
|
+
customViewLoading: "보기를 불러오는 중…",
|
|
774
|
+
customViewError: "이 보기를 불러오지 못했습니다: {error}",
|
|
775
|
+
addViewPrompt: "{title} 컬렉션에 사용자 지정 보기를 추가하고 싶어요. 무엇을 보거나 편집하고 싶은지 먼저 물어본 뒤, {base}/views/your-view.html 에 HTML 보기 파일을 만들고 {base}/schema.json의 `views[]`에 등록해 주세요(읽기 전용 보기는 capabilities [\"read\"], 레코드를 편집하면 [\"read\",\"write\"]). 데이터 계약은 custom-view 도움말을 따르세요.",
|
|
776
|
+
repair: "복구",
|
|
777
|
+
dataIssuesDetected: "{count}개의 레코드 파일에 데이터 문제가 있어 이 보기에 표시되지 않을 수 있습니다.",
|
|
778
|
+
repairPrompt: "{title} 컬렉션에 표시되지 않는 원인이 되는 데이터 문제가 있는 레코드 파일이 {count}개 있습니다. 각 파일을 수정하세요 — Read로 파일을 읽고 수정한 뒤 Write로 다시 저장하세요:\n{issues}\n\n완료되면 presentCollection을 호출하여 레코드가 로드되는지 확인하세요.",
|
|
779
|
+
source: {
|
|
780
|
+
user: "사용자",
|
|
781
|
+
project: "프로젝트"
|
|
782
|
+
}
|
|
783
|
+
},
|
|
784
|
+
common: {
|
|
785
|
+
close: "닫기",
|
|
786
|
+
add: "추가",
|
|
787
|
+
cancel: "취소",
|
|
788
|
+
loading: "불러오는 중...",
|
|
789
|
+
no: "아니오",
|
|
790
|
+
remove: "삭제",
|
|
791
|
+
save: "저장",
|
|
792
|
+
saving: "저장 중...",
|
|
793
|
+
yes: "예"
|
|
794
|
+
}
|
|
795
|
+
},
|
|
796
|
+
es: {
|
|
797
|
+
collectionsView: {
|
|
798
|
+
addCollectionLabel: "Colección",
|
|
799
|
+
addCollectionPrompt: "Ayúdame a crear una nueva colección. Primero lee `config/helps/collection-skills.md` para conocer las convenciones de las colecciones basadas en esquemas. Luego usa la herramienta `presentForm` (no uses AskUserQuestion) para preguntarme qué tipo de datos quiero registrar, y crea el schema.json y el SKILL.md a partir de mis respuestas.",
|
|
800
|
+
addFeedTitle: "Añadir un feed",
|
|
801
|
+
addFeedHint: "Pega la URL de un feed o una API; la obtendré y deduciré el título y los campos por ti.",
|
|
802
|
+
addFeedPrompt: "Añade una nueva fuente de datos (feed) desde esta URL: {url}\n\nPrimero lee `config/helps/feeds.md` y síguelo exactamente. Obtén esa URL tú mismo, inspecciona la respuesta para deducir un título adecuado y los campos, y luego crea `feeds/<slug>/schema.json` como indica la ayuda. NO me hagas preguntas: dedúcelo todo a partir de los datos. Al abrir el feed sus elementos se cargan automáticamente; cuando termines, dime que está registrado (no hace falta mencionar Refresh).",
|
|
803
|
+
title: "Colecciones",
|
|
804
|
+
backToIndex: "Volver a colecciones",
|
|
805
|
+
indexEmpty: "No hay colecciones instaladas. Marca con estrella una skill que incluya un schema desde la página Skills para verla aquí.",
|
|
806
|
+
editItem: "Editar",
|
|
807
|
+
openItem: "Abrir {id}",
|
|
808
|
+
confirmDelete: "¿Eliminar este elemento? Esta acción no se puede deshacer.",
|
|
809
|
+
deleteFeed: "Eliminar feed",
|
|
810
|
+
confirmDeleteFeed: "¿Eliminar el feed \"{title}\" y todos sus registros descargados? Esta acción no se puede deshacer.",
|
|
811
|
+
deleteCollection: "Eliminar colección",
|
|
812
|
+
confirmDeleteCollection: "¿Eliminar toda la colección \"{title}\", incluidos todos sus registros? Antes se archiva una copia de seguridad restaurable.",
|
|
813
|
+
itemsEmpty: "Aún no hay elementos. Pulsa + para añadir uno.",
|
|
814
|
+
notFound: "Colección no encontrada",
|
|
815
|
+
loadFailed: "Error al cargar",
|
|
816
|
+
requiredField: "Este campo es obligatorio",
|
|
817
|
+
selectPlaceholder: "Seleccionar…",
|
|
818
|
+
inlineSaveFailed: "No se pudo guardar el cambio: {error}",
|
|
819
|
+
addRow: "Añadir fila",
|
|
820
|
+
removeRow: "Quitar fila",
|
|
821
|
+
noRows: "Aún no hay filas",
|
|
822
|
+
tableSummary: "{count} elementos",
|
|
823
|
+
embedMissing: "No se encontró el registro «{id}» en {collection}.",
|
|
824
|
+
embedCreate: "Configurarlo",
|
|
825
|
+
searchPlaceholder: "Buscar registros…",
|
|
826
|
+
searchSummary: "Mostrando {shown} de {total}",
|
|
827
|
+
noMatchingItems: "No hay elementos coincidentes",
|
|
828
|
+
clearSearch: "Borrar búsqueda",
|
|
829
|
+
sortBy: "Ordenar por {field}",
|
|
830
|
+
openCollection: "Abrir {title}",
|
|
831
|
+
createTitle: "Añadir nuevo",
|
|
832
|
+
derivedLabel: "Derivado",
|
|
833
|
+
embedMissingTitle: "Falta la referencia incrustada",
|
|
834
|
+
chat: "Chat",
|
|
835
|
+
refreshFeed: "Actualizar",
|
|
836
|
+
refreshFailed: "Error al actualizar: {error}",
|
|
837
|
+
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}",
|
|
838
|
+
feedsTitle: "Fuentes de datos",
|
|
839
|
+
feedsEmpty: "Aún no hay fuentes registradas.",
|
|
840
|
+
chatTitle: "Iniciar un chat",
|
|
841
|
+
chatPlaceholder: "Describe qué quieres hacer con esta colección…",
|
|
842
|
+
chatStart: "Iniciar chat",
|
|
843
|
+
viewToggle: "Vista",
|
|
844
|
+
viewTable: "Tabla",
|
|
845
|
+
viewCalendar: "Calendario",
|
|
846
|
+
calendarFieldLabel: "Campo de fecha del calendario",
|
|
847
|
+
calendarPrevMonth: "Mes anterior",
|
|
848
|
+
calendarNextMonth: "Mes siguiente",
|
|
849
|
+
calendarToday: "Hoy",
|
|
850
|
+
calendarNoDate: "Sin fecha",
|
|
851
|
+
calendarCreateOn: "Crear el {date}",
|
|
852
|
+
dayViewOpen: "Abrir vista de día para {date}",
|
|
853
|
+
dayViewAllDay: "Todo el día",
|
|
854
|
+
dayViewEmpty: "No hay elementos este día",
|
|
855
|
+
dayViewClose: "Cerrar vista de día",
|
|
856
|
+
viewKanban: "Kanban",
|
|
857
|
+
kanbanFieldLabel: "Campo de agrupación Kanban",
|
|
858
|
+
kanbanUncategorized: "Sin categoría",
|
|
859
|
+
kanbanOpenCard: "Abrir {label}",
|
|
860
|
+
addView: "Añadir vista",
|
|
861
|
+
config: {
|
|
862
|
+
open: "Ajustes de la colección",
|
|
863
|
+
title: "{title} · ajustes",
|
|
864
|
+
viewsHeading: "Vistas personalizadas",
|
|
865
|
+
deleteView: "Eliminar {label}",
|
|
866
|
+
confirmDelete: "¿Eliminar la vista \"{label}\"? Se borrará su archivo HTML y se anulará su registro.",
|
|
867
|
+
empty: "Aún no hay vistas personalizadas."
|
|
868
|
+
},
|
|
869
|
+
customViewLoading: "Cargando vista…",
|
|
870
|
+
customViewError: "No se pudo cargar esta vista: {error}",
|
|
871
|
+
addViewPrompt: "Quiero añadir una vista personalizada a la colección «{title}». Pregúntame qué quiero ver o editar, luego crea el archivo HTML de la vista en {base}/views/your-view.html y regístralo en {base}/schema.json dentro de `views[]` (capabilities [\"read\"] para una vista de solo lectura, [\"read\",\"write\"] si edita registros). Sigue la ayuda custom-view para el contrato de datos.",
|
|
872
|
+
repair: "Reparar",
|
|
873
|
+
dataIssuesDetected: "{count} archivo(s) de registro tienen problemas de datos y podrían no aparecer en esta vista.",
|
|
874
|
+
repairPrompt: "La colección {title} tiene {count} archivo(s) de registro con problemas de datos que impiden que aparezcan. Corrige cada uno: lee el archivo con Read, corrígelo y vuelve a escribirlo con Write:\n{issues}\n\nCuando termines, llama a presentCollection para confirmar que los registros se cargan.",
|
|
875
|
+
source: {
|
|
876
|
+
user: "Usuario",
|
|
877
|
+
project: "Proyecto"
|
|
878
|
+
}
|
|
879
|
+
},
|
|
880
|
+
common: {
|
|
881
|
+
close: "Cerrar",
|
|
882
|
+
add: "Añadir",
|
|
883
|
+
cancel: "Cancelar",
|
|
884
|
+
loading: "Cargando...",
|
|
885
|
+
no: "No",
|
|
886
|
+
remove: "Quitar",
|
|
887
|
+
save: "Guardar",
|
|
888
|
+
saving: "Guardando...",
|
|
889
|
+
yes: "Sí"
|
|
890
|
+
}
|
|
891
|
+
},
|
|
892
|
+
"pt-BR": {
|
|
893
|
+
collectionsView: {
|
|
894
|
+
addCollectionLabel: "Coleção",
|
|
895
|
+
addCollectionPrompt: "Ajude-me a criar uma nova coleção. Primeiro leia `config/helps/collection-skills.md` para conhecer as convenções de coleções baseadas em esquema. Depois use a ferramenta `presentForm` (não use AskUserQuestion) para perguntar que tipo de dados quero acompanhar, e crie o schema.json e o SKILL.md a partir das minhas respostas.",
|
|
896
|
+
addFeedTitle: "Adicionar um feed",
|
|
897
|
+
addFeedHint: "Cole a URL de um feed ou API; vou buscá-la e deduzir o título e os campos para você.",
|
|
898
|
+
addFeedPrompt: "Adicione um novo feed de fonte de dados a partir desta URL: {url}\n\nPrimeiro leia `config/helps/feeds.md` e siga-o exatamente. Busque essa URL você mesmo, inspecione a resposta para deduzir um título adequado e os campos, e então crie `feeds/<slug>/schema.json` como a ajuda descreve. NÃO me faça perguntas: deduza tudo a partir dos dados. Ao abrir o feed os itens são carregados automaticamente; quando terminar, diga-me que está registrado (não precisa mencionar Refresh).",
|
|
899
|
+
title: "Coleções",
|
|
900
|
+
backToIndex: "Voltar para coleções",
|
|
901
|
+
indexEmpty: "Nenhuma coleção instalada. Marque com estrela uma skill que inclua um schema na página Skills para vê-la aqui.",
|
|
902
|
+
editItem: "Editar",
|
|
903
|
+
openItem: "Abrir {id}",
|
|
904
|
+
confirmDelete: "Excluir este item? Esta ação não pode ser desfeita.",
|
|
905
|
+
deleteFeed: "Excluir feed",
|
|
906
|
+
confirmDeleteFeed: "Excluir o feed \"{title}\" e todos os seus registros baixados? Esta ação não pode ser desfeita.",
|
|
907
|
+
deleteCollection: "Excluir coleção",
|
|
908
|
+
confirmDeleteCollection: "Excluir toda a coleção \"{title}\", incluindo todos os seus registros? Um backup restaurável é arquivado antes.",
|
|
909
|
+
itemsEmpty: "Ainda não há itens. Clique em + para adicionar um.",
|
|
910
|
+
notFound: "Coleção não encontrada",
|
|
911
|
+
loadFailed: "Falha ao carregar",
|
|
912
|
+
requiredField: "Este campo é obrigatório",
|
|
913
|
+
selectPlaceholder: "Selecionar…",
|
|
914
|
+
inlineSaveFailed: "Não foi possível salvar a alteração: {error}",
|
|
915
|
+
addRow: "Adicionar linha",
|
|
916
|
+
removeRow: "Remover linha",
|
|
917
|
+
noRows: "Ainda não há linhas",
|
|
918
|
+
tableSummary: "{count} itens",
|
|
919
|
+
embedMissing: "Nenhum registro '{id}' encontrado em {collection}.",
|
|
920
|
+
embedCreate: "Configurar",
|
|
921
|
+
searchPlaceholder: "Buscar registros…",
|
|
922
|
+
searchSummary: "Mostrando {shown} de {total}",
|
|
923
|
+
noMatchingItems: "Nenhum item correspondente",
|
|
924
|
+
clearSearch: "Limpar busca",
|
|
925
|
+
sortBy: "Ordenar por {field}",
|
|
926
|
+
openCollection: "Abrir {title}",
|
|
927
|
+
createTitle: "Adicionar novo",
|
|
928
|
+
derivedLabel: "Derivado",
|
|
929
|
+
embedMissingTitle: "Referência incorporada ausente",
|
|
930
|
+
chat: "Chat",
|
|
931
|
+
refreshFeed: "Atualizar",
|
|
932
|
+
refreshFailed: "Falha ao atualizar: {error}",
|
|
933
|
+
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}",
|
|
934
|
+
feedsTitle: "Feeds de dados",
|
|
935
|
+
feedsEmpty: "Nenhum feed registrado ainda.",
|
|
936
|
+
chatTitle: "Iniciar um chat",
|
|
937
|
+
chatPlaceholder: "Descreva o que você quer fazer com esta coleção…",
|
|
938
|
+
chatStart: "Iniciar chat",
|
|
939
|
+
viewToggle: "Visualização",
|
|
940
|
+
viewTable: "Tabela",
|
|
941
|
+
viewCalendar: "Calendário",
|
|
942
|
+
calendarFieldLabel: "Campo de data do calendário",
|
|
943
|
+
calendarPrevMonth: "Mês anterior",
|
|
944
|
+
calendarNextMonth: "Próximo mês",
|
|
945
|
+
calendarToday: "Hoje",
|
|
946
|
+
calendarNoDate: "Sem data",
|
|
947
|
+
calendarCreateOn: "Criar em {date}",
|
|
948
|
+
dayViewOpen: "Abrir visualização do dia para {date}",
|
|
949
|
+
dayViewAllDay: "Dia inteiro",
|
|
950
|
+
dayViewEmpty: "Nenhum item neste dia",
|
|
951
|
+
dayViewClose: "Fechar visualização do dia",
|
|
952
|
+
viewKanban: "Kanban",
|
|
953
|
+
kanbanFieldLabel: "Campo de agrupamento do Kanban",
|
|
954
|
+
kanbanUncategorized: "Sem categoria",
|
|
955
|
+
kanbanOpenCard: "Abrir {label}",
|
|
956
|
+
addView: "Adicionar visualização",
|
|
957
|
+
config: {
|
|
958
|
+
open: "Configurações da coleção",
|
|
959
|
+
title: "{title} · configurações",
|
|
960
|
+
viewsHeading: "Visualizações personalizadas",
|
|
961
|
+
deleteView: "Excluir {label}",
|
|
962
|
+
confirmDelete: "Excluir a visualização \"{label}\"? Isso remove o arquivo HTML e cancela o registro.",
|
|
963
|
+
empty: "Ainda não há visualizações personalizadas."
|
|
964
|
+
},
|
|
965
|
+
customViewLoading: "Carregando visualização…",
|
|
966
|
+
customViewError: "Não foi possível carregar esta visualização: {error}",
|
|
967
|
+
addViewPrompt: "Quero adicionar uma visualização personalizada à coleção \"{title}\". Pergunte o que eu quero ver ou editar, depois crie o arquivo HTML da visualização em {base}/views/your-view.html e registre-o em {base}/schema.json em `views[]` (capabilities [\"read\"] para uma visualização somente leitura, [\"read\",\"write\"] se editar registros). Siga a ajuda custom-view para o contrato de dados.",
|
|
968
|
+
repair: "Reparar",
|
|
969
|
+
dataIssuesDetected: "{count} arquivo(s) de registro têm problemas de dados e podem não aparecer nesta visualização.",
|
|
970
|
+
repairPrompt: "A coleção {title} tem {count} arquivo(s) de registro com problemas de dados que impedem que apareçam. Corrija cada um: leia o arquivo com Read, corrija-o e grave-o novamente com Write:\n{issues}\n\nQuando terminar, chame presentCollection para confirmar que os registros carregam.",
|
|
971
|
+
source: {
|
|
972
|
+
user: "Usuário",
|
|
973
|
+
project: "Projeto"
|
|
974
|
+
}
|
|
975
|
+
},
|
|
976
|
+
common: {
|
|
977
|
+
close: "Fechar",
|
|
978
|
+
add: "Adicionar",
|
|
979
|
+
cancel: "Cancelar",
|
|
980
|
+
loading: "Carregando...",
|
|
981
|
+
no: "Não",
|
|
982
|
+
remove: "Remover",
|
|
983
|
+
save: "Salvar",
|
|
984
|
+
saving: "Salvando...",
|
|
985
|
+
yes: "Sim"
|
|
986
|
+
}
|
|
987
|
+
},
|
|
988
|
+
fr: {
|
|
989
|
+
collectionsView: {
|
|
990
|
+
addCollectionLabel: "Collection",
|
|
991
|
+
addCollectionPrompt: "Aide-moi à créer une nouvelle collection. Lis d'abord `config/helps/collection-skills.md` pour les conventions des collections basées sur un schéma. Utilise ensuite l'outil `presentForm` (n'utilise pas AskUserQuestion) pour me demander quel type de données je veux suivre, et crée le schema.json et le SKILL.md à partir de mes réponses.",
|
|
992
|
+
addFeedTitle: "Ajouter un flux",
|
|
993
|
+
addFeedHint: "Collez l'URL d'un flux ou d'une API ; je la récupère et déduis le titre et les champs pour vous.",
|
|
994
|
+
addFeedPrompt: "Ajoute un nouveau flux de source de données depuis cette URL : {url}\n\nLis d'abord `config/helps/feeds.md` et suis-le exactement. Récupère cette URL toi-même, inspecte la réponse pour déduire un titre pertinent et les champs, puis crée `feeds/<slug>/schema.json` comme l'explique l'aide. Ne me pose AUCUNE question — déduis tout à partir des données. À l'ouverture du flux, ses éléments se chargent automatiquement ; quand tu as terminé, dis-moi qu'il est enregistré (inutile de mentionner Refresh).",
|
|
995
|
+
title: "Collections",
|
|
996
|
+
backToIndex: "Retour aux collections",
|
|
997
|
+
indexEmpty: "Aucune collection installée. Mettez une étoile sur une compétence avec un schema depuis la page Skills pour la voir ici.",
|
|
998
|
+
editItem: "Modifier",
|
|
999
|
+
openItem: "Ouvrir {id}",
|
|
1000
|
+
confirmDelete: "Supprimer cet élément ? Cette action est irréversible.",
|
|
1001
|
+
deleteFeed: "Supprimer le flux",
|
|
1002
|
+
confirmDeleteFeed: "Supprimer le flux « {title} » et tous ses enregistrements récupérés ? Cette action est irréversible.",
|
|
1003
|
+
deleteCollection: "Supprimer la collection",
|
|
1004
|
+
confirmDeleteCollection: "Supprimer toute la collection « {title} », y compris tous ses enregistrements ? Une sauvegarde restaurable est archivée au préalable.",
|
|
1005
|
+
itemsEmpty: "Aucun élément pour l'instant. Cliquez sur + pour en ajouter un.",
|
|
1006
|
+
notFound: "Collection introuvable",
|
|
1007
|
+
loadFailed: "Échec du chargement",
|
|
1008
|
+
requiredField: "Ce champ est obligatoire",
|
|
1009
|
+
selectPlaceholder: "Sélectionner…",
|
|
1010
|
+
inlineSaveFailed: "Impossible d'enregistrer la modification : {error}",
|
|
1011
|
+
addRow: "Ajouter une ligne",
|
|
1012
|
+
removeRow: "Supprimer la ligne",
|
|
1013
|
+
noRows: "Aucune ligne pour l'instant",
|
|
1014
|
+
tableSummary: "{count} éléments",
|
|
1015
|
+
embedMissing: "Aucun enregistrement « {id} » trouvé dans {collection}.",
|
|
1016
|
+
embedCreate: "Le configurer",
|
|
1017
|
+
searchPlaceholder: "Rechercher des enregistrements…",
|
|
1018
|
+
searchSummary: "Affichage de {shown} sur {total}",
|
|
1019
|
+
noMatchingItems: "Aucun élément correspondant",
|
|
1020
|
+
clearSearch: "Effacer la recherche",
|
|
1021
|
+
sortBy: "Trier par {field}",
|
|
1022
|
+
openCollection: "Ouvrir {title}",
|
|
1023
|
+
createTitle: "Ajouter",
|
|
1024
|
+
derivedLabel: "Calculé",
|
|
1025
|
+
embedMissingTitle: "Référence intégrée manquante",
|
|
1026
|
+
chat: "Discussion",
|
|
1027
|
+
refreshFeed: "Actualiser",
|
|
1028
|
+
refreshFailed: "Échec de l'actualisation : {error}",
|
|
1029
|
+
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}",
|
|
1030
|
+
feedsTitle: "Flux de données",
|
|
1031
|
+
feedsEmpty: "Aucun flux enregistré pour le moment.",
|
|
1032
|
+
chatTitle: "Démarrer une discussion",
|
|
1033
|
+
chatPlaceholder: "Décrivez ce que vous voulez faire avec cette collection…",
|
|
1034
|
+
chatStart: "Démarrer la discussion",
|
|
1035
|
+
viewToggle: "Affichage",
|
|
1036
|
+
viewTable: "Tableau",
|
|
1037
|
+
viewCalendar: "Calendrier",
|
|
1038
|
+
calendarFieldLabel: "Champ de date du calendrier",
|
|
1039
|
+
calendarPrevMonth: "Mois précédent",
|
|
1040
|
+
calendarNextMonth: "Mois suivant",
|
|
1041
|
+
calendarToday: "Aujourd'hui",
|
|
1042
|
+
calendarNoDate: "Sans date",
|
|
1043
|
+
calendarCreateOn: "Créer le {date}",
|
|
1044
|
+
dayViewOpen: "Ouvrir la vue du jour pour {date}",
|
|
1045
|
+
dayViewAllDay: "Toute la journée",
|
|
1046
|
+
dayViewEmpty: "Aucun élément ce jour",
|
|
1047
|
+
dayViewClose: "Fermer la vue du jour",
|
|
1048
|
+
viewKanban: "Kanban",
|
|
1049
|
+
kanbanFieldLabel: "Champ de regroupement Kanban",
|
|
1050
|
+
kanbanUncategorized: "Non classé",
|
|
1051
|
+
kanbanOpenCard: "Ouvrir {label}",
|
|
1052
|
+
addView: "Ajouter une vue",
|
|
1053
|
+
config: {
|
|
1054
|
+
open: "Paramètres de la collection",
|
|
1055
|
+
title: "{title} · paramètres",
|
|
1056
|
+
viewsHeading: "Vues personnalisées",
|
|
1057
|
+
deleteView: "Supprimer {label}",
|
|
1058
|
+
confirmDelete: "Supprimer la vue « {label} » ? Cela supprime son fichier HTML et la désenregistre.",
|
|
1059
|
+
empty: "Aucune vue personnalisée pour le moment."
|
|
1060
|
+
},
|
|
1061
|
+
customViewLoading: "Chargement de la vue…",
|
|
1062
|
+
customViewError: "Impossible de charger cette vue : {error}",
|
|
1063
|
+
addViewPrompt: "Je veux ajouter une vue personnalisée à la collection « {title} ». Demande-moi ce que je veux voir ou modifier, puis crée le fichier HTML de la vue dans {base}/views/your-view.html et enregistre-le dans {base}/schema.json sous `views[]` (capabilities [\"read\"] pour une vue en lecture seule, [\"read\",\"write\"] si elle modifie des enregistrements). Suis l'aide custom-view pour le contrat de données.",
|
|
1064
|
+
repair: "Réparer",
|
|
1065
|
+
dataIssuesDetected: "{count} fichier(s) d'enregistrement présentent des problèmes de données et peuvent être absents de cette vue.",
|
|
1066
|
+
repairPrompt: "La collection « {title} » comporte {count} fichier(s) d'enregistrement présentant des problèmes de données qui les empêchent d'apparaître. Corrigez chacun : lisez le fichier avec Read, corrigez-le, puis réécrivez-le avec Write :\n{issues}\n\nUne fois terminé, appelez presentCollection pour confirmer que les enregistrements se chargent.",
|
|
1067
|
+
source: {
|
|
1068
|
+
user: "Utilisateur",
|
|
1069
|
+
project: "Projet"
|
|
1070
|
+
}
|
|
1071
|
+
},
|
|
1072
|
+
common: {
|
|
1073
|
+
close: "Fermer",
|
|
1074
|
+
add: "Ajouter",
|
|
1075
|
+
cancel: "Annuler",
|
|
1076
|
+
loading: "Chargement...",
|
|
1077
|
+
no: "Non",
|
|
1078
|
+
remove: "Supprimer",
|
|
1079
|
+
save: "Enregistrer",
|
|
1080
|
+
saving: "Enregistrement...",
|
|
1081
|
+
yes: "Oui"
|
|
1082
|
+
}
|
|
1083
|
+
},
|
|
1084
|
+
de: {
|
|
1085
|
+
collectionsView: {
|
|
1086
|
+
addCollectionLabel: "Sammlung",
|
|
1087
|
+
addCollectionPrompt: "Hilf mir, eine neue Sammlung zu erstellen. Lies zuerst `config/helps/collection-skills.md` für die Konventionen schemabasierter Sammlungen. Verwende dann das Tool `presentForm` (nutze nicht AskUserQuestion), um mich zu fragen, welche Art von Daten ich verfolgen möchte, und erstelle die schema.json und SKILL.md aus meinen Antworten.",
|
|
1088
|
+
addFeedTitle: "Feed hinzufügen",
|
|
1089
|
+
addFeedHint: "Füge die URL eines Feeds oder einer API ein; ich rufe sie ab und ermittle Titel und Felder für dich.",
|
|
1090
|
+
addFeedPrompt: "Füge einen neuen Datenquellen-Feed von dieser URL hinzu: {url}\n\nLies zuerst `config/helps/feeds.md` und befolge es genau. Rufe diese URL selbst ab, untersuche die Antwort, um einen sinnvollen Titel und die Felder abzuleiten, und erstelle dann `feeds/<slug>/schema.json` wie in der Hilfe beschrieben. Stelle mir KEINE Fragen - leite alles aus den Daten ab. Beim Öffnen des Feeds werden seine Einträge automatisch geladen; sag mir Bescheid, wenn er registriert ist (Refresh muss nicht erwähnt werden).",
|
|
1091
|
+
title: "Sammlungen",
|
|
1092
|
+
backToIndex: "Zurück zu Sammlungen",
|
|
1093
|
+
indexEmpty: "Keine Sammlungen installiert. Markiere auf der Skills-Seite eine Skill mit Schema, um sie hier zu sehen.",
|
|
1094
|
+
editItem: "Bearbeiten",
|
|
1095
|
+
openItem: "{id} öffnen",
|
|
1096
|
+
confirmDelete: "Diesen Eintrag löschen? Das kann nicht rückgängig gemacht werden.",
|
|
1097
|
+
deleteFeed: "Feed löschen",
|
|
1098
|
+
confirmDeleteFeed: "Den Feed {title} und alle abgerufenen Datensätze löschen? Dies kann nicht rückgängig gemacht werden.",
|
|
1099
|
+
deleteCollection: "Sammlung löschen",
|
|
1100
|
+
confirmDeleteCollection: "Die gesamte Sammlung „{title}“ einschließlich aller Datensätze löschen? Zuvor wird eine wiederherstellbare Sicherung archiviert.",
|
|
1101
|
+
itemsEmpty: "Noch keine Einträge. Klicke auf +, um einen hinzuzufügen.",
|
|
1102
|
+
notFound: "Sammlung nicht gefunden",
|
|
1103
|
+
loadFailed: "Laden fehlgeschlagen",
|
|
1104
|
+
requiredField: "Dieses Feld ist erforderlich",
|
|
1105
|
+
selectPlaceholder: "Auswählen…",
|
|
1106
|
+
inlineSaveFailed: "Änderung konnte nicht gespeichert werden: {error}",
|
|
1107
|
+
addRow: "Zeile hinzufügen",
|
|
1108
|
+
removeRow: "Zeile entfernen",
|
|
1109
|
+
noRows: "Noch keine Zeilen",
|
|
1110
|
+
tableSummary: "{count} Einträge",
|
|
1111
|
+
embedMissing: "Kein Datensatz {id} in {collection} gefunden.",
|
|
1112
|
+
embedCreate: "Einrichten",
|
|
1113
|
+
searchPlaceholder: "Datensätze suchen…",
|
|
1114
|
+
searchSummary: "{shown} von {total} werden angezeigt",
|
|
1115
|
+
noMatchingItems: "Keine passenden Einträge",
|
|
1116
|
+
clearSearch: "Suche zurücksetzen",
|
|
1117
|
+
sortBy: "Nach {field} sortieren",
|
|
1118
|
+
openCollection: "{title} öffnen",
|
|
1119
|
+
createTitle: "Neu hinzufügen",
|
|
1120
|
+
derivedLabel: "Abgeleitet",
|
|
1121
|
+
embedMissingTitle: "Eingebettete Referenz fehlt",
|
|
1122
|
+
chat: "Chat",
|
|
1123
|
+
refreshFeed: "Aktualisieren",
|
|
1124
|
+
refreshFailed: "Aktualisierung fehlgeschlagen: {error}",
|
|
1125
|
+
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}",
|
|
1126
|
+
feedsTitle: "Datenquellen-Feeds",
|
|
1127
|
+
feedsEmpty: "Noch keine Feeds registriert.",
|
|
1128
|
+
chatTitle: "Chat starten",
|
|
1129
|
+
chatPlaceholder: "Beschreibe, was du mit dieser Sammlung tun möchtest…",
|
|
1130
|
+
chatStart: "Chat starten",
|
|
1131
|
+
viewToggle: "Ansicht",
|
|
1132
|
+
viewTable: "Tabelle",
|
|
1133
|
+
viewCalendar: "Kalender",
|
|
1134
|
+
calendarFieldLabel: "Kalender-Datumsfeld",
|
|
1135
|
+
calendarPrevMonth: "Voriger Monat",
|
|
1136
|
+
calendarNextMonth: "Nächster Monat",
|
|
1137
|
+
calendarToday: "Heute",
|
|
1138
|
+
calendarNoDate: "Kein Datum",
|
|
1139
|
+
calendarCreateOn: "Am {date} erstellen",
|
|
1140
|
+
dayViewOpen: "Tagesansicht für {date} öffnen",
|
|
1141
|
+
dayViewAllDay: "Ganztägig",
|
|
1142
|
+
dayViewEmpty: "Keine Einträge an diesem Tag",
|
|
1143
|
+
dayViewClose: "Tagesansicht schließen",
|
|
1144
|
+
viewKanban: "Kanban",
|
|
1145
|
+
kanbanFieldLabel: "Kanban-Gruppierungsfeld",
|
|
1146
|
+
kanbanUncategorized: "Nicht kategorisiert",
|
|
1147
|
+
kanbanOpenCard: "{label} öffnen",
|
|
1148
|
+
addView: "Ansicht hinzufügen",
|
|
1149
|
+
config: {
|
|
1150
|
+
open: "Sammlungseinstellungen",
|
|
1151
|
+
title: "{title} · Einstellungen",
|
|
1152
|
+
viewsHeading: "Benutzerdefinierte Ansichten",
|
|
1153
|
+
deleteView: "{label} löschen",
|
|
1154
|
+
confirmDelete: "Ansicht {label} löschen? Die HTML-Datei wird entfernt und die Registrierung aufgehoben.",
|
|
1155
|
+
empty: "Noch keine benutzerdefinierten Ansichten."
|
|
1156
|
+
},
|
|
1157
|
+
customViewLoading: "Ansicht wird geladen…",
|
|
1158
|
+
customViewError: "Diese Ansicht konnte nicht geladen werden: {error}",
|
|
1159
|
+
addViewPrompt: "Ich möchte der Sammlung {title} eine benutzerdefinierte Ansicht hinzufügen. Frag mich, was ich sehen oder bearbeiten möchte, erstelle dann die HTML-Ansichtsdatei unter {base}/views/your-view.html und registriere sie in {base}/schema.json unter `views[]` (capabilities [\"read\"] für eine schreibgeschützte Ansicht, [\"read\",\"write\"] wenn sie Datensätze bearbeitet). Folge der custom-view-Hilfe für den Datenvertrag.",
|
|
1160
|
+
repair: "Reparieren",
|
|
1161
|
+
dataIssuesDetected: "{count} Datensatzdatei(en) haben Datenprobleme und fehlen möglicherweise in dieser Ansicht.",
|
|
1162
|
+
repairPrompt: "Die Sammlung {title} hat {count} Datensatzdatei(en) mit Datenproblemen, die ihr Erscheinen verhindern. Korrigiere jede — die Datei mit Read lesen, korrigieren und mit Write zurückschreiben:\n{issues}\n\nRufe anschließend presentCollection auf, um zu bestätigen, dass die Datensätze geladen werden.",
|
|
1163
|
+
source: {
|
|
1164
|
+
user: "Benutzer",
|
|
1165
|
+
project: "Projekt"
|
|
1166
|
+
}
|
|
1167
|
+
},
|
|
1168
|
+
common: {
|
|
1169
|
+
close: "Schließen",
|
|
1170
|
+
add: "Hinzufügen",
|
|
1171
|
+
cancel: "Abbrechen",
|
|
1172
|
+
loading: "Wird geladen...",
|
|
1173
|
+
no: "Nein",
|
|
1174
|
+
remove: "Entfernen",
|
|
1175
|
+
save: "Speichern",
|
|
1176
|
+
saving: "Wird gespeichert...",
|
|
1177
|
+
yes: "Ja"
|
|
1178
|
+
}
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
});
|
|
1182
|
+
var syncScope = effectScope(true);
|
|
1183
|
+
var syncing = false;
|
|
1184
|
+
/** Mirror this instance's locale to the host's (via the binding) exactly once,
|
|
1185
|
+
* in a detached effect so it lives for the app's lifetime rather than a single
|
|
1186
|
+
* component's. Called lazily on the first `useT()` — by then App.vue's setup has
|
|
1187
|
+
* configured the binding, so `collectionUi()` resolves. */
|
|
1188
|
+
function ensureLocaleSync() {
|
|
1189
|
+
if (syncing) return;
|
|
1190
|
+
syncScope.run(() => {
|
|
1191
|
+
watchEffect(() => {
|
|
1192
|
+
i18n.global.locale.value = collectionUi().localeTag();
|
|
1193
|
+
});
|
|
1194
|
+
});
|
|
1195
|
+
syncing = true;
|
|
1196
|
+
}
|
|
1197
|
+
/** The plugin's i18n composable — a drop-in for vue-i18n's `useI18n()` over the
|
|
1198
|
+
* plugin's own self-contained instance. Returns `{ t, locale }` (destructured at
|
|
1199
|
+
* the call site, exactly like `useI18n()`), with `t` reading the plugin's keys
|
|
1200
|
+
* and `locale` the reactive tag for date/number formatting. */
|
|
1201
|
+
function useCollectionI18n() {
|
|
1202
|
+
ensureLocaleSync();
|
|
1203
|
+
return {
|
|
1204
|
+
t: i18n.global.t,
|
|
1205
|
+
locale: i18n.global.locale
|
|
1206
|
+
};
|
|
1207
|
+
}
|
|
1208
|
+
//#endregion
|
|
329
1209
|
//#region src/vue/components/CollectionEmbedView.vue?vue&type=script&setup=true&lang.ts
|
|
330
|
-
var _hoisted_1$
|
|
331
|
-
var _hoisted_2$
|
|
332
|
-
var _hoisted_3$
|
|
333
|
-
var _hoisted_4$
|
|
334
|
-
var _hoisted_5$
|
|
335
|
-
var _hoisted_6$
|
|
336
|
-
var _hoisted_7$
|
|
1210
|
+
var _hoisted_1$9 = { class: "flex items-center justify-between text-[10px] font-bold text-indigo-600/90 tracking-wider uppercase" };
|
|
1211
|
+
var _hoisted_2$9 = { class: "flex items-center gap-1.5" };
|
|
1212
|
+
var _hoisted_3$9 = { class: "bg-indigo-100/60 text-indigo-700 px-1.5 py-0.5 rounded font-mono font-medium lowercase" };
|
|
1213
|
+
var _hoisted_4$9 = { class: "grid gap-x-4 gap-y-3 grid-cols-2" };
|
|
1214
|
+
var _hoisted_5$8 = { class: "text-[10px] font-semibold text-slate-400 uppercase tracking-wide" };
|
|
1215
|
+
var _hoisted_6$8 = ["data-testid"];
|
|
1216
|
+
var _hoisted_7$8 = {
|
|
337
1217
|
key: 0,
|
|
338
1218
|
class: "material-icons text-emerald-600 text-sm align-middle"
|
|
339
1219
|
};
|
|
340
|
-
var _hoisted_8$
|
|
1220
|
+
var _hoisted_8$8 = {
|
|
341
1221
|
key: 1,
|
|
342
1222
|
class: "text-slate-300"
|
|
343
1223
|
};
|
|
344
|
-
var _hoisted_9$
|
|
1224
|
+
var _hoisted_9$8 = {
|
|
345
1225
|
key: 1,
|
|
346
1226
|
class: "whitespace-pre-wrap font-normal text-slate-600"
|
|
347
1227
|
};
|
|
348
|
-
var _hoisted_10$
|
|
349
|
-
var _hoisted_11$
|
|
350
|
-
var _hoisted_12$
|
|
351
|
-
var _hoisted_13$
|
|
352
|
-
var _hoisted_14$
|
|
353
|
-
var _hoisted_15$
|
|
1228
|
+
var _hoisted_10$8 = { key: 2 };
|
|
1229
|
+
var _hoisted_11$8 = ["data-testid"];
|
|
1230
|
+
var _hoisted_12$7 = { class: "flex items-start gap-3" };
|
|
1231
|
+
var _hoisted_13$6 = { class: "flex-1 min-w-0" };
|
|
1232
|
+
var _hoisted_14$5 = { class: "text-xs font-semibold text-red-800 uppercase tracking-wider mb-1" };
|
|
1233
|
+
var _hoisted_15$5 = ["data-testid"];
|
|
354
1234
|
//#endregion
|
|
355
1235
|
//#region src/vue/components/CollectionEmbedView.vue
|
|
356
1236
|
var CollectionEmbedView_default = /* @__PURE__ */ defineComponent({
|
|
@@ -360,7 +1240,7 @@ var CollectionEmbedView_default = /* @__PURE__ */ defineComponent({
|
|
|
360
1240
|
fieldKey: {}
|
|
361
1241
|
},
|
|
362
1242
|
setup(__props) {
|
|
363
|
-
const { t } =
|
|
1243
|
+
const { t } = useCollectionI18n();
|
|
364
1244
|
return (_ctx, _cache) => {
|
|
365
1245
|
const _component_router_link = resolveComponent("router-link");
|
|
366
1246
|
return __props.view.found ? (openBlock(), createBlock(_component_router_link, {
|
|
@@ -374,15 +1254,15 @@ var CollectionEmbedView_default = /* @__PURE__ */ defineComponent({
|
|
|
374
1254
|
}, {
|
|
375
1255
|
default: withCtx(() => [
|
|
376
1256
|
_cache[1] || (_cache[1] = createElementVNode("div", { class: "absolute left-0 top-0 bottom-0 w-1 bg-indigo-500 rounded-l-xl transition-all duration-300 group-hover:w-1.5 group-hover:bg-indigo-600" }, null, -1)),
|
|
377
|
-
createElementVNode("div", _hoisted_1$
|
|
378
|
-
createElementVNode("div", _hoisted_4$
|
|
1257
|
+
createElementVNode("div", _hoisted_1$9, [createElementVNode("div", _hoisted_2$9, [_cache[0] || (_cache[0] = createElementVNode("span", { class: "material-icons text-sm" }, "link", -1)), createElementVNode("span", null, toDisplayString(__props.view.targetSlug), 1)]), createElementVNode("span", _hoisted_3$9, toDisplayString(__props.view.recordId), 1)]),
|
|
1258
|
+
createElementVNode("div", _hoisted_4$9, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.view.rows, (row) => {
|
|
379
1259
|
return openBlock(), createElementBlock("div", {
|
|
380
1260
|
key: row.key,
|
|
381
1261
|
class: "space-y-0.5"
|
|
382
|
-
}, [createElementVNode("div", _hoisted_5$
|
|
1262
|
+
}, [createElementVNode("div", _hoisted_5$8, toDisplayString(row.label), 1), createElementVNode("div", {
|
|
383
1263
|
class: "text-xs text-slate-700 font-medium break-words",
|
|
384
1264
|
"data-testid": `collections-embed-${__props.fieldKey}-${row.key}`
|
|
385
|
-
}, [row.type === "boolean" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [row.value === true ? (openBlock(), createElementBlock("span", _hoisted_7$
|
|
1265
|
+
}, [row.type === "boolean" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [row.value === true ? (openBlock(), createElementBlock("span", _hoisted_7$8, "check_circle")) : (openBlock(), createElementBlock("span", _hoisted_8$8, "—"))], 64)) : row.type === "markdown" ? (openBlock(), createElementBlock("p", _hoisted_9$8, toDisplayString(row.display), 1)) : (openBlock(), createElementBlock("span", _hoisted_10$8, toDisplayString(row.display), 1))], 8, _hoisted_6$8)]);
|
|
386
1266
|
}), 128))])
|
|
387
1267
|
]),
|
|
388
1268
|
_: 1
|
|
@@ -390,15 +1270,15 @@ var CollectionEmbedView_default = /* @__PURE__ */ defineComponent({
|
|
|
390
1270
|
key: 1,
|
|
391
1271
|
class: "relative rounded-xl border border-red-100 bg-red-50/30 p-4 pl-5 shadow-sm",
|
|
392
1272
|
"data-testid": `collections-embed-${__props.fieldKey}`
|
|
393
|
-
}, [_cache[4] || (_cache[4] = createElementVNode("div", { class: "absolute left-0 top-0 bottom-0 w-1 bg-red-400 rounded-l-xl" }, null, -1)), createElementVNode("div", _hoisted_12$
|
|
394
|
-
createElementVNode("p", _hoisted_14$
|
|
1273
|
+
}, [_cache[4] || (_cache[4] = createElementVNode("div", { class: "absolute left-0 top-0 bottom-0 w-1 bg-red-400 rounded-l-xl" }, null, -1)), createElementVNode("div", _hoisted_12$7, [_cache[3] || (_cache[3] = createElementVNode("span", { class: "material-icons text-red-500 text-lg mt-0.5" }, "error_outline", -1)), createElementVNode("div", _hoisted_13$6, [
|
|
1274
|
+
createElementVNode("p", _hoisted_14$5, toDisplayString(unref(t)("collectionsView.embedMissingTitle")), 1),
|
|
395
1275
|
createElementVNode("p", {
|
|
396
1276
|
class: "text-xs text-red-600",
|
|
397
1277
|
"data-testid": `collections-embed-missing-${__props.fieldKey}`
|
|
398
1278
|
}, toDisplayString(unref(t)("collectionsView.embedMissing", {
|
|
399
1279
|
collection: __props.view.targetSlug,
|
|
400
1280
|
id: __props.view.recordId
|
|
401
|
-
})), 9, _hoisted_15$
|
|
1281
|
+
})), 9, _hoisted_15$5),
|
|
402
1282
|
__props.view.targetSlug ? (openBlock(), createBlock(_component_router_link, {
|
|
403
1283
|
key: 0,
|
|
404
1284
|
to: { path: `/collections/${__props.view.targetSlug}` },
|
|
@@ -407,40 +1287,40 @@ var CollectionEmbedView_default = /* @__PURE__ */ defineComponent({
|
|
|
407
1287
|
default: withCtx(() => [createElementVNode("span", null, toDisplayString(unref(t)("collectionsView.embedCreate")), 1), _cache[2] || (_cache[2] = createElementVNode("span", { class: "material-icons text-xs" }, "arrow_forward", -1))]),
|
|
408
1288
|
_: 1
|
|
409
1289
|
}, 8, ["to"])) : createCommentVNode("", true)
|
|
410
|
-
])])], 8, _hoisted_11$
|
|
1290
|
+
])])], 8, _hoisted_11$8));
|
|
411
1291
|
};
|
|
412
1292
|
}
|
|
413
1293
|
});
|
|
414
1294
|
//#endregion
|
|
415
1295
|
//#region src/vue/components/CollectionCalendarView.vue?vue&type=script&setup=true&lang.ts
|
|
416
|
-
var _hoisted_1$
|
|
1296
|
+
var _hoisted_1$8 = {
|
|
417
1297
|
class: "flex flex-col gap-3",
|
|
418
1298
|
"data-testid": "collection-calendar"
|
|
419
1299
|
};
|
|
420
|
-
var _hoisted_2$
|
|
421
|
-
var _hoisted_3$
|
|
422
|
-
var _hoisted_4$
|
|
423
|
-
var _hoisted_5$
|
|
1300
|
+
var _hoisted_2$8 = { class: "flex items-center gap-2" };
|
|
1301
|
+
var _hoisted_3$8 = ["aria-label"];
|
|
1302
|
+
var _hoisted_4$8 = ["aria-label"];
|
|
1303
|
+
var _hoisted_5$7 = {
|
|
424
1304
|
class: "text-sm font-bold text-slate-800 flex-1",
|
|
425
1305
|
"data-testid": "collection-calendar-month"
|
|
426
1306
|
};
|
|
427
|
-
var _hoisted_6$
|
|
428
|
-
var _hoisted_7$
|
|
429
|
-
var _hoisted_8$
|
|
1307
|
+
var _hoisted_6$7 = { class: "grid grid-cols-7 gap-1 text-[10px] font-bold text-slate-400 uppercase tracking-wider select-none" };
|
|
1308
|
+
var _hoisted_7$7 = { class: "grid grid-cols-7 gap-1" };
|
|
1309
|
+
var _hoisted_8$7 = [
|
|
430
1310
|
"aria-label",
|
|
431
1311
|
"data-testid",
|
|
432
1312
|
"onClick",
|
|
433
1313
|
"onKeydown"
|
|
434
1314
|
];
|
|
435
|
-
var _hoisted_9$
|
|
436
|
-
var _hoisted_10$
|
|
437
|
-
var _hoisted_11$
|
|
1315
|
+
var _hoisted_9$7 = { class: "flex items-center justify-end" };
|
|
1316
|
+
var _hoisted_10$7 = ["data-testid", "onClick"];
|
|
1317
|
+
var _hoisted_11$7 = {
|
|
438
1318
|
key: 0,
|
|
439
1319
|
class: "flex flex-wrap items-center gap-1.5 pt-1",
|
|
440
1320
|
"data-testid": "collection-calendar-no-date"
|
|
441
1321
|
};
|
|
442
|
-
var _hoisted_12$
|
|
443
|
-
var _hoisted_13$
|
|
1322
|
+
var _hoisted_12$6 = { class: "text-[10px] font-bold text-slate-400 uppercase tracking-wider mr-1" };
|
|
1323
|
+
var _hoisted_13$5 = ["data-testid", "onClick"];
|
|
444
1324
|
/** Sort key for ordering a day's chips by start time: earliest first, with
|
|
445
1325
|
* clock-less all-day records sinking to the bottom (matching the day view). */
|
|
446
1326
|
var DAY_CHIP_DEFAULT = "bg-indigo-50 text-indigo-700 border-indigo-100 hover:bg-indigo-100";
|
|
@@ -462,7 +1342,7 @@ var CollectionCalendarView_default = /* @__PURE__ */ defineComponent({
|
|
|
462
1342
|
setup(__props, { emit: __emit }) {
|
|
463
1343
|
const props = __props;
|
|
464
1344
|
const emit = __emit;
|
|
465
|
-
const { t, locale } =
|
|
1345
|
+
const { t, locale } = useCollectionI18n();
|
|
466
1346
|
const now = /* @__PURE__ */ new Date();
|
|
467
1347
|
const viewYear = ref(now.getFullYear());
|
|
468
1348
|
const viewMonth = ref(now.getMonth() + 1);
|
|
@@ -554,23 +1434,23 @@ var CollectionCalendarView_default = /* @__PURE__ */ defineComponent({
|
|
|
554
1434
|
viewMonth.value = now.getMonth() + 1;
|
|
555
1435
|
}
|
|
556
1436
|
return (_ctx, _cache) => {
|
|
557
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
558
|
-
createElementVNode("div", _hoisted_2$
|
|
1437
|
+
return openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
1438
|
+
createElementVNode("div", _hoisted_2$8, [
|
|
559
1439
|
createElementVNode("button", {
|
|
560
1440
|
type: "button",
|
|
561
1441
|
class: "h-8 w-8 flex items-center justify-center rounded text-slate-500 hover:bg-slate-100 transition-colors",
|
|
562
1442
|
"aria-label": unref(t)("collectionsView.calendarPrevMonth"),
|
|
563
1443
|
"data-testid": "collection-calendar-prev",
|
|
564
1444
|
onClick: _cache[0] || (_cache[0] = ($event) => stepMonth(-1))
|
|
565
|
-
}, [..._cache[2] || (_cache[2] = [createElementVNode("span", { class: "material-icons text-lg" }, "chevron_left", -1)])], 8, _hoisted_3$
|
|
1445
|
+
}, [..._cache[2] || (_cache[2] = [createElementVNode("span", { class: "material-icons text-lg" }, "chevron_left", -1)])], 8, _hoisted_3$8),
|
|
566
1446
|
createElementVNode("button", {
|
|
567
1447
|
type: "button",
|
|
568
1448
|
class: "h-8 w-8 flex items-center justify-center rounded text-slate-500 hover:bg-slate-100 transition-colors",
|
|
569
1449
|
"aria-label": unref(t)("collectionsView.calendarNextMonth"),
|
|
570
1450
|
"data-testid": "collection-calendar-next",
|
|
571
1451
|
onClick: _cache[1] || (_cache[1] = ($event) => stepMonth(1))
|
|
572
|
-
}, [..._cache[3] || (_cache[3] = [createElementVNode("span", { class: "material-icons text-lg" }, "chevron_right", -1)])], 8, _hoisted_4$
|
|
573
|
-
createElementVNode("h3", _hoisted_5$
|
|
1452
|
+
}, [..._cache[3] || (_cache[3] = [createElementVNode("span", { class: "material-icons text-lg" }, "chevron_right", -1)])], 8, _hoisted_4$8),
|
|
1453
|
+
createElementVNode("h3", _hoisted_5$7, toDisplayString(monthLabel.value), 1),
|
|
574
1454
|
createElementVNode("button", {
|
|
575
1455
|
type: "button",
|
|
576
1456
|
class: "h-8 px-2.5 flex items-center gap-1 rounded border border-slate-200 bg-white text-slate-600 hover:bg-slate-50 text-xs font-bold transition-colors",
|
|
@@ -578,13 +1458,13 @@ var CollectionCalendarView_default = /* @__PURE__ */ defineComponent({
|
|
|
578
1458
|
onClick: goToday
|
|
579
1459
|
}, toDisplayString(unref(t)("collectionsView.calendarToday")), 1)
|
|
580
1460
|
]),
|
|
581
|
-
createElementVNode("div", _hoisted_6$
|
|
1461
|
+
createElementVNode("div", _hoisted_6$7, [(openBlock(true), createElementBlock(Fragment, null, renderList(weekdayLabels.value, (label, idx) => {
|
|
582
1462
|
return openBlock(), createElementBlock("div", {
|
|
583
1463
|
key: idx,
|
|
584
1464
|
class: "px-1 py-1 text-center"
|
|
585
1465
|
}, toDisplayString(label), 1);
|
|
586
1466
|
}), 128))]),
|
|
587
|
-
createElementVNode("div", _hoisted_7$
|
|
1467
|
+
createElementVNode("div", _hoisted_7$7, [(openBlock(true), createElementBlock(Fragment, null, renderList(cells.value, ({ cell, entries }) => {
|
|
588
1468
|
return openBlock(), createElementBlock("div", {
|
|
589
1469
|
key: cell.key,
|
|
590
1470
|
class: normalizeClass(["min-h-[5.5rem] rounded-lg border p-1 flex flex-col gap-1 overflow-hidden transition-colors cursor-pointer hover:border-indigo-300 focus:outline-none focus:ring-2 focus:ring-indigo-500/30", cell.inMonth ? "bg-white border-slate-200" : "bg-slate-50/50 border-slate-100"]),
|
|
@@ -594,24 +1474,24 @@ var CollectionCalendarView_default = /* @__PURE__ */ defineComponent({
|
|
|
594
1474
|
"data-testid": `collection-calendar-day-${cell.key}`,
|
|
595
1475
|
onClick: ($event) => emit("openDay", cell.ymd),
|
|
596
1476
|
onKeydown: [withKeys(withModifiers(($event) => emit("openDay", cell.ymd), ["self", "prevent"]), ["enter"]), withKeys(withModifiers(($event) => emit("openDay", cell.ymd), ["self", "prevent"]), ["space"])]
|
|
597
|
-
}, [createElementVNode("div", _hoisted_9$
|
|
1477
|
+
}, [createElementVNode("div", _hoisted_9$7, [createElementVNode("span", { class: normalizeClass(["text-[11px] font-bold h-5 min-w-5 px-1 inline-flex items-center justify-center rounded-full", cell.key === unref(todayKey) ? "bg-indigo-600 text-white" : cell.inMonth ? "text-slate-500" : "text-slate-300"]) }, toDisplayString(cell.ymd.day), 3)]), (openBlock(true), createElementBlock(Fragment, null, renderList(entries, (entry) => {
|
|
598
1478
|
return openBlock(), createElementBlock("button", {
|
|
599
1479
|
key: entry.id,
|
|
600
1480
|
type: "button",
|
|
601
1481
|
class: normalizeClass(["text-left text-[11px] leading-tight font-semibold truncate rounded px-1.5 py-0.5 border transition-colors", chipClass(entry, DAY_CHIP_DEFAULT)]),
|
|
602
1482
|
"data-testid": `collection-calendar-chip-${entry.id}`,
|
|
603
1483
|
onClick: withModifiers(($event) => emit("select", entry.id), ["stop"])
|
|
604
|
-
}, toDisplayString(entry.label), 11, _hoisted_10$
|
|
605
|
-
}), 128))], 42, _hoisted_8$
|
|
1484
|
+
}, toDisplayString(entry.label), 11, _hoisted_10$7);
|
|
1485
|
+
}), 128))], 42, _hoisted_8$7);
|
|
606
1486
|
}), 128))]),
|
|
607
|
-
bucketed.value.noDate.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_11$
|
|
1487
|
+
bucketed.value.noDate.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_11$7, [createElementVNode("span", _hoisted_12$6, toDisplayString(unref(t)("collectionsView.calendarNoDate")), 1), (openBlock(true), createElementBlock(Fragment, null, renderList(undatedEntries.value, (entry) => {
|
|
608
1488
|
return openBlock(), createElementBlock("button", {
|
|
609
1489
|
key: entry.id,
|
|
610
1490
|
type: "button",
|
|
611
1491
|
class: normalizeClass(["text-[11px] font-semibold truncate rounded px-1.5 py-0.5 border transition-colors", chipClass(entry, UNDATED_CHIP_DEFAULT)]),
|
|
612
1492
|
"data-testid": `collection-calendar-undated-${entry.id}`,
|
|
613
1493
|
onClick: ($event) => emit("select", entry.id)
|
|
614
|
-
}, toDisplayString(entry.label), 11, _hoisted_13$
|
|
1494
|
+
}, toDisplayString(entry.label), 11, _hoisted_13$5);
|
|
615
1495
|
}), 128))])) : createCommentVNode("", true)
|
|
616
1496
|
]);
|
|
617
1497
|
};
|
|
@@ -619,40 +1499,40 @@ var CollectionCalendarView_default = /* @__PURE__ */ defineComponent({
|
|
|
619
1499
|
});
|
|
620
1500
|
//#endregion
|
|
621
1501
|
//#region src/vue/components/CollectionDayView.vue?vue&type=script&setup=true&lang.ts
|
|
622
|
-
var _hoisted_1$
|
|
623
|
-
var _hoisted_2$
|
|
1502
|
+
var _hoisted_1$7 = { class: "flex items-center gap-2 border-b border-slate-200 px-4 py-3" };
|
|
1503
|
+
var _hoisted_2$7 = {
|
|
624
1504
|
class: "flex-1 text-sm font-bold text-slate-800",
|
|
625
1505
|
"data-testid": "collection-day-view-title"
|
|
626
1506
|
};
|
|
627
|
-
var _hoisted_3$
|
|
628
|
-
var _hoisted_4$
|
|
629
|
-
var _hoisted_5$
|
|
1507
|
+
var _hoisted_3$7 = ["aria-label"];
|
|
1508
|
+
var _hoisted_4$7 = ["aria-label"];
|
|
1509
|
+
var _hoisted_5$6 = {
|
|
630
1510
|
key: 0,
|
|
631
1511
|
class: "px-4 py-10 text-center text-sm text-slate-400"
|
|
632
1512
|
};
|
|
633
|
-
var _hoisted_6$
|
|
634
|
-
var _hoisted_7$
|
|
1513
|
+
var _hoisted_6$6 = { class: "absolute -top-2 left-0 w-10 pr-1 text-right text-[10px] tabular-nums text-slate-400" };
|
|
1514
|
+
var _hoisted_7$6 = {
|
|
635
1515
|
class: "absolute inset-y-0 right-0",
|
|
636
1516
|
style: { "left": "2.75rem" }
|
|
637
1517
|
};
|
|
638
|
-
var _hoisted_8$
|
|
639
|
-
var _hoisted_9$
|
|
640
|
-
var _hoisted_10$
|
|
1518
|
+
var _hoisted_8$6 = ["data-testid", "onClick"];
|
|
1519
|
+
var _hoisted_9$6 = { class: "block truncate text-[11px] font-semibold leading-tight" };
|
|
1520
|
+
var _hoisted_10$6 = {
|
|
641
1521
|
key: 0,
|
|
642
1522
|
"aria-hidden": "true"
|
|
643
1523
|
};
|
|
644
|
-
var _hoisted_11$
|
|
1524
|
+
var _hoisted_11$6 = {
|
|
645
1525
|
key: 1,
|
|
646
1526
|
"aria-hidden": "true"
|
|
647
1527
|
};
|
|
648
|
-
var _hoisted_12$
|
|
1528
|
+
var _hoisted_12$5 = {
|
|
649
1529
|
key: 2,
|
|
650
1530
|
class: "flex flex-wrap items-center gap-1.5 border-t border-slate-200 px-4 py-2",
|
|
651
1531
|
"data-testid": "collection-day-view-all-day"
|
|
652
1532
|
};
|
|
653
|
-
var _hoisted_13$
|
|
654
|
-
var _hoisted_14$
|
|
655
|
-
var _hoisted_15$
|
|
1533
|
+
var _hoisted_13$4 = { class: "mr-1 text-[10px] font-bold uppercase tracking-wider text-slate-400" };
|
|
1534
|
+
var _hoisted_14$4 = ["data-testid", "onClick"];
|
|
1535
|
+
var _hoisted_15$4 = {
|
|
656
1536
|
key: 0,
|
|
657
1537
|
class: "min-w-0 flex-1 overflow-y-auto",
|
|
658
1538
|
"data-testid": "collection-day-view-detail"
|
|
@@ -688,7 +1568,7 @@ var CollectionDayView_default = /* @__PURE__ */ defineComponent({
|
|
|
688
1568
|
setup(__props, { emit: __emit }) {
|
|
689
1569
|
const props = __props;
|
|
690
1570
|
const emit = __emit;
|
|
691
|
-
const { t, locale } =
|
|
1571
|
+
const { t, locale } = useCollectionI18n();
|
|
692
1572
|
const TOTAL_HEIGHT = HOUR_PX * 24;
|
|
693
1573
|
const PX_PER_MIN = HOUR_PX / 60;
|
|
694
1574
|
const scrollEl = ref(null);
|
|
@@ -811,8 +1691,8 @@ var CollectionDayView_default = /* @__PURE__ */ defineComponent({
|
|
|
811
1691
|
role: "dialog",
|
|
812
1692
|
"aria-modal": "true"
|
|
813
1693
|
}, [createElementVNode("div", { class: normalizeClass(["flex min-h-0 flex-col", __props.showDetail ? "w-80 shrink-0 border-r border-slate-200" : "w-full"]) }, [
|
|
814
|
-
createElementVNode("div", _hoisted_1$
|
|
815
|
-
createElementVNode("h3", _hoisted_2$
|
|
1694
|
+
createElementVNode("div", _hoisted_1$7, [
|
|
1695
|
+
createElementVNode("h3", _hoisted_2$7, toDisplayString(dayLabel.value), 1),
|
|
816
1696
|
__props.canCreate ? (openBlock(), createElementBlock("button", {
|
|
817
1697
|
key: 0,
|
|
818
1698
|
type: "button",
|
|
@@ -820,16 +1700,16 @@ var CollectionDayView_default = /* @__PURE__ */ defineComponent({
|
|
|
820
1700
|
"aria-label": unref(t)("collectionsView.calendarCreateOn", { date: dayKey.value }),
|
|
821
1701
|
"data-testid": "collection-day-view-create",
|
|
822
1702
|
onClick: onCreate
|
|
823
|
-
}, [..._cache[3] || (_cache[3] = [createElementVNode("span", { class: "material-icons text-lg" }, "add", -1)])], 8, _hoisted_3$
|
|
1703
|
+
}, [..._cache[3] || (_cache[3] = [createElementVNode("span", { class: "material-icons text-lg" }, "add", -1)])], 8, _hoisted_3$7)) : createCommentVNode("", true),
|
|
824
1704
|
createElementVNode("button", {
|
|
825
1705
|
type: "button",
|
|
826
1706
|
class: "h-8 w-8 flex items-center justify-center rounded text-slate-500 hover:bg-slate-100 transition-colors",
|
|
827
1707
|
"aria-label": unref(t)("collectionsView.dayViewClose"),
|
|
828
1708
|
"data-testid": "collection-day-view-close",
|
|
829
1709
|
onClick: _cache[0] || (_cache[0] = ($event) => emit("close"))
|
|
830
|
-
}, [..._cache[4] || (_cache[4] = [createElementVNode("span", { class: "material-icons text-lg" }, "close", -1)])], 8, _hoisted_4$
|
|
1710
|
+
}, [..._cache[4] || (_cache[4] = [createElementVNode("span", { class: "material-icons text-lg" }, "close", -1)])], 8, _hoisted_4$7)
|
|
831
1711
|
]),
|
|
832
|
-
timedEntries.value.length === 0 && allDayEntries.value.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_5$
|
|
1712
|
+
timedEntries.value.length === 0 && allDayEntries.value.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_5$6, toDisplayString(unref(t)("collectionsView.dayViewEmpty")), 1)) : (openBlock(), createElementBlock("div", {
|
|
833
1713
|
key: 1,
|
|
834
1714
|
ref_key: "scrollEl",
|
|
835
1715
|
ref: scrollEl,
|
|
@@ -843,8 +1723,8 @@ var CollectionDayView_default = /* @__PURE__ */ defineComponent({
|
|
|
843
1723
|
key: hour,
|
|
844
1724
|
class: "absolute left-0 right-0 border-t border-slate-100",
|
|
845
1725
|
style: normalizeStyle({ top: `${(hour - 1) * HOUR_PX}px` })
|
|
846
|
-
}, [createElementVNode("span", _hoisted_6$
|
|
847
|
-
}), 64)), createElementVNode("div", _hoisted_7$
|
|
1726
|
+
}, [createElementVNode("span", _hoisted_6$6, toDisplayString(hourLabel(hour - 1)), 1)], 4);
|
|
1727
|
+
}), 64)), createElementVNode("div", _hoisted_7$6, [(openBlock(true), createElementBlock(Fragment, null, renderList(timedEntries.value, (entry) => {
|
|
848
1728
|
return openBlock(), createElementBlock("button", {
|
|
849
1729
|
key: entry.id,
|
|
850
1730
|
type: "button",
|
|
@@ -852,56 +1732,56 @@ var CollectionDayView_default = /* @__PURE__ */ defineComponent({
|
|
|
852
1732
|
style: normalizeStyle(entry.style),
|
|
853
1733
|
"data-testid": `collection-day-view-chip-${entry.id}`,
|
|
854
1734
|
onClick: ($event) => onSelect(entry.id)
|
|
855
|
-
}, [createElementVNode("span", _hoisted_9$
|
|
856
|
-
entry.slice.bleedsBefore ? (openBlock(), createElementBlock("span", _hoisted_10$
|
|
1735
|
+
}, [createElementVNode("span", _hoisted_9$6, [
|
|
1736
|
+
entry.slice.bleedsBefore ? (openBlock(), createElementBlock("span", _hoisted_10$6, "▲ ")) : createCommentVNode("", true),
|
|
857
1737
|
createTextVNode(toDisplayString(entry.label), 1),
|
|
858
|
-
entry.slice.bleedsAfter ? (openBlock(), createElementBlock("span", _hoisted_11$
|
|
1738
|
+
entry.slice.bleedsAfter ? (openBlock(), createElementBlock("span", _hoisted_11$6, " ▼")) : createCommentVNode("", true)
|
|
859
1739
|
]), (openBlock(true), createElementBlock(Fragment, null, renderList(entry.secondary, (text, i) => {
|
|
860
1740
|
return openBlock(), createElementBlock("span", {
|
|
861
1741
|
key: i,
|
|
862
1742
|
class: "block truncate text-[10px] leading-tight opacity-70"
|
|
863
1743
|
}, toDisplayString(text), 1);
|
|
864
|
-
}), 128))], 14, _hoisted_8$
|
|
1744
|
+
}), 128))], 14, _hoisted_8$6);
|
|
865
1745
|
}), 128))])], 4)], 512)),
|
|
866
|
-
allDayEntries.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_12$
|
|
1746
|
+
allDayEntries.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_12$5, [createElementVNode("span", _hoisted_13$4, toDisplayString(unref(t)("collectionsView.dayViewAllDay")), 1), (openBlock(true), createElementBlock(Fragment, null, renderList(allDayEntries.value, (entry) => {
|
|
867
1747
|
return openBlock(), createElementBlock("button", {
|
|
868
1748
|
key: entry.id,
|
|
869
1749
|
type: "button",
|
|
870
1750
|
class: normalizeClass(["truncate rounded border px-1.5 py-0.5 text-[11px] font-semibold transition-colors", allDayChipClass(entry)]),
|
|
871
1751
|
"data-testid": `collection-day-view-allday-${entry.id}`,
|
|
872
1752
|
onClick: ($event) => onSelect(entry.id)
|
|
873
|
-
}, toDisplayString(entry.label), 11, _hoisted_14$
|
|
1753
|
+
}, toDisplayString(entry.label), 11, _hoisted_14$4);
|
|
874
1754
|
}), 128))])) : createCommentVNode("", true)
|
|
875
|
-
], 2), __props.showDetail ? (openBlock(), createElementBlock("div", _hoisted_15$
|
|
1755
|
+
], 2), __props.showDetail ? (openBlock(), createElementBlock("div", _hoisted_15$4, [renderSlot(_ctx.$slots, "detail")])) : createCommentVNode("", true)], 2)], 32);
|
|
876
1756
|
};
|
|
877
1757
|
}
|
|
878
1758
|
});
|
|
879
1759
|
//#endregion
|
|
880
1760
|
//#region src/vue/components/CollectionKanbanView.vue?vue&type=script&setup=true&lang.ts
|
|
881
|
-
var _hoisted_1$
|
|
1761
|
+
var _hoisted_1$6 = {
|
|
882
1762
|
class: "h-full overflow-x-auto overflow-y-hidden",
|
|
883
1763
|
"data-testid": "collection-kanban"
|
|
884
1764
|
};
|
|
885
|
-
var _hoisted_2$
|
|
886
|
-
var _hoisted_3$
|
|
887
|
-
var _hoisted_4$
|
|
888
|
-
var _hoisted_5$
|
|
889
|
-
var _hoisted_6$
|
|
890
|
-
var _hoisted_7$
|
|
891
|
-
var _hoisted_8$
|
|
1765
|
+
var _hoisted_2$6 = { class: "flex gap-3 h-full p-1 min-w-max" };
|
|
1766
|
+
var _hoisted_3$6 = ["data-testid"];
|
|
1767
|
+
var _hoisted_4$6 = { class: "flex items-center justify-between px-3 py-2 border-b border-slate-200" };
|
|
1768
|
+
var _hoisted_5$5 = { class: "flex items-center gap-2 min-w-0" };
|
|
1769
|
+
var _hoisted_6$5 = ["title"];
|
|
1770
|
+
var _hoisted_7$5 = { class: "text-[11px] text-slate-400 shrink-0" };
|
|
1771
|
+
var _hoisted_8$5 = [
|
|
892
1772
|
"data-testid",
|
|
893
1773
|
"aria-label",
|
|
894
1774
|
"onClick",
|
|
895
1775
|
"onKeydown"
|
|
896
1776
|
];
|
|
897
|
-
var _hoisted_9$
|
|
898
|
-
var _hoisted_10$
|
|
1777
|
+
var _hoisted_9$5 = { class: "flex items-start gap-2" };
|
|
1778
|
+
var _hoisted_10$5 = [
|
|
899
1779
|
"checked",
|
|
900
1780
|
"aria-label",
|
|
901
1781
|
"data-testid",
|
|
902
1782
|
"onChange"
|
|
903
1783
|
];
|
|
904
|
-
var _hoisted_11$
|
|
1784
|
+
var _hoisted_11$5 = { class: "text-sm font-medium text-slate-800 truncate" };
|
|
905
1785
|
var UNCATEGORIZED = "";
|
|
906
1786
|
//#endregion
|
|
907
1787
|
//#region src/vue/components/CollectionKanbanView.vue
|
|
@@ -918,7 +1798,7 @@ var CollectionKanbanView_default = /* @__PURE__ */ defineComponent({
|
|
|
918
1798
|
setup(__props, { emit: __emit }) {
|
|
919
1799
|
const props = __props;
|
|
920
1800
|
const emit = __emit;
|
|
921
|
-
const { t } =
|
|
1801
|
+
const { t } = useCollectionI18n();
|
|
922
1802
|
/** The Uncategorized column uses the empty string as its sentinel value. */
|
|
923
1803
|
const groupSpec = computed(() => props.schema.fields[props.groupField]);
|
|
924
1804
|
/** Declared enum values become columns in order, with a trailing
|
|
@@ -999,15 +1879,15 @@ var CollectionKanbanView_default = /* @__PURE__ */ defineComponent({
|
|
|
999
1879
|
emit("move", itemId(item), next);
|
|
1000
1880
|
}
|
|
1001
1881
|
return (_ctx, _cache) => {
|
|
1002
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
1882
|
+
return openBlock(), createElementBlock("div", _hoisted_1$6, [createElementVNode("div", _hoisted_2$6, [(openBlock(true), createElementBlock(Fragment, null, renderList(columns.value, (column) => {
|
|
1003
1883
|
return openBlock(), createElementBlock("div", {
|
|
1004
1884
|
key: column.value,
|
|
1005
1885
|
"data-testid": `collection-kanban-column-${column.value || "uncategorized"}`,
|
|
1006
1886
|
class: "w-72 shrink-0 flex flex-col bg-slate-100 rounded-lg"
|
|
1007
|
-
}, [createElementVNode("div", _hoisted_4$
|
|
1887
|
+
}, [createElementVNode("div", _hoisted_4$6, [createElementVNode("div", _hoisted_5$5, [createElementVNode("span", { class: normalizeClass(["w-2 h-2 rounded-full shrink-0", unref(resolveEnumColor)(__props.schema, __props.groupField, column.value).dot]) }, null, 2), createElementVNode("span", {
|
|
1008
1888
|
class: "font-semibold text-xs text-slate-600 truncate",
|
|
1009
1889
|
title: column.label
|
|
1010
|
-
}, toDisplayString(column.label), 9, _hoisted_6$
|
|
1890
|
+
}, toDisplayString(column.label), 9, _hoisted_6$5)]), createElementVNode("span", _hoisted_7$5, toDisplayString(itemsByColumn(column.value).length), 1)]), createVNode(unref(draggable), {
|
|
1011
1891
|
"model-value": itemsByColumn(column.value),
|
|
1012
1892
|
"item-key": __props.schema.primaryKey,
|
|
1013
1893
|
group: "collection-kanban-cards",
|
|
@@ -1023,7 +1903,7 @@ var CollectionKanbanView_default = /* @__PURE__ */ defineComponent({
|
|
|
1023
1903
|
class: normalizeClass(["bg-white border border-slate-200 rounded shadow-sm p-2 cursor-grab hover:shadow active:cursor-grabbing focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400", [itemId(element) === __props.selected ? "ring-2 ring-indigo-500 border-indigo-300" : "", notifyAccentClass(element)]]),
|
|
1024
1904
|
onClick: ($event) => emit("select", itemId(element)),
|
|
1025
1905
|
onKeydown: [withKeys(withModifiers((e) => !e.repeat && emit("select", itemId(element)), ["prevent", "self"]), ["enter"]), withKeys(withModifiers((e) => !e.repeat && emit("select", itemId(element)), ["prevent", "self"]), ["space"])]
|
|
1026
|
-
}, [createElementVNode("div", _hoisted_9$
|
|
1906
|
+
}, [createElementVNode("div", _hoisted_9$5, [cardToggle.value ? (openBlock(), createElementBlock("input", {
|
|
1027
1907
|
key: 0,
|
|
1028
1908
|
type: "checkbox",
|
|
1029
1909
|
checked: cardChecked(element),
|
|
@@ -1032,124 +1912,124 @@ var CollectionKanbanView_default = /* @__PURE__ */ defineComponent({
|
|
|
1032
1912
|
"data-testid": `collection-kanban-toggle-${itemId(element)}`,
|
|
1033
1913
|
onClick: _cache[0] || (_cache[0] = withModifiers(() => {}, ["stop"])),
|
|
1034
1914
|
onChange: ($event) => onCardToggle(element)
|
|
1035
|
-
}, null, 40, _hoisted_10$
|
|
1915
|
+
}, null, 40, _hoisted_10$5)) : createCommentVNode("", true), createElementVNode("div", _hoisted_11$5, toDisplayString(itemLabel(element)), 1)])], 42, _hoisted_8$5)]),
|
|
1036
1916
|
_: 1
|
|
1037
1917
|
}, 8, [
|
|
1038
1918
|
"model-value",
|
|
1039
1919
|
"item-key",
|
|
1040
1920
|
"onChange"
|
|
1041
|
-
])], 8, _hoisted_3$
|
|
1921
|
+
])], 8, _hoisted_3$6);
|
|
1042
1922
|
}), 128))])]);
|
|
1043
1923
|
};
|
|
1044
1924
|
}
|
|
1045
1925
|
});
|
|
1046
1926
|
//#endregion
|
|
1047
1927
|
//#region src/vue/components/CollectionRecordPanel.vue?vue&type=script&setup=true&lang.ts
|
|
1048
|
-
var _hoisted_1 = { class: "flex items-center gap-2 mb-4" };
|
|
1049
|
-
var _hoisted_2 = { class: "flex-1 min-w-0" };
|
|
1050
|
-
var _hoisted_3 = { class: "block text-[9px] font-bold text-slate-400 uppercase tracking-wider" };
|
|
1051
|
-
var _hoisted_4 = ["data-testid"];
|
|
1052
|
-
var _hoisted_5 = ["disabled"];
|
|
1053
|
-
var _hoisted_6 = {
|
|
1928
|
+
var _hoisted_1$5 = { class: "flex items-center gap-2 mb-4" };
|
|
1929
|
+
var _hoisted_2$5 = { class: "flex-1 min-w-0" };
|
|
1930
|
+
var _hoisted_3$5 = { class: "block text-[9px] font-bold text-slate-400 uppercase tracking-wider" };
|
|
1931
|
+
var _hoisted_4$5 = ["data-testid"];
|
|
1932
|
+
var _hoisted_5$4 = ["disabled"];
|
|
1933
|
+
var _hoisted_6$4 = {
|
|
1054
1934
|
key: 1,
|
|
1055
1935
|
class: "flex items-center gap-2"
|
|
1056
1936
|
};
|
|
1057
|
-
var _hoisted_7 = [
|
|
1937
|
+
var _hoisted_7$4 = [
|
|
1058
1938
|
"disabled",
|
|
1059
1939
|
"data-testid",
|
|
1060
1940
|
"onClick"
|
|
1061
1941
|
];
|
|
1062
|
-
var _hoisted_8 = {
|
|
1942
|
+
var _hoisted_8$4 = {
|
|
1063
1943
|
key: 0,
|
|
1064
1944
|
class: "material-icons text-sm"
|
|
1065
1945
|
};
|
|
1066
|
-
var _hoisted_9 = ["aria-label"];
|
|
1067
|
-
var _hoisted_10 = {
|
|
1946
|
+
var _hoisted_9$4 = ["aria-label"];
|
|
1947
|
+
var _hoisted_10$4 = {
|
|
1068
1948
|
key: 0,
|
|
1069
1949
|
class: "mb-3 text-xs font-semibold text-red-600 bg-red-50 border border-red-100 p-2.5 rounded-xl shadow-sm",
|
|
1070
1950
|
"data-testid": "collections-detail-action-error"
|
|
1071
1951
|
};
|
|
1072
|
-
var _hoisted_11 = { class: "grid grid-cols-1 sm:grid-cols-2 gap-x-6 gap-y-4 bg-white rounded-2xl border border-slate-200/60 p-6 shadow-sm" };
|
|
1073
|
-
var _hoisted_12 = ["for"];
|
|
1074
|
-
var _hoisted_13 = {
|
|
1952
|
+
var _hoisted_11$4 = { class: "grid grid-cols-1 sm:grid-cols-2 gap-x-6 gap-y-4 bg-white rounded-2xl border border-slate-200/60 p-6 shadow-sm" };
|
|
1953
|
+
var _hoisted_12$4 = ["for"];
|
|
1954
|
+
var _hoisted_13$3 = {
|
|
1075
1955
|
key: 0,
|
|
1076
1956
|
class: "text-rose-500 font-bold"
|
|
1077
1957
|
};
|
|
1078
|
-
var _hoisted_14 = {
|
|
1958
|
+
var _hoisted_14$3 = {
|
|
1079
1959
|
key: 0,
|
|
1080
1960
|
class: "inline-flex items-center gap-2.5 text-sm text-slate-700 cursor-pointer select-none"
|
|
1081
1961
|
};
|
|
1082
|
-
var _hoisted_15 = [
|
|
1962
|
+
var _hoisted_15$3 = [
|
|
1083
1963
|
"id",
|
|
1084
1964
|
"onUpdate:modelValue",
|
|
1085
1965
|
"data-testid",
|
|
1086
1966
|
"onChange"
|
|
1087
1967
|
];
|
|
1088
|
-
var _hoisted_16 = [
|
|
1968
|
+
var _hoisted_16$2 = [
|
|
1089
1969
|
"id",
|
|
1090
1970
|
"onUpdate:modelValue",
|
|
1091
1971
|
"required",
|
|
1092
1972
|
"data-testid"
|
|
1093
1973
|
];
|
|
1094
|
-
var _hoisted_17 = { value: "" };
|
|
1095
|
-
var _hoisted_18 = ["value"];
|
|
1096
|
-
var _hoisted_19 = [
|
|
1974
|
+
var _hoisted_17$2 = { value: "" };
|
|
1975
|
+
var _hoisted_18$2 = ["value"];
|
|
1976
|
+
var _hoisted_19$2 = [
|
|
1097
1977
|
"id",
|
|
1098
1978
|
"onUpdate:modelValue",
|
|
1099
1979
|
"required",
|
|
1100
1980
|
"data-testid"
|
|
1101
1981
|
];
|
|
1102
|
-
var _hoisted_20 = { value: "" };
|
|
1103
|
-
var _hoisted_21 = ["value"];
|
|
1104
|
-
var _hoisted_22 = ["data-testid"];
|
|
1105
|
-
var _hoisted_23 = {
|
|
1982
|
+
var _hoisted_20$2 = { value: "" };
|
|
1983
|
+
var _hoisted_21$2 = ["value"];
|
|
1984
|
+
var _hoisted_22$2 = ["data-testid"];
|
|
1985
|
+
var _hoisted_23$2 = {
|
|
1106
1986
|
key: 0,
|
|
1107
1987
|
class: "overflow-hidden border border-slate-200 rounded-lg shadow-sm"
|
|
1108
1988
|
};
|
|
1109
|
-
var _hoisted_24 = { class: "w-full text-xs text-slate-600 bg-white" };
|
|
1110
|
-
var _hoisted_25 = { class: "bg-slate-50 border-b border-slate-200 text-slate-500 font-bold uppercase tracking-wider" };
|
|
1111
|
-
var _hoisted_26 = { class: "divide-y divide-slate-100" };
|
|
1112
|
-
var _hoisted_27 = ["onUpdate:modelValue", "onChange"];
|
|
1113
|
-
var _hoisted_28 = ["onUpdate:modelValue", "required"];
|
|
1114
|
-
var _hoisted_29 = { value: "" };
|
|
1115
|
-
var _hoisted_30 = ["value"];
|
|
1116
|
-
var _hoisted_31 = ["onUpdate:modelValue", "required"];
|
|
1117
|
-
var _hoisted_32 = { value: "" };
|
|
1118
|
-
var _hoisted_33 = ["value"];
|
|
1119
|
-
var _hoisted_34 = {
|
|
1989
|
+
var _hoisted_24$1 = { class: "w-full text-xs text-slate-600 bg-white" };
|
|
1990
|
+
var _hoisted_25$1 = { class: "bg-slate-50 border-b border-slate-200 text-slate-500 font-bold uppercase tracking-wider" };
|
|
1991
|
+
var _hoisted_26$1 = { class: "divide-y divide-slate-100" };
|
|
1992
|
+
var _hoisted_27$1 = ["onUpdate:modelValue", "onChange"];
|
|
1993
|
+
var _hoisted_28$1 = ["onUpdate:modelValue", "required"];
|
|
1994
|
+
var _hoisted_29$1 = { value: "" };
|
|
1995
|
+
var _hoisted_30$1 = ["value"];
|
|
1996
|
+
var _hoisted_31$1 = ["onUpdate:modelValue", "required"];
|
|
1997
|
+
var _hoisted_32$1 = { value: "" };
|
|
1998
|
+
var _hoisted_33$1 = ["value"];
|
|
1999
|
+
var _hoisted_34$1 = {
|
|
1120
2000
|
key: 3,
|
|
1121
2001
|
class: "relative flex items-center"
|
|
1122
2002
|
};
|
|
1123
|
-
var _hoisted_35 = { class: "absolute left-1.5 text-[10px] text-slate-400 font-bold pr-1 border-r border-slate-200" };
|
|
1124
|
-
var _hoisted_36 = ["onUpdate:modelValue", "required"];
|
|
1125
|
-
var _hoisted_37 = [
|
|
2003
|
+
var _hoisted_35$1 = { class: "absolute left-1.5 text-[10px] text-slate-400 font-bold pr-1 border-r border-slate-200" };
|
|
2004
|
+
var _hoisted_36$1 = ["onUpdate:modelValue", "required"];
|
|
2005
|
+
var _hoisted_37$1 = [
|
|
1126
2006
|
"onUpdate:modelValue",
|
|
1127
2007
|
"type",
|
|
1128
2008
|
"required"
|
|
1129
2009
|
];
|
|
1130
|
-
var _hoisted_38 = { class: "text-center px-1" };
|
|
1131
|
-
var _hoisted_39 = [
|
|
2010
|
+
var _hoisted_38$1 = { class: "text-center px-1" };
|
|
2011
|
+
var _hoisted_39$1 = [
|
|
1132
2012
|
"aria-label",
|
|
1133
2013
|
"data-testid",
|
|
1134
2014
|
"onClick"
|
|
1135
2015
|
];
|
|
1136
|
-
var _hoisted_40 = {
|
|
2016
|
+
var _hoisted_40$1 = {
|
|
1137
2017
|
key: 1,
|
|
1138
2018
|
class: "text-xs text-slate-400 italic"
|
|
1139
2019
|
};
|
|
1140
|
-
var _hoisted_41 = ["data-testid", "onClick"];
|
|
1141
|
-
var _hoisted_42 = {
|
|
2020
|
+
var _hoisted_41$1 = ["data-testid", "onClick"];
|
|
2021
|
+
var _hoisted_42$1 = {
|
|
1142
2022
|
key: 4,
|
|
1143
2023
|
class: "relative flex items-center"
|
|
1144
2024
|
};
|
|
1145
|
-
var _hoisted_43 = { class: "absolute left-3 text-slate-400 font-bold text-xs select-none pr-1.5 border-r border-slate-200" };
|
|
1146
|
-
var _hoisted_44 = [
|
|
2025
|
+
var _hoisted_43$1 = { class: "absolute left-3 text-slate-400 font-bold text-xs select-none pr-1.5 border-r border-slate-200" };
|
|
2026
|
+
var _hoisted_44$1 = [
|
|
1147
2027
|
"id",
|
|
1148
2028
|
"onUpdate:modelValue",
|
|
1149
2029
|
"required",
|
|
1150
2030
|
"data-testid"
|
|
1151
2031
|
];
|
|
1152
|
-
var _hoisted_45 = [
|
|
2032
|
+
var _hoisted_45$1 = [
|
|
1153
2033
|
"id",
|
|
1154
2034
|
"onUpdate:modelValue",
|
|
1155
2035
|
"type",
|
|
@@ -1157,77 +2037,77 @@ var _hoisted_45 = [
|
|
|
1157
2037
|
"disabled",
|
|
1158
2038
|
"data-testid"
|
|
1159
2039
|
];
|
|
1160
|
-
var _hoisted_46 = [
|
|
2040
|
+
var _hoisted_46$1 = [
|
|
1161
2041
|
"id",
|
|
1162
2042
|
"onUpdate:modelValue",
|
|
1163
2043
|
"rows",
|
|
1164
2044
|
"required",
|
|
1165
2045
|
"data-testid"
|
|
1166
2046
|
];
|
|
1167
|
-
var _hoisted_47 = ["data-testid"];
|
|
1168
|
-
var _hoisted_48 = {
|
|
2047
|
+
var _hoisted_47$1 = ["data-testid"];
|
|
2048
|
+
var _hoisted_48$1 = {
|
|
1169
2049
|
key: 0,
|
|
1170
2050
|
class: "inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-semibold bg-emerald-50 text-emerald-700 border border-emerald-200/40"
|
|
1171
2051
|
};
|
|
1172
|
-
var _hoisted_49 = {
|
|
2052
|
+
var _hoisted_49$1 = {
|
|
1173
2053
|
key: 1,
|
|
1174
2054
|
class: "inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-semibold bg-slate-50 text-slate-400 border border-slate-200/20"
|
|
1175
2055
|
};
|
|
1176
|
-
var _hoisted_50 = {
|
|
2056
|
+
var _hoisted_50$1 = {
|
|
1177
2057
|
key: 0,
|
|
1178
2058
|
class: "inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-semibold bg-emerald-50 text-emerald-700 border border-emerald-200/40"
|
|
1179
2059
|
};
|
|
1180
|
-
var _hoisted_51 = {
|
|
2060
|
+
var _hoisted_51$1 = {
|
|
1181
2061
|
key: 1,
|
|
1182
2062
|
class: "inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-semibold bg-slate-50 text-slate-400 border border-slate-200/20"
|
|
1183
2063
|
};
|
|
1184
|
-
var _hoisted_52 = {
|
|
2064
|
+
var _hoisted_52$1 = {
|
|
1185
2065
|
key: 2,
|
|
1186
2066
|
class: "text-slate-300"
|
|
1187
2067
|
};
|
|
1188
|
-
var _hoisted_53 = {
|
|
2068
|
+
var _hoisted_53$1 = {
|
|
1189
2069
|
key: 3,
|
|
1190
2070
|
class: "font-semibold text-slate-900 tabular-nums text-sm"
|
|
1191
2071
|
};
|
|
1192
|
-
var _hoisted_54 = {
|
|
2072
|
+
var _hoisted_54$1 = {
|
|
1193
2073
|
key: 4,
|
|
1194
2074
|
class: "inline-block truncate tabular-nums font-bold text-indigo-900 bg-indigo-50/50 px-2 py-0.5 rounded border border-indigo-100/50"
|
|
1195
2075
|
};
|
|
1196
|
-
var _hoisted_55 = {
|
|
2076
|
+
var _hoisted_55$1 = {
|
|
1197
2077
|
key: 5,
|
|
1198
2078
|
class: "border border-slate-200/80 rounded-xl overflow-hidden shadow-sm mt-1"
|
|
1199
2079
|
};
|
|
1200
|
-
var _hoisted_56 = { class: "w-full text-[11px] text-slate-600 bg-white" };
|
|
1201
|
-
var _hoisted_57 = { class: "bg-slate-50 border-b border-slate-200 text-slate-500 font-bold uppercase tracking-wider" };
|
|
1202
|
-
var _hoisted_58 = { class: "divide-y divide-slate-100" };
|
|
1203
|
-
var _hoisted_59 = {
|
|
2080
|
+
var _hoisted_56$1 = { class: "w-full text-[11px] text-slate-600 bg-white" };
|
|
2081
|
+
var _hoisted_57$1 = { class: "bg-slate-50 border-b border-slate-200 text-slate-500 font-bold uppercase tracking-wider" };
|
|
2082
|
+
var _hoisted_58$1 = { class: "divide-y divide-slate-100" };
|
|
2083
|
+
var _hoisted_59$1 = {
|
|
1204
2084
|
key: 0,
|
|
1205
2085
|
class: "material-icons text-emerald-600 text-base"
|
|
1206
2086
|
};
|
|
1207
|
-
var _hoisted_60 = {
|
|
2087
|
+
var _hoisted_60$1 = {
|
|
1208
2088
|
key: 1,
|
|
1209
2089
|
class: "text-slate-300"
|
|
1210
2090
|
};
|
|
1211
|
-
var _hoisted_61 = {
|
|
2091
|
+
var _hoisted_61$1 = {
|
|
1212
2092
|
key: 6,
|
|
1213
2093
|
class: "text-slate-400 italic"
|
|
1214
2094
|
};
|
|
1215
|
-
var _hoisted_62 = {
|
|
2095
|
+
var _hoisted_62$1 = {
|
|
1216
2096
|
key: 7,
|
|
1217
2097
|
class: "bg-slate-50 rounded-xl p-4 border border-slate-200/60 text-slate-600 text-xs whitespace-pre-wrap leading-relaxed max-h-[30vh] overflow-y-auto"
|
|
1218
2098
|
};
|
|
1219
|
-
var _hoisted_63 = [
|
|
2099
|
+
var _hoisted_63$1 = [
|
|
1220
2100
|
"src",
|
|
1221
2101
|
"alt",
|
|
1222
2102
|
"data-testid"
|
|
1223
2103
|
];
|
|
1224
|
-
var _hoisted_64 = ["href", "data-testid"];
|
|
1225
|
-
var _hoisted_65 = ["href", "data-testid"];
|
|
1226
|
-
var _hoisted_66 = {
|
|
2104
|
+
var _hoisted_64$1 = ["href", "data-testid"];
|
|
2105
|
+
var _hoisted_65$1 = ["href", "data-testid"];
|
|
2106
|
+
var _hoisted_66$1 = {
|
|
1227
2107
|
key: 13,
|
|
1228
2108
|
class: "text-slate-800 font-semibold"
|
|
1229
2109
|
};
|
|
1230
|
-
var _hoisted_67 = {
|
|
2110
|
+
var _hoisted_67$1 = {
|
|
1231
2111
|
key: 0,
|
|
1232
2112
|
class: "col-span-full text-xs font-semibold text-red-600 bg-red-50 border border-red-100 p-2.5 rounded-xl"
|
|
1233
2113
|
};
|
|
@@ -1266,7 +2146,7 @@ var CollectionRecordPanel_default = /* @__PURE__ */ defineComponent({
|
|
|
1266
2146
|
const props = __props;
|
|
1267
2147
|
const editing = useModel(__props, "editing");
|
|
1268
2148
|
const emit = __emit;
|
|
1269
|
-
const { t } =
|
|
2149
|
+
const { t } = useCollectionI18n();
|
|
1270
2150
|
const embedViews = computed(() => props.render.embedViews.value);
|
|
1271
2151
|
/** The record the read-only displays render from: the live draft while
|
|
1272
2152
|
* editing (so non-editable cells like derived/embed preview the in-flight
|
|
@@ -1349,10 +2229,10 @@ var CollectionRecordPanel_default = /* @__PURE__ */ defineComponent({
|
|
|
1349
2229
|
onSubmit: _cache[4] || (_cache[4] = withModifiers(($event) => emit("submit"), ["prevent"]))
|
|
1350
2230
|
}, {
|
|
1351
2231
|
default: withCtx(() => [
|
|
1352
|
-
createElementVNode("div", _hoisted_1, [createElementVNode("div", _hoisted_2, [createElementVNode("span", _hoisted_3, toDisplayString(__props.collection.title), 1), createElementVNode("h2", {
|
|
2232
|
+
createElementVNode("div", _hoisted_1$5, [createElementVNode("div", _hoisted_2$5, [createElementVNode("span", _hoisted_3$5, toDisplayString(__props.collection.title), 1), createElementVNode("h2", {
|
|
1353
2233
|
class: "text-base font-bold text-slate-800 truncate",
|
|
1354
2234
|
"data-testid": editing.value ? "collections-edit-title" : "collections-detail-title"
|
|
1355
|
-
}, toDisplayString(headerTitle.value), 9, _hoisted_4)]), editing.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("button", {
|
|
2235
|
+
}, toDisplayString(headerTitle.value), 9, _hoisted_4$5)]), editing.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("button", {
|
|
1356
2236
|
type: "button",
|
|
1357
2237
|
class: "h-8 px-2.5 rounded text-xs font-bold text-slate-500 hover:bg-slate-200/50 transition-colors",
|
|
1358
2238
|
"data-testid": "collections-editor-cancel",
|
|
@@ -1362,7 +2242,7 @@ var CollectionRecordPanel_default = /* @__PURE__ */ defineComponent({
|
|
|
1362
2242
|
class: "h-8 px-2.5 rounded bg-indigo-600 text-white font-bold text-xs hover:bg-indigo-700 disabled:opacity-50 transition-all shadow-sm shadow-indigo-600/10",
|
|
1363
2243
|
disabled: __props.saving,
|
|
1364
2244
|
"data-testid": "collections-editor-save"
|
|
1365
|
-
}, toDisplayString(__props.saving ? unref(t)("common.saving") : unref(t)("common.save")), 9, _hoisted_5)], 64)) : (openBlock(), createElementBlock("div", _hoisted_6, [
|
|
2245
|
+
}, toDisplayString(__props.saving ? unref(t)("common.saving") : unref(t)("common.save")), 9, _hoisted_5$4)], 64)) : (openBlock(), createElementBlock("div", _hoisted_6$4, [
|
|
1366
2246
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.visibleActions, (action) => {
|
|
1367
2247
|
return openBlock(), createElementBlock("button", {
|
|
1368
2248
|
key: action.id,
|
|
@@ -1371,7 +2251,7 @@ var CollectionRecordPanel_default = /* @__PURE__ */ defineComponent({
|
|
|
1371
2251
|
disabled: __props.actionPending,
|
|
1372
2252
|
"data-testid": `collections-detail-action-${action.id}`,
|
|
1373
2253
|
onClick: ($event) => emit("runAction", action)
|
|
1374
|
-
}, [action.icon ? (openBlock(), createElementBlock("span", _hoisted_8, toDisplayString(action.icon), 1)) : createCommentVNode("", true), createElementVNode("span", null, toDisplayString(action.label), 1)], 8, _hoisted_7);
|
|
2254
|
+
}, [action.icon ? (openBlock(), createElementBlock("span", _hoisted_8$4, toDisplayString(action.icon), 1)) : createCommentVNode("", true), createElementVNode("span", null, toDisplayString(action.label), 1)], 8, _hoisted_7$4);
|
|
1375
2255
|
}), 128)),
|
|
1376
2256
|
createElementVNode("button", {
|
|
1377
2257
|
type: "button",
|
|
@@ -1391,57 +2271,57 @@ var CollectionRecordPanel_default = /* @__PURE__ */ defineComponent({
|
|
|
1391
2271
|
"aria-label": unref(t)("common.close"),
|
|
1392
2272
|
"data-testid": "collections-detail-close",
|
|
1393
2273
|
onClick: _cache[3] || (_cache[3] = ($event) => emit("close"))
|
|
1394
|
-
}, [..._cache[7] || (_cache[7] = [createElementVNode("span", { class: "material-icons text-lg" }, "close", -1)])], 8, _hoisted_9)
|
|
2274
|
+
}, [..._cache[7] || (_cache[7] = [createElementVNode("span", { class: "material-icons text-lg" }, "close", -1)])], 8, _hoisted_9$4)
|
|
1395
2275
|
]))]),
|
|
1396
|
-
!editing.value && __props.actionError ? (openBlock(), createElementBlock("p", _hoisted_10, toDisplayString(__props.actionError), 1)) : createCommentVNode("", true),
|
|
1397
|
-
createElementVNode("div", _hoisted_11, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.collection.schema.fields, (field, key) => {
|
|
2276
|
+
!editing.value && __props.actionError ? (openBlock(), createElementBlock("p", _hoisted_10$4, toDisplayString(__props.actionError), 1)) : createCommentVNode("", true),
|
|
2277
|
+
createElementVNode("div", _hoisted_11$4, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.collection.schema.fields, (field, key) => {
|
|
1398
2278
|
return openBlock(), createElementBlock(Fragment, { key }, [cellVisible(field) ? (openBlock(), createElementBlock("div", {
|
|
1399
2279
|
key: 0,
|
|
1400
2280
|
class: normalizeClass(["flex flex-col gap-1.5", colSpanClass(field)])
|
|
1401
2281
|
}, [createElementVNode("label", {
|
|
1402
2282
|
class: "text-[10px] font-bold text-slate-400 uppercase tracking-wider flex items-center gap-1",
|
|
1403
2283
|
for: `collections-field-${key}`
|
|
1404
|
-
}, [createTextVNode(toDisplayString(field.label) + " ", 1), editing.value && field.required ? (openBlock(), createElementBlock("span", _hoisted_13, "*")) : createCommentVNode("", true)], 8, _hoisted_12), editing.value && isEditableType(field.type) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [field.type === "boolean" ? (openBlock(), createElementBlock("label", _hoisted_14, [withDirectives(createElementVNode("input", {
|
|
2284
|
+
}, [createTextVNode(toDisplayString(field.label) + " ", 1), editing.value && field.required ? (openBlock(), createElementBlock("span", _hoisted_13$3, "*")) : createCommentVNode("", true)], 8, _hoisted_12$4), editing.value && isEditableType(field.type) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [field.type === "boolean" ? (openBlock(), createElementBlock("label", _hoisted_14$3, [withDirectives(createElementVNode("input", {
|
|
1405
2285
|
id: `collections-field-${key}`,
|
|
1406
2286
|
"onUpdate:modelValue": ($event) => editing.value.bool[key] = $event,
|
|
1407
2287
|
type: "checkbox",
|
|
1408
2288
|
class: "h-5 w-5 rounded border-slate-300 text-indigo-600 focus:ring-indigo-500/20 cursor-pointer",
|
|
1409
2289
|
"data-testid": `collections-input-${key}`,
|
|
1410
2290
|
onChange: ($event) => markBoolTouched(String(key))
|
|
1411
|
-
}, null, 40, _hoisted_15), [[vModelCheckbox, editing.value.bool[key]]]), createElementVNode("span", { class: normalizeClass(["text-xs font-semibold", editing.value.bool[key] ? "text-indigo-600" : "text-slate-500"]) }, toDisplayString(editing.value.bool[key] ? unref(t)("common.yes") : unref(t)("common.no")), 3)])) : field.type === "ref" && field.to && __props.render.refOptions(field.to).length > 0 ? withDirectives((openBlock(), createElementBlock("select", {
|
|
2291
|
+
}, null, 40, _hoisted_15$3), [[vModelCheckbox, editing.value.bool[key]]]), createElementVNode("span", { class: normalizeClass(["text-xs font-semibold", editing.value.bool[key] ? "text-indigo-600" : "text-slate-500"]) }, toDisplayString(editing.value.bool[key] ? unref(t)("common.yes") : unref(t)("common.no")), 3)])) : field.type === "ref" && field.to && __props.render.refOptions(field.to).length > 0 ? withDirectives((openBlock(), createElementBlock("select", {
|
|
1412
2292
|
key: 1,
|
|
1413
2293
|
id: `collections-field-${key}`,
|
|
1414
2294
|
"onUpdate:modelValue": ($event) => editing.value.text[key] = $event,
|
|
1415
2295
|
required: isFieldRequiredInUi(field),
|
|
1416
2296
|
class: "w-full rounded-xl border border-slate-200 px-3 py-2 text-xs bg-slate-50 hover:bg-slate-50/50 focus:bg-white focus:border-indigo-500 focus:ring-2 focus:ring-indigo-500/20 focus:outline-none transition-all cursor-pointer font-medium text-slate-700",
|
|
1417
2297
|
"data-testid": `collections-input-${key}`
|
|
1418
|
-
}, [createElementVNode("option", _hoisted_17, toDisplayString(unref(t)("collectionsView.selectPlaceholder")), 1), (openBlock(true), createElementBlock(Fragment, null, renderList(__props.render.refOptions(field.to), (opt) => {
|
|
2298
|
+
}, [createElementVNode("option", _hoisted_17$2, toDisplayString(unref(t)("collectionsView.selectPlaceholder")), 1), (openBlock(true), createElementBlock(Fragment, null, renderList(__props.render.refOptions(field.to), (opt) => {
|
|
1419
2299
|
return openBlock(), createElementBlock("option", {
|
|
1420
2300
|
key: opt.slug,
|
|
1421
2301
|
value: opt.slug
|
|
1422
|
-
}, toDisplayString(opt.display), 9, _hoisted_18);
|
|
1423
|
-
}), 128))], 8, _hoisted_16)), [[vModelSelect, editing.value.text[key]]]) : field.type === "enum" && Array.isArray(field.values) && field.values.length > 0 ? withDirectives((openBlock(), createElementBlock("select", {
|
|
2302
|
+
}, toDisplayString(opt.display), 9, _hoisted_18$2);
|
|
2303
|
+
}), 128))], 8, _hoisted_16$2)), [[vModelSelect, editing.value.text[key]]]) : field.type === "enum" && Array.isArray(field.values) && field.values.length > 0 ? withDirectives((openBlock(), createElementBlock("select", {
|
|
1424
2304
|
key: 2,
|
|
1425
2305
|
id: `collections-field-${key}`,
|
|
1426
2306
|
"onUpdate:modelValue": ($event) => editing.value.text[key] = $event,
|
|
1427
2307
|
required: isFieldRequiredInUi(field),
|
|
1428
2308
|
class: normalizeClass(["w-full rounded-xl border px-3 py-2 text-xs focus:bg-white focus:border-indigo-500 focus:ring-2 focus:ring-indigo-500/20 focus:outline-none transition-all cursor-pointer font-medium", enumControlClass(String(key), editing.value.text[key])]),
|
|
1429
2309
|
"data-testid": `collections-input-${key}`
|
|
1430
|
-
}, [createElementVNode("option", _hoisted_20, toDisplayString(unref(t)("collectionsView.selectPlaceholder")), 1), (openBlock(true), createElementBlock(Fragment, null, renderList(field.values, (value) => {
|
|
2310
|
+
}, [createElementVNode("option", _hoisted_20$2, toDisplayString(unref(t)("collectionsView.selectPlaceholder")), 1), (openBlock(true), createElementBlock(Fragment, null, renderList(field.values, (value) => {
|
|
1431
2311
|
return openBlock(), createElementBlock("option", {
|
|
1432
2312
|
key: value,
|
|
1433
2313
|
value
|
|
1434
|
-
}, toDisplayString(value), 9, _hoisted_21);
|
|
1435
|
-
}), 128))], 10, _hoisted_19)), [[vModelSelect, editing.value.text[key]]]) : field.type === "table" && field.of ? (openBlock(), createElementBlock("div", {
|
|
2314
|
+
}, toDisplayString(value), 9, _hoisted_21$2);
|
|
2315
|
+
}), 128))], 10, _hoisted_19$2)), [[vModelSelect, editing.value.text[key]]]) : field.type === "table" && field.of ? (openBlock(), createElementBlock("div", {
|
|
1436
2316
|
key: 3,
|
|
1437
2317
|
class: "border border-slate-200 bg-slate-50/30 rounded-xl p-4 space-y-3",
|
|
1438
2318
|
"data-testid": `collections-table-${key}`
|
|
1439
|
-
}, [editing.value.table[key] && editing.value.table[key].length > 0 ? (openBlock(), createElementBlock("div", _hoisted_23, [createElementVNode("table", _hoisted_24, [createElementVNode("thead", _hoisted_25, [createElementVNode("tr", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(field.of, (subField, subKey) => {
|
|
2319
|
+
}, [editing.value.table[key] && editing.value.table[key].length > 0 ? (openBlock(), createElementBlock("div", _hoisted_23$2, [createElementVNode("table", _hoisted_24$1, [createElementVNode("thead", _hoisted_25$1, [createElementVNode("tr", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(field.of, (subField, subKey) => {
|
|
1440
2320
|
return openBlock(), createElementBlock("th", {
|
|
1441
2321
|
key: subKey,
|
|
1442
2322
|
class: "text-left px-3 py-2 font-bold"
|
|
1443
2323
|
}, toDisplayString(subField.label), 1);
|
|
1444
|
-
}), 128)), _cache[8] || (_cache[8] = createElementVNode("th", { class: "w-9" }, null, -1))])]), createElementVNode("tbody", _hoisted_26, [(openBlock(true), createElementBlock(Fragment, null, renderList(editing.value.table[key], (row, rowIdx) => {
|
|
2324
|
+
}), 128)), _cache[8] || (_cache[8] = createElementVNode("th", { class: "w-9" }, null, -1))])]), createElementVNode("tbody", _hoisted_26$1, [(openBlock(true), createElementBlock(Fragment, null, renderList(editing.value.table[key], (row, rowIdx) => {
|
|
1445
2325
|
return openBlock(), createElementBlock("tr", {
|
|
1446
2326
|
key: rowIdx,
|
|
1447
2327
|
class: "hover:bg-slate-50/50"
|
|
@@ -1455,52 +2335,52 @@ var CollectionRecordPanel_default = /* @__PURE__ */ defineComponent({
|
|
|
1455
2335
|
type: "checkbox",
|
|
1456
2336
|
class: "h-4 w-4 rounded border-slate-300 text-indigo-600 focus:ring-indigo-500/20 cursor-pointer",
|
|
1457
2337
|
onChange: ($event) => markRowBoolTouched(row, String(subKey))
|
|
1458
|
-
}, null, 40, _hoisted_27)), [[vModelCheckbox, row.bool[subKey]]]) : subField.type === "enum" && Array.isArray(subField.values) && subField.values.length > 0 ? withDirectives((openBlock(), createElementBlock("select", {
|
|
2338
|
+
}, null, 40, _hoisted_27$1)), [[vModelCheckbox, row.bool[subKey]]]) : subField.type === "enum" && Array.isArray(subField.values) && subField.values.length > 0 ? withDirectives((openBlock(), createElementBlock("select", {
|
|
1459
2339
|
key: 1,
|
|
1460
2340
|
"onUpdate:modelValue": ($event) => row.text[subKey] = $event,
|
|
1461
2341
|
required: subField.required,
|
|
1462
2342
|
class: "w-full rounded-lg border border-slate-200 px-2 py-1 text-xs focus:border-indigo-500 focus:outline-none cursor-pointer bg-slate-50 font-medium"
|
|
1463
|
-
}, [createElementVNode("option", _hoisted_29, toDisplayString(unref(t)("collectionsView.selectPlaceholder")), 1), (openBlock(true), createElementBlock(Fragment, null, renderList(subField.values, (value) => {
|
|
2343
|
+
}, [createElementVNode("option", _hoisted_29$1, toDisplayString(unref(t)("collectionsView.selectPlaceholder")), 1), (openBlock(true), createElementBlock(Fragment, null, renderList(subField.values, (value) => {
|
|
1464
2344
|
return openBlock(), createElementBlock("option", {
|
|
1465
2345
|
key: value,
|
|
1466
2346
|
value
|
|
1467
|
-
}, toDisplayString(value), 9, _hoisted_30);
|
|
1468
|
-
}), 128))], 8, _hoisted_28)), [[vModelSelect, row.text[subKey]]]) : subField.type === "ref" && subField.to && __props.render.refOptions(subField.to).length > 0 ? withDirectives((openBlock(), createElementBlock("select", {
|
|
2347
|
+
}, toDisplayString(value), 9, _hoisted_30$1);
|
|
2348
|
+
}), 128))], 8, _hoisted_28$1)), [[vModelSelect, row.text[subKey]]]) : subField.type === "ref" && subField.to && __props.render.refOptions(subField.to).length > 0 ? withDirectives((openBlock(), createElementBlock("select", {
|
|
1469
2349
|
key: 2,
|
|
1470
2350
|
"onUpdate:modelValue": ($event) => row.text[subKey] = $event,
|
|
1471
2351
|
required: subField.required,
|
|
1472
2352
|
class: "w-full rounded-lg border border-slate-200 px-2 py-1 text-xs focus:border-indigo-500 focus:outline-none cursor-pointer bg-slate-50 font-medium"
|
|
1473
|
-
}, [createElementVNode("option", _hoisted_32, toDisplayString(unref(t)("collectionsView.selectPlaceholder")), 1), (openBlock(true), createElementBlock(Fragment, null, renderList(__props.render.refOptions(subField.to), (opt) => {
|
|
2353
|
+
}, [createElementVNode("option", _hoisted_32$1, toDisplayString(unref(t)("collectionsView.selectPlaceholder")), 1), (openBlock(true), createElementBlock(Fragment, null, renderList(__props.render.refOptions(subField.to), (opt) => {
|
|
1474
2354
|
return openBlock(), createElementBlock("option", {
|
|
1475
2355
|
key: opt.slug,
|
|
1476
2356
|
value: opt.slug
|
|
1477
|
-
}, toDisplayString(opt.display), 9, _hoisted_33);
|
|
1478
|
-
}), 128))], 8, _hoisted_31)), [[vModelSelect, row.text[subKey]]]) : subField.type === "money" ? (openBlock(), createElementBlock("div", _hoisted_34, [createElementVNode("span", _hoisted_35, toDisplayString(__props.render.currencySymbol(__props.render.resolveCurrency(subField, __props.liveRecord))), 1), withDirectives(createElementVNode("input", {
|
|
2357
|
+
}, toDisplayString(opt.display), 9, _hoisted_33$1);
|
|
2358
|
+
}), 128))], 8, _hoisted_31$1)), [[vModelSelect, row.text[subKey]]]) : subField.type === "money" ? (openBlock(), createElementBlock("div", _hoisted_34$1, [createElementVNode("span", _hoisted_35$1, toDisplayString(__props.render.currencySymbol(__props.render.resolveCurrency(subField, __props.liveRecord))), 1), withDirectives(createElementVNode("input", {
|
|
1479
2359
|
"onUpdate:modelValue": ($event) => row.text[subKey] = $event,
|
|
1480
2360
|
type: "number",
|
|
1481
2361
|
step: "0.01",
|
|
1482
2362
|
required: subField.required,
|
|
1483
2363
|
class: "w-full rounded-lg border border-slate-200 pl-6 pr-1.5 py-1 text-xs focus:border-indigo-500 focus:outline-none font-semibold text-slate-800"
|
|
1484
|
-
}, null, 8, _hoisted_36), [[vModelText, row.text[subKey]]])])) : withDirectives((openBlock(), createElementBlock("input", {
|
|
2364
|
+
}, null, 8, _hoisted_36$1), [[vModelText, row.text[subKey]]])])) : withDirectives((openBlock(), createElementBlock("input", {
|
|
1485
2365
|
key: 4,
|
|
1486
2366
|
"onUpdate:modelValue": ($event) => row.text[subKey] = $event,
|
|
1487
2367
|
type: __props.render.inputTypeFor(subField.type),
|
|
1488
2368
|
required: subField.required,
|
|
1489
2369
|
class: "w-full rounded-lg border border-slate-200 px-2 py-1 text-xs focus:border-indigo-500 focus:outline-none font-medium text-slate-700"
|
|
1490
|
-
}, null, 8, _hoisted_37)), [[vModelDynamic, row.text[subKey]]])]);
|
|
1491
|
-
}), 128)), createElementVNode("td", _hoisted_38, [createElementVNode("button", {
|
|
2370
|
+
}, null, 8, _hoisted_37$1)), [[vModelDynamic, row.text[subKey]]])]);
|
|
2371
|
+
}), 128)), createElementVNode("td", _hoisted_38$1, [createElementVNode("button", {
|
|
1492
2372
|
type: "button",
|
|
1493
2373
|
class: "h-7 w-7 flex items-center justify-center rounded-lg text-slate-400 hover:text-rose-600 hover:bg-rose-50 transition-colors",
|
|
1494
2374
|
"aria-label": unref(t)("collectionsView.removeRow"),
|
|
1495
2375
|
"data-testid": `collections-table-${key}-remove-${rowIdx}`,
|
|
1496
2376
|
onClick: ($event) => removeTableRow(String(key), rowIdx)
|
|
1497
|
-
}, [..._cache[9] || (_cache[9] = [createElementVNode("span", { class: "material-icons text-base" }, "close", -1)])], 8, _hoisted_39)])]);
|
|
1498
|
-
}), 128))])])])) : (openBlock(), createElementBlock("p", _hoisted_40, toDisplayString(unref(t)("collectionsView.noRows")), 1)), createElementVNode("button", {
|
|
2377
|
+
}, [..._cache[9] || (_cache[9] = [createElementVNode("span", { class: "material-icons text-base" }, "close", -1)])], 8, _hoisted_39$1)])]);
|
|
2378
|
+
}), 128))])])])) : (openBlock(), createElementBlock("p", _hoisted_40$1, toDisplayString(unref(t)("collectionsView.noRows")), 1)), createElementVNode("button", {
|
|
1499
2379
|
type: "button",
|
|
1500
2380
|
class: "inline-flex items-center gap-1 text-xs text-indigo-600 hover:text-indigo-800 font-bold hover:underline",
|
|
1501
2381
|
"data-testid": `collections-table-${key}-add`,
|
|
1502
2382
|
onClick: ($event) => addTableRow(String(key), field.of)
|
|
1503
|
-
}, [_cache[10] || (_cache[10] = createElementVNode("span", { class: "material-icons text-xs" }, "add", -1)), createElementVNode("span", null, toDisplayString(unref(t)("collectionsView.addRow")), 1)], 8, _hoisted_41)], 8, _hoisted_22)) : field.type === "money" ? (openBlock(), createElementBlock("div", _hoisted_42, [createElementVNode("div", _hoisted_43, toDisplayString(__props.render.currencySymbol(__props.render.resolveCurrency(field, __props.liveRecord))), 1), withDirectives(createElementVNode("input", {
|
|
2383
|
+
}, [_cache[10] || (_cache[10] = createElementVNode("span", { class: "material-icons text-xs" }, "add", -1)), createElementVNode("span", null, toDisplayString(unref(t)("collectionsView.addRow")), 1)], 8, _hoisted_41$1)], 8, _hoisted_22$2)) : field.type === "money" ? (openBlock(), createElementBlock("div", _hoisted_42$1, [createElementVNode("div", _hoisted_43$1, toDisplayString(__props.render.currencySymbol(__props.render.resolveCurrency(field, __props.liveRecord))), 1), withDirectives(createElementVNode("input", {
|
|
1504
2384
|
id: `collections-field-${key}`,
|
|
1505
2385
|
"onUpdate:modelValue": ($event) => editing.value.text[key] = $event,
|
|
1506
2386
|
type: "number",
|
|
@@ -1508,7 +2388,7 @@ var CollectionRecordPanel_default = /* @__PURE__ */ defineComponent({
|
|
|
1508
2388
|
required: isFieldRequiredInUi(field),
|
|
1509
2389
|
class: "w-full rounded-xl border border-slate-200 pl-11 pr-3 py-2 text-xs focus:border-indigo-500 focus:ring-2 focus:ring-indigo-500/20 focus:outline-none font-semibold text-slate-800 transition-all",
|
|
1510
2390
|
"data-testid": `collections-input-${key}`
|
|
1511
|
-
}, null, 8, _hoisted_44), [[vModelText, editing.value.text[key]]])])) : [
|
|
2391
|
+
}, null, 8, _hoisted_44$1), [[vModelText, editing.value.text[key]]])])) : [
|
|
1512
2392
|
"string",
|
|
1513
2393
|
"email",
|
|
1514
2394
|
"number",
|
|
@@ -1526,7 +2406,7 @@ var CollectionRecordPanel_default = /* @__PURE__ */ defineComponent({
|
|
|
1526
2406
|
disabled: field.primary === true && (editing.value.mode === "edit" || __props.isSingleton),
|
|
1527
2407
|
class: "w-full rounded-xl border border-slate-200 px-3 py-2 text-xs focus:border-indigo-500 focus:ring-2 focus:ring-indigo-500/20 focus:outline-none disabled:bg-slate-100 disabled:text-slate-400 font-medium text-slate-700 transition-all",
|
|
1528
2408
|
"data-testid": `collections-input-${key}`
|
|
1529
|
-
}, null, 8, _hoisted_45)), [[vModelDynamic, editing.value.text[key]]]) : withDirectives((openBlock(), createElementBlock("textarea", {
|
|
2409
|
+
}, null, 8, _hoisted_45$1)), [[vModelDynamic, editing.value.text[key]]]) : withDirectives((openBlock(), createElementBlock("textarea", {
|
|
1530
2410
|
key: 6,
|
|
1531
2411
|
id: `collections-field-${key}`,
|
|
1532
2412
|
"onUpdate:modelValue": ($event) => editing.value.text[key] = $event,
|
|
@@ -1534,11 +2414,11 @@ var CollectionRecordPanel_default = /* @__PURE__ */ defineComponent({
|
|
|
1534
2414
|
required: isFieldRequiredInUi(field),
|
|
1535
2415
|
class: "w-full rounded-xl border border-slate-200 px-3 py-2 text-xs focus:border-indigo-500 focus:ring-2 focus:ring-indigo-500/20 focus:outline-none font-medium text-slate-700 transition-all",
|
|
1536
2416
|
"data-testid": `collections-input-${key}`
|
|
1537
|
-
}, null, 8, _hoisted_46)), [[vModelText, editing.value.text[key]]])], 64)) : (openBlock(), createElementBlock("div", {
|
|
2417
|
+
}, null, 8, _hoisted_46$1)), [[vModelText, editing.value.text[key]]])], 64)) : (openBlock(), createElementBlock("div", {
|
|
1538
2418
|
key: 1,
|
|
1539
2419
|
class: "text-xs font-medium text-slate-700 break-words",
|
|
1540
2420
|
"data-testid": `collections-detail-value-${key}`
|
|
1541
|
-
}, [field.type === "toggle" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [field.field !== void 0 && String(detailRecord.value[field.field] ?? "") === field.onValue ? (openBlock(), createElementBlock("span", _hoisted_48, [_cache[11] || (_cache[11] = createElementVNode("span", { class: "h-1.5 w-1.5 rounded-full bg-emerald-500" }, null, -1)), createTextVNode(" " + toDisplayString(unref(t)("common.yes")), 1)])) : (openBlock(), createElementBlock("span", _hoisted_49, toDisplayString(unref(t)("common.no")), 1))], 64)) : field.type === "boolean" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [detailRecord.value[key] === true ? (openBlock(), createElementBlock("span", _hoisted_50, [_cache[12] || (_cache[12] = createElementVNode("span", { class: "h-1.5 w-1.5 rounded-full bg-emerald-500" }, null, -1)), createTextVNode(" " + toDisplayString(unref(t)("common.yes")), 1)])) : detailRecord.value[key] === false ? (openBlock(), createElementBlock("span", _hoisted_51, toDisplayString(unref(t)("common.no")), 1)) : (openBlock(), createElementBlock("span", _hoisted_52, "—"))], 64)) : field.type === "ref" && field.to && typeof detailRecord.value[key] === "string" && detailRecord.value[key] ? (openBlock(), createBlock(_component_router_link, {
|
|
2421
|
+
}, [field.type === "toggle" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [field.field !== void 0 && String(detailRecord.value[field.field] ?? "") === field.onValue ? (openBlock(), createElementBlock("span", _hoisted_48$1, [_cache[11] || (_cache[11] = createElementVNode("span", { class: "h-1.5 w-1.5 rounded-full bg-emerald-500" }, null, -1)), createTextVNode(" " + toDisplayString(unref(t)("common.yes")), 1)])) : (openBlock(), createElementBlock("span", _hoisted_49$1, toDisplayString(unref(t)("common.no")), 1))], 64)) : field.type === "boolean" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [detailRecord.value[key] === true ? (openBlock(), createElementBlock("span", _hoisted_50$1, [_cache[12] || (_cache[12] = createElementVNode("span", { class: "h-1.5 w-1.5 rounded-full bg-emerald-500" }, null, -1)), createTextVNode(" " + toDisplayString(unref(t)("common.yes")), 1)])) : detailRecord.value[key] === false ? (openBlock(), createElementBlock("span", _hoisted_51$1, toDisplayString(unref(t)("common.no")), 1)) : (openBlock(), createElementBlock("span", _hoisted_52$1, "—"))], 64)) : field.type === "ref" && field.to && typeof detailRecord.value[key] === "string" && detailRecord.value[key] ? (openBlock(), createBlock(_component_router_link, {
|
|
1542
2422
|
key: 2,
|
|
1543
2423
|
to: {
|
|
1544
2424
|
path: `/collections/${field.to}`,
|
|
@@ -1549,12 +2429,12 @@ var CollectionRecordPanel_default = /* @__PURE__ */ defineComponent({
|
|
|
1549
2429
|
}, {
|
|
1550
2430
|
default: withCtx(() => [createTextVNode(toDisplayString(__props.render.refDisplay(field.to, String(detailRecord.value[key]))), 1)]),
|
|
1551
2431
|
_: 2
|
|
1552
|
-
}, 1032, ["to", "data-testid"])) : field.type === "money" ? (openBlock(), createElementBlock("span", _hoisted_53, toDisplayString(__props.render.formatMoney(detailRecord.value[key], __props.render.resolveCurrency(field, detailRecord.value), __props.locale)), 1)) : field.type === "derived" ? (openBlock(), createElementBlock("span", _hoisted_54, toDisplayString(__props.render.derivedDisplay(field, __props.render.evaluateDerivedAgainstItem(field, String(key), detailRecord.value), detailRecord.value)), 1)) : field.type === "table" && field.of && __props.render.hasTableRows(detailRecord.value[key]) ? (openBlock(), createElementBlock("div", _hoisted_55, [createElementVNode("table", _hoisted_56, [createElementVNode("thead", _hoisted_57, [createElementVNode("tr", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(field.of, (subField, subKey) => {
|
|
2432
|
+
}, 1032, ["to", "data-testid"])) : field.type === "money" ? (openBlock(), createElementBlock("span", _hoisted_53$1, toDisplayString(__props.render.formatMoney(detailRecord.value[key], __props.render.resolveCurrency(field, detailRecord.value), __props.locale)), 1)) : field.type === "derived" ? (openBlock(), createElementBlock("span", _hoisted_54$1, toDisplayString(__props.render.derivedDisplay(field, __props.render.evaluateDerivedAgainstItem(field, String(key), detailRecord.value), detailRecord.value)), 1)) : field.type === "table" && field.of && __props.render.hasTableRows(detailRecord.value[key]) ? (openBlock(), createElementBlock("div", _hoisted_55$1, [createElementVNode("table", _hoisted_56$1, [createElementVNode("thead", _hoisted_57$1, [createElementVNode("tr", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(field.of, (subField, subKey) => {
|
|
1553
2433
|
return openBlock(), createElementBlock("th", {
|
|
1554
2434
|
key: subKey,
|
|
1555
2435
|
class: "text-left px-4 py-2 font-bold"
|
|
1556
2436
|
}, toDisplayString(subField.label), 1);
|
|
1557
|
-
}), 128))])]), createElementVNode("tbody", _hoisted_58, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.render.tableRows(detailRecord.value[key]), (row, rowIdx) => {
|
|
2437
|
+
}), 128))])]), createElementVNode("tbody", _hoisted_58$1, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.render.tableRows(detailRecord.value[key]), (row, rowIdx) => {
|
|
1558
2438
|
return openBlock(), createElementBlock("tr", {
|
|
1559
2439
|
key: rowIdx,
|
|
1560
2440
|
class: "hover:bg-slate-50/50"
|
|
@@ -1562,12 +2442,12 @@ var CollectionRecordPanel_default = /* @__PURE__ */ defineComponent({
|
|
|
1562
2442
|
return openBlock(), createElementBlock("td", {
|
|
1563
2443
|
key: subKey,
|
|
1564
2444
|
class: "px-4 py-2 align-middle font-medium"
|
|
1565
|
-
}, [subField.type === "boolean" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [row[subKey] === true ? (openBlock(), createElementBlock("span", _hoisted_59, "check_circle")) : (openBlock(), createElementBlock("span", _hoisted_60, "—"))], 64)) : (openBlock(), createElementBlock("span", {
|
|
2445
|
+
}, [subField.type === "boolean" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [row[subKey] === true ? (openBlock(), createElementBlock("span", _hoisted_59$1, "check_circle")) : (openBlock(), createElementBlock("span", _hoisted_60$1, "—"))], 64)) : (openBlock(), createElementBlock("span", {
|
|
1566
2446
|
key: 1,
|
|
1567
2447
|
class: normalizeClass([subField.type === "money" ? "font-bold text-slate-800 tabular-nums" : ""])
|
|
1568
2448
|
}, toDisplayString(__props.render.formatSubCell(subField, row[subKey], detailRecord.value)), 3))]);
|
|
1569
2449
|
}), 128))]);
|
|
1570
|
-
}), 128))])])])) : field.type === "table" ? (openBlock(), createElementBlock("span", _hoisted_61, toDisplayString(unref(t)("collectionsView.noRows")), 1)) : field.type === "markdown" ? (openBlock(), createElementBlock("div", _hoisted_62, toDisplayString(__props.render.detailText(detailRecord.value[key])), 1)) : field.type === "embed" && embedViews.value[key] ? (openBlock(), createBlock(CollectionEmbedView_default, {
|
|
2450
|
+
}), 128))])])])) : field.type === "table" ? (openBlock(), createElementBlock("span", _hoisted_61$1, toDisplayString(unref(t)("collectionsView.noRows")), 1)) : field.type === "markdown" ? (openBlock(), createElementBlock("div", _hoisted_62$1, toDisplayString(__props.render.detailText(detailRecord.value[key])), 1)) : field.type === "embed" && embedViews.value[key] ? (openBlock(), createBlock(CollectionEmbedView_default, {
|
|
1571
2451
|
key: 8,
|
|
1572
2452
|
view: embedViews.value[key],
|
|
1573
2453
|
"field-key": String(key)
|
|
@@ -1577,21 +2457,21 @@ var CollectionRecordPanel_default = /* @__PURE__ */ defineComponent({
|
|
|
1577
2457
|
alt: field.label,
|
|
1578
2458
|
class: "max-h-64 max-w-full object-contain rounded-lg border border-slate-200 bg-slate-50",
|
|
1579
2459
|
"data-testid": `collections-detail-image-${key}`
|
|
1580
|
-
}, null, 8, _hoisted_63)) : field.type !== "file" && __props.render.isExternalUrl(detailRecord.value[key]) ? (openBlock(), createElementBlock("a", {
|
|
2460
|
+
}, null, 8, _hoisted_63$1)) : field.type !== "file" && __props.render.isExternalUrl(detailRecord.value[key]) ? (openBlock(), createElementBlock("a", {
|
|
1581
2461
|
key: 10,
|
|
1582
2462
|
href: String(detailRecord.value[key]),
|
|
1583
2463
|
target: "_blank",
|
|
1584
2464
|
rel: "noopener noreferrer",
|
|
1585
2465
|
class: "text-blue-600 hover:text-blue-800 font-semibold hover:underline break-all",
|
|
1586
2466
|
"data-testid": `collections-detail-url-${key}`
|
|
1587
|
-
}, toDisplayString(String(detailRecord.value[key])), 9, _hoisted_64)) : field.type === "file" && __props.render.artifactUrl(detailRecord.value[key]) ? (openBlock(), createElementBlock("a", {
|
|
2467
|
+
}, toDisplayString(String(detailRecord.value[key])), 9, _hoisted_64$1)) : field.type === "file" && __props.render.artifactUrl(detailRecord.value[key]) ? (openBlock(), createElementBlock("a", {
|
|
1588
2468
|
key: 11,
|
|
1589
2469
|
href: __props.render.artifactUrl(detailRecord.value[key]) ?? void 0,
|
|
1590
2470
|
target: "_blank",
|
|
1591
2471
|
rel: "noopener noreferrer",
|
|
1592
2472
|
class: "text-blue-600 hover:text-blue-800 font-semibold hover:underline break-all",
|
|
1593
2473
|
"data-testid": `collections-detail-file-${key}`
|
|
1594
|
-
}, toDisplayString(String(detailRecord.value[key])), 9, _hoisted_65)) : field.type === "file" && __props.render.fileRoutePath(detailRecord.value[key]) ? (openBlock(), createBlock(_component_router_link, {
|
|
2474
|
+
}, toDisplayString(String(detailRecord.value[key])), 9, _hoisted_65$1)) : field.type === "file" && __props.render.fileRoutePath(detailRecord.value[key]) ? (openBlock(), createBlock(_component_router_link, {
|
|
1595
2475
|
key: 12,
|
|
1596
2476
|
to: __props.render.fileRoutePath(detailRecord.value[key]) ?? "",
|
|
1597
2477
|
class: "text-blue-600 hover:text-blue-800 font-semibold hover:underline break-all",
|
|
@@ -1599,8 +2479,8 @@ var CollectionRecordPanel_default = /* @__PURE__ */ defineComponent({
|
|
|
1599
2479
|
}, {
|
|
1600
2480
|
default: withCtx(() => [createTextVNode(toDisplayString(String(detailRecord.value[key])), 1)]),
|
|
1601
2481
|
_: 2
|
|
1602
|
-
}, 1032, ["to", "data-testid"])) : (openBlock(), createElementBlock("span", _hoisted_66, toDisplayString(__props.render.formatCell(detailRecord.value[key], field.type)), 1))], 8, _hoisted_47))], 2)) : createCommentVNode("", true)], 64);
|
|
1603
|
-
}), 128)), editing.value && __props.saveError ? (openBlock(), createElementBlock("p", _hoisted_67, toDisplayString(__props.saveError), 1)) : createCommentVNode("", true)])
|
|
2482
|
+
}, 1032, ["to", "data-testid"])) : (openBlock(), createElementBlock("span", _hoisted_66$1, toDisplayString(__props.render.formatCell(detailRecord.value[key], field.type)), 1))], 8, _hoisted_47$1))], 2)) : createCommentVNode("", true)], 64);
|
|
2483
|
+
}), 128)), editing.value && __props.saveError ? (openBlock(), createElementBlock("p", _hoisted_67$1, toDisplayString(__props.saveError), 1)) : createCommentVNode("", true)])
|
|
1604
2484
|
]),
|
|
1605
2485
|
_: 1
|
|
1606
2486
|
}, 40, ["data-testid"]);
|
|
@@ -1608,6 +2488,2214 @@ var CollectionRecordPanel_default = /* @__PURE__ */ defineComponent({
|
|
|
1608
2488
|
}
|
|
1609
2489
|
});
|
|
1610
2490
|
//#endregion
|
|
1611
|
-
|
|
2491
|
+
//#region src/vue/components/CollectionViewConfigModal.vue?vue&type=script&setup=true&lang.ts
|
|
2492
|
+
var _hoisted_1$4 = {
|
|
2493
|
+
"data-testid": "collection-config-modal",
|
|
2494
|
+
class: "flex flex-col overflow-hidden"
|
|
2495
|
+
};
|
|
2496
|
+
var _hoisted_2$4 = { class: "flex items-center justify-between gap-2 border-b border-slate-100 px-5 py-3" };
|
|
2497
|
+
var _hoisted_3$4 = { class: "text-sm font-bold text-slate-700" };
|
|
2498
|
+
var _hoisted_4$4 = ["title", "aria-label"];
|
|
2499
|
+
var _hoisted_5$3 = { class: "overflow-y-auto px-5 py-4" };
|
|
2500
|
+
var _hoisted_6$3 = { class: "mb-2 text-[10px] font-bold uppercase tracking-wider text-slate-400" };
|
|
2501
|
+
var _hoisted_7$3 = {
|
|
2502
|
+
key: 0,
|
|
2503
|
+
class: "mb-3 rounded border border-rose-200 bg-rose-50 px-3 py-2 text-xs font-medium text-rose-600",
|
|
2504
|
+
"data-testid": "collection-config-error"
|
|
2505
|
+
};
|
|
2506
|
+
var _hoisted_8$3 = {
|
|
2507
|
+
key: 1,
|
|
2508
|
+
class: "flex flex-col gap-1"
|
|
2509
|
+
};
|
|
2510
|
+
var _hoisted_9$3 = { class: "material-icons text-base text-slate-400" };
|
|
2511
|
+
var _hoisted_10$3 = { class: "flex-1 truncate text-sm font-semibold text-slate-700" };
|
|
2512
|
+
var _hoisted_11$3 = [
|
|
2513
|
+
"title",
|
|
2514
|
+
"aria-label",
|
|
2515
|
+
"data-testid",
|
|
2516
|
+
"disabled",
|
|
2517
|
+
"onClick"
|
|
2518
|
+
];
|
|
2519
|
+
var _hoisted_12$3 = {
|
|
2520
|
+
key: 2,
|
|
2521
|
+
class: "text-xs text-slate-400",
|
|
2522
|
+
"data-testid": "collection-config-empty"
|
|
2523
|
+
};
|
|
2524
|
+
//#endregion
|
|
2525
|
+
//#region src/vue/components/CollectionViewConfigModal.vue
|
|
2526
|
+
var CollectionViewConfigModal_default = /* @__PURE__ */ defineComponent({
|
|
2527
|
+
__name: "CollectionViewConfigModal",
|
|
2528
|
+
props: {
|
|
2529
|
+
slug: {},
|
|
2530
|
+
title: {},
|
|
2531
|
+
views: {}
|
|
2532
|
+
},
|
|
2533
|
+
emits: ["close", "changed"],
|
|
2534
|
+
setup(__props, { emit: __emit }) {
|
|
2535
|
+
const props = __props;
|
|
2536
|
+
const emit = __emit;
|
|
2537
|
+
const { t } = useCollectionI18n();
|
|
2538
|
+
const deleting = ref(null);
|
|
2539
|
+
const error = ref(null);
|
|
2540
|
+
async function onDelete(view) {
|
|
2541
|
+
if (!await collectionUi().confirm({
|
|
2542
|
+
message: t("collectionsView.config.confirmDelete", { label: view.label }),
|
|
2543
|
+
confirmText: t("common.remove"),
|
|
2544
|
+
cancelText: t("common.cancel"),
|
|
2545
|
+
variant: "danger"
|
|
2546
|
+
})) return;
|
|
2547
|
+
error.value = null;
|
|
2548
|
+
deleting.value = view.id;
|
|
2549
|
+
try {
|
|
2550
|
+
const result = await collectionUi().deleteView(props.slug, view.id);
|
|
2551
|
+
if (!result.ok) {
|
|
2552
|
+
error.value = result.error;
|
|
2553
|
+
return;
|
|
2554
|
+
}
|
|
2555
|
+
emit("changed");
|
|
2556
|
+
} catch (err) {
|
|
2557
|
+
error.value = errorMessage(err);
|
|
2558
|
+
} finally {
|
|
2559
|
+
deleting.value = null;
|
|
2560
|
+
}
|
|
2561
|
+
}
|
|
2562
|
+
return (_ctx, _cache) => {
|
|
2563
|
+
return openBlock(), createBlock(CollectionRecordModal_default, { onClose: _cache[1] || (_cache[1] = ($event) => emit("close")) }, {
|
|
2564
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_1$4, [createElementVNode("header", _hoisted_2$4, [createElementVNode("h2", _hoisted_3$4, toDisplayString(unref(t)("collectionsView.config.title", { title: __props.title })), 1), createElementVNode("button", {
|
|
2565
|
+
type: "button",
|
|
2566
|
+
class: "h-8 w-8 flex items-center justify-center rounded text-slate-400 hover:bg-slate-50 hover:text-slate-600",
|
|
2567
|
+
title: unref(t)("common.close"),
|
|
2568
|
+
"aria-label": unref(t)("common.close"),
|
|
2569
|
+
"data-testid": "collection-config-close",
|
|
2570
|
+
onClick: _cache[0] || (_cache[0] = ($event) => emit("close"))
|
|
2571
|
+
}, [..._cache[2] || (_cache[2] = [createElementVNode("span", { class: "material-icons text-sm" }, "close", -1)])], 8, _hoisted_4$4)]), createElementVNode("div", _hoisted_5$3, [
|
|
2572
|
+
createElementVNode("h3", _hoisted_6$3, toDisplayString(unref(t)("collectionsView.config.viewsHeading")), 1),
|
|
2573
|
+
error.value ? (openBlock(), createElementBlock("p", _hoisted_7$3, toDisplayString(error.value), 1)) : createCommentVNode("", true),
|
|
2574
|
+
__props.views.length > 0 ? (openBlock(), createElementBlock("ul", _hoisted_8$3, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.views, (view) => {
|
|
2575
|
+
return openBlock(), createElementBlock("li", {
|
|
2576
|
+
key: view.id,
|
|
2577
|
+
class: "flex items-center gap-2 rounded border border-slate-200 bg-white px-3 py-2"
|
|
2578
|
+
}, [
|
|
2579
|
+
createElementVNode("span", _hoisted_9$3, toDisplayString(view.icon || "dashboard_customize"), 1),
|
|
2580
|
+
createElementVNode("span", _hoisted_10$3, toDisplayString(view.label), 1),
|
|
2581
|
+
createElementVNode("button", {
|
|
2582
|
+
type: "button",
|
|
2583
|
+
class: "h-8 w-8 flex items-center justify-center rounded border border-rose-200 bg-white text-rose-600 hover:bg-rose-50 disabled:opacity-50",
|
|
2584
|
+
title: unref(t)("collectionsView.config.deleteView", { label: view.label }),
|
|
2585
|
+
"aria-label": unref(t)("collectionsView.config.deleteView", { label: view.label }),
|
|
2586
|
+
"data-testid": `collection-view-delete-${view.id}`,
|
|
2587
|
+
disabled: deleting.value !== null,
|
|
2588
|
+
onClick: ($event) => onDelete(view)
|
|
2589
|
+
}, [..._cache[3] || (_cache[3] = [createElementVNode("span", { class: "material-icons text-sm" }, "delete_forever", -1)])], 8, _hoisted_11$3)
|
|
2590
|
+
]);
|
|
2591
|
+
}), 128))])) : (openBlock(), createElementBlock("p", _hoisted_12$3, toDisplayString(unref(t)("collectionsView.config.empty")), 1))
|
|
2592
|
+
])])]),
|
|
2593
|
+
_: 1
|
|
2594
|
+
});
|
|
2595
|
+
};
|
|
2596
|
+
}
|
|
2597
|
+
});
|
|
2598
|
+
//#endregion
|
|
2599
|
+
//#region src/vue/components/CollectionCustomView.vue?vue&type=script&setup=true&lang.ts
|
|
2600
|
+
var _hoisted_1$3 = { class: "custom-view-container" };
|
|
2601
|
+
var _hoisted_2$3 = {
|
|
2602
|
+
key: 0,
|
|
2603
|
+
class: "custom-view-message",
|
|
2604
|
+
role: "alert",
|
|
2605
|
+
"data-testid": "collection-custom-view-error"
|
|
2606
|
+
};
|
|
2607
|
+
var _hoisted_3$3 = {
|
|
2608
|
+
key: 1,
|
|
2609
|
+
class: "custom-view-message",
|
|
2610
|
+
"data-testid": "collection-custom-view-loading"
|
|
2611
|
+
};
|
|
2612
|
+
var _hoisted_4$3 = ["title", "srcdoc"];
|
|
2613
|
+
var REMINT_LEAD_MS = 6e4;
|
|
2614
|
+
var MIN_REMINT_DELAY_MS = 1e4;
|
|
2615
|
+
var CollectionCustomView_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
2616
|
+
__name: "CollectionCustomView",
|
|
2617
|
+
props: {
|
|
2618
|
+
slug: {},
|
|
2619
|
+
view: {}
|
|
2620
|
+
},
|
|
2621
|
+
setup(__props) {
|
|
2622
|
+
const { t } = useCollectionI18n();
|
|
2623
|
+
const props = __props;
|
|
2624
|
+
const loading = ref(true);
|
|
2625
|
+
const error = ref(null);
|
|
2626
|
+
const srcdoc = ref(null);
|
|
2627
|
+
let refreshTimer;
|
|
2628
|
+
function clearRefresh() {
|
|
2629
|
+
if (refreshTimer !== void 0) {
|
|
2630
|
+
clearTimeout(refreshTimer);
|
|
2631
|
+
refreshTimer = void 0;
|
|
2632
|
+
}
|
|
2633
|
+
}
|
|
2634
|
+
function scheduleRefresh(expMs) {
|
|
2635
|
+
clearRefresh();
|
|
2636
|
+
const delay = Math.max(expMs - Date.now() - REMINT_LEAD_MS, MIN_REMINT_DELAY_MS);
|
|
2637
|
+
refreshTimer = setTimeout(() => void load(), delay);
|
|
2638
|
+
}
|
|
2639
|
+
let loadSeq = 0;
|
|
2640
|
+
async function load() {
|
|
2641
|
+
clearRefresh();
|
|
2642
|
+
const seq = ++loadSeq;
|
|
2643
|
+
const stale = () => seq !== loadSeq;
|
|
2644
|
+
loading.value = true;
|
|
2645
|
+
error.value = null;
|
|
2646
|
+
srcdoc.value = null;
|
|
2647
|
+
const binding = collectionUi();
|
|
2648
|
+
try {
|
|
2649
|
+
const mint = await binding.mintViewToken(props.slug, props.view.id);
|
|
2650
|
+
if (stale()) return;
|
|
2651
|
+
if (!mint.ok) {
|
|
2652
|
+
error.value = mint.error;
|
|
2653
|
+
return;
|
|
2654
|
+
}
|
|
2655
|
+
scheduleRefresh(mint.data.exp);
|
|
2656
|
+
const resp = await binding.fetchViewHtml(props.slug, props.view.id);
|
|
2657
|
+
if (stale()) return;
|
|
2658
|
+
if (!resp.ok) {
|
|
2659
|
+
error.value = `HTTP ${resp.status}`;
|
|
2660
|
+
return;
|
|
2661
|
+
}
|
|
2662
|
+
srcdoc.value = binding.buildViewSrcdoc(resp.html, {
|
|
2663
|
+
slug: props.slug,
|
|
2664
|
+
token: mint.data.token,
|
|
2665
|
+
dataUrl: mint.data.dataUrl,
|
|
2666
|
+
origin: window.location.origin
|
|
2667
|
+
});
|
|
2668
|
+
} catch (err) {
|
|
2669
|
+
if (!stale()) error.value = errorMessage(err);
|
|
2670
|
+
} finally {
|
|
2671
|
+
if (!stale()) loading.value = false;
|
|
2672
|
+
}
|
|
2673
|
+
}
|
|
2674
|
+
watch([() => props.slug, () => props.view.id], () => void load(), { immediate: true });
|
|
2675
|
+
onBeforeUnmount(clearRefresh);
|
|
2676
|
+
return (_ctx, _cache) => {
|
|
2677
|
+
return openBlock(), createElementBlock("div", _hoisted_1$3, [error.value ? (openBlock(), createElementBlock("div", _hoisted_2$3, toDisplayString(unref(t)("collectionsView.customViewError", { error: error.value })), 1)) : loading.value ? (openBlock(), createElementBlock("div", _hoisted_3$3, toDisplayString(unref(t)("collectionsView.customViewLoading")), 1)) : srcdoc.value ? (openBlock(), createElementBlock("iframe", {
|
|
2678
|
+
key: __props.view.id,
|
|
2679
|
+
"data-testid": "collection-custom-view-iframe",
|
|
2680
|
+
title: __props.view.label,
|
|
2681
|
+
srcdoc: srcdoc.value,
|
|
2682
|
+
sandbox: "allow-scripts allow-popups allow-popups-to-escape-sandbox",
|
|
2683
|
+
class: "w-full h-full border-0"
|
|
2684
|
+
}, null, 8, _hoisted_4$3)) : createCommentVNode("", true)]);
|
|
2685
|
+
};
|
|
2686
|
+
}
|
|
2687
|
+
});
|
|
2688
|
+
//#endregion
|
|
2689
|
+
//#region \0plugin-vue:export-helper
|
|
2690
|
+
var _plugin_vue_export_helper_default = (sfc, props) => {
|
|
2691
|
+
const target = sfc.__vccOpts || sfc;
|
|
2692
|
+
for (const [key, val] of props) target[key] = val;
|
|
2693
|
+
return target;
|
|
2694
|
+
};
|
|
2695
|
+
//#endregion
|
|
2696
|
+
//#region src/vue/components/CollectionCustomView.vue
|
|
2697
|
+
var CollectionCustomView_default = /* @__PURE__ */ _plugin_vue_export_helper_default(CollectionCustomView_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-3ab71997"]]);
|
|
2698
|
+
//#endregion
|
|
2699
|
+
//#region src/vue/components/CollectionView.vue?vue&type=script&setup=true&lang.ts
|
|
2700
|
+
var _hoisted_1$2 = { class: "h-full flex flex-col bg-slate-50/30" };
|
|
2701
|
+
var _hoisted_2$2 = { class: "flex items-center gap-3 px-6 py-2 border-b border-slate-200 bg-white" };
|
|
2702
|
+
var _hoisted_3$2 = ["title", "aria-label"];
|
|
2703
|
+
var _hoisted_4$2 = {
|
|
2704
|
+
key: 1,
|
|
2705
|
+
class: "h-9 w-9 flex items-center justify-center rounded-xl bg-indigo-50 text-indigo-600 border border-indigo-100"
|
|
2706
|
+
};
|
|
2707
|
+
var _hoisted_5$2 = { class: "material-symbols-outlined text-xl" };
|
|
2708
|
+
var _hoisted_6$2 = { class: "flex-1 min-w-0" };
|
|
2709
|
+
var _hoisted_7$2 = { class: "text-base font-bold text-slate-800 truncate" };
|
|
2710
|
+
var _hoisted_8$2 = {
|
|
2711
|
+
key: 0,
|
|
2712
|
+
class: "block text-[10px] text-slate-400 font-bold uppercase tracking-wider"
|
|
2713
|
+
};
|
|
2714
|
+
var _hoisted_9$2 = ["disabled"];
|
|
2715
|
+
var _hoisted_10$2 = { class: "material-icons text-sm" };
|
|
2716
|
+
var _hoisted_11$2 = [
|
|
2717
|
+
"disabled",
|
|
2718
|
+
"data-testid",
|
|
2719
|
+
"onClick"
|
|
2720
|
+
];
|
|
2721
|
+
var _hoisted_12$2 = {
|
|
2722
|
+
key: 0,
|
|
2723
|
+
class: "material-icons text-sm"
|
|
2724
|
+
};
|
|
2725
|
+
var _hoisted_13$2 = ["title", "aria-label"];
|
|
2726
|
+
var _hoisted_14$2 = ["title", "aria-label"];
|
|
2727
|
+
var _hoisted_15$2 = {
|
|
2728
|
+
key: 0,
|
|
2729
|
+
class: "px-6 py-3 bg-white border-b border-slate-100 flex items-center justify-between gap-4"
|
|
2730
|
+
};
|
|
2731
|
+
var _hoisted_16$1 = {
|
|
2732
|
+
key: 0,
|
|
2733
|
+
class: "relative flex-1 max-w-md"
|
|
2734
|
+
};
|
|
2735
|
+
var _hoisted_17$1 = ["placeholder", "aria-label"];
|
|
2736
|
+
var _hoisted_18$1 = ["aria-label"];
|
|
2737
|
+
var _hoisted_19$1 = { class: "flex items-center gap-2" };
|
|
2738
|
+
var _hoisted_20$1 = ["aria-label"];
|
|
2739
|
+
var _hoisted_21$1 = ["aria-pressed"];
|
|
2740
|
+
var _hoisted_22$1 = ["aria-pressed"];
|
|
2741
|
+
var _hoisted_23$1 = ["aria-pressed"];
|
|
2742
|
+
var _hoisted_24 = [
|
|
2743
|
+
"aria-pressed",
|
|
2744
|
+
"data-testid",
|
|
2745
|
+
"onClick"
|
|
2746
|
+
];
|
|
2747
|
+
var _hoisted_25 = { class: "material-icons text-sm" };
|
|
2748
|
+
var _hoisted_26 = ["title", "aria-label"];
|
|
2749
|
+
var _hoisted_27 = ["title", "aria-label"];
|
|
2750
|
+
var _hoisted_28 = ["value", "aria-label"];
|
|
2751
|
+
var _hoisted_29 = ["value"];
|
|
2752
|
+
var _hoisted_30 = ["value", "aria-label"];
|
|
2753
|
+
var _hoisted_31 = ["value"];
|
|
2754
|
+
var _hoisted_32 = {
|
|
2755
|
+
key: 3,
|
|
2756
|
+
class: "text-[10px] text-slate-400 font-bold uppercase tracking-wider select-none"
|
|
2757
|
+
};
|
|
2758
|
+
var _hoisted_33 = {
|
|
2759
|
+
key: 1,
|
|
2760
|
+
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",
|
|
2761
|
+
"data-testid": "collections-data-issues"
|
|
2762
|
+
};
|
|
2763
|
+
var _hoisted_34 = { class: "flex-1" };
|
|
2764
|
+
var _hoisted_35 = { class: "flex-1 overflow-auto" };
|
|
2765
|
+
var _hoisted_36 = {
|
|
2766
|
+
key: 0,
|
|
2767
|
+
class: "flex flex-col items-center justify-center py-20 text-sm text-slate-500 gap-3"
|
|
2768
|
+
};
|
|
2769
|
+
var _hoisted_37 = {
|
|
2770
|
+
key: 1,
|
|
2771
|
+
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"
|
|
2772
|
+
};
|
|
2773
|
+
var _hoisted_38 = { key: 2 };
|
|
2774
|
+
var _hoisted_39 = {
|
|
2775
|
+
key: 3,
|
|
2776
|
+
class: "p-4"
|
|
2777
|
+
};
|
|
2778
|
+
var _hoisted_40 = {
|
|
2779
|
+
key: 4,
|
|
2780
|
+
class: "h-full flex flex-col"
|
|
2781
|
+
};
|
|
2782
|
+
var _hoisted_41 = {
|
|
2783
|
+
key: 0,
|
|
2784
|
+
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",
|
|
2785
|
+
"data-testid": "collections-inline-error"
|
|
2786
|
+
};
|
|
2787
|
+
var _hoisted_42 = { class: "flex-1" };
|
|
2788
|
+
var _hoisted_43 = ["aria-label"];
|
|
2789
|
+
var _hoisted_44 = { class: "flex-1 min-h-0 px-3 py-2" };
|
|
2790
|
+
var _hoisted_45 = {
|
|
2791
|
+
key: 5,
|
|
2792
|
+
class: "h-full",
|
|
2793
|
+
"data-testid": "collection-custom-view-body"
|
|
2794
|
+
};
|
|
2795
|
+
var _hoisted_46 = {
|
|
2796
|
+
key: 6,
|
|
2797
|
+
class: "flex flex-col items-center justify-center py-20 text-sm text-slate-400 gap-2"
|
|
2798
|
+
};
|
|
2799
|
+
var _hoisted_47 = { class: "font-semibold text-slate-600" };
|
|
2800
|
+
var _hoisted_48 = {
|
|
2801
|
+
key: 7,
|
|
2802
|
+
class: "flex flex-col items-center justify-center py-20 text-sm text-slate-400 gap-2"
|
|
2803
|
+
};
|
|
2804
|
+
var _hoisted_49 = { class: "font-semibold text-slate-600" };
|
|
2805
|
+
var _hoisted_50 = {
|
|
2806
|
+
key: 8,
|
|
2807
|
+
class: "overflow-x-auto [container-type:inline-size]"
|
|
2808
|
+
};
|
|
2809
|
+
var _hoisted_51 = {
|
|
2810
|
+
key: 0,
|
|
2811
|
+
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",
|
|
2812
|
+
"data-testid": "collections-inline-error"
|
|
2813
|
+
};
|
|
2814
|
+
var _hoisted_52 = { class: "flex-1" };
|
|
2815
|
+
var _hoisted_53 = ["aria-label"];
|
|
2816
|
+
var _hoisted_54 = { class: "min-w-full text-xs" };
|
|
2817
|
+
var _hoisted_55 = { class: "bg-slate-50 border-b border-slate-200" };
|
|
2818
|
+
var _hoisted_56 = ["aria-sort"];
|
|
2819
|
+
var _hoisted_57 = { class: "flex items-center gap-1" };
|
|
2820
|
+
var _hoisted_58 = ["title"];
|
|
2821
|
+
var _hoisted_59 = [
|
|
2822
|
+
"data-testid",
|
|
2823
|
+
"aria-label",
|
|
2824
|
+
"onClick",
|
|
2825
|
+
"onPointerenter"
|
|
2826
|
+
];
|
|
2827
|
+
var _hoisted_60 = { class: "material-icons text-base align-middle" };
|
|
2828
|
+
var _hoisted_61 = { class: "divide-y divide-slate-100 bg-white" };
|
|
2829
|
+
var _hoisted_62 = [
|
|
2830
|
+
"aria-label",
|
|
2831
|
+
"data-testid",
|
|
2832
|
+
"onClick",
|
|
2833
|
+
"onKeydown"
|
|
2834
|
+
];
|
|
2835
|
+
var _hoisted_63 = [
|
|
2836
|
+
"checked",
|
|
2837
|
+
"disabled",
|
|
2838
|
+
"data-testid",
|
|
2839
|
+
"aria-label",
|
|
2840
|
+
"onChange"
|
|
2841
|
+
];
|
|
2842
|
+
var _hoisted_64 = [
|
|
2843
|
+
"checked",
|
|
2844
|
+
"disabled",
|
|
2845
|
+
"data-testid",
|
|
2846
|
+
"aria-label",
|
|
2847
|
+
"onChange"
|
|
2848
|
+
];
|
|
2849
|
+
var _hoisted_65 = {
|
|
2850
|
+
key: 2,
|
|
2851
|
+
class: "block truncate"
|
|
2852
|
+
};
|
|
2853
|
+
var _hoisted_66 = [
|
|
2854
|
+
"value",
|
|
2855
|
+
"disabled",
|
|
2856
|
+
"data-testid",
|
|
2857
|
+
"aria-label",
|
|
2858
|
+
"onChange"
|
|
2859
|
+
];
|
|
2860
|
+
var _hoisted_67 = {
|
|
2861
|
+
key: 0,
|
|
2862
|
+
value: ""
|
|
2863
|
+
};
|
|
2864
|
+
var _hoisted_68 = ["value"];
|
|
2865
|
+
var _hoisted_69 = {
|
|
2866
|
+
key: 4,
|
|
2867
|
+
class: "block truncate tabular-nums font-semibold text-slate-900"
|
|
2868
|
+
};
|
|
2869
|
+
var _hoisted_70 = {
|
|
2870
|
+
key: 5,
|
|
2871
|
+
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"
|
|
2872
|
+
};
|
|
2873
|
+
var _hoisted_71 = {
|
|
2874
|
+
key: 6,
|
|
2875
|
+
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"
|
|
2876
|
+
};
|
|
2877
|
+
var _hoisted_72 = ["href", "data-testid"];
|
|
2878
|
+
var _hoisted_73 = ["href", "data-testid"];
|
|
2879
|
+
var _hoisted_74 = {
|
|
2880
|
+
key: 10,
|
|
2881
|
+
class: "block truncate text-slate-600"
|
|
2882
|
+
};
|
|
2883
|
+
var _hoisted_75 = { class: "bg-white rounded-2xl shadow-2xl w-full max-w-xl flex flex-col border border-slate-200 overflow-hidden" };
|
|
2884
|
+
var _hoisted_76 = { class: "px-6 py-4 border-b border-slate-100 flex items-center gap-3 bg-slate-50/50" };
|
|
2885
|
+
var _hoisted_77 = { class: "flex-1" };
|
|
2886
|
+
var _hoisted_78 = {
|
|
2887
|
+
id: "collections-chat-title",
|
|
2888
|
+
class: "text-sm font-bold text-slate-800 uppercase tracking-wide"
|
|
2889
|
+
};
|
|
2890
|
+
var _hoisted_79 = { class: "text-xs text-slate-400 font-semibold" };
|
|
2891
|
+
var _hoisted_80 = ["aria-label"];
|
|
2892
|
+
var _hoisted_81 = { class: "px-6 py-5" };
|
|
2893
|
+
var _hoisted_82 = ["placeholder", "onKeydown"];
|
|
2894
|
+
var _hoisted_83 = { class: "px-6 py-3.5 border-t border-slate-100 flex items-center justify-end gap-2 bg-slate-50/50" };
|
|
2895
|
+
var _hoisted_84 = ["disabled"];
|
|
2896
|
+
//#endregion
|
|
2897
|
+
//#region src/vue/components/CollectionView.vue
|
|
2898
|
+
var CollectionView_default = /* @__PURE__ */ defineComponent({
|
|
2899
|
+
__name: "CollectionView",
|
|
2900
|
+
props: {
|
|
2901
|
+
slug: {},
|
|
2902
|
+
selected: {},
|
|
2903
|
+
sendTextMessage: { type: Function },
|
|
2904
|
+
initialView: {},
|
|
2905
|
+
initialAnchorField: {},
|
|
2906
|
+
initialGroupField: {}
|
|
2907
|
+
},
|
|
2908
|
+
emits: ["select", "viewStateChange"],
|
|
2909
|
+
setup(__props, { emit: __emit }) {
|
|
2910
|
+
const props = __props;
|
|
2911
|
+
const emit = __emit;
|
|
2912
|
+
const { t, locale } = useCollectionI18n();
|
|
2913
|
+
const cui = collectionUi();
|
|
2914
|
+
const { confirm: openConfirm, unpin, pinToggle, startChat } = cui;
|
|
2915
|
+
const appApi = { startNewChat: startChat };
|
|
2916
|
+
/** Embedded when a `slug` prop is supplied; standalone (route-driven)
|
|
2917
|
+
* otherwise. Switches the slug/selected source and the open/close
|
|
2918
|
+
* navigation behaviour. */
|
|
2919
|
+
const embedded = computed(() => props.slug !== void 0);
|
|
2920
|
+
/** Active collection slug: the prop in embedded mode, else the route
|
|
2921
|
+
* param. */
|
|
2922
|
+
const activeSlug = computed(() => {
|
|
2923
|
+
if (props.slug !== void 0) return props.slug;
|
|
2924
|
+
const slug = cui.routeSlug();
|
|
2925
|
+
return slug !== void 0 && slug.length > 0 ? slug : void 0;
|
|
2926
|
+
});
|
|
2927
|
+
/** Active open-record id: the prop in embedded mode (may be undefined),
|
|
2928
|
+
* else the `?selected=` query. */
|
|
2929
|
+
const activeSelected = computed(() => {
|
|
2930
|
+
if (embedded.value) return props.selected;
|
|
2931
|
+
return cui.routeSelectedId();
|
|
2932
|
+
});
|
|
2933
|
+
const collection = ref(null);
|
|
2934
|
+
const items = ref([]);
|
|
2935
|
+
const loading = ref(true);
|
|
2936
|
+
const loadError = ref(null);
|
|
2937
|
+
const dataIssues = ref([]);
|
|
2938
|
+
const notifiedSeverities = computed(() => {
|
|
2939
|
+
const slug = collection.value?.slug;
|
|
2940
|
+
return slug ? cui.notifiedSeverities(slug) : /* @__PURE__ */ new Map();
|
|
2941
|
+
});
|
|
2942
|
+
/** True while a feed collection's manual refresh is in flight. */
|
|
2943
|
+
const refreshing = ref(false);
|
|
2944
|
+
/** Slug already auto-refreshed on first open — prevents a reload loop
|
|
2945
|
+
* (the auto-refresh reloads the view, which would re-trigger otherwise). */
|
|
2946
|
+
const autoRefreshedSlug = ref(null);
|
|
2947
|
+
const editing = ref(null);
|
|
2948
|
+
/** The record currently shown in read-only "open" mode. Distinct
|
|
2949
|
+
* from `editing`: open mode renders formatted values (no inputs)
|
|
2950
|
+
* and is what a `/collections/<slug>?selected=<id>` deep link
|
|
2951
|
+
* lands on. Mutually exclusive with `editing` in practice —
|
|
2952
|
+
* `editFromView` hands off from one to the other. */
|
|
2953
|
+
const viewing = ref(null);
|
|
2954
|
+
/** The calendar day whose time-allocation popup is open, or null. The
|
|
2955
|
+
* selected record (`viewing`) renders in that popup's right pane; a record
|
|
2956
|
+
* with no resolvable day falls back to the panel below the grid. */
|
|
2957
|
+
const openDay = ref(null);
|
|
2958
|
+
const saving = ref(false);
|
|
2959
|
+
const saveError = ref(null);
|
|
2960
|
+
/** Error from an inline table-cell edit (checkbox/dropdown). Distinct
|
|
2961
|
+
* from `saveError` (rendered only inside the detail panel, which is
|
|
2962
|
+
* closed during inline editing) — shown as a banner above the table. */
|
|
2963
|
+
const inlineError = ref(null);
|
|
2964
|
+
/** Per-load snapshot of enum cells that had NO value when fetched
|
|
2965
|
+
* (keyed `<rowId>:<fieldKey>`). Only these cells offer the empty
|
|
2966
|
+
* placeholder option in their inline dropdown — a cell that already
|
|
2967
|
+
* has a value can't be blanked inline (use the edit form for that). */
|
|
2968
|
+
const enumOriginallyEmpty = ref(/* @__PURE__ */ new Set());
|
|
2969
|
+
/** Rows with an inline cell save in flight (by `rowId`). While a row is
|
|
2970
|
+
* here its inline controls are disabled, so two quick edits to the same
|
|
2971
|
+
* row can't race two full-record PUTs — an older PUT landing last would
|
|
2972
|
+
* otherwise clobber the newer field on disk while the UI shows the
|
|
2973
|
+
* newer optimistic value (Codex PR #1599 P2). */
|
|
2974
|
+
const inlineSavingRows = ref(/* @__PURE__ */ new Set());
|
|
2975
|
+
const actionPending = ref(false);
|
|
2976
|
+
const actionError = ref(null);
|
|
2977
|
+
const collectionActionPending = ref(false);
|
|
2978
|
+
const chatOpen = ref(false);
|
|
2979
|
+
const chatMessage = ref("");
|
|
2980
|
+
const chatInputEl = ref(null);
|
|
2981
|
+
const render = useCollectionRendering(collection, locale);
|
|
2982
|
+
const { refRecordCache, refDisplay, formatMoney, resolveCurrency, derivedDisplay, evaluateDerivedAgainstItem, formatCell, isExternalUrl, artifactUrl, fileRoutePath } = render;
|
|
2983
|
+
const searchQuery = ref("");
|
|
2984
|
+
/** Case-insensitive substring match across an item's scalar fields.
|
|
2985
|
+
* Object-valued fields (table rows, nested records) are skipped —
|
|
2986
|
+
* they don't render as searchable text in the list table. */
|
|
2987
|
+
function itemMatchesQuery(item, query) {
|
|
2988
|
+
return Object.values(item).some((val) => {
|
|
2989
|
+
if (val === void 0 || val === null || typeof val === "object") return false;
|
|
2990
|
+
return String(val).toLowerCase().includes(query);
|
|
2991
|
+
});
|
|
2992
|
+
}
|
|
2993
|
+
const filteredItems = computed(() => {
|
|
2994
|
+
const query = searchQuery.value.trim().toLowerCase();
|
|
2995
|
+
if (!query) return items.value;
|
|
2996
|
+
return items.value.filter((item) => itemMatchesQuery(item, query));
|
|
2997
|
+
});
|
|
2998
|
+
function storedSortFor(slug) {
|
|
2999
|
+
return slug && readCollectionSort(slug) || null;
|
|
3000
|
+
}
|
|
3001
|
+
const sortState = ref(storedSortFor(activeSlug.value));
|
|
3002
|
+
const hoveredSortKey = ref(null);
|
|
3003
|
+
function sortDirectionFor(key) {
|
|
3004
|
+
return sortState.value?.field === key ? sortState.value.direction : null;
|
|
3005
|
+
}
|
|
3006
|
+
/** The direction whose visuals to render: on hover, preview the next
|
|
3007
|
+
* click's state; otherwise show the column's actual state. */
|
|
3008
|
+
function effectiveSortDir(key) {
|
|
3009
|
+
const current = sortDirectionFor(key);
|
|
3010
|
+
return hoveredSortKey.value === key ? nextSortDirection(current) : current;
|
|
3011
|
+
}
|
|
3012
|
+
/** Cycle a column none → asc → desc → none; activating one clears the rest. */
|
|
3013
|
+
function cycleSort(key) {
|
|
3014
|
+
const next = nextSortDirection(sortDirectionFor(key));
|
|
3015
|
+
sortState.value = next ? {
|
|
3016
|
+
field: key,
|
|
3017
|
+
direction: next
|
|
3018
|
+
} : null;
|
|
3019
|
+
}
|
|
3020
|
+
function sortIconName(key) {
|
|
3021
|
+
return effectiveSortDir(key) === "desc" ? "arrow_downward" : "arrow_upward";
|
|
3022
|
+
}
|
|
3023
|
+
function sortButtonClass(key) {
|
|
3024
|
+
return effectiveSortDir(key) ? "text-slate-600" : "text-slate-300";
|
|
3025
|
+
}
|
|
3026
|
+
/** ARIA `aria-sort` token for a column's header cell. */
|
|
3027
|
+
function sortAriaValue(key) {
|
|
3028
|
+
const dir = sortDirectionFor(key);
|
|
3029
|
+
return dir === "asc" ? "ascending" : dir === "desc" ? "descending" : "none";
|
|
3030
|
+
}
|
|
3031
|
+
/** Comparable value for scalar fields that key off the raw cell value. */
|
|
3032
|
+
function scalarSortValue(field, raw) {
|
|
3033
|
+
switch (field.type) {
|
|
3034
|
+
case "number":
|
|
3035
|
+
case "money": return numericSortValue(raw);
|
|
3036
|
+
case "date":
|
|
3037
|
+
case "datetime": return dateSortValue(raw);
|
|
3038
|
+
case "enum": return enumSortValue(field.values, raw);
|
|
3039
|
+
case "boolean": return boolSortValue(raw === true);
|
|
3040
|
+
case "ref": return field.to && typeof raw === "string" && raw ? stringSortValue(refDisplay(field.to, raw)) : stringSortValue(raw);
|
|
3041
|
+
default: return stringSortValue(raw);
|
|
3042
|
+
}
|
|
3043
|
+
}
|
|
3044
|
+
/** Comparable value for one row under the active field. Toggle and derived
|
|
3045
|
+
* need the whole record; every other type keys off the raw cell. */
|
|
3046
|
+
function sortValueOf(field, key, item) {
|
|
3047
|
+
if (field.type === "toggle") return boolSortValue(toggleChecked(item, field));
|
|
3048
|
+
if (field.type === "derived") return derivedSortValue(field, key, item);
|
|
3049
|
+
return scalarSortValue(field, item[key]);
|
|
3050
|
+
}
|
|
3051
|
+
/** Derived rows sort by their display type: money/number → numeric,
|
|
3052
|
+
* date/datetime → epoch, anything else → the enriched value as a string. */
|
|
3053
|
+
function derivedSortValue(field, key, item) {
|
|
3054
|
+
const { display } = field;
|
|
3055
|
+
if (display === void 0 || display === "number" || display === "money") return numericSortValue(evaluateDerivedAgainstItem(field, key, item));
|
|
3056
|
+
const enriched = collection.value ? render.deriveAll(collection.value.schema, item, render.refRecordCache.value) : item;
|
|
3057
|
+
if (display === "date" || display === "datetime") return dateSortValue(enriched[key]);
|
|
3058
|
+
return stringSortValue(enriched[key]);
|
|
3059
|
+
}
|
|
3060
|
+
const sortedItems = computed(() => {
|
|
3061
|
+
const state = sortState.value;
|
|
3062
|
+
const field = state ? collection.value?.schema.fields[state.field] : void 0;
|
|
3063
|
+
if (!state || !field) return filteredItems.value;
|
|
3064
|
+
return sortItems(filteredItems.value, state.direction, (item) => sortValueOf(field, state.field, item));
|
|
3065
|
+
});
|
|
3066
|
+
/** Stringified primary-key value for a row (the row's stable identity). */
|
|
3067
|
+
function rowId(item) {
|
|
3068
|
+
const primaryKey = collection.value?.schema.primaryKey;
|
|
3069
|
+
return primaryKey ? String(item[primaryKey] ?? "") : "";
|
|
3070
|
+
}
|
|
3071
|
+
/** Stable key for one cell in the `enumOriginallyEmpty` snapshot. */
|
|
3072
|
+
function cellKey(rowIdValue, fieldKey) {
|
|
3073
|
+
return `${rowIdValue}:${fieldKey}`;
|
|
3074
|
+
}
|
|
3075
|
+
/** Build the set of enum cells that were empty in the freshly-fetched
|
|
3076
|
+
* records — the only cells whose inline dropdown offers an empty option. */
|
|
3077
|
+
function snapshotEmptyEnums(schema, records) {
|
|
3078
|
+
const empty = /* @__PURE__ */ new Set();
|
|
3079
|
+
const enumKeys = Object.entries(schema.fields).filter(([, field]) => field.type === "enum").map(([fieldKey]) => fieldKey);
|
|
3080
|
+
if (enumKeys.length === 0) return empty;
|
|
3081
|
+
for (const record of records) {
|
|
3082
|
+
const recordId = String(record[schema.primaryKey] ?? "");
|
|
3083
|
+
for (const fieldKey of enumKeys) if (record[fieldKey] == null || record[fieldKey] === "") empty.add(cellKey(recordId, fieldKey));
|
|
3084
|
+
}
|
|
3085
|
+
return empty;
|
|
3086
|
+
}
|
|
3087
|
+
/** Whether an inline enum dropdown should render its empty placeholder
|
|
3088
|
+
* option: only for cells with no value at load time. */
|
|
3089
|
+
function showEnumPlaceholder(item, fieldKey) {
|
|
3090
|
+
return enumOriginallyEmpty.value.has(cellKey(rowId(item), fieldKey));
|
|
3091
|
+
}
|
|
3092
|
+
/** Tailwind fill/text/border classes tinting an inline enum `<select>` by its
|
|
3093
|
+
* current value's colour (palette, or notification red/amber/grey when the
|
|
3094
|
+
* field is the schema's notifyWhen target). */
|
|
3095
|
+
function enumControlClass(fieldKey, value) {
|
|
3096
|
+
const schema = collection.value?.schema;
|
|
3097
|
+
if (!schema) return "";
|
|
3098
|
+
const cls = resolveEnumColor(schema, fieldKey, value);
|
|
3099
|
+
return `${cls.badge} ${cls.border}`;
|
|
3100
|
+
}
|
|
3101
|
+
/** This row is the one open in read-only detail. */
|
|
3102
|
+
function isRowOpen(item) {
|
|
3103
|
+
return viewing.value !== null && rowId(viewing.value) === rowId(item);
|
|
3104
|
+
}
|
|
3105
|
+
/** This row is the one being edited (highlights it in the list while the
|
|
3106
|
+
* edit modal is open). Create mode has no backing row, so nothing matches. */
|
|
3107
|
+
function isEditingRow(item) {
|
|
3108
|
+
const draft = editing.value;
|
|
3109
|
+
if (!draft || draft.mode === "create") return false;
|
|
3110
|
+
return draft.originalId === rowId(item);
|
|
3111
|
+
}
|
|
3112
|
+
/** Re-run a feed collection's retrieval now, then reload its records.
|
|
3113
|
+
* Only reachable when `schema.ingest` is present (button is gated). */
|
|
3114
|
+
async function refreshFeed() {
|
|
3115
|
+
const current = collection.value;
|
|
3116
|
+
if (!current?.schema.ingest || refreshing.value) return;
|
|
3117
|
+
refreshing.value = true;
|
|
3118
|
+
inlineError.value = null;
|
|
3119
|
+
const result = await cui.refreshCollection(current.slug);
|
|
3120
|
+
refreshing.value = false;
|
|
3121
|
+
if (!result.ok) {
|
|
3122
|
+
loadError.value = result.error;
|
|
3123
|
+
return;
|
|
3124
|
+
}
|
|
3125
|
+
await loadCollection(current.slug);
|
|
3126
|
+
if (result.data.errors.length > 0) inlineError.value = t("collectionsView.refreshFailed", { error: result.data.errors.join("; ") });
|
|
3127
|
+
}
|
|
3128
|
+
/** Collection-level header actions. No `when` predicate (no record). */
|
|
3129
|
+
const collectionActions = computed(() => collection.value?.schema.collectionActions ?? []);
|
|
3130
|
+
/** Run a collection-level action: ask the server to assemble the seed
|
|
3131
|
+
* prompt (a progress summary of all records + the template), then start
|
|
3132
|
+
* a new chat in the action's role with it. Generic — no domain knowledge. */
|
|
3133
|
+
async function runCollectionAction(action) {
|
|
3134
|
+
const current = collection.value;
|
|
3135
|
+
if (!current || collectionActionPending.value) return;
|
|
3136
|
+
collectionActionPending.value = true;
|
|
3137
|
+
inlineError.value = null;
|
|
3138
|
+
const result = await cui.runCollectionAction(current.slug, action.id);
|
|
3139
|
+
collectionActionPending.value = false;
|
|
3140
|
+
if (!result.ok) {
|
|
3141
|
+
inlineError.value = result.error;
|
|
3142
|
+
return;
|
|
3143
|
+
}
|
|
3144
|
+
if (props.sendTextMessage) {
|
|
3145
|
+
props.sendTextMessage(result.data.prompt);
|
|
3146
|
+
return;
|
|
3147
|
+
}
|
|
3148
|
+
appApi.startNewChat(result.data.prompt, result.data.role);
|
|
3149
|
+
}
|
|
3150
|
+
/** Report the server-detected record data problems back to the LLM so it
|
|
3151
|
+
* fixes the offending files. Mirrors the `presentCollection` validation
|
|
3152
|
+
* path (`dispatchPresentCollection`), but user-initiated via the Repair
|
|
3153
|
+
* button instead of fired automatically after a write. Dispatches into
|
|
3154
|
+
* the current chat when embedded, else seeds a new General chat. */
|
|
3155
|
+
function repairCollection() {
|
|
3156
|
+
const current = collection.value;
|
|
3157
|
+
if (!current || dataIssues.value.length === 0) return;
|
|
3158
|
+
const lines = dataIssues.value.map((issue) => `- ${defangForPrompt(issue.file)}: ${defangForPrompt(issue.problem)}`).join("\n");
|
|
3159
|
+
const prompt = t("collectionsView.repairPrompt", {
|
|
3160
|
+
title: current.title,
|
|
3161
|
+
count: dataIssues.value.length,
|
|
3162
|
+
issues: lines
|
|
3163
|
+
});
|
|
3164
|
+
if (props.sendTextMessage) {
|
|
3165
|
+
props.sendTextMessage(prompt);
|
|
3166
|
+
return;
|
|
3167
|
+
}
|
|
3168
|
+
appApi.startNewChat(prompt, cui.generalRoleId);
|
|
3169
|
+
}
|
|
3170
|
+
/** Actions whose optional `when` predicate matches the open record.
|
|
3171
|
+
* Status-driven buttons (e.g. invoice "Record payment") stay hidden
|
|
3172
|
+
* until the record reaches the matching state. */
|
|
3173
|
+
const visibleActions = computed(() => {
|
|
3174
|
+
const record = viewing.value;
|
|
3175
|
+
if (!record) return [];
|
|
3176
|
+
return (collection.value?.schema.actions ?? []).filter((action) => actionVisible(action, record));
|
|
3177
|
+
});
|
|
3178
|
+
/** Run a schema-declared action on the open record: ask the server to
|
|
3179
|
+
* assemble the seed prompt, then start a new chat in the action's
|
|
3180
|
+
* role with it. Generic — no knowledge of what the action does. */
|
|
3181
|
+
async function runAction(action) {
|
|
3182
|
+
if (!collection.value || !viewing.value) return;
|
|
3183
|
+
const itemId = String(viewing.value[collection.value.schema.primaryKey] ?? "");
|
|
3184
|
+
if (!itemId) return;
|
|
3185
|
+
actionPending.value = true;
|
|
3186
|
+
actionError.value = null;
|
|
3187
|
+
const result = await cui.runItemAction(collection.value.slug, itemId, action.id);
|
|
3188
|
+
actionPending.value = false;
|
|
3189
|
+
if (!result.ok) {
|
|
3190
|
+
actionError.value = result.error;
|
|
3191
|
+
return;
|
|
3192
|
+
}
|
|
3193
|
+
if (props.sendTextMessage) {
|
|
3194
|
+
props.sendTextMessage(result.data.prompt);
|
|
3195
|
+
return;
|
|
3196
|
+
}
|
|
3197
|
+
appApi.startNewChat(result.data.prompt, result.data.role);
|
|
3198
|
+
}
|
|
3199
|
+
/** Open the chat modal, blanking any prior draft and focusing the input. */
|
|
3200
|
+
function openChat() {
|
|
3201
|
+
chatMessage.value = "";
|
|
3202
|
+
chatOpen.value = true;
|
|
3203
|
+
nextTick(() => chatInputEl.value?.focus());
|
|
3204
|
+
}
|
|
3205
|
+
function closeChat() {
|
|
3206
|
+
chatOpen.value = false;
|
|
3207
|
+
}
|
|
3208
|
+
/** Build the chat seed text for the current view.
|
|
3209
|
+
*
|
|
3210
|
+
* A collection IS a skill, so its slug doubles as a slash command:
|
|
3211
|
+
* "I want to create an item" on `mc_worklog` becomes
|
|
3212
|
+
* `/mc_worklog I want to create an item`.
|
|
3213
|
+
*
|
|
3214
|
+
* A feed is data-only — it has NO skill, so `/<slug>` would resolve to
|
|
3215
|
+
* nothing. Instead, point the agent at the feed's schema + records
|
|
3216
|
+
* (`feeds/<slug>/schema.json` and `<dataPath>/`) and let it act on the
|
|
3217
|
+
* request directly. */
|
|
3218
|
+
function buildChatSeed(slug, message) {
|
|
3219
|
+
const schema = collection.value?.schema;
|
|
3220
|
+
if (!schema?.ingest) return `/${slug} ${message}`;
|
|
3221
|
+
return t("collectionsView.feedChatSeed", {
|
|
3222
|
+
slug,
|
|
3223
|
+
dataPath: schema.dataPath ?? `data/feeds/${slug}`,
|
|
3224
|
+
message
|
|
3225
|
+
});
|
|
3226
|
+
}
|
|
3227
|
+
/** Start a new general-role chat seeded from the current view. */
|
|
3228
|
+
function submitChat() {
|
|
3229
|
+
if (!collection.value) return;
|
|
3230
|
+
const message = chatMessage.value.trim();
|
|
3231
|
+
if (!message) return;
|
|
3232
|
+
closeChat();
|
|
3233
|
+
const text = buildChatSeed(collection.value.slug, message);
|
|
3234
|
+
if (props.sendTextMessage) {
|
|
3235
|
+
props.sendTextMessage(text);
|
|
3236
|
+
return;
|
|
3237
|
+
}
|
|
3238
|
+
appApi.startNewChat(text, cui.generalRoleId);
|
|
3239
|
+
}
|
|
3240
|
+
async function loadCollection(slug) {
|
|
3241
|
+
const requestedKind = !embedded.value && cui.isFeedRoute() ? "feed" : "collection";
|
|
3242
|
+
loading.value = true;
|
|
3243
|
+
loadError.value = null;
|
|
3244
|
+
collection.value = null;
|
|
3245
|
+
items.value = [];
|
|
3246
|
+
dataIssues.value = [];
|
|
3247
|
+
searchQuery.value = "";
|
|
3248
|
+
render.resetLinkedCaches();
|
|
3249
|
+
viewing.value = null;
|
|
3250
|
+
openDay.value = null;
|
|
3251
|
+
const result = await cui.fetchCollectionDetail(slug);
|
|
3252
|
+
loading.value = false;
|
|
3253
|
+
if (!result.ok) {
|
|
3254
|
+
loadError.value = result.status === 404 ? "not-found" : result.error;
|
|
3255
|
+
if (result.status === 404 && !embedded.value && activeSlug.value === slug) unpin(requestedKind, slug);
|
|
3256
|
+
return;
|
|
3257
|
+
}
|
|
3258
|
+
collection.value = result.data.collection;
|
|
3259
|
+
items.value = result.data.items;
|
|
3260
|
+
dataIssues.value = result.data.issues ?? [];
|
|
3261
|
+
enumOriginallyEmpty.value = snapshotEmptyEnums(result.data.collection.schema, result.data.items);
|
|
3262
|
+
await render.loadLinkedCollections(result.data.collection.schema, slug);
|
|
3263
|
+
if (collection.value?.slug === slug) {
|
|
3264
|
+
syncViewToSelected();
|
|
3265
|
+
maybeOpenCalendarForSelected();
|
|
3266
|
+
}
|
|
3267
|
+
maybeAutoRefreshFeed(slug);
|
|
3268
|
+
}
|
|
3269
|
+
function maybeAutoRefreshFeed(slug) {
|
|
3270
|
+
if (embedded.value) return;
|
|
3271
|
+
const current = collection.value;
|
|
3272
|
+
if (current?.slug !== slug || !current.schema.ingest) return;
|
|
3273
|
+
if (items.value.length > 0 || autoRefreshedSlug.value === slug) return;
|
|
3274
|
+
autoRefreshedSlug.value = slug;
|
|
3275
|
+
refreshFeed();
|
|
3276
|
+
}
|
|
3277
|
+
/** Schema fields excluding display-only `embed` fields — used by the
|
|
3278
|
+
* list table only (a whole embedded record doesn't fit a table cell,
|
|
3279
|
+
* and it'd be identical in every row). The detail modal and the edit
|
|
3280
|
+
* form iterate the full `schema.fields` so embeds render there too. */
|
|
3281
|
+
const listColumnFields = computed(() => collection.value ? Object.entries(collection.value.schema.fields).filter(([key, field]) => field.type !== "embed" && field.type !== "image" && key !== collection.value?.schema.primaryKey) : []);
|
|
3282
|
+
/** True when the current collection declares `schema.singleton` —
|
|
3283
|
+
* exactly one record, its primary key fixed to the declared value. */
|
|
3284
|
+
const isSingleton = computed(() => Boolean(collection.value?.schema.singleton));
|
|
3285
|
+
/** Whether the Add button should show. Always for a normal collection;
|
|
3286
|
+
* for a singleton only until its one record exists. */
|
|
3287
|
+
const canCreate = computed(() => {
|
|
3288
|
+
if (!collection.value) return false;
|
|
3289
|
+
return !(isSingleton.value && items.value.length > 0);
|
|
3290
|
+
});
|
|
3291
|
+
const canDeleteCollection = computed(() => {
|
|
3292
|
+
const current = collection.value;
|
|
3293
|
+
if (!current) return false;
|
|
3294
|
+
return current.source === "project" && !current.slug.startsWith("mc-");
|
|
3295
|
+
});
|
|
3296
|
+
const isFeed = computed(() => Boolean(collection.value?.schema.ingest));
|
|
3297
|
+
const canDeleteFeed = computed(() => isFeed.value && !embedded.value);
|
|
3298
|
+
const isFeedRoute = computed(() => !embedded.value && cui.isFeedRoute());
|
|
3299
|
+
/** The view to open with: the embedded card's restored `initialView` if
|
|
3300
|
+
* present (its own persisted state wins), else the slug's stored
|
|
3301
|
+
* preference, else "table". Embedded cards READ the store but never WRITE
|
|
3302
|
+
* it (the persist watch only emits `viewStateChange` for them), so a stale
|
|
3303
|
+
* card re-rendering can't clobber the shared preference. */
|
|
3304
|
+
function initialViewMode() {
|
|
3305
|
+
if (props.initialView) return props.initialView;
|
|
3306
|
+
const slug = activeSlug.value;
|
|
3307
|
+
return slug && readCollectionViewMode(slug) || "table";
|
|
3308
|
+
}
|
|
3309
|
+
const view = ref(initialViewMode());
|
|
3310
|
+
/** `date` / `datetime` fields in declaration order — the calendar can anchor
|
|
3311
|
+
* on any (a `datetime` anchor also carries the clock for the day view). */
|
|
3312
|
+
const dateFields = computed(() => collection.value ? Object.entries(collection.value.schema.fields).filter(([, field]) => field.type === "date" || field.type === "datetime").map(([key]) => key) : []);
|
|
3313
|
+
/** Whether the table ↔ calendar toggle is offered. */
|
|
3314
|
+
const hasCalendar = computed(() => dateFields.value.length > 0);
|
|
3315
|
+
/** `enum` fields in declaration order — the kanban can group on any. */
|
|
3316
|
+
const enumFields = computed(() => collection.value ? Object.entries(collection.value.schema.fields).filter(([, field]) => field.type === "enum").map(([key]) => key) : []);
|
|
3317
|
+
/** Whether the kanban toggle is offered (needs an `enum` field to group on). */
|
|
3318
|
+
const hasKanban = computed(() => enumFields.value.length > 0);
|
|
3319
|
+
/** The effective view, collapsing any stale mode whose enabling field
|
|
3320
|
+
* vanished (e.g. `view = "kanban"` after switching to an enum-less
|
|
3321
|
+
* collection) back to "table". Single source of truth for the toggle and
|
|
3322
|
+
* the body branches. */
|
|
3323
|
+
/** Custom (LLM-authored) HTML views declared on the schema. */
|
|
3324
|
+
const customViews = computed(() => collection.value?.schema.views ?? []);
|
|
3325
|
+
const hasCustomViews = computed(() => customViews.value.length > 0);
|
|
3326
|
+
const activeView = computed(() => {
|
|
3327
|
+
if (view.value === "calendar" && hasCalendar.value) return "calendar";
|
|
3328
|
+
if (view.value === "kanban" && hasKanban.value) return "kanban";
|
|
3329
|
+
if (view.value.startsWith("custom:")) {
|
|
3330
|
+
const viewId = view.value.slice(7);
|
|
3331
|
+
if (customViews.value.some((entry) => entry.id === viewId)) return view.value;
|
|
3332
|
+
}
|
|
3333
|
+
return "table";
|
|
3334
|
+
});
|
|
3335
|
+
/** The selected custom view's spec, or null when a built-in view is active. */
|
|
3336
|
+
const activeCustomView = computed(() => {
|
|
3337
|
+
const mode = activeView.value;
|
|
3338
|
+
if (!mode.startsWith("custom:")) return null;
|
|
3339
|
+
const viewId = mode.slice(7);
|
|
3340
|
+
return customViews.value.find((entry) => entry.id === viewId) ?? null;
|
|
3341
|
+
});
|
|
3342
|
+
/** Narrow a (possibly custom) mode to a built-in one, used where only the
|
|
3343
|
+
* built-in views are representable (the embedded card's viewState). */
|
|
3344
|
+
function builtInViewOrTable(mode) {
|
|
3345
|
+
return mode === "calendar" || mode === "kanban" ? mode : "table";
|
|
3346
|
+
}
|
|
3347
|
+
/** Whether to offer the "+" (author a new custom view) button. Standalone
|
|
3348
|
+
* page only (the seed starts a chat). Feeds qualify too — their views are
|
|
3349
|
+
* authored under feeds/<slug>/ and the seed prompt points there. */
|
|
3350
|
+
const canAddCustomView = computed(() => Boolean(collection.value) && !embedded.value);
|
|
3351
|
+
/** Seed a chat asking Claude to author a new custom view for this collection.
|
|
3352
|
+
* Reuses the same chat-seed path as collection actions — the host injects a
|
|
3353
|
+
* templated prompt; Claude asks, authors the HTML, and registers it. The
|
|
3354
|
+
* authoring base is source-aware: a feed lives under `feeds/<slug>/`, every
|
|
3355
|
+
* other collection under the `data/skills/<slug>/` staging dir. */
|
|
3356
|
+
function addCustomView() {
|
|
3357
|
+
const current = collection.value;
|
|
3358
|
+
if (!current) return;
|
|
3359
|
+
const base = current.schema.ingest ? `feeds/${current.slug}` : `data/skills/${current.slug}`;
|
|
3360
|
+
const prompt = t("collectionsView.addViewPrompt", {
|
|
3361
|
+
title: current.title,
|
|
3362
|
+
base
|
|
3363
|
+
});
|
|
3364
|
+
if (props.sendTextMessage) {
|
|
3365
|
+
props.sendTextMessage(prompt);
|
|
3366
|
+
return;
|
|
3367
|
+
}
|
|
3368
|
+
appApi.startNewChat(prompt, cui.generalRoleId);
|
|
3369
|
+
}
|
|
3370
|
+
const configOpen = ref(false);
|
|
3371
|
+
/** Whether to offer the config gear. Standalone page only, and only when
|
|
3372
|
+
* there's a deletable custom view to manage — i.e. the collection is one
|
|
3373
|
+
* whose views the server will delete (project non-preset, or a feed; never a
|
|
3374
|
+
* read-only user-scope skill). Mirrors the server's refusal rules. */
|
|
3375
|
+
const canConfigureViews = computed(() => !embedded.value && hasCustomViews.value && (canDeleteCollection.value || isFeed.value));
|
|
3376
|
+
/** Reload the collection after the config modal deletes a view so the toggle
|
|
3377
|
+
* row + the modal's own list reflect the removal. */
|
|
3378
|
+
async function onViewsChanged() {
|
|
3379
|
+
const current = collection.value;
|
|
3380
|
+
if (current) await loadCollection(current.slug);
|
|
3381
|
+
}
|
|
3382
|
+
/** True when the calendar is the active body. */
|
|
3383
|
+
const calendarActive = computed(() => activeView.value === "calendar");
|
|
3384
|
+
/** True when the kanban is the active body. */
|
|
3385
|
+
const kanbanActive = computed(() => activeView.value === "kanban");
|
|
3386
|
+
const kanbanOverride = ref(props.initialGroupField ?? null);
|
|
3387
|
+
const kanbanGroupField = computed(() => {
|
|
3388
|
+
if (kanbanOverride.value && enumFields.value.includes(kanbanOverride.value)) return kanbanOverride.value;
|
|
3389
|
+
const hint = collection.value?.schema.kanbanField;
|
|
3390
|
+
if (hint && enumFields.value.includes(hint)) return hint;
|
|
3391
|
+
return enumFields.value[0] ?? "";
|
|
3392
|
+
});
|
|
3393
|
+
const anchorOverride = ref(props.initialAnchorField ?? null);
|
|
3394
|
+
const calendarAnchorField = computed(() => {
|
|
3395
|
+
if (anchorOverride.value && dateFields.value.includes(anchorOverride.value)) return anchorOverride.value;
|
|
3396
|
+
const hint = collection.value?.schema.calendarField;
|
|
3397
|
+
if (hint && dateFields.value.includes(hint)) return hint;
|
|
3398
|
+
return dateFields.value[0] ?? "";
|
|
3399
|
+
});
|
|
3400
|
+
const calendarEndField = computed(() => {
|
|
3401
|
+
const schema = collection.value?.schema;
|
|
3402
|
+
if (!schema?.calendarEndField) return void 0;
|
|
3403
|
+
return calendarAnchorField.value === schema.calendarField ? schema.calendarEndField : void 0;
|
|
3404
|
+
});
|
|
3405
|
+
const calendarTimeField = computed(() => {
|
|
3406
|
+
const schema = collection.value?.schema;
|
|
3407
|
+
if (!schema?.calendarTimeField) return void 0;
|
|
3408
|
+
return calendarAnchorField.value === schema.calendarField ? schema.calendarTimeField : void 0;
|
|
3409
|
+
});
|
|
3410
|
+
function setView(next) {
|
|
3411
|
+
view.value = next;
|
|
3412
|
+
}
|
|
3413
|
+
/** Select a custom view by id (builds the `custom:<id>` mode key). */
|
|
3414
|
+
function setCustomView(viewId) {
|
|
3415
|
+
view.value = `custom:${viewId}`;
|
|
3416
|
+
}
|
|
3417
|
+
/** Selector-key for a custom view, for active-state comparison in the template. */
|
|
3418
|
+
function customViewKey(viewId) {
|
|
3419
|
+
return `custom:${viewId}`;
|
|
3420
|
+
}
|
|
3421
|
+
/** A short, slug-safe id not already used by a loaded record. Collisions
|
|
3422
|
+
* are astronomically unlikely (32 bits), but we still re-roll a few
|
|
3423
|
+
* times against the in-memory set before giving up and using the last
|
|
3424
|
+
* candidate (the server's overwrite guard is the final backstop). */
|
|
3425
|
+
function generateUniqueItemId(primaryKey) {
|
|
3426
|
+
const existing = new Set(items.value.map((item) => String(item[primaryKey] ?? "")));
|
|
3427
|
+
let candidate = shortHexId();
|
|
3428
|
+
for (let attempt = 0; attempt < 8 && existing.has(candidate); attempt++) candidate = shortHexId();
|
|
3429
|
+
return candidate;
|
|
3430
|
+
}
|
|
3431
|
+
function openCreate() {
|
|
3432
|
+
if (!collection.value) return;
|
|
3433
|
+
const text = {};
|
|
3434
|
+
const bool = {};
|
|
3435
|
+
const boolOriginallyPresent = {};
|
|
3436
|
+
const boolTouched = {};
|
|
3437
|
+
const table = {};
|
|
3438
|
+
for (const [key, field] of Object.entries(collection.value.schema.fields)) if (field.type === "boolean") {
|
|
3439
|
+
bool[key] = false;
|
|
3440
|
+
boolOriginallyPresent[key] = false;
|
|
3441
|
+
boolTouched[key] = false;
|
|
3442
|
+
} else if (field.type === "table") table[key] = [];
|
|
3443
|
+
else if (field.type !== "derived" && field.type !== "embed" && field.type !== "toggle") text[key] = "";
|
|
3444
|
+
const { singleton, primaryKey } = collection.value.schema;
|
|
3445
|
+
if (singleton) text[primaryKey] = singleton;
|
|
3446
|
+
else if (primaryKey in text) text[primaryKey] = generateUniqueItemId(primaryKey);
|
|
3447
|
+
viewing.value = null;
|
|
3448
|
+
editing.value = {
|
|
3449
|
+
mode: "create",
|
|
3450
|
+
text,
|
|
3451
|
+
bool,
|
|
3452
|
+
boolOriginallyPresent,
|
|
3453
|
+
boolTouched,
|
|
3454
|
+
table,
|
|
3455
|
+
originalId: null
|
|
3456
|
+
};
|
|
3457
|
+
saveError.value = null;
|
|
3458
|
+
}
|
|
3459
|
+
function openEdit(item) {
|
|
3460
|
+
if (!collection.value) return;
|
|
3461
|
+
const text = {};
|
|
3462
|
+
const bool = {};
|
|
3463
|
+
const boolOriginallyPresent = {};
|
|
3464
|
+
const boolTouched = {};
|
|
3465
|
+
const table = {};
|
|
3466
|
+
for (const [key, field] of Object.entries(collection.value.schema.fields)) {
|
|
3467
|
+
const raw = item[key];
|
|
3468
|
+
if (field.type === "boolean") {
|
|
3469
|
+
bool[key] = raw === true;
|
|
3470
|
+
boolOriginallyPresent[key] = typeof raw === "boolean";
|
|
3471
|
+
boolTouched[key] = false;
|
|
3472
|
+
} else if (field.type === "table" && field.of) {
|
|
3473
|
+
const sub = field.of;
|
|
3474
|
+
table[key] = (Array.isArray(raw) ? raw : []).filter((row) => Boolean(row) && typeof row === "object" && !Array.isArray(row)).map((row) => rowFromItem(row, sub));
|
|
3475
|
+
} else if (field.type !== "derived" && field.type !== "embed" && field.type !== "toggle") text[key] = raw === void 0 || raw === null ? "" : String(raw);
|
|
3476
|
+
}
|
|
3477
|
+
const primaryRaw = item[collection.value.schema.primaryKey];
|
|
3478
|
+
const originalId = typeof primaryRaw === "string" ? primaryRaw : String(primaryRaw ?? "");
|
|
3479
|
+
viewing.value = null;
|
|
3480
|
+
editing.value = {
|
|
3481
|
+
mode: "edit",
|
|
3482
|
+
text,
|
|
3483
|
+
bool,
|
|
3484
|
+
boolOriginallyPresent,
|
|
3485
|
+
boolTouched,
|
|
3486
|
+
table,
|
|
3487
|
+
originalId
|
|
3488
|
+
};
|
|
3489
|
+
saveError.value = null;
|
|
3490
|
+
}
|
|
3491
|
+
function closeEditor() {
|
|
3492
|
+
editing.value = null;
|
|
3493
|
+
saving.value = false;
|
|
3494
|
+
saveError.value = null;
|
|
3495
|
+
}
|
|
3496
|
+
/** Cancel the editor. Edit → reopen the record's read-only detail (don't
|
|
3497
|
+
* collapse the panel); create → just close (no prior detail to show). */
|
|
3498
|
+
function cancelEditor() {
|
|
3499
|
+
const draft = editing.value;
|
|
3500
|
+
const returnTo = draft && draft.mode === "edit" ? draft.originalId : null;
|
|
3501
|
+
closeEditor();
|
|
3502
|
+
if (returnTo) {
|
|
3503
|
+
const item = findItemById(returnTo);
|
|
3504
|
+
if (item) showDetail(item);
|
|
3505
|
+
}
|
|
3506
|
+
}
|
|
3507
|
+
/** Open mode (read-only detail). Toggles: clicking the already-open row
|
|
3508
|
+
* collapses it. Opening a row cancels any in-progress edit (one panel
|
|
3509
|
+
* open at a time). In embedded mode, report the open id so the host
|
|
3510
|
+
* card can persist it in `viewState`. */
|
|
3511
|
+
function openView(item) {
|
|
3512
|
+
if (isRowOpen(item) && !editing.value) {
|
|
3513
|
+
closeView();
|
|
3514
|
+
return;
|
|
3515
|
+
}
|
|
3516
|
+
if (editing.value) closeEditor();
|
|
3517
|
+
showDetail(item);
|
|
3518
|
+
}
|
|
3519
|
+
/** Open the read-only detail for a record WITHOUT the click-toggle. Used
|
|
3520
|
+
* when reopening detail programmatically (after save / cancel), where
|
|
3521
|
+
* `openView`'s "click the open row to collapse" guard would otherwise
|
|
3522
|
+
* immediately close a row the embedded `viewState` sync just reopened. */
|
|
3523
|
+
function showDetail(item) {
|
|
3524
|
+
viewing.value = item;
|
|
3525
|
+
actionError.value = null;
|
|
3526
|
+
if (embedded.value && collection.value) emit("select", String(item[collection.value.schema.primaryKey] ?? ""));
|
|
3527
|
+
}
|
|
3528
|
+
/** Close open mode. Embedded mode reports the close via `select(null)`
|
|
3529
|
+
* (the card clears its `viewState`); standalone mode drops the
|
|
3530
|
+
* `?selected=` query param so a refresh / back-button doesn't reopen
|
|
3531
|
+
* the record and the URL reflects the closed state. */
|
|
3532
|
+
function closeView() {
|
|
3533
|
+
viewing.value = null;
|
|
3534
|
+
actionError.value = null;
|
|
3535
|
+
if (embedded.value) {
|
|
3536
|
+
emit("select", null);
|
|
3537
|
+
return;
|
|
3538
|
+
}
|
|
3539
|
+
if (cui.routeSelectedId() !== void 0) cui.setSelectedId(null);
|
|
3540
|
+
}
|
|
3541
|
+
/** Backdrop click / Escape on the shared record modal. While editing this
|
|
3542
|
+
* cancels the draft (reopening the detail, matching the in-panel Cancel
|
|
3543
|
+
* button — so a stray click never silently discards edits); while viewing
|
|
3544
|
+
* it closes the detail. */
|
|
3545
|
+
function closeRecordModal() {
|
|
3546
|
+
if (editing.value) {
|
|
3547
|
+
cancelEditor();
|
|
3548
|
+
return;
|
|
3549
|
+
}
|
|
3550
|
+
closeView();
|
|
3551
|
+
}
|
|
3552
|
+
/** Hand off from open mode to the editor for the same record. */
|
|
3553
|
+
function editFromView() {
|
|
3554
|
+
const item = viewing.value;
|
|
3555
|
+
if (!item) return;
|
|
3556
|
+
viewing.value = null;
|
|
3557
|
+
openEdit(item);
|
|
3558
|
+
}
|
|
3559
|
+
function findItemById(itemId) {
|
|
3560
|
+
if (!collection.value) return void 0;
|
|
3561
|
+
const { primaryKey } = collection.value.schema;
|
|
3562
|
+
return items.value.find((item) => String(item[primaryKey] ?? "") === itemId);
|
|
3563
|
+
}
|
|
3564
|
+
/** Reconcile the open-mode view with the `?selected=<id>` query —
|
|
3565
|
+
* the single source of truth for which record is open. Opens the
|
|
3566
|
+
* matching record, or closes the modal when the param is absent /
|
|
3567
|
+
* empty / points at an id that isn't loaded (deleted record, stale
|
|
3568
|
+
* link). Keeping `viewing` in lockstep with the URL means browser
|
|
3569
|
+
* back / forward and a removed param both close the modal instead
|
|
3570
|
+
* of leaving stale UI on screen (Codex P2 + CodeRabbit on #1502). */
|
|
3571
|
+
function syncViewToSelected() {
|
|
3572
|
+
const selected = activeSelected.value;
|
|
3573
|
+
if (typeof selected !== "string" || selected.length === 0) {
|
|
3574
|
+
viewing.value = null;
|
|
3575
|
+
return;
|
|
3576
|
+
}
|
|
3577
|
+
viewing.value = findItemById(selected) ?? null;
|
|
3578
|
+
}
|
|
3579
|
+
/** Title for the open-mode header: the record's primary-key value
|
|
3580
|
+
* (e.g. `INV-2026-0001`), falling back to the collection title.
|
|
3581
|
+
* Non-string primary keys (numeric ids) are stringified rather
|
|
3582
|
+
* than discarded (CodeRabbit on #1502). */
|
|
3583
|
+
const viewTitle = computed(() => {
|
|
3584
|
+
if (!viewing.value || !collection.value) return "";
|
|
3585
|
+
const pkValue = viewing.value[collection.value.schema.primaryKey];
|
|
3586
|
+
if (pkValue === void 0 || pkValue === null || pkValue === "") return collection.value.title ?? "";
|
|
3587
|
+
return String(pkValue);
|
|
3588
|
+
});
|
|
3589
|
+
/** Live computed record from the current draft. Drives derived
|
|
3590
|
+
* field displays in the form so subtotal/tax/total update as
|
|
3591
|
+
* the user edits line items. */
|
|
3592
|
+
const liveRecord = computed(() => {
|
|
3593
|
+
if (!collection.value || !editing.value) return null;
|
|
3594
|
+
return draftToRecord(editing.value, collection.value.schema);
|
|
3595
|
+
});
|
|
3596
|
+
/** Live record with derived fields resolved (drives the form's
|
|
3597
|
+
* read-only derived inputs). Derivation lives in the shared
|
|
3598
|
+
* rendering composable; this binds it to the current draft. */
|
|
3599
|
+
const liveDerived = computed(() => {
|
|
3600
|
+
if (!collection.value || !liveRecord.value) return null;
|
|
3601
|
+
return render.deriveAll(collection.value.schema, liveRecord.value, refRecordCache.value);
|
|
3602
|
+
});
|
|
3603
|
+
/** Short summary for a `table`-typed cell in the main collection
|
|
3604
|
+
* table. Counts rows; nothing fancier yet (per-row preview is
|
|
3605
|
+
* hard to fit in a single cell). */
|
|
3606
|
+
function tableSummary(value) {
|
|
3607
|
+
if (!Array.isArray(value)) return "—";
|
|
3608
|
+
if (value.length === 0) return "—";
|
|
3609
|
+
return t("collectionsView.tableSummary", { count: value.length });
|
|
3610
|
+
}
|
|
3611
|
+
async function saveEditor() {
|
|
3612
|
+
if (!collection.value || !editing.value) return;
|
|
3613
|
+
const { slug, schema } = collection.value;
|
|
3614
|
+
const draft = editing.value;
|
|
3615
|
+
saveError.value = null;
|
|
3616
|
+
const missing = firstMissingRequiredField(draft, schema);
|
|
3617
|
+
if (missing) {
|
|
3618
|
+
saveError.value = `${missing}: ${t("collectionsView.requiredField")}`;
|
|
3619
|
+
return;
|
|
3620
|
+
}
|
|
3621
|
+
saving.value = true;
|
|
3622
|
+
const record = draftToRecord(draft, schema);
|
|
3623
|
+
const result = draft.mode === "create" ? await cui.createItem(slug, record) : await cui.updateItem(slug, draft.originalId ?? "", record);
|
|
3624
|
+
saving.value = false;
|
|
3625
|
+
if (!result.ok) {
|
|
3626
|
+
saveError.value = result.error;
|
|
3627
|
+
return;
|
|
3628
|
+
}
|
|
3629
|
+
const savedId = result.data.itemId;
|
|
3630
|
+
closeEditor();
|
|
3631
|
+
await loadCollection(slug);
|
|
3632
|
+
const saved = findItemById(savedId);
|
|
3633
|
+
if (saved) showDetail(saved);
|
|
3634
|
+
}
|
|
3635
|
+
/** Write a single cell's value directly onto the live `items` entry.
|
|
3636
|
+
* Reactive in Vue 3 (proxy), so the bound checkbox/select re-renders.
|
|
3637
|
+
* `undefined` (enum cleared to the placeholder) renders as the empty
|
|
3638
|
+
* option; the PUT body omits the key via `buildUpdatedRecord`. */
|
|
3639
|
+
function applyInlineValue(item, key, value) {
|
|
3640
|
+
item[key] = value;
|
|
3641
|
+
}
|
|
3642
|
+
/** True while this row has an inline cell save in flight — its inline
|
|
3643
|
+
* controls render disabled to serialize edits (one PUT per row). */
|
|
3644
|
+
function isRowInlineSaving(item) {
|
|
3645
|
+
return inlineSavingRows.value.has(rowId(item));
|
|
3646
|
+
}
|
|
3647
|
+
/** Inline table-cell edit (boolean checkbox / enum dropdown): optimistic
|
|
3648
|
+
* update, then PUT the full record. Gated per row so a second edit can't
|
|
3649
|
+
* race the in-flight one. On failure, roll the cell back and surface the
|
|
3650
|
+
* error. Bypasses the detail/edit panel entirely. */
|
|
3651
|
+
async function commitInlineEdit(item, key, field, raw) {
|
|
3652
|
+
if (!collection.value) return;
|
|
3653
|
+
const { slug } = collection.value;
|
|
3654
|
+
const itemId = rowId(item);
|
|
3655
|
+
if (!itemId || inlineSavingRows.value.has(itemId)) return;
|
|
3656
|
+
const previous = item[key];
|
|
3657
|
+
const coerced = coerceInlineValue(field, raw);
|
|
3658
|
+
applyInlineValue(item, key, coerced);
|
|
3659
|
+
inlineError.value = null;
|
|
3660
|
+
inlineSavingRows.value.add(itemId);
|
|
3661
|
+
const result = await cui.updateItem(slug, itemId, buildUpdatedRecord(item, key, coerced));
|
|
3662
|
+
inlineSavingRows.value.delete(itemId);
|
|
3663
|
+
if (!result.ok) {
|
|
3664
|
+
applyInlineValue(item, key, previous);
|
|
3665
|
+
inlineError.value = result.error;
|
|
3666
|
+
}
|
|
3667
|
+
}
|
|
3668
|
+
/** Whether a `toggle` field reads as checked: its projected enum field
|
|
3669
|
+
* currently equals `onValue`. The toggle stores nothing itself. */
|
|
3670
|
+
function toggleChecked(item, field) {
|
|
3671
|
+
return field.field !== void 0 && String(item[field.field] ?? "") === field.onValue;
|
|
3672
|
+
}
|
|
3673
|
+
/** Flip a `toggle`: write the projected enum field to `offValue` when
|
|
3674
|
+
* currently checked, else `onValue`. Reuses the inline-edit PUT path
|
|
3675
|
+
* (optimistic + rollback) — the toggle has no value of its own. */
|
|
3676
|
+
function commitToggle(item, field) {
|
|
3677
|
+
const targetKey = field.field;
|
|
3678
|
+
if (!targetKey || !collection.value) return;
|
|
3679
|
+
const enumField = collection.value.schema.fields[targetKey];
|
|
3680
|
+
if (!enumField) return;
|
|
3681
|
+
const next = toggleChecked(item, field) ? field.offValue : field.onValue;
|
|
3682
|
+
if (next === void 0) return;
|
|
3683
|
+
commitInlineEdit(item, targetKey, enumField, next);
|
|
3684
|
+
}
|
|
3685
|
+
async function confirmDelete(item) {
|
|
3686
|
+
if (!collection.value) return;
|
|
3687
|
+
const { slug } = collection.value;
|
|
3688
|
+
const { primaryKey } = collection.value.schema;
|
|
3689
|
+
const idRaw = item[primaryKey];
|
|
3690
|
+
const itemId = typeof idRaw === "string" ? idRaw : String(idRaw ?? "");
|
|
3691
|
+
if (!itemId) return;
|
|
3692
|
+
if (!await openConfirm({
|
|
3693
|
+
message: t("collectionsView.confirmDelete"),
|
|
3694
|
+
confirmText: t("common.remove"),
|
|
3695
|
+
cancelText: t("common.cancel"),
|
|
3696
|
+
variant: "danger"
|
|
3697
|
+
})) return;
|
|
3698
|
+
const result = await cui.deleteItem(slug, itemId);
|
|
3699
|
+
if (!result.ok) {
|
|
3700
|
+
loadError.value = result.error;
|
|
3701
|
+
return;
|
|
3702
|
+
}
|
|
3703
|
+
await loadCollection(slug);
|
|
3704
|
+
}
|
|
3705
|
+
async function confirmCollectionDelete() {
|
|
3706
|
+
const current = collection.value;
|
|
3707
|
+
if (!current) return;
|
|
3708
|
+
const { slug, title } = current;
|
|
3709
|
+
if (!await openConfirm({
|
|
3710
|
+
message: t("collectionsView.confirmDeleteCollection", { title }),
|
|
3711
|
+
confirmText: t("common.remove"),
|
|
3712
|
+
cancelText: t("common.cancel"),
|
|
3713
|
+
variant: "danger"
|
|
3714
|
+
})) return;
|
|
3715
|
+
const result = await cui.deleteCollection(slug);
|
|
3716
|
+
if (!result.ok) {
|
|
3717
|
+
loadError.value = result.error;
|
|
3718
|
+
return;
|
|
3719
|
+
}
|
|
3720
|
+
cui.gotoIndex("collection");
|
|
3721
|
+
}
|
|
3722
|
+
function goBack() {
|
|
3723
|
+
cui.gotoIndex(isFeedRoute.value ? "feed" : "collection");
|
|
3724
|
+
}
|
|
3725
|
+
async function confirmFeedDelete() {
|
|
3726
|
+
const current = collection.value;
|
|
3727
|
+
if (!current) return;
|
|
3728
|
+
const { slug, title } = current;
|
|
3729
|
+
if (!await openConfirm({
|
|
3730
|
+
message: t("collectionsView.confirmDeleteFeed", { title }),
|
|
3731
|
+
confirmText: t("common.remove"),
|
|
3732
|
+
cancelText: t("common.cancel"),
|
|
3733
|
+
variant: "danger"
|
|
3734
|
+
})) return;
|
|
3735
|
+
const result = await cui.deleteFeed(slug);
|
|
3736
|
+
if (!result.ok) {
|
|
3737
|
+
loadError.value = result.error;
|
|
3738
|
+
return;
|
|
3739
|
+
}
|
|
3740
|
+
cui.gotoIndex("feed");
|
|
3741
|
+
}
|
|
3742
|
+
/** Open the create form with the clicked calendar day prefilled into the
|
|
3743
|
+
* anchor field. The calendar day view's + affordance; the create flow itself
|
|
3744
|
+
* is the same one the Add button uses. A `datetime` anchor renders as a
|
|
3745
|
+
* `datetime-local` input, which rejects a bare `YYYY-MM-DD` — seed midnight
|
|
3746
|
+
* so the chosen day actually survives the prefill. */
|
|
3747
|
+
function createOnDate(iso) {
|
|
3748
|
+
if (!canCreate.value) return;
|
|
3749
|
+
openCreate();
|
|
3750
|
+
const anchor = calendarAnchorField.value;
|
|
3751
|
+
if (!editing.value || !anchor) return;
|
|
3752
|
+
const anchorType = collection.value?.schema.fields[anchor]?.type;
|
|
3753
|
+
editing.value.text[anchor] = anchorType === "datetime" ? `${iso}T00:00` : iso;
|
|
3754
|
+
}
|
|
3755
|
+
/** The civil day a record sits on, from its calendar anchor field (handles
|
|
3756
|
+
* both `date` and `datetime`). Null for undated records. */
|
|
3757
|
+
function dayOfItem(item) {
|
|
3758
|
+
return dateOf(item[calendarAnchorField.value]);
|
|
3759
|
+
}
|
|
3760
|
+
/** Mirror the open record into the `?selected=<id>` query (standalone mode)
|
|
3761
|
+
* so the calendar's day-view + selection is a copy-pasteable link. In-app
|
|
3762
|
+
* selection didn't previously touch the URL; the calendar now does. */
|
|
3763
|
+
function writeSelectedToUrl(itemId) {
|
|
3764
|
+
if (embedded.value || cui.routeSelectedId() === itemId) return;
|
|
3765
|
+
cui.setSelectedId(itemId);
|
|
3766
|
+
}
|
|
3767
|
+
/** Calendar chip / kanban card click → open that record's detail. In the
|
|
3768
|
+
* calendar it opens the day (time-allocation) popup on the record's day with
|
|
3769
|
+
* the detail in the right pane; an undated record falls back to the panel
|
|
3770
|
+
* below the grid. Unlike `openView`, this never toggles — a second click on
|
|
3771
|
+
* the same record keeps it open. */
|
|
3772
|
+
function onCalendarSelect(itemId) {
|
|
3773
|
+
if (!itemId) {
|
|
3774
|
+
closeView();
|
|
3775
|
+
return;
|
|
3776
|
+
}
|
|
3777
|
+
const item = findItemById(itemId);
|
|
3778
|
+
if (!item) return;
|
|
3779
|
+
if (editing.value) closeEditor();
|
|
3780
|
+
if (calendarActive.value) openDay.value = dayOfItem(item);
|
|
3781
|
+
showDetail(item);
|
|
3782
|
+
writeSelectedToUrl(itemId);
|
|
3783
|
+
}
|
|
3784
|
+
/** A calendar day cell was activated → open its popup on a clean slate
|
|
3785
|
+
* (clear any prior selection so the popup opens timeline-only). */
|
|
3786
|
+
function onOpenDay(day) {
|
|
3787
|
+
if (editing.value) closeEditor();
|
|
3788
|
+
closeView();
|
|
3789
|
+
openDay.value = day;
|
|
3790
|
+
}
|
|
3791
|
+
/** Close the day popup: drop the open day, the selection, AND any in-progress
|
|
3792
|
+
* draft together. Clearing `editing` matters because the shared record modal
|
|
3793
|
+
* shows whenever `editing` is set and no day is open — so without this, an
|
|
3794
|
+
* edit/create started inside the day popup would re-appear in the centred
|
|
3795
|
+
* modal the instant the popup closed (Codex P2 on #1656). */
|
|
3796
|
+
function onDayClose() {
|
|
3797
|
+
openDay.value = null;
|
|
3798
|
+
if (editing.value) closeEditor();
|
|
3799
|
+
closeView();
|
|
3800
|
+
}
|
|
3801
|
+
/** Deep-link entry: a `?selected=<id>` link to a calendar-capable collection
|
|
3802
|
+
* opens in calendar view with the popup focused on the record's day. Runs
|
|
3803
|
+
* on load / slug change only (not on in-app selection), so table users
|
|
3804
|
+
* aren't forced into the calendar. */
|
|
3805
|
+
function maybeOpenCalendarForSelected() {
|
|
3806
|
+
if (embedded.value || !hasCalendar.value || !viewing.value) return;
|
|
3807
|
+
const day = dayOfItem(viewing.value);
|
|
3808
|
+
if (!day) return;
|
|
3809
|
+
view.value = "calendar";
|
|
3810
|
+
openDay.value = day;
|
|
3811
|
+
}
|
|
3812
|
+
/** Kanban card dropped in a column → set the record's group field to the
|
|
3813
|
+
* column value (the empty string clears it for the Uncategorized column).
|
|
3814
|
+
* Reuses the inline-edit path (optimistic write + PUT + rollback). */
|
|
3815
|
+
function onKanbanMove(itemId, value) {
|
|
3816
|
+
const item = findItemById(itemId);
|
|
3817
|
+
const key = kanbanGroupField.value;
|
|
3818
|
+
const field = collection.value?.schema.fields[key];
|
|
3819
|
+
if (!item || !field) return;
|
|
3820
|
+
commitInlineEdit(item, key, field, value);
|
|
3821
|
+
}
|
|
3822
|
+
watch(activeSlug, (slug, prevSlug) => {
|
|
3823
|
+
if (prevSlug !== void 0 && slug !== prevSlug) {
|
|
3824
|
+
view.value = slug && readCollectionViewMode(slug) || "table";
|
|
3825
|
+
anchorOverride.value = null;
|
|
3826
|
+
kanbanOverride.value = null;
|
|
3827
|
+
sortState.value = storedSortFor(slug);
|
|
3828
|
+
}
|
|
3829
|
+
if (slug) loadCollection(slug);
|
|
3830
|
+
else {
|
|
3831
|
+
collection.value = null;
|
|
3832
|
+
items.value = [];
|
|
3833
|
+
enumOriginallyEmpty.value = /* @__PURE__ */ new Set();
|
|
3834
|
+
inlineSavingRows.value = /* @__PURE__ */ new Set();
|
|
3835
|
+
searchQuery.value = "";
|
|
3836
|
+
loading.value = false;
|
|
3837
|
+
}
|
|
3838
|
+
}, { immediate: true });
|
|
3839
|
+
watch([
|
|
3840
|
+
activeView,
|
|
3841
|
+
calendarAnchorField,
|
|
3842
|
+
kanbanGroupField,
|
|
3843
|
+
sortState,
|
|
3844
|
+
loading
|
|
3845
|
+
], () => {
|
|
3846
|
+
if (embedded.value) emit("viewStateChange", {
|
|
3847
|
+
view: builtInViewOrTable(activeView.value),
|
|
3848
|
+
anchorField: calendarAnchorField.value,
|
|
3849
|
+
groupField: kanbanGroupField.value
|
|
3850
|
+
});
|
|
3851
|
+
if (activeSlug.value && !loading.value && collection.value) {
|
|
3852
|
+
if (!embedded.value) writeCollectionViewMode(activeSlug.value, activeView.value);
|
|
3853
|
+
writeCollectionSort(activeSlug.value, sortState.value);
|
|
3854
|
+
}
|
|
3855
|
+
});
|
|
3856
|
+
watch(activeSelected, () => {
|
|
3857
|
+
if (loading.value || !collection.value) return;
|
|
3858
|
+
syncViewToSelected();
|
|
3859
|
+
openDay.value = viewing.value ? dayOfItem(viewing.value) : null;
|
|
3860
|
+
});
|
|
3861
|
+
return (_ctx, _cache) => {
|
|
3862
|
+
const _component_router_link = resolveComponent("router-link");
|
|
3863
|
+
return openBlock(), createElementBlock("div", _hoisted_1$2, [
|
|
3864
|
+
createElementVNode("header", _hoisted_2$2, [
|
|
3865
|
+
!embedded.value ? (openBlock(), createElementBlock("button", {
|
|
3866
|
+
key: 0,
|
|
3867
|
+
type: "button",
|
|
3868
|
+
class: "h-8 w-8 flex items-center justify-center rounded text-slate-500 hover:bg-slate-50 hover:text-slate-800 transition-colors",
|
|
3869
|
+
title: unref(t)("collectionsView.backToIndex"),
|
|
3870
|
+
"aria-label": unref(t)("collectionsView.backToIndex"),
|
|
3871
|
+
"data-testid": "collections-back",
|
|
3872
|
+
onClick: goBack
|
|
3873
|
+
}, [..._cache[25] || (_cache[25] = [createElementVNode("span", { class: "material-icons text-lg" }, "arrow_back", -1)])], 8, _hoisted_3$2)) : createCommentVNode("", true),
|
|
3874
|
+
collection.value ? (openBlock(), createElementBlock("div", _hoisted_4$2, [createElementVNode("span", _hoisted_5$2, toDisplayString(collection.value.icon), 1)])) : createCommentVNode("", true),
|
|
3875
|
+
createElementVNode("div", _hoisted_6$2, [createElementVNode("h1", _hoisted_7$2, toDisplayString(collection.value?.title ?? unref(t)("collectionsView.title")), 1), collection.value ? (openBlock(), createElementBlock("span", _hoisted_8$2, toDisplayString(collection.value.slug), 1)) : createCommentVNode("", true)]),
|
|
3876
|
+
collection.value && !embedded.value ? (openBlock(), createBlock(resolveDynamicComponent(unref(pinToggle)), {
|
|
3877
|
+
key: 2,
|
|
3878
|
+
kind: isFeedRoute.value ? "feed" : "collection",
|
|
3879
|
+
slug: collection.value.slug,
|
|
3880
|
+
title: collection.value.title,
|
|
3881
|
+
icon: collection.value.icon
|
|
3882
|
+
}, null, 8, [
|
|
3883
|
+
"kind",
|
|
3884
|
+
"slug",
|
|
3885
|
+
"title",
|
|
3886
|
+
"icon"
|
|
3887
|
+
])) : createCommentVNode("", true),
|
|
3888
|
+
collection.value?.schema.ingest ? (openBlock(), createElementBlock("button", {
|
|
3889
|
+
key: 3,
|
|
3890
|
+
type: "button",
|
|
3891
|
+
class: "h-8 px-2.5 flex items-center gap-1 rounded border border-indigo-200 bg-white hover:bg-indigo-50 text-indigo-600 font-bold text-xs transition-colors disabled:opacity-50",
|
|
3892
|
+
disabled: refreshing.value,
|
|
3893
|
+
"data-testid": "collections-refresh-feed",
|
|
3894
|
+
onClick: refreshFeed
|
|
3895
|
+
}, [createElementVNode("span", _hoisted_10$2, toDisplayString(refreshing.value ? "hourglass_empty" : "refresh"), 1), createElementVNode("span", null, toDisplayString(unref(t)("collectionsView.refreshFeed")), 1)], 8, _hoisted_9$2)) : createCommentVNode("", true),
|
|
3896
|
+
collection.value ? (openBlock(), createElementBlock("button", {
|
|
3897
|
+
key: 4,
|
|
3898
|
+
type: "button",
|
|
3899
|
+
class: "h-8 px-2.5 flex items-center gap-1 rounded border border-indigo-200 bg-white hover:bg-indigo-50 text-indigo-600 font-bold text-xs transition-colors",
|
|
3900
|
+
"data-testid": "collections-chat",
|
|
3901
|
+
onClick: openChat
|
|
3902
|
+
}, [_cache[26] || (_cache[26] = createElementVNode("span", { class: "material-icons text-sm" }, "forum", -1)), createElementVNode("span", null, toDisplayString(unref(t)("collectionsView.chat")), 1)])) : createCommentVNode("", true),
|
|
3903
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(collectionActions.value, (action) => {
|
|
3904
|
+
return openBlock(), createElementBlock("button", {
|
|
3905
|
+
key: action.id,
|
|
3906
|
+
type: "button",
|
|
3907
|
+
class: "h-8 px-2.5 flex items-center gap-1 rounded border border-indigo-200 bg-white hover:bg-indigo-50 text-indigo-600 font-bold text-xs transition-colors disabled:opacity-50",
|
|
3908
|
+
disabled: collectionActionPending.value,
|
|
3909
|
+
"data-testid": `collections-action-${action.id}`,
|
|
3910
|
+
onClick: ($event) => runCollectionAction(action)
|
|
3911
|
+
}, [action.icon ? (openBlock(), createElementBlock("span", _hoisted_12$2, toDisplayString(action.icon), 1)) : createCommentVNode("", true), createElementVNode("span", null, toDisplayString(action.label), 1)], 8, _hoisted_11$2);
|
|
3912
|
+
}), 128)),
|
|
3913
|
+
canCreate.value && !calendarActive.value ? (openBlock(), createElementBlock("button", {
|
|
3914
|
+
key: 5,
|
|
3915
|
+
type: "button",
|
|
3916
|
+
class: "h-8 px-2.5 flex items-center gap-1 rounded bg-indigo-600 hover:bg-indigo-700 text-white font-bold text-xs transition-colors shadow-sm",
|
|
3917
|
+
"data-testid": "collections-add-item",
|
|
3918
|
+
onClick: openCreate
|
|
3919
|
+
}, [_cache[27] || (_cache[27] = createElementVNode("span", { class: "material-icons text-sm" }, "add", -1)), createElementVNode("span", null, toDisplayString(unref(t)("common.add")), 1)])) : createCommentVNode("", true),
|
|
3920
|
+
canDeleteCollection.value && !embedded.value ? (openBlock(), createElementBlock("button", {
|
|
3921
|
+
key: 6,
|
|
3922
|
+
type: "button",
|
|
3923
|
+
class: "h-8 w-8 flex items-center justify-center rounded border border-rose-200 bg-white text-rose-600 hover:bg-rose-50 transition-colors",
|
|
3924
|
+
title: unref(t)("collectionsView.deleteCollection"),
|
|
3925
|
+
"aria-label": unref(t)("collectionsView.deleteCollection"),
|
|
3926
|
+
"data-testid": "collections-delete",
|
|
3927
|
+
onClick: confirmCollectionDelete
|
|
3928
|
+
}, [..._cache[28] || (_cache[28] = [createElementVNode("span", { class: "material-icons text-sm" }, "delete_forever", -1)])], 8, _hoisted_13$2)) : createCommentVNode("", true),
|
|
3929
|
+
canDeleteFeed.value && !embedded.value ? (openBlock(), createElementBlock("button", {
|
|
3930
|
+
key: 7,
|
|
3931
|
+
type: "button",
|
|
3932
|
+
class: "h-8 w-8 flex items-center justify-center rounded border border-rose-200 bg-white text-rose-600 hover:bg-rose-50 transition-colors",
|
|
3933
|
+
title: unref(t)("collectionsView.deleteFeed"),
|
|
3934
|
+
"aria-label": unref(t)("collectionsView.deleteFeed"),
|
|
3935
|
+
"data-testid": "feeds-delete",
|
|
3936
|
+
onClick: confirmFeedDelete
|
|
3937
|
+
}, [..._cache[29] || (_cache[29] = [createElementVNode("span", { class: "material-icons text-sm" }, "delete_forever", -1)])], 8, _hoisted_14$2)) : createCommentVNode("", true)
|
|
3938
|
+
]),
|
|
3939
|
+
collection.value && (items.value.length > 0 || hasCalendar.value || hasKanban.value || hasCustomViews.value || canAddCustomView.value) ? (openBlock(), createElementBlock("div", _hoisted_15$2, [items.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_16$1, [
|
|
3940
|
+
_cache[31] || (_cache[31] = createElementVNode("span", { class: "absolute inset-y-0 left-0 flex items-center pl-3 text-slate-400 pointer-events-none" }, [createElementVNode("span", { class: "material-icons text-lg" }, "search")], -1)),
|
|
3941
|
+
withDirectives(createElementVNode("input", {
|
|
3942
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => searchQuery.value = $event),
|
|
3943
|
+
type: "text",
|
|
3944
|
+
placeholder: unref(t)("collectionsView.searchPlaceholder"),
|
|
3945
|
+
"aria-label": unref(t)("collectionsView.searchPlaceholder"),
|
|
3946
|
+
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"
|
|
3947
|
+
}, null, 8, _hoisted_17$1), [[vModelText, searchQuery.value]]),
|
|
3948
|
+
searchQuery.value ? (openBlock(), createElementBlock("button", {
|
|
3949
|
+
key: 0,
|
|
3950
|
+
type: "button",
|
|
3951
|
+
"aria-label": unref(t)("collectionsView.clearSearch"),
|
|
3952
|
+
class: "absolute inset-y-0 right-0 flex items-center pr-2.5 text-slate-400 hover:text-slate-600",
|
|
3953
|
+
onClick: _cache[1] || (_cache[1] = ($event) => searchQuery.value = "")
|
|
3954
|
+
}, [..._cache[30] || (_cache[30] = [createElementVNode("span", { class: "material-icons text-sm" }, "close", -1)])], 8, _hoisted_18$1)) : createCommentVNode("", true)
|
|
3955
|
+
])) : createCommentVNode("", true), createElementVNode("div", _hoisted_19$1, [
|
|
3956
|
+
hasCalendar.value || hasKanban.value || hasCustomViews.value || canAddCustomView.value ? (openBlock(), createElementBlock("div", {
|
|
3957
|
+
key: 0,
|
|
3958
|
+
class: "flex gap-0.5",
|
|
3959
|
+
role: "group",
|
|
3960
|
+
"aria-label": unref(t)("collectionsView.viewToggle")
|
|
3961
|
+
}, [
|
|
3962
|
+
createElementVNode("button", {
|
|
3963
|
+
type: "button",
|
|
3964
|
+
class: normalizeClass(["h-8 px-2.5 flex items-center gap-1 rounded text-xs font-bold transition-colors", activeView.value === "table" ? "bg-indigo-600 text-white" : "bg-white text-slate-500 border border-slate-200 hover:bg-slate-50"]),
|
|
3965
|
+
"aria-pressed": activeView.value === "table",
|
|
3966
|
+
"data-testid": "collection-view-toggle-table",
|
|
3967
|
+
onClick: _cache[2] || (_cache[2] = ($event) => setView("table"))
|
|
3968
|
+
}, [_cache[32] || (_cache[32] = createElementVNode("span", { class: "material-icons text-sm" }, "table_rows", -1)), createElementVNode("span", null, toDisplayString(unref(t)("collectionsView.viewTable")), 1)], 10, _hoisted_21$1),
|
|
3969
|
+
hasCalendar.value ? (openBlock(), createElementBlock("button", {
|
|
3970
|
+
key: 0,
|
|
3971
|
+
type: "button",
|
|
3972
|
+
class: normalizeClass(["h-8 px-2.5 flex items-center gap-1 rounded text-xs font-bold transition-colors", activeView.value === "calendar" ? "bg-indigo-600 text-white" : "bg-white text-slate-500 border border-slate-200 hover:bg-slate-50"]),
|
|
3973
|
+
"aria-pressed": activeView.value === "calendar",
|
|
3974
|
+
"data-testid": "collection-view-toggle-calendar",
|
|
3975
|
+
onClick: _cache[3] || (_cache[3] = ($event) => setView("calendar"))
|
|
3976
|
+
}, [_cache[33] || (_cache[33] = createElementVNode("span", { class: "material-icons text-sm" }, "calendar_month", -1)), createElementVNode("span", null, toDisplayString(unref(t)("collectionsView.viewCalendar")), 1)], 10, _hoisted_22$1)) : createCommentVNode("", true),
|
|
3977
|
+
hasKanban.value ? (openBlock(), createElementBlock("button", {
|
|
3978
|
+
key: 1,
|
|
3979
|
+
type: "button",
|
|
3980
|
+
class: normalizeClass(["h-8 px-2.5 flex items-center gap-1 rounded text-xs font-bold transition-colors", activeView.value === "kanban" ? "bg-indigo-600 text-white" : "bg-white text-slate-500 border border-slate-200 hover:bg-slate-50"]),
|
|
3981
|
+
"aria-pressed": activeView.value === "kanban",
|
|
3982
|
+
"data-testid": "collection-view-toggle-kanban",
|
|
3983
|
+
onClick: _cache[4] || (_cache[4] = ($event) => setView("kanban"))
|
|
3984
|
+
}, [_cache[34] || (_cache[34] = createElementVNode("span", { class: "material-icons text-sm" }, "view_kanban", -1)), createElementVNode("span", null, toDisplayString(unref(t)("collectionsView.viewKanban")), 1)], 10, _hoisted_23$1)) : createCommentVNode("", true),
|
|
3985
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(customViews.value, (cv) => {
|
|
3986
|
+
return openBlock(), createElementBlock("button", {
|
|
3987
|
+
key: cv.id,
|
|
3988
|
+
type: "button",
|
|
3989
|
+
class: 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"]),
|
|
3990
|
+
"aria-pressed": activeView.value === customViewKey(cv.id),
|
|
3991
|
+
"data-testid": `collection-view-custom-${cv.id}`,
|
|
3992
|
+
onClick: ($event) => setCustomView(cv.id)
|
|
3993
|
+
}, [createElementVNode("span", _hoisted_25, toDisplayString(cv.icon || "dashboard_customize"), 1), createElementVNode("span", null, toDisplayString(cv.label), 1)], 10, _hoisted_24);
|
|
3994
|
+
}), 128)),
|
|
3995
|
+
canAddCustomView.value ? (openBlock(), createElementBlock("button", {
|
|
3996
|
+
key: 2,
|
|
3997
|
+
type: "button",
|
|
3998
|
+
class: "h-8 w-8 flex items-center justify-center rounded bg-white text-slate-500 border border-slate-200 hover:bg-slate-50",
|
|
3999
|
+
title: unref(t)("collectionsView.addView"),
|
|
4000
|
+
"aria-label": unref(t)("collectionsView.addView"),
|
|
4001
|
+
"data-testid": "collection-view-add",
|
|
4002
|
+
onClick: addCustomView
|
|
4003
|
+
}, [..._cache[35] || (_cache[35] = [createElementVNode("span", { class: "material-icons text-sm" }, "add", -1)])], 8, _hoisted_26)) : createCommentVNode("", true),
|
|
4004
|
+
canConfigureViews.value ? (openBlock(), createElementBlock("button", {
|
|
4005
|
+
key: 3,
|
|
4006
|
+
type: "button",
|
|
4007
|
+
class: "h-8 w-8 flex items-center justify-center rounded bg-white text-slate-500 border border-slate-200 hover:bg-slate-50",
|
|
4008
|
+
title: unref(t)("collectionsView.config.open"),
|
|
4009
|
+
"aria-label": unref(t)("collectionsView.config.open"),
|
|
4010
|
+
"data-testid": "collection-config-open",
|
|
4011
|
+
onClick: _cache[5] || (_cache[5] = ($event) => configOpen.value = true)
|
|
4012
|
+
}, [..._cache[36] || (_cache[36] = [createElementVNode("span", { class: "material-icons text-sm" }, "settings", -1)])], 8, _hoisted_27)) : createCommentVNode("", true)
|
|
4013
|
+
], 8, _hoisted_20$1)) : createCommentVNode("", true),
|
|
4014
|
+
calendarActive.value && dateFields.value.length > 1 ? (openBlock(), createElementBlock("select", {
|
|
4015
|
+
key: 1,
|
|
4016
|
+
value: calendarAnchorField.value,
|
|
4017
|
+
class: "h-8 px-2 rounded border border-slate-200 bg-white text-xs font-semibold text-slate-600 focus:outline-none focus:border-indigo-500 cursor-pointer",
|
|
4018
|
+
"aria-label": unref(t)("collectionsView.calendarFieldLabel"),
|
|
4019
|
+
"data-testid": "collection-calendar-field",
|
|
4020
|
+
onChange: _cache[6] || (_cache[6] = ($event) => anchorOverride.value = $event.target.value)
|
|
4021
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(dateFields.value, (key) => {
|
|
4022
|
+
return openBlock(), createElementBlock("option", {
|
|
4023
|
+
key,
|
|
4024
|
+
value: key
|
|
4025
|
+
}, toDisplayString(collection.value?.schema.fields[key]?.label ?? key), 9, _hoisted_29);
|
|
4026
|
+
}), 128))], 40, _hoisted_28)) : createCommentVNode("", true),
|
|
4027
|
+
kanbanActive.value && enumFields.value.length > 1 ? (openBlock(), createElementBlock("select", {
|
|
4028
|
+
key: 2,
|
|
4029
|
+
value: kanbanGroupField.value,
|
|
4030
|
+
class: "h-8 px-2 rounded border border-slate-200 bg-white text-xs font-semibold text-slate-600 focus:outline-none focus:border-indigo-500 cursor-pointer",
|
|
4031
|
+
"aria-label": unref(t)("collectionsView.kanbanFieldLabel"),
|
|
4032
|
+
"data-testid": "collection-kanban-field",
|
|
4033
|
+
onChange: _cache[7] || (_cache[7] = ($event) => kanbanOverride.value = $event.target.value)
|
|
4034
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(enumFields.value, (key) => {
|
|
4035
|
+
return openBlock(), createElementBlock("option", {
|
|
4036
|
+
key,
|
|
4037
|
+
value: key
|
|
4038
|
+
}, toDisplayString(collection.value?.schema.fields[key]?.label ?? key), 9, _hoisted_31);
|
|
4039
|
+
}), 128))], 40, _hoisted_30)) : createCommentVNode("", true),
|
|
4040
|
+
items.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_32, toDisplayString(unref(t)("collectionsView.searchSummary", {
|
|
4041
|
+
shown: filteredItems.value.length,
|
|
4042
|
+
total: items.value.length
|
|
4043
|
+
})), 1)) : createCommentVNode("", true)
|
|
4044
|
+
])])) : createCommentVNode("", true),
|
|
4045
|
+
collection.value && dataIssues.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_33, [
|
|
4046
|
+
_cache[38] || (_cache[38] = createElementVNode("span", { class: "material-icons text-amber-600" }, "warning", -1)),
|
|
4047
|
+
createElementVNode("span", _hoisted_34, toDisplayString(unref(t)("collectionsView.dataIssuesDetected", { count: dataIssues.value.length })), 1),
|
|
4048
|
+
createElementVNode("button", {
|
|
4049
|
+
type: "button",
|
|
4050
|
+
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",
|
|
4051
|
+
"data-testid": "collections-repair",
|
|
4052
|
+
onClick: repairCollection
|
|
4053
|
+
}, [_cache[37] || (_cache[37] = createElementVNode("span", { class: "material-icons text-sm" }, "build", -1)), createElementVNode("span", null, toDisplayString(unref(t)("collectionsView.repair")), 1)])
|
|
4054
|
+
])) : createCommentVNode("", true),
|
|
4055
|
+
createElementVNode("div", _hoisted_35, [loading.value ? (openBlock(), createElementBlock("div", _hoisted_36, [_cache[39] || (_cache[39] = createElementVNode("div", { class: "h-8 w-8 border-2 border-indigo-600/20 border-t-indigo-600 rounded-full animate-spin" }, null, -1)), createElementVNode("span", null, toDisplayString(unref(t)("common.loading")), 1)])) : loadError.value ? (openBlock(), createElementBlock("div", _hoisted_37, [_cache[40] || (_cache[40] = createElementVNode("span", { class: "material-icons text-red-600" }, "error", -1)), createElementVNode("span", null, toDisplayString(loadError.value === "not-found" ? unref(t)("collectionsView.notFound") : `${unref(t)("collectionsView.loadFailed")}: ${loadError.value}`), 1)])) : !collection.value ? (openBlock(), createElementBlock("div", _hoisted_38)) : calendarActive.value ? (openBlock(), createElementBlock("div", _hoisted_39, [createVNode(CollectionCalendarView_default, {
|
|
4056
|
+
schema: collection.value.schema,
|
|
4057
|
+
items: filteredItems.value,
|
|
4058
|
+
"anchor-field": calendarAnchorField.value,
|
|
4059
|
+
"end-field": calendarEndField.value,
|
|
4060
|
+
"time-field": calendarTimeField.value,
|
|
4061
|
+
"color-field": hasKanban.value ? kanbanGroupField.value : "",
|
|
4062
|
+
selected: viewing.value ? String(viewing.value[collection.value.schema.primaryKey] ?? "") : void 0,
|
|
4063
|
+
onSelect: onCalendarSelect,
|
|
4064
|
+
onOpenDay
|
|
4065
|
+
}, null, 8, [
|
|
4066
|
+
"schema",
|
|
4067
|
+
"items",
|
|
4068
|
+
"anchor-field",
|
|
4069
|
+
"end-field",
|
|
4070
|
+
"time-field",
|
|
4071
|
+
"color-field",
|
|
4072
|
+
"selected"
|
|
4073
|
+
]), openDay.value ? (openBlock(), createBlock(CollectionDayView_default, {
|
|
4074
|
+
key: 0,
|
|
4075
|
+
schema: collection.value.schema,
|
|
4076
|
+
items: filteredItems.value,
|
|
4077
|
+
day: openDay.value,
|
|
4078
|
+
"anchor-field": calendarAnchorField.value,
|
|
4079
|
+
"end-field": calendarEndField.value,
|
|
4080
|
+
"time-field": calendarTimeField.value,
|
|
4081
|
+
"color-field": hasKanban.value ? kanbanGroupField.value : "",
|
|
4082
|
+
selected: viewing.value ? String(viewing.value[collection.value.schema.primaryKey] ?? "") : void 0,
|
|
4083
|
+
"can-create": canCreate.value,
|
|
4084
|
+
"show-detail": Boolean(viewing.value || editing.value),
|
|
4085
|
+
onSelect: onCalendarSelect,
|
|
4086
|
+
onCreateOn: createOnDate,
|
|
4087
|
+
onClose: onDayClose
|
|
4088
|
+
}, {
|
|
4089
|
+
detail: withCtx(() => [createVNode(CollectionRecordPanel_default, {
|
|
4090
|
+
editing: editing.value,
|
|
4091
|
+
"onUpdate:editing": _cache[8] || (_cache[8] = ($event) => editing.value = $event),
|
|
4092
|
+
collection: collection.value,
|
|
4093
|
+
viewing: viewing.value,
|
|
4094
|
+
saving: saving.value,
|
|
4095
|
+
"save-error": saveError.value,
|
|
4096
|
+
"action-error": actionError.value,
|
|
4097
|
+
"action-pending": actionPending.value,
|
|
4098
|
+
"visible-actions": visibleActions.value,
|
|
4099
|
+
"live-record": liveRecord.value,
|
|
4100
|
+
"live-derived": liveDerived.value,
|
|
4101
|
+
"view-title": viewTitle.value,
|
|
4102
|
+
"is-singleton": isSingleton.value,
|
|
4103
|
+
render: unref(render),
|
|
4104
|
+
locale: unref(locale),
|
|
4105
|
+
onSubmit: saveEditor,
|
|
4106
|
+
onCancel: cancelEditor,
|
|
4107
|
+
onEdit: editFromView,
|
|
4108
|
+
onClose: onDayClose,
|
|
4109
|
+
onDelete: _cache[9] || (_cache[9] = ($event) => viewing.value && confirmDelete(viewing.value)),
|
|
4110
|
+
onRunAction: runAction
|
|
4111
|
+
}, null, 8, [
|
|
4112
|
+
"editing",
|
|
4113
|
+
"collection",
|
|
4114
|
+
"viewing",
|
|
4115
|
+
"saving",
|
|
4116
|
+
"save-error",
|
|
4117
|
+
"action-error",
|
|
4118
|
+
"action-pending",
|
|
4119
|
+
"visible-actions",
|
|
4120
|
+
"live-record",
|
|
4121
|
+
"live-derived",
|
|
4122
|
+
"view-title",
|
|
4123
|
+
"is-singleton",
|
|
4124
|
+
"render",
|
|
4125
|
+
"locale"
|
|
4126
|
+
])]),
|
|
4127
|
+
_: 1
|
|
4128
|
+
}, 8, [
|
|
4129
|
+
"schema",
|
|
4130
|
+
"items",
|
|
4131
|
+
"day",
|
|
4132
|
+
"anchor-field",
|
|
4133
|
+
"end-field",
|
|
4134
|
+
"time-field",
|
|
4135
|
+
"color-field",
|
|
4136
|
+
"selected",
|
|
4137
|
+
"can-create",
|
|
4138
|
+
"show-detail"
|
|
4139
|
+
])) : createCommentVNode("", true)])) : kanbanActive.value ? (openBlock(), createElementBlock("div", _hoisted_40, [inlineError.value ? (openBlock(), createElementBlock("div", _hoisted_41, [
|
|
4140
|
+
_cache[42] || (_cache[42] = createElementVNode("span", { class: "material-icons text-red-600" }, "error", -1)),
|
|
4141
|
+
createElementVNode("span", _hoisted_42, toDisplayString(unref(t)("collectionsView.inlineSaveFailed", { error: inlineError.value })), 1),
|
|
4142
|
+
createElementVNode("button", {
|
|
4143
|
+
type: "button",
|
|
4144
|
+
class: "h-8 w-8 flex items-center justify-center rounded text-red-600 hover:bg-red-100",
|
|
4145
|
+
"aria-label": unref(t)("common.close"),
|
|
4146
|
+
onClick: _cache[10] || (_cache[10] = ($event) => inlineError.value = null)
|
|
4147
|
+
}, [..._cache[41] || (_cache[41] = [createElementVNode("span", { class: "material-icons text-base" }, "close", -1)])], 8, _hoisted_43)
|
|
4148
|
+
])) : createCommentVNode("", true), createElementVNode("div", _hoisted_44, [createVNode(CollectionKanbanView_default, {
|
|
4149
|
+
schema: collection.value.schema,
|
|
4150
|
+
items: filteredItems.value,
|
|
4151
|
+
"group-field": kanbanGroupField.value,
|
|
4152
|
+
selected: viewing.value ? String(viewing.value[collection.value.schema.primaryKey] ?? "") : void 0,
|
|
4153
|
+
notified: notifiedSeverities.value,
|
|
4154
|
+
onSelect: onCalendarSelect,
|
|
4155
|
+
onMove: onKanbanMove
|
|
4156
|
+
}, null, 8, [
|
|
4157
|
+
"schema",
|
|
4158
|
+
"items",
|
|
4159
|
+
"group-field",
|
|
4160
|
+
"selected",
|
|
4161
|
+
"notified"
|
|
4162
|
+
])])])) : activeCustomView.value ? (openBlock(), createElementBlock("div", _hoisted_45, [createVNode(CollectionCustomView_default, {
|
|
4163
|
+
slug: collection.value.slug,
|
|
4164
|
+
view: activeCustomView.value
|
|
4165
|
+
}, null, 8, ["slug", "view"])])) : items.value.length === 0 && editing.value?.mode !== "create" ? (openBlock(), createElementBlock("div", _hoisted_46, [_cache[43] || (_cache[43] = createElementVNode("span", { class: "material-icons text-4xl text-slate-300" }, "folder_open", -1)), createElementVNode("p", _hoisted_47, toDisplayString(unref(t)("collectionsView.itemsEmpty")), 1)])) : filteredItems.value.length === 0 && editing.value?.mode !== "create" ? (openBlock(), createElementBlock("div", _hoisted_48, [
|
|
4166
|
+
_cache[44] || (_cache[44] = createElementVNode("span", { class: "material-icons text-4xl text-slate-300" }, "search_off", -1)),
|
|
4167
|
+
createElementVNode("p", _hoisted_49, toDisplayString(unref(t)("collectionsView.noMatchingItems")), 1),
|
|
4168
|
+
createElementVNode("button", {
|
|
4169
|
+
type: "button",
|
|
4170
|
+
class: "text-xs text-indigo-600 font-semibold hover:underline",
|
|
4171
|
+
onClick: _cache[11] || (_cache[11] = ($event) => searchQuery.value = "")
|
|
4172
|
+
}, toDisplayString(unref(t)("collectionsView.clearSearch")), 1)
|
|
4173
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_50, [inlineError.value ? (openBlock(), createElementBlock("div", _hoisted_51, [
|
|
4174
|
+
_cache[46] || (_cache[46] = createElementVNode("span", { class: "material-icons text-red-600" }, "error", -1)),
|
|
4175
|
+
createElementVNode("span", _hoisted_52, toDisplayString(unref(t)("collectionsView.inlineSaveFailed", { error: inlineError.value })), 1),
|
|
4176
|
+
createElementVNode("button", {
|
|
4177
|
+
type: "button",
|
|
4178
|
+
class: "h-8 w-8 flex items-center justify-center rounded text-red-600 hover:bg-red-100",
|
|
4179
|
+
"aria-label": unref(t)("common.close"),
|
|
4180
|
+
onClick: _cache[12] || (_cache[12] = ($event) => inlineError.value = null)
|
|
4181
|
+
}, [..._cache[45] || (_cache[45] = [createElementVNode("span", { class: "material-icons text-base" }, "close", -1)])], 8, _hoisted_53)
|
|
4182
|
+
])) : createCommentVNode("", true), createElementVNode("table", _hoisted_54, [createElementVNode("thead", null, [createElementVNode("tr", _hoisted_55, [(openBlock(true), createElementBlock(Fragment, null, renderList(listColumnFields.value, ([key, field]) => {
|
|
4183
|
+
return openBlock(), createElementBlock("th", {
|
|
4184
|
+
key,
|
|
4185
|
+
"aria-sort": unref(isSortableField)(field) ? sortAriaValue(key) : void 0,
|
|
4186
|
+
class: "px-5 py-3 font-bold text-slate-500 text-left uppercase tracking-wider whitespace-nowrap"
|
|
4187
|
+
}, [createElementVNode("div", _hoisted_57, [createElementVNode("span", {
|
|
4188
|
+
class: "truncate max-w-[14rem]",
|
|
4189
|
+
title: field.label
|
|
4190
|
+
}, toDisplayString(field.label), 9, _hoisted_58), unref(isSortableField)(field) ? (openBlock(), createElementBlock("button", {
|
|
4191
|
+
key: 0,
|
|
4192
|
+
type: "button",
|
|
4193
|
+
class: normalizeClass(["inline-flex items-center justify-center rounded p-0.5 -my-1 leading-none transition-colors", sortButtonClass(key)]),
|
|
4194
|
+
"data-testid": `collections-sort-${key}`,
|
|
4195
|
+
"aria-label": unref(t)("collectionsView.sortBy", { field: field.label }),
|
|
4196
|
+
onClick: withModifiers(($event) => cycleSort(key), ["stop"]),
|
|
4197
|
+
onPointerenter: ($event) => hoveredSortKey.value = key,
|
|
4198
|
+
onPointerleave: _cache[13] || (_cache[13] = ($event) => hoveredSortKey.value = null)
|
|
4199
|
+
}, [createElementVNode("span", _hoisted_60, toDisplayString(sortIconName(key)), 1)], 42, _hoisted_59)) : createCommentVNode("", true)])], 8, _hoisted_56);
|
|
4200
|
+
}), 128))])]), createElementVNode("tbody", _hoisted_61, [(openBlock(true), createElementBlock(Fragment, null, renderList(sortedItems.value, (item) => {
|
|
4201
|
+
return openBlock(), createElementBlock("tr", {
|
|
4202
|
+
key: String(item[collection.value.schema.primaryKey] ?? ""),
|
|
4203
|
+
class: 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" : ""]),
|
|
4204
|
+
role: "button",
|
|
4205
|
+
tabindex: "0",
|
|
4206
|
+
"aria-label": unref(t)("collectionsView.openItem", { id: String(item[collection.value.schema.primaryKey] ?? "") }),
|
|
4207
|
+
"data-testid": `collections-row-${item[collection.value.schema.primaryKey]}`,
|
|
4208
|
+
onClick: ($event) => openView(item),
|
|
4209
|
+
onKeydown: [withKeys(withModifiers(($event) => openView(item), ["self"]), ["enter"]), withKeys(withModifiers(($event) => openView(item), ["self", "prevent"]), ["space"])]
|
|
4210
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(listColumnFields.value, ([key, field]) => {
|
|
4211
|
+
return openBlock(), createElementBlock("td", {
|
|
4212
|
+
key,
|
|
4213
|
+
class: "px-5 py-2 text-slate-700 align-middle max-w-xs font-medium"
|
|
4214
|
+
}, [unref(fieldVisible)(field, item) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [field.type === "toggle" ? (openBlock(), createElementBlock("input", {
|
|
4215
|
+
key: 0,
|
|
4216
|
+
type: "checkbox",
|
|
4217
|
+
checked: toggleChecked(item, field),
|
|
4218
|
+
disabled: isRowInlineSaving(item),
|
|
4219
|
+
class: "h-5 w-5 rounded border-slate-300 text-indigo-600 focus:ring-indigo-500/20 cursor-pointer align-middle disabled:opacity-50 disabled:cursor-not-allowed",
|
|
4220
|
+
"data-testid": `collections-inline-toggle-${key}-${item[collection.value.schema.primaryKey]}`,
|
|
4221
|
+
"aria-label": field.label,
|
|
4222
|
+
onClick: _cache[14] || (_cache[14] = withModifiers(() => {}, ["stop"])),
|
|
4223
|
+
onChange: ($event) => commitToggle(item, field)
|
|
4224
|
+
}, null, 40, _hoisted_63)) : field.type === "boolean" ? (openBlock(), createElementBlock("input", {
|
|
4225
|
+
key: 1,
|
|
4226
|
+
type: "checkbox",
|
|
4227
|
+
checked: item[key] === true,
|
|
4228
|
+
disabled: isRowInlineSaving(item),
|
|
4229
|
+
class: "h-5 w-5 rounded border-slate-300 text-indigo-600 focus:ring-indigo-500/20 cursor-pointer align-middle disabled:opacity-50 disabled:cursor-not-allowed",
|
|
4230
|
+
"data-testid": `collections-inline-bool-${key}-${item[collection.value.schema.primaryKey]}`,
|
|
4231
|
+
"aria-label": field.label,
|
|
4232
|
+
onClick: _cache[15] || (_cache[15] = withModifiers(() => {}, ["stop"])),
|
|
4233
|
+
onChange: ($event) => commitInlineEdit(item, String(key), field, $event.target.checked)
|
|
4234
|
+
}, null, 40, _hoisted_64)) : field.type === "ref" && field.to && typeof item[key] === "string" && item[key] ? (openBlock(), createElementBlock("span", _hoisted_65, [createVNode(_component_router_link, {
|
|
4235
|
+
to: {
|
|
4236
|
+
path: `/collections/${field.to}`,
|
|
4237
|
+
query: { selected: String(item[key]) }
|
|
4238
|
+
},
|
|
4239
|
+
class: "text-indigo-600 hover:text-indigo-800 hover:underline font-semibold",
|
|
4240
|
+
"data-testid": `collections-ref-link-${key}-${item[key]}`,
|
|
4241
|
+
onClick: _cache[16] || (_cache[16] = withModifiers(() => {}, ["stop"]))
|
|
4242
|
+
}, {
|
|
4243
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(refDisplay)(field.to, String(item[key]))), 1)]),
|
|
4244
|
+
_: 2
|
|
4245
|
+
}, 1032, ["to", "data-testid"])])) : field.type === "enum" && Array.isArray(field.values) && field.values.length > 0 ? (openBlock(), createElementBlock("select", {
|
|
4246
|
+
key: 3,
|
|
4247
|
+
value: item[key] == null ? "" : String(item[key]),
|
|
4248
|
+
disabled: isRowInlineSaving(item),
|
|
4249
|
+
class: normalizeClass(["rounded-lg border px-2 py-0.5 text-[11px] font-semibold focus:border-indigo-500 focus:ring-2 focus:ring-indigo-500/20 focus:outline-none cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed", enumControlClass(String(key), item[key])]),
|
|
4250
|
+
"data-testid": `collections-inline-enum-${key}-${item[collection.value.schema.primaryKey]}`,
|
|
4251
|
+
"aria-label": field.label,
|
|
4252
|
+
onClick: _cache[17] || (_cache[17] = withModifiers(() => {}, ["stop"])),
|
|
4253
|
+
onChange: ($event) => commitInlineEdit(item, String(key), field, $event.target.value)
|
|
4254
|
+
}, [showEnumPlaceholder(item, String(key)) ? (openBlock(), createElementBlock("option", _hoisted_67, toDisplayString(unref(t)("collectionsView.selectPlaceholder")), 1)) : createCommentVNode("", true), (openBlock(true), createElementBlock(Fragment, null, renderList(field.values, (value) => {
|
|
4255
|
+
return openBlock(), createElementBlock("option", {
|
|
4256
|
+
key: value,
|
|
4257
|
+
value
|
|
4258
|
+
}, toDisplayString(value), 9, _hoisted_68);
|
|
4259
|
+
}), 128))], 42, _hoisted_66)) : field.type === "money" ? (openBlock(), createElementBlock("span", _hoisted_69, toDisplayString(unref(formatMoney)(item[key], unref(resolveCurrency)(field, item), unref(locale))), 1)) : field.type === "table" ? (openBlock(), createElementBlock("span", _hoisted_70, [_cache[47] || (_cache[47] = createElementVNode("span", { class: "material-icons text-[11px]" }, "list", -1)), createElementVNode("span", null, toDisplayString(tableSummary(item[key])), 1)])) : field.type === "derived" ? (openBlock(), createElementBlock("span", _hoisted_71, toDisplayString(unref(derivedDisplay)(field, unref(evaluateDerivedAgainstItem)(field, String(key), item), item)), 1)) : field.type !== "file" && unref(isExternalUrl)(item[key]) ? (openBlock(), createElementBlock("a", {
|
|
4260
|
+
key: 7,
|
|
4261
|
+
href: String(item[key]),
|
|
4262
|
+
target: "_blank",
|
|
4263
|
+
rel: "noopener noreferrer",
|
|
4264
|
+
class: "block truncate text-blue-600 hover:text-blue-800 hover:underline font-semibold",
|
|
4265
|
+
"data-testid": `collections-url-link-${key}-${item[collection.value.schema.primaryKey]}`,
|
|
4266
|
+
onClick: _cache[18] || (_cache[18] = withModifiers(() => {}, ["stop"]))
|
|
4267
|
+
}, toDisplayString(String(item[key])), 9, _hoisted_72)) : field.type === "file" && unref(artifactUrl)(item[key]) ? (openBlock(), createElementBlock("a", {
|
|
4268
|
+
key: 8,
|
|
4269
|
+
href: unref(artifactUrl)(item[key]) ?? void 0,
|
|
4270
|
+
target: "_blank",
|
|
4271
|
+
rel: "noopener noreferrer",
|
|
4272
|
+
class: "block truncate text-blue-600 hover:text-blue-800 hover:underline font-semibold",
|
|
4273
|
+
"data-testid": `collections-file-link-${key}-${item[collection.value.schema.primaryKey]}`,
|
|
4274
|
+
onClick: _cache[19] || (_cache[19] = withModifiers(() => {}, ["stop"]))
|
|
4275
|
+
}, toDisplayString(String(item[key])), 9, _hoisted_73)) : field.type === "file" && unref(fileRoutePath)(item[key]) ? (openBlock(), createBlock(_component_router_link, {
|
|
4276
|
+
key: 9,
|
|
4277
|
+
to: unref(fileRoutePath)(item[key]) ?? "",
|
|
4278
|
+
class: "block truncate text-blue-600 hover:text-blue-800 hover:underline font-semibold",
|
|
4279
|
+
"data-testid": `collections-file-link-${key}-${item[collection.value.schema.primaryKey]}`,
|
|
4280
|
+
onClick: _cache[20] || (_cache[20] = withModifiers(() => {}, ["stop"]))
|
|
4281
|
+
}, {
|
|
4282
|
+
default: withCtx(() => [createTextVNode(toDisplayString(String(item[key])), 1)]),
|
|
4283
|
+
_: 2
|
|
4284
|
+
}, 1032, ["to", "data-testid"])) : (openBlock(), createElementBlock("span", _hoisted_74, toDisplayString(unref(formatCell)(item[key], field.type)), 1))], 64)) : createCommentVNode("", true)]);
|
|
4285
|
+
}), 128))], 42, _hoisted_62);
|
|
4286
|
+
}), 128))])])]))]),
|
|
4287
|
+
collection.value && (viewing.value || editing.value) && !(calendarActive.value && openDay.value) ? (openBlock(), createBlock(CollectionRecordModal_default, {
|
|
4288
|
+
key: 2,
|
|
4289
|
+
onClose: closeRecordModal
|
|
4290
|
+
}, {
|
|
4291
|
+
default: withCtx(() => [createVNode(CollectionRecordPanel_default, {
|
|
4292
|
+
editing: editing.value,
|
|
4293
|
+
"onUpdate:editing": _cache[21] || (_cache[21] = ($event) => editing.value = $event),
|
|
4294
|
+
collection: collection.value,
|
|
4295
|
+
viewing: viewing.value,
|
|
4296
|
+
saving: saving.value,
|
|
4297
|
+
"save-error": saveError.value,
|
|
4298
|
+
"action-error": actionError.value,
|
|
4299
|
+
"action-pending": actionPending.value,
|
|
4300
|
+
"visible-actions": visibleActions.value,
|
|
4301
|
+
"live-record": liveRecord.value,
|
|
4302
|
+
"live-derived": liveDerived.value,
|
|
4303
|
+
"view-title": viewTitle.value,
|
|
4304
|
+
"is-singleton": isSingleton.value,
|
|
4305
|
+
render: unref(render),
|
|
4306
|
+
locale: unref(locale),
|
|
4307
|
+
onSubmit: saveEditor,
|
|
4308
|
+
onCancel: cancelEditor,
|
|
4309
|
+
onEdit: editFromView,
|
|
4310
|
+
onClose: closeView,
|
|
4311
|
+
onDelete: _cache[22] || (_cache[22] = ($event) => viewing.value && confirmDelete(viewing.value)),
|
|
4312
|
+
onRunAction: runAction
|
|
4313
|
+
}, null, 8, [
|
|
4314
|
+
"editing",
|
|
4315
|
+
"collection",
|
|
4316
|
+
"viewing",
|
|
4317
|
+
"saving",
|
|
4318
|
+
"save-error",
|
|
4319
|
+
"action-error",
|
|
4320
|
+
"action-pending",
|
|
4321
|
+
"visible-actions",
|
|
4322
|
+
"live-record",
|
|
4323
|
+
"live-derived",
|
|
4324
|
+
"view-title",
|
|
4325
|
+
"is-singleton",
|
|
4326
|
+
"render",
|
|
4327
|
+
"locale"
|
|
4328
|
+
])]),
|
|
4329
|
+
_: 1
|
|
4330
|
+
})) : createCommentVNode("", true),
|
|
4331
|
+
configOpen.value && collection.value ? (openBlock(), createBlock(CollectionViewConfigModal_default, {
|
|
4332
|
+
key: 3,
|
|
4333
|
+
slug: collection.value.slug,
|
|
4334
|
+
title: collection.value.title,
|
|
4335
|
+
views: customViews.value,
|
|
4336
|
+
onChanged: onViewsChanged,
|
|
4337
|
+
onClose: _cache[23] || (_cache[23] = ($event) => configOpen.value = false)
|
|
4338
|
+
}, null, 8, [
|
|
4339
|
+
"slug",
|
|
4340
|
+
"title",
|
|
4341
|
+
"views"
|
|
4342
|
+
])) : createCommentVNode("", true),
|
|
4343
|
+
chatOpen.value && collection.value ? (openBlock(), createElementBlock("div", {
|
|
4344
|
+
key: 4,
|
|
4345
|
+
class: "fixed inset-0 z-30 flex items-center justify-center bg-slate-900/60 backdrop-blur-sm p-4 transition-all duration-300",
|
|
4346
|
+
role: "dialog",
|
|
4347
|
+
"aria-modal": "true",
|
|
4348
|
+
"aria-labelledby": "collections-chat-title",
|
|
4349
|
+
"data-testid": "collections-chat-modal",
|
|
4350
|
+
onClick: withModifiers(closeChat, ["self"]),
|
|
4351
|
+
onKeydown: withKeys(closeChat, ["esc"])
|
|
4352
|
+
}, [createElementVNode("div", _hoisted_75, [
|
|
4353
|
+
createElementVNode("header", _hoisted_76, [
|
|
4354
|
+
_cache[49] || (_cache[49] = 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" }, [createElementVNode("span", { class: "material-icons text-lg" }, "forum")], -1)),
|
|
4355
|
+
createElementVNode("div", _hoisted_77, [createElementVNode("h2", _hoisted_78, toDisplayString(unref(t)("collectionsView.chatTitle")), 1), createElementVNode("span", _hoisted_79, toDisplayString(collection.value.title), 1)]),
|
|
4356
|
+
createElementVNode("button", {
|
|
4357
|
+
type: "button",
|
|
4358
|
+
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",
|
|
4359
|
+
"aria-label": unref(t)("common.close"),
|
|
4360
|
+
"data-testid": "collections-chat-close",
|
|
4361
|
+
onClick: closeChat
|
|
4362
|
+
}, [..._cache[48] || (_cache[48] = [createElementVNode("span", { class: "material-icons text-lg" }, "close", -1)])], 8, _hoisted_80)
|
|
4363
|
+
]),
|
|
4364
|
+
createElementVNode("div", _hoisted_81, [withDirectives(createElementVNode("textarea", {
|
|
4365
|
+
ref_key: "chatInputEl",
|
|
4366
|
+
ref: chatInputEl,
|
|
4367
|
+
"onUpdate:modelValue": _cache[24] || (_cache[24] = ($event) => chatMessage.value = $event),
|
|
4368
|
+
rows: "4",
|
|
4369
|
+
placeholder: unref(t)("collectionsView.chatPlaceholder"),
|
|
4370
|
+
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",
|
|
4371
|
+
"data-testid": "collections-chat-input",
|
|
4372
|
+
onKeydown: [withKeys(withModifiers(submitChat, ["meta"]), ["enter"]), withKeys(withModifiers(submitChat, ["ctrl"]), ["enter"])]
|
|
4373
|
+
}, null, 40, _hoisted_82), [[vModelText, chatMessage.value]])]),
|
|
4374
|
+
createElementVNode("footer", _hoisted_83, [createElementVNode("button", {
|
|
4375
|
+
type: "button",
|
|
4376
|
+
class: "h-8 px-2.5 rounded text-xs font-bold text-slate-500 hover:bg-slate-200/50 transition-colors",
|
|
4377
|
+
"data-testid": "collections-chat-cancel",
|
|
4378
|
+
onClick: closeChat
|
|
4379
|
+
}, toDisplayString(unref(t)("common.cancel")), 1), createElementVNode("button", {
|
|
4380
|
+
type: "button",
|
|
4381
|
+
class: "h-8 px-2.5 rounded bg-indigo-600 text-white font-bold text-xs hover:bg-indigo-700 disabled:opacity-50 transition-all shadow-sm shadow-indigo-600/10",
|
|
4382
|
+
disabled: !chatMessage.value.trim(),
|
|
4383
|
+
"data-testid": "collections-chat-send",
|
|
4384
|
+
onClick: submitChat
|
|
4385
|
+
}, toDisplayString(unref(t)("collectionsView.chatStart")), 9, _hoisted_84)])
|
|
4386
|
+
])], 32)) : createCommentVNode("", true)
|
|
4387
|
+
]);
|
|
4388
|
+
};
|
|
4389
|
+
}
|
|
4390
|
+
});
|
|
4391
|
+
//#endregion
|
|
4392
|
+
//#region src/vue/components/CollectionsIndexView.vue?vue&type=script&setup=true&lang.ts
|
|
4393
|
+
var _hoisted_1$1 = {
|
|
4394
|
+
class: "h-full overflow-y-auto bg-slate-50/50 px-6 py-6",
|
|
4395
|
+
"data-testid": "collections-view-root"
|
|
4396
|
+
};
|
|
4397
|
+
var _hoisted_2$1 = { class: "max-w-4xl mx-auto" };
|
|
4398
|
+
var _hoisted_3$1 = { class: "flex items-center justify-between mb-6" };
|
|
4399
|
+
var _hoisted_4$1 = { class: "text-xl font-semibold text-slate-800" };
|
|
4400
|
+
var _hoisted_5$1 = {
|
|
4401
|
+
key: 0,
|
|
4402
|
+
class: "flex flex-col items-center justify-center py-20 text-sm text-slate-500 gap-3"
|
|
4403
|
+
};
|
|
4404
|
+
var _hoisted_6$1 = {
|
|
4405
|
+
key: 1,
|
|
4406
|
+
class: "rounded-xl border border-red-200 bg-red-50/50 p-4 text-sm text-red-800 shadow-sm flex items-center gap-3"
|
|
4407
|
+
};
|
|
4408
|
+
var _hoisted_7$1 = {
|
|
4409
|
+
key: 2,
|
|
4410
|
+
class: "rounded-xl border border-slate-200 bg-white px-6 py-12 text-center text-sm text-slate-500 shadow-sm"
|
|
4411
|
+
};
|
|
4412
|
+
var _hoisted_8$1 = { class: "font-medium text-slate-700" };
|
|
4413
|
+
var _hoisted_9$1 = {
|
|
4414
|
+
key: 3,
|
|
4415
|
+
class: "grid gap-4 sm:grid-cols-2"
|
|
4416
|
+
};
|
|
4417
|
+
var _hoisted_10$1 = [
|
|
4418
|
+
"aria-label",
|
|
4419
|
+
"data-testid",
|
|
4420
|
+
"onClick",
|
|
4421
|
+
"onKeydown"
|
|
4422
|
+
];
|
|
4423
|
+
var _hoisted_11$1 = { class: "material-symbols-outlined text-2xl" };
|
|
4424
|
+
var _hoisted_12$1 = { class: "flex-1 min-w-0" };
|
|
4425
|
+
var _hoisted_13$1 = { class: "block font-semibold text-slate-800 text-[15px] group-hover:text-indigo-950 transition-colors truncate" };
|
|
4426
|
+
var _hoisted_14$1 = { class: "block text-[10px] text-slate-400 mt-1 tracking-wider font-semibold uppercase flex items-center gap-1.5" };
|
|
4427
|
+
var _hoisted_15$1 = { class: "text-[10px] bg-slate-100 px-1 rounded lowercase text-slate-500 font-mono font-normal" };
|
|
4428
|
+
//#endregion
|
|
4429
|
+
//#region src/vue/components/CollectionsIndexView.vue
|
|
4430
|
+
var CollectionsIndexView_default = /* @__PURE__ */ defineComponent({
|
|
4431
|
+
__name: "CollectionsIndexView",
|
|
4432
|
+
setup(__props) {
|
|
4433
|
+
const { t } = useCollectionI18n();
|
|
4434
|
+
const cui = collectionUi();
|
|
4435
|
+
const { pinToggle, reconcileShortcuts } = cui;
|
|
4436
|
+
const collections = ref([]);
|
|
4437
|
+
const loading = ref(true);
|
|
4438
|
+
const loadError = ref(null);
|
|
4439
|
+
async function loadCollections() {
|
|
4440
|
+
loading.value = true;
|
|
4441
|
+
loadError.value = null;
|
|
4442
|
+
const result = await cui.listCollections();
|
|
4443
|
+
loading.value = false;
|
|
4444
|
+
if (!result.ok) {
|
|
4445
|
+
loadError.value = result.error;
|
|
4446
|
+
return;
|
|
4447
|
+
}
|
|
4448
|
+
collections.value = result.data.collections.filter((collection) => collection.source !== "feed");
|
|
4449
|
+
reconcileShortcuts("collection", collections.value.map((collection) => ({
|
|
4450
|
+
slug: collection.slug,
|
|
4451
|
+
title: collection.title,
|
|
4452
|
+
icon: collection.icon
|
|
4453
|
+
})));
|
|
4454
|
+
}
|
|
4455
|
+
function openCollection(slug) {
|
|
4456
|
+
cui.gotoDetail("collection", slug);
|
|
4457
|
+
}
|
|
4458
|
+
function startCreateCollectionChat() {
|
|
4459
|
+
cui.startChat(t("collectionsView.addCollectionPrompt"), cui.generalRoleId);
|
|
4460
|
+
}
|
|
4461
|
+
onMounted(loadCollections);
|
|
4462
|
+
return (_ctx, _cache) => {
|
|
4463
|
+
return openBlock(), createElementBlock("div", _hoisted_1$1, [createElementVNode("div", _hoisted_2$1, [createElementVNode("div", _hoisted_3$1, [createElementVNode("h1", _hoisted_4$1, toDisplayString(unref(t)("collectionsView.title")), 1), createElementVNode("button", {
|
|
4464
|
+
type: "button",
|
|
4465
|
+
class: "h-8 px-2.5 flex items-center gap-1 rounded bg-indigo-600 hover:bg-indigo-700 text-white font-bold text-xs transition-colors shadow-sm",
|
|
4466
|
+
"data-testid": "collections-add-collection",
|
|
4467
|
+
onClick: startCreateCollectionChat
|
|
4468
|
+
}, [_cache[0] || (_cache[0] = createElementVNode("span", { class: "material-icons text-sm" }, "add", -1)), createElementVNode("span", null, toDisplayString(unref(t)("collectionsView.addCollectionLabel")), 1)])]), loading.value ? (openBlock(), createElementBlock("div", _hoisted_5$1, [_cache[1] || (_cache[1] = createElementVNode("div", { class: "h-8 w-8 border-2 border-indigo-600/20 border-t-indigo-600 rounded-full animate-spin" }, null, -1)), createElementVNode("span", null, toDisplayString(unref(t)("common.loading")), 1)])) : loadError.value ? (openBlock(), createElementBlock("div", _hoisted_6$1, [_cache[2] || (_cache[2] = createElementVNode("span", { class: "material-icons text-red-600" }, "error", -1)), createElementVNode("span", null, toDisplayString(unref(t)("collectionsView.loadFailed")) + ": " + toDisplayString(loadError.value), 1)])) : collections.value.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_7$1, [_cache[3] || (_cache[3] = createElementVNode("span", { class: "material-icons text-4xl text-slate-300 mb-2" }, "dashboard_customize", -1)), createElementVNode("p", _hoisted_8$1, toDisplayString(unref(t)("collectionsView.indexEmpty")), 1)])) : (openBlock(), createElementBlock("div", _hoisted_9$1, [(openBlock(true), createElementBlock(Fragment, null, renderList(collections.value, (collection) => {
|
|
4469
|
+
return openBlock(), createElementBlock("div", {
|
|
4470
|
+
key: collection.slug,
|
|
4471
|
+
class: "group relative rounded-xl border border-slate-200 bg-white p-5 shadow-sm hover:shadow-md hover:border-indigo-300 transition-all duration-300 cursor-pointer flex items-center gap-4 focus:outline-none focus:ring-2 focus:ring-indigo-500/20",
|
|
4472
|
+
role: "button",
|
|
4473
|
+
tabindex: "0",
|
|
4474
|
+
"aria-label": unref(t)("collectionsView.openCollection", { title: collection.title }),
|
|
4475
|
+
"data-testid": `collections-index-card-${collection.slug}`,
|
|
4476
|
+
onClick: ($event) => openCollection(collection.slug),
|
|
4477
|
+
onKeydown: [withKeys(withModifiers(($event) => openCollection(collection.slug), ["self"]), ["enter"]), withKeys(withModifiers(($event) => openCollection(collection.slug), ["self", "prevent"]), ["space"])]
|
|
4478
|
+
}, [
|
|
4479
|
+
createElementVNode("div", { class: normalizeClass(["absolute left-0 top-0 bottom-0 w-1 rounded-l-xl transition-all duration-300 group-hover:w-1.5", collection.source === "project" ? "bg-indigo-600" : "bg-violet-600"]) }, null, 2),
|
|
4480
|
+
createElementVNode("div", { class: normalizeClass(["h-12 w-12 flex items-center justify-center rounded-xl transition-all duration-300 group-hover:scale-105 shadow-sm", collection.source === "project" ? "bg-indigo-50 text-indigo-600 group-hover:bg-indigo-100/80 border border-indigo-100/50" : "bg-violet-50 text-violet-600 group-hover:bg-violet-100/80 border border-violet-100/50"]) }, [createElementVNode("span", _hoisted_11$1, toDisplayString(collection.icon), 1)], 2),
|
|
4481
|
+
createElementVNode("div", _hoisted_12$1, [createElementVNode("span", _hoisted_13$1, toDisplayString(collection.title), 1), createElementVNode("span", _hoisted_14$1, [
|
|
4482
|
+
createElementVNode("span", { class: normalizeClass(["h-1.5 w-1.5 rounded-full", collection.source === "project" ? "bg-indigo-500" : "bg-violet-500"]) }, null, 2),
|
|
4483
|
+
createTextVNode(" " + toDisplayString(unref(t)(`collectionsView.source.${collection.source}`)) + " · ", 1),
|
|
4484
|
+
createElementVNode("code", _hoisted_15$1, toDisplayString(collection.slug), 1)
|
|
4485
|
+
])]),
|
|
4486
|
+
(openBlock(), createBlock(resolveDynamicComponent(unref(pinToggle)), {
|
|
4487
|
+
kind: "collection",
|
|
4488
|
+
slug: collection.slug,
|
|
4489
|
+
title: collection.title,
|
|
4490
|
+
icon: collection.icon
|
|
4491
|
+
}, null, 8, [
|
|
4492
|
+
"slug",
|
|
4493
|
+
"title",
|
|
4494
|
+
"icon"
|
|
4495
|
+
])),
|
|
4496
|
+
_cache[4] || (_cache[4] = createElementVNode("div", { class: "h-8 w-8 flex items-center justify-center rounded-lg bg-slate-50 group-hover:bg-indigo-50 text-slate-400 group-hover:text-indigo-600 transition-all duration-300" }, [createElementVNode("span", { class: "material-icons text-lg transition-transform duration-300 group-hover:translate-x-0.5" }, "chevron_right")], -1))
|
|
4497
|
+
], 40, _hoisted_10$1);
|
|
4498
|
+
}), 128))]))])]);
|
|
4499
|
+
};
|
|
4500
|
+
}
|
|
4501
|
+
});
|
|
4502
|
+
//#endregion
|
|
4503
|
+
//#region src/vue/components/FeedsView.vue?vue&type=script&setup=true&lang.ts
|
|
4504
|
+
var _hoisted_1 = {
|
|
4505
|
+
class: "h-full overflow-y-auto bg-slate-50/50 px-6 py-6",
|
|
4506
|
+
"data-testid": "feeds-view-root"
|
|
4507
|
+
};
|
|
4508
|
+
var _hoisted_2 = { class: "max-w-4xl mx-auto" };
|
|
4509
|
+
var _hoisted_3 = { class: "flex items-center justify-between mb-6" };
|
|
4510
|
+
var _hoisted_4 = { class: "text-xl font-semibold text-slate-800" };
|
|
4511
|
+
var _hoisted_5 = {
|
|
4512
|
+
key: 0,
|
|
4513
|
+
class: "mb-4 flex items-center gap-2 rounded-xl border border-red-200 bg-red-50/50 p-3 text-sm text-red-800 shadow-sm",
|
|
4514
|
+
"data-testid": "feeds-refresh-error"
|
|
4515
|
+
};
|
|
4516
|
+
var _hoisted_6 = {
|
|
4517
|
+
key: 1,
|
|
4518
|
+
class: "flex flex-col items-center justify-center py-20 text-sm text-slate-500 gap-3"
|
|
4519
|
+
};
|
|
4520
|
+
var _hoisted_7 = {
|
|
4521
|
+
key: 2,
|
|
4522
|
+
class: "rounded-xl border border-red-200 bg-red-50/50 p-4 text-sm text-red-800 shadow-sm flex items-center gap-3"
|
|
4523
|
+
};
|
|
4524
|
+
var _hoisted_8 = {
|
|
4525
|
+
key: 3,
|
|
4526
|
+
class: "rounded-xl border border-slate-200 bg-white px-6 py-12 text-center text-sm text-slate-500 shadow-sm"
|
|
4527
|
+
};
|
|
4528
|
+
var _hoisted_9 = { class: "font-medium text-slate-700" };
|
|
4529
|
+
var _hoisted_10 = {
|
|
4530
|
+
key: 4,
|
|
4531
|
+
class: "grid gap-4 sm:grid-cols-2"
|
|
4532
|
+
};
|
|
4533
|
+
var _hoisted_11 = [
|
|
4534
|
+
"data-testid",
|
|
4535
|
+
"onClick",
|
|
4536
|
+
"onKeydown"
|
|
4537
|
+
];
|
|
4538
|
+
var _hoisted_12 = { class: "h-12 w-12 flex items-center justify-center rounded-xl bg-indigo-50 text-indigo-600 border border-indigo-100/50" };
|
|
4539
|
+
var _hoisted_13 = { class: "material-symbols-outlined text-2xl" };
|
|
4540
|
+
var _hoisted_14 = { class: "flex-1 min-w-0" };
|
|
4541
|
+
var _hoisted_15 = { class: "block font-semibold text-slate-800 text-[15px] truncate" };
|
|
4542
|
+
var _hoisted_16 = { class: "block text-[10px] text-slate-400 mt-1 tracking-wider font-semibold uppercase" };
|
|
4543
|
+
var _hoisted_17 = [
|
|
4544
|
+
"disabled",
|
|
4545
|
+
"title",
|
|
4546
|
+
"aria-label",
|
|
4547
|
+
"data-testid",
|
|
4548
|
+
"onClick"
|
|
4549
|
+
];
|
|
4550
|
+
var _hoisted_18 = { class: "material-icons text-lg" };
|
|
4551
|
+
var _hoisted_19 = { class: "w-full max-w-md rounded-xl bg-white p-5 shadow-xl" };
|
|
4552
|
+
var _hoisted_20 = { class: "text-sm font-semibold text-slate-800 mb-1" };
|
|
4553
|
+
var _hoisted_21 = { class: "text-xs text-slate-500 mb-3" };
|
|
4554
|
+
var _hoisted_22 = { class: "mt-4 flex justify-end gap-2" };
|
|
4555
|
+
var _hoisted_23 = ["disabled"];
|
|
4556
|
+
//#endregion
|
|
4557
|
+
//#region src/vue/components/FeedsView.vue
|
|
4558
|
+
var FeedsView_default = /* @__PURE__ */ defineComponent({
|
|
4559
|
+
__name: "FeedsView",
|
|
4560
|
+
setup(__props) {
|
|
4561
|
+
const { t } = useCollectionI18n();
|
|
4562
|
+
const cui = collectionUi();
|
|
4563
|
+
const { pinToggle, reconcileShortcuts } = cui;
|
|
4564
|
+
const feeds = ref([]);
|
|
4565
|
+
const loading = ref(true);
|
|
4566
|
+
const loadError = ref(null);
|
|
4567
|
+
const refreshingSlug = ref(null);
|
|
4568
|
+
/** Non-destructive banner for a per-feed Refresh that failed (the
|
|
4569
|
+
* endpoint reports retriever errors via `errors` even on HTTP 200). */
|
|
4570
|
+
const refreshError = ref(null);
|
|
4571
|
+
const addOpen = ref(false);
|
|
4572
|
+
const addUrl = ref("");
|
|
4573
|
+
const addInputEl = ref(null);
|
|
4574
|
+
async function load() {
|
|
4575
|
+
loading.value = true;
|
|
4576
|
+
loadError.value = null;
|
|
4577
|
+
const result = await cui.listFeeds();
|
|
4578
|
+
loading.value = false;
|
|
4579
|
+
if (!result.ok) {
|
|
4580
|
+
loadError.value = result.error;
|
|
4581
|
+
return;
|
|
4582
|
+
}
|
|
4583
|
+
feeds.value = result.data.feeds;
|
|
4584
|
+
reconcileShortcuts("feed", feeds.value.map((feed) => ({
|
|
4585
|
+
slug: feed.slug,
|
|
4586
|
+
title: feed.title,
|
|
4587
|
+
icon: feed.icon || "dynamic_feed"
|
|
4588
|
+
})));
|
|
4589
|
+
}
|
|
4590
|
+
function open(slug) {
|
|
4591
|
+
cui.gotoDetail("feed", slug);
|
|
4592
|
+
}
|
|
4593
|
+
async function refresh(slug) {
|
|
4594
|
+
refreshingSlug.value = slug;
|
|
4595
|
+
refreshError.value = null;
|
|
4596
|
+
const result = await cui.refreshCollection(slug);
|
|
4597
|
+
refreshingSlug.value = null;
|
|
4598
|
+
if (!result.ok) {
|
|
4599
|
+
refreshError.value = t("collectionsView.refreshFailed", { error: result.error });
|
|
4600
|
+
return;
|
|
4601
|
+
}
|
|
4602
|
+
await load();
|
|
4603
|
+
if (result.data.errors.length > 0) refreshError.value = t("collectionsView.refreshFailed", { error: result.data.errors.join("; ") });
|
|
4604
|
+
}
|
|
4605
|
+
function startAddFeedChat() {
|
|
4606
|
+
addUrl.value = "";
|
|
4607
|
+
addOpen.value = true;
|
|
4608
|
+
nextTick(() => addInputEl.value?.focus());
|
|
4609
|
+
}
|
|
4610
|
+
function closeAdd() {
|
|
4611
|
+
addOpen.value = false;
|
|
4612
|
+
}
|
|
4613
|
+
function submitAdd() {
|
|
4614
|
+
const url = addUrl.value.trim();
|
|
4615
|
+
if (!url) return;
|
|
4616
|
+
addOpen.value = false;
|
|
4617
|
+
cui.startChat(t("collectionsView.addFeedPrompt", { url }), cui.personalRoleId);
|
|
4618
|
+
}
|
|
4619
|
+
function formatTime(iso) {
|
|
4620
|
+
const date = new Date(iso);
|
|
4621
|
+
return Number.isNaN(date.getTime()) ? iso : date.toLocaleString();
|
|
4622
|
+
}
|
|
4623
|
+
onMounted(load);
|
|
4624
|
+
return (_ctx, _cache) => {
|
|
4625
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("div", _hoisted_2, [
|
|
4626
|
+
createElementVNode("div", _hoisted_3, [createElementVNode("h1", _hoisted_4, toDisplayString(unref(t)("collectionsView.feedsTitle")), 1), createElementVNode("button", {
|
|
4627
|
+
type: "button",
|
|
4628
|
+
class: "h-8 px-2.5 flex items-center gap-1 rounded bg-indigo-600 hover:bg-indigo-700 text-white font-bold text-xs transition-colors shadow-sm",
|
|
4629
|
+
"data-testid": "feeds-add",
|
|
4630
|
+
onClick: startAddFeedChat
|
|
4631
|
+
}, [_cache[1] || (_cache[1] = createElementVNode("span", { class: "material-icons text-sm" }, "add", -1)), createElementVNode("span", null, toDisplayString(unref(t)("common.add")), 1)])]),
|
|
4632
|
+
refreshError.value ? (openBlock(), createElementBlock("div", _hoisted_5, [_cache[2] || (_cache[2] = createElementVNode("span", { class: "material-icons text-base text-red-600" }, "error", -1)), createElementVNode("span", null, toDisplayString(refreshError.value), 1)])) : createCommentVNode("", true),
|
|
4633
|
+
loading.value ? (openBlock(), createElementBlock("div", _hoisted_6, [_cache[3] || (_cache[3] = createElementVNode("div", { class: "h-8 w-8 border-2 border-indigo-600/20 border-t-indigo-600 rounded-full animate-spin" }, null, -1)), createElementVNode("span", null, toDisplayString(unref(t)("common.loading")), 1)])) : loadError.value ? (openBlock(), createElementBlock("div", _hoisted_7, [_cache[4] || (_cache[4] = createElementVNode("span", { class: "material-icons text-red-600" }, "error", -1)), createElementVNode("span", null, toDisplayString(unref(t)("collectionsView.loadFailed")) + ": " + toDisplayString(loadError.value), 1)])) : feeds.value.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_8, [_cache[5] || (_cache[5] = createElementVNode("span", { class: "material-icons text-4xl text-slate-300 mb-2" }, "dynamic_feed", -1)), createElementVNode("p", _hoisted_9, toDisplayString(unref(t)("collectionsView.feedsEmpty")), 1)])) : (openBlock(), createElementBlock("div", _hoisted_10, [(openBlock(true), createElementBlock(Fragment, null, renderList(feeds.value, (feed) => {
|
|
4634
|
+
return openBlock(), createElementBlock("div", {
|
|
4635
|
+
key: feed.slug,
|
|
4636
|
+
class: "group relative rounded-xl border border-slate-200 bg-white p-5 shadow-sm hover:shadow-md hover:border-indigo-300 transition-all duration-300 cursor-pointer flex items-center gap-4 focus:outline-none focus:ring-2 focus:ring-indigo-500/20",
|
|
4637
|
+
role: "button",
|
|
4638
|
+
tabindex: "0",
|
|
4639
|
+
"data-testid": `feeds-card-${feed.slug}`,
|
|
4640
|
+
onClick: ($event) => open(feed.slug),
|
|
4641
|
+
onKeydown: [withKeys(withModifiers(($event) => open(feed.slug), ["self"]), ["enter"]), withKeys(withModifiers(($event) => open(feed.slug), ["self", "prevent"]), ["space"])]
|
|
4642
|
+
}, [
|
|
4643
|
+
createElementVNode("div", _hoisted_12, [createElementVNode("span", _hoisted_13, toDisplayString(feed.icon || "dynamic_feed"), 1)]),
|
|
4644
|
+
createElementVNode("div", _hoisted_14, [createElementVNode("span", _hoisted_15, toDisplayString(feed.title), 1), createElementVNode("span", _hoisted_16, [createTextVNode(toDisplayString(feed.kind) + " · " + toDisplayString(feed.schedule) + " ", 1), feed.lastFetchedAt ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(" · " + toDisplayString(formatTime(feed.lastFetchedAt)), 1)], 64)) : createCommentVNode("", true)])]),
|
|
4645
|
+
(openBlock(), createBlock(resolveDynamicComponent(unref(pinToggle)), {
|
|
4646
|
+
kind: "feed",
|
|
4647
|
+
slug: feed.slug,
|
|
4648
|
+
title: feed.title,
|
|
4649
|
+
icon: feed.icon || "dynamic_feed"
|
|
4650
|
+
}, null, 8, [
|
|
4651
|
+
"slug",
|
|
4652
|
+
"title",
|
|
4653
|
+
"icon"
|
|
4654
|
+
])),
|
|
4655
|
+
createElementVNode("button", {
|
|
4656
|
+
type: "button",
|
|
4657
|
+
class: "h-8 w-8 flex items-center justify-center rounded-lg bg-slate-50 hover:bg-indigo-50 text-slate-400 hover:text-indigo-600 transition-all duration-300 disabled:opacity-50",
|
|
4658
|
+
disabled: refreshingSlug.value === feed.slug,
|
|
4659
|
+
title: unref(t)("collectionsView.refreshFeed"),
|
|
4660
|
+
"aria-label": unref(t)("collectionsView.refreshFeed"),
|
|
4661
|
+
"data-testid": `feeds-refresh-${feed.slug}`,
|
|
4662
|
+
onClick: withModifiers(($event) => refresh(feed.slug), ["stop"])
|
|
4663
|
+
}, [createElementVNode("span", _hoisted_18, toDisplayString(refreshingSlug.value === feed.slug ? "hourglass_empty" : "refresh"), 1)], 8, _hoisted_17)
|
|
4664
|
+
], 40, _hoisted_11);
|
|
4665
|
+
}), 128))]))
|
|
4666
|
+
]), addOpen.value ? (openBlock(), createElementBlock("div", {
|
|
4667
|
+
key: 0,
|
|
4668
|
+
class: "fixed inset-0 z-40 flex items-center justify-center bg-black/30 p-4",
|
|
4669
|
+
onClick: withModifiers(closeAdd, ["self"])
|
|
4670
|
+
}, [createElementVNode("div", _hoisted_19, [
|
|
4671
|
+
createElementVNode("h2", _hoisted_20, toDisplayString(unref(t)("collectionsView.addFeedTitle")), 1),
|
|
4672
|
+
createElementVNode("p", _hoisted_21, toDisplayString(unref(t)("collectionsView.addFeedHint")), 1),
|
|
4673
|
+
withDirectives(createElementVNode("input", {
|
|
4674
|
+
ref_key: "addInputEl",
|
|
4675
|
+
ref: addInputEl,
|
|
4676
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => addUrl.value = $event),
|
|
4677
|
+
type: "url",
|
|
4678
|
+
placeholder: "https://example.com/feed.xml",
|
|
4679
|
+
class: "w-full rounded border border-slate-200 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500/20 focus:border-indigo-500",
|
|
4680
|
+
"data-testid": "feeds-add-url",
|
|
4681
|
+
onKeydown: [withKeys(submitAdd, ["enter"]), withKeys(closeAdd, ["esc"])]
|
|
4682
|
+
}, null, 544), [[vModelText, addUrl.value]]),
|
|
4683
|
+
createElementVNode("div", _hoisted_22, [createElementVNode("button", {
|
|
4684
|
+
type: "button",
|
|
4685
|
+
class: "h-8 px-3 rounded text-xs font-medium text-slate-600 hover:bg-slate-100",
|
|
4686
|
+
onClick: closeAdd
|
|
4687
|
+
}, toDisplayString(unref(t)("common.cancel")), 1), createElementVNode("button", {
|
|
4688
|
+
type: "button",
|
|
4689
|
+
class: "h-8 px-3 rounded bg-indigo-600 hover:bg-indigo-700 text-white text-xs font-bold disabled:opacity-50",
|
|
4690
|
+
disabled: !addUrl.value.trim(),
|
|
4691
|
+
"data-testid": "feeds-add-submit",
|
|
4692
|
+
onClick: submitAdd
|
|
4693
|
+
}, toDisplayString(unref(t)("common.add")), 9, _hoisted_23)])
|
|
4694
|
+
])])) : createCommentVNode("", true)]);
|
|
4695
|
+
};
|
|
4696
|
+
}
|
|
4697
|
+
});
|
|
4698
|
+
//#endregion
|
|
4699
|
+
export { CollectionCalendarView_default as CollectionCalendarView, CollectionCustomView_default as CollectionCustomView, CollectionDayView_default as CollectionDayView, CollectionEmbedView_default as CollectionEmbedView, CollectionKanbanView_default as CollectionKanbanView, CollectionRecordModal_default as CollectionRecordModal, CollectionRecordPanel_default as CollectionRecordPanel, CollectionView_default as CollectionView, CollectionViewConfigModal_default as CollectionViewConfigModal, CollectionsIndexView_default as CollectionsIndexView, FeedsView_default as FeedsView, collectionUi, configureCollectionUi, readCollectionSort, readCollectionViewMode, useCollectionRendering, writeCollectionSort, writeCollectionViewMode };
|
|
1612
4700
|
|
|
1613
4701
|
//# sourceMappingURL=vue.js.map
|