@ai-matrx/records-ui 0.116.79 → 0.116.80
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 +23 -3
- package/dist/{chunk-5ICDUZS7.js → chunk-5DELD6DC.js} +18 -5
- package/dist/{chunk-5ICDUZS7.js.map → chunk-5DELD6DC.js.map} +1 -1
- package/dist/entity-doors.cjs +164 -0
- package/dist/entity-doors.cjs.map +1 -0
- package/dist/entity-doors.d.cts +289 -0
- package/dist/entity-doors.d.ts +289 -0
- package/dist/entity-doors.js +154 -0
- package/dist/entity-doors.js.map +1 -0
- package/dist/entity-ref.cjs +795 -0
- package/dist/entity-ref.cjs.map +1 -0
- package/dist/entity-ref.d.cts +709 -0
- package/dist/entity-ref.d.ts +709 -0
- package/dist/entity-ref.js +764 -0
- package/dist/entity-ref.js.map +1 -0
- package/dist/index.cjs +16 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/pickers.cjs +16 -3
- package/dist/pickers.cjs.map +1 -1
- package/dist/pickers.js +1 -1
- package/package.json +26 -6
package/dist/index.js
CHANGED
package/dist/pickers.cjs
CHANGED
|
@@ -8243,7 +8243,7 @@ function hostOf(url) {
|
|
|
8243
8243
|
return url;
|
|
8244
8244
|
}
|
|
8245
8245
|
}
|
|
8246
|
-
function linkPreviewRecord(url, shown2) {
|
|
8246
|
+
function linkPreviewRecord(url, shown2, icon = shown2.faviconUrl) {
|
|
8247
8247
|
const site = shown2.siteName?.trim() || hostOf(url);
|
|
8248
8248
|
const title = shown2.title?.trim() || site;
|
|
8249
8249
|
return {
|
|
@@ -8252,7 +8252,7 @@ function linkPreviewRecord(url, shown2) {
|
|
|
8252
8252
|
showId: false,
|
|
8253
8253
|
title,
|
|
8254
8254
|
...shown2.siteName || shown2.title ? { subtitle: site } : {},
|
|
8255
|
-
avatar: { initials: site.slice(0, 1).toUpperCase(), ...
|
|
8255
|
+
avatar: { initials: site.slice(0, 1).toUpperCase(), ...icon ? { src: icon } : {} },
|
|
8256
8256
|
...shown2.imageUrl ? { media: { alt: title, src: shown2.imageUrl, aspect: "16:9" } } : {},
|
|
8257
8257
|
...shown2.description ? { body: [{ section: "Description", text: shown2.description, clamp: 3 }] } : {},
|
|
8258
8258
|
href: url,
|
|
@@ -8264,7 +8264,20 @@ function LinkPreviewCard({ url, children }) {
|
|
|
8264
8264
|
const [preview, setPreview] = (0, import_react34.useState)(void 0);
|
|
8265
8265
|
const [open, setOpen] = (0, import_react34.useState)(false);
|
|
8266
8266
|
const shown2 = preview && (preview.title || preview.description || preview.imageUrl) ? preview : null;
|
|
8267
|
-
const
|
|
8267
|
+
const [icon, setIcon] = (0, import_react34.useState)(null);
|
|
8268
|
+
const iconKey = `${url}|${shown2?.faviconUrl ?? ""}`;
|
|
8269
|
+
(0, import_react34.useEffect)(() => {
|
|
8270
|
+
if (!shown2) return;
|
|
8271
|
+
let live = true;
|
|
8272
|
+
void (0, import_design_system22.resolveSiteIcon)(url, shown2.faviconUrl).then((src) => live && setIcon({ key: iconKey, src }));
|
|
8273
|
+
return () => {
|
|
8274
|
+
live = false;
|
|
8275
|
+
};
|
|
8276
|
+
}, [shown2, url, iconKey]);
|
|
8277
|
+
const record = (0, import_react34.useMemo)(
|
|
8278
|
+
() => shown2 ? linkPreviewRecord(url, shown2, icon?.key === iconKey ? icon.src : shown2.faviconUrl) : null,
|
|
8279
|
+
[url, shown2, icon, iconKey]
|
|
8280
|
+
);
|
|
8268
8281
|
(0, import_react34.useEffect)(() => setPreview(void 0), [url]);
|
|
8269
8282
|
if (!port) return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_jsx_runtime26.Fragment, { children });
|
|
8270
8283
|
const ask = () => {
|