dsh-sidenote 0.8.2 → 0.8.3
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 +2 -2
- package/lib/client.js +426 -153
- package/lib/index.js +895 -1
- package/lib/types/client/annotate/SelectionToolbar.d.ts +10 -0
- package/lib/types/client/annotate/index.d.ts +2 -1
- package/lib/types/client/annotate/overlay.d.ts +2 -0
- package/lib/types/client/host/contracts.d.ts +2 -1
- package/lib/types/client/host/input.d.ts +2 -0
- package/lib/types/client/host/selection.d.ts +4 -0
- package/lib/types/client/locales.d.ts +11 -0
- package/lib/types/client/preferences.d.ts +23 -0
- package/lib/types/client/settings.d.ts +3 -0
- package/lib/types/index.d.ts +2 -1
- package/lib/types/settings.d.ts +7 -0
- package/package.json +7 -9
- package/src/client/annotate/SelectionToolbar.tsx +63 -0
- package/src/client/annotate/annotate.module.css +15 -0
- package/src/client/annotate/index.tsx +6 -3
- package/src/client/annotate/overlay.tsx +14 -63
- package/src/client/host/contracts.ts +4 -0
- package/src/client/host/input.ts +6 -0
- package/src/client/host/selection.tsx +39 -0
- package/src/client/index.tsx +9 -2
- package/src/client/locales.ts +22 -0
- package/src/client/preferences.ts +52 -0
- package/src/client/settings.module.css +59 -0
- package/src/client/settings.tsx +43 -0
- package/src/index.ts +7 -0
- package/src/settings.ts +6 -0
package/lib/client.js
CHANGED
|
@@ -53,6 +53,14 @@ window.__ModuleLoader__.load({
|
|
|
53
53
|
function resolveInput(ctx, sessionId) {
|
|
54
54
|
return probeInput(ctx, sessionId).input;
|
|
55
55
|
}
|
|
56
|
+
/** The captured source session owns the quote, even if another pane has focus. */
|
|
57
|
+
function insertNativeQuote(ctx, sessionId, text) {
|
|
58
|
+
try {
|
|
59
|
+
return resolveInput(ctx, sessionId)?.insertQuote?.(text) ?? false;
|
|
60
|
+
} catch {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
56
64
|
/** Shape and real state read share the exact resolver used by both composers. */
|
|
57
65
|
function probeInput(ctx, sessionId) {
|
|
58
66
|
const path = "sessions.scope → conversation.input.for";
|
|
@@ -742,7 +750,7 @@ window.__ModuleLoader__.load({
|
|
|
742
750
|
let dockRegistered = false;
|
|
743
751
|
let report = {
|
|
744
752
|
versions: {
|
|
745
|
-
sidenote: "0.8.
|
|
753
|
+
sidenote: "0.8.3",
|
|
746
754
|
dsh: "unknown",
|
|
747
755
|
betterSidebar: null
|
|
748
756
|
},
|
|
@@ -936,6 +944,17 @@ window.__ModuleLoader__.load({
|
|
|
936
944
|
inputWaiting: "The input is not ready. Body, attachments and quotes have been retained. Please try again shortly.",
|
|
937
945
|
draftRecoveryConflict: "The host has another draft. Your local body is retained; review this session in the main view before retrying.",
|
|
938
946
|
quoteWorkflowWaiting: "Annotations are not ready yet. Please try again shortly.",
|
|
947
|
+
nativeQuote: "Quote",
|
|
948
|
+
nativeQuoteHint: "Insert the selected text as a quote in this conversation",
|
|
949
|
+
nativeQuoteFailed: "The quote could not be added. Wait for the input to be ready and try again.",
|
|
950
|
+
settingsDescription: "Choose the actions available when you select conversation text.",
|
|
951
|
+
hideNativeQuote: "Hide native quote",
|
|
952
|
+
hideNativeQuoteHint: "Hide the Quote action in main and side chats.",
|
|
953
|
+
settingsSaving: "Saving…",
|
|
954
|
+
settingsLoading: "Loading preferences…",
|
|
955
|
+
settingsUnavailable: "Preferences are unavailable. Reload the page to reconnect.",
|
|
956
|
+
settingsReadOnly: "Preferences are read-only in this host.",
|
|
957
|
+
settingsSaveFailed: "The preference could not be saved. Please try again.",
|
|
939
958
|
menuTitle: "Side chat",
|
|
940
959
|
tabBaseTitle: "Side",
|
|
941
960
|
codeCopy: "Copy",
|
|
@@ -1100,6 +1119,17 @@ window.__ModuleLoader__.load({
|
|
|
1100
1119
|
};
|
|
1101
1120
|
/** 中文词典(与 en 同 key)。 */
|
|
1102
1121
|
const zh = {
|
|
1122
|
+
nativeQuote: "引用",
|
|
1123
|
+
nativeQuoteHint: "将所选文字作为引用加入当前对话的输入框",
|
|
1124
|
+
nativeQuoteFailed: "暂时无法加入引用,请等待输入框就绪后重试。",
|
|
1125
|
+
settingsDescription: "调整划选对话文字时显示的操作。",
|
|
1126
|
+
hideNativeQuote: "隐藏原生引用",
|
|
1127
|
+
hideNativeQuoteHint: "在主对话和侧边聊天中隐藏“引用”按钮。",
|
|
1128
|
+
settingsSaving: "正在保存…",
|
|
1129
|
+
settingsLoading: "正在加载偏好设置…",
|
|
1130
|
+
settingsUnavailable: "暂时无法读取设置,请刷新页面重新连接。",
|
|
1131
|
+
settingsReadOnly: "当前宿主的偏好设置为只读。",
|
|
1132
|
+
settingsSaveFailed: "设置保存失败,请重试。",
|
|
1103
1133
|
diagTitle: "兼容诊断",
|
|
1104
1134
|
diagClose: "关闭兼容诊断",
|
|
1105
1135
|
diagUnknownVersion: "版本未知",
|
|
@@ -1364,23 +1394,23 @@ window.__ModuleLoader__.load({
|
|
|
1364
1394
|
}
|
|
1365
1395
|
//#endregion
|
|
1366
1396
|
//#region \0dsh-css:/home/runner/work/dsh-sidenote/dsh-sidenote/src/client/diagnostics/diagnostics.module.css.mjs
|
|
1367
|
-
const css$
|
|
1368
|
-
const tagId$
|
|
1369
|
-
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$
|
|
1397
|
+
const css$4 = ".tGe0LW_trigger{color:var(--dsw-alias-label-secondary,#555);border:1px solid var(--dsw-alias-border-l1,#ddd);cursor:pointer;background:0 0;border-radius:8px;padding:4px 8px;font-size:12px}.tGe0LW_panel{z-index:100;box-sizing:border-box;background:var(--dsw-alias-bg-layer-1,#fff);width:min(400px,100vw - 32px);max-height:calc(100vh - 80px);color:var(--dsw-alias-label-primary,#222);border:1px solid var(--dsw-alias-border-l1,#ddd);border-radius:12px;padding:14px;font-size:13px;position:fixed;top:60px;right:16px;overflow:auto;box-shadow:0 12px 36px #0002}.tGe0LW_header,.tGe0LW_actions,.tGe0LW_list li>div{justify-content:space-between;align-items:center;gap:12px;display:flex}.tGe0LW_header button,.tGe0LW_actions button{color:inherit;border:1px solid var(--dsw-alias-border-l1,#ddd);cursor:pointer;background:0 0;border-radius:6px;padding:4px 8px}.tGe0LW_description,.tGe0LW_versions,.tGe0LW_list p{color:var(--dsw-alias-label-secondary,#666);font-size:12px;line-height:1.5}.tGe0LW_list{margin:12px 0;padding:0;list-style:none}.tGe0LW_list li{border-top:1px solid var(--dsw-alias-border-l1,#ddd);padding:10px 0}.tGe0LW_list li p{margin:4px 0}.tGe0LW_list strong{font-size:12px;font-weight:500}.tGe0LW_list [data-state=unavailable]{color:var(--dsw-alias-state-error-primary,#c33)}.tGe0LW_list details{color:var(--dsw-alias-label-tertiary,#888);font-size:11px}.tGe0LW_list summary{cursor:pointer}.tGe0LW_list code{overflow-wrap:anywhere}";
|
|
1398
|
+
const tagId$4 = "dsh-sidenote/diagnostics.module.css";
|
|
1399
|
+
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$4) + "]") === null) {
|
|
1370
1400
|
const tag = document.createElement("style");
|
|
1371
1401
|
tag.dataset.plugin = "dsh-sidenote";
|
|
1372
|
-
tag.dataset.pluginCss = tagId$
|
|
1373
|
-
tag.textContent = css$
|
|
1402
|
+
tag.dataset.pluginCss = tagId$4;
|
|
1403
|
+
tag.textContent = css$4;
|
|
1374
1404
|
document.head.appendChild(tag);
|
|
1375
1405
|
}
|
|
1376
1406
|
var diagnostics_module_css_default = {
|
|
1377
|
-
"
|
|
1378
|
-
"
|
|
1407
|
+
"trigger": "tGe0LW_trigger",
|
|
1408
|
+
"header": "tGe0LW_header",
|
|
1409
|
+
"list": "tGe0LW_list",
|
|
1379
1410
|
"description": "tGe0LW_description",
|
|
1411
|
+
"panel": "tGe0LW_panel",
|
|
1380
1412
|
"versions": "tGe0LW_versions",
|
|
1381
|
-
"
|
|
1382
|
-
"trigger": "tGe0LW_trigger",
|
|
1383
|
-
"list": "tGe0LW_list"
|
|
1413
|
+
"actions": "tGe0LW_actions"
|
|
1384
1414
|
};
|
|
1385
1415
|
//#endregion
|
|
1386
1416
|
//#region src/client/diagnostics/index.tsx
|
|
@@ -2269,43 +2299,43 @@ window.__ModuleLoader__.load({
|
|
|
2269
2299
|
}
|
|
2270
2300
|
//#endregion
|
|
2271
2301
|
//#region \0dsh-css:/home/runner/work/dsh-sidenote/dsh-sidenote/src/client/annotations/annotations.module.css.mjs
|
|
2272
|
-
const css$
|
|
2273
|
-
const tagId$
|
|
2274
|
-
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$
|
|
2302
|
+
const css$3 = ".SVnebq_chipWrap{box-sizing:border-box;width:calc(100% - 2 * var(--dsh-composer-side-clearance,16px));max-width:var(--dsh-composer-card-max-width,780px);background:var(--dsw-alias-bg-base);flex-wrap:wrap;align-items:center;gap:6px;margin:0 auto;padding:2px 0;display:flex}.SVnebq_chip{--chip-surface:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l1);background:var(--chip-surface);color:var(--dsw-alias-label-secondary);border-radius:10px;align-items:center;transition:background .12s,color .12s;display:inline-flex;position:relative}.SVnebq_chip:hover,.SVnebq_chip:focus-within,.SVnebq_chip[data-open]{--chip-surface:var(--dsw-alias-interactive-bg-hover-solid);color:var(--dsw-alias-label-primary)}.SVnebq_chipMain{border-radius:inherit;min-height:28px;color:inherit;font:inherit;cursor:pointer;background:0 0;border:0;align-items:center;gap:5px;padding:3px 9px;font-size:12px;line-height:18px;display:inline-flex}.SVnebq_chipDismissShade{border-radius:inherit;background:linear-gradient(to right, transparent, var(--chip-surface) 45%);opacity:0;pointer-events:none;justify-content:flex-end;align-items:center;width:38px;transition:opacity .16s ease-out;display:flex;position:absolute;inset:0 3px 0 auto}.SVnebq_chipDismiss{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);width:24px;height:24px;color:var(--dsw-alias-label-secondary);cursor:pointer;border-radius:50%;flex:none;justify-content:center;align-items:center;padding:0;transition:transform .16s ease-out,background .12s,color .12s;display:inline-flex;transform:translate(2px)scale(.94)}.SVnebq_chip:hover .SVnebq_chipDismissShade,.SVnebq_chip:focus-within .SVnebq_chipDismissShade{opacity:1}.SVnebq_chip:hover .SVnebq_chipDismiss,.SVnebq_chip:focus-within .SVnebq_chipDismiss{pointer-events:auto;transform:none}.SVnebq_chipDismiss:hover{background:var(--dsw-alias-interactive-bg-hover-solid);color:var(--dsw-alias-label-primary)}.SVnebq_chipDismiss:disabled{opacity:.45;cursor:default}.SVnebq_contextPanel{box-sizing:border-box;z-index:1000;overscroll-behavior:contain;border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);border-radius:14px;padding:4px;animation:.12s ease-out SVnebq_contextAppear;position:fixed;overflow:auto;box-shadow:0 8px 28px #0000001f}.SVnebq_contextList{margin:0;padding:0;list-style:none}.SVnebq_contextItem{border-radius:10px;align-items:flex-start;gap:10px;margin:0;padding:8px 10px;transition:background .12s;display:flex}.SVnebq_contextItem+.SVnebq_contextItem{border-top:1px solid var(--dsw-alias-border-l1)}.SVnebq_contextItem:hover,.SVnebq_contextItem:focus-within{background:var(--dsw-alias-interactive-bg-hover)}.SVnebq_contextNumber{min-width:16px;color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;flex:none;font-size:12px;line-height:21px}.SVnebq_contextContent{flex:1;min-width:0}.SVnebq_contextLabel{color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:18px}.SVnebq_contextLabel:not(:first-child){margin-top:6px}.SVnebq_contextSource{color:var(--dsw-alias-label-secondary);margin-bottom:8px;font-size:12px}.SVnebq_contextText{white-space:pre-wrap;overflow-wrap:anywhere;user-select:text;font-size:13px;line-height:1.6}.SVnebq_contextActions{flex:none;gap:2px;display:flex}.SVnebq_contextAction{width:26px;height:26px;color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:0;border-radius:8px;justify-content:center;align-items:center;padding:0;transition:color .12s,background .12s;display:inline-flex}.SVnebq_contextAction:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover)}.SVnebq_contextAction:disabled,.SVnebq_chipClearAll:disabled{opacity:.45;cursor:default}.SVnebq_contextEditor{box-sizing:border-box;resize:vertical;border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-base);width:100%;min-height:64px;color:inherit;font:inherit;border-radius:6px;margin-top:4px;padding:6px 8px;font-size:13px;line-height:1.6;display:block}.SVnebq_contextFooter{padding:2px 10px 4px}.SVnebq_chipClearAll{color:var(--dsw-alias-label-tertiary);cursor:pointer;font:inherit;background:0 0;border:0;border-radius:6px;padding:4px 6px;font-size:12px}.SVnebq_chipClearAll:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-state-error-primary)}.SVnebq_chipMain:focus-visible,.SVnebq_chipDismiss:focus-visible,.SVnebq_contextAction:focus-visible,.SVnebq_chipClearAll:focus-visible,.SVnebq_contextEditor:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}.SVnebq_storageNotice{color:var(--dsw-alias-label-secondary);flex-basis:100%;font-size:12px}@keyframes SVnebq_contextAppear{0%{opacity:0;transform:translateY(3px)}to{opacity:1;transform:translateY(0)}}@media (hover:none){.SVnebq_chipMain{padding-right:32px}.SVnebq_chipDismissShade{opacity:1}.SVnebq_chipDismiss{pointer-events:auto;transform:none}}@media (prefers-reduced-motion:reduce){.SVnebq_contextPanel{animation:none}.SVnebq_chip,.SVnebq_chipDismissShade,.SVnebq_chipDismiss,.SVnebq_contextItem,.SVnebq_contextAction{transition:none}}.SVnebq_userContextHost{display:contents}[data-sidenote-context-replaced]{display:none!important}.SVnebq_sentChips{white-space:normal;display:inline}.SVnebq_sentChipGroup{display:inline}.SVnebq_sentChip{vertical-align:middle;background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-secondary);font:inherit;border:0;border-radius:6px;align-items:center;gap:4px;margin:0 6px 2px 0;padding:2px 6px;font-size:12px;line-height:18px;transition:background .14s,color .14s;display:inline-flex}button.SVnebq_sentChip{cursor:pointer}button.SVnebq_sentChip:hover,button.SVnebq_sentChip[aria-expanded=true]{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover-solid)}button.SVnebq_sentChip:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}.SVnebq_sentChevron,.SVnebq_sentChevronOpen{opacity:.65;flex:none;transition:transform .14s}.SVnebq_sentChevronOpen{transform:rotate(180deg)}.SVnebq_sentPreview{text-align:left;white-space:normal}@media (prefers-reduced-motion:reduce){.SVnebq_sentChip,.SVnebq_sentChevron,.SVnebq_sentChevronOpen{transition:none}}";
|
|
2303
|
+
const tagId$3 = "dsh-sidenote/annotations.module.css";
|
|
2304
|
+
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$3) + "]") === null) {
|
|
2275
2305
|
const tag = document.createElement("style");
|
|
2276
2306
|
tag.dataset.plugin = "dsh-sidenote";
|
|
2277
|
-
tag.dataset.pluginCss = tagId$
|
|
2278
|
-
tag.textContent = css$
|
|
2307
|
+
tag.dataset.pluginCss = tagId$3;
|
|
2308
|
+
tag.textContent = css$3;
|
|
2279
2309
|
document.head.appendChild(tag);
|
|
2280
2310
|
}
|
|
2281
2311
|
var annotations_module_css_default = {
|
|
2282
2312
|
"chipDismiss": "SVnebq_chipDismiss",
|
|
2283
|
-
"
|
|
2284
|
-
"
|
|
2285
|
-
"chipClearAll": "SVnebq_chipClearAll",
|
|
2313
|
+
"userContextHost": "SVnebq_userContextHost",
|
|
2314
|
+
"contextAppear": "SVnebq_contextAppear",
|
|
2286
2315
|
"sentChips": "SVnebq_sentChips",
|
|
2316
|
+
"contextSource": "SVnebq_contextSource",
|
|
2287
2317
|
"sentChevronOpen": "SVnebq_sentChevronOpen",
|
|
2288
|
-
"contextText": "SVnebq_contextText",
|
|
2289
|
-
"contextLabel": "SVnebq_contextLabel",
|
|
2290
|
-
"chip": "SVnebq_chip",
|
|
2291
2318
|
"contextPanel": "SVnebq_contextPanel",
|
|
2292
|
-
"
|
|
2293
|
-
"chipMain": "SVnebq_chipMain",
|
|
2294
|
-
"contextEditor": "SVnebq_contextEditor",
|
|
2295
|
-
"sentPreview": "SVnebq_sentPreview",
|
|
2296
|
-
"userContextHost": "SVnebq_userContextHost",
|
|
2297
|
-
"sentChip": "SVnebq_sentChip",
|
|
2319
|
+
"contextContent": "SVnebq_contextContent",
|
|
2298
2320
|
"sentChipGroup": "SVnebq_sentChipGroup",
|
|
2299
|
-
"
|
|
2300
|
-
"contextSource": "SVnebq_contextSource",
|
|
2301
|
-
"contextList": "SVnebq_contextList",
|
|
2321
|
+
"chipMain": "SVnebq_chipMain",
|
|
2302
2322
|
"sentChevron": "SVnebq_sentChevron",
|
|
2303
|
-
"contextAppear": "SVnebq_contextAppear",
|
|
2304
2323
|
"contextActions": "SVnebq_contextActions",
|
|
2324
|
+
"contextAction": "SVnebq_contextAction",
|
|
2325
|
+
"contextNumber": "SVnebq_contextNumber",
|
|
2326
|
+
"storageNotice": "SVnebq_storageNotice",
|
|
2327
|
+
"sentChip": "SVnebq_sentChip",
|
|
2328
|
+
"sentPreview": "SVnebq_sentPreview",
|
|
2329
|
+
"contextItem": "SVnebq_contextItem",
|
|
2330
|
+
"contextFooter": "SVnebq_contextFooter",
|
|
2331
|
+
"contextLabel": "SVnebq_contextLabel",
|
|
2332
|
+
"contextList": "SVnebq_contextList",
|
|
2305
2333
|
"chipWrap": "SVnebq_chipWrap",
|
|
2306
2334
|
"chipDismissShade": "SVnebq_chipDismissShade",
|
|
2307
|
-
"
|
|
2308
|
-
"
|
|
2335
|
+
"chip": "SVnebq_chip",
|
|
2336
|
+
"contextText": "SVnebq_contextText",
|
|
2337
|
+
"chipClearAll": "SVnebq_chipClearAll",
|
|
2338
|
+
"contextEditor": "SVnebq_contextEditor"
|
|
2309
2339
|
};
|
|
2310
2340
|
//#endregion
|
|
2311
2341
|
//#region src/client/annotations/NativeUserContext.tsx
|
|
@@ -2769,48 +2799,48 @@ window.__ModuleLoader__.load({
|
|
|
2769
2799
|
}
|
|
2770
2800
|
//#endregion
|
|
2771
2801
|
//#region \0dsh-css:/home/runner/work/dsh-sidenote/dsh-sidenote/src/client/sidechat/sidechat.module.css.mjs
|
|
2772
|
-
const css$
|
|
2773
|
-
const tagId$
|
|
2774
|
-
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$
|
|
2802
|
+
const css$2 = "._5KEEsG_nativeHost,._5KEEsG_root,._5KEEsG_nativeConversation{flex-direction:column;min-height:0;display:flex}._5KEEsG_nativeHost,._5KEEsG_root{height:100%}._5KEEsG_root{color:var(--dsw-alias-label-primary)}._5KEEsG_nativeConversation{flex:1}._5KEEsG_chatView{flex-direction:column;flex:1 0 auto;min-width:0;display:flex}._5KEEsG_mainContext{box-sizing:border-box;width:100%;padding:12px calc(var(--dsh-composer-side-clearance,8px) + 16px) 4px;flex:none;min-width:0}._5KEEsG_contextColumn{width:100%;max-width:var(--dsh-chat-content-width,748px);min-width:0;margin-inline:auto}._5KEEsG_historyToggle{align-items:center;gap:6px;display:flex}._5KEEsG_contextHint{color:var(--dsw-alias-label-tertiary);font-size:12px}._5KEEsG_contextChevron{transform:rotate(-90deg)}._5KEEsG_contextChevron,._5KEEsG_contextChevronOpen{flex:none}._5KEEsG_progress{margin:12px 0;padding:4px 0;position:relative;container-type:inline-size}._5KEEsG_progressEntries{overscroll-behavior:contain;scrollbar-width:thin;overflow-anchor:none;max-height:min(240px,32vh);margin-inline-end:-16px;overflow:auto}._5KEEsG_progressContent{width:100cqw}._5KEEsG_progressEntries:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}._5KEEsG_progressDetail,._5KEEsG_contextBubble{white-space:pre-wrap}._5KEEsG_progressEntry,._5KEEsG_progressDetail{overflow-wrap:anywhere;font-size:14px;line-height:1.65}._5KEEsG_contextImage{border-radius:8px;max-width:100%;max-height:160px;margin:8px 0}._5KEEsG_progressEntry{margin:0 0 12px;display:flow-root}._5KEEsG_progressEntry:last-child{margin-bottom:0}._5KEEsG_progressProcess{color:var(--dsw-alias-label-tertiary);margin:8px 0;font-size:13px}._5KEEsG_progressProcess summary{cursor:pointer;border-radius:4px;align-items:center;gap:6px;min-height:24px;list-style:none;display:flex}._5KEEsG_progressProcess summary::-webkit-details-marker{display:none}._5KEEsG_progressProcess summary:hover{color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-interactive-bg-hover)}._5KEEsG_progressProcess summary>svg,._5KEEsG_progressProcess summary>span:not(._5KEEsG_progressPreview){flex:none}._5KEEsG_progressProcess summary>svg:last-child{margin-left:auto;transform:rotate(-90deg)}._5KEEsG_progressProcess[open] summary>svg:last-child{transform:none}._5KEEsG_progressPreview{white-space:nowrap;text-overflow:ellipsis;min-width:0;overflow:hidden}._5KEEsG_progressDetail{color:var(--dsw-alias-label-secondary);margin:6px 0 12px 20px}._5KEEsG_progressLatest{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-button-floating-fill);color:var(--dsw-alias-label-secondary);font:inherit;cursor:pointer;border-radius:16px;align-items:center;gap:4px;padding:5px 9px;font-size:12px;display:flex;position:absolute;bottom:4px;right:12px}._5KEEsG_progressLatest:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-button-floating-hover)}._5KEEsG_reflowAction{width:32px;height:32px;color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:0;border-radius:8px;flex:none;order:1;justify-content:center;align-items:center;margin-left:auto;padding:0;display:inline-flex}._5KEEsG_reflowAction:hover{color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-interactive-bg-hover)}._5KEEsG_reflowAction:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}._5KEEsG_reflowAction:disabled{cursor:default;color:var(--dsw-alias-state-business-primary);background:0 0}._5KEEsG_nativeToolbar{border-bottom:1px solid var(--dsw-alias-border-l1);justify-content:space-between;align-items:center;gap:8px;padding:8px 12px;display:flex}._5KEEsG_nativeToolbarActions{flex-wrap:wrap;align-items:center;gap:8px;display:flex}._5KEEsG_nativeAction,._5KEEsG_historyToggle{color:var(--dsw-alias-label-secondary);font:inherit;cursor:pointer;background:0 0;border:0;border-radius:6px;padding:4px 6px;font-size:13px}._5KEEsG_nativeAction:hover,._5KEEsG_nativeAction:focus-visible,._5KEEsG_historyToggle:hover,._5KEEsG_historyToggle:focus-visible{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover)}._5KEEsG_nativeAction:disabled{opacity:.5;cursor:default}._5KEEsG_historyToggle{margin:0;text-align:left;margin-inline-start:-6px}._5KEEsG_stateScreen{text-align:center;flex-direction:column;flex:1;justify-content:center;align-items:center;gap:8px;padding:24px 16px;display:flex}._5KEEsG_emptyIcon{color:var(--dsw-alias-label-tertiary)}._5KEEsG_emptyTitle{font-size:14px;font-weight:600}._5KEEsG_emptyText{color:var(--dsw-alias-label-secondary);max-width:280px;font-size:13px;line-height:1.6}._5KEEsG_stateDetail,._5KEEsG_errorRow{color:var(--dsw-alias-state-error-primary);overflow-wrap:anywhere;font-size:13px;line-height:1.6}._5KEEsG_errorRow{padding:8px 12px}._5KEEsG_headerSide{color:var(--dsw-alias-label-secondary);cursor:pointer;font:inherit;background:0 0;border:0;border-radius:6px;align-items:center;gap:4px;padding:4px 8px;display:inline-flex}._5KEEsG_headerSide:hover,._5KEEsG_headerSide:focus-visible{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover)}._5KEEsG_headerSide:disabled{opacity:.4;cursor:default}._5KEEsG_contextUserRow{flex-direction:column;align-items:flex-end;gap:8px;margin:16px 0 24px;display:flex}._5KEEsG_contextBubble{border-radius:var(--dsw-radius-xl);background:var(--dsw-specific-bubble);max-width:82%;color:var(--dsw-alias-label-primary);overflow-wrap:anywhere;padding:10px 16px;font-size:14px;line-height:1.65}";
|
|
2803
|
+
const tagId$2 = "dsh-sidenote/sidechat.module.css";
|
|
2804
|
+
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$2) + "]") === null) {
|
|
2775
2805
|
const tag = document.createElement("style");
|
|
2776
2806
|
tag.dataset.plugin = "dsh-sidenote";
|
|
2777
|
-
tag.dataset.pluginCss = tagId$
|
|
2778
|
-
tag.textContent = css$
|
|
2807
|
+
tag.dataset.pluginCss = tagId$2;
|
|
2808
|
+
tag.textContent = css$2;
|
|
2779
2809
|
document.head.appendChild(tag);
|
|
2780
2810
|
}
|
|
2781
2811
|
var sidechat_module_css_default = {
|
|
2812
|
+
"progress": "_5KEEsG_progress",
|
|
2813
|
+
"contextColumn": "_5KEEsG_contextColumn",
|
|
2782
2814
|
"emptyTitle": "_5KEEsG_emptyTitle",
|
|
2783
|
-
"
|
|
2784
|
-
"progressEntry": "_5KEEsG_progressEntry",
|
|
2785
|
-
"stateDetail": "_5KEEsG_stateDetail",
|
|
2815
|
+
"contextUserRow": "_5KEEsG_contextUserRow",
|
|
2786
2816
|
"progressDetail": "_5KEEsG_progressDetail",
|
|
2787
|
-
"
|
|
2788
|
-
"
|
|
2789
|
-
"mainContext": "_5KEEsG_mainContext",
|
|
2790
|
-
"contextHint": "_5KEEsG_contextHint",
|
|
2791
|
-
"progressPreview": "_5KEEsG_progressPreview",
|
|
2792
|
-
"nativeToolbar": "_5KEEsG_nativeToolbar",
|
|
2817
|
+
"contextChevronOpen": "_5KEEsG_contextChevronOpen",
|
|
2818
|
+
"errorRow": "_5KEEsG_errorRow",
|
|
2793
2819
|
"progressContent": "_5KEEsG_progressContent",
|
|
2794
|
-
"
|
|
2795
|
-
"
|
|
2796
|
-
"
|
|
2797
|
-
"
|
|
2820
|
+
"reflowAction": "_5KEEsG_reflowAction",
|
|
2821
|
+
"nativeAction": "_5KEEsG_nativeAction",
|
|
2822
|
+
"root": "_5KEEsG_root",
|
|
2823
|
+
"progressLatest": "_5KEEsG_progressLatest",
|
|
2798
2824
|
"emptyText": "_5KEEsG_emptyText",
|
|
2825
|
+
"contextImage": "_5KEEsG_contextImage",
|
|
2826
|
+
"progressEntries": "_5KEEsG_progressEntries",
|
|
2827
|
+
"nativeConversation": "_5KEEsG_nativeConversation",
|
|
2799
2828
|
"nativeHost": "_5KEEsG_nativeHost",
|
|
2829
|
+
"chatView": "_5KEEsG_chatView",
|
|
2800
2830
|
"contextBubble": "_5KEEsG_contextBubble",
|
|
2801
|
-
"contextChevronOpen": "_5KEEsG_contextChevronOpen",
|
|
2802
2831
|
"nativeToolbarActions": "_5KEEsG_nativeToolbarActions",
|
|
2803
|
-
"contextColumn": "_5KEEsG_contextColumn",
|
|
2804
|
-
"progressProcess": "_5KEEsG_progressProcess",
|
|
2805
|
-
"progressLatest": "_5KEEsG_progressLatest",
|
|
2806
|
-
"nativeAction": "_5KEEsG_nativeAction",
|
|
2807
2832
|
"historyToggle": "_5KEEsG_historyToggle",
|
|
2808
|
-
"
|
|
2809
|
-
"
|
|
2810
|
-
"
|
|
2811
|
-
"
|
|
2812
|
-
"
|
|
2813
|
-
"
|
|
2833
|
+
"mainContext": "_5KEEsG_mainContext",
|
|
2834
|
+
"stateScreen": "_5KEEsG_stateScreen",
|
|
2835
|
+
"stateDetail": "_5KEEsG_stateDetail",
|
|
2836
|
+
"progressPreview": "_5KEEsG_progressPreview",
|
|
2837
|
+
"nativeToolbar": "_5KEEsG_nativeToolbar",
|
|
2838
|
+
"contextChevron": "_5KEEsG_contextChevron",
|
|
2839
|
+
"contextHint": "_5KEEsG_contextHint",
|
|
2840
|
+
"progressProcess": "_5KEEsG_progressProcess",
|
|
2841
|
+
"headerSide": "_5KEEsG_headerSide",
|
|
2842
|
+
"progressEntry": "_5KEEsG_progressEntry",
|
|
2843
|
+
"emptyIcon": "_5KEEsG_emptyIcon"
|
|
2814
2844
|
};
|
|
2815
2845
|
//#endregion
|
|
2816
2846
|
//#region src/client/sidechat/ContextProgress.tsx
|
|
@@ -6538,44 +6568,45 @@ ${body}
|
|
|
6538
6568
|
}
|
|
6539
6569
|
//#endregion
|
|
6540
6570
|
//#region \0dsh-css:/home/runner/work/dsh-sidenote/dsh-sidenote/src/client/annotate/annotate.module.css.mjs
|
|
6541
|
-
const css = "._SVViG_toolbar{z-index:50;background:var(--dsw-alias-bg-layer-1,#fff);border:1px solid var(--dsw-alias-border-l1,#00000014);user-select:none;border-radius:10px;align-items:stretch;display:flex;position:fixed;overflow:hidden;transform:translate(-50%,-100%);box-shadow:0 4px 16px #0000001f}._SVViG_toolbarBelow{transform:translate(-50%)}._SVViG_toolbarButton{appearance:none;color:var(--dsw-alias-label-primary,#1f2329);cursor:pointer;white-space:nowrap;background:0 0;border:none;padding:7px 12px;font-size:13px;line-height:20px}._SVViG_toolbarButton+._SVViG_toolbarButton{border-left:1px solid var(--dsw-alias-border-l1,#00000014)}._SVViG_toolbarButton:hover{background:var(--dsw-alias-interactive-bg-hover,#0000000d)}._SVViG_badge{z-index:50;color:#fff;text-align:center;cursor:pointer;user-select:none;background:#2f88ff;border:none;border-radius:999px;width:18px;height:18px;padding:0;font-size:11px;font-weight:600;line-height:18px;position:fixed;transform:translateY(-50%);box-shadow:0 1px 4px #2f88ff73}._SVViG_badge:hover{background:#1f78f0}._SVViG_highlight{z-index:49;pointer-events:none;background:#2f88ff38;border-radius:2px;position:fixed}._SVViG_editorNew{z-index:50;background:var(--dsw-alias-bg-layer-1,#fff);border:1px solid var(--dsw-alias-border-l1,#00000014);border-radius:999px;align-items:center;gap:8px;padding:6px 8px 6px 12px;display:flex;position:fixed;box-shadow:0 6px 24px #00000024}._SVViG_editorEdit{z-index:50;background:var(--dsw-alias-bg-layer-1,#fff);border:1px solid var(--dsw-alias-border-l1,#00000014);border-radius:14px;flex-direction:column;display:flex;position:fixed;overflow:hidden;box-shadow:0 8px 28px #00000029}._SVViG_editorInput{min-width:0;color:var(--dsw-alias-label-primary,#1f2329);background:0 0;border:none;outline:none;flex:auto;font-size:13px;line-height:22px}._SVViG_editorTextarea{resize:none;color:var(--dsw-alias-label-primary,#1f2329);background:0 0;border:none;outline:none;padding:10px 12px 4px;font-family:inherit;font-size:13px;line-height:20px}._SVViG_editorInput::placeholder,._SVViG_editorTextarea::placeholder{color:var(--dsw-alias-label-caption,#8f959e)}._SVViG_editorAsk{z-index:50;background:var(--dsw-alias-bg-layer-1,#fff);border:1px solid var(--dsw-alias-border-l1,#00000014);border-radius:14px;flex-direction:column;gap:2px;padding:6px 8px 6px 12px;display:flex;position:fixed;box-shadow:0 6px 24px #00000024}._SVViG_editorAskRow{align-items:center;gap:8px;display:flex}._SVViG_editorTarget{color:var(--dsw-alias-label-caption,#8f959e);user-select:none;padding:2px 2px 0;font-size:11px;line-height:16px}._SVViG_confirmButton{color:#fff;cursor:pointer;background:#1f2329;border:none;border-radius:999px;flex:none;place-items:center;width:26px;height:26px;padding:0;display:grid}._SVViG_confirmButton:hover{background:#000}._SVViG_editorFooter{align-items:center;gap:8px;padding:6px 10px 8px;display:flex}._SVViG_editorSpacer{flex:auto}._SVViG_deleteButton{width:26px;height:26px;color:var(--dsw-alias-label-tertiary,#8f959e);cursor:pointer;background:0 0;border:none;border-radius:999px;place-items:center;padding:0;display:grid}._SVViG_deleteButton:hover{background:var(--dsw-alias-interactive-bg-hover,#0000000d);color:var(--dsw-alias-state-error-primary,#d53f3f)}._SVViG_cancelButton,._SVViG_saveButton{cursor:pointer;border:none;border-radius:999px;padding:4px 14px;font-size:13px;line-height:20px}._SVViG_cancelButton{background:var(--dsw-alias-interactive-bg-hover,#0000000d);color:var(--dsw-alias-label-primary,#1f2329)}._SVViG_saveButton{color:#fff;background:#1f2329}._SVViG_saveButton:hover{background:#000}._SVViG_editorError{color:#e5484d;white-space:nowrap;font-size:12px;position:absolute;top:calc(100% + 4px);left:12px}._SVViG_badgeSent{background:var(--dsw-alias-label-caption,#8f959e);box-shadow:none;opacity:.75}._SVViG_badgeSent:hover{background:var(--dsw-alias-label-tertiary,#6b7075)}._SVViG_sentChip{border:1px solid var(--dsw-alias-border-l1,#0000001a);background:var(--dsw-alias-interactive-bg-hover,#0000000d);color:var(--dsw-alias-label-secondary,#3f454d);cursor:default;user-select:none;border-radius:999px;align-items:center;gap:4px;margin:0 0 6px;padding:1px 10px;font-size:12px;line-height:18px;display:inline-flex}._SVViG_sentCardTitle{color:var(--dsw-alias-label-tertiary,#8f959e);padding:2px 12px 0;font-size:12px;font-weight:600}._SVViG_sentCardQuote{color:var(--dsw-alias-label-secondary,#3f454d);border-left:2px solid var(--dsw-alias-border-l1,#0000001f);word-break:break-word;margin:4px 12px 0;padding:4px 12px;font-size:13px;line-height:20px}._SVViG_sentCardNote{color:var(--dsw-alias-label-primary,#1f2329);word-break:break-word;padding:4px 12px 10px;font-size:13px;line-height:20px}._SVViG_hint{z-index:50;background:var(--dsw-alias-bg-layer-1,#fff);border:1px solid var(--dsw-alias-border-l1,#00000014);max-width:320px;color:var(--dsw-alias-label-secondary,#3f454d);border-radius:12px;align-items:center;gap:10px;padding:10px 12px;font-size:12px;line-height:18px;animation:.25s ease-out _SVViG_dshSidenoteHintIn;display:flex;position:fixed;bottom:160px;right:24px;box-shadow:0 8px 28px #00000024}._SVViG_hintClose{width:20px;height:20px;color:var(--dsw-alias-label-tertiary,#8f959e);cursor:pointer;background:0 0;border:none;border-radius:999px;flex:none;place-items:center;padding:0;font-size:14px;line-height:1;display:grid}._SVViG_hintClose:hover{background:var(--dsw-alias-interactive-bg-hover,#0000000d);color:var(--dsw-alias-label-primary,#1f2329)}@keyframes _SVViG_dshSidenoteHintIn{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}._SVViG_sentChipRow{align-items:center;gap:6px;margin:0 0 6px;display:inline-flex}._SVViG_badgeSent{background:var(--dsw-alias-bg-layer-1,#fff);color:var(--dsw-alias-label-tertiary,#8f959e);border:1.5px solid var(--dsw-alias-label-caption,#b0b5bb);box-shadow:none;opacity:1;line-height:15px}._SVViG_badgeSent:hover{background:var(--dsw-alias-interactive-bg-hover,#0000000a);color:var(--dsw-alias-label-secondary,#3f454d)}._SVViG_hint{background:color-mix(in srgb, var(--dsw-alias-bg-layer-1,#fff) 88%, transparent);backdrop-filter:blur(8px);bottom:130px}";
|
|
6542
|
-
const tagId = "dsh-sidenote/annotate.module.css";
|
|
6543
|
-
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
|
6571
|
+
const css$1 = "._SVViG_toolbar{z-index:50;background:var(--dsw-alias-bg-layer-1,#fff);border:1px solid var(--dsw-alias-border-l1,#00000014);user-select:none;border-radius:10px;flex-wrap:wrap;align-items:stretch;width:max-content;display:flex;position:fixed;overflow:hidden;transform:translate(-50%,-100%);box-shadow:0 4px 16px #0000001f}._SVViG_toolbarBelow{transform:translate(-50%)}._SVViG_toolbarButton{appearance:none;color:var(--dsw-alias-label-primary,#1f2329);cursor:pointer;white-space:nowrap;background:0 0;border:none;padding:7px 12px;font-size:13px;line-height:20px}._SVViG_toolbarButton+._SVViG_toolbarButton{border-left:1px solid var(--dsw-alias-border-l1,#00000014)}._SVViG_toolbarButton:hover{background:var(--dsw-alias-interactive-bg-hover,#0000000d)}._SVViG_toolbarButton:focus-visible{outline-offset:-3px;outline:2px solid #2f88ff}._SVViG_toolbarStatus{color:var(--dsw-alias-label-secondary,#646a73);flex-basis:100%;padding:6px 12px;font-size:12px;line-height:18px}._SVViG_badge{z-index:50;color:#fff;text-align:center;cursor:pointer;user-select:none;background:#2f88ff;border:none;border-radius:999px;width:18px;height:18px;padding:0;font-size:11px;font-weight:600;line-height:18px;position:fixed;transform:translateY(-50%);box-shadow:0 1px 4px #2f88ff73}._SVViG_badge:hover{background:#1f78f0}._SVViG_highlight{z-index:49;pointer-events:none;background:#2f88ff38;border-radius:2px;position:fixed}._SVViG_editorNew{z-index:50;background:var(--dsw-alias-bg-layer-1,#fff);border:1px solid var(--dsw-alias-border-l1,#00000014);border-radius:999px;align-items:center;gap:8px;padding:6px 8px 6px 12px;display:flex;position:fixed;box-shadow:0 6px 24px #00000024}._SVViG_editorEdit{z-index:50;background:var(--dsw-alias-bg-layer-1,#fff);border:1px solid var(--dsw-alias-border-l1,#00000014);border-radius:14px;flex-direction:column;display:flex;position:fixed;overflow:hidden;box-shadow:0 8px 28px #00000029}._SVViG_editorInput{min-width:0;color:var(--dsw-alias-label-primary,#1f2329);background:0 0;border:none;outline:none;flex:auto;font-size:13px;line-height:22px}._SVViG_editorTextarea{resize:none;color:var(--dsw-alias-label-primary,#1f2329);background:0 0;border:none;outline:none;padding:10px 12px 4px;font-family:inherit;font-size:13px;line-height:20px}._SVViG_editorInput::placeholder,._SVViG_editorTextarea::placeholder{color:var(--dsw-alias-label-caption,#8f959e)}._SVViG_editorAsk{z-index:50;background:var(--dsw-alias-bg-layer-1,#fff);border:1px solid var(--dsw-alias-border-l1,#00000014);border-radius:14px;flex-direction:column;gap:2px;padding:6px 8px 6px 12px;display:flex;position:fixed;box-shadow:0 6px 24px #00000024}._SVViG_editorAskRow{align-items:center;gap:8px;display:flex}._SVViG_editorTarget{color:var(--dsw-alias-label-caption,#8f959e);user-select:none;padding:2px 2px 0;font-size:11px;line-height:16px}._SVViG_confirmButton{color:#fff;cursor:pointer;background:#1f2329;border:none;border-radius:999px;flex:none;place-items:center;width:26px;height:26px;padding:0;display:grid}._SVViG_confirmButton:hover{background:#000}._SVViG_editorFooter{align-items:center;gap:8px;padding:6px 10px 8px;display:flex}._SVViG_editorSpacer{flex:auto}._SVViG_deleteButton{width:26px;height:26px;color:var(--dsw-alias-label-tertiary,#8f959e);cursor:pointer;background:0 0;border:none;border-radius:999px;place-items:center;padding:0;display:grid}._SVViG_deleteButton:hover{background:var(--dsw-alias-interactive-bg-hover,#0000000d);color:var(--dsw-alias-state-error-primary,#d53f3f)}._SVViG_cancelButton,._SVViG_saveButton{cursor:pointer;border:none;border-radius:999px;padding:4px 14px;font-size:13px;line-height:20px}._SVViG_cancelButton{background:var(--dsw-alias-interactive-bg-hover,#0000000d);color:var(--dsw-alias-label-primary,#1f2329)}._SVViG_saveButton{color:#fff;background:#1f2329}._SVViG_saveButton:hover{background:#000}._SVViG_editorError{color:#e5484d;white-space:nowrap;font-size:12px;position:absolute;top:calc(100% + 4px);left:12px}._SVViG_badgeSent{background:var(--dsw-alias-label-caption,#8f959e);box-shadow:none;opacity:.75}._SVViG_badgeSent:hover{background:var(--dsw-alias-label-tertiary,#6b7075)}._SVViG_sentChip{border:1px solid var(--dsw-alias-border-l1,#0000001a);background:var(--dsw-alias-interactive-bg-hover,#0000000d);color:var(--dsw-alias-label-secondary,#3f454d);cursor:default;user-select:none;border-radius:999px;align-items:center;gap:4px;margin:0 0 6px;padding:1px 10px;font-size:12px;line-height:18px;display:inline-flex}._SVViG_sentCardTitle{color:var(--dsw-alias-label-tertiary,#8f959e);padding:2px 12px 0;font-size:12px;font-weight:600}._SVViG_sentCardQuote{color:var(--dsw-alias-label-secondary,#3f454d);border-left:2px solid var(--dsw-alias-border-l1,#0000001f);word-break:break-word;margin:4px 12px 0;padding:4px 12px;font-size:13px;line-height:20px}._SVViG_sentCardNote{color:var(--dsw-alias-label-primary,#1f2329);word-break:break-word;padding:4px 12px 10px;font-size:13px;line-height:20px}._SVViG_hint{z-index:50;background:var(--dsw-alias-bg-layer-1,#fff);border:1px solid var(--dsw-alias-border-l1,#00000014);max-width:320px;color:var(--dsw-alias-label-secondary,#3f454d);border-radius:12px;align-items:center;gap:10px;padding:10px 12px;font-size:12px;line-height:18px;animation:.25s ease-out _SVViG_dshSidenoteHintIn;display:flex;position:fixed;bottom:160px;right:24px;box-shadow:0 8px 28px #00000024}._SVViG_hintClose{width:20px;height:20px;color:var(--dsw-alias-label-tertiary,#8f959e);cursor:pointer;background:0 0;border:none;border-radius:999px;flex:none;place-items:center;padding:0;font-size:14px;line-height:1;display:grid}._SVViG_hintClose:hover{background:var(--dsw-alias-interactive-bg-hover,#0000000d);color:var(--dsw-alias-label-primary,#1f2329)}@keyframes _SVViG_dshSidenoteHintIn{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}._SVViG_sentChipRow{align-items:center;gap:6px;margin:0 0 6px;display:inline-flex}._SVViG_badgeSent{background:var(--dsw-alias-bg-layer-1,#fff);color:var(--dsw-alias-label-tertiary,#8f959e);border:1.5px solid var(--dsw-alias-label-caption,#b0b5bb);box-shadow:none;opacity:1;line-height:15px}._SVViG_badgeSent:hover{background:var(--dsw-alias-interactive-bg-hover,#0000000a);color:var(--dsw-alias-label-secondary,#3f454d)}._SVViG_hint{background:color-mix(in srgb, var(--dsw-alias-bg-layer-1,#fff) 88%, transparent);backdrop-filter:blur(8px);bottom:130px}";
|
|
6572
|
+
const tagId$1 = "dsh-sidenote/annotate.module.css";
|
|
6573
|
+
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$1) + "]") === null) {
|
|
6544
6574
|
const tag = document.createElement("style");
|
|
6545
6575
|
tag.dataset.plugin = "dsh-sidenote";
|
|
6546
|
-
tag.dataset.pluginCss = tagId;
|
|
6547
|
-
tag.textContent = css;
|
|
6576
|
+
tag.dataset.pluginCss = tagId$1;
|
|
6577
|
+
tag.textContent = css$1;
|
|
6548
6578
|
document.head.appendChild(tag);
|
|
6549
6579
|
}
|
|
6550
6580
|
var annotate_module_css_default = {
|
|
6551
|
-
"
|
|
6581
|
+
"confirmButton": "_SVViG_confirmButton",
|
|
6552
6582
|
"hintClose": "_SVViG_hintClose",
|
|
6553
|
-
"
|
|
6554
|
-
"badgeSent": "_SVViG_badgeSent",
|
|
6555
|
-
"sentCardTitle": "_SVViG_sentCardTitle",
|
|
6556
|
-
"editorFooter": "_SVViG_editorFooter",
|
|
6557
|
-
"toolbar": "_SVViG_toolbar",
|
|
6583
|
+
"dshSidenoteHintIn": "_SVViG_dshSidenoteHintIn",
|
|
6558
6584
|
"toolbarButton": "_SVViG_toolbarButton",
|
|
6559
|
-
"
|
|
6560
|
-
"highlight": "_SVViG_highlight",
|
|
6561
|
-
"editorNew": "_SVViG_editorNew",
|
|
6585
|
+
"deleteButton": "_SVViG_deleteButton",
|
|
6562
6586
|
"editorAsk": "_SVViG_editorAsk",
|
|
6563
|
-
"
|
|
6587
|
+
"badge": "_SVViG_badge",
|
|
6588
|
+
"badgeSent": "_SVViG_badgeSent",
|
|
6589
|
+
"toolbarBelow": "_SVViG_toolbarBelow",
|
|
6590
|
+
"saveButton": "_SVViG_saveButton",
|
|
6591
|
+
"editorTextarea": "_SVViG_editorTextarea",
|
|
6564
6592
|
"cancelButton": "_SVViG_cancelButton",
|
|
6565
|
-
"
|
|
6566
|
-
"editorInput": "_SVViG_editorInput",
|
|
6593
|
+
"sentChipRow": "_SVViG_sentChipRow",
|
|
6567
6594
|
"editorTarget": "_SVViG_editorTarget",
|
|
6568
|
-
"
|
|
6569
|
-
"
|
|
6570
|
-
"
|
|
6571
|
-
"
|
|
6572
|
-
"sentCardQuote": "_SVViG_sentCardQuote",
|
|
6573
|
-
"dshSidenoteHintIn": "_SVViG_dshSidenoteHintIn",
|
|
6574
|
-
"badge": "_SVViG_badge",
|
|
6575
|
-
"sentCardNote": "_SVViG_sentCardNote",
|
|
6595
|
+
"editorAskRow": "_SVViG_editorAskRow",
|
|
6596
|
+
"highlight": "_SVViG_highlight",
|
|
6597
|
+
"editorInput": "_SVViG_editorInput",
|
|
6598
|
+
"toolbar": "_SVViG_toolbar",
|
|
6576
6599
|
"editorError": "_SVViG_editorError",
|
|
6577
|
-
"
|
|
6578
|
-
"
|
|
6600
|
+
"editorNew": "_SVViG_editorNew",
|
|
6601
|
+
"sentCardNote": "_SVViG_sentCardNote",
|
|
6602
|
+
"toolbarStatus": "_SVViG_toolbarStatus",
|
|
6603
|
+
"sentCardQuote": "_SVViG_sentCardQuote",
|
|
6604
|
+
"hint": "_SVViG_hint",
|
|
6605
|
+
"editorFooter": "_SVViG_editorFooter",
|
|
6606
|
+
"editorEdit": "_SVViG_editorEdit",
|
|
6607
|
+
"editorSpacer": "_SVViG_editorSpacer",
|
|
6608
|
+
"sentChip": "_SVViG_sentChip",
|
|
6609
|
+
"sentCardTitle": "_SVViG_sentCardTitle"
|
|
6579
6610
|
};
|
|
6580
6611
|
//#endregion
|
|
6581
6612
|
//#region src/client/annotate/hint.tsx
|
|
@@ -6654,6 +6685,97 @@ ${body}
|
|
|
6654
6685
|
}
|
|
6655
6686
|
};
|
|
6656
6687
|
//#endregion
|
|
6688
|
+
//#region src/client/annotate/SelectionToolbar.tsx
|
|
6689
|
+
/** Preserve Sidenote's selection surface while admitting the host quote action. */
|
|
6690
|
+
function SelectionToolbar(props) {
|
|
6691
|
+
useLocaleTick();
|
|
6692
|
+
const root = (0, react.useRef)(null);
|
|
6693
|
+
const [failed, setFailed] = (0, react.useState)(false);
|
|
6694
|
+
(0, react.useLayoutEffect)(() => {
|
|
6695
|
+
const toolbar = root.current;
|
|
6696
|
+
if (toolbar === null) return;
|
|
6697
|
+
const place = () => {
|
|
6698
|
+
const rect = props.snapshot.range.getBoundingClientRect();
|
|
6699
|
+
const clip = sourceClip(props.snapshot.source);
|
|
6700
|
+
toolbar.style.maxWidth = `${Math.max(0, clip.right - clip.left - 16)}px`;
|
|
6701
|
+
const { width, height } = toolbar.getBoundingClientRect();
|
|
6702
|
+
const left = Math.max(clip.left + width / 2 + 8, Math.min(clip.right - width / 2 - 8, rect.left + rect.width / 2));
|
|
6703
|
+
const below = rect.top < clip.top + Math.max(64, height + 10);
|
|
6704
|
+
toolbar.style.left = `${left}px`;
|
|
6705
|
+
toolbar.style.top = `${below ? Math.max(clip.top + 4, Math.min(clip.bottom - height - 8, rect.bottom + 10)) : rect.top - 10}px`;
|
|
6706
|
+
toolbar.classList.toggle(annotate_module_css_default.toolbarBelow, below);
|
|
6707
|
+
toolbar.style.visibility = rect.bottom > clip.top && rect.top < clip.bottom ? "visible" : "hidden";
|
|
6708
|
+
};
|
|
6709
|
+
place();
|
|
6710
|
+
const observer = new ResizeObserver(place);
|
|
6711
|
+
observer.observe(toolbar);
|
|
6712
|
+
return () => {
|
|
6713
|
+
observer.disconnect();
|
|
6714
|
+
};
|
|
6715
|
+
});
|
|
6716
|
+
if (!props.snapshot.source.body.isConnected || props.snapshot.range.getClientRects().length === 0) return null;
|
|
6717
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6718
|
+
ref: root,
|
|
6719
|
+
className: annotate_module_css_default.toolbar,
|
|
6720
|
+
role: "toolbar",
|
|
6721
|
+
"aria-label": t("toolbarAria"),
|
|
6722
|
+
children: [
|
|
6723
|
+
props.onQuote && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
6724
|
+
type: "button",
|
|
6725
|
+
className: annotate_module_css_default.toolbarButton,
|
|
6726
|
+
title: t("nativeQuoteHint"),
|
|
6727
|
+
onMouseDown: (event) => {
|
|
6728
|
+
event.preventDefault();
|
|
6729
|
+
},
|
|
6730
|
+
onClick: (event) => {
|
|
6731
|
+
event.preventDefault();
|
|
6732
|
+
event.stopPropagation();
|
|
6733
|
+
setFailed(!props.onQuote());
|
|
6734
|
+
},
|
|
6735
|
+
children: t("nativeQuote")
|
|
6736
|
+
}),
|
|
6737
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
6738
|
+
type: "button",
|
|
6739
|
+
className: annotate_module_css_default.toolbarButton,
|
|
6740
|
+
disabled: !props.addAvailable,
|
|
6741
|
+
title: !props.addAvailable ? t("quoteWorkflowWaiting") : void 0,
|
|
6742
|
+
onMouseDown: (event) => {
|
|
6743
|
+
event.preventDefault();
|
|
6744
|
+
},
|
|
6745
|
+
onClick: (event) => {
|
|
6746
|
+
event.preventDefault();
|
|
6747
|
+
event.stopPropagation();
|
|
6748
|
+
props.onAdd();
|
|
6749
|
+
},
|
|
6750
|
+
children: t("addToConversation")
|
|
6751
|
+
}),
|
|
6752
|
+
props.sideChatAvailable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
6753
|
+
type: "button",
|
|
6754
|
+
className: annotate_module_css_default.toolbarButton,
|
|
6755
|
+
onMouseDown: (event) => {
|
|
6756
|
+
event.preventDefault();
|
|
6757
|
+
},
|
|
6758
|
+
onClick: (event) => {
|
|
6759
|
+
event.preventDefault();
|
|
6760
|
+
event.stopPropagation();
|
|
6761
|
+
props.onAsk();
|
|
6762
|
+
},
|
|
6763
|
+
children: t("askInSideChat")
|
|
6764
|
+
}),
|
|
6765
|
+
!props.addAvailable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6766
|
+
className: annotate_module_css_default.toolbarStatus,
|
|
6767
|
+
role: "status",
|
|
6768
|
+
children: t("quoteWorkflowWaiting")
|
|
6769
|
+
}),
|
|
6770
|
+
failed && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6771
|
+
className: annotate_module_css_default.toolbarStatus,
|
|
6772
|
+
role: "alert",
|
|
6773
|
+
children: t("nativeQuoteFailed")
|
|
6774
|
+
})
|
|
6775
|
+
]
|
|
6776
|
+
});
|
|
6777
|
+
}
|
|
6778
|
+
//#endregion
|
|
6657
6779
|
//#region src/client/annotate/overlay.tsx
|
|
6658
6780
|
/**
|
|
6659
6781
|
* The annotation overlay (Workitem 02): an independent React root appended to
|
|
@@ -6687,8 +6809,9 @@ ${body}
|
|
|
6687
6809
|
function AnnotateOverlay(props) {
|
|
6688
6810
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AnnotationBoundary, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AnnotateOverlayInner, { ...props }) });
|
|
6689
6811
|
}
|
|
6690
|
-
function AnnotateOverlayInner({ ctx, store, controller }) {
|
|
6812
|
+
function AnnotateOverlayInner({ ctx, store, controller, preferences }) {
|
|
6691
6813
|
useLocaleTick();
|
|
6814
|
+
const preference = (0, react.useSyncExternalStore)(preferences.subscribe, preferences.getSnapshot);
|
|
6692
6815
|
const diagnostics = hostDiagnostics(ctx);
|
|
6693
6816
|
(0, react.useSyncExternalStore)(diagnostics.subscribe, diagnostics.getSnapshot);
|
|
6694
6817
|
const selectionState = (0, react.useSyncExternalStore)((0, react.useCallback)((cb) => controller.subscribe(cb), [controller]), () => controller.getSnapshot());
|
|
@@ -6746,6 +6869,7 @@ ${body}
|
|
|
6746
6869
|
};
|
|
6747
6870
|
}, []);
|
|
6748
6871
|
const selection = selectionState.selection;
|
|
6872
|
+
const nativeQuoteAvailable = selection !== null && !preference.hidden && typeof resolveInput(ctx, selection.sessionId)?.insertQuote === "function";
|
|
6749
6873
|
const addToConversation = (snapshot) => {
|
|
6750
6874
|
const anchor = selectionBadgePoint(snapshot);
|
|
6751
6875
|
const annotation = store.add({
|
|
@@ -6839,6 +6963,12 @@ ${body}
|
|
|
6839
6963
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(FirstUseHint, {}),
|
|
6840
6964
|
selection !== null && editor === null && sideDraft === null && viewer === null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SelectionToolbar, {
|
|
6841
6965
|
snapshot: selection,
|
|
6966
|
+
onQuote: nativeQuoteAvailable ? () => {
|
|
6967
|
+
if (!insertNativeQuote(ctx, selection.sessionId, selection.text)) return false;
|
|
6968
|
+
controller.clear();
|
|
6969
|
+
window.getSelection()?.removeAllRanges();
|
|
6970
|
+
return true;
|
|
6971
|
+
} : void 0,
|
|
6842
6972
|
addAvailable: selection.source.surface === "side" || probeInput(ctx, selection.sessionId).state === "available" && hostDiagnostics(ctx).getSnapshot().capabilities.some((capability) => capability.id === "dock" && capability.state === "available"),
|
|
6843
6973
|
sideChatAvailable: selection.source.surface === "main" && sideChatBridge.current !== null,
|
|
6844
6974
|
onAdd: () => {
|
|
@@ -6847,7 +6977,7 @@ ${body}
|
|
|
6847
6977
|
onAsk: () => {
|
|
6848
6978
|
askInSideChat(selection);
|
|
6849
6979
|
}
|
|
6850
|
-
}),
|
|
6980
|
+
}, `${selection.sessionId}:${selection.anchorKey}:${selection.anchorText}:${selection.occurrence}`),
|
|
6851
6981
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(BadgeLayer, {
|
|
6852
6982
|
store,
|
|
6853
6983
|
sessionId: currentSessionId,
|
|
@@ -7113,63 +7243,6 @@ ${body}
|
|
|
7113
7243
|
]
|
|
7114
7244
|
});
|
|
7115
7245
|
}
|
|
7116
|
-
/** The floating two-button toolbar above a validated selection. */
|
|
7117
|
-
function SelectionToolbar(props) {
|
|
7118
|
-
useLocaleTick();
|
|
7119
|
-
if (!props.snapshot.source.body.isConnected || props.snapshot.range.getClientRects().length === 0) return null;
|
|
7120
|
-
const rect = props.snapshot.range.getBoundingClientRect();
|
|
7121
|
-
const clip = sourceClip(props.snapshot.source);
|
|
7122
|
-
const halfWidth = Math.min(props.sideChatAvailable ? 160 : 80, (clip.right - clip.left - 16) / 2);
|
|
7123
|
-
const left = Math.max(clip.left + halfWidth + 8, Math.min(clip.right - halfWidth - 8, rect.left + rect.width / 2));
|
|
7124
|
-
const flipBelow = rect.top < clip.top + 64;
|
|
7125
|
-
const selectionBottom = props.snapshot.range.getBoundingClientRect().bottom;
|
|
7126
|
-
const top = flipBelow ? Math.max(clip.top + 4, Math.min(clip.bottom - 48, selectionBottom + 10)) : Math.max(clip.top + 44, rect.top - 10);
|
|
7127
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
7128
|
-
className: flipBelow ? `${annotate_module_css_default.toolbar} ${annotate_module_css_default.toolbarBelow}` : annotate_module_css_default.toolbar,
|
|
7129
|
-
style: {
|
|
7130
|
-
left,
|
|
7131
|
-
top,
|
|
7132
|
-
maxWidth: Math.max(0, clip.right - clip.left - 16)
|
|
7133
|
-
},
|
|
7134
|
-
role: "toolbar",
|
|
7135
|
-
"aria-label": t("toolbarAria"),
|
|
7136
|
-
children: [
|
|
7137
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
7138
|
-
type: "button",
|
|
7139
|
-
className: annotate_module_css_default.toolbarButton,
|
|
7140
|
-
disabled: !props.addAvailable,
|
|
7141
|
-
title: !props.addAvailable ? t("quoteWorkflowWaiting") : void 0,
|
|
7142
|
-
onMouseDown: (event) => {
|
|
7143
|
-
event.preventDefault();
|
|
7144
|
-
},
|
|
7145
|
-
onClick: (event) => {
|
|
7146
|
-
event.preventDefault();
|
|
7147
|
-
event.stopPropagation();
|
|
7148
|
-
props.onAdd();
|
|
7149
|
-
},
|
|
7150
|
-
children: t("addToConversation")
|
|
7151
|
-
}),
|
|
7152
|
-
props.sideChatAvailable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
7153
|
-
type: "button",
|
|
7154
|
-
className: annotate_module_css_default.toolbarButton,
|
|
7155
|
-
onMouseDown: (event) => {
|
|
7156
|
-
event.preventDefault();
|
|
7157
|
-
},
|
|
7158
|
-
onClick: (event) => {
|
|
7159
|
-
event.preventDefault();
|
|
7160
|
-
event.stopPropagation();
|
|
7161
|
-
props.onAsk();
|
|
7162
|
-
},
|
|
7163
|
-
children: t("askInSideChat")
|
|
7164
|
-
}),
|
|
7165
|
-
!props.addAvailable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
7166
|
-
className: annotate_module_css_default.toolbarButton,
|
|
7167
|
-
role: "status",
|
|
7168
|
-
children: t("quoteWorkflowWaiting")
|
|
7169
|
-
})
|
|
7170
|
-
]
|
|
7171
|
-
});
|
|
7172
|
-
}
|
|
7173
7246
|
/** The badge layer (one numbered circle per annotation) + the active highlight. */
|
|
7174
7247
|
function BadgeLayer(props) {
|
|
7175
7248
|
const annotations = props.store.sessions().flatMap((id) => props.store.list(id));
|
|
@@ -7973,6 +8046,38 @@ ${body}
|
|
|
7973
8046
|
});
|
|
7974
8047
|
}
|
|
7975
8048
|
//#endregion
|
|
8049
|
+
//#region src/client/host/selection.tsx
|
|
8050
|
+
/** Coordinate the native surface with Sidenote's existing selection toolbar. */
|
|
8051
|
+
function registerNativeQuoteVisibility(ctx, preferences, ownsSelection) {
|
|
8052
|
+
const slots = ctx.slots;
|
|
8053
|
+
ctx.slots.inject("conversation.chat.text-interaction", () => {
|
|
8054
|
+
const patched = /* @__PURE__ */ new Map();
|
|
8055
|
+
const patch = () => {
|
|
8056
|
+
for (const entry of slots.entries("conversation.chat.text-interaction")) {
|
|
8057
|
+
if (entry.options.key !== "quote" || patched.has(entry)) continue;
|
|
8058
|
+
const Original = entry.component;
|
|
8059
|
+
const Wrapped = (props) => {
|
|
8060
|
+
const state = (0, react.useSyncExternalStore)(preferences.subscribe, preferences.getSnapshot);
|
|
8061
|
+
const sessionId = props.useSession((session) => session.sessionId);
|
|
8062
|
+
if (state.hidden || ownsSelection(sessionId)) return null;
|
|
8063
|
+
return (0, react.createElement)(Original, props);
|
|
8064
|
+
};
|
|
8065
|
+
entry.component = Wrapped;
|
|
8066
|
+
patched.set(entry, {
|
|
8067
|
+
original: Original,
|
|
8068
|
+
wrapped: Wrapped
|
|
8069
|
+
});
|
|
8070
|
+
}
|
|
8071
|
+
};
|
|
8072
|
+
patch();
|
|
8073
|
+
const unsubscribe = slots.subscribe("conversation.chat.text-interaction", patch);
|
|
8074
|
+
return () => {
|
|
8075
|
+
unsubscribe();
|
|
8076
|
+
for (const [entry, value] of patched) if (entry.component === value.wrapped) entry.component = value.original;
|
|
8077
|
+
};
|
|
8078
|
+
});
|
|
8079
|
+
}
|
|
8080
|
+
//#endregion
|
|
7976
8081
|
//#region src/client/annotate/index.tsx
|
|
7977
8082
|
/**
|
|
7978
8083
|
* 划选注释(Delivery_02 重构后):selection listener + numbered badges +
|
|
@@ -7988,7 +8093,7 @@ ${body}
|
|
|
7988
8093
|
* 否则重挂后双重挂载(两层工具条、双份监听、新旧 store 分裂)。slot 注册
|
|
7989
8094
|
* 的 disposer 由 cordis 服务代理路由进调用方 fiber,无需手动回收。
|
|
7990
8095
|
*/
|
|
7991
|
-
function registerAnnotations(ctx, reflow, store) {
|
|
8096
|
+
function registerAnnotations(ctx, reflow, store, preferences) {
|
|
7992
8097
|
ctx.effect(() => {
|
|
7993
8098
|
try {
|
|
7994
8099
|
const controller = createSelectionController(() => currentSessionIdOf(ctx));
|
|
@@ -7999,8 +8104,10 @@ ${body}
|
|
|
7999
8104
|
root.render(/* @__PURE__ */ (0, react_jsx_runtime.jsx)(AnnotateOverlay, {
|
|
8000
8105
|
ctx,
|
|
8001
8106
|
store,
|
|
8002
|
-
controller
|
|
8107
|
+
controller,
|
|
8108
|
+
preferences
|
|
8003
8109
|
}));
|
|
8110
|
+
registerNativeQuoteVisibility(ctx, preferences, (sessionId) => captureSelection(currentSessionIdOf(ctx))?.sessionId === sessionId);
|
|
8004
8111
|
registerNativeComposer(ctx, store, reflow);
|
|
8005
8112
|
registerUserContext(ctx);
|
|
8006
8113
|
ctx.slots.inject("conversation.input.dock", () => {
|
|
@@ -8098,13 +8205,174 @@ ${body}
|
|
|
8098
8205
|
registerSessionListFilter(ctx, visibility);
|
|
8099
8206
|
}
|
|
8100
8207
|
//#endregion
|
|
8208
|
+
//#region src/client/preferences.ts
|
|
8209
|
+
/** Share one host-backed value between every main and side conversation. */
|
|
8210
|
+
function createSidenotePreferences(form) {
|
|
8211
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
8212
|
+
let saving = false;
|
|
8213
|
+
let failed = false;
|
|
8214
|
+
const read = () => {
|
|
8215
|
+
const state = form.getSnapshot();
|
|
8216
|
+
return {
|
|
8217
|
+
hidden: state.value?.hideNativeQuote ?? true,
|
|
8218
|
+
status: state.status,
|
|
8219
|
+
writable: state.writable,
|
|
8220
|
+
saving,
|
|
8221
|
+
failed
|
|
8222
|
+
};
|
|
8223
|
+
};
|
|
8224
|
+
let snapshot = read();
|
|
8225
|
+
const publish = () => {
|
|
8226
|
+
snapshot = read();
|
|
8227
|
+
for (const listener of listeners) listener();
|
|
8228
|
+
};
|
|
8229
|
+
const unsubscribe = form.subscribe(publish);
|
|
8230
|
+
return {
|
|
8231
|
+
getSnapshot: () => snapshot,
|
|
8232
|
+
subscribe(listener) {
|
|
8233
|
+
listeners.add(listener);
|
|
8234
|
+
return () => {
|
|
8235
|
+
listeners.delete(listener);
|
|
8236
|
+
};
|
|
8237
|
+
},
|
|
8238
|
+
async setHidden(hidden) {
|
|
8239
|
+
if (saving || snapshot.status !== "ready" || !snapshot.writable) return;
|
|
8240
|
+
saving = true;
|
|
8241
|
+
failed = false;
|
|
8242
|
+
publish();
|
|
8243
|
+
try {
|
|
8244
|
+
failed = !await form.set("hideNativeQuote", hidden);
|
|
8245
|
+
} catch {
|
|
8246
|
+
failed = true;
|
|
8247
|
+
} finally {
|
|
8248
|
+
saving = false;
|
|
8249
|
+
publish();
|
|
8250
|
+
}
|
|
8251
|
+
},
|
|
8252
|
+
dispose() {
|
|
8253
|
+
unsubscribe();
|
|
8254
|
+
listeners.clear();
|
|
8255
|
+
}
|
|
8256
|
+
};
|
|
8257
|
+
}
|
|
8258
|
+
//#endregion
|
|
8259
|
+
//#region \0dsh-css:/home/runner/work/dsh-sidenote/dsh-sidenote/src/client/settings.module.css.mjs
|
|
8260
|
+
const css = "._2xJwMG_page{max-width:640px;color:var(--dsw-alias-label-primary,#1f2329);font-family:inherit}._2xJwMG_title{margin:0 0 8px;font-size:20px;font-weight:600;line-height:28px}._2xJwMG_description,._2xJwMG_hint,._2xJwMG_status{color:var(--dsw-alias-label-secondary,#646a73);font-size:13px;line-height:20px}._2xJwMG_description{margin:0 0 28px}._2xJwMG_row{border-top:1px solid var(--dsw-alias-border-l1,#00000014);border-bottom:1px solid var(--dsw-alias-border-l1,#00000014);align-items:center;gap:24px;padding:18px 0;display:flex}._2xJwMG_copy{flex:1;min-width:0}._2xJwMG_label{font-size:14px;font-weight:500;line-height:22px}._2xJwMG_hint{margin:4px 0 0}._2xJwMG_status,._2xJwMG_error{margin:12px 0 0}._2xJwMG_error{color:var(--dsw-alias-state-error-primary,#d53f3f);font-size:13px;line-height:20px}";
|
|
8261
|
+
const tagId = "dsh-sidenote/settings.module.css";
|
|
8262
|
+
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
|
8263
|
+
const tag = document.createElement("style");
|
|
8264
|
+
tag.dataset.plugin = "dsh-sidenote";
|
|
8265
|
+
tag.dataset.pluginCss = tagId;
|
|
8266
|
+
tag.textContent = css;
|
|
8267
|
+
document.head.appendChild(tag);
|
|
8268
|
+
}
|
|
8269
|
+
var settings_module_css_default = {
|
|
8270
|
+
"page": "_2xJwMG_page",
|
|
8271
|
+
"description": "_2xJwMG_description",
|
|
8272
|
+
"error": "_2xJwMG_error",
|
|
8273
|
+
"status": "_2xJwMG_status",
|
|
8274
|
+
"row": "_2xJwMG_row",
|
|
8275
|
+
"hint": "_2xJwMG_hint",
|
|
8276
|
+
"label": "_2xJwMG_label",
|
|
8277
|
+
"title": "_2xJwMG_title",
|
|
8278
|
+
"copy": "_2xJwMG_copy"
|
|
8279
|
+
};
|
|
8280
|
+
//#endregion
|
|
8281
|
+
//#region src/client/settings.tsx
|
|
8282
|
+
function SidenoteSettings({ preferences }) {
|
|
8283
|
+
useLocaleTick();
|
|
8284
|
+
const state = (0, react.useSyncExternalStore)(preferences.subscribe, preferences.getSnapshot);
|
|
8285
|
+
const id = (0, react.useId)();
|
|
8286
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
8287
|
+
className: settings_module_css_default.page,
|
|
8288
|
+
"aria-labelledby": `${id}-title`,
|
|
8289
|
+
children: [
|
|
8290
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", {
|
|
8291
|
+
id: `${id}-title`,
|
|
8292
|
+
className: settings_module_css_default.title,
|
|
8293
|
+
children: "Sidenote"
|
|
8294
|
+
}),
|
|
8295
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
8296
|
+
className: settings_module_css_default.description,
|
|
8297
|
+
children: t("settingsDescription")
|
|
8298
|
+
}),
|
|
8299
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
8300
|
+
className: settings_module_css_default.row,
|
|
8301
|
+
role: "group",
|
|
8302
|
+
"aria-labelledby": `${id}-label`,
|
|
8303
|
+
"aria-describedby": `${id}-description`,
|
|
8304
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
8305
|
+
className: settings_module_css_default.copy,
|
|
8306
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
8307
|
+
id: `${id}-label`,
|
|
8308
|
+
className: settings_module_css_default.label,
|
|
8309
|
+
children: t("hideNativeQuote")
|
|
8310
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
8311
|
+
id: `${id}-description`,
|
|
8312
|
+
className: settings_module_css_default.hint,
|
|
8313
|
+
children: t("hideNativeQuoteHint")
|
|
8314
|
+
})]
|
|
8315
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Switch, {
|
|
8316
|
+
checked: state.hidden,
|
|
8317
|
+
label: t("hideNativeQuote"),
|
|
8318
|
+
title: t("hideNativeQuoteHint"),
|
|
8319
|
+
disabled: state.status !== "ready" || !state.writable || state.saving,
|
|
8320
|
+
onChange: (hidden) => {
|
|
8321
|
+
preferences.setHidden(hidden);
|
|
8322
|
+
}
|
|
8323
|
+
})]
|
|
8324
|
+
}),
|
|
8325
|
+
state.saving && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
8326
|
+
className: settings_module_css_default.status,
|
|
8327
|
+
role: "status",
|
|
8328
|
+
children: t("settingsSaving")
|
|
8329
|
+
}),
|
|
8330
|
+
state.status === "loading" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
8331
|
+
className: settings_module_css_default.status,
|
|
8332
|
+
role: "status",
|
|
8333
|
+
children: t("settingsLoading")
|
|
8334
|
+
}),
|
|
8335
|
+
state.status === "unavailable" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
8336
|
+
className: settings_module_css_default.error,
|
|
8337
|
+
role: "alert",
|
|
8338
|
+
children: t("settingsUnavailable")
|
|
8339
|
+
}),
|
|
8340
|
+
state.status === "ready" && !state.writable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
8341
|
+
className: settings_module_css_default.status,
|
|
8342
|
+
role: "status",
|
|
8343
|
+
children: t("settingsReadOnly")
|
|
8344
|
+
}),
|
|
8345
|
+
state.failed && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
8346
|
+
className: settings_module_css_default.error,
|
|
8347
|
+
role: "alert",
|
|
8348
|
+
children: t("settingsSaveFailed")
|
|
8349
|
+
})
|
|
8350
|
+
]
|
|
8351
|
+
});
|
|
8352
|
+
}
|
|
8353
|
+
function registerSidenoteSettings(ctx, preferences) {
|
|
8354
|
+
ctx.slots.inject("settings.section", () => ctx.slots.register({
|
|
8355
|
+
name: "settings.section",
|
|
8356
|
+
id: "dsh-sidenote",
|
|
8357
|
+
label: "Sidenote",
|
|
8358
|
+
order: 80,
|
|
8359
|
+
registrant: "dsh-sidenote"
|
|
8360
|
+
}, () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidenoteSettings, { preferences })));
|
|
8361
|
+
ctx.slots.inject("settings.section.icon", () => ctx.slots.register({
|
|
8362
|
+
name: "settings.section.icon",
|
|
8363
|
+
id: "dsh-sidenote",
|
|
8364
|
+
registrant: "dsh-sidenote"
|
|
8365
|
+
}, ({ size }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconListPenOutline16, { size })));
|
|
8366
|
+
}
|
|
8367
|
+
//#endregion
|
|
8101
8368
|
//#region src/client/index.tsx
|
|
8102
8369
|
const inject = [
|
|
8103
8370
|
"sessions",
|
|
8104
8371
|
"workspaces",
|
|
8105
8372
|
"slots",
|
|
8106
8373
|
"connection",
|
|
8107
|
-
"locale"
|
|
8374
|
+
"locale",
|
|
8375
|
+
"configForms"
|
|
8108
8376
|
];
|
|
8109
8377
|
function apply(ctx) {
|
|
8110
8378
|
ctx.effect(() => {
|
|
@@ -8119,8 +8387,13 @@ ${body}
|
|
|
8119
8387
|
sweepOrphanedSideChatMeta();
|
|
8120
8388
|
const reflow = createReflowStore();
|
|
8121
8389
|
const annotations = createAnnotationStore();
|
|
8390
|
+
const preferences = createSidenotePreferences(ctx.get("configForms").get("side-chat"));
|
|
8391
|
+
ctx.effect(() => () => {
|
|
8392
|
+
preferences.dispose();
|
|
8393
|
+
}, "dsh-sidenote: preferences");
|
|
8394
|
+
registerSidenoteSettings(ctx, preferences);
|
|
8122
8395
|
registerSideChat(ctx, reflow, annotations);
|
|
8123
|
-
registerAnnotations(ctx, reflow, annotations);
|
|
8396
|
+
registerAnnotations(ctx, reflow, annotations, preferences);
|
|
8124
8397
|
}
|
|
8125
8398
|
//#endregion
|
|
8126
8399
|
exports.apply = apply;
|