@folio-agent/widget 0.6.2 → 0.8.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/README.md CHANGED
@@ -20,4 +20,6 @@ npm install @folio-agent/widget
20
20
 
21
21
  配色・フォントは CSS カスタムプロパティ6トークン(`--folio-agent-surface` / `text` / `muted` / `accent` / `accent-contrast` / `font`)で上書きできる。未指定時はホストの配色に合わせる。変える場合も `surface` / `text` / `accent` の3色で足り、残りはこの3色から導出する。
22
22
 
23
- UI 文言は `lang="en"` 属性で英語に切り替えられる(未指定は日本語)。パネルの見出し・案内文・質問候補は `heading` / `greeting` / `suggestions`(`|` 区切り)属性で差し替えられる。
23
+ UI 文言は `lang="en"` 属性で英語に切り替えられる(未指定は日本語)。パネルの見出し・案内文・質問候補は `heading` / `greeting` / `suggestions`(`|` 区切り)属性で差し替えられる。ヘッダ2行目(何をもとに答えるか)は `slot="subheading"` の要素で差し替えられ、リンクも書ける。
24
+
25
+ 回答はプレーンテキストで描き、handler が返す `[表示する文字](URL)` だけをその文字のリンクにする(HTML は解釈しない)。同じサイト内は同じタブ、外部は新しいタブで開く。
package/dist/answer.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // handler が返す回答の形式(プレーンテキスト、記法はリンクの [表示する文字](http(s)://…) だけ)を描く。
2
- // HTML は解釈せず、テキストノードと <a> を組み立てる。形式を守らせるのは handler の normalize_answer で、
2
+ // HTML は解釈せず、テキストノードと <a> を組み立てる。形式を守らせるのは handler の check_answer で、
3
3
  // ここでは古い handler が URL をそのまま返した場合にだけ、その URL をリンクにする。
4
4
  const TOKEN = /\[([^\]\n]+)\]\((https?:\/\/[^\s)]+)\)|https?:\/\/[^\s<>"'()「」『』【】、。]+/g;
5
5
  const TRAILING_PUNCTUATION = /[.,;:!?)\]]+$/;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@folio-agent/widget",
3
- "version": "0.6.2",
3
+ "version": "0.8.0",
4
4
  "description": "Framework-agnostic reception chat widget (silent until clicked)",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -32,6 +32,6 @@
32
32
  "prepublishOnly": "tsc -b --force"
33
33
  },
34
34
  "devDependencies": {
35
- "happy-dom": "^20.14.5"
35
+ "happy-dom": "^21.0.4"
36
36
  }
37
37
  }