first commit

This commit is contained in:
yehongyu
2026-07-20 14:40:17 +08:00
commit 50fd043a2d
55 changed files with 7786 additions and 0 deletions
+140
View File
@@ -0,0 +1,140 @@
.chatpapers-root {
display: flex;
flex-direction: column;
gap: 8px;
padding: 8px;
min-height: 320px;
box-sizing: border-box;
font-size: 13px;
}
.chatpapers-header {
display: flex;
flex-direction: column;
gap: 2px;
}
.chatpapers-title {
font-weight: 600;
line-height: 1.3;
}
.chatpapers-meta {
opacity: 0.7;
font-size: 12px;
}
.chatpapers-messages {
flex: 1;
min-height: 180px;
max-height: 420px;
overflow: auto;
border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
border-radius: 8px;
padding: 8px;
display: flex;
flex-direction: column;
gap: 8px;
background: color-mix(in srgb, currentColor 4%, transparent);
}
.chatpapers-bubble {
padding: 8px 10px;
border-radius: 8px;
white-space: pre-wrap;
word-break: break-word;
}
.chatpapers-user {
background: color-mix(in srgb, #3b82f6 18%, transparent);
align-self: flex-end;
max-width: 92%;
}
.chatpapers-assistant {
background: color-mix(in srgb, currentColor 8%, transparent);
align-self: flex-start;
max-width: 96%;
}
.chatpapers-role {
font-size: 11px;
opacity: 0.65;
margin-bottom: 4px;
font-weight: 600;
}
.chatpapers-status {
min-height: 1.2em;
font-size: 12px;
opacity: 0.85;
}
.chatpapers-status[data-kind="warn"] {
color: #b45309;
}
.chatpapers-status[data-kind="error"] {
color: #b91c1c;
}
.chatpapers-toolbar,
.chatpapers-actions {
display: flex;
flex-wrap: wrap;
gap: 6px;
}
.chatpapers-btn {
appearance: none;
border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
background: color-mix(in srgb, currentColor 6%, transparent);
border-radius: 6px;
padding: 4px 10px;
cursor: pointer;
font: inherit;
}
.chatpapers-btn:hover:not(:disabled) {
background: color-mix(in srgb, currentColor 12%, transparent);
}
.chatpapers-btn:disabled {
opacity: 0.5;
cursor: default;
}
.chatpapers-primary {
background: #2563eb;
border-color: #2563eb;
color: #fff;
}
.chatpapers-primary:hover:not(:disabled) {
background: #1d4ed8;
}
.chatpapers-input {
width: 100%;
box-sizing: border-box;
resize: vertical;
min-height: 64px;
border-radius: 8px;
border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
padding: 8px;
font: inherit;
background: transparent;
color: inherit;
}
.chatpapers-loading {
padding: 12px;
opacity: 0.7;
}
.chatpapers-pref-hint {
opacity: 0.8;
font-size: 12px;
margin: 4px 0 10px;
max-width: 52em;
}
+6
View File
@@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="context-fill" stroke="context-stroke">
<path d="M3.5 4.5h13a1.5 1.5 0 0 1 1.5 1.5v7a1.5 1.5 0 0 1-1.5 1.5H8l-3.2 2.4a.5.5 0 0 1-.8-.4V14.5H3.5A1.5 1.5 0 0 1 2 13V6a1.5 1.5 0 0 1 1.5-1.5z"/>
<circle cx="7" cy="9.5" r="1"/>
<circle cx="10" cy="9.5" r="1"/>
<circle cx="13" cy="9.5" r="1"/>
</svg>

After

Width:  |  Height:  |  Size: 392 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 677 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 836 B

+127
View File
@@ -0,0 +1,127 @@
<linkset>
<html:link rel="localization" href="__addonRef__-preferences.ftl" />
</linkset>
<groupbox
onload="Zotero.__addonInstance__.hooks.onPrefsEvent('load', { window })"
>
<label><html:h2 data-l10n-id="prefs-section-provider"></html:h2></label>
<html:p id="chatpapers-pref-hint" class="chatpapers-pref-hint"></html:p>
<hbox align="center">
<html:label
for="chatpapers-pref-provider"
data-l10n-id="prefs-provider"
></html:label>
<html:select id="chatpapers-pref-provider" preference="provider">
</html:select>
<button id="chatpapers-pref-reset" data-l10n-id="prefs-reset"></button>
</hbox>
<hbox align="center">
<html:label
for="chatpapers-pref-apiBaseUrl"
data-l10n-id="prefs-base-url"
></html:label>
<html:input
type="text"
id="chatpapers-pref-apiBaseUrl"
preference="apiBaseUrl"
></html:input>
</hbox>
<hbox align="center">
<html:label
for="zotero-prefpane-__addonRef__-apiKey"
data-l10n-id="prefs-api-key"
></html:label>
<html:input
type="password"
id="zotero-prefpane-__addonRef__-apiKey"
preference="apiKey"
></html:input>
</hbox>
<hbox align="center">
<html:label
for="chatpapers-pref-model"
data-l10n-id="prefs-model"
></html:label>
<html:input
type="text"
id="chatpapers-pref-model"
preference="model"
></html:input>
<button
id="chatpapers-pref-refresh-models"
data-l10n-id="prefs-refresh-models"
></button>
</hbox>
</groupbox>
<groupbox>
<label><html:h2 data-l10n-id="prefs-section-generation"></html:h2></label>
<hbox align="center">
<html:label data-l10n-id="prefs-temperature"></html:label>
<html:input
type="text"
preference="temperature"
></html:input>
</hbox>
<hbox align="center">
<html:label data-l10n-id="prefs-max-tokens"></html:label>
<html:input
type="number"
preference="maxTokens"
min="256"
max="128000"
></html:input>
</hbox>
<hbox align="center">
<html:label data-l10n-id="prefs-timeout"></html:label>
<html:input
type="number"
preference="timeoutMs"
min="10000"
step="1000"
></html:input>
</hbox>
<hbox align="center">
<html:label data-l10n-id="prefs-max-context"></html:label>
<html:input
type="number"
preference="maxContextChars"
min="5000"
step="1000"
></html:input>
</hbox>
<hbox align="center">
<html:label data-l10n-id="prefs-answer-language"></html:label>
<html:input type="text" preference="answerLanguage"></html:input>
</hbox>
<checkbox preference="sendMetadata" data-l10n-id="prefs-send-metadata" />
</groupbox>
<groupbox>
<label><html:h2 data-l10n-id="prefs-section-openrouter"></html:h2></label>
<hbox align="center">
<html:label data-l10n-id="prefs-openrouter-referer"></html:label>
<html:input
type="text"
preference="openrouterReferer"
></html:input>
</hbox>
<hbox align="center">
<html:label data-l10n-id="prefs-openrouter-title"></html:label>
<html:input type="text" preference="openrouterTitle"></html:input>
</hbox>
</groupbox>
<groupbox>
<label><html:h2 data-l10n-id="prefs-section-prompts"></html:h2></label>
<html:label data-l10n-id="prefs-system-prompt"></html:label>
<html:textarea preference="systemPrompt" rows="4"></html:textarea>
<html:label data-l10n-id="prefs-summary-prompt"></html:label>
<html:textarea preference="summaryPrompt" rows="4"></html:textarea>
</groupbox>
<html:p data-l10n-id="prefs-privacy" class="chatpapers-pref-hint"></html:p>
+3
View File
@@ -0,0 +1,3 @@
.makeItRed {
background-color: red;
}