@object-ui/plugin-detail 3.4.0 → 4.0.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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @object-ui/plugin-detail
|
|
2
2
|
|
|
3
|
+
## 4.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @object-ui/types@4.0.1
|
|
8
|
+
- @object-ui/core@4.0.1
|
|
9
|
+
- @object-ui/react@4.0.1
|
|
10
|
+
- @object-ui/components@4.0.1
|
|
11
|
+
- @object-ui/fields@4.0.1
|
|
12
|
+
|
|
13
|
+
## 4.0.0
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
- @object-ui/types@4.0.0
|
|
19
|
+
- @object-ui/components@4.0.0
|
|
20
|
+
- @object-ui/core@4.0.0
|
|
21
|
+
- @object-ui/fields@4.0.0
|
|
22
|
+
- @object-ui/react@4.0.0
|
|
23
|
+
|
|
3
24
|
## 3.4.0
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -1142,15 +1142,18 @@ var At = ({ section: e, data: t, className: i, objectSchema: u, objectName: m, i
|
|
|
1142
1142
|
}), o.map((e) => /* @__PURE__ */ X(y, {
|
|
1143
1143
|
value: e.key,
|
|
1144
1144
|
className: "mt-4",
|
|
1145
|
-
children:
|
|
1146
|
-
|
|
1147
|
-
children: e.content
|
|
1148
|
-
|
|
1145
|
+
children: /* @__PURE__ */ X(J.Suspense, {
|
|
1146
|
+
fallback: null,
|
|
1147
|
+
children: Array.isArray(e.content) ? /* @__PURE__ */ X("div", {
|
|
1148
|
+
className: "space-y-4",
|
|
1149
|
+
children: e.content.map((e, n) => /* @__PURE__ */ X(g, {
|
|
1150
|
+
schema: e,
|
|
1151
|
+
data: t
|
|
1152
|
+
}, n))
|
|
1153
|
+
}) : /* @__PURE__ */ X(g, {
|
|
1154
|
+
schema: e.content,
|
|
1149
1155
|
data: t
|
|
1150
|
-
}
|
|
1151
|
-
}) : /* @__PURE__ */ X(g, {
|
|
1152
|
-
schema: e.content,
|
|
1153
|
-
data: t
|
|
1156
|
+
})
|
|
1154
1157
|
})
|
|
1155
1158
|
}, e.key))]
|
|
1156
1159
|
});
|
|
@@ -1784,7 +1787,43 @@ var Ht = {
|
|
|
1784
1787
|
})]
|
|
1785
1788
|
})] })]
|
|
1786
1789
|
});
|
|
1787
|
-
}, Wt = 5
|
|
1790
|
+
}, Wt = 5;
|
|
1791
|
+
function Gt(e, t, n, r) {
|
|
1792
|
+
if (e && typeof e == "object") {
|
|
1793
|
+
if (t.primaryField) {
|
|
1794
|
+
let n = e[t.primaryField];
|
|
1795
|
+
if (n != null && n !== "") return String(n);
|
|
1796
|
+
}
|
|
1797
|
+
let r = n?.titleFormat;
|
|
1798
|
+
if (r) {
|
|
1799
|
+
let t = "[-\\u2013\\u2014|/·,:]", n = !1, i = r.replace(/\{([^{}]+)\}/g, (t, r) => {
|
|
1800
|
+
let i = e[r.trim()];
|
|
1801
|
+
return i != null && i !== "" ? (n = !0, String(i)) : "\0";
|
|
1802
|
+
});
|
|
1803
|
+
if (n) {
|
|
1804
|
+
let e = i.replace(RegExp(`\\s*${t}\\s*`, "g"), "").replace(RegExp(`\\s*${t}\\s*`, "g"), "").replace(RegExp("\0", "g"), "").replace(/\s+/g, " ").trim();
|
|
1805
|
+
if (e) return e;
|
|
1806
|
+
}
|
|
1807
|
+
}
|
|
1808
|
+
}
|
|
1809
|
+
if (t.title) return t.title;
|
|
1810
|
+
if (e && typeof e == "object") for (let t of [
|
|
1811
|
+
"name",
|
|
1812
|
+
"full_name",
|
|
1813
|
+
"fullName",
|
|
1814
|
+
"title",
|
|
1815
|
+
"subject",
|
|
1816
|
+
"label",
|
|
1817
|
+
"display_name",
|
|
1818
|
+
"displayName"
|
|
1819
|
+
]) {
|
|
1820
|
+
let n = e[t];
|
|
1821
|
+
if (typeof n == "string" && n.trim()) return n.trim();
|
|
1822
|
+
if (n != null && n !== "") return String(n);
|
|
1823
|
+
}
|
|
1824
|
+
return r;
|
|
1825
|
+
}
|
|
1826
|
+
var Kt = ({ schema: e, dataSource: t, className: r, onEdit: i, onDelete: a, onBack: o, inlineEdit: s = !1, onFieldSave: c, discussionSlot: l, rightRail: u, objectLabel: h, onDataLoaded: b }) => {
|
|
1788
1827
|
let [x, C] = J.useState(e.data), [T, O] = J.useState(!e.data && !!(e.api && e.resourceId || t && e.objectName && e.resourceId)), [k, ee] = J.useState(!1), [j, te] = J.useState(!1), [M, N] = J.useState({}), [P, F] = J.useState(null), [I, ne] = J.useState(!1), { t: z } = $();
|
|
1789
1828
|
J.useEffect(() => {
|
|
1790
1829
|
x && b && b(x);
|
|
@@ -2089,7 +2128,7 @@ var Ht = {
|
|
|
2089
2128
|
children: [
|
|
2090
2129
|
/* @__PURE__ */ X("h1", {
|
|
2091
2130
|
className: "text-xl sm:text-2xl font-bold truncate",
|
|
2092
|
-
children:
|
|
2131
|
+
children: Gt(x, e, P, z("detail.details"))
|
|
2093
2132
|
}),
|
|
2094
2133
|
ae.map((t) => {
|
|
2095
2134
|
let r = x?.[t];
|
|
@@ -2462,7 +2501,7 @@ var Ht = {
|
|
|
2462
2501
|
}) })
|
|
2463
2502
|
]
|
|
2464
2503
|
}) });
|
|
2465
|
-
},
|
|
2504
|
+
}, qt = ({ objectName: e, relationshipField: t, fields: n, onCreateRecord: i, onLinkRecord: a, onSearch: o, existingRecords: u = [], className: p }) => {
|
|
2466
2505
|
let [h, g] = J.useState(!1), [_, v] = J.useState("create"), [x, C] = J.useState({}), [T, E] = J.useState(""), [D, O] = J.useState(u), [k, A] = J.useState(!1), [ee, j] = J.useState(!1), te = J.useMemo(() => {
|
|
2467
2506
|
if (!T.trim()) return D;
|
|
2468
2507
|
let e = T.toLowerCase();
|
|
@@ -2635,11 +2674,11 @@ var Ht = {
|
|
|
2635
2674
|
};
|
|
2636
2675
|
//#endregion
|
|
2637
2676
|
//#region src/RichTextCommentInput.tsx
|
|
2638
|
-
function
|
|
2677
|
+
function Jt(e) {
|
|
2639
2678
|
let t = e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/```([\s\S]*?)```/g, "<pre class=\"bg-muted rounded p-2 text-xs font-mono my-1 overflow-x-auto\">$1</pre>").replace(/`([^`]+)`/g, "<code class=\"bg-muted rounded px-1 py-0.5 text-xs font-mono\">$1</code>").replace(/\*\*(.+?)\*\*/g, "<strong>$1</strong>").replace(/\*(.+?)\*/g, "<em>$1</em>").replace(/@(\w+)/g, "<span class=\"text-primary font-medium\">@$1</span>").replace(/^- (.+)$/gm, "<li class=\"ml-4 list-disc\">$1</li>").replace(/\n/g, "<br/>");
|
|
2640
2679
|
return t = t.replace(/(<li[^>]*>.*?<\/li>(?:<br\/>)?)+/g, (e) => `<ul class="my-1">${e.replace(/<br\/>/g, "")}</ul>`), t;
|
|
2641
2680
|
}
|
|
2642
|
-
var
|
|
2681
|
+
var Yt = ({ value: e, onChange: t, onSubmit: n, mentionSuggestions: r = [], placeholder: i, className: a, disabled: o = !1 }) => {
|
|
2643
2682
|
let { t: s } = $(), [c, l] = J.useState(!1), [u, p] = J.useState(!1), [m, h] = J.useState(""), [g, _] = J.useState(0), v = J.useRef(null), y = J.useMemo(() => {
|
|
2644
2683
|
if (!m) return r;
|
|
2645
2684
|
let e = m.toLowerCase();
|
|
@@ -2772,7 +2811,7 @@ var Jt = ({ value: e, onChange: t, onSubmit: n, mentionSuggestions: r = [], plac
|
|
|
2772
2811
|
className: "relative",
|
|
2773
2812
|
children: c ? /* @__PURE__ */ X("div", {
|
|
2774
2813
|
className: "min-h-[80px] px-3 py-2 text-sm prose prose-sm max-w-none",
|
|
2775
|
-
dangerouslySetInnerHTML: { __html:
|
|
2814
|
+
dangerouslySetInnerHTML: { __html: Jt(e) }
|
|
2776
2815
|
}) : /* @__PURE__ */ Z(Y, { children: [/* @__PURE__ */ X("textarea", {
|
|
2777
2816
|
ref: v,
|
|
2778
2817
|
className: "w-full min-h-[80px] px-3 py-2 text-sm bg-transparent resize-none focus:outline-none placeholder:text-muted-foreground",
|
|
@@ -2804,7 +2843,7 @@ var Jt = ({ value: e, onChange: t, onSubmit: n, mentionSuggestions: r = [], plac
|
|
|
2804
2843
|
};
|
|
2805
2844
|
//#endregion
|
|
2806
2845
|
//#region src/DiffView.tsx
|
|
2807
|
-
function
|
|
2846
|
+
function Xt(e, t) {
|
|
2808
2847
|
if (e == null) return ["(empty)"];
|
|
2809
2848
|
switch (t) {
|
|
2810
2849
|
case "json": try {
|
|
@@ -2823,7 +2862,7 @@ function Yt(e, t) {
|
|
|
2823
2862
|
default: return String(e).split("\n");
|
|
2824
2863
|
}
|
|
2825
2864
|
}
|
|
2826
|
-
function
|
|
2865
|
+
function Zt(e, t) {
|
|
2827
2866
|
let n = [], r = Math.max(e.length, t.length);
|
|
2828
2867
|
for (let i = 0; i < r; i++) {
|
|
2829
2868
|
let r = i < e.length ? e[i] : void 0, a = i < t.length ? t[i] : void 0;
|
|
@@ -2840,16 +2879,16 @@ function Xt(e, t) {
|
|
|
2840
2879
|
}
|
|
2841
2880
|
return n;
|
|
2842
2881
|
}
|
|
2843
|
-
var
|
|
2882
|
+
var Qt = {
|
|
2844
2883
|
added: "bg-green-50 text-green-800 dark:bg-green-950/30 dark:text-green-300",
|
|
2845
2884
|
removed: "bg-red-50 text-red-800 dark:bg-red-950/30 dark:text-red-300",
|
|
2846
2885
|
unchanged: "text-muted-foreground"
|
|
2847
|
-
},
|
|
2886
|
+
}, $t = {
|
|
2848
2887
|
added: "+",
|
|
2849
2888
|
removed: "-",
|
|
2850
2889
|
unchanged: " "
|
|
2851
|
-
},
|
|
2852
|
-
let { t: u } = $(), [p, m] = J.useState(a), h = J.useMemo(() =>
|
|
2890
|
+
}, en = ({ oldValue: e, newValue: t, fieldName: n, fieldType: i = "string", mode: a = "unified", className: o }) => {
|
|
2891
|
+
let { t: u } = $(), [p, m] = J.useState(a), h = J.useMemo(() => Xt(e, i), [e, i]), g = J.useMemo(() => Xt(t, i), [t, i]), _ = J.useMemo(() => Zt(h, g), [h, g]), v = _.some((e) => e.type !== "unchanged"), y = J.useMemo(() => {
|
|
2853
2892
|
if (p !== "side-by-side") return [];
|
|
2854
2893
|
let e = [], t = 0;
|
|
2855
2894
|
for (; t < _.length;) {
|
|
@@ -2907,10 +2946,10 @@ var Zt = {
|
|
|
2907
2946
|
children: v ? p === "unified" ? /* @__PURE__ */ X("div", {
|
|
2908
2947
|
className: "font-mono text-xs overflow-x-auto",
|
|
2909
2948
|
children: _.map((e, t) => /* @__PURE__ */ Z("div", {
|
|
2910
|
-
className: f("px-4 py-0.5 whitespace-pre-wrap border-l-2",
|
|
2949
|
+
className: f("px-4 py-0.5 whitespace-pre-wrap border-l-2", Qt[e.type], e.type === "added" && "border-l-green-500", e.type === "removed" && "border-l-red-500", e.type === "unchanged" && "border-l-transparent"),
|
|
2911
2950
|
children: [/* @__PURE__ */ X("span", {
|
|
2912
2951
|
className: "select-none mr-2 inline-block w-3 text-center opacity-60",
|
|
2913
|
-
children:
|
|
2952
|
+
children: $t[e.type]
|
|
2914
2953
|
}), e.value]
|
|
2915
2954
|
}, t))
|
|
2916
2955
|
}) : /* @__PURE__ */ X("div", {
|
|
@@ -2927,10 +2966,10 @@ var Zt = {
|
|
|
2927
2966
|
children: u("detail.currentVersion")
|
|
2928
2967
|
}),
|
|
2929
2968
|
y.map((e, t) => /* @__PURE__ */ Z(J.Fragment, { children: [/* @__PURE__ */ X("div", {
|
|
2930
|
-
className: f("px-3 py-0.5 whitespace-pre-wrap min-h-[1.5em]", e.left ?
|
|
2969
|
+
className: f("px-3 py-0.5 whitespace-pre-wrap min-h-[1.5em]", e.left ? Qt[e.left.type] : "bg-muted/20"),
|
|
2931
2970
|
children: e.left?.value ?? ""
|
|
2932
2971
|
}), /* @__PURE__ */ X("div", {
|
|
2933
|
-
className: f("px-3 py-0.5 whitespace-pre-wrap min-h-[1.5em]", e.right ?
|
|
2972
|
+
className: f("px-3 py-0.5 whitespace-pre-wrap min-h-[1.5em]", e.right ? Qt[e.right.type] : "bg-muted/20"),
|
|
2934
2973
|
children: e.right?.value ?? ""
|
|
2935
2974
|
})] }, t))
|
|
2936
2975
|
]
|
|
@@ -2941,7 +2980,7 @@ var Zt = {
|
|
|
2941
2980
|
})
|
|
2942
2981
|
})]
|
|
2943
2982
|
});
|
|
2944
|
-
},
|
|
2983
|
+
}, tn = ({ currentIndex: e, totalRecords: t, recordIds: n, onNavigate: r, onSearch: i, className: a }) => {
|
|
2945
2984
|
let { t: o } = $(), [s, c] = J.useState(""), [l, u] = J.useState(!1), p = J.useRef(null), m = e > 0, h = e > 0, g = e < t - 1, _ = e < t - 1, v = J.useCallback(() => {
|
|
2946
2985
|
m && r(n[0]);
|
|
2947
2986
|
}, [
|
|
@@ -3074,18 +3113,18 @@ var Zt = {
|
|
|
3074
3113
|
})] })
|
|
3075
3114
|
]
|
|
3076
3115
|
});
|
|
3077
|
-
},
|
|
3116
|
+
}, nn = 28, rn = [
|
|
3078
3117
|
"fill-primary stroke-primary",
|
|
3079
3118
|
"fill-blue-500 stroke-blue-500",
|
|
3080
3119
|
"fill-emerald-500 stroke-emerald-500",
|
|
3081
3120
|
"fill-amber-500 stroke-amber-500"
|
|
3082
|
-
],
|
|
3121
|
+
], an = [
|
|
3083
3122
|
"fill-primary-foreground",
|
|
3084
3123
|
"fill-white",
|
|
3085
3124
|
"fill-white",
|
|
3086
3125
|
"fill-white"
|
|
3087
3126
|
];
|
|
3088
|
-
function
|
|
3127
|
+
function on(e, t, n, r, i) {
|
|
3089
3128
|
let a = [], o = [], s = /* @__PURE__ */ new Set(), c = r / 2, l = i / 2;
|
|
3090
3129
|
a.push({
|
|
3091
3130
|
id: e.id,
|
|
@@ -3149,10 +3188,10 @@ function an(e, t, n, r, i) {
|
|
|
3149
3188
|
edges: o
|
|
3150
3189
|
};
|
|
3151
3190
|
}
|
|
3152
|
-
function
|
|
3191
|
+
function sn(e, t = 6) {
|
|
3153
3192
|
return e.length <= t ? e : e.slice(0, t - 1) + "…";
|
|
3154
3193
|
}
|
|
3155
|
-
var
|
|
3194
|
+
var cn = ({ record: e, relatedRecords: t, levels: n = 1, onNodeClick: i, className: a }) => {
|
|
3156
3195
|
let o = J.useRef(null), [u, d] = J.useState({
|
|
3157
3196
|
width: 500,
|
|
3158
3197
|
height: 400
|
|
@@ -3173,7 +3212,7 @@ var sn = ({ record: e, relatedRecords: t, levels: n = 1, onNodeClick: i, classNa
|
|
|
3173
3212
|
});
|
|
3174
3213
|
return n.observe(t), () => n.disconnect();
|
|
3175
3214
|
}, []);
|
|
3176
|
-
let { nodes: h, edges: g } = J.useMemo(() =>
|
|
3215
|
+
let { nodes: h, edges: g } = J.useMemo(() => on(e, t, n, u.width, u.height), [
|
|
3177
3216
|
e,
|
|
3178
3217
|
t,
|
|
3179
3218
|
n,
|
|
@@ -3215,7 +3254,7 @@ var sn = ({ record: e, relatedRecords: t, levels: n = 1, onNodeClick: i, classNa
|
|
|
3215
3254
|
strokeWidth: 1.5,
|
|
3216
3255
|
strokeOpacity: .5
|
|
3217
3256
|
}, `edge-${t}`)), h.map((e) => {
|
|
3218
|
-
let t = p === e.id, n =
|
|
3257
|
+
let t = p === e.id, n = rn[Math.min(e.level, rn.length - 1)], r = an[Math.min(e.level, an.length - 1)], a = e.level === 0 ? nn + 6 : nn;
|
|
3219
3258
|
return /* @__PURE__ */ Z("g", {
|
|
3220
3259
|
className: f("cursor-pointer transition-transform", i && "hover:opacity-80"),
|
|
3221
3260
|
onClick: () => i?.(e.id),
|
|
@@ -3237,7 +3276,7 @@ var sn = ({ record: e, relatedRecords: t, levels: n = 1, onNodeClick: i, classNa
|
|
|
3237
3276
|
textAnchor: "middle",
|
|
3238
3277
|
dominantBaseline: "central",
|
|
3239
3278
|
className: f("text-[10px] font-medium pointer-events-none", r),
|
|
3240
|
-
children:
|
|
3279
|
+
children: sn(e.label)
|
|
3241
3280
|
}),
|
|
3242
3281
|
e.type && /* @__PURE__ */ X("text", {
|
|
3243
3282
|
x: e.x,
|
|
@@ -3271,16 +3310,16 @@ var sn = ({ record: e, relatedRecords: t, levels: n = 1, onNodeClick: i, classNa
|
|
|
3271
3310
|
};
|
|
3272
3311
|
//#endregion
|
|
3273
3312
|
//#region src/CommentAttachment.tsx
|
|
3274
|
-
function
|
|
3313
|
+
function ln(e) {
|
|
3275
3314
|
return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
3276
3315
|
}
|
|
3277
|
-
function
|
|
3316
|
+
function un(e) {
|
|
3278
3317
|
return e.startsWith("image/");
|
|
3279
3318
|
}
|
|
3280
|
-
function
|
|
3281
|
-
return
|
|
3319
|
+
function dn(e) {
|
|
3320
|
+
return un(e) ? U : e.includes("pdf") || e.includes("document") || e.includes("text") ? V : e.includes("zip") || e.includes("archive") || e.includes("compressed") ? de : H;
|
|
3282
3321
|
}
|
|
3283
|
-
var
|
|
3322
|
+
var fn = ({ attachments: e, onUpload: t, onRemove: n, className: r, readOnly: i = !1 }) => {
|
|
3284
3323
|
let { t: a } = $(), [o, s] = J.useState(!1), c = J.useRef(null), l = J.useCallback((e) => {
|
|
3285
3324
|
e.preventDefault(), e.stopPropagation(), s(!0);
|
|
3286
3325
|
}, []), u = J.useCallback((e) => {
|
|
@@ -3325,7 +3364,7 @@ var dn = ({ attachments: e, onUpload: t, onRemove: n, className: r, readOnly: i
|
|
|
3325
3364
|
}), /* @__PURE__ */ X("div", {
|
|
3326
3365
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-2",
|
|
3327
3366
|
children: e.map((e) => {
|
|
3328
|
-
let t =
|
|
3367
|
+
let t = un(e.type), r = dn(e.type);
|
|
3329
3368
|
return /* @__PURE__ */ Z("div", {
|
|
3330
3369
|
className: "flex items-center gap-2 rounded-md border px-2.5 py-2 bg-muted/30 group",
|
|
3331
3370
|
children: [
|
|
@@ -3344,7 +3383,7 @@ var dn = ({ attachments: e, onUpload: t, onRemove: n, className: r, readOnly: i
|
|
|
3344
3383
|
children: e.name
|
|
3345
3384
|
}), /* @__PURE__ */ X("p", {
|
|
3346
3385
|
className: "text-[10px] text-muted-foreground",
|
|
3347
|
-
children:
|
|
3386
|
+
children: ln(e.size)
|
|
3348
3387
|
})]
|
|
3349
3388
|
}),
|
|
3350
3389
|
n && !i && /* @__PURE__ */ X(d, {
|
|
@@ -3364,7 +3403,7 @@ var dn = ({ attachments: e, onUpload: t, onRemove: n, className: r, readOnly: i
|
|
|
3364
3403
|
};
|
|
3365
3404
|
//#endregion
|
|
3366
3405
|
//#region src/PointInTimeRestore.tsx
|
|
3367
|
-
function
|
|
3406
|
+
function pn(e) {
|
|
3368
3407
|
try {
|
|
3369
3408
|
let t = new Date(e), n = (/* @__PURE__ */ new Date()).getTime() - t.getTime(), r = Math.floor(n / 6e4);
|
|
3370
3409
|
if (r < 1) return "just now";
|
|
@@ -3375,7 +3414,7 @@ function fn(e) {
|
|
|
3375
3414
|
return e;
|
|
3376
3415
|
}
|
|
3377
3416
|
}
|
|
3378
|
-
var
|
|
3417
|
+
var mn = ({ recordId: e, revisions: t, onRestore: n, className: i }) => {
|
|
3379
3418
|
let [a, o] = J.useState(null), [u, p] = J.useState(!1), [m, h] = J.useState(!1), g = J.useMemo(() => t.find((e) => e.id === a) ?? null, [t, a]), _ = J.useCallback(async () => {
|
|
3380
3419
|
if (!(!g || !n)) {
|
|
3381
3420
|
if (!u) {
|
|
@@ -3447,7 +3486,7 @@ var pn = ({ recordId: e, revisions: t, onRestore: n, className: i }) => {
|
|
|
3447
3486
|
children: e.user
|
|
3448
3487
|
}), /* @__PURE__ */ X("span", {
|
|
3449
3488
|
className: "text-xs text-muted-foreground",
|
|
3450
|
-
children:
|
|
3489
|
+
children: pn(e.timestamp)
|
|
3451
3490
|
})]
|
|
3452
3491
|
}), /* @__PURE__ */ Z("p", {
|
|
3453
3492
|
className: "text-xs text-muted-foreground mt-0.5",
|
|
@@ -3520,7 +3559,7 @@ var pn = ({ recordId: e, revisions: t, onRestore: n, className: i }) => {
|
|
|
3520
3559
|
children: [
|
|
3521
3560
|
"This will restore the record to its state at",
|
|
3522
3561
|
" ",
|
|
3523
|
-
|
|
3562
|
+
pn(g.timestamp),
|
|
3524
3563
|
". Continue?"
|
|
3525
3564
|
]
|
|
3526
3565
|
}), /* @__PURE__ */ Z("div", {
|
|
@@ -3551,7 +3590,7 @@ var pn = ({ recordId: e, revisions: t, onRestore: n, className: i }) => {
|
|
|
3551
3590
|
})]
|
|
3552
3591
|
}) })]
|
|
3553
3592
|
});
|
|
3554
|
-
},
|
|
3593
|
+
}, hn = ({ change: e, className: t }) => {
|
|
3555
3594
|
let n = e.fieldLabel ?? e.field.charAt(0).toUpperCase() + e.field.slice(1).replace(/_/g, " "), r = e.oldDisplayValue ?? (e.oldValue == null ? "(empty)" : String(e.oldValue)), i = e.newDisplayValue ?? (e.newValue == null ? "(empty)" : String(e.newValue));
|
|
3556
3595
|
return /* @__PURE__ */ Z("div", {
|
|
3557
3596
|
className: f("flex items-center gap-1.5 text-sm flex-wrap", t),
|
|
@@ -3571,14 +3610,14 @@ var pn = ({ recordId: e, revisions: t, onRestore: n, className: i }) => {
|
|
|
3571
3610
|
})
|
|
3572
3611
|
]
|
|
3573
3612
|
});
|
|
3574
|
-
},
|
|
3613
|
+
}, gn = [
|
|
3575
3614
|
"👍",
|
|
3576
3615
|
"❤️",
|
|
3577
3616
|
"🎉",
|
|
3578
3617
|
"😂",
|
|
3579
3618
|
"😮",
|
|
3580
3619
|
"😢"
|
|
3581
|
-
],
|
|
3620
|
+
], _n = ({ reactions: e, onToggleReaction: t, emojiOptions: n = gn, className: r }) => {
|
|
3582
3621
|
let [i, a] = J.useState(!1), o = J.useCallback((e) => {
|
|
3583
3622
|
t?.(e), a(!1);
|
|
3584
3623
|
}, [t]);
|
|
@@ -3618,7 +3657,7 @@ var pn = ({ recordId: e, revisions: t, onRestore: n, className: i }) => {
|
|
|
3618
3657
|
};
|
|
3619
3658
|
//#endregion
|
|
3620
3659
|
//#region src/ThreadedReplies.tsx
|
|
3621
|
-
function
|
|
3660
|
+
function vn(e) {
|
|
3622
3661
|
try {
|
|
3623
3662
|
let t = new Date(e), n = (/* @__PURE__ */ new Date()).getTime() - t.getTime(), r = Math.floor(n / 6e4);
|
|
3624
3663
|
if (r < 1) return "just now";
|
|
@@ -3631,7 +3670,7 @@ function _n(e) {
|
|
|
3631
3670
|
return e;
|
|
3632
3671
|
}
|
|
3633
3672
|
}
|
|
3634
|
-
var
|
|
3673
|
+
var yn = ({ parentItem: e, replies: t, onAddReply: n, showReplyInput: r = !0, className: i }) => {
|
|
3635
3674
|
let { t: a } = $(), [o, s] = J.useState(!1), [c, l] = J.useState(""), [u, p] = J.useState(!1), m = J.useCallback(async () => {
|
|
3636
3675
|
let t = c.trim();
|
|
3637
3676
|
if (!(!t || !n)) {
|
|
@@ -3686,7 +3725,7 @@ var vn = ({ parentItem: e, replies: t, onAddReply: n, showReplyInput: r = !0, cl
|
|
|
3686
3725
|
children: e.actor
|
|
3687
3726
|
}), /* @__PURE__ */ X("span", {
|
|
3688
3727
|
className: "text-[10px] text-muted-foreground",
|
|
3689
|
-
children:
|
|
3728
|
+
children: vn(e.createdAt)
|
|
3690
3729
|
})]
|
|
3691
3730
|
}), /* @__PURE__ */ X("p", {
|
|
3692
3731
|
className: "text-xs whitespace-pre-wrap break-words",
|
|
@@ -3716,7 +3755,7 @@ var vn = ({ parentItem: e, replies: t, onAddReply: n, showReplyInput: r = !0, cl
|
|
|
3716
3755
|
})
|
|
3717
3756
|
]
|
|
3718
3757
|
});
|
|
3719
|
-
},
|
|
3758
|
+
}, bn = ({ subscription: e, onToggle: t, className: n }) => {
|
|
3720
3759
|
let { t: r } = $(), [i, a] = J.useState(!1), o = J.useCallback(async () => {
|
|
3721
3760
|
if (t) {
|
|
3722
3761
|
a(!0);
|
|
@@ -3737,7 +3776,7 @@ var vn = ({ parentItem: e, replies: t, onAddReply: n, showReplyInput: r = !0, cl
|
|
|
3737
3776
|
title: e.subscribed ? r("detail.subscribedTooltip") : r("detail.unsubscribedTooltip"),
|
|
3738
3777
|
children: e.subscribed ? /* @__PURE__ */ X(P, { className: "h-4 w-4 text-primary" }) : /* @__PURE__ */ X(N, { className: "h-4 w-4 text-muted-foreground" })
|
|
3739
3778
|
});
|
|
3740
|
-
},
|
|
3779
|
+
}, xn = {
|
|
3741
3780
|
comment: K,
|
|
3742
3781
|
field_change: q,
|
|
3743
3782
|
task: ke,
|
|
@@ -3745,7 +3784,7 @@ var vn = ({ parentItem: e, replies: t, onAddReply: n, showReplyInput: r = !0, cl
|
|
|
3745
3784
|
system: Fe,
|
|
3746
3785
|
email: ge,
|
|
3747
3786
|
call: xe
|
|
3748
|
-
},
|
|
3787
|
+
}, Sn = {
|
|
3749
3788
|
comment: "bg-purple-100 text-purple-600",
|
|
3750
3789
|
field_change: "bg-blue-100 text-blue-600",
|
|
3751
3790
|
task: "bg-green-100 text-green-600",
|
|
@@ -3754,7 +3793,7 @@ var vn = ({ parentItem: e, replies: t, onAddReply: n, showReplyInput: r = !0, cl
|
|
|
3754
3793
|
email: "bg-indigo-100 text-indigo-600",
|
|
3755
3794
|
call: "bg-teal-100 text-teal-600"
|
|
3756
3795
|
};
|
|
3757
|
-
function
|
|
3796
|
+
function Cn(e) {
|
|
3758
3797
|
return [
|
|
3759
3798
|
{
|
|
3760
3799
|
value: "all",
|
|
@@ -3774,7 +3813,7 @@ function Sn(e) {
|
|
|
3774
3813
|
}
|
|
3775
3814
|
];
|
|
3776
3815
|
}
|
|
3777
|
-
function
|
|
3816
|
+
function wn(e) {
|
|
3778
3817
|
try {
|
|
3779
3818
|
let t = new Date(e), n = (/* @__PURE__ */ new Date()).getTime() - t.getTime(), r = Math.floor(n / 6e4);
|
|
3780
3819
|
if (r < 1) return "just now";
|
|
@@ -3787,7 +3826,7 @@ function Cn(e) {
|
|
|
3787
3826
|
return e;
|
|
3788
3827
|
}
|
|
3789
3828
|
}
|
|
3790
|
-
function
|
|
3829
|
+
function Tn(e, t) {
|
|
3791
3830
|
switch (t) {
|
|
3792
3831
|
case "comments_only": return e.filter((e) => e.type === "comment");
|
|
3793
3832
|
case "changes_only": return e.filter((e) => e.type === "field_change");
|
|
@@ -3795,8 +3834,8 @@ function wn(e, t) {
|
|
|
3795
3834
|
default: return e;
|
|
3796
3835
|
}
|
|
3797
3836
|
}
|
|
3798
|
-
var
|
|
3799
|
-
let { t: b } = $(), [x, S] = J.useState("all"), [C, w] = J.useState(""), [T, E] = J.useState(!1), [D, O] = J.useState(!1), A = n ?? x, ee = t?.showFilterToggle !== !1, j = t?.showCommentInput !== !1 && !!p, te = t?.enableReactions ?? !1, M = t?.enableThreading ?? !1, N = t?.showSubscriptionToggle ?? !1, P = J.useMemo(() =>
|
|
3837
|
+
var En = ({ items: e, config: t, filterMode: n, onFilterChange: i, hasMore: a = !1, onLoadMore: o, loading: u = !1, onAddComment: p, onAddReply: m, onToggleReaction: h, subscription: g, onToggleSubscription: _, collapseWhenEmpty: v = !1, className: y }) => {
|
|
3838
|
+
let { t: b } = $(), [x, S] = J.useState("all"), [C, w] = J.useState(""), [T, E] = J.useState(!1), [D, O] = J.useState(!1), A = n ?? x, ee = t?.showFilterToggle !== !1, j = t?.showCommentInput !== !1 && !!p, te = t?.enableReactions ?? !1, M = t?.enableThreading ?? !1, N = t?.showSubscriptionToggle ?? !1, P = J.useMemo(() => Tn(e, A), [e, A]), F = J.useMemo(() => M ? P.filter((e) => !e.parentId) : P, [P, M]), I = J.useMemo(() => {
|
|
3800
3839
|
if (!M) return /* @__PURE__ */ new Map();
|
|
3801
3840
|
let e = /* @__PURE__ */ new Map();
|
|
3802
3841
|
for (let t of P) if (t.parentId) {
|
|
@@ -3848,7 +3887,7 @@ var Tn = ({ items: e, config: t, filterMode: n, onFilterChange: i, hasMore: a =
|
|
|
3848
3887
|
]
|
|
3849
3888
|
}), /* @__PURE__ */ X("div", {
|
|
3850
3889
|
className: "flex items-center gap-1",
|
|
3851
|
-
children: N && g && /* @__PURE__ */ X(
|
|
3890
|
+
children: N && g && /* @__PURE__ */ X(bn, {
|
|
3852
3891
|
subscription: g,
|
|
3853
3892
|
onToggle: _
|
|
3854
3893
|
})
|
|
@@ -3863,7 +3902,7 @@ var Tn = ({ items: e, config: t, filterMode: n, onFilterChange: i, hasMore: a =
|
|
|
3863
3902
|
value: A,
|
|
3864
3903
|
onChange: (e) => L(e.target.value),
|
|
3865
3904
|
"aria-label": b("detail.filterActivity"),
|
|
3866
|
-
children:
|
|
3905
|
+
children: Cn(b).map((e) => /* @__PURE__ */ X("option", {
|
|
3867
3906
|
value: e.value,
|
|
3868
3907
|
children: e.label
|
|
3869
3908
|
}, e.value))
|
|
@@ -3896,7 +3935,7 @@ var Tn = ({ items: e, config: t, filterMode: n, onFilterChange: i, hasMore: a =
|
|
|
3896
3935
|
children: [/* @__PURE__ */ X("div", { className: "absolute left-4 top-2 bottom-2 w-px bg-border" }), /* @__PURE__ */ X("div", {
|
|
3897
3936
|
className: "space-y-4",
|
|
3898
3937
|
children: F.map((e) => {
|
|
3899
|
-
let t =
|
|
3938
|
+
let t = xn[e.type] || Fe, n = Sn[e.type] || "bg-gray-100 text-gray-600", r = I.get(e.id) ?? [];
|
|
3900
3939
|
return /* @__PURE__ */ Z("div", { children: [/* @__PURE__ */ Z("div", {
|
|
3901
3940
|
className: "flex gap-3 relative",
|
|
3902
3941
|
children: [/* @__PURE__ */ X("div", {
|
|
@@ -3922,7 +3961,7 @@ var Tn = ({ items: e, config: t, filterMode: n, onFilterChange: i, hasMore: a =
|
|
|
3922
3961
|
}),
|
|
3923
3962
|
/* @__PURE__ */ X("span", {
|
|
3924
3963
|
className: "text-xs text-muted-foreground",
|
|
3925
|
-
children:
|
|
3964
|
+
children: wn(e.createdAt)
|
|
3926
3965
|
}),
|
|
3927
3966
|
e.edited && /* @__PURE__ */ X("span", {
|
|
3928
3967
|
className: "text-xs text-muted-foreground italic",
|
|
@@ -3940,25 +3979,25 @@ var Tn = ({ items: e, config: t, filterMode: n, onFilterChange: i, hasMore: a =
|
|
|
3940
3979
|
}),
|
|
3941
3980
|
e.type === "field_change" && e.fieldChanges && /* @__PURE__ */ X("div", {
|
|
3942
3981
|
className: "space-y-1 mt-1",
|
|
3943
|
-
children: e.fieldChanges.map((e, t) => /* @__PURE__ */ X(
|
|
3982
|
+
children: e.fieldChanges.map((e, t) => /* @__PURE__ */ X(hn, { change: e }, t))
|
|
3944
3983
|
}),
|
|
3945
3984
|
te && e.reactions && e.reactions.length > 0 && /* @__PURE__ */ X("div", {
|
|
3946
3985
|
className: "mt-1.5",
|
|
3947
|
-
children: /* @__PURE__ */ X(
|
|
3986
|
+
children: /* @__PURE__ */ X(_n, {
|
|
3948
3987
|
reactions: e.reactions,
|
|
3949
3988
|
onToggleReaction: h ? (t) => h(e.id, t) : void 0
|
|
3950
3989
|
})
|
|
3951
3990
|
}),
|
|
3952
3991
|
te && (!e.reactions || e.reactions.length === 0) && h && /* @__PURE__ */ X("div", {
|
|
3953
3992
|
className: "mt-1.5",
|
|
3954
|
-
children: /* @__PURE__ */ X(
|
|
3993
|
+
children: /* @__PURE__ */ X(_n, {
|
|
3955
3994
|
reactions: [],
|
|
3956
3995
|
onToggleReaction: (t) => h(e.id, t)
|
|
3957
3996
|
})
|
|
3958
3997
|
})
|
|
3959
3998
|
]
|
|
3960
3999
|
})]
|
|
3961
|
-
}), M && (e.replyCount ?? 0) > 0 && /* @__PURE__ */ X(
|
|
4000
|
+
}), M && (e.replyCount ?? 0) > 0 && /* @__PURE__ */ X(yn, {
|
|
3962
4001
|
parentItem: e,
|
|
3963
4002
|
replies: r,
|
|
3964
4003
|
onAddReply: m,
|
|
@@ -3981,7 +4020,7 @@ var Tn = ({ items: e, config: t, filterMode: n, onFilterChange: i, hasMore: a =
|
|
|
3981
4020
|
]
|
|
3982
4021
|
})]
|
|
3983
4022
|
});
|
|
3984
|
-
},
|
|
4023
|
+
}, Dn = ({ config: e, items: t, hasMore: n, onLoadMore: r, loading: i, onAddComment: a, onAddReply: o, onToggleReaction: s, subscription: c, onToggleSubscription: l, filterMode: u, onFilterChange: p, collapseWhenEmpty: m = !1, className: h }) => {
|
|
3985
4024
|
let g = e?.position ?? "right", _ = e?.width ?? "360px", v = e?.collapsible ?? !0, y = m && t.length === 0 || (e?.defaultCollapsed ?? !1), { t: b } = $(), [x, S] = J.useState(y);
|
|
3986
4025
|
return g === "right" || g === "left" ? x && v ? /* @__PURE__ */ X("div", {
|
|
3987
4026
|
className: f("flex items-start pt-4", g === "right" ? "border-l" : "border-r", h),
|
|
@@ -4017,7 +4056,7 @@ var Tn = ({ items: e, config: t, filterMode: n, onFilterChange: i, hasMore: a =
|
|
|
4017
4056
|
})]
|
|
4018
4057
|
}), /* @__PURE__ */ X("div", {
|
|
4019
4058
|
className: "flex-1 overflow-y-auto",
|
|
4020
|
-
children: /* @__PURE__ */ X(
|
|
4059
|
+
children: /* @__PURE__ */ X(En, {
|
|
4021
4060
|
items: t,
|
|
4022
4061
|
config: e?.feed,
|
|
4023
4062
|
hasMore: n,
|
|
@@ -4055,7 +4094,7 @@ var Tn = ({ items: e, config: t, filterMode: n, onFilterChange: i, hasMore: a =
|
|
|
4055
4094
|
"aria-label": b("detail.hideDiscussion"),
|
|
4056
4095
|
children: /* @__PURE__ */ X(ve, { className: "h-3.5 w-3.5" })
|
|
4057
4096
|
})]
|
|
4058
|
-
}), /* @__PURE__ */ X(
|
|
4097
|
+
}), /* @__PURE__ */ X(En, {
|
|
4059
4098
|
items: t,
|
|
4060
4099
|
config: e?.feed,
|
|
4061
4100
|
hasMore: n,
|
|
@@ -4071,7 +4110,7 @@ var Tn = ({ items: e, config: t, filterMode: n, onFilterChange: i, hasMore: a =
|
|
|
4071
4110
|
collapseWhenEmpty: m
|
|
4072
4111
|
})] })
|
|
4073
4112
|
});
|
|
4074
|
-
},
|
|
4113
|
+
}, On = ({ onSubmit: e, placeholder: t = "Leave a comment…", disabled: n = !1, className: r }) => {
|
|
4075
4114
|
let [i, a] = J.useState(""), [o, s] = J.useState(!1), c = J.useCallback(async () => {
|
|
4076
4115
|
let t = i.trim();
|
|
4077
4116
|
if (t) {
|
|
@@ -4104,7 +4143,7 @@ var Tn = ({ items: e, config: t, filterMode: n, onFilterChange: i, hasMore: a =
|
|
|
4104
4143
|
children: /* @__PURE__ */ X(De, { className: "h-4 w-4" })
|
|
4105
4144
|
})]
|
|
4106
4145
|
});
|
|
4107
|
-
},
|
|
4146
|
+
}, kn = ({ query: e, suggestions: t, onSelect: n, visible: r = !0, activeIndex: i = 0, className: a }) => {
|
|
4108
4147
|
let o = J.useMemo(() => {
|
|
4109
4148
|
if (!e) return t;
|
|
4110
4149
|
let n = e.toLowerCase();
|
|
@@ -4146,7 +4185,7 @@ var Tn = ({ items: e, config: t, filterMode: n, onFilterChange: i, hasMore: a =
|
|
|
4146
4185
|
}, e.id))
|
|
4147
4186
|
});
|
|
4148
4187
|
};
|
|
4149
|
-
function
|
|
4188
|
+
function An(e, t, n) {
|
|
4150
4189
|
return {
|
|
4151
4190
|
type: e.type,
|
|
4152
4191
|
id: e.id,
|
|
@@ -4155,7 +4194,7 @@ function kn(e, t, n) {
|
|
|
4155
4194
|
length: n
|
|
4156
4195
|
};
|
|
4157
4196
|
}
|
|
4158
|
-
x.register("detail-view",
|
|
4197
|
+
x.register("detail-view", Kt, {
|
|
4159
4198
|
namespace: "plugin-detail",
|
|
4160
4199
|
label: "Detail View",
|
|
4161
4200
|
category: "Views",
|
|
@@ -4383,7 +4422,7 @@ x.register("detail-view", Gt, {
|
|
|
4383
4422
|
label: "Columns"
|
|
4384
4423
|
}
|
|
4385
4424
|
]
|
|
4386
|
-
}), x.register("detail",
|
|
4425
|
+
}), x.register("detail", Kt, {
|
|
4387
4426
|
namespace: "view",
|
|
4388
4427
|
category: "view",
|
|
4389
4428
|
label: "Detail",
|
|
@@ -4408,4 +4447,4 @@ x.register("detail-view", Gt, {
|
|
|
4408
4447
|
]
|
|
4409
4448
|
});
|
|
4410
4449
|
//#endregion
|
|
4411
|
-
export { Ut as ActivityTimeline,
|
|
4450
|
+
export { Ut as ActivityTimeline, fn as CommentAttachment, On as CommentInput, Ot as DETAIL_DEFAULT_TRANSLATIONS, At as DetailSection, jt as DetailTabs, Kt as DetailView, en as DiffView, hn as FieldChangeItem, Ft as HeaderHighlight, qt as InlineCreateRelated, kn as MentionAutocomplete, mn as PointInTimeRestore, _n as ReactionPicker, En as RecordActivityTimeline, Dn as RecordChatterPanel, Lt as RecordComments, tn as RecordNavigationEnhanced, Nt as RelatedList, cn as RelationshipGraph, Yt as RichTextCommentInput, Pt as SectionGroup, bn as SubscriptionToggle, yn as ThreadedReplies, Tt as applyAutoSpan, Et as applyDetailAutoLayout, An as createMentionFromSuggestion, Dt as createSafeTranslationHook, wt as inferDetailColumns, Ct as isWideFieldType, $ as useDetailTranslation };
|