@iyulab/chat-components 0.12.2 → 0.13.0
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 +34 -0
- package/dist/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/decorate.js +1 -1
- package/dist/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/decorateMetadata.js +1 -1
- package/dist/components/blocks/UCodeBlock.js +2 -2
- package/dist/components/blocks/UElementBlock.js +2 -2
- package/dist/components/blocks/UFileBlock.d.ts +3 -2
- package/dist/components/blocks/UFileBlock.js +11 -10
- package/dist/components/blocks/UFileBlock.styles.js +1 -1
- package/dist/components/blocks/UMarkedBlock.js +2 -2
- package/dist/components/blocks/URefBlock.js +2 -2
- package/dist/components/blocks/UTableBlock.js +2 -2
- package/dist/components/blocks/UTextBlock.js +2 -2
- package/dist/components/message/UMessage.js +2 -2
- package/dist/components/prompt/UPrompt.js +2 -2
- package/dist/components/references/URefCard.d.ts +21 -2
- package/dist/components/references/URefCard.js +30 -18
- package/dist/components/references/URefCardGroup.js +2 -2
- package/dist/components/references/URefTag.js +2 -2
- package/dist/components-extra/UChartBlock.js +2 -2
- package/dist/components-extra/UImagesBlock.d.ts +3 -1
- package/dist/components-extra/UImagesBlock.js +12 -4
- package/dist/components-extra/UImagesBlock.styles.js +1 -1
- package/dist/components-extra/UMapBlock.js +2 -2
- package/dist/components-extra/UVideoBlock.js +2 -2
- package/dist/index.js +2 -2
- package/dist/node_modules/katex/dist/katex.js +2 -2
- package/package.json +2 -2
- package/skills/iyulab-chat-components/references/components/file-block.md +6 -0
- package/skills/iyulab-chat-components/references/components/ref-card.md +20 -1
- package/skills/iyulab-chat-components/references/components/table-block.md +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.13.0] - 2026-09-28
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- **Escape in a file preview or an image lightbox opened inside a dialog closes only the viewer.**
|
|
8
|
+
Both listened for Escape on the document themselves, so one press closed the viewer and the
|
|
9
|
+
dialog under it. They now join `@iyulab/components`' layer stack, where one Escape closes the
|
|
10
|
+
most recently opened layer. Arrow keys still page the lightbox. Requires `@iyulab/components`
|
|
11
|
+
1.49.0 or later.
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- 🔴 **Breaking — `u-ref-card` no longer requests a favicon unless you choose where from.** A web
|
|
16
|
+
card used to load `https://www.google.com/s2/favicons?domain=<host>` for every card, with no way to
|
|
17
|
+
point it elsewhere or turn it off — each card sent the site's host name to a third party, and on a
|
|
18
|
+
closed network every card made a request that failed. Cards now show no favicon by default. Set
|
|
19
|
+
`URefCard.defaultFaviconUrl` (every card, including those inside `u-ref-block` and
|
|
20
|
+
`u-ref-card-group`) or a card's `faviconUrl` property to a `(url) => string | undefined` resolver.
|
|
21
|
+
A card without a `url` no longer falls back to the app's own `/favicon.ico`.
|
|
22
|
+
Migration, to keep the previous look: `URefCard.defaultFaviconUrl = googleFaviconUrl;` (both
|
|
23
|
+
exported from `@iyulab/chat-components`).
|
|
24
|
+
|
|
25
|
+
- The file preview and the image lightbox read `--u-layer-overlay` (9999, as before) — the shared
|
|
26
|
+
stacking token from `@iyulab/components` — instead of their own number, so they stack in the
|
|
27
|
+
same order as dialogs and drawers.
|
|
28
|
+
|
|
29
|
+
## [0.12.3] - 2026-09-21
|
|
30
|
+
|
|
31
|
+
### Documentation
|
|
32
|
+
|
|
33
|
+
- **The file and table blocks now list the CSS parts they expose.** Neither reference page had
|
|
34
|
+
a `CSS Parts` section, so `card-main` (the file block's clickable card body) and
|
|
35
|
+
`sort-button` (a table column header's sort toggle) were styleable but undocumented.
|
|
36
|
+
|
|
3
37
|
## [0.12.2] - 2026-09-20
|
|
4
38
|
|
|
5
39
|
### Fixed
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region \0@oxc-project+runtime@0.
|
|
1
|
+
//#region \0@oxc-project+runtime@0.151.0/helpers/esm/decorate.js
|
|
2
2
|
function __decorate(decorators, target, key, desc) {
|
|
3
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region \0@oxc-project+runtime@0.
|
|
1
|
+
//#region \0@oxc-project+runtime@0.151.0/helpers/esm/decorateMetadata.js
|
|
2
2
|
function __decorateMetadata(k, v) {
|
|
3
3
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
4
4
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { styles } from "./UCodeBlock.styles.js";
|
|
2
|
-
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.
|
|
3
|
-
import __decorate from "../../_virtual/_@oxc-project_runtime@0.
|
|
2
|
+
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.js";
|
|
3
|
+
import __decorate from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorate.js";
|
|
4
4
|
import { html } from "lit";
|
|
5
5
|
import { customElement, property } from "lit/decorators.js";
|
|
6
6
|
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.
|
|
2
|
-
import __decorate from "../../_virtual/_@oxc-project_runtime@0.
|
|
1
|
+
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.js";
|
|
2
|
+
import __decorate from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorate.js";
|
|
3
3
|
import { UDataElement } from "../UDataElement.js";
|
|
4
4
|
import { styles } from "./UElementBlock.styles.js";
|
|
5
5
|
import { html, nothing } from "lit";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
1
2
|
import { UElement } from '@iyulab/components/dist/components/UElement.js';
|
|
2
3
|
/**
|
|
3
4
|
* 단일 파일을 표시하는 블록 컴포넌트입니다.
|
|
@@ -18,8 +19,9 @@ export declare class UFileBlock extends UElement {
|
|
|
18
19
|
url?: string;
|
|
19
20
|
/** 미리보기 오버레이가 열려있는지 여부 */
|
|
20
21
|
private previewOpen;
|
|
21
|
-
connectedCallback(): void;
|
|
22
22
|
disconnectedCallback(): void;
|
|
23
|
+
/** 열린 미리보기는 층이다 — Escape 는 components 의 층 스택이 «가장 나중에 연 층 하나» 에만 준다. */
|
|
24
|
+
protected updated(changed: PropertyValues): void;
|
|
23
25
|
private get isImage();
|
|
24
26
|
private get isVideo();
|
|
25
27
|
/** 클릭 시 오버레이로 미리볼 수 있는 타입인지 여부 */
|
|
@@ -29,7 +31,6 @@ export declare class UFileBlock extends UElement {
|
|
|
29
31
|
private renderCardMain;
|
|
30
32
|
private handleCardClick;
|
|
31
33
|
private closePreview;
|
|
32
|
-
private handleKeyDown;
|
|
33
34
|
private handleRemoveClick;
|
|
34
35
|
/** MIME 타입 → Tabler Icon 이름 */
|
|
35
36
|
private resolveIcon;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.
|
|
2
|
-
import __decorate from "../../_virtual/_@oxc-project_runtime@0.
|
|
1
|
+
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.js";
|
|
2
|
+
import __decorate from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorate.js";
|
|
3
3
|
import { messages } from "../../utilities/messages.js";
|
|
4
4
|
import { styles } from "./UFileBlock.styles.js";
|
|
5
5
|
import { html, nothing } from "lit";
|
|
@@ -7,6 +7,7 @@ import { customElement, property, state } from "lit/decorators.js";
|
|
|
7
7
|
import "@iyulab/components/dist/components/icon/UIcon.js";
|
|
8
8
|
import { UElement } from "@iyulab/components/dist/components/UElement.js";
|
|
9
9
|
import "@iyulab/components/dist/components/button/UButton.js";
|
|
10
|
+
import { OverlayManager } from "@iyulab/components/dist/utilities/OverlayManager.js";
|
|
10
11
|
//#region src/components/blocks/UFileBlock.ts
|
|
11
12
|
var UFileBlock = class UFileBlock extends UElement {
|
|
12
13
|
constructor(..._args) {
|
|
@@ -21,9 +22,6 @@ var UFileBlock = class UFileBlock extends UElement {
|
|
|
21
22
|
e?.stopPropagation();
|
|
22
23
|
this.previewOpen = false;
|
|
23
24
|
};
|
|
24
|
-
this.handleKeyDown = (e) => {
|
|
25
|
-
if (this.previewOpen && e.key === "Escape") this.closePreview();
|
|
26
|
-
};
|
|
27
25
|
this.handleRemoveClick = (e) => {
|
|
28
26
|
e.stopPropagation();
|
|
29
27
|
if (this.fire("remove")) this.remove();
|
|
@@ -32,14 +30,17 @@ var UFileBlock = class UFileBlock extends UElement {
|
|
|
32
30
|
static {
|
|
33
31
|
this.styles = [super.styles, styles];
|
|
34
32
|
}
|
|
35
|
-
connectedCallback() {
|
|
36
|
-
super.connectedCallback();
|
|
37
|
-
document.addEventListener("keydown", this.handleKeyDown);
|
|
38
|
-
}
|
|
39
33
|
disconnectedCallback() {
|
|
40
|
-
|
|
34
|
+
OverlayManager.closeLayer(this);
|
|
41
35
|
super.disconnectedCallback();
|
|
42
36
|
}
|
|
37
|
+
/** 열린 미리보기는 층이다 — Escape 는 components 의 층 스택이 «가장 나중에 연 층 하나» 에만 준다. */
|
|
38
|
+
updated(changed) {
|
|
39
|
+
super.updated(changed);
|
|
40
|
+
if (!changed.has("previewOpen")) return;
|
|
41
|
+
if (this.previewOpen) OverlayManager.openLayer(this, () => this.closePreview());
|
|
42
|
+
else OverlayManager.closeLayer(this);
|
|
43
|
+
}
|
|
43
44
|
get isImage() {
|
|
44
45
|
return !!this.url && !!this.type?.startsWith("image/");
|
|
45
46
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.
|
|
2
|
-
import __decorate from "../../_virtual/_@oxc-project_runtime@0.
|
|
1
|
+
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.js";
|
|
2
|
+
import __decorate from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorate.js";
|
|
3
3
|
import "./UCodeBlock.js";
|
|
4
4
|
import { escapeHtmlAttr, escapeHtmlHref, escapeHtmlText, stripZeroWidth } from "../../utilities/sanitizers.js";
|
|
5
5
|
import { HtmlBuilder } from "../../utilities/HtmlBuilder.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.
|
|
2
|
-
import __decorate from "../../_virtual/_@oxc-project_runtime@0.
|
|
1
|
+
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.js";
|
|
2
|
+
import __decorate from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorate.js";
|
|
3
3
|
import "../references/URefCard.js";
|
|
4
4
|
import { styles } from "./URefBlock.styles.js";
|
|
5
5
|
import { html } from "lit";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.
|
|
2
|
-
import __decorate from "../../_virtual/_@oxc-project_runtime@0.
|
|
1
|
+
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.js";
|
|
2
|
+
import __decorate from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorate.js";
|
|
3
3
|
import { UDataElement } from "../UDataElement.js";
|
|
4
4
|
import { messages } from "../../utilities/messages.js";
|
|
5
5
|
import { styles } from "./UTableBlock.styles.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.
|
|
2
|
-
import __decorate from "../../_virtual/_@oxc-project_runtime@0.
|
|
1
|
+
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.js";
|
|
2
|
+
import __decorate from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorate.js";
|
|
3
3
|
import { styles } from "./UTextBlock.styles.js";
|
|
4
4
|
import { html } from "lit";
|
|
5
5
|
import { customElement, property, query } from "lit/decorators.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.
|
|
2
|
-
import __decorate from "../../_virtual/_@oxc-project_runtime@0.
|
|
1
|
+
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.js";
|
|
2
|
+
import __decorate from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorate.js";
|
|
3
3
|
import { styles } from "./UMessage.styles.js";
|
|
4
4
|
import { html } from "lit";
|
|
5
5
|
import { customElement, property } from "lit/decorators.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.
|
|
2
|
-
import __decorate from "../../_virtual/_@oxc-project_runtime@0.
|
|
1
|
+
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.js";
|
|
2
|
+
import __decorate from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorate.js";
|
|
3
3
|
import { messages } from "../../utilities/messages.js";
|
|
4
4
|
import "../blocks/UFileBlock.js";
|
|
5
5
|
import { styles } from "./UPrompt.styles.js";
|
|
@@ -1,10 +1,27 @@
|
|
|
1
1
|
import { UDataElement } from '../UDataElement.js';
|
|
2
|
+
/**
|
|
3
|
+
* 웹 참조 카드의 파비콘 이미지 URL 을 정한다. `undefined` 를 돌려주면 파비콘 없이 그린다.
|
|
4
|
+
* @param url 카드의 `url`
|
|
5
|
+
*/
|
|
6
|
+
export type FaviconResolver = (url: string) => string | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* 구글 공개 파비콘 서비스를 쓰는 리졸버(opt-in). 카드마다 사이트의 호스트 이름을 구글에 보낸다 —
|
|
9
|
+
* 공용 인터넷에 닿지 않는 망에서는 쓰지 말 것.
|
|
10
|
+
*
|
|
11
|
+
* @example URefCard.defaultFaviconUrl = googleFaviconUrl;
|
|
12
|
+
*/
|
|
13
|
+
export declare const googleFaviconUrl: FaviconResolver;
|
|
2
14
|
/**
|
|
3
15
|
* 참조 소스를 카드 형태로 표시하는 공통 컴포넌트입니다.
|
|
4
16
|
* Web과 Document 타입 모두 지원합니다.
|
|
5
17
|
*/
|
|
6
18
|
export declare class URefCard extends UDataElement {
|
|
7
19
|
static styles: import('lit').CSSResultGroup[];
|
|
20
|
+
/**
|
|
21
|
+
* 자기 `faviconUrl` 이 없는 모든 카드가 쓰는 리졸버. 기본값 `undefined` 는 파비콘을 요청하지 않는다 —
|
|
22
|
+
* 카드가 밖으로 나가는 요청을 스스로 만들지 않는다. 카드가 그려지기 전에 정할 것.
|
|
23
|
+
*/
|
|
24
|
+
static defaultFaviconUrl?: FaviconResolver;
|
|
8
25
|
/** 카드 타입 (web 또는 document) */
|
|
9
26
|
type: 'web' | 'document';
|
|
10
27
|
/** 외부 링크 URL */
|
|
@@ -15,6 +32,8 @@ export declare class URefCard extends UDataElement {
|
|
|
15
32
|
snippet?: string;
|
|
16
33
|
/** 태그 목록 */
|
|
17
34
|
tags?: string[];
|
|
35
|
+
/** 이 카드의 파비콘 리졸버 — `URefCard.defaultFaviconUrl` 보다 우선한다. */
|
|
36
|
+
faviconUrl?: FaviconResolver;
|
|
18
37
|
render(): import('lit-html').TemplateResult<1>;
|
|
19
38
|
/**
|
|
20
39
|
* script-payload(UMarkedBlock 툴팁)와 property 바인딩(URefBlock) 두 사용
|
|
@@ -24,8 +43,8 @@ export declare class URefCard extends UDataElement {
|
|
|
24
43
|
protected load(data?: object): Promise<void>;
|
|
25
44
|
/** 링크 클릭 핸들러 */
|
|
26
45
|
private handleAnchorClick;
|
|
27
|
-
/** URL
|
|
28
|
-
private
|
|
46
|
+
/** 리졸버가 URL 을 돌려줄 때만 파비콘을 그린다(장식 — 제목이 이름을 나른다). */
|
|
47
|
+
private renderFavicon;
|
|
29
48
|
/** URL에서 도메인 사이트 주소를 반환합니다. */
|
|
30
49
|
private getDomainName;
|
|
31
50
|
}
|
|
@@ -1,14 +1,31 @@
|
|
|
1
|
-
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.
|
|
2
|
-
import __decorate from "../../_virtual/_@oxc-project_runtime@0.
|
|
1
|
+
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.js";
|
|
2
|
+
import __decorate from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorate.js";
|
|
3
3
|
import { UDataElement } from "../UDataElement.js";
|
|
4
4
|
import { styles } from "./URefCard.styles.js";
|
|
5
|
-
import { html } from "lit";
|
|
5
|
+
import { html, nothing } from "lit";
|
|
6
6
|
import { customElement, property } from "lit/decorators.js";
|
|
7
7
|
import "@iyulab/components/dist/components/icon/UIcon.js";
|
|
8
8
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
9
9
|
import { arrayAttrConverter } from "@iyulab/components/dist/utilities/converters.js";
|
|
10
10
|
//#region src/components/references/URefCard.ts
|
|
11
|
+
var _URefCard;
|
|
12
|
+
/**
|
|
13
|
+
* 구글 공개 파비콘 서비스를 쓰는 리졸버(opt-in). 카드마다 사이트의 호스트 이름을 구글에 보낸다 —
|
|
14
|
+
* 공용 인터넷에 닿지 않는 망에서는 쓰지 말 것.
|
|
15
|
+
*
|
|
16
|
+
* @example URefCard.defaultFaviconUrl = googleFaviconUrl;
|
|
17
|
+
*/
|
|
18
|
+
var googleFaviconUrl = (url) => {
|
|
19
|
+
try {
|
|
20
|
+
return `https://www.google.com/s2/favicons?sz=64&domain=${encodeURIComponent(new URL(url).hostname)}`;
|
|
21
|
+
} catch {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
11
25
|
var URefCard = class URefCard extends UDataElement {
|
|
26
|
+
static {
|
|
27
|
+
_URefCard = this;
|
|
28
|
+
}
|
|
12
29
|
constructor(..._args) {
|
|
13
30
|
super(..._args);
|
|
14
31
|
this.type = "web";
|
|
@@ -22,11 +39,7 @@ var URefCard = class URefCard extends UDataElement {
|
|
|
22
39
|
<a href="${ifDefined(this.url)}" target="_blank" rel="noopener noreferrer"
|
|
23
40
|
@click=${this.handleAnchorClick}>
|
|
24
41
|
<div class="header">
|
|
25
|
-
|
|
26
|
-
src="${this.getFaviconUrl(this.url)}"
|
|
27
|
-
alt=""
|
|
28
|
-
aria-hidden="true"
|
|
29
|
-
/>
|
|
42
|
+
${this.renderFavicon()}
|
|
30
43
|
<div class="title">
|
|
31
44
|
${this.title || this.getDomainName(this.url)}
|
|
32
45
|
</div>
|
|
@@ -68,14 +81,12 @@ var URefCard = class URefCard extends UDataElement {
|
|
|
68
81
|
e.stopPropagation();
|
|
69
82
|
}
|
|
70
83
|
}
|
|
71
|
-
/** URL
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
return `/favicon.ico`;
|
|
78
|
-
}
|
|
84
|
+
/** 리졸버가 URL 을 돌려줄 때만 파비콘을 그린다(장식 — 제목이 이름을 나른다). */
|
|
85
|
+
renderFavicon() {
|
|
86
|
+
const resolve = this.faviconUrl ?? _URefCard.defaultFaviconUrl;
|
|
87
|
+
const src = this.url && resolve ? resolve(this.url) : void 0;
|
|
88
|
+
if (!src) return nothing;
|
|
89
|
+
return html`<img class="favicon" src=${src} alt="" aria-hidden="true" />`;
|
|
79
90
|
}
|
|
80
91
|
/** URL에서 도메인 사이트 주소를 반환합니다. */
|
|
81
92
|
getDomainName(url) {
|
|
@@ -98,6 +109,7 @@ __decorate([property({
|
|
|
98
109
|
type: Array,
|
|
99
110
|
converter: arrayAttrConverter((v) => v)
|
|
100
111
|
}), __decorateMetadata("design:type", Array)], URefCard.prototype, "tags", void 0);
|
|
101
|
-
|
|
112
|
+
__decorate([property({ attribute: false }), __decorateMetadata("design:type", Object)], URefCard.prototype, "faviconUrl", void 0);
|
|
113
|
+
URefCard = _URefCard = __decorate([customElement("u-ref-card")], URefCard);
|
|
102
114
|
//#endregion
|
|
103
|
-
export { URefCard };
|
|
115
|
+
export { URefCard, googleFaviconUrl };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.
|
|
2
|
-
import __decorate from "../../_virtual/_@oxc-project_runtime@0.
|
|
1
|
+
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.js";
|
|
2
|
+
import __decorate from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorate.js";
|
|
3
3
|
import { messages } from "../../utilities/messages.js";
|
|
4
4
|
import { URefCard } from "./URefCard.js";
|
|
5
5
|
import { styles } from "./URefCardGroup.styles.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.
|
|
2
|
-
import __decorate from "../../_virtual/_@oxc-project_runtime@0.
|
|
1
|
+
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.js";
|
|
2
|
+
import __decorate from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorate.js";
|
|
3
3
|
import { styles } from "./URefTag.styles.js";
|
|
4
4
|
import { html } from "lit";
|
|
5
5
|
import { customElement, property } from "lit/decorators.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import __decorateMetadata from "../_virtual/_@oxc-project_runtime@0.
|
|
2
|
-
import __decorate from "../_virtual/_@oxc-project_runtime@0.
|
|
1
|
+
import __decorateMetadata from "../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.js";
|
|
2
|
+
import __decorate from "../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorate.js";
|
|
3
3
|
import { messages } from "../utilities/messages.js";
|
|
4
4
|
import { styles } from "./UChartBlock.styles.js";
|
|
5
5
|
import { html, nothing } from "lit";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { nothing } from 'lit';
|
|
1
|
+
import { nothing, PropertyValues } from 'lit';
|
|
2
2
|
import { UElement } from '@iyulab/components/dist/components/UElement.js';
|
|
3
3
|
export interface ImageSlide {
|
|
4
4
|
src: string;
|
|
@@ -16,6 +16,8 @@ export declare class UImagesBlock extends UElement {
|
|
|
16
16
|
private index;
|
|
17
17
|
connectedCallback(): void;
|
|
18
18
|
disconnectedCallback(): void;
|
|
19
|
+
/** 열린 라이트박스는 층이다 — Escape 는 components 의 층 스택이 «가장 나중에 연 층 하나» 에만 준다. */
|
|
20
|
+
protected updated(changed: PropertyValues): void;
|
|
19
21
|
render(): typeof nothing | import('lit-html').TemplateResult<1>;
|
|
20
22
|
private renderLightbox;
|
|
21
23
|
open: (i: number) => void;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import __decorateMetadata from "../_virtual/_@oxc-project_runtime@0.
|
|
2
|
-
import __decorate from "../_virtual/_@oxc-project_runtime@0.
|
|
1
|
+
import __decorateMetadata from "../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.js";
|
|
2
|
+
import __decorate from "../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorate.js";
|
|
3
3
|
import { messages } from "../utilities/messages.js";
|
|
4
4
|
import { styles } from "./UImagesBlock.styles.js";
|
|
5
5
|
import { html, nothing } from "lit";
|
|
6
6
|
import { customElement, property, state } from "lit/decorators.js";
|
|
7
7
|
import "@iyulab/components/dist/components/icon/UIcon.js";
|
|
8
8
|
import { UElement } from "@iyulab/components/dist/components/UElement.js";
|
|
9
|
+
import { OverlayManager } from "@iyulab/components/dist/utilities/OverlayManager.js";
|
|
9
10
|
import { repeat } from "lit/directives/repeat.js";
|
|
10
11
|
import "@iyulab/components/dist/components/carousel/UCarousel.js";
|
|
11
12
|
//#region src/components-extra/UImagesBlock.ts
|
|
@@ -36,8 +37,7 @@ var UImagesBlock = class UImagesBlock extends UElement {
|
|
|
36
37
|
};
|
|
37
38
|
this.handleKeyDown = (e) => {
|
|
38
39
|
if (this.index === null) return;
|
|
39
|
-
if (e.key === "
|
|
40
|
-
else if (e.key === "ArrowLeft") this.prev();
|
|
40
|
+
if (e.key === "ArrowLeft") this.prev();
|
|
41
41
|
else if (e.key === "ArrowRight") this.next();
|
|
42
42
|
};
|
|
43
43
|
}
|
|
@@ -50,8 +50,16 @@ var UImagesBlock = class UImagesBlock extends UElement {
|
|
|
50
50
|
}
|
|
51
51
|
disconnectedCallback() {
|
|
52
52
|
document.removeEventListener("keydown", this.handleKeyDown);
|
|
53
|
+
OverlayManager.closeLayer(this);
|
|
53
54
|
super.disconnectedCallback();
|
|
54
55
|
}
|
|
56
|
+
/** 열린 라이트박스는 층이다 — Escape 는 components 의 층 스택이 «가장 나중에 연 층 하나» 에만 준다. */
|
|
57
|
+
updated(changed) {
|
|
58
|
+
super.updated(changed);
|
|
59
|
+
if (!changed.has("index")) return;
|
|
60
|
+
if (this.index !== null) OverlayManager.openLayer(this, () => this.close());
|
|
61
|
+
else OverlayManager.closeLayer(this);
|
|
62
|
+
}
|
|
55
63
|
render() {
|
|
56
64
|
if (!this.items?.length) return nothing;
|
|
57
65
|
const count = this.items.length;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import __decorateMetadata from "../_virtual/_@oxc-project_runtime@0.
|
|
2
|
-
import __decorate from "../_virtual/_@oxc-project_runtime@0.
|
|
1
|
+
import __decorateMetadata from "../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.js";
|
|
2
|
+
import __decorate from "../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorate.js";
|
|
3
3
|
import { styles } from "./UMapBlock.styles.js";
|
|
4
4
|
import { html, nothing } from "lit";
|
|
5
5
|
import { customElement, property } from "lit/decorators.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import __decorateMetadata from "../_virtual/_@oxc-project_runtime@0.
|
|
2
|
-
import __decorate from "../_virtual/_@oxc-project_runtime@0.
|
|
1
|
+
import __decorateMetadata from "../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.js";
|
|
2
|
+
import __decorate from "../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorate.js";
|
|
3
3
|
import { styles } from "./UVideoBlock.styles.js";
|
|
4
4
|
import { html, nothing } from "lit";
|
|
5
5
|
import { customElement, property } from "lit/decorators.js";
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { HtmlBuilder } from "./utilities/HtmlBuilder.js";
|
|
|
4
4
|
import { UElementBlock } from "./components/blocks/UElementBlock.js";
|
|
5
5
|
import { UFileBlock } from "./components/blocks/UFileBlock.js";
|
|
6
6
|
import { URefTag } from "./components/references/URefTag.js";
|
|
7
|
-
import { URefCard } from "./components/references/URefCard.js";
|
|
7
|
+
import { URefCard, googleFaviconUrl } from "./components/references/URefCard.js";
|
|
8
8
|
import { URefCardGroup } from "./components/references/URefCardGroup.js";
|
|
9
9
|
import { UTableBlock } from "./components/blocks/UTableBlock.js";
|
|
10
10
|
import { UMarkedBlock } from "./components/blocks/UMarkedBlock.js";
|
|
@@ -13,4 +13,4 @@ import { URefBlock } from "./components/blocks/URefBlock.js";
|
|
|
13
13
|
import { UMessage } from "./components/message/UMessage.js";
|
|
14
14
|
import { UPrompt } from "./components/prompt/UPrompt.js";
|
|
15
15
|
import { ElementPromptBuilder } from "./utilities/PromptBuilder.js";
|
|
16
|
-
export { ElementPromptBuilder, HtmlBuilder, UCodeBlock, UElementBlock, UFileBlock, UMarkedBlock, UMessage, UPrompt, URefBlock, URefCard, URefCardGroup, URefTag, UTableBlock, UTextBlock, escapeHtmlAttr, escapeHtmlHref, escapeHtmlText, stripZeroWidth };
|
|
16
|
+
export { ElementPromptBuilder, HtmlBuilder, UCodeBlock, UElementBlock, UFileBlock, UMarkedBlock, UMessage, UPrompt, URefBlock, URefCard, URefCardGroup, URefTag, UTableBlock, UTextBlock, escapeHtmlAttr, escapeHtmlHref, escapeHtmlText, googleFaviconUrl, stripZeroWidth };
|
|
@@ -20846,7 +20846,7 @@ function parseArray(parser, _ref, style) {
|
|
|
20846
20846
|
parser.consume();
|
|
20847
20847
|
} else if (next === "\\end") {
|
|
20848
20848
|
endRow();
|
|
20849
|
-
if (row.length === 1 && cell.type === "styling" && cell.body.length === 1 && cell.body[0].type === "ordgroup" && cell.body[0].body.length === 0 && (body.length > 1 || !emptySingleRow) && !Array.isArray(tags == null ? void 0 : tags[tags.length - 1])) body.pop();
|
|
20849
|
+
if (row.length === 1 && cell.type === "styling" && cell.body.length === 1 && cell.body[0].type === "ordgroup" && cell.body[0].body.length === 0 && (body.length > 1 || !emptySingleRow) && !Array.isArray(tags == null ? void 0 : tags[tags.length - 1]) && !(autoTag && (tags == null ? void 0 : tags[tags.length - 1]) === true)) body.pop();
|
|
20850
20850
|
if (hLinesBeforeRow.length < body.length + 1) hLinesBeforeRow.push([]);
|
|
20851
20851
|
break;
|
|
20852
20852
|
} else if (next === "\\\\") {
|
|
@@ -26276,7 +26276,7 @@ var renderToHTMLTree = function renderToHTMLTree(expression, options) {
|
|
|
26276
26276
|
return renderError(error, expression, settings);
|
|
26277
26277
|
}
|
|
26278
26278
|
};
|
|
26279
|
-
var version = "0.18.
|
|
26279
|
+
var version = "0.18.9";
|
|
26280
26280
|
var __domTree = {
|
|
26281
26281
|
Span,
|
|
26282
26282
|
Anchor,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iyulab/chat-components",
|
|
3
3
|
"description": "llm chat components for building chat interfaces",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.13.0",
|
|
5
5
|
"author": "iyulab",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"keywords": [
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"marked": "^18.0.6"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
|
-
"@iyulab/components": ">=1.
|
|
70
|
+
"@iyulab/components": ">=1.49.0",
|
|
71
71
|
"@lit/react": ">=1.0.8",
|
|
72
72
|
"chart.js": ">=4.5.1",
|
|
73
73
|
"react": ">=18.0.0"
|
|
@@ -38,6 +38,12 @@ Clicking anywhere on the card opens a full-size preview overlay, but only for im
|
|
|
38
38
|
| `size` | `number` | `undefined` | — | File size in bytes; auto-formatted to KB/MB/GB |
|
|
39
39
|
| `url` | `string` | `undefined` | — | File URL, used for the image/video thumbnail and preview overlay |
|
|
40
40
|
|
|
41
|
+
## CSS Parts
|
|
42
|
+
|
|
43
|
+
| Part | Description |
|
|
44
|
+
|------|-------------|
|
|
45
|
+
| `card-main` | The clickable card body (rendered only when the block is actionable) |
|
|
46
|
+
|
|
41
47
|
## Events
|
|
42
48
|
|
|
43
49
|
| Event | Detail | Description |
|
|
@@ -6,7 +6,7 @@ import '@iyulab/chat-components/dist/components/references/URefCard.js';
|
|
|
6
6
|
|
|
7
7
|
**Tag:** `u-ref-card`
|
|
8
8
|
|
|
9
|
-
Displays a single reference source as a card. Supports `web` and `document` types.
|
|
9
|
+
Displays a single reference source as a card. Supports `web` and `document` types. A web card shows a favicon only when you give it a resolver — by default it makes no request of its own (see [Favicon](#favicon)).
|
|
10
10
|
|
|
11
11
|
Extends `UDataElement`, so data can also be injected via a `<script type="application/json">` slot.
|
|
12
12
|
|
|
@@ -46,3 +46,22 @@ Extends `UDataElement`, so data can also be injected via a `<script type="applic
|
|
|
46
46
|
| `title` | `string` | `''` | — | Card title (falls back to domain name for web type) |
|
|
47
47
|
| `snippet` | `string` | `undefined` | — | Excerpt text |
|
|
48
48
|
| `tags` | `string[]` | `undefined` | — | Tag list. Pass as JSON array string via HTML attribute |
|
|
49
|
+
| `faviconUrl` | `FaviconResolver` | `undefined` | — | Favicon resolver for this card (property only). Overrides `URefCard.defaultFaviconUrl` |
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Favicon
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
import { URefCard, googleFaviconUrl } from '@iyulab/chat-components';
|
|
57
|
+
|
|
58
|
+
// type FaviconResolver = (url: string) => string | undefined
|
|
59
|
+
URefCard.defaultFaviconUrl = (url) => `/favicons/${new URL(url).hostname}.png`; // your own host
|
|
60
|
+
// or, where the public internet is reachable and sending host names to Google is acceptable:
|
|
61
|
+
URefCard.defaultFaviconUrl = googleFaviconUrl;
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
- **Default: no favicon, no request.** The card never contacts a third party unless you choose one — safe on a closed network.
|
|
65
|
+
- `URefCard.defaultFaviconUrl` applies to every card, including those rendered inside `u-ref-block`, `u-ref-card-group` and marked-block tooltips. Set it before cards render.
|
|
66
|
+
- A card's own `faviconUrl` property wins over the module-wide one. Returning `undefined` draws the card without a favicon.
|
|
67
|
+
- `googleFaviconUrl` sends each card's host name (not the full URL) to `www.google.com`.
|
|
@@ -59,6 +59,12 @@ There is no size property or custom property for this — the host is the lever.
|
|
|
59
59
|
| `headers` | `TableCell[]` | `[]` | Header cells, each with `text` and `align` |
|
|
60
60
|
| `rows` | `TableCell[][]` | `[]` | Row data; each row is an array of `TableCell` |
|
|
61
61
|
|
|
62
|
+
## CSS Parts
|
|
63
|
+
|
|
64
|
+
| Part | Description |
|
|
65
|
+
|------|-------------|
|
|
66
|
+
| `sort-button` | A column header's sort toggle |
|
|
67
|
+
|
|
62
68
|
## TableCell Type
|
|
63
69
|
|
|
64
70
|
```ts
|