dsh-zotero 0.3.0 → 0.3.1
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/lib/client.js +454 -545
- package/lib/client.js.map +4 -4
- package/lib/contract.d.ts +7 -45
- package/lib/contract.d.ts.map +1 -1
- package/lib/contract.js +7 -97
- package/lib/contract.js.map +1 -1
- package/lib/remote.d.ts +6 -28
- package/lib/remote.d.ts.map +1 -1
- package/lib/remote.js +5 -80
- package/lib/remote.js.map +1 -1
- package/lib/typert.d.ts +5 -6
- package/lib/typert.d.ts.map +1 -1
- package/lib/typert.js +6 -22
- package/lib/typert.js.map +1 -1
- package/package.json +28 -26
package/lib/client.js
CHANGED
|
@@ -5,8 +5,8 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __export = (target, all) => {
|
|
8
|
-
for (var
|
|
9
|
-
__defProp(target,
|
|
8
|
+
for (var name2 in all)
|
|
9
|
+
__defProp(target, name2, { get: all[name2], enumerable: true });
|
|
10
10
|
};
|
|
11
11
|
var __copyProps = (to, from, except, desc) => {
|
|
12
12
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
@@ -26,7 +26,8 @@ __export(index_exports, {
|
|
|
26
26
|
});
|
|
27
27
|
module.exports = __toCommonJS(index_exports);
|
|
28
28
|
|
|
29
|
-
// src/client/
|
|
29
|
+
// src/client/ZoteroPluginCard.tsx
|
|
30
|
+
var import_react = require("react");
|
|
30
31
|
var import_dsh_client_ui_primitives2 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
31
32
|
|
|
32
33
|
// src/client/fields.tsx
|
|
@@ -422,7 +423,6 @@ var BOOLEAN_FIELD_KEYS = new Set(
|
|
|
422
423
|
var ZoteroCardController = class {
|
|
423
424
|
form;
|
|
424
425
|
store;
|
|
425
|
-
scope;
|
|
426
426
|
/**
|
|
427
427
|
* @param scope - the bound settings scope for the `zotero` namespace. The
|
|
428
428
|
* seam types the section generically; the settings wire validates it
|
|
@@ -430,7 +430,6 @@ var ZoteroCardController = class {
|
|
|
430
430
|
* is the contract the host registration established.
|
|
431
431
|
*/
|
|
432
432
|
constructor(scope) {
|
|
433
|
-
this.scope = scope;
|
|
434
433
|
this.form = new CardForm(scope, FIELDS);
|
|
435
434
|
this.store = this.form.bind(() => this.projection());
|
|
436
435
|
}
|
|
@@ -440,7 +439,6 @@ var ZoteroCardController = class {
|
|
|
440
439
|
);
|
|
441
440
|
return {
|
|
442
441
|
...this.form.shell(),
|
|
443
|
-
loading: this.scope.getSnapshot().status === "loading",
|
|
444
442
|
...fields2
|
|
445
443
|
};
|
|
446
444
|
}
|
|
@@ -462,34 +460,8 @@ function groupFields(specs) {
|
|
|
462
460
|
return groups;
|
|
463
461
|
}
|
|
464
462
|
|
|
465
|
-
// src/client/
|
|
463
|
+
// src/client/ZoteroSettingsForm.tsx
|
|
466
464
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
467
|
-
var page = {
|
|
468
|
-
display: "flex",
|
|
469
|
-
flexDirection: "column",
|
|
470
|
-
gap: 14,
|
|
471
|
-
maxWidth: 640,
|
|
472
|
-
boxSizing: "border-box",
|
|
473
|
-
padding: "4px 2px"
|
|
474
|
-
};
|
|
475
|
-
var title = {
|
|
476
|
-
margin: 0,
|
|
477
|
-
color: "var(--dsw-alias-label-primary)",
|
|
478
|
-
fontSize: 20,
|
|
479
|
-
fontWeight: 600,
|
|
480
|
-
lineHeight: 1.3
|
|
481
|
-
};
|
|
482
|
-
var description = {
|
|
483
|
-
margin: 0,
|
|
484
|
-
color: "var(--dsw-alias-label-secondary)",
|
|
485
|
-
fontSize: 13,
|
|
486
|
-
lineHeight: 1.5
|
|
487
|
-
};
|
|
488
|
-
var status = {
|
|
489
|
-
margin: 0,
|
|
490
|
-
color: "var(--dsw-alias-label-secondary)",
|
|
491
|
-
fontSize: 13
|
|
492
|
-
};
|
|
493
465
|
var group = {
|
|
494
466
|
display: "flex",
|
|
495
467
|
flexDirection: "column",
|
|
@@ -510,46 +482,29 @@ var fields = {
|
|
|
510
482
|
flexDirection: "column",
|
|
511
483
|
gap: 4
|
|
512
484
|
};
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
}
|
|
536
|
-
const disabled = !state.writable;
|
|
537
|
-
const blocked = !state.dirty || state.invalid || state.saving;
|
|
538
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: page, children: [
|
|
539
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h2", { style: title, children: t("title") }),
|
|
540
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { style: description, children: t("description") }),
|
|
541
|
-
disabled ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { style: status, role: "status", children: t("readOnly") }) : null,
|
|
542
|
-
FIELD_GROUPS.map(({ key: groupKey, fields: keys }) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("section", { style: group, "aria-label": t(groupKey), children: [
|
|
543
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h3", { style: groupTitle, children: t(groupKey) }),
|
|
544
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { style: fields, children: keys.map((key) => field(props, state, key, t, disabled, NUMERIC_FIELD_KEYS.has(key))) })
|
|
545
|
-
] }, groupKey)),
|
|
546
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: footer, children: [
|
|
547
|
-
state.failed ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { style: failed, role: "status", children: t("saveFailed") }) : null,
|
|
548
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.Button, { variant: "primary", size: "md", disabled: blocked, onClick: props.save, children: t(state.saving ? "saving" : "save") })
|
|
549
|
-
] })
|
|
550
|
-
] });
|
|
551
|
-
}
|
|
552
|
-
function field(props, state, key, t, disabled, numeric) {
|
|
485
|
+
function ZoteroSettingsForm(props) {
|
|
486
|
+
const { t, state, actions } = props;
|
|
487
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, { children: FIELD_GROUPS.map(({ key: groupKey, fields: keys }) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("section", { style: group, "aria-label": t(groupKey), children: [
|
|
488
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h3", { style: groupTitle, children: t(groupKey) }),
|
|
489
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { style: fields, children: keys.map((key) => field(t, state, actions, key)) })
|
|
490
|
+
] }, groupKey)) });
|
|
491
|
+
}
|
|
492
|
+
function field(t, state, actions, key) {
|
|
493
|
+
const shared = {
|
|
494
|
+
overriddenLabel: t("overridden"),
|
|
495
|
+
resetLabel: t("reset"),
|
|
496
|
+
disabled: !state.writable,
|
|
497
|
+
...state[key],
|
|
498
|
+
// The web tab toggle's own state is its undo, so it carries no override
|
|
499
|
+
// marker (no badge, no reset); every other field keeps it.
|
|
500
|
+
overridden: key === "webEnabled" ? false : state[key].overridden,
|
|
501
|
+
onEdit: (text) => {
|
|
502
|
+
actions.edit(key, text);
|
|
503
|
+
},
|
|
504
|
+
onReset: () => {
|
|
505
|
+
actions.resetField(key);
|
|
506
|
+
}
|
|
507
|
+
};
|
|
553
508
|
if (BOOLEAN_FIELD_KEYS.has(key)) {
|
|
554
509
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
555
510
|
BooleanField,
|
|
@@ -557,16 +512,7 @@ function field(props, state, key, t, disabled, numeric) {
|
|
|
557
512
|
id: `zotero-settings-${key}`,
|
|
558
513
|
label: t(key),
|
|
559
514
|
hintLabel: t(`${key}Hint`),
|
|
560
|
-
|
|
561
|
-
resetLabel: t("reset"),
|
|
562
|
-
disabled,
|
|
563
|
-
...state[key],
|
|
564
|
-
onEdit: (text) => {
|
|
565
|
-
props.edit(key, text);
|
|
566
|
-
},
|
|
567
|
-
onReset: () => {
|
|
568
|
-
props.resetField(key);
|
|
569
|
-
}
|
|
515
|
+
...shared
|
|
570
516
|
},
|
|
571
517
|
key
|
|
572
518
|
);
|
|
@@ -577,25 +523,155 @@ function field(props, state, key, t, disabled, numeric) {
|
|
|
577
523
|
id: `zotero-settings-${key}`,
|
|
578
524
|
label: t(key),
|
|
579
525
|
hint: t(`${key}Hint`),
|
|
580
|
-
overriddenLabel: t("overridden"),
|
|
581
|
-
resetLabel: t("reset"),
|
|
582
526
|
invalidLabel: t("invalidNumber"),
|
|
583
|
-
numeric,
|
|
584
|
-
|
|
585
|
-
...state[key],
|
|
586
|
-
onEdit: (text) => {
|
|
587
|
-
props.edit(key, text);
|
|
588
|
-
},
|
|
589
|
-
onReset: () => {
|
|
590
|
-
props.resetField(key);
|
|
591
|
-
}
|
|
527
|
+
numeric: NUMERIC_FIELD_KEYS.has(key),
|
|
528
|
+
...shared
|
|
592
529
|
},
|
|
593
530
|
key
|
|
594
531
|
);
|
|
595
532
|
}
|
|
596
533
|
|
|
534
|
+
// src/client/ZoteroPluginCard.tsx
|
|
535
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
536
|
+
var card = {
|
|
537
|
+
listStyle: "none",
|
|
538
|
+
border: "1px solid var(--dsw-alias-border-l2)",
|
|
539
|
+
borderRadius: 12,
|
|
540
|
+
background: "var(--dsw-alias-bg-layer-3)"
|
|
541
|
+
};
|
|
542
|
+
var cardOpen = {
|
|
543
|
+
background: "var(--dsw-alias-bg-layer-2)",
|
|
544
|
+
borderColor: "var(--dsw-alias-label-dimmed)"
|
|
545
|
+
};
|
|
546
|
+
var header = {
|
|
547
|
+
width: "100%",
|
|
548
|
+
appearance: "none",
|
|
549
|
+
border: 0,
|
|
550
|
+
background: "none",
|
|
551
|
+
font: "inherit",
|
|
552
|
+
color: "inherit",
|
|
553
|
+
textAlign: "left",
|
|
554
|
+
cursor: "pointer",
|
|
555
|
+
display: "flex",
|
|
556
|
+
alignItems: "center",
|
|
557
|
+
gap: 12,
|
|
558
|
+
padding: "14px 16px",
|
|
559
|
+
borderRadius: 12
|
|
560
|
+
};
|
|
561
|
+
var headText = {
|
|
562
|
+
flex: 1,
|
|
563
|
+
minWidth: 0,
|
|
564
|
+
display: "flex",
|
|
565
|
+
flexDirection: "column",
|
|
566
|
+
gap: 4
|
|
567
|
+
};
|
|
568
|
+
var name = {
|
|
569
|
+
fontSize: 15,
|
|
570
|
+
fontWeight: 600,
|
|
571
|
+
lineHeight: 1.4,
|
|
572
|
+
color: "var(--dsw-alias-label-primary)"
|
|
573
|
+
};
|
|
574
|
+
var description = {
|
|
575
|
+
fontSize: 13,
|
|
576
|
+
lineHeight: 1.5,
|
|
577
|
+
color: "var(--dsw-alias-label-tertiary)"
|
|
578
|
+
};
|
|
579
|
+
var chevron = {
|
|
580
|
+
flex: "none",
|
|
581
|
+
color: "var(--dsw-alias-label-tertiary)"
|
|
582
|
+
};
|
|
583
|
+
var pending = {
|
|
584
|
+
flex: "none",
|
|
585
|
+
borderRadius: 999,
|
|
586
|
+
padding: "1px 8px",
|
|
587
|
+
fontSize: 11,
|
|
588
|
+
lineHeight: "17px",
|
|
589
|
+
fontWeight: 500,
|
|
590
|
+
whiteSpace: "nowrap",
|
|
591
|
+
background: "var(--dsw-alias-bg-module-platform)",
|
|
592
|
+
color: "var(--dsw-alias-label-secondary)"
|
|
593
|
+
};
|
|
594
|
+
var body = {
|
|
595
|
+
borderTop: "1px solid var(--dsw-alias-border-l2)",
|
|
596
|
+
margin: "0 16px",
|
|
597
|
+
padding: "12px 0 8px",
|
|
598
|
+
display: "flex",
|
|
599
|
+
flexDirection: "column",
|
|
600
|
+
gap: 10
|
|
601
|
+
};
|
|
602
|
+
var readOnly = {
|
|
603
|
+
margin: 0,
|
|
604
|
+
fontSize: 12,
|
|
605
|
+
lineHeight: 1.5,
|
|
606
|
+
color: "var(--dsw-alias-label-tertiary)"
|
|
607
|
+
};
|
|
608
|
+
var footer = {
|
|
609
|
+
display: "flex",
|
|
610
|
+
alignItems: "center",
|
|
611
|
+
justifyContent: "flex-end",
|
|
612
|
+
gap: 8,
|
|
613
|
+
paddingTop: 12,
|
|
614
|
+
borderTop: "1px solid var(--dsw-alias-border-l2)"
|
|
615
|
+
};
|
|
616
|
+
var failed = {
|
|
617
|
+
flex: 1,
|
|
618
|
+
minWidth: 0,
|
|
619
|
+
margin: 0,
|
|
620
|
+
fontSize: 12,
|
|
621
|
+
lineHeight: 1.5,
|
|
622
|
+
color: "var(--dsw-alias-label-error)"
|
|
623
|
+
};
|
|
624
|
+
function ZoteroPluginCard(props) {
|
|
625
|
+
const { t } = props;
|
|
626
|
+
const state = props.useZoteroCard((snapshot) => snapshot);
|
|
627
|
+
const [open, setOpen] = (0, import_react.useState)(false);
|
|
628
|
+
if (!state.available) return null;
|
|
629
|
+
const title = t("title");
|
|
630
|
+
const blocked = !state.dirty || state.invalid || state.saving;
|
|
631
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("li", { style: open ? { ...card, ...cardOpen } : card, children: [
|
|
632
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
633
|
+
"button",
|
|
634
|
+
{
|
|
635
|
+
type: "button",
|
|
636
|
+
style: header,
|
|
637
|
+
"aria-expanded": open,
|
|
638
|
+
"aria-label": `${t(open ? "collapse" : "expand")}: ${title}`,
|
|
639
|
+
onClick: () => {
|
|
640
|
+
setOpen(!open);
|
|
641
|
+
},
|
|
642
|
+
children: [
|
|
643
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { style: headText, children: [
|
|
644
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { style: name, children: title }),
|
|
645
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { style: description, children: t("description") })
|
|
646
|
+
] }),
|
|
647
|
+
state.dirty ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { style: pending, children: t("unsaved") }) : null,
|
|
648
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { style: open ? { ...chevron, transform: "rotate(180deg)" } : chevron, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_dsh_client_ui_primitives2.IconChevronDownOutline14, {}) })
|
|
649
|
+
]
|
|
650
|
+
}
|
|
651
|
+
),
|
|
652
|
+
open ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { style: body, children: [
|
|
653
|
+
!state.writable ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { style: readOnly, role: "status", children: t("readOnly") }) : null,
|
|
654
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ZoteroSettingsForm, { t, state, actions: props }),
|
|
655
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { style: footer, children: [
|
|
656
|
+
state.failed ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { style: failed, role: "status", children: t("saveFailed") }) : null,
|
|
657
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
658
|
+
import_dsh_client_ui_primitives2.Button,
|
|
659
|
+
{
|
|
660
|
+
variant: "outline",
|
|
661
|
+
size: "sm",
|
|
662
|
+
disabled: !state.dirty || state.saving,
|
|
663
|
+
onClick: props.discard,
|
|
664
|
+
children: t("discard")
|
|
665
|
+
}
|
|
666
|
+
),
|
|
667
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_dsh_client_ui_primitives2.Button, { variant: "primary", size: "sm", disabled: blocked, onClick: props.save, children: t(state.saving ? "saving" : "save") })
|
|
668
|
+
] })
|
|
669
|
+
] }) : null
|
|
670
|
+
] });
|
|
671
|
+
}
|
|
672
|
+
|
|
597
673
|
// src/client/ZoteroTab.tsx
|
|
598
|
-
var
|
|
674
|
+
var import_react5 = require("react");
|
|
599
675
|
|
|
600
676
|
// node_modules/clsx/dist/clsx.mjs
|
|
601
677
|
function r(e) {
|
|
@@ -671,8 +747,8 @@ function rowStateOf(block) {
|
|
|
671
747
|
}
|
|
672
748
|
function titleOf(block, fallback) {
|
|
673
749
|
const view = viewOf(block);
|
|
674
|
-
const
|
|
675
|
-
return
|
|
750
|
+
const title = view?.card === "generic" && view.title !== "" ? view.title : void 0;
|
|
751
|
+
return title ?? fallback;
|
|
676
752
|
}
|
|
677
753
|
function viewOf(block) {
|
|
678
754
|
return block.callView ?? null;
|
|
@@ -738,11 +814,11 @@ function scopeFactOf(args) {
|
|
|
738
814
|
const scope = args["scope"];
|
|
739
815
|
if (isRecord(scope)) {
|
|
740
816
|
const kind = scope["kind"];
|
|
741
|
-
const
|
|
742
|
-
if (kind === "collection" && typeof
|
|
743
|
-
return `collection:${
|
|
744
|
-
if (kind === "savedSearch" && typeof
|
|
745
|
-
return `savedSearch:${
|
|
817
|
+
const name2 = scope["refOrName"];
|
|
818
|
+
if (kind === "collection" && typeof name2 === "string" && name2 !== "")
|
|
819
|
+
return `collection:${name2}`;
|
|
820
|
+
if (kind === "savedSearch" && typeof name2 === "string" && name2 !== "")
|
|
821
|
+
return `savedSearch:${name2}`;
|
|
746
822
|
}
|
|
747
823
|
return `library:${mode}`;
|
|
748
824
|
}
|
|
@@ -753,13 +829,13 @@ function searchRowsOf(meta3) {
|
|
|
753
829
|
for (const item of items) {
|
|
754
830
|
if (!isRecord(item)) return null;
|
|
755
831
|
const ref = stringField(item, "ref");
|
|
756
|
-
const
|
|
832
|
+
const title = stringField(item, "title");
|
|
757
833
|
const creatorSummary = stringField(item, "creatorSummary");
|
|
758
834
|
const itemType = stringField(item, "itemType");
|
|
759
|
-
if (ref === void 0 ||
|
|
835
|
+
if (ref === void 0 || title === void 0 || creatorSummary === void 0 || itemType === void 0)
|
|
760
836
|
return null;
|
|
761
837
|
const year = numberField2(item, "year");
|
|
762
|
-
rows.push({ ref, title
|
|
838
|
+
rows.push({ ref, title, creatorSummary, ...year === void 0 ? {} : { year }, itemType });
|
|
763
839
|
}
|
|
764
840
|
return rows;
|
|
765
841
|
}
|
|
@@ -930,12 +1006,12 @@ function buildCorpus(blocks) {
|
|
|
930
1006
|
if (draft === null) break;
|
|
931
1007
|
draft.usage.read = true;
|
|
932
1008
|
if (meta3 === null) break;
|
|
933
|
-
const
|
|
1009
|
+
const title = stringField(meta3, "title");
|
|
934
1010
|
const creators = stringField(meta3, "creators");
|
|
935
1011
|
const venue = stringField(meta3, "venue");
|
|
936
1012
|
const year = numberField2(meta3, "year");
|
|
937
1013
|
const itemType = stringField(meta3, "itemType");
|
|
938
|
-
if (
|
|
1014
|
+
if (title !== void 0) draft.title = title;
|
|
939
1015
|
if (creators !== void 0) draft.creators = creators;
|
|
940
1016
|
if (venue !== void 0) draft.venue = venue;
|
|
941
1017
|
if (year !== void 0) draft.year = year;
|
|
@@ -961,9 +1037,9 @@ function buildCorpus(blocks) {
|
|
|
961
1037
|
const kind = stringField(meta3, "kind") === "url" ? "url" : "file";
|
|
962
1038
|
const contentType = stringField(meta3, "contentType");
|
|
963
1039
|
if (contentType === void 0) break;
|
|
964
|
-
const
|
|
1040
|
+
const title = stringField(meta3, "title") ?? "";
|
|
965
1041
|
const location = kind === "file" ? stringField(meta3, "path") ?? "" : stringField(meta3, "url") ?? "";
|
|
966
|
-
draft.attachment = { kind, contentType, title
|
|
1042
|
+
draft.attachment = { kind, contentType, title, location };
|
|
967
1043
|
break;
|
|
968
1044
|
}
|
|
969
1045
|
case "zotero_export": {
|
|
@@ -1036,15 +1112,15 @@ function citeCommandOf(keys) {
|
|
|
1036
1112
|
}
|
|
1037
1113
|
|
|
1038
1114
|
// src/client/ZoteroCiteLens.tsx
|
|
1039
|
-
var
|
|
1115
|
+
var import_react4 = require("react");
|
|
1040
1116
|
var import_dsh_client_ui_primitives5 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
1041
1117
|
|
|
1042
1118
|
// src/client/ZoteroToolViews.tsx
|
|
1043
|
-
var
|
|
1119
|
+
var import_react3 = require("react");
|
|
1044
1120
|
var import_dsh_client_ui_primitives4 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
1045
1121
|
|
|
1046
1122
|
// src/client/ZoteroToolRow.tsx
|
|
1047
|
-
var
|
|
1123
|
+
var import_react2 = require("react");
|
|
1048
1124
|
var import_dsh_client_ui_primitives3 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
1049
1125
|
|
|
1050
1126
|
// src/client/ZoteroToolRow.module.css
|
|
@@ -1055,14 +1131,14 @@ if (typeof document !== "undefined" && !document.querySelector('style[data-plugi
|
|
|
1055
1131
|
tag.textContent = style;
|
|
1056
1132
|
document.head.appendChild(tag);
|
|
1057
1133
|
}
|
|
1058
|
-
var ZoteroToolRow_default = { "
|
|
1134
|
+
var ZoteroToolRow_default = { "chevron": "cYA8PW_chevron", "chevronOpen": "cYA8PW_chevronOpen", "iconIdle": "cYA8PW_iconIdle", "tag": "cYA8PW_tag", "line": "cYA8PW_line", "sep": "cYA8PW_sep", "summary": "cYA8PW_summary", "factGroup": "cYA8PW_factGroup", "title": "cYA8PW_title", "actions": "cYA8PW_actions", "zotero-row-sweep": "cYA8PW_zotero-row-sweep", "chevronHover": "cYA8PW_chevronHover", "leading": "cYA8PW_leading", "root": "cYA8PW_root", "fact": "cYA8PW_fact", "chevronEnd": "cYA8PW_chevronEnd", "summaryPrimary": "cYA8PW_summaryPrimary", "trailing": "cYA8PW_trailing", "bodyWrap": "cYA8PW_bodyWrap", "visuallyHidden": "cYA8PW_visuallyHidden", "card": "cYA8PW_card", "errorSummary": "cYA8PW_errorSummary" };
|
|
1059
1135
|
|
|
1060
1136
|
// src/client/ZoteroToolRow.tsx
|
|
1061
|
-
var
|
|
1137
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
1062
1138
|
function ZoteroToolRow(props) {
|
|
1063
1139
|
const {
|
|
1064
1140
|
state,
|
|
1065
|
-
title
|
|
1141
|
+
title,
|
|
1066
1142
|
summary,
|
|
1067
1143
|
tag,
|
|
1068
1144
|
icon,
|
|
@@ -1076,7 +1152,7 @@ function ZoteroToolRow(props) {
|
|
|
1076
1152
|
actions,
|
|
1077
1153
|
children
|
|
1078
1154
|
} = props;
|
|
1079
|
-
const [expanded, setExpanded] = (0,
|
|
1155
|
+
const [expanded, setExpanded] = (0, import_react2.useState)(false);
|
|
1080
1156
|
const open = expanded && expandable;
|
|
1081
1157
|
const toggle2 = () => {
|
|
1082
1158
|
setExpanded((value) => !value);
|
|
@@ -1086,15 +1162,15 @@ function ZoteroToolRow(props) {
|
|
|
1086
1162
|
event.preventDefault();
|
|
1087
1163
|
toggle2();
|
|
1088
1164
|
};
|
|
1089
|
-
const
|
|
1165
|
+
const status = state === "running" ? runningLabel : state === "error" ? errorLabel : state === "stopped" ? stoppedLabel : null;
|
|
1090
1166
|
const visibleFacts = facts.filter((fact) => fact !== "");
|
|
1091
|
-
const leading = tag === void 0 ? open ? /* @__PURE__ */ (0,
|
|
1092
|
-
/* @__PURE__ */ (0,
|
|
1093
|
-
/* @__PURE__ */ (0,
|
|
1094
|
-
] }) : state === "error" || state === "stopped" ? /* @__PURE__ */ (0,
|
|
1095
|
-
return /* @__PURE__ */ (0,
|
|
1096
|
-
/* @__PURE__ */ (0,
|
|
1097
|
-
/* @__PURE__ */ (0,
|
|
1167
|
+
const leading = tag === void 0 ? open ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives3.IconChevronDownOutline14, { className: ZoteroToolRow_default.chevron }) : expandable ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
1168
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: ZoteroToolRow_default.iconIdle, children: state === "error" || state === "stopped" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives3.StateDot, { state: state === "error" ? "error" : "warning" }) : icon }),
|
|
1169
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives3.IconChevronDownOutline14, { className: clsx_default(ZoteroToolRow_default.chevron, ZoteroToolRow_default.chevronHover) })
|
|
1170
|
+
] }) : state === "error" || state === "stopped" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives3.StateDot, { state: state === "error" ? "error" : "warning" }) : icon : null;
|
|
1171
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: ZoteroToolRow_default.card, children: [
|
|
1172
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: ZoteroToolRow_default.line, children: [
|
|
1173
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
1098
1174
|
"div",
|
|
1099
1175
|
{
|
|
1100
1176
|
className: ZoteroToolRow_default.root,
|
|
@@ -1104,19 +1180,19 @@ function ZoteroToolRow(props) {
|
|
|
1104
1180
|
"data-tag": tag !== void 0 || void 0,
|
|
1105
1181
|
role: expandable ? "button" : void 0,
|
|
1106
1182
|
tabIndex: expandable ? 0 : void 0,
|
|
1107
|
-
title
|
|
1183
|
+
title,
|
|
1108
1184
|
"aria-busy": state === "running",
|
|
1109
1185
|
"aria-expanded": expandable ? open : void 0,
|
|
1110
1186
|
onClick: expandable ? toggle2 : void 0,
|
|
1111
1187
|
onKeyDown: expandable ? toggleFromKeyboard : void 0,
|
|
1112
1188
|
children: [
|
|
1113
|
-
tag !== void 0 ? /* @__PURE__ */ (0,
|
|
1114
|
-
/* @__PURE__ */ (0,
|
|
1115
|
-
/* @__PURE__ */ (0,
|
|
1116
|
-
/* @__PURE__ */ (0,
|
|
1189
|
+
tag !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: ZoteroToolRow_default.tag, "data-kind": tag.kind, "data-state": state, children: tag.label }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
1190
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: ZoteroToolRow_default.leading, children: leading }),
|
|
1191
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: ZoteroToolRow_default.title, children: title }),
|
|
1192
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: ZoteroToolRow_default.sep, "aria-hidden": true })
|
|
1117
1193
|
] }),
|
|
1118
|
-
|
|
1119
|
-
/* @__PURE__ */ (0,
|
|
1194
|
+
status !== null && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: ZoteroToolRow_default.visuallyHidden, children: status }),
|
|
1195
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1120
1196
|
"span",
|
|
1121
1197
|
{
|
|
1122
1198
|
className: clsx_default(
|
|
@@ -1127,18 +1203,18 @@ function ZoteroToolRow(props) {
|
|
|
1127
1203
|
children: errorSummary ?? summary
|
|
1128
1204
|
}
|
|
1129
1205
|
),
|
|
1130
|
-
visibleFacts.map((fact, index) => /* @__PURE__ */ (0,
|
|
1131
|
-
/* @__PURE__ */ (0,
|
|
1132
|
-
/* @__PURE__ */ (0,
|
|
1206
|
+
visibleFacts.map((fact, index) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: ZoteroToolRow_default.factGroup, children: [
|
|
1207
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: ZoteroToolRow_default.sep, "aria-hidden": true }),
|
|
1208
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: ZoteroToolRow_default.fact, children: fact })
|
|
1133
1209
|
] }, `${fact}-${index}`)),
|
|
1134
|
-
trailing !== void 0 && trailing !== null && /* @__PURE__ */ (0,
|
|
1135
|
-
tag !== void 0 && expandable && /* @__PURE__ */ (0,
|
|
1210
|
+
trailing !== void 0 && trailing !== null && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: ZoteroToolRow_default.trailing, children: trailing }),
|
|
1211
|
+
tag !== void 0 && expandable && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: clsx_default(ZoteroToolRow_default.chevronEnd, open ? ZoteroToolRow_default.chevronOpen : ZoteroToolRow_default.chevronHover), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives3.IconChevronDownOutline14, { className: ZoteroToolRow_default.chevron }) })
|
|
1136
1212
|
]
|
|
1137
1213
|
}
|
|
1138
1214
|
),
|
|
1139
|
-
actions !== void 0 && actions !== null && /* @__PURE__ */ (0,
|
|
1215
|
+
actions !== void 0 && actions !== null && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: ZoteroToolRow_default.actions, children: actions })
|
|
1140
1216
|
] }),
|
|
1141
|
-
open && /* @__PURE__ */ (0,
|
|
1217
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: ZoteroToolRow_default.bodyWrap, children })
|
|
1142
1218
|
] });
|
|
1143
1219
|
}
|
|
1144
1220
|
|
|
@@ -1150,18 +1226,18 @@ if (typeof document !== "undefined" && !document.querySelector('style[data-plugi
|
|
|
1150
1226
|
tag.textContent = style2;
|
|
1151
1227
|
document.head.appendChild(tag);
|
|
1152
1228
|
}
|
|
1153
|
-
var ZoteroToolViews_default = { "
|
|
1229
|
+
var ZoteroToolViews_default = { "rows": "yIyarq_rows", "previewGroupLabel": "yIyarq_previewGroupLabel", "evidenceRow": "yIyarq_evidenceRow", "previewLabel": "yIyarq_previewLabel", "previewText": "yIyarq_previewText", "fallback": "yIyarq_fallback", "plainCode": "yIyarq_plainCode", "evidenceHead": "yIyarq_evidenceHead", "expandButton": "yIyarq_expandButton", "evidenceFlag": "yIyarq_evidenceFlag", "copyButton": "yIyarq_copyButton", "previewRow": "yIyarq_previewRow", "evidenceTextClamped": "yIyarq_evidenceTextClamped", "resultRow": "yIyarq_resultRow", "evidenceRef": "yIyarq_evidenceRef", "evidenceSource": "yIyarq_evidenceSource", "omitted": "yIyarq_omitted", "evidenceText": "yIyarq_evidenceText", "targetText": "yIyarq_targetText", "targetRow": "yIyarq_targetRow", "actionButton": "yIyarq_actionButton", "codeBlock": "yIyarq_codeBlock", "resultText": "yIyarq_resultText" };
|
|
1154
1230
|
|
|
1155
1231
|
// src/client/ZoteroToolViews.tsx
|
|
1156
|
-
var
|
|
1232
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
1157
1233
|
function CopyValue({
|
|
1158
1234
|
value,
|
|
1159
1235
|
t,
|
|
1160
1236
|
label
|
|
1161
1237
|
}) {
|
|
1162
|
-
const [copied, setCopied] = (0,
|
|
1163
|
-
const timer = (0,
|
|
1164
|
-
(0,
|
|
1238
|
+
const [copied, setCopied] = (0, import_react3.useState)(false);
|
|
1239
|
+
const timer = (0, import_react3.useRef)(void 0);
|
|
1240
|
+
(0, import_react3.useEffect)(
|
|
1165
1241
|
() => () => {
|
|
1166
1242
|
if (timer.current !== void 0) clearTimeout(timer.current);
|
|
1167
1243
|
},
|
|
@@ -1174,7 +1250,7 @@ function CopyValue({
|
|
|
1174
1250
|
setCopied(false);
|
|
1175
1251
|
}, 1e3);
|
|
1176
1252
|
};
|
|
1177
|
-
return /* @__PURE__ */ (0,
|
|
1253
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
1178
1254
|
"button",
|
|
1179
1255
|
{
|
|
1180
1256
|
type: "button",
|
|
@@ -1184,27 +1260,27 @@ function CopyValue({
|
|
|
1184
1260
|
},
|
|
1185
1261
|
"aria-label": label ?? t("copy"),
|
|
1186
1262
|
children: [
|
|
1187
|
-
/* @__PURE__ */ (0,
|
|
1263
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_dsh_client_ui_primitives4.IconCopyOutline16, { size: 14 }),
|
|
1188
1264
|
copied ? t("copied") : label ?? t("copy")
|
|
1189
1265
|
]
|
|
1190
1266
|
}
|
|
1191
1267
|
);
|
|
1192
1268
|
}
|
|
1193
1269
|
function FallbackBody({ text }) {
|
|
1194
|
-
return /* @__PURE__ */ (0,
|
|
1270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("pre", { className: ZoteroToolViews_default.fallback, children: text });
|
|
1195
1271
|
}
|
|
1196
1272
|
function SearchResultRow({ row: row2, t }) {
|
|
1197
1273
|
const creator = row2.creatorSummary === "" ? "" : ` \xB7 ${row2.creatorSummary}`;
|
|
1198
1274
|
const year = row2.year === void 0 ? "" : ` \xB7 ${row2.year}`;
|
|
1199
|
-
return /* @__PURE__ */ (0,
|
|
1200
|
-
/* @__PURE__ */ (0,
|
|
1275
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: ZoteroToolViews_default.resultRow, children: [
|
|
1276
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: ZoteroToolViews_default.resultText, title: row2.title, children: [
|
|
1201
1277
|
row2.title,
|
|
1202
1278
|
creator,
|
|
1203
1279
|
year,
|
|
1204
1280
|
" \xB7 ",
|
|
1205
1281
|
row2.itemType
|
|
1206
1282
|
] }),
|
|
1207
|
-
/* @__PURE__ */ (0,
|
|
1283
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CopyValue, { value: row2.ref, t })
|
|
1208
1284
|
] });
|
|
1209
1285
|
}
|
|
1210
1286
|
function ChildPreviewRow({
|
|
@@ -1212,32 +1288,32 @@ function ChildPreviewRow({
|
|
|
1212
1288
|
label,
|
|
1213
1289
|
t
|
|
1214
1290
|
}) {
|
|
1215
|
-
const
|
|
1216
|
-
return /* @__PURE__ */ (0,
|
|
1217
|
-
/* @__PURE__ */ (0,
|
|
1291
|
+
const page = preview.pageLabel === void 0 ? "" : ` ${t("pageLabel").replace("{label}", preview.pageLabel)}`;
|
|
1292
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: ZoteroToolViews_default.previewRow, children: [
|
|
1293
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: ZoteroToolViews_default.previewLabel, children: [
|
|
1218
1294
|
label,
|
|
1219
|
-
|
|
1295
|
+
page
|
|
1220
1296
|
] }),
|
|
1221
|
-
/* @__PURE__ */ (0,
|
|
1222
|
-
/* @__PURE__ */ (0,
|
|
1297
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: ZoteroToolViews_default.previewText, children: preview.preview }),
|
|
1298
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CopyValue, { value: preview.ref, t })
|
|
1223
1299
|
] });
|
|
1224
1300
|
}
|
|
1225
1301
|
function EvidenceRow({
|
|
1226
1302
|
item,
|
|
1227
1303
|
t
|
|
1228
1304
|
}) {
|
|
1229
|
-
const [open, setOpen] = (0,
|
|
1305
|
+
const [open, setOpen] = (0, import_react3.useState)(false);
|
|
1230
1306
|
const sourceLabel = t(sourceKeyOf(item.source));
|
|
1231
|
-
const
|
|
1232
|
-
return /* @__PURE__ */ (0,
|
|
1233
|
-
/* @__PURE__ */ (0,
|
|
1234
|
-
/* @__PURE__ */ (0,
|
|
1307
|
+
const page = item.pageLabel === void 0 ? "" : ` \xB7 ${t("pageLabel").replace("{label}", item.pageLabel)}`;
|
|
1308
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: ZoteroToolViews_default.evidenceRow, children: [
|
|
1309
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: ZoteroToolViews_default.evidenceHead, children: [
|
|
1310
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: ZoteroToolViews_default.evidenceSource, children: [
|
|
1235
1311
|
sourceLabel,
|
|
1236
|
-
|
|
1312
|
+
page
|
|
1237
1313
|
] }),
|
|
1238
|
-
/* @__PURE__ */ (0,
|
|
1239
|
-
item.previewTruncated && /* @__PURE__ */ (0,
|
|
1240
|
-
/* @__PURE__ */ (0,
|
|
1314
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: ZoteroToolViews_default.evidenceRef, title: item.sourceRef, children: shortKeyOf(item.sourceRef) ?? item.sourceRef }),
|
|
1315
|
+
item.previewTruncated && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: ZoteroToolViews_default.evidenceFlag, children: t("truncatedPreview") }),
|
|
1316
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1241
1317
|
"button",
|
|
1242
1318
|
{
|
|
1243
1319
|
type: "button",
|
|
@@ -1251,7 +1327,7 @@ function EvidenceRow({
|
|
|
1251
1327
|
}
|
|
1252
1328
|
)
|
|
1253
1329
|
] }),
|
|
1254
|
-
/* @__PURE__ */ (0,
|
|
1330
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: clsx_default(ZoteroToolViews_default.evidenceText, !open && ZoteroToolViews_default.evidenceTextClamped), children: item.preview })
|
|
1255
1331
|
] });
|
|
1256
1332
|
}
|
|
1257
1333
|
function sourceKeyOf(source) {
|
|
@@ -1276,12 +1352,12 @@ function plainTextOf(html, cap) {
|
|
|
1276
1352
|
}
|
|
1277
1353
|
function ExportBody({ format, text, t, copy = true }) {
|
|
1278
1354
|
if (format === "citation" || format === "bibliography") {
|
|
1279
|
-
return /* @__PURE__ */ (0,
|
|
1355
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("pre", { className: ZoteroToolViews_default.fallback, children: plainTextOf(text, PLAIN_PREVIEW_CAP) });
|
|
1280
1356
|
}
|
|
1281
1357
|
if (!copy) {
|
|
1282
|
-
return /* @__PURE__ */ (0,
|
|
1358
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("pre", { className: ZoteroToolViews_default.plainCode, children: text });
|
|
1283
1359
|
}
|
|
1284
|
-
return /* @__PURE__ */ (0,
|
|
1360
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1285
1361
|
import_dsh_client_ui_primitives4.CodeBlock,
|
|
1286
1362
|
{
|
|
1287
1363
|
code: text,
|
|
@@ -1305,11 +1381,11 @@ function ZoteroSearchRow({ block, t }) {
|
|
|
1305
1381
|
if (state === "running" && scope !== void 0) {
|
|
1306
1382
|
const parts = scope.split(":");
|
|
1307
1383
|
const kind = parts.shift();
|
|
1308
|
-
const
|
|
1384
|
+
const name2 = parts.join(":");
|
|
1309
1385
|
facts.push(
|
|
1310
1386
|
kind === "collection" || kind === "savedSearch" ? interpolate(t(kind === "collection" ? "scopeCollection" : "scopeSavedSearch"), {
|
|
1311
|
-
name
|
|
1312
|
-
}) : kind === "library" &&
|
|
1387
|
+
name: name2
|
|
1388
|
+
}) : kind === "library" && name2 === "everything" ? t("scopeLibraryEverything") : t("scopeLibraryMetadata")
|
|
1313
1389
|
);
|
|
1314
1390
|
}
|
|
1315
1391
|
if (state === "error" && "error" in block && block.error?.code === "ZOTERO_SERVER_MISMATCH") {
|
|
@@ -1318,7 +1394,7 @@ function ZoteroSearchRow({ block, t }) {
|
|
|
1318
1394
|
const omitted = counts?.omitted ?? 0;
|
|
1319
1395
|
const fullText = resultTextOf(block);
|
|
1320
1396
|
const truncatedProjection = omitted > 0;
|
|
1321
|
-
return /* @__PURE__ */ (0,
|
|
1397
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1322
1398
|
ZoteroToolRow,
|
|
1323
1399
|
{
|
|
1324
1400
|
state,
|
|
@@ -1331,9 +1407,9 @@ function ZoteroSearchRow({ block, t }) {
|
|
|
1331
1407
|
runningLabel: t("checking"),
|
|
1332
1408
|
errorLabel: t("statusUnavailable"),
|
|
1333
1409
|
stoppedLabel: t("statusUnavailable"),
|
|
1334
|
-
children: rows !== null && !truncatedProjection ? /* @__PURE__ */ (0,
|
|
1335
|
-
rows.map((row2) => /* @__PURE__ */ (0,
|
|
1336
|
-
/* @__PURE__ */ (0,
|
|
1410
|
+
children: rows !== null && !truncatedProjection ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: ZoteroToolViews_default.rows, children: rows.map((row2) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SearchResultRow, { row: row2, t }, row2.ref)) }) : fullText !== null ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(FallbackBody, { text: fullText }) : rows !== null ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: ZoteroToolViews_default.rows, children: [
|
|
1411
|
+
rows.map((row2) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SearchResultRow, { row: row2, t }, row2.ref)),
|
|
1412
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: ZoteroToolViews_default.omitted, children: interpolate(t("moreOmitted"), { count: omitted }) })
|
|
1337
1413
|
] }) : null
|
|
1338
1414
|
}
|
|
1339
1415
|
);
|
|
@@ -1354,8 +1430,8 @@ function ZoteroGetRow({ block, t }) {
|
|
|
1354
1430
|
const annotationsTotal = isRecord(annotationsMeta) ? numberField2(annotationsMeta, "total") : void 0;
|
|
1355
1431
|
const facts = [];
|
|
1356
1432
|
if (state !== "running") {
|
|
1357
|
-
const
|
|
1358
|
-
if (
|
|
1433
|
+
const header2 = joinNonEmpty(creators, year, venue);
|
|
1434
|
+
if (header2 !== "") facts.push(header2);
|
|
1359
1435
|
const pdf = stringField(meta3 ?? {}, "bestAttachmentContentType") === "application/pdf" ? "PDF" : "";
|
|
1360
1436
|
const counts = joinNonEmpty(
|
|
1361
1437
|
notesTotal === void 0 ? "" : `${notesTotal} ${t("personalNotes").toLowerCase()}`,
|
|
@@ -1369,7 +1445,7 @@ function ZoteroGetRow({ block, t }) {
|
|
|
1369
1445
|
const annotationsComplete = annotationsTotal === void 0 || annotations !== null && annotations.length >= annotationsTotal;
|
|
1370
1446
|
const truncatedProjection = !notesComplete || !annotationsComplete;
|
|
1371
1447
|
const hasBody = notes !== null && notes.length > 0 || annotations !== null && annotations.length > 0 || fullText !== null;
|
|
1372
|
-
return /* @__PURE__ */ (0,
|
|
1448
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1373
1449
|
ZoteroToolRow,
|
|
1374
1450
|
{
|
|
1375
1451
|
state,
|
|
@@ -1382,14 +1458,14 @@ function ZoteroGetRow({ block, t }) {
|
|
|
1382
1458
|
runningLabel: t("checking"),
|
|
1383
1459
|
errorLabel: t("statusUnavailable"),
|
|
1384
1460
|
stoppedLabel: t("statusUnavailable"),
|
|
1385
|
-
children: truncatedProjection && fullText !== null ? /* @__PURE__ */ (0,
|
|
1386
|
-
notes !== null && notes.length > 0 && /* @__PURE__ */ (0,
|
|
1387
|
-
/* @__PURE__ */ (0,
|
|
1388
|
-
notes.map((note) => /* @__PURE__ */ (0,
|
|
1461
|
+
children: truncatedProjection && fullText !== null ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(FallbackBody, { text: fullText }) : notes === null && annotations === null ? fullText !== null && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(FallbackBody, { text: fullText }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: ZoteroToolViews_default.rows, children: [
|
|
1462
|
+
notes !== null && notes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
1463
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: ZoteroToolViews_default.previewGroupLabel, children: t("personalNotes") }),
|
|
1464
|
+
notes.map((note) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ChildPreviewRow, { preview: note, label: t("personalNotes"), t }, note.ref))
|
|
1389
1465
|
] }),
|
|
1390
|
-
annotations !== null && annotations.length > 0 && /* @__PURE__ */ (0,
|
|
1391
|
-
/* @__PURE__ */ (0,
|
|
1392
|
-
annotations.map((annotation) => /* @__PURE__ */ (0,
|
|
1466
|
+
annotations !== null && annotations.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
1467
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: ZoteroToolViews_default.previewGroupLabel, children: t("personalAnnotations") }),
|
|
1468
|
+
annotations.map((annotation) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1393
1469
|
ChildPreviewRow,
|
|
1394
1470
|
{
|
|
1395
1471
|
preview: annotation,
|
|
@@ -1424,7 +1500,7 @@ function ZoteroRetrieveRow({ block, t }) {
|
|
|
1424
1500
|
const sourcesSkipped = meta3 !== null && Array.isArray(meta3["sourcesSkipped"]) && meta3["sourcesSkipped"].length > 0;
|
|
1425
1501
|
const truncatedProjection = truncated || sourcesSkipped;
|
|
1426
1502
|
const hasBody = items !== null || fullText !== null;
|
|
1427
|
-
return /* @__PURE__ */ (0,
|
|
1503
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1428
1504
|
ZoteroToolRow,
|
|
1429
1505
|
{
|
|
1430
1506
|
state,
|
|
@@ -1437,9 +1513,9 @@ function ZoteroRetrieveRow({ block, t }) {
|
|
|
1437
1513
|
runningLabel: t("checking"),
|
|
1438
1514
|
errorLabel: t("statusUnavailable"),
|
|
1439
1515
|
stoppedLabel: t("statusUnavailable"),
|
|
1440
|
-
children: items !== null && !truncatedProjection ? /* @__PURE__ */ (0,
|
|
1441
|
-
items.map((item, index) => /* @__PURE__ */ (0,
|
|
1442
|
-
truncated && /* @__PURE__ */ (0,
|
|
1516
|
+
children: items !== null && !truncatedProjection ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: ZoteroToolViews_default.rows, children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(EvidenceRow, { item, t }, `${item.sourceRef}-${index}`)) }) : fullText !== null ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(FallbackBody, { text: fullText }) : items !== null ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: ZoteroToolViews_default.rows, children: [
|
|
1517
|
+
items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(EvidenceRow, { item, t }, `${item.sourceRef}-${index}`)),
|
|
1518
|
+
truncated && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: ZoteroToolViews_default.omitted, children: t("truncatedMore") })
|
|
1443
1519
|
] }) : null
|
|
1444
1520
|
}
|
|
1445
1521
|
);
|
|
@@ -1448,18 +1524,18 @@ function ZoteroAttachmentRow({ block, t }) {
|
|
|
1448
1524
|
const state = rowStateOf(block);
|
|
1449
1525
|
const meta3 = metaOf(block);
|
|
1450
1526
|
const kind = stringField(meta3 ?? {}, "kind");
|
|
1451
|
-
const
|
|
1527
|
+
const title = stringField(meta3 ?? {}, "title");
|
|
1452
1528
|
const contentType = stringField(meta3 ?? {}, "contentType");
|
|
1453
1529
|
const path = stringField(meta3 ?? {}, "path");
|
|
1454
1530
|
const url2 = stringField(meta3 ?? {}, "url");
|
|
1455
1531
|
const target = kind === "file" ? path : url2;
|
|
1456
|
-
const summary = state === "running" ? displayRefOf(rawInputOf(block)) :
|
|
1532
|
+
const summary = state === "running" ? displayRefOf(rawInputOf(block)) : title !== void 0 && title !== "" ? title : displayRefOf(rawInputOf(block));
|
|
1457
1533
|
const facts = state === "running" || meta3 === null ? [] : [kind === "file" ? t("localFile") : t("linkedUrl"), contentType ?? ""].filter(
|
|
1458
1534
|
(fact) => fact !== ""
|
|
1459
1535
|
);
|
|
1460
1536
|
const fullText = resultTextOf(block);
|
|
1461
1537
|
const hasBody = target !== void 0 || fullText !== null;
|
|
1462
|
-
return /* @__PURE__ */ (0,
|
|
1538
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1463
1539
|
ZoteroToolRow,
|
|
1464
1540
|
{
|
|
1465
1541
|
state,
|
|
@@ -1472,10 +1548,10 @@ function ZoteroAttachmentRow({ block, t }) {
|
|
|
1472
1548
|
runningLabel: t("checking"),
|
|
1473
1549
|
errorLabel: t("statusUnavailable"),
|
|
1474
1550
|
stoppedLabel: t("statusUnavailable"),
|
|
1475
|
-
children: target !== void 0 ? /* @__PURE__ */ (0,
|
|
1476
|
-
/* @__PURE__ */ (0,
|
|
1477
|
-
/* @__PURE__ */ (0,
|
|
1478
|
-
] }) : fullText !== null && /* @__PURE__ */ (0,
|
|
1551
|
+
children: target !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: ZoteroToolViews_default.targetRow, children: [
|
|
1552
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("code", { className: ZoteroToolViews_default.targetText, title: target, children: target }),
|
|
1553
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CopyValue, { value: target, t })
|
|
1554
|
+
] }) : fullText !== null && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(FallbackBody, { text: fullText })
|
|
1479
1555
|
}
|
|
1480
1556
|
);
|
|
1481
1557
|
}
|
|
@@ -1496,7 +1572,7 @@ function ZoteroExportRow({ block, t }) {
|
|
|
1496
1572
|
const detail = joinNonEmpty(style6 ?? "", locale ?? "");
|
|
1497
1573
|
if (detail !== "") facts.push(detail);
|
|
1498
1574
|
}
|
|
1499
|
-
return /* @__PURE__ */ (0,
|
|
1575
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1500
1576
|
ZoteroToolRow,
|
|
1501
1577
|
{
|
|
1502
1578
|
state,
|
|
@@ -1509,7 +1585,7 @@ function ZoteroExportRow({ block, t }) {
|
|
|
1509
1585
|
runningLabel: t("checking"),
|
|
1510
1586
|
errorLabel: t("statusUnavailable"),
|
|
1511
1587
|
stoppedLabel: t("statusUnavailable"),
|
|
1512
|
-
children: text !== null && /* @__PURE__ */ (0,
|
|
1588
|
+
children: text !== null && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ExportBody, { format, text, t })
|
|
1513
1589
|
}
|
|
1514
1590
|
);
|
|
1515
1591
|
}
|
|
@@ -1519,15 +1595,15 @@ function CardFor({
|
|
|
1519
1595
|
}) {
|
|
1520
1596
|
switch (callNameOf(block)) {
|
|
1521
1597
|
case "zotero_search":
|
|
1522
|
-
return /* @__PURE__ */ (0,
|
|
1598
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ZoteroSearchRow, { block, t });
|
|
1523
1599
|
case "zotero_get":
|
|
1524
|
-
return /* @__PURE__ */ (0,
|
|
1600
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ZoteroGetRow, { block, t });
|
|
1525
1601
|
case "zotero_retrieve":
|
|
1526
|
-
return /* @__PURE__ */ (0,
|
|
1602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ZoteroRetrieveRow, { block, t });
|
|
1527
1603
|
case "zotero_attachment":
|
|
1528
|
-
return /* @__PURE__ */ (0,
|
|
1604
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ZoteroAttachmentRow, { block, t });
|
|
1529
1605
|
case "zotero_export":
|
|
1530
|
-
return /* @__PURE__ */ (0,
|
|
1606
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ZoteroExportRow, { block, t });
|
|
1531
1607
|
default:
|
|
1532
1608
|
return null;
|
|
1533
1609
|
}
|
|
@@ -1541,26 +1617,26 @@ if (typeof document !== "undefined" && !document.querySelector('style[data-plugi
|
|
|
1541
1617
|
tag.textContent = style3;
|
|
1542
1618
|
document.head.appendChild(tag);
|
|
1543
1619
|
}
|
|
1544
|
-
var ZoteroCiteLens_default = { "
|
|
1620
|
+
var ZoteroCiteLens_default = { "quickRow": "rh35jG_quickRow", "sectionLabel": "rh35jG_sectionLabel", "section": "rh35jG_section", "spacer": "rh35jG_spacer", "chevronOpen": "rh35jG_chevronOpen", "quickMeta": "rh35jG_quickMeta", "exportFormat": "rh35jG_exportFormat", "noExports": "rh35jG_noExports", "exportHead": "rh35jG_exportHead", "citePreview": "rh35jG_citePreview", "toggleButton": "rh35jG_toggleButton", "exportCard": "rh35jG_exportCard", "exportStyle": "rh35jG_exportStyle", "noExportsText": "rh35jG_noExportsText", "quickTitle": "rh35jG_quickTitle", "chevron": "rh35jG_chevron" };
|
|
1545
1621
|
|
|
1546
1622
|
// src/client/ZoteroCiteLens.tsx
|
|
1547
|
-
var
|
|
1623
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1548
1624
|
function ExportCard({
|
|
1549
1625
|
artifact,
|
|
1550
1626
|
t
|
|
1551
1627
|
}) {
|
|
1552
|
-
const keys = (0,
|
|
1628
|
+
const keys = (0, import_react4.useMemo)(() => bibTexKeysOf(artifact.text), [artifact.text]);
|
|
1553
1629
|
const cite = citeCommandOf(keys);
|
|
1554
|
-
const [open, setOpen] = (0,
|
|
1555
|
-
return /* @__PURE__ */ (0,
|
|
1556
|
-
/* @__PURE__ */ (0,
|
|
1557
|
-
/* @__PURE__ */ (0,
|
|
1558
|
-
artifact.style !== void 0 && /* @__PURE__ */ (0,
|
|
1559
|
-
keys.length > 0 && /* @__PURE__ */ (0,
|
|
1560
|
-
/* @__PURE__ */ (0,
|
|
1561
|
-
/* @__PURE__ */ (0,
|
|
1562
|
-
cite !== "" && /* @__PURE__ */ (0,
|
|
1563
|
-
/* @__PURE__ */ (0,
|
|
1630
|
+
const [open, setOpen] = (0, import_react4.useState)(false);
|
|
1631
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: ZoteroCiteLens_default.exportCard, children: [
|
|
1632
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: ZoteroCiteLens_default.exportHead, children: [
|
|
1633
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: ZoteroCiteLens_default.exportFormat, children: artifact.format }),
|
|
1634
|
+
artifact.style !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: ZoteroCiteLens_default.exportStyle, children: artifact.style }),
|
|
1635
|
+
keys.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("code", { className: ZoteroCiteLens_default.citePreview, title: keys.join(", "), children: keys.join(" \xB7 ") }),
|
|
1636
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: ZoteroCiteLens_default.spacer }),
|
|
1637
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CopyValue, { value: artifact.text, t, label: t("copyFullText") }),
|
|
1638
|
+
cite !== "" && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CopyValue, { value: cite, t, label: t("copyCite") }),
|
|
1639
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1564
1640
|
"button",
|
|
1565
1641
|
{
|
|
1566
1642
|
type: "button",
|
|
@@ -1570,11 +1646,11 @@ function ExportCard({
|
|
|
1570
1646
|
onClick: () => {
|
|
1571
1647
|
setOpen((value) => !value);
|
|
1572
1648
|
},
|
|
1573
|
-
children: /* @__PURE__ */ (0,
|
|
1649
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives5.IconChevronDownOutline14, { className: clsx_default(ZoteroCiteLens_default.chevron, open && ZoteroCiteLens_default.chevronOpen) })
|
|
1574
1650
|
}
|
|
1575
1651
|
)
|
|
1576
1652
|
] }),
|
|
1577
|
-
open && /* @__PURE__ */ (0,
|
|
1653
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1578
1654
|
ExportBody,
|
|
1579
1655
|
{
|
|
1580
1656
|
format: artifact.format === "" ? void 0 : artifact.format,
|
|
@@ -1586,11 +1662,11 @@ function ExportCard({
|
|
|
1586
1662
|
] });
|
|
1587
1663
|
}
|
|
1588
1664
|
function ZoteroCiteLens({ corpus, t, setDraft }) {
|
|
1589
|
-
return /* @__PURE__ */ (0,
|
|
1590
|
-
/* @__PURE__ */ (0,
|
|
1591
|
-
/* @__PURE__ */ (0,
|
|
1592
|
-
/* @__PURE__ */ (0,
|
|
1593
|
-
setDraft !== void 0 && /* @__PURE__ */ (0,
|
|
1665
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1666
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: ZoteroCiteLens_default.sectionLabel, children: t("exportsLabel") }),
|
|
1667
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("section", { className: ZoteroCiteLens_default.section, children: corpus.exports.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: ZoteroCiteLens_default.noExports, children: [
|
|
1668
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: ZoteroCiteLens_default.noExportsText, children: t("noExportsHint") }),
|
|
1669
|
+
setDraft !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1594
1670
|
"button",
|
|
1595
1671
|
{
|
|
1596
1672
|
type: "button",
|
|
@@ -1601,16 +1677,16 @@ function ZoteroCiteLens({ corpus, t, setDraft }) {
|
|
|
1601
1677
|
children: t("starterCite")
|
|
1602
1678
|
}
|
|
1603
1679
|
)
|
|
1604
|
-
] }) : corpus.exports.map((artifact) => /* @__PURE__ */ (0,
|
|
1605
|
-
corpus.literature.length > 0 && /* @__PURE__ */ (0,
|
|
1606
|
-
/* @__PURE__ */ (0,
|
|
1607
|
-
/* @__PURE__ */ (0,
|
|
1680
|
+
] }) : corpus.exports.map((artifact) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ExportCard, { artifact, t }, artifact.callId)) }),
|
|
1681
|
+
corpus.literature.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1682
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: ZoteroCiteLens_default.sectionLabel, children: t("quickAccessLabel") }),
|
|
1683
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("section", { className: ZoteroCiteLens_default.section, children: corpus.literature.map((item) => {
|
|
1608
1684
|
const summary = joinNonEmpty(item.creators, item.year);
|
|
1609
|
-
return /* @__PURE__ */ (0,
|
|
1610
|
-
/* @__PURE__ */ (0,
|
|
1611
|
-
/* @__PURE__ */ (0,
|
|
1612
|
-
/* @__PURE__ */ (0,
|
|
1613
|
-
setDraft !== void 0 && /* @__PURE__ */ (0,
|
|
1685
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: ZoteroCiteLens_default.quickRow, children: [
|
|
1686
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: ZoteroCiteLens_default.quickTitle, title: item.title ?? item.ref, children: item.title ?? displayRefOf(item.ref) }),
|
|
1687
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: ZoteroCiteLens_default.quickMeta, title: summary, children: summary }),
|
|
1688
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CopyValue, { value: item.ref, t, label: t("copyRef") }),
|
|
1689
|
+
setDraft !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1614
1690
|
"button",
|
|
1615
1691
|
{
|
|
1616
1692
|
type: "button",
|
|
@@ -1638,10 +1714,10 @@ if (typeof document !== "undefined" && !document.querySelector('style[data-plugi
|
|
|
1638
1714
|
tag.textContent = style4;
|
|
1639
1715
|
document.head.appendChild(tag);
|
|
1640
1716
|
}
|
|
1641
|
-
var ZoteroItemsLens_default = { "
|
|
1717
|
+
var ZoteroItemsLens_default = { "attachmentRow": "T8jWra_attachmentRow", "badgeBusiness": "T8jWra_badgeBusiness", "badgeNeutral": "T8jWra_badgeNeutral", "section": "T8jWra_section", "sectionLabel": "T8jWra_sectionLabel", "attachmentKind": "T8jWra_attachmentKind", "badgeMono": "T8jWra_badgeMono", "location": "T8jWra_location", "sourceNote": "T8jWra_sourceNote", "empty": "T8jWra_empty", "dossier": "T8jWra_dossier", "badge": "T8jWra_badge" };
|
|
1642
1718
|
|
|
1643
1719
|
// src/client/ZoteroItemsLens.tsx
|
|
1644
|
-
var
|
|
1720
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1645
1721
|
function itemStateOf(item) {
|
|
1646
1722
|
let worst = "ok";
|
|
1647
1723
|
for (const call of item.calls) {
|
|
@@ -1659,29 +1735,29 @@ function badgesOf(item, t) {
|
|
|
1659
1735
|
const parts = [];
|
|
1660
1736
|
if (item.usage.read) {
|
|
1661
1737
|
parts.push(
|
|
1662
|
-
/* @__PURE__ */ (0,
|
|
1738
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: clsx_default(ZoteroItemsLens_default.badge, ZoteroItemsLens_default.badgeNeutral), children: t("badgeRead") }, "read")
|
|
1663
1739
|
);
|
|
1664
1740
|
}
|
|
1665
1741
|
if (item.usage.cited) {
|
|
1666
1742
|
parts.push(
|
|
1667
|
-
/* @__PURE__ */ (0,
|
|
1743
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: clsx_default(ZoteroItemsLens_default.badge, ZoteroItemsLens_default.badgeBusiness), children: t("badgeCited") }, "cited")
|
|
1668
1744
|
);
|
|
1669
1745
|
}
|
|
1670
1746
|
if (item.attachment?.contentType === "application/pdf") {
|
|
1671
1747
|
parts.push(
|
|
1672
|
-
/* @__PURE__ */ (0,
|
|
1748
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: clsx_default(ZoteroItemsLens_default.badge, ZoteroItemsLens_default.badgeMono), children: t("badgePdf") }, "pdf")
|
|
1673
1749
|
);
|
|
1674
1750
|
}
|
|
1675
|
-
return parts.length === 0 ? null : /* @__PURE__ */ (0,
|
|
1751
|
+
return parts.length === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, { children: parts });
|
|
1676
1752
|
}
|
|
1677
1753
|
function RowActions({
|
|
1678
1754
|
item,
|
|
1679
1755
|
t,
|
|
1680
1756
|
setDraft
|
|
1681
1757
|
}) {
|
|
1682
|
-
return /* @__PURE__ */ (0,
|
|
1683
|
-
/* @__PURE__ */ (0,
|
|
1684
|
-
setDraft !== void 0 && /* @__PURE__ */ (0,
|
|
1758
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
1759
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CopyValue, { value: item.ref, t, label: t("copyRef") }),
|
|
1760
|
+
setDraft !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1685
1761
|
"button",
|
|
1686
1762
|
{
|
|
1687
1763
|
type: "button",
|
|
@@ -1698,14 +1774,14 @@ function Dossier({
|
|
|
1698
1774
|
item,
|
|
1699
1775
|
t
|
|
1700
1776
|
}) {
|
|
1701
|
-
return /* @__PURE__ */ (0,
|
|
1702
|
-
item.notesPreview.length > 0 && /* @__PURE__ */ (0,
|
|
1703
|
-
/* @__PURE__ */ (0,
|
|
1704
|
-
item.notesPreview.map((note) => /* @__PURE__ */ (0,
|
|
1777
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: ZoteroItemsLens_default.dossier, children: [
|
|
1778
|
+
item.notesPreview.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("section", { className: ZoteroItemsLens_default.section, children: [
|
|
1779
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: ZoteroItemsLens_default.sectionLabel, children: t("personalNotes") }),
|
|
1780
|
+
item.notesPreview.map((note) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ChildPreviewRow, { preview: note, label: t("personalNotes"), t }, note.ref))
|
|
1705
1781
|
] }),
|
|
1706
|
-
item.annotationsPreview.length > 0 && /* @__PURE__ */ (0,
|
|
1707
|
-
/* @__PURE__ */ (0,
|
|
1708
|
-
item.annotationsPreview.map((annotation) => /* @__PURE__ */ (0,
|
|
1782
|
+
item.annotationsPreview.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("section", { className: ZoteroItemsLens_default.section, children: [
|
|
1783
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: ZoteroItemsLens_default.sectionLabel, children: t("personalAnnotations") }),
|
|
1784
|
+
item.annotationsPreview.map((annotation) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1709
1785
|
ChildPreviewRow,
|
|
1710
1786
|
{
|
|
1711
1787
|
preview: annotation,
|
|
@@ -1715,23 +1791,23 @@ function Dossier({
|
|
|
1715
1791
|
annotation.ref
|
|
1716
1792
|
))
|
|
1717
1793
|
] }),
|
|
1718
|
-
item.evidence.length > 0 && /* @__PURE__ */ (0,
|
|
1719
|
-
/* @__PURE__ */ (0,
|
|
1720
|
-
item.evidence.map((evidence, index) => /* @__PURE__ */ (0,
|
|
1794
|
+
item.evidence.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("section", { className: ZoteroItemsLens_default.section, children: [
|
|
1795
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: ZoteroItemsLens_default.sectionLabel, children: interpolate(t("evidencePassages"), { count: item.evidence.length }) }),
|
|
1796
|
+
item.evidence.map((evidence, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EvidenceRow, { item: evidence, t }, `${evidence.sourceRef}-${index}`))
|
|
1721
1797
|
] }),
|
|
1722
|
-
item.attachment !== void 0 && item.attachment.location !== "" && /* @__PURE__ */ (0,
|
|
1723
|
-
/* @__PURE__ */ (0,
|
|
1724
|
-
/* @__PURE__ */ (0,
|
|
1725
|
-
/* @__PURE__ */ (0,
|
|
1798
|
+
item.attachment !== void 0 && item.attachment.location !== "" && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: ZoteroItemsLens_default.attachmentRow, children: [
|
|
1799
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: ZoteroItemsLens_default.attachmentKind, children: item.attachment.kind === "file" ? t("localFile") : t("linkedUrl") }),
|
|
1800
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("code", { className: ZoteroItemsLens_default.location, title: item.attachment.location, children: item.attachment.location }),
|
|
1801
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CopyValue, { value: item.attachment.location, t })
|
|
1726
1802
|
] })
|
|
1727
1803
|
] });
|
|
1728
1804
|
}
|
|
1729
1805
|
function ZoteroItemsLens({ corpus, t, setDraft }) {
|
|
1730
1806
|
if (corpus.items.length === 0) {
|
|
1731
|
-
return /* @__PURE__ */ (0,
|
|
1807
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: ZoteroItemsLens_default.empty, children: t("itemsEmptyNote") });
|
|
1732
1808
|
}
|
|
1733
|
-
return /* @__PURE__ */ (0,
|
|
1734
|
-
corpus.items.some(isWorkedOn) ? /* @__PURE__ */ (0,
|
|
1809
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
1810
|
+
corpus.items.some(isWorkedOn) ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: ZoteroItemsLens_default.sourceNote, children: t("itemsProcessedNote") }) : corpus.searched > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: ZoteroItemsLens_default.sourceNote, children: corpus.searchOmitted > 0 ? (
|
|
1735
1811
|
// The list shows the found set's rows; the omitted rows of
|
|
1736
1812
|
// the bounded projection add back to the honest hit total.
|
|
1737
1813
|
interpolate(t("itemsSourceOmittedNote"), {
|
|
@@ -1742,21 +1818,21 @@ function ZoteroItemsLens({ corpus, t, setDraft }) {
|
|
|
1742
1818
|
corpus.items.map((item) => {
|
|
1743
1819
|
const badges = badgesOf(item, t);
|
|
1744
1820
|
const summary = joinNonEmpty(item.creators, item.year, item.venue);
|
|
1745
|
-
return /* @__PURE__ */ (0,
|
|
1821
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1746
1822
|
ZoteroToolRow,
|
|
1747
1823
|
{
|
|
1748
1824
|
state: itemStateOf(item),
|
|
1749
1825
|
title: item.title ?? displayRefOf(item.ref),
|
|
1750
1826
|
summary,
|
|
1751
|
-
icon: /* @__PURE__ */ (0,
|
|
1827
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_dsh_client_ui_primitives6.IconBrowseOutline16, { size: 14 }),
|
|
1752
1828
|
facts: item.itemType === void 0 ? [] : [item.itemType],
|
|
1753
1829
|
trailing: badges,
|
|
1754
|
-
actions: /* @__PURE__ */ (0,
|
|
1830
|
+
actions: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(RowActions, { item, t, setDraft }),
|
|
1755
1831
|
expandable: hasDossierContent(item),
|
|
1756
1832
|
runningLabel: t("checking"),
|
|
1757
1833
|
errorLabel: t("statusUnavailable"),
|
|
1758
1834
|
stoppedLabel: t("statusUnavailable"),
|
|
1759
|
-
children: /* @__PURE__ */ (0,
|
|
1835
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Dossier, { item, t })
|
|
1760
1836
|
},
|
|
1761
1837
|
item.key
|
|
1762
1838
|
);
|
|
@@ -1772,10 +1848,10 @@ if (typeof document !== "undefined" && !document.querySelector('style[data-plugi
|
|
|
1772
1848
|
tag.textContent = style5;
|
|
1773
1849
|
document.head.appendChild(tag);
|
|
1774
1850
|
}
|
|
1775
|
-
var ZoteroTab_default = { "
|
|
1851
|
+
var ZoteroTab_default = { "scroller": "RYIe2q_scroller", "view": "RYIe2q_view", "toolbar": "RYIe2q_toolbar", "spacer": "RYIe2q_spacer", "chip": "RYIe2q_chip", "checkedAt": "RYIe2q_checkedAt", "diagnosis": "RYIe2q_diagnosis", "activityLedger": "RYIe2q_activityLedger", "lensBar": "RYIe2q_lensBar", "activityNote": "RYIe2q_activityNote", "list": "RYIe2q_list", "emptyIcon": "RYIe2q_emptyIcon", "activitySpan": "RYIe2q_activitySpan", "funnelChip": "RYIe2q_funnelChip", "emptyText": "RYIe2q_emptyText", "starterRow": "RYIe2q_starterRow", "lensGroup": "RYIe2q_lensGroup", "empty": "RYIe2q_empty", "funnel": "RYIe2q_funnel", "activityRow": "RYIe2q_activityRow", "chipMono": "RYIe2q_chipMono", "refresh": "RYIe2q_refresh", "scrollerEmpty": "RYIe2q_scrollerEmpty", "activityStrip": "RYIe2q_activityStrip", "statusText": "RYIe2q_statusText" };
|
|
1776
1852
|
|
|
1777
1853
|
// src/client/ZoteroTab.tsx
|
|
1778
|
-
var
|
|
1854
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1779
1855
|
var LENSES = [
|
|
1780
1856
|
{ id: "items", key: "lensItems" },
|
|
1781
1857
|
{ id: "citations", key: "lensCitations" },
|
|
@@ -1806,8 +1882,8 @@ function collectZoteroCalls(snapshot) {
|
|
|
1806
1882
|
const out = [];
|
|
1807
1883
|
const seen = /* @__PURE__ */ new Set();
|
|
1808
1884
|
const visit = (block) => {
|
|
1809
|
-
const
|
|
1810
|
-
if (
|
|
1885
|
+
const name2 = callNameOf(block);
|
|
1886
|
+
if (name2 !== null && name2.startsWith("zotero_") && !seen.has(block.callId)) {
|
|
1811
1887
|
seen.add(block.callId);
|
|
1812
1888
|
out.push(block);
|
|
1813
1889
|
}
|
|
@@ -1820,37 +1896,37 @@ function collectZoteroCalls(snapshot) {
|
|
|
1820
1896
|
out.sort((a, b) => orderKeyOf(a) - orderKeyOf(b));
|
|
1821
1897
|
return out;
|
|
1822
1898
|
}
|
|
1823
|
-
function ZoteroTab({ status
|
|
1899
|
+
function ZoteroTab({ status, t, useSession, inputActions }) {
|
|
1824
1900
|
const session = useSession((snapshot) => snapshot);
|
|
1825
|
-
const blocks = (0,
|
|
1826
|
-
const corpus = (0,
|
|
1827
|
-
const [manualLens, setManualLens] = (0,
|
|
1828
|
-
const [statusState, setStatusState] = (0,
|
|
1829
|
-
const [requestId, setRequestId] = (0,
|
|
1830
|
-
const [hoveredCall, setHoveredCall] = (0,
|
|
1901
|
+
const blocks = (0, import_react5.useMemo)(() => collectZoteroCalls(session), [session]);
|
|
1902
|
+
const corpus = (0, import_react5.useMemo)(() => buildCorpus(blocks), [blocks]);
|
|
1903
|
+
const [manualLens, setManualLens] = (0, import_react5.useState)(void 0);
|
|
1904
|
+
const [statusState, setStatusState] = (0, import_react5.useState)({ kind: "loading" });
|
|
1905
|
+
const [requestId, setRequestId] = (0, import_react5.useState)(0);
|
|
1906
|
+
const [hoveredCall, setHoveredCall] = (0, import_react5.useState)(void 0);
|
|
1831
1907
|
const lens = manualLens ?? "activity";
|
|
1832
1908
|
const setDraft = inputActions?.setDraft.bind(inputActions);
|
|
1833
|
-
(0,
|
|
1834
|
-
if (
|
|
1909
|
+
(0, import_react5.useEffect)(() => {
|
|
1910
|
+
if (status === void 0) return;
|
|
1835
1911
|
const controller = new AbortController();
|
|
1836
1912
|
setStatusState({ kind: "loading" });
|
|
1837
1913
|
void (async () => {
|
|
1838
|
-
const result = await
|
|
1914
|
+
const result = await status();
|
|
1839
1915
|
if (controller.signal.aborted) return;
|
|
1840
1916
|
setStatusState(stateOf(result, currentTime()));
|
|
1841
1917
|
})();
|
|
1842
1918
|
return () => {
|
|
1843
1919
|
controller.abort();
|
|
1844
1920
|
};
|
|
1845
|
-
}, [
|
|
1921
|
+
}, [status, requestId]);
|
|
1846
1922
|
const refresh = () => {
|
|
1847
1923
|
setRequestId((id) => id + 1);
|
|
1848
1924
|
};
|
|
1849
1925
|
const connected = statusState.kind === "connected" ? statusState.data : void 0;
|
|
1850
1926
|
const failed2 = statusState.kind === "unavailable" || statusState.kind === "remote-error";
|
|
1851
1927
|
const checkedAt = statusState.kind === "connected" || statusState.kind === "unavailable" ? statusState.checkedAt : void 0;
|
|
1852
|
-
return /* @__PURE__ */ (0,
|
|
1853
|
-
/* @__PURE__ */ (0,
|
|
1928
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: ZoteroTab_default.view, "data-conversation-composer-overlay": true, children: [
|
|
1929
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1854
1930
|
"div",
|
|
1855
1931
|
{
|
|
1856
1932
|
className: ZoteroTab_default.toolbar,
|
|
@@ -1858,33 +1934,33 @@ function ZoteroTab({ status: status2, t, useSession, inputActions }) {
|
|
|
1858
1934
|
"aria-live": "polite",
|
|
1859
1935
|
"aria-busy": statusState.kind === "loading",
|
|
1860
1936
|
children: [
|
|
1861
|
-
/* @__PURE__ */ (0,
|
|
1937
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1862
1938
|
import_dsh_client_ui_primitives7.StateDot,
|
|
1863
1939
|
{
|
|
1864
1940
|
state: statusState.kind === "loading" ? "ongoing" : statusState.kind === "connected" ? "done" : "error"
|
|
1865
1941
|
}
|
|
1866
1942
|
),
|
|
1867
|
-
/* @__PURE__ */ (0,
|
|
1943
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: ZoteroTab_default.statusText, children: [
|
|
1868
1944
|
statusState.kind === "loading" && t("checking"),
|
|
1869
1945
|
statusState.kind === "connected" && t("statusConnected"),
|
|
1870
1946
|
failed2 && t("statusUnavailable")
|
|
1871
1947
|
] }),
|
|
1872
|
-
connected?.apiVersion !== void 0 && /* @__PURE__ */ (0,
|
|
1948
|
+
connected?.apiVersion !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: ZoteroTab_default.chip, children: [
|
|
1873
1949
|
t("apiVersionLabel"),
|
|
1874
1950
|
" ",
|
|
1875
1951
|
connected.apiVersion
|
|
1876
1952
|
] }),
|
|
1877
|
-
connected?.schemaVersion !== void 0 && /* @__PURE__ */ (0,
|
|
1953
|
+
connected?.schemaVersion !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: ZoteroTab_default.chip, children: [
|
|
1878
1954
|
t("schemaVersionLabel"),
|
|
1879
1955
|
" ",
|
|
1880
1956
|
connected.schemaVersion
|
|
1881
1957
|
] }),
|
|
1882
|
-
connected?.serverId !== void 0 && /* @__PURE__ */ (0,
|
|
1958
|
+
connected?.serverId !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: clsx_default(ZoteroTab_default.chip, ZoteroTab_default.chipMono), title: connected.serverId, children: [
|
|
1883
1959
|
t("serverIdLabel"),
|
|
1884
1960
|
" ",
|
|
1885
1961
|
shortServerId(connected.serverId)
|
|
1886
1962
|
] }),
|
|
1887
|
-
failed2 && /* @__PURE__ */ (0,
|
|
1963
|
+
failed2 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1888
1964
|
"span",
|
|
1889
1965
|
{
|
|
1890
1966
|
className: ZoteroTab_default.diagnosis,
|
|
@@ -1892,13 +1968,13 @@ function ZoteroTab({ status: status2, t, useSession, inputActions }) {
|
|
|
1892
1968
|
children: statusState.kind === "remote-error" ? statusState.message : `${t("diagnosisLabel")}: ${statusState.data.diagnosis}`
|
|
1893
1969
|
}
|
|
1894
1970
|
),
|
|
1895
|
-
!failed2 && /* @__PURE__ */ (0,
|
|
1896
|
-
checkedAt !== void 0 && /* @__PURE__ */ (0,
|
|
1971
|
+
!failed2 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: ZoteroTab_default.spacer }),
|
|
1972
|
+
checkedAt !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: ZoteroTab_default.checkedAt, children: [
|
|
1897
1973
|
t("lastCheckedLabel"),
|
|
1898
1974
|
" ",
|
|
1899
1975
|
checkedAt
|
|
1900
1976
|
] }),
|
|
1901
|
-
/* @__PURE__ */ (0,
|
|
1977
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1902
1978
|
"button",
|
|
1903
1979
|
{
|
|
1904
1980
|
type: "button",
|
|
@@ -1911,11 +1987,11 @@ function ZoteroTab({ status: status2, t, useSession, inputActions }) {
|
|
|
1911
1987
|
]
|
|
1912
1988
|
}
|
|
1913
1989
|
),
|
|
1914
|
-
blocks.length === 0 ? /* @__PURE__ */ (0,
|
|
1915
|
-
/* @__PURE__ */ (0,
|
|
1916
|
-
/* @__PURE__ */ (0,
|
|
1917
|
-
setDraft !== void 0 && /* @__PURE__ */ (0,
|
|
1918
|
-
/* @__PURE__ */ (0,
|
|
1990
|
+
blocks.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: ZoteroTab_default.scrollerEmpty, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: ZoteroTab_default.empty, children: [
|
|
1991
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_dsh_client_ui_primitives7.IconBrowseOutline16, { size: 16, className: ZoteroTab_default.emptyIcon }),
|
|
1992
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: ZoteroTab_default.emptyText, children: t("noActivity") }),
|
|
1993
|
+
setDraft !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: ZoteroTab_default.starterRow, children: [
|
|
1994
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1919
1995
|
import_dsh_client_ui_primitives7.Pill,
|
|
1920
1996
|
{
|
|
1921
1997
|
onClick: () => {
|
|
@@ -1924,7 +2000,7 @@ function ZoteroTab({ status: status2, t, useSession, inputActions }) {
|
|
|
1924
2000
|
children: t("starterFind")
|
|
1925
2001
|
}
|
|
1926
2002
|
),
|
|
1927
|
-
/* @__PURE__ */ (0,
|
|
2003
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1928
2004
|
import_dsh_client_ui_primitives7.Pill,
|
|
1929
2005
|
{
|
|
1930
2006
|
onClick: () => {
|
|
@@ -1933,7 +2009,7 @@ function ZoteroTab({ status: status2, t, useSession, inputActions }) {
|
|
|
1933
2009
|
children: t("starterCite")
|
|
1934
2010
|
}
|
|
1935
2011
|
),
|
|
1936
|
-
/* @__PURE__ */ (0,
|
|
2012
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1937
2013
|
import_dsh_client_ui_primitives7.Pill,
|
|
1938
2014
|
{
|
|
1939
2015
|
onClick: () => {
|
|
@@ -1943,9 +2019,9 @@ function ZoteroTab({ status: status2, t, useSession, inputActions }) {
|
|
|
1943
2019
|
}
|
|
1944
2020
|
)
|
|
1945
2021
|
] })
|
|
1946
|
-
] }) }) : /* @__PURE__ */ (0,
|
|
1947
|
-
/* @__PURE__ */ (0,
|
|
1948
|
-
/* @__PURE__ */ (0,
|
|
2022
|
+
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
2023
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: ZoteroTab_default.lensBar, role: "group", children: [
|
|
2024
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: ZoteroTab_default.lensGroup, children: LENSES.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1949
2025
|
import_dsh_client_ui_primitives7.Pill,
|
|
1950
2026
|
{
|
|
1951
2027
|
active: lens === entry.id,
|
|
@@ -1957,16 +2033,16 @@ function ZoteroTab({ status: status2, t, useSession, inputActions }) {
|
|
|
1957
2033
|
},
|
|
1958
2034
|
entry.id
|
|
1959
2035
|
)) }),
|
|
1960
|
-
corpus.funnel !== null && /* @__PURE__ */ (0,
|
|
1961
|
-
corpus.funnel.searched > 0 && /* @__PURE__ */ (0,
|
|
1962
|
-
corpus.funnel.read > 0 && /* @__PURE__ */ (0,
|
|
1963
|
-
corpus.funnel.cited > 0 && /* @__PURE__ */ (0,
|
|
2036
|
+
corpus.funnel !== null && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: ZoteroTab_default.funnel, children: [
|
|
2037
|
+
corpus.funnel.searched > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: ZoteroTab_default.funnelChip, "data-stage": "searched", children: interpolate(t("funnelSearched"), { count: corpus.funnel.searched }) }),
|
|
2038
|
+
corpus.funnel.read > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: ZoteroTab_default.funnelChip, "data-stage": "read", children: interpolate(t("funnelRead"), { count: corpus.funnel.read }) }),
|
|
2039
|
+
corpus.funnel.cited > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: ZoteroTab_default.funnelChip, "data-stage": "cited", children: interpolate(t("funnelCited"), { count: corpus.funnel.cited }) })
|
|
1964
2040
|
] })
|
|
1965
2041
|
] }),
|
|
1966
|
-
/* @__PURE__ */ (0,
|
|
1967
|
-
/* @__PURE__ */ (0,
|
|
1968
|
-
/* @__PURE__ */ (0,
|
|
1969
|
-
/* @__PURE__ */ (0,
|
|
2042
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: ZoteroTab_default.scroller, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: ZoteroTab_default.list, children: lens === "items" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ZoteroItemsLens, { corpus, t, setDraft }) : lens === "citations" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ZoteroCiteLens, { corpus, t, setDraft }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
2043
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: ZoteroTab_default.activityLedger, "aria-hidden": true, children: [
|
|
2044
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: ZoteroTab_default.activityNote, children: interpolate(t("activityNote"), { count: blocks.length }) }),
|
|
2045
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: ZoteroTab_default.activityStrip, children: blocks.map((block) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1970
2046
|
"span",
|
|
1971
2047
|
{
|
|
1972
2048
|
className: ZoteroTab_default.activitySpan,
|
|
@@ -1985,12 +2061,12 @@ function ZoteroTab({ status: status2, t, useSession, inputActions }) {
|
|
|
1985
2061
|
block.callId
|
|
1986
2062
|
)) })
|
|
1987
2063
|
] }),
|
|
1988
|
-
blocks.map((block) => /* @__PURE__ */ (0,
|
|
2064
|
+
blocks.map((block) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1989
2065
|
"div",
|
|
1990
2066
|
{
|
|
1991
2067
|
className: ZoteroTab_default.activityRow,
|
|
1992
2068
|
"data-hovered": hoveredCall === block.callId || void 0,
|
|
1993
|
-
children: /* @__PURE__ */ (0,
|
|
2069
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(CardFor, { block, t })
|
|
1994
2070
|
},
|
|
1995
2071
|
block.callId
|
|
1996
2072
|
))
|
|
@@ -2527,7 +2603,7 @@ var NEVER = /* @__PURE__ */ Object.freeze({
|
|
|
2527
2603
|
status: "aborted"
|
|
2528
2604
|
});
|
|
2529
2605
|
// @__NO_SIDE_EFFECTS__
|
|
2530
|
-
function $constructor(
|
|
2606
|
+
function $constructor(name2, initializer3, params) {
|
|
2531
2607
|
function init(inst, def) {
|
|
2532
2608
|
if (!inst._zod) {
|
|
2533
2609
|
Object.defineProperty(inst, "_zod", {
|
|
@@ -2539,10 +2615,10 @@ function $constructor(name, initializer3, params) {
|
|
|
2539
2615
|
enumerable: false
|
|
2540
2616
|
});
|
|
2541
2617
|
}
|
|
2542
|
-
if (inst._zod.traits.has(
|
|
2618
|
+
if (inst._zod.traits.has(name2)) {
|
|
2543
2619
|
return;
|
|
2544
2620
|
}
|
|
2545
|
-
inst._zod.traits.add(
|
|
2621
|
+
inst._zod.traits.add(name2);
|
|
2546
2622
|
initializer3(inst, def);
|
|
2547
2623
|
const proto = _.prototype;
|
|
2548
2624
|
const keys = Object.keys(proto);
|
|
@@ -2556,7 +2632,7 @@ function $constructor(name, initializer3, params) {
|
|
|
2556
2632
|
const Parent = params?.Parent ?? Object;
|
|
2557
2633
|
class Definition extends Parent {
|
|
2558
2634
|
}
|
|
2559
|
-
Object.defineProperty(Definition, "name", { value:
|
|
2635
|
+
Object.defineProperty(Definition, "name", { value: name2 });
|
|
2560
2636
|
function _(def) {
|
|
2561
2637
|
var _a3;
|
|
2562
2638
|
const inst = params?.Parent ? new Definition() : this;
|
|
@@ -2572,10 +2648,10 @@ function $constructor(name, initializer3, params) {
|
|
|
2572
2648
|
value: (inst) => {
|
|
2573
2649
|
if (params?.Parent && inst instanceof params.Parent)
|
|
2574
2650
|
return true;
|
|
2575
|
-
return inst?._zod?.traits?.has(
|
|
2651
|
+
return inst?._zod?.traits?.has(name2);
|
|
2576
2652
|
}
|
|
2577
2653
|
});
|
|
2578
|
-
Object.defineProperty(_, "name", { value:
|
|
2654
|
+
Object.defineProperty(_, "name", { value: name2 });
|
|
2579
2655
|
return _;
|
|
2580
2656
|
}
|
|
2581
2657
|
var $brand = /* @__PURE__ */ Symbol("zod_brand");
|
|
@@ -2585,8 +2661,8 @@ var $ZodAsyncError = class extends Error {
|
|
|
2585
2661
|
}
|
|
2586
2662
|
};
|
|
2587
2663
|
var $ZodEncodeError = class extends Error {
|
|
2588
|
-
constructor(
|
|
2589
|
-
super(`Encountered unidirectional transform during encode: ${
|
|
2664
|
+
constructor(name2) {
|
|
2665
|
+
super(`Encountered unidirectional transform during encode: ${name2}`);
|
|
2590
2666
|
this.name = "ZodEncodeError";
|
|
2591
2667
|
}
|
|
2592
2668
|
};
|
|
@@ -4665,10 +4741,10 @@ function isValidJWT(token, algorithm = null) {
|
|
|
4665
4741
|
const tokensParts = token.split(".");
|
|
4666
4742
|
if (tokensParts.length !== 3)
|
|
4667
4743
|
return false;
|
|
4668
|
-
const [
|
|
4669
|
-
if (!
|
|
4744
|
+
const [header2] = tokensParts;
|
|
4745
|
+
if (!header2)
|
|
4670
4746
|
return false;
|
|
4671
|
-
const parsedHeader = JSON.parse(atob(
|
|
4747
|
+
const parsedHeader = JSON.parse(atob(header2));
|
|
4672
4748
|
if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT")
|
|
4673
4749
|
return false;
|
|
4674
4750
|
if (!parsedHeader.alg)
|
|
@@ -16517,14 +16593,6 @@ config(en_default());
|
|
|
16517
16593
|
var ZOTERO_SETTINGS_NAMESPACE = "zotero";
|
|
16518
16594
|
|
|
16519
16595
|
// src/contract.ts
|
|
16520
|
-
var zoteroConfigViewSchema = external_exports.object({
|
|
16521
|
-
available: external_exports.boolean(),
|
|
16522
|
-
writable: external_exports.boolean(),
|
|
16523
|
-
value: external_exports.record(external_exports.string(), external_exports.unknown()).nullable().optional(),
|
|
16524
|
-
base: external_exports.record(external_exports.string(), external_exports.unknown()).nullable().optional(),
|
|
16525
|
-
user: external_exports.record(external_exports.string(), external_exports.unknown()).nullable().optional(),
|
|
16526
|
-
revision: external_exports.number().int().nullable().optional()
|
|
16527
|
-
}).readonly();
|
|
16528
16596
|
var zoteroStatusSchema = external_exports.object({
|
|
16529
16597
|
providerId: external_exports.string(),
|
|
16530
16598
|
connected: external_exports.boolean(),
|
|
@@ -16533,9 +16601,6 @@ var zoteroStatusSchema = external_exports.object({
|
|
|
16533
16601
|
schemaVersion: external_exports.string().optional(),
|
|
16534
16602
|
diagnosis: external_exports.string()
|
|
16535
16603
|
}).readonly();
|
|
16536
|
-
var zoteroPatchSchema = external_exports.record(external_exports.string(), external_exports.unknown()).readonly();
|
|
16537
|
-
var zoteroFieldSchema = external_exports.string().min(1);
|
|
16538
|
-
var zoteroRevisionSchema = external_exports.number().int().optional();
|
|
16539
16604
|
var ZOTERO_INVOCATIONS = [
|
|
16540
16605
|
{
|
|
16541
16606
|
id: "dsh-zotero#zotero/status",
|
|
@@ -16549,77 +16614,6 @@ var ZOTERO_INVOCATIONS = [
|
|
|
16549
16614
|
typeSymbol: "dsh-zotero#ZoteroStatusView",
|
|
16550
16615
|
schema: zoteroStatusSchema
|
|
16551
16616
|
}
|
|
16552
|
-
},
|
|
16553
|
-
{
|
|
16554
|
-
id: "dsh-zotero#zotero/config",
|
|
16555
|
-
service: "zoteroRemote",
|
|
16556
|
-
namespace: ZOTERO_SETTINGS_NAMESPACE,
|
|
16557
|
-
method: "config",
|
|
16558
|
-
invocation: { kind: "direct" },
|
|
16559
|
-
parameters: [],
|
|
16560
|
-
result: {
|
|
16561
|
-
mode: "strict",
|
|
16562
|
-
typeSymbol: "dsh-zotero#ZoteroConfigView",
|
|
16563
|
-
schema: zoteroConfigViewSchema
|
|
16564
|
-
}
|
|
16565
|
-
},
|
|
16566
|
-
{
|
|
16567
|
-
id: "dsh-zotero#zotero/configUpdate",
|
|
16568
|
-
service: "zoteroRemote",
|
|
16569
|
-
namespace: ZOTERO_SETTINGS_NAMESPACE,
|
|
16570
|
-
method: "configUpdate",
|
|
16571
|
-
invocation: { kind: "direct" },
|
|
16572
|
-
parameters: [
|
|
16573
|
-
{
|
|
16574
|
-
name: "patch",
|
|
16575
|
-
wire: "patch",
|
|
16576
|
-
source: "json",
|
|
16577
|
-
codec: {
|
|
16578
|
-
mode: "strict",
|
|
16579
|
-
typeSymbol: "dsh-zotero#ZoteroConfigPatch",
|
|
16580
|
-
schema: zoteroPatchSchema
|
|
16581
|
-
}
|
|
16582
|
-
},
|
|
16583
|
-
{
|
|
16584
|
-
name: "revision",
|
|
16585
|
-
wire: "revision",
|
|
16586
|
-
source: "json",
|
|
16587
|
-
acceptsUndefined: true,
|
|
16588
|
-
codec: { mode: "strict", typeSymbol: "number", schema: zoteroRevisionSchema }
|
|
16589
|
-
}
|
|
16590
|
-
],
|
|
16591
|
-
result: {
|
|
16592
|
-
mode: "strict",
|
|
16593
|
-
typeSymbol: "dsh-zotero#ZoteroConfigView",
|
|
16594
|
-
schema: zoteroConfigViewSchema
|
|
16595
|
-
}
|
|
16596
|
-
},
|
|
16597
|
-
{
|
|
16598
|
-
id: "dsh-zotero#zotero/configClear",
|
|
16599
|
-
service: "zoteroRemote",
|
|
16600
|
-
namespace: ZOTERO_SETTINGS_NAMESPACE,
|
|
16601
|
-
method: "configClear",
|
|
16602
|
-
invocation: { kind: "direct" },
|
|
16603
|
-
parameters: [
|
|
16604
|
-
{
|
|
16605
|
-
name: "field",
|
|
16606
|
-
wire: "field",
|
|
16607
|
-
source: "json",
|
|
16608
|
-
codec: { mode: "strict", typeSymbol: "string", schema: zoteroFieldSchema }
|
|
16609
|
-
},
|
|
16610
|
-
{
|
|
16611
|
-
name: "revision",
|
|
16612
|
-
wire: "revision",
|
|
16613
|
-
source: "json",
|
|
16614
|
-
acceptsUndefined: true,
|
|
16615
|
-
codec: { mode: "strict", typeSymbol: "number", schema: zoteroRevisionSchema }
|
|
16616
|
-
}
|
|
16617
|
-
],
|
|
16618
|
-
result: {
|
|
16619
|
-
mode: "strict",
|
|
16620
|
-
typeSymbol: "dsh-zotero#ZoteroConfigView",
|
|
16621
|
-
schema: zoteroConfigViewSchema
|
|
16622
|
-
}
|
|
16623
16617
|
}
|
|
16624
16618
|
];
|
|
16625
16619
|
|
|
@@ -16629,107 +16623,18 @@ var ZOTERO_REMOTE = {
|
|
|
16629
16623
|
descriptors: ZOTERO_INVOCATIONS
|
|
16630
16624
|
};
|
|
16631
16625
|
|
|
16632
|
-
// src/client/remote-scope.ts
|
|
16633
|
-
var RemoteScope = class {
|
|
16634
|
-
/**
|
|
16635
|
-
* @param face - resolves the mounted Remote face; undefined until the mount
|
|
16636
|
-
* settles, and after a connection reset unmounts it.
|
|
16637
|
-
*/
|
|
16638
|
-
constructor(face) {
|
|
16639
|
-
this.face = face;
|
|
16640
|
-
}
|
|
16641
|
-
face;
|
|
16642
|
-
snapshot = {
|
|
16643
|
-
status: "loading",
|
|
16644
|
-
value: void 0,
|
|
16645
|
-
base: void 0,
|
|
16646
|
-
user: void 0,
|
|
16647
|
-
revision: void 0,
|
|
16648
|
-
writable: false,
|
|
16649
|
-
mode: "host"
|
|
16650
|
-
};
|
|
16651
|
-
listeners = /* @__PURE__ */ new Set();
|
|
16652
|
-
connected = false;
|
|
16653
|
-
/** @returns the current sync snapshot (stable reference until the next change). */
|
|
16654
|
-
getSnapshot() {
|
|
16655
|
-
return this.snapshot;
|
|
16656
|
-
}
|
|
16657
|
-
/**
|
|
16658
|
-
* Observe snapshot replacements.
|
|
16659
|
-
* @param listener - invoked after each snapshot change.
|
|
16660
|
-
* @returns the disposer removing this listener.
|
|
16661
|
-
*/
|
|
16662
|
-
subscribe(listener) {
|
|
16663
|
-
this.listeners.add(listener);
|
|
16664
|
-
return () => {
|
|
16665
|
-
this.listeners.delete(listener);
|
|
16666
|
-
};
|
|
16667
|
-
}
|
|
16668
|
-
/**
|
|
16669
|
-
* Start the first load. Called once the Remote face is mounted; idempotent.
|
|
16670
|
-
* @returns settlement after the first snapshot publishes (or the load fails silently).
|
|
16671
|
-
*/
|
|
16672
|
-
async connect() {
|
|
16673
|
-
if (this.connected) return;
|
|
16674
|
-
this.connected = true;
|
|
16675
|
-
await this.reload();
|
|
16676
|
-
}
|
|
16677
|
-
/**
|
|
16678
|
-
* Merge one field into the user layer through the Remote namespace.
|
|
16679
|
-
* @param field - scalar field inside the namespace section.
|
|
16680
|
-
* @param value - JSON-shaped value selected by the user.
|
|
16681
|
-
* @returns settlement after the write; a refused write reloads instead.
|
|
16682
|
-
*/
|
|
16683
|
-
async set(field2, value) {
|
|
16684
|
-
const face = this.face();
|
|
16685
|
-
if (face === void 0) return;
|
|
16686
|
-
const result = await face.configUpdate({ [field2]: value }, this.snapshot.revision);
|
|
16687
|
-
if (result.ok) this.apply(result.value);
|
|
16688
|
-
else await this.reload();
|
|
16689
|
-
}
|
|
16690
|
-
/**
|
|
16691
|
-
* Clear one field from the user layer so it re-inherits the composition layer.
|
|
16692
|
-
* @param field - scalar field inside the namespace section.
|
|
16693
|
-
* @returns settlement after the clear; a refused clear reloads instead.
|
|
16694
|
-
*/
|
|
16695
|
-
async unset(field2) {
|
|
16696
|
-
const face = this.face();
|
|
16697
|
-
if (face === void 0) return;
|
|
16698
|
-
const result = await face.configClear(field2, this.snapshot.revision);
|
|
16699
|
-
if (result.ok) this.apply(result.value);
|
|
16700
|
-
else await this.reload();
|
|
16701
|
-
}
|
|
16702
|
-
/** Re-read the Host view and publish it; a failed read keeps the last snapshot. */
|
|
16703
|
-
async reload() {
|
|
16704
|
-
const face = this.face();
|
|
16705
|
-
if (face === void 0) return;
|
|
16706
|
-
const result = await face.config();
|
|
16707
|
-
if (result.ok) this.apply(result.value);
|
|
16708
|
-
}
|
|
16709
|
-
apply(view) {
|
|
16710
|
-
this.snapshot = {
|
|
16711
|
-
status: view.available ? "ready" : "unavailable",
|
|
16712
|
-
value: view.value,
|
|
16713
|
-
base: view.base,
|
|
16714
|
-
user: view.user,
|
|
16715
|
-
revision: view.revision,
|
|
16716
|
-
writable: view.writable,
|
|
16717
|
-
mode: "host"
|
|
16718
|
-
};
|
|
16719
|
-
for (const listener of this.listeners) listener();
|
|
16720
|
-
}
|
|
16721
|
-
};
|
|
16722
|
-
|
|
16723
16626
|
// src/client/locales.ts
|
|
16724
16627
|
var en = {
|
|
16725
16628
|
nav: "Zotero",
|
|
16726
16629
|
title: "Zotero",
|
|
16727
|
-
description: "Access to your
|
|
16728
|
-
loading: "Loading settings\u2026",
|
|
16729
|
-
unavailable: "Settings are unavailable: this deployment composes no settings document for Zotero.",
|
|
16630
|
+
description: "Access to your Zotero library.",
|
|
16730
16631
|
overridden: "Overridden",
|
|
16731
16632
|
reset: "Reset to default",
|
|
16732
16633
|
readOnly: "This deployment stores settings read-only.",
|
|
16634
|
+
discard: "Discard changes",
|
|
16635
|
+
unsaved: "Unsaved",
|
|
16636
|
+
expand: "Show settings",
|
|
16637
|
+
collapse: "Hide settings",
|
|
16733
16638
|
save: "Save",
|
|
16734
16639
|
saving: "Saving\u2026",
|
|
16735
16640
|
saveFailed: "The deployment did not accept these values; they were left for you to correct.",
|
|
@@ -16778,7 +16683,7 @@ var en = {
|
|
|
16778
16683
|
defaultLocaleHint: "CSL locale for citation and bibliography formats (e.g. en-US).",
|
|
16779
16684
|
groupWeb: "Web view",
|
|
16780
16685
|
webEnabled: "Zotero conversation tab",
|
|
16781
|
-
webEnabledHint: "Shows a dedicated Zotero tab at the top of conversations (items, citations, activity). Turning it off hides the tab
|
|
16686
|
+
webEnabledHint: "Shows a dedicated Zotero tab at the top of conversations (items, citations, activity). Turning it off hides the tab right away.",
|
|
16782
16687
|
copy: "Copy",
|
|
16783
16688
|
copied: "Copied",
|
|
16784
16689
|
checking: "Checking\u2026",
|
|
@@ -16862,12 +16767,14 @@ var en = {
|
|
|
16862
16767
|
var zh = {
|
|
16863
16768
|
nav: "Zotero",
|
|
16864
16769
|
title: "Zotero",
|
|
16865
|
-
description: "
|
|
16866
|
-
loading: "\u6B63\u5728\u52A0\u8F7D\u8BBE\u7F6E\u2026",
|
|
16867
|
-
unavailable: "\u8BBE\u7F6E\u4E0D\u53EF\u7528\uFF1A\u672C\u90E8\u7F72\u672A\u4E3A Zotero \u7EC4\u5408\u8BBE\u7F6E\u6587\u6863\u3002",
|
|
16770
|
+
description: "Zotero \u6587\u732E\u5E93\u7684\u63A5\u5165\u914D\u7F6E\u3002",
|
|
16868
16771
|
overridden: "\u5DF2\u8986\u76D6",
|
|
16869
16772
|
reset: "\u6062\u590D\u9ED8\u8BA4",
|
|
16870
16773
|
readOnly: "\u672C\u90E8\u7F72\u7684\u8BBE\u7F6E\u4E3A\u53EA\u8BFB\u3002",
|
|
16774
|
+
discard: "\u653E\u5F03\u4FEE\u6539",
|
|
16775
|
+
unsaved: "\u672A\u4FDD\u5B58",
|
|
16776
|
+
expand: "\u5C55\u5F00\u8BBE\u7F6E",
|
|
16777
|
+
collapse: "\u6536\u8D77\u8BBE\u7F6E",
|
|
16871
16778
|
save: "\u4FDD\u5B58",
|
|
16872
16779
|
saving: "\u4FDD\u5B58\u4E2D\u2026",
|
|
16873
16780
|
saveFailed: "\u672C\u90E8\u7F72\u6CA1\u6709\u63A5\u53D7\u8FD9\u4E9B\u503C\uFF0C\u5DF2\u4FDD\u7559\u4F9B\u4F60\u4FEE\u6539\u3002",
|
|
@@ -16916,7 +16823,7 @@ var zh = {
|
|
|
16916
16823
|
defaultLocaleHint: "citation/bibliography \u683C\u5F0F\u7684 CSL locale\uFF08\u5982 en-US\uFF09\u3002",
|
|
16917
16824
|
groupWeb: "Web \u89C6\u56FE",
|
|
16918
16825
|
webEnabled: "Zotero \u4F1A\u8BDD\u6807\u7B7E\u9875",
|
|
16919
|
-
webEnabledHint: "\u5728\u4F1A\u8BDD\u9876\u90E8\u663E\u793A Zotero \u4E13\u5C5E\u6807\u7B7E\u9875\uFF0C\u5305\u542B\u6587\u732E\u3001\u5F15\u7528\u4E0E\u6D3B\u52A8\uFF1B\u5173\u95ED\u540E\
|
|
16826
|
+
webEnabledHint: "\u5728\u4F1A\u8BDD\u9876\u90E8\u663E\u793A Zotero \u4E13\u5C5E\u6807\u7B7E\u9875\uFF0C\u5305\u542B\u6587\u732E\u3001\u5F15\u7528\u4E0E\u6D3B\u52A8\uFF1B\u5173\u95ED\u540E\u6807\u7B7E\u9875\u7ACB\u5373\u9690\u85CF\u3002",
|
|
16920
16827
|
copy: "\u590D\u5236",
|
|
16921
16828
|
copied: "\u5DF2\u590D\u5236",
|
|
16922
16829
|
checking: "\u68C0\u67E5\u4E2D\u2026",
|
|
@@ -17000,11 +16907,27 @@ var zh = {
|
|
|
17000
16907
|
|
|
17001
16908
|
// src/client/index.ts
|
|
17002
16909
|
var NS = "zotero";
|
|
17003
|
-
var inject = ["locale", "slots", "remote"];
|
|
16910
|
+
var inject = ["locale", "slots", "connection", "settingsScope", "remote"];
|
|
17004
16911
|
function apply(ctx) {
|
|
17005
16912
|
ctx.effect(() => ctx.locale.register(NS, { zh, en }), "dsh-zotero: page dictionaries");
|
|
16913
|
+
const scope = ctx.settingsScope.bind({
|
|
16914
|
+
namespace: ZOTERO_SETTINGS_NAMESPACE,
|
|
16915
|
+
decode: (section) => typeof section === "object" && section !== null && !Array.isArray(section) ? section : void 0
|
|
16916
|
+
});
|
|
16917
|
+
const card2 = new ZoteroCardController(scope);
|
|
16918
|
+
ctx.slots.inject(
|
|
16919
|
+
"settings.plugin.item",
|
|
16920
|
+
() => ctx.slots.register(
|
|
16921
|
+
{
|
|
16922
|
+
name: "settings.plugin.item",
|
|
16923
|
+
key: ZOTERO_SETTINGS_NAMESPACE,
|
|
16924
|
+
locale: NS,
|
|
16925
|
+
inject: () => card2.inject()
|
|
16926
|
+
},
|
|
16927
|
+
ZoteroPluginCard
|
|
16928
|
+
)
|
|
16929
|
+
);
|
|
17006
16930
|
let zotero;
|
|
17007
|
-
const scope = new RemoteScope(() => zotero);
|
|
17008
16931
|
ctx.effect(async () => {
|
|
17009
16932
|
const dispose = await ctx.remote.$mount(ZOTERO_REMOTE);
|
|
17010
16933
|
zotero = ctx.reflect.get("remote.zotero");
|
|
@@ -17012,55 +16935,41 @@ function apply(ctx) {
|
|
|
17012
16935
|
throw new Error("dsh-zotero: the zotero Remote namespace did not mount");
|
|
17013
16936
|
}
|
|
17014
16937
|
let tabDispose;
|
|
17015
|
-
|
|
17016
|
-
|
|
17017
|
-
const
|
|
17018
|
-
|
|
17019
|
-
|
|
17020
|
-
|
|
17021
|
-
|
|
17022
|
-
|
|
17023
|
-
|
|
17024
|
-
|
|
17025
|
-
|
|
17026
|
-
|
|
17027
|
-
|
|
17028
|
-
|
|
17029
|
-
|
|
17030
|
-
|
|
17031
|
-
|
|
17032
|
-
|
|
17033
|
-
|
|
17034
|
-
|
|
17035
|
-
|
|
17036
|
-
|
|
17037
|
-
|
|
17038
|
-
|
|
17039
|
-
|
|
17040
|
-
}
|
|
17041
|
-
|
|
16938
|
+
const tabT = ctx.locale.bind(NS);
|
|
16939
|
+
const sync = () => {
|
|
16940
|
+
const snapshot = scope.getSnapshot();
|
|
16941
|
+
const enabled = snapshot.status !== "ready" || snapshot.value?.webEnabled !== false;
|
|
16942
|
+
if (enabled && tabDispose === void 0) {
|
|
16943
|
+
tabDispose = ctx.slots.inject(
|
|
16944
|
+
"conversation.view",
|
|
16945
|
+
() => ctx.slots.register(
|
|
16946
|
+
{
|
|
16947
|
+
name: "conversation.view",
|
|
16948
|
+
id: "zotero",
|
|
16949
|
+
order: 30,
|
|
16950
|
+
locale: NS,
|
|
16951
|
+
label: () => tabT("nav"),
|
|
16952
|
+
inject: () => ({
|
|
16953
|
+
status: () => zotero.status()
|
|
16954
|
+
})
|
|
16955
|
+
},
|
|
16956
|
+
ZoteroTab
|
|
16957
|
+
)
|
|
16958
|
+
);
|
|
16959
|
+
} else if (!enabled && tabDispose !== void 0) {
|
|
16960
|
+
tabDispose();
|
|
16961
|
+
tabDispose = void 0;
|
|
16962
|
+
}
|
|
16963
|
+
};
|
|
16964
|
+
const unsubscribe = scope.subscribe(sync);
|
|
16965
|
+
sync();
|
|
17042
16966
|
return () => {
|
|
16967
|
+
unsubscribe();
|
|
17043
16968
|
tabDispose?.();
|
|
17044
16969
|
zotero = void 0;
|
|
17045
16970
|
void dispose();
|
|
17046
16971
|
};
|
|
17047
16972
|
}, "dsh-zotero: remote");
|
|
17048
|
-
const card = new ZoteroCardController(scope);
|
|
17049
|
-
const t = ctx.locale.bind(NS);
|
|
17050
|
-
ctx.slots.inject(
|
|
17051
|
-
"settings.section",
|
|
17052
|
-
() => ctx.slots.register(
|
|
17053
|
-
{
|
|
17054
|
-
name: "settings.section",
|
|
17055
|
-
id: "zotero",
|
|
17056
|
-
order: 30,
|
|
17057
|
-
label: () => t("nav"),
|
|
17058
|
-
locale: NS,
|
|
17059
|
-
inject: () => card.inject()
|
|
17060
|
-
},
|
|
17061
|
-
ZoteroSettingsSection
|
|
17062
|
-
)
|
|
17063
|
-
);
|
|
17064
16973
|
}
|
|
17065
16974
|
return module.exports; } });
|
|
17066
16975
|
//# sourceMappingURL=client.js.map
|