@mulmoclaude/collection-plugin 0.5.0 → 0.5.2
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/server/discovery.d.ts +29 -1
- package/dist/server/discovery.d.ts.map +1 -1
- package/dist/server/paths.d.ts +6 -0
- package/dist/server/paths.d.ts.map +1 -1
- package/dist/server.cjs +68 -30
- package/dist/server.cjs.map +1 -1
- package/dist/server.js +67 -31
- package/dist/server.js.map +1 -1
- package/dist/vue/components/CollectionEmbedView.vue.d.ts.map +1 -1
- package/dist/vue/components/CollectionRecordPanel.vue.d.ts.map +1 -1
- package/dist/vue/components/CollectionView.vue.d.ts.map +1 -1
- package/dist/vue/refLink.d.ts +7 -0
- package/dist/vue/refLink.d.ts.map +1 -0
- package/dist/vue.cjs +60 -29
- package/dist/vue.cjs.map +1 -1
- package/dist/vue.js +60 -29
- package/dist/vue.js.map +1 -1
- package/package.json +1 -1
package/dist/vue.js
CHANGED
|
@@ -1560,8 +1560,35 @@ var CollectionKanbanView_default = /* @__PURE__ */ defineComponent({
|
|
|
1560
1560
|
}
|
|
1561
1561
|
});
|
|
1562
1562
|
//#endregion
|
|
1563
|
+
//#region src/vue/refLink.ts
|
|
1564
|
+
function isModifiedClick(event) {
|
|
1565
|
+
return event instanceof MouseEvent && (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey);
|
|
1566
|
+
}
|
|
1567
|
+
/** Activate a ref/embed link → navigate to `targetSlug` (optionally a record). */
|
|
1568
|
+
function activateRefLink(event, targetSlug, recordId, stop = false) {
|
|
1569
|
+
if (stop) event.stopPropagation();
|
|
1570
|
+
if (isModifiedClick(event)) return;
|
|
1571
|
+
event.preventDefault();
|
|
1572
|
+
collectionUi().navigateToRecord(targetSlug, recordId);
|
|
1573
|
+
}
|
|
1574
|
+
/** Activate a `file` cell link → navigate to a host path. When the host has no
|
|
1575
|
+
* `navigate` capability, do NOT preventDefault so the `href` still works (or, in
|
|
1576
|
+
* a router-less host that also has no path, the link simply isn't rendered). */
|
|
1577
|
+
function activatePathLink(event, path, stop = false) {
|
|
1578
|
+
if (stop) event.stopPropagation();
|
|
1579
|
+
if (isModifiedClick(event)) return;
|
|
1580
|
+
const nav = collectionUi().navigate;
|
|
1581
|
+
if (!nav) return;
|
|
1582
|
+
event.preventDefault();
|
|
1583
|
+
nav(path);
|
|
1584
|
+
}
|
|
1585
|
+
//#endregion
|
|
1563
1586
|
//#region src/vue/components/CollectionEmbedView.vue?vue&type=script&setup=true&lang.ts
|
|
1564
|
-
var _hoisted_1$8 = [
|
|
1587
|
+
var _hoisted_1$8 = [
|
|
1588
|
+
"href",
|
|
1589
|
+
"tabindex",
|
|
1590
|
+
"data-testid"
|
|
1591
|
+
];
|
|
1565
1592
|
var _hoisted_2$7 = { class: "flex items-center justify-between text-[10px] font-bold text-indigo-600/90 tracking-wider uppercase" };
|
|
1566
1593
|
var _hoisted_3$7 = { class: "flex items-center gap-1.5" };
|
|
1567
1594
|
var _hoisted_4$7 = { class: "bg-indigo-100/60 text-indigo-700 px-1.5 py-0.5 rounded font-mono font-medium lowercase" };
|
|
@@ -1586,7 +1613,7 @@ var _hoisted_13$4 = { class: "flex items-start gap-3" };
|
|
|
1586
1613
|
var _hoisted_14$4 = { class: "flex-1 min-w-0" };
|
|
1587
1614
|
var _hoisted_15$4 = { class: "text-xs font-semibold text-red-800 uppercase tracking-wider mb-1" };
|
|
1588
1615
|
var _hoisted_16$3 = ["data-testid"];
|
|
1589
|
-
var _hoisted_17$3 = ["href"];
|
|
1616
|
+
var _hoisted_17$3 = ["href", "tabindex"];
|
|
1590
1617
|
//#endregion
|
|
1591
1618
|
//#region src/vue/components/CollectionEmbedView.vue
|
|
1592
1619
|
var CollectionEmbedView_default = /* @__PURE__ */ defineComponent({
|
|
@@ -1602,12 +1629,15 @@ var CollectionEmbedView_default = /* @__PURE__ */ defineComponent({
|
|
|
1602
1629
|
return __props.view.found ? (openBlock(), createElementBlock("a", {
|
|
1603
1630
|
key: 0,
|
|
1604
1631
|
href: unref(cui).recordHref?.(__props.view.targetSlug, __props.view.recordId),
|
|
1632
|
+
tabindex: unref(cui).recordHref?.(__props.view.targetSlug, __props.view.recordId) ? void 0 : 0,
|
|
1633
|
+
role: "link",
|
|
1605
1634
|
class: "group block relative rounded-xl border border-slate-200 bg-slate-50/50 p-4 pl-5 space-y-3 hover:bg-indigo-50/20 hover:border-indigo-200 transition-all duration-300 shadow-sm",
|
|
1606
1635
|
"data-testid": `collections-embed-${__props.fieldKey}`,
|
|
1607
|
-
onClick: _cache[0] || (_cache[0] =
|
|
1636
|
+
onClick: _cache[0] || (_cache[0] = ($event) => unref(activateRefLink)($event, __props.view.targetSlug, __props.view.recordId)),
|
|
1637
|
+
onKeydown: [_cache[1] || (_cache[1] = withKeys(($event) => unref(activateRefLink)($event, __props.view.targetSlug, __props.view.recordId), ["enter"])), _cache[2] || (_cache[2] = withKeys(($event) => unref(activateRefLink)($event, __props.view.targetSlug, __props.view.recordId), ["space"]))]
|
|
1608
1638
|
}, [
|
|
1609
|
-
_cache[
|
|
1610
|
-
createElementVNode("div", _hoisted_2$7, [createElementVNode("div", _hoisted_3$7, [_cache[
|
|
1639
|
+
_cache[7] || (_cache[7] = 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)),
|
|
1640
|
+
createElementVNode("div", _hoisted_2$7, [createElementVNode("div", _hoisted_3$7, [_cache[6] || (_cache[6] = createElementVNode("span", { class: "material-icons text-sm" }, "link", -1)), createElementVNode("span", null, toDisplayString(__props.view.targetSlug), 1)]), createElementVNode("span", _hoisted_4$7, toDisplayString(__props.view.recordId), 1)]),
|
|
1611
1641
|
createElementVNode("div", _hoisted_5$6, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.view.rows, (row) => {
|
|
1612
1642
|
return openBlock(), createElementBlock("div", {
|
|
1613
1643
|
key: row.key,
|
|
@@ -1617,11 +1647,11 @@ var CollectionEmbedView_default = /* @__PURE__ */ defineComponent({
|
|
|
1617
1647
|
"data-testid": `collections-embed-${__props.fieldKey}-${row.key}`
|
|
1618
1648
|
}, [row.type === "boolean" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [row.value === true ? (openBlock(), createElementBlock("span", _hoisted_8$5, "check_circle")) : (openBlock(), createElementBlock("span", _hoisted_9$5, "—"))], 64)) : row.type === "markdown" ? (openBlock(), createElementBlock("p", _hoisted_10$5, toDisplayString(row.display), 1)) : (openBlock(), createElementBlock("span", _hoisted_11$5, toDisplayString(row.display), 1))], 8, _hoisted_7$5)]);
|
|
1619
1649
|
}), 128))])
|
|
1620
|
-
],
|
|
1650
|
+
], 40, _hoisted_1$8)) : (openBlock(), createElementBlock("div", {
|
|
1621
1651
|
key: 1,
|
|
1622
1652
|
class: "relative rounded-xl border border-red-100 bg-red-50/30 p-4 pl-5 shadow-sm",
|
|
1623
1653
|
"data-testid": `collections-embed-${__props.fieldKey}`
|
|
1624
|
-
}, [_cache[
|
|
1654
|
+
}, [_cache[10] || (_cache[10] = createElementVNode("div", { class: "absolute left-0 top-0 bottom-0 w-1 bg-red-400 rounded-l-xl" }, null, -1)), createElementVNode("div", _hoisted_13$4, [_cache[9] || (_cache[9] = createElementVNode("span", { class: "material-icons text-red-500 text-lg mt-0.5" }, "error_outline", -1)), createElementVNode("div", _hoisted_14$4, [
|
|
1625
1655
|
createElementVNode("p", _hoisted_15$4, toDisplayString(unref(t)("collectionsView.embedMissingTitle")), 1),
|
|
1626
1656
|
createElementVNode("p", {
|
|
1627
1657
|
class: "text-xs text-red-600",
|
|
@@ -1633,9 +1663,12 @@ var CollectionEmbedView_default = /* @__PURE__ */ defineComponent({
|
|
|
1633
1663
|
__props.view.targetSlug ? (openBlock(), createElementBlock("a", {
|
|
1634
1664
|
key: 0,
|
|
1635
1665
|
href: unref(cui).recordHref?.(__props.view.targetSlug),
|
|
1666
|
+
tabindex: unref(cui).recordHref?.(__props.view.targetSlug) ? void 0 : 0,
|
|
1667
|
+
role: "link",
|
|
1636
1668
|
class: "inline-flex items-center gap-0.5 text-xs text-indigo-600 hover:text-indigo-800 font-semibold mt-2 hover:underline",
|
|
1637
|
-
onClick: _cache[
|
|
1638
|
-
|
|
1669
|
+
onClick: _cache[3] || (_cache[3] = ($event) => unref(activateRefLink)($event, __props.view.targetSlug)),
|
|
1670
|
+
onKeydown: [_cache[4] || (_cache[4] = withKeys(($event) => unref(activateRefLink)($event, __props.view.targetSlug), ["enter"])), _cache[5] || (_cache[5] = withKeys(($event) => unref(activateRefLink)($event, __props.view.targetSlug), ["space"]))]
|
|
1671
|
+
}, [createElementVNode("span", null, toDisplayString(unref(t)("collectionsView.embedCreate")), 1), _cache[8] || (_cache[8] = createElementVNode("span", { class: "material-icons text-xs" }, "arrow_forward", -1))], 40, _hoisted_17$3)) : createCommentVNode("", true)
|
|
1639
1672
|
])])], 8, _hoisted_12$5));
|
|
1640
1673
|
};
|
|
1641
1674
|
}
|
|
@@ -1784,8 +1817,10 @@ var _hoisted_52$1 = {
|
|
|
1784
1817
|
};
|
|
1785
1818
|
var _hoisted_53$1 = [
|
|
1786
1819
|
"href",
|
|
1820
|
+
"tabindex",
|
|
1787
1821
|
"data-testid",
|
|
1788
|
-
"onClick"
|
|
1822
|
+
"onClick",
|
|
1823
|
+
"onKeydown"
|
|
1789
1824
|
];
|
|
1790
1825
|
var _hoisted_54$1 = {
|
|
1791
1826
|
key: 3,
|
|
@@ -2148,10 +2183,13 @@ var CollectionRecordPanel_default = /* @__PURE__ */ defineComponent({
|
|
|
2148
2183
|
}, [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(), createElementBlock("a", {
|
|
2149
2184
|
key: 2,
|
|
2150
2185
|
href: unref(cui).recordHref?.(field.to, String(detailRecord.value[key])),
|
|
2186
|
+
tabindex: unref(cui).recordHref?.(field.to, String(detailRecord.value[key])) ? void 0 : 0,
|
|
2187
|
+
role: "link",
|
|
2151
2188
|
class: "text-indigo-600 hover:text-indigo-800 font-bold hover:underline",
|
|
2152
2189
|
"data-testid": `collections-detail-ref-${key}`,
|
|
2153
|
-
onClick:
|
|
2154
|
-
|
|
2190
|
+
onClick: ($event) => unref(activateRefLink)($event, field.to, String(detailRecord.value[key])),
|
|
2191
|
+
onKeydown: [withKeys(($event) => unref(activateRefLink)($event, field.to, String(detailRecord.value[key])), ["enter"]), withKeys(($event) => unref(activateRefLink)($event, field.to, String(detailRecord.value[key])), ["space"])]
|
|
2192
|
+
}, toDisplayString(__props.render.refDisplay(field.to, String(detailRecord.value[key]))), 41, _hoisted_53$1)) : field.type === "money" ? (openBlock(), createElementBlock("span", _hoisted_54$1, toDisplayString(__props.render.formatMoney(detailRecord.value[key], __props.render.resolveCurrency(field, detailRecord.value), __props.locale)), 1)) : field.type === "derived" ? (openBlock(), createElementBlock("span", _hoisted_55$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_56$1, [createElementVNode("table", _hoisted_57$1, [createElementVNode("thead", _hoisted_58$1, [createElementVNode("tr", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(field.of, (subField, subKey) => {
|
|
2155
2193
|
return openBlock(), createElementBlock("th", {
|
|
2156
2194
|
key: subKey,
|
|
2157
2195
|
class: "text-left px-4 py-2 font-bold"
|
|
@@ -2198,7 +2236,7 @@ var CollectionRecordPanel_default = /* @__PURE__ */ defineComponent({
|
|
|
2198
2236
|
href: __props.render.fileRoutePath(detailRecord.value[key]) ?? void 0,
|
|
2199
2237
|
class: "text-blue-600 hover:text-blue-800 font-semibold hover:underline break-all",
|
|
2200
2238
|
"data-testid": `collections-detail-file-${key}`,
|
|
2201
|
-
onClick:
|
|
2239
|
+
onClick: ($event) => unref(activatePathLink)($event, __props.render.fileRoutePath(detailRecord.value[key]) ?? "")
|
|
2202
2240
|
}, toDisplayString(String(detailRecord.value[key])), 9, _hoisted_67$1)) : (openBlock(), createElementBlock("span", _hoisted_68$1, toDisplayString(__props.render.formatCell(detailRecord.value[key], field.type)), 1))], 8, _hoisted_47$1))], 2)) : createCommentVNode("", true)], 64);
|
|
2203
2241
|
}), 128)), editing.value && __props.saveError ? (openBlock(), createElementBlock("p", _hoisted_69$1, toDisplayString(__props.saveError), 1)) : createCommentVNode("", true)])
|
|
2204
2242
|
]),
|
|
@@ -2891,8 +2929,10 @@ var _hoisted_65 = {
|
|
|
2891
2929
|
};
|
|
2892
2930
|
var _hoisted_66 = [
|
|
2893
2931
|
"href",
|
|
2932
|
+
"tabindex",
|
|
2894
2933
|
"data-testid",
|
|
2895
|
-
"onClick"
|
|
2934
|
+
"onClick",
|
|
2935
|
+
"onKeydown"
|
|
2896
2936
|
];
|
|
2897
2937
|
var _hoisted_67 = [
|
|
2898
2938
|
"value",
|
|
@@ -2962,18 +3002,6 @@ var CollectionView_default = /* @__PURE__ */ defineComponent({
|
|
|
2962
3002
|
const cui = collectionUi();
|
|
2963
3003
|
const { confirm: openConfirm, unpin, pinToggle, startChat } = cui;
|
|
2964
3004
|
const appApi = { startNewChat: startChat };
|
|
2965
|
-
function onRefLinkClick(event, targetSlug, recordId) {
|
|
2966
|
-
event.stopPropagation();
|
|
2967
|
-
if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
|
|
2968
|
-
event.preventDefault();
|
|
2969
|
-
cui.navigateToRecord(targetSlug, recordId);
|
|
2970
|
-
}
|
|
2971
|
-
function onFileLinkClick(event, path) {
|
|
2972
|
-
event.stopPropagation();
|
|
2973
|
-
if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
|
|
2974
|
-
event.preventDefault();
|
|
2975
|
-
cui.navigate?.(path);
|
|
2976
|
-
}
|
|
2977
3005
|
/** Embedded when a `slug` prop is supplied; standalone (route-driven)
|
|
2978
3006
|
* otherwise. Switches the slug/selected source and the open/close
|
|
2979
3007
|
* navigation behaviour. */
|
|
@@ -4293,10 +4321,13 @@ var CollectionView_default = /* @__PURE__ */ defineComponent({
|
|
|
4293
4321
|
onChange: ($event) => commitInlineEdit(item, String(key), field, $event.target.checked)
|
|
4294
4322
|
}, null, 40, _hoisted_64)) : field.type === "ref" && field.to && typeof item[key] === "string" && item[key] ? (openBlock(), createElementBlock("span", _hoisted_65, [createElementVNode("a", {
|
|
4295
4323
|
href: unref(cui).recordHref?.(field.to, String(item[key])),
|
|
4324
|
+
tabindex: unref(cui).recordHref?.(field.to, String(item[key])) ? void 0 : 0,
|
|
4325
|
+
role: "link",
|
|
4296
4326
|
class: "text-indigo-600 hover:text-indigo-800 hover:underline font-semibold",
|
|
4297
4327
|
"data-testid": `collections-ref-link-${key}-${item[key]}`,
|
|
4298
|
-
onClick: ($event) =>
|
|
4299
|
-
|
|
4328
|
+
onClick: ($event) => unref(activateRefLink)($event, field.to, String(item[key]), true),
|
|
4329
|
+
onKeydown: [withKeys(($event) => unref(activateRefLink)($event, field.to, String(item[key]), true), ["enter"]), withKeys(($event) => unref(activateRefLink)($event, field.to, String(item[key]), true), ["space"])]
|
|
4330
|
+
}, toDisplayString(unref(refDisplay)(field.to, String(item[key]))), 41, _hoisted_66)])) : field.type === "enum" && Array.isArray(field.values) && field.values.length > 0 ? (openBlock(), createElementBlock("select", {
|
|
4300
4331
|
key: 3,
|
|
4301
4332
|
value: item[key] == null ? "" : String(item[key]),
|
|
4302
4333
|
disabled: isRowInlineSaving(item),
|
|
@@ -4331,7 +4362,7 @@ var CollectionView_default = /* @__PURE__ */ defineComponent({
|
|
|
4331
4362
|
href: unref(fileRoutePath)(item[key]) ?? void 0,
|
|
4332
4363
|
class: "block truncate text-blue-600 hover:text-blue-800 hover:underline font-semibold",
|
|
4333
4364
|
"data-testid": `collections-file-link-${key}-${item[collection.value.schema.primaryKey]}`,
|
|
4334
|
-
onClick: ($event) =>
|
|
4365
|
+
onClick: ($event) => unref(activatePathLink)($event, unref(fileRoutePath)(item[key]) ?? "", true)
|
|
4335
4366
|
}, toDisplayString(String(item[key])), 9, _hoisted_75)) : (openBlock(), createElementBlock("span", _hoisted_76, toDisplayString(unref(formatCell)(item[key], field.type)), 1))], 64)) : createCommentVNode("", true)]);
|
|
4336
4367
|
}), 128))], 42, _hoisted_62);
|
|
4337
4368
|
}), 128))])])]))]),
|