@celljs/ta-extensions 4.7.0 → 4.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +4 -1
- package/README.md +4 -1
- package/host/index.mjs +64 -61
- package/package.json +14 -4
- package/skills/ta-package/SKILL.md +12 -7
- package/web/index.js +488 -120
- package/web-src/actions.ts +0 -204
- package/web-src/archive.spec.ts +0 -101
- package/web-src/archive.ts +0 -229
- package/web-src/context.ts +0 -24
- package/web-src/extensions-util.spec.ts +0 -38
- package/web-src/extensions-util.ts +0 -40
- package/web-src/host.spec.ts +0 -72
- package/web-src/host.ts +0 -115
- package/web-src/i18n.ts +0 -240
- package/web-src/import-dialog.tsx +0 -89
- package/web-src/index.tsx +0 -50
- package/web-src/market-detail.tsx +0 -138
- package/web-src/market-parts.tsx +0 -94
- package/web-src/market-store.ts +0 -116
- package/web-src/market-style.ts +0 -94
- package/web-src/market-util.spec.ts +0 -79
- package/web-src/market-util.ts +0 -239
- package/web-src/market-view.tsx +0 -245
- package/web-src/market.spec.ts +0 -154
- package/web-src/market.ts +0 -232
- package/web-src/page.tsx +0 -278
- package/web-src/pictures.tsx +0 -87
- package/web-src/react.ts +0 -11
- package/web-src/signal.ts +0 -34
- package/web-src/style.ts +0 -92
package/web/index.js
CHANGED
|
@@ -43,7 +43,8 @@ var EN = {
|
|
|
43
43
|
changeTitle: "Change {name}",
|
|
44
44
|
changePlaceholder: "What should it do differently?",
|
|
45
45
|
mine: "Yours",
|
|
46
|
-
mineEmpty: "
|
|
46
|
+
mineEmpty: "No extensions yet",
|
|
47
|
+
mineEmptyHint: "Say what you want above, or find one in the marketplace",
|
|
47
48
|
tabMine: "Mine",
|
|
48
49
|
tabMarket: "Marketplace",
|
|
49
50
|
browseMarket: "Browse the marketplace",
|
|
@@ -104,13 +105,20 @@ var EN = {
|
|
|
104
105
|
turnedOff: "{name} is off",
|
|
105
106
|
shareTitle: "Hand them on",
|
|
106
107
|
shareSteps: ["Export", "Send the .tgz", "They import it"],
|
|
107
|
-
shareMore: "npm and Git sources import too, or just tell Ta.",
|
|
108
|
+
shareMore: "Or tap the share button of an extension for a link and a QR code; npm and Git sources import too, or just tell Ta.",
|
|
108
109
|
importTitle: "Import an extension",
|
|
109
110
|
dropHere: "Drop a .tgz file here, or",
|
|
110
111
|
chooseFile: "choose a file",
|
|
111
112
|
orSource: "Or install it from npm or Git",
|
|
112
113
|
sourcePlaceholder: "npm:@scope/name or https://github.com/you/repo",
|
|
113
114
|
install: "Install",
|
|
115
|
+
share: "Share",
|
|
116
|
+
installedTitle: "Installed",
|
|
117
|
+
builtinTitle: "Come with Ta",
|
|
118
|
+
madeHere: "On this computer",
|
|
119
|
+
openNow: "Open",
|
|
120
|
+
openingNow: "Opening…",
|
|
121
|
+
openNowHint: "Run it now without installing it: only its pages, cleared after a while unused",
|
|
114
122
|
working: "Working…",
|
|
115
123
|
trust: "An extension runs code on this computer: import only those of people you trust.",
|
|
116
124
|
dropToImport: "Drop to import",
|
|
@@ -155,7 +163,8 @@ var ZH = {
|
|
|
155
163
|
changeTitle: "修改 {name}",
|
|
156
164
|
changePlaceholder: "想让它有什么不同?",
|
|
157
165
|
mine: "我的扩展",
|
|
158
|
-
mineEmpty: "
|
|
166
|
+
mineEmpty: "还没有扩展",
|
|
167
|
+
mineEmptyHint: "在上面说一句就能做一个,也可以去市场找找",
|
|
159
168
|
tabMine: "我的",
|
|
160
169
|
tabMarket: "市场",
|
|
161
170
|
browseMarket: "去市场看看",
|
|
@@ -216,13 +225,20 @@ var ZH = {
|
|
|
216
225
|
turnedOff: "已停用 {name}",
|
|
217
226
|
shareTitle: "分享给别人",
|
|
218
227
|
shareSteps: ["导出", "发送 .tgz 文件", "对方导入"],
|
|
219
|
-
shareMore: "
|
|
228
|
+
shareMore: "也可以点扩展的分享按钮,生成链接和二维码;也支持 npm、Git 来源,或者直接对 Ta 说。",
|
|
220
229
|
importTitle: "导入扩展",
|
|
221
230
|
dropHere: "把 .tgz 文件拖到这里,或",
|
|
222
231
|
chooseFile: "选择文件",
|
|
223
232
|
orSource: "或者从 npm、Git 安装",
|
|
224
233
|
sourcePlaceholder: "npm:@scope/name 或 https://github.com/you/repo",
|
|
225
234
|
install: "安装",
|
|
235
|
+
share: "分享",
|
|
236
|
+
installedTitle: "已安装",
|
|
237
|
+
builtinTitle: "内置",
|
|
238
|
+
madeHere: "本机的扩展",
|
|
239
|
+
openNow: "打开",
|
|
240
|
+
openingNow: "正在打开…",
|
|
241
|
+
openNowHint: "不安装,直接运行:只运行它的页面,一段时间不用会被清除",
|
|
226
242
|
working: "正在处理…",
|
|
227
243
|
trust: "扩展会在这台电脑上运行代码:只导入你信任的人给的扩展。",
|
|
228
244
|
dropToImport: "松开即可导入",
|
|
@@ -275,7 +291,7 @@ class PackagesStore {
|
|
|
275
291
|
}
|
|
276
292
|
async load() {
|
|
277
293
|
try {
|
|
278
|
-
this.current = { packages: await this.pi.packages.listPackages() };
|
|
294
|
+
this.current = { packages: (await this.pi.packages.listPackages()).filter((pkg) => pkg.origin !== "temporary") };
|
|
279
295
|
} catch (error) {
|
|
280
296
|
this.current = { packages: this.current.packages ?? [] };
|
|
281
297
|
this.pi.ui.notify(error instanceof Error ? error.message : String(error), "error");
|
|
@@ -405,6 +421,12 @@ class ExtensionActions {
|
|
|
405
421
|
this.market.setInstalling(name, false);
|
|
406
422
|
}
|
|
407
423
|
}
|
|
424
|
+
async openFromMarket(name) {
|
|
425
|
+
return this.guard(async () => {
|
|
426
|
+
await this.pi.openTemporary(`npm:${name}`, "market");
|
|
427
|
+
return true;
|
|
428
|
+
});
|
|
429
|
+
}
|
|
408
430
|
async changed() {
|
|
409
431
|
await this.pi.reloadExtensions();
|
|
410
432
|
await this.store.load();
|
|
@@ -513,6 +535,242 @@ class MarketStore {
|
|
|
513
535
|
}
|
|
514
536
|
}
|
|
515
537
|
|
|
538
|
+
// ../ta-protocol/esm/common/access-protocol.js
|
|
539
|
+
var TaAccessServer = Symbol("TaAccessServer");
|
|
540
|
+
// ../ta-protocol/esm/common/auth-protocol.js
|
|
541
|
+
var TaAuthServer = Symbol("TaAuthServer");
|
|
542
|
+
// ../ta-protocol/esm/common/gateway-protocol.js
|
|
543
|
+
var TaGatewayServer = Symbol("TaGatewayServer");
|
|
544
|
+
// ../ta-protocol/esm/common/location.js
|
|
545
|
+
var TaLocation;
|
|
546
|
+
(function(TaLocation2) {
|
|
547
|
+
TaLocation2.SSH = "ssh://";
|
|
548
|
+
const HOST = /^(?!-)[\w.@:%+[\]-]+$/;
|
|
549
|
+
function isRemote(location) {
|
|
550
|
+
return location.startsWith(TaLocation2.SSH);
|
|
551
|
+
}
|
|
552
|
+
TaLocation2.isRemote = isRemote;
|
|
553
|
+
function parse(location) {
|
|
554
|
+
if (!isRemote(location)) {
|
|
555
|
+
return;
|
|
556
|
+
}
|
|
557
|
+
const rest = location.slice(TaLocation2.SSH.length);
|
|
558
|
+
const slash = rest.indexOf("/");
|
|
559
|
+
const host2 = slash < 0 ? rest : rest.slice(0, slash);
|
|
560
|
+
const path2 = slash < 0 ? "" : normalize(rest.slice(slash));
|
|
561
|
+
if (!isHost(host2)) {
|
|
562
|
+
throw new Error(`${JSON.stringify(location)} names no host: write ssh://<host>/<path>, the host as ssh takes it.`);
|
|
563
|
+
}
|
|
564
|
+
return { host: host2, path: path2 };
|
|
565
|
+
}
|
|
566
|
+
TaLocation2.parse = parse;
|
|
567
|
+
function isHost(host2) {
|
|
568
|
+
return HOST.test(host2);
|
|
569
|
+
}
|
|
570
|
+
TaLocation2.isHost = isHost;
|
|
571
|
+
const FLAGS = /^-[46AaCfGgKkMNnqsTtVvXxYy]+$/;
|
|
572
|
+
function readHost(input) {
|
|
573
|
+
const words = input.trim().split(/\s+/).filter(Boolean);
|
|
574
|
+
if (words[0] === "ssh") {
|
|
575
|
+
words.shift();
|
|
576
|
+
}
|
|
577
|
+
let destination;
|
|
578
|
+
let port;
|
|
579
|
+
let user;
|
|
580
|
+
const options = [];
|
|
581
|
+
for (let i = 0;i < words.length; i++) {
|
|
582
|
+
const word = words[i];
|
|
583
|
+
const glued = /^-([pl])(.+)$/.exec(word);
|
|
584
|
+
if (word === "-p" || word === "-l" || glued) {
|
|
585
|
+
const value = glued ? glued[2] : words[++i];
|
|
586
|
+
if (value === undefined) {
|
|
587
|
+
return { error: "invalid" };
|
|
588
|
+
}
|
|
589
|
+
if ((glued ? glued[1] : word[1]) === "p") {
|
|
590
|
+
port = value;
|
|
591
|
+
} else {
|
|
592
|
+
user = value;
|
|
593
|
+
}
|
|
594
|
+
} else if (word === "-o" || word.startsWith("-o")) {
|
|
595
|
+
const value = word === "-o" ? words[++i] : word.slice(2);
|
|
596
|
+
const option = /^(port|user)\s*=?\s*(.+)$/i.exec(value !== null && value !== undefined ? value : "");
|
|
597
|
+
if (!option) {
|
|
598
|
+
options.push(`-o ${value !== null && value !== undefined ? value : ""}`.trim());
|
|
599
|
+
} else if (option[1].toLowerCase() === "port") {
|
|
600
|
+
port = option[2];
|
|
601
|
+
} else {
|
|
602
|
+
user = option[2];
|
|
603
|
+
}
|
|
604
|
+
} else if (FLAGS.test(word)) {} else if (word.startsWith("-")) {
|
|
605
|
+
options.push(/^-[bBcDeEFiIJLmOQRSwW]$/.test(word) && words[i + 1] !== undefined ? `${word} ${words[++i]}` : word);
|
|
606
|
+
} else if (destination === undefined) {
|
|
607
|
+
destination = word;
|
|
608
|
+
} else {
|
|
609
|
+
return { error: "invalid" };
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
if (options.length > 0) {
|
|
613
|
+
return { error: "options", options };
|
|
614
|
+
}
|
|
615
|
+
if (!destination) {
|
|
616
|
+
return { error: "empty" };
|
|
617
|
+
}
|
|
618
|
+
let host2 = destination.replace(/^ssh:\/\//, "").replace(/\/.*$/, "");
|
|
619
|
+
if (user && !host2.includes("@")) {
|
|
620
|
+
host2 = `${user}@${host2}`;
|
|
621
|
+
}
|
|
622
|
+
if (port) {
|
|
623
|
+
if (!/^\d{1,5}$/.test(port) || /:\d+$/.test(host2)) {
|
|
624
|
+
return { error: "invalid" };
|
|
625
|
+
}
|
|
626
|
+
host2 = port === "22" ? host2 : `${host2}:${port}`;
|
|
627
|
+
}
|
|
628
|
+
return isHost(host2) ? { host: host2 } : { error: "invalid" };
|
|
629
|
+
}
|
|
630
|
+
TaLocation2.readHost = readHost;
|
|
631
|
+
function ssh(host2, path2 = "") {
|
|
632
|
+
return `${TaLocation2.SSH}${host2}${path2 ? normalize(path2) : ""}`;
|
|
633
|
+
}
|
|
634
|
+
TaLocation2.ssh = ssh;
|
|
635
|
+
function hostLabel(host2) {
|
|
636
|
+
const name = host2.replace(/^[^@]*@/, "").replace(/^\[(.*)\](?::\d+)?$/, "$1").replace(/^([^:]*):\d+$/, "$1");
|
|
637
|
+
return /^[\d.]+$/.test(name) || name.includes(":") ? name : name.split(".")[0] || name;
|
|
638
|
+
}
|
|
639
|
+
TaLocation2.hostLabel = hostLabel;
|
|
640
|
+
function host(location) {
|
|
641
|
+
var _a;
|
|
642
|
+
return isRemote(location) ? (_a = parse(location)) === null || _a === undefined ? undefined : _a.host : undefined;
|
|
643
|
+
}
|
|
644
|
+
TaLocation2.host = host;
|
|
645
|
+
function path(location) {
|
|
646
|
+
var _a;
|
|
647
|
+
var _b;
|
|
648
|
+
return (_b = (_a = parse(location)) === null || _a === undefined ? undefined : _a.path) !== null && _b !== undefined ? _b : location;
|
|
649
|
+
}
|
|
650
|
+
TaLocation2.path = path;
|
|
651
|
+
function parent(location) {
|
|
652
|
+
const remote = parse(location);
|
|
653
|
+
if (remote) {
|
|
654
|
+
const above = remote.path ? parentPath(remote.path) : undefined;
|
|
655
|
+
return above === undefined ? undefined : ssh(remote.host, above);
|
|
656
|
+
}
|
|
657
|
+
return parentPath(location);
|
|
658
|
+
}
|
|
659
|
+
TaLocation2.parent = parent;
|
|
660
|
+
function child(location, name) {
|
|
661
|
+
const remote = parse(location);
|
|
662
|
+
if (remote) {
|
|
663
|
+
return ssh(remote.host, childPath(remote.path || "/", name));
|
|
664
|
+
}
|
|
665
|
+
return childPath(location, name);
|
|
666
|
+
}
|
|
667
|
+
TaLocation2.child = child;
|
|
668
|
+
function basename(location) {
|
|
669
|
+
const remote = parse(location);
|
|
670
|
+
const path2 = (remote ? remote.path : location).replace(/[\\/]+$/, "");
|
|
671
|
+
const name = path2.slice(Math.max(path2.lastIndexOf("/"), path2.lastIndexOf("\\")) + 1);
|
|
672
|
+
return name || (remote === null || remote === undefined ? undefined : remote.host) || location;
|
|
673
|
+
}
|
|
674
|
+
TaLocation2.basename = basename;
|
|
675
|
+
function parentPath(path2) {
|
|
676
|
+
const trimmed = path2.replace(/[\\/]+$/, "");
|
|
677
|
+
const at = Math.max(trimmed.lastIndexOf("/"), trimmed.lastIndexOf("\\"));
|
|
678
|
+
if (at < 0) {
|
|
679
|
+
return;
|
|
680
|
+
}
|
|
681
|
+
const head = trimmed.slice(0, at);
|
|
682
|
+
return head === "" || /^[A-Za-z]:$/.test(head) ? head + trimmed[at] : head;
|
|
683
|
+
}
|
|
684
|
+
function childPath(path2, name) {
|
|
685
|
+
const separator = path2.includes("/") || !path2.includes("\\") ? "/" : "\\";
|
|
686
|
+
return path2.endsWith(separator) ? path2 + name : path2 + separator + name;
|
|
687
|
+
}
|
|
688
|
+
function normalize(path2) {
|
|
689
|
+
const squeezed = `/${path2}`.replace(/\/+/g, "/");
|
|
690
|
+
return squeezed.length > 1 ? squeezed.replace(/\/$/, "") : squeezed;
|
|
691
|
+
}
|
|
692
|
+
})(TaLocation || (TaLocation = {}));
|
|
693
|
+
// ../ta-protocol/esm/common/package-protocol.js
|
|
694
|
+
var TaPackageServer = Symbol("TaPackageServer");
|
|
695
|
+
var TaPackageTextUtil;
|
|
696
|
+
(function(TaPackageTextUtil2) {
|
|
697
|
+
function pick(text, language) {
|
|
698
|
+
var _a, _b, _c, _d;
|
|
699
|
+
if (text === undefined || typeof text === "string") {
|
|
700
|
+
return text;
|
|
701
|
+
}
|
|
702
|
+
return (_d = (_c = (_b = (_a = text[language]) !== null && _a !== undefined ? _a : text[language.split("-")[0]]) !== null && _b !== undefined ? _b : text.en) !== null && _c !== undefined ? _c : text["en-US"]) !== null && _d !== undefined ? _d : Object.values(text)[0];
|
|
703
|
+
}
|
|
704
|
+
TaPackageTextUtil2.pick = pick;
|
|
705
|
+
})(TaPackageTextUtil || (TaPackageTextUtil = {}));
|
|
706
|
+
// ../ta-protocol/esm/common/relay-protocol.js
|
|
707
|
+
var TaRelayServer = Symbol("TaRelayServer");
|
|
708
|
+
// ../ta-protocol/esm/common/remote-protocol.js
|
|
709
|
+
var TaRemoteServer = Symbol("TaRemoteServer");
|
|
710
|
+
// ../ta-protocol/esm/common/settings-protocol.js
|
|
711
|
+
var TaSettingsServer = Symbol("TaSettingsServer");
|
|
712
|
+
// ../ta-protocol/esm/common/ta-protocol.js
|
|
713
|
+
var TaServer = Symbol("TaServer");
|
|
714
|
+
var TaClient = Symbol("TaClient");
|
|
715
|
+
var TaErrorUtil;
|
|
716
|
+
(function(TaErrorUtil2) {
|
|
717
|
+
function code(error) {
|
|
718
|
+
var _a;
|
|
719
|
+
var _b;
|
|
720
|
+
const failure = error;
|
|
721
|
+
const code2 = (_b = failure === null || failure === undefined ? undefined : failure.code) !== null && _b !== undefined ? _b : (_a = failure === null || failure === undefined ? undefined : failure.data) === null || _a === undefined ? undefined : _a.code;
|
|
722
|
+
return typeof code2 === "string" ? code2 : undefined;
|
|
723
|
+
}
|
|
724
|
+
TaErrorUtil2.code = code;
|
|
725
|
+
})(TaErrorUtil || (TaErrorUtil = {}));
|
|
726
|
+
var TaMessageContext;
|
|
727
|
+
(function(TaMessageContext2) {
|
|
728
|
+
const BLOCK = /^<context>\n?[\s\S]*?\n?<\/context>\n?/;
|
|
729
|
+
function wrap(context, message) {
|
|
730
|
+
return `<context>
|
|
731
|
+
${context}
|
|
732
|
+
</context>
|
|
733
|
+
${message}`;
|
|
734
|
+
}
|
|
735
|
+
TaMessageContext2.wrap = wrap;
|
|
736
|
+
function strip(message) {
|
|
737
|
+
return message.replace(BLOCK, "");
|
|
738
|
+
}
|
|
739
|
+
TaMessageContext2.strip = strip;
|
|
740
|
+
})(TaMessageContext || (TaMessageContext = {}));
|
|
741
|
+
var TaSkillUse;
|
|
742
|
+
(function(TaSkillUse2) {
|
|
743
|
+
const BLOCK = /^<skill name="([^"]+)" location="([^"]+)">\n([\s\S]*?)\n<\/skill>(?:\n\n([\s\S]+))?$/;
|
|
744
|
+
function parse(message) {
|
|
745
|
+
var _a;
|
|
746
|
+
const match = BLOCK.exec(message);
|
|
747
|
+
if (!match) {
|
|
748
|
+
return;
|
|
749
|
+
}
|
|
750
|
+
return { name: match[1], location: match[2], content: match[3], message: ((_a = match[4]) === null || _a === undefined ? undefined : _a.trim()) || undefined };
|
|
751
|
+
}
|
|
752
|
+
TaSkillUse2.parse = parse;
|
|
753
|
+
function command(use) {
|
|
754
|
+
return use.message ? `/skill:${use.name} ${use.message}` : `/skill:${use.name}`;
|
|
755
|
+
}
|
|
756
|
+
TaSkillUse2.command = command;
|
|
757
|
+
})(TaSkillUse || (TaSkillUse = {}));
|
|
758
|
+
// ../ta-protocol/esm/common/workspace-protocol.js
|
|
759
|
+
var TaWorkspaceServer = Symbol("TaWorkspaceServer");
|
|
760
|
+
var TaTerminalServer = Symbol("TaTerminalServer");
|
|
761
|
+
var TaExcludedFiles;
|
|
762
|
+
(function(TaExcludedFiles2) {
|
|
763
|
+
TaExcludedFiles2.NAMES = [".git", ".svn", ".hg", ".DS_Store", "Thumbs.db"];
|
|
764
|
+
function has(name) {
|
|
765
|
+
return TaExcludedFiles2.NAMES.includes(name);
|
|
766
|
+
}
|
|
767
|
+
TaExcludedFiles2.has = has;
|
|
768
|
+
function filter(entries) {
|
|
769
|
+
return entries.filter((entry) => !has(entry.name));
|
|
770
|
+
}
|
|
771
|
+
TaExcludedFiles2.filter = filter;
|
|
772
|
+
})(TaExcludedFiles || (TaExcludedFiles = {}));
|
|
773
|
+
var TA_UPLOAD_PART_BYTES = 4 * 1024 * 1024;
|
|
516
774
|
// web-src/context.ts
|
|
517
775
|
function icon(pi, name, fallback = "Square") {
|
|
518
776
|
return pi.ui.icons[name] ?? pi.ui.icons[fallback] ?? (() => null);
|
|
@@ -817,6 +1075,7 @@ function MarketDetailView({ context, name, onBack }) {
|
|
|
817
1075
|
const [detail, setDetail] = React.useState();
|
|
818
1076
|
const [error, setError] = React.useState();
|
|
819
1077
|
const [attempt, setAttempt] = React.useState(0);
|
|
1078
|
+
const [opening, setOpening] = React.useState(false);
|
|
820
1079
|
React.useEffect(() => {
|
|
821
1080
|
let live = true;
|
|
822
1081
|
setError(undefined);
|
|
@@ -841,6 +1100,7 @@ function MarketDetailView({ context, name, onBack }) {
|
|
|
841
1100
|
const ArrowLeft = icon(pi, "ArrowLeft");
|
|
842
1101
|
const External = icon(pi, "ExternalLink");
|
|
843
1102
|
const Trash = icon(pi, "Trash2");
|
|
1103
|
+
const QrCode = icon(pi, "QrCode", "Share2");
|
|
844
1104
|
const Markdown = pi.ui.Markdown;
|
|
845
1105
|
const ago = MarketUtil.ago(summary?.date, pi.ui.language);
|
|
846
1106
|
const facts = [
|
|
@@ -855,6 +1115,8 @@ function MarketDetailView({ context, name, onBack }) {
|
|
|
855
1115
|
{ key: "source", label: words.source, href: summary?.links.repository },
|
|
856
1116
|
{ key: "home", label: words.homepage, href: summary?.links.homepage !== summary?.links.repository ? summary?.links.homepage : undefined }
|
|
857
1117
|
].filter((link) => !!link.href && /^https?:\/\//.test(link.href));
|
|
1118
|
+
const kinds = detail?.resources.length ? detail.resources : summary?.kinds ?? [];
|
|
1119
|
+
const hasWeb = kinds.includes("web");
|
|
858
1120
|
const tags = ((detail?.resources.length) ? detail.resources : summary?.kinds ?? []).map((type) => type === "web" ? words.kinds.web : words.marketKinds[type]);
|
|
859
1121
|
return /* @__PURE__ */ React.createElement("article", {
|
|
860
1122
|
className: "tax-detail",
|
|
@@ -890,13 +1152,28 @@ function MarketDetailView({ context, name, onBack }) {
|
|
|
890
1152
|
context,
|
|
891
1153
|
name,
|
|
892
1154
|
large: true
|
|
893
|
-
}), status.kind === "
|
|
1155
|
+
}), status.kind === "none" && hasWeb && /* @__PURE__ */ React.createElement("button", {
|
|
1156
|
+
type: "button",
|
|
1157
|
+
className: "tax-button tax-button-quiet",
|
|
1158
|
+
title: words.openNowHint,
|
|
1159
|
+
disabled: opening,
|
|
1160
|
+
onClick: () => {
|
|
1161
|
+
setOpening(true);
|
|
1162
|
+
actions.openFromMarket(name).finally(() => setOpening(false));
|
|
1163
|
+
}
|
|
1164
|
+
}, opening ? words.openingNow : words.openNow), status.kind === "installed" && /* @__PURE__ */ React.createElement("button", {
|
|
894
1165
|
type: "button",
|
|
895
1166
|
className: "tax-button tax-button-quiet",
|
|
896
1167
|
onClick: () => void actions.remove(status.pkg)
|
|
897
1168
|
}, /* @__PURE__ */ React.createElement(Trash, {
|
|
898
1169
|
size: 14
|
|
899
|
-
}), " ", words.remove),
|
|
1170
|
+
}), " ", words.remove), /* @__PURE__ */ React.createElement("button", {
|
|
1171
|
+
type: "button",
|
|
1172
|
+
className: "tax-button tax-button-quiet",
|
|
1173
|
+
onClick: () => pi.ui.shareExtension({ title: name, source: `npm:${name}` })
|
|
1174
|
+
}, /* @__PURE__ */ React.createElement(QrCode, {
|
|
1175
|
+
size: 14
|
|
1176
|
+
}), " ", words.share), links.map((link) => /* @__PURE__ */ React.createElement("a", {
|
|
900
1177
|
key: link.key,
|
|
901
1178
|
className: "tax-button tax-button-quiet",
|
|
902
1179
|
href: link.href,
|
|
@@ -1140,16 +1417,8 @@ function MarketCard({ context, pkg, onOpen }) {
|
|
|
1140
1417
|
}
|
|
1141
1418
|
|
|
1142
1419
|
// web-src/pictures.tsx
|
|
1143
|
-
var Frame = () => /* @__PURE__ */ React.createElement("rect", {
|
|
1144
|
-
className: "tax-pic-frame",
|
|
1145
|
-
x: "1",
|
|
1146
|
-
y: "1",
|
|
1147
|
-
width: "158",
|
|
1148
|
-
height: "94",
|
|
1149
|
-
rx: "9"
|
|
1150
|
-
});
|
|
1151
1420
|
var Line = ({ x, y, w }) => /* @__PURE__ */ React.createElement("rect", {
|
|
1152
|
-
className: "
|
|
1421
|
+
className: "ta-pic-line",
|
|
1153
1422
|
x,
|
|
1154
1423
|
y,
|
|
1155
1424
|
width: w,
|
|
@@ -1157,7 +1426,7 @@ var Line = ({ x, y, w }) => /* @__PURE__ */ React.createElement("rect", {
|
|
|
1157
1426
|
rx: "2.5"
|
|
1158
1427
|
});
|
|
1159
1428
|
function Card() {
|
|
1160
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
1429
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Line, {
|
|
1161
1430
|
x: 12,
|
|
1162
1431
|
y: 16,
|
|
1163
1432
|
w: 58
|
|
@@ -1170,32 +1439,32 @@ function Card() {
|
|
|
1170
1439
|
y: 38,
|
|
1171
1440
|
w: 46
|
|
1172
1441
|
}), /* @__PURE__ */ React.createElement("rect", {
|
|
1173
|
-
className: "
|
|
1442
|
+
className: "ta-pic-pane",
|
|
1174
1443
|
x: "100",
|
|
1175
1444
|
y: "1",
|
|
1176
1445
|
width: "59",
|
|
1177
1446
|
height: "94"
|
|
1178
1447
|
}), /* @__PURE__ */ React.createElement("rect", {
|
|
1179
|
-
className: "
|
|
1448
|
+
className: "ta-pic-accent",
|
|
1180
1449
|
x: "108",
|
|
1181
1450
|
y: "14",
|
|
1182
1451
|
width: "43",
|
|
1183
1452
|
height: "38",
|
|
1184
1453
|
rx: "6"
|
|
1185
1454
|
}), /* @__PURE__ */ React.createElement("circle", {
|
|
1186
|
-
className: "
|
|
1455
|
+
className: "ta-pic-mark",
|
|
1187
1456
|
cx: "129.5",
|
|
1188
1457
|
cy: "33",
|
|
1189
1458
|
r: "10"
|
|
1190
1459
|
}), /* @__PURE__ */ React.createElement("path", {
|
|
1191
|
-
className: "
|
|
1460
|
+
className: "ta-pic-hand",
|
|
1192
1461
|
d: "M129.5 27v6l4 3"
|
|
1193
1462
|
}), /* @__PURE__ */ React.createElement(Line, {
|
|
1194
1463
|
x: 108,
|
|
1195
1464
|
y: 62,
|
|
1196
1465
|
w: 34
|
|
1197
1466
|
}), /* @__PURE__ */ React.createElement("rect", {
|
|
1198
|
-
className: "
|
|
1467
|
+
className: "ta-pic-box",
|
|
1199
1468
|
x: "12",
|
|
1200
1469
|
y: "72",
|
|
1201
1470
|
width: "78",
|
|
@@ -1204,29 +1473,29 @@ function Card() {
|
|
|
1204
1473
|
}));
|
|
1205
1474
|
}
|
|
1206
1475
|
function Page() {
|
|
1207
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
1208
|
-
className: "
|
|
1476
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("rect", {
|
|
1477
|
+
className: "ta-pic-pane",
|
|
1209
1478
|
x: "1",
|
|
1210
1479
|
y: "1",
|
|
1211
1480
|
width: "20",
|
|
1212
1481
|
height: "94"
|
|
1213
1482
|
}), /* @__PURE__ */ React.createElement("circle", {
|
|
1214
|
-
className: "
|
|
1483
|
+
className: "ta-pic-line",
|
|
1215
1484
|
cx: "11",
|
|
1216
1485
|
cy: "16",
|
|
1217
1486
|
r: "3.5"
|
|
1218
1487
|
}), /* @__PURE__ */ React.createElement("circle", {
|
|
1219
|
-
className: "
|
|
1488
|
+
className: "ta-pic-mark",
|
|
1220
1489
|
cx: "11",
|
|
1221
1490
|
cy: "30",
|
|
1222
1491
|
r: "3.5"
|
|
1223
1492
|
}), /* @__PURE__ */ React.createElement("circle", {
|
|
1224
|
-
className: "
|
|
1493
|
+
className: "ta-pic-line",
|
|
1225
1494
|
cx: "11",
|
|
1226
1495
|
cy: "44",
|
|
1227
1496
|
r: "3.5"
|
|
1228
1497
|
}), /* @__PURE__ */ React.createElement("rect", {
|
|
1229
|
-
className: "
|
|
1498
|
+
className: "ta-pic-accent",
|
|
1230
1499
|
x: "31",
|
|
1231
1500
|
y: "13",
|
|
1232
1501
|
width: "118",
|
|
@@ -1234,7 +1503,7 @@ function Page() {
|
|
|
1234
1503
|
rx: "6"
|
|
1235
1504
|
}), [18, 30, 24, 42, 34, 50].map((height, i) => /* @__PURE__ */ React.createElement("rect", {
|
|
1236
1505
|
key: height,
|
|
1237
|
-
className: "
|
|
1506
|
+
className: "ta-pic-mark",
|
|
1238
1507
|
x: 42 + i * 17,
|
|
1239
1508
|
y: 73 - height,
|
|
1240
1509
|
width: "9",
|
|
@@ -1243,8 +1512,8 @@ function Page() {
|
|
|
1243
1512
|
})));
|
|
1244
1513
|
}
|
|
1245
1514
|
function Command() {
|
|
1246
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
1247
|
-
className: "
|
|
1515
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("rect", {
|
|
1516
|
+
className: "ta-pic-line",
|
|
1248
1517
|
x: "70",
|
|
1249
1518
|
y: "12",
|
|
1250
1519
|
width: "76",
|
|
@@ -1259,62 +1528,62 @@ function Command() {
|
|
|
1259
1528
|
y: 47,
|
|
1260
1529
|
w: 60
|
|
1261
1530
|
}), /* @__PURE__ */ React.createElement("rect", {
|
|
1262
|
-
className: "
|
|
1531
|
+
className: "ta-pic-box",
|
|
1263
1532
|
x: "10",
|
|
1264
1533
|
y: "64",
|
|
1265
1534
|
width: "140",
|
|
1266
1535
|
height: "21",
|
|
1267
1536
|
rx: "10.5"
|
|
1268
1537
|
}), /* @__PURE__ */ React.createElement("rect", {
|
|
1269
|
-
className: "
|
|
1538
|
+
className: "ta-pic-accent",
|
|
1270
1539
|
x: "16",
|
|
1271
1540
|
y: "68.5",
|
|
1272
1541
|
width: "50",
|
|
1273
1542
|
height: "12",
|
|
1274
1543
|
rx: "6"
|
|
1275
1544
|
}), /* @__PURE__ */ React.createElement("text", {
|
|
1276
|
-
className: "
|
|
1545
|
+
className: "ta-pic-text",
|
|
1277
1546
|
x: "22",
|
|
1278
1547
|
y: "78"
|
|
1279
1548
|
}, "/standup"));
|
|
1280
1549
|
}
|
|
1281
1550
|
function Skill() {
|
|
1282
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
1283
|
-
className: "
|
|
1551
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("rect", {
|
|
1552
|
+
className: "ta-pic-line",
|
|
1284
1553
|
x: "74",
|
|
1285
1554
|
y: "12",
|
|
1286
1555
|
width: "72",
|
|
1287
1556
|
height: "14",
|
|
1288
1557
|
rx: "7"
|
|
1289
1558
|
}), /* @__PURE__ */ React.createElement("rect", {
|
|
1290
|
-
className: "
|
|
1559
|
+
className: "ta-pic-accent",
|
|
1291
1560
|
x: "12",
|
|
1292
1561
|
y: "34",
|
|
1293
1562
|
width: "96",
|
|
1294
1563
|
height: "30",
|
|
1295
1564
|
rx: "8"
|
|
1296
1565
|
}), /* @__PURE__ */ React.createElement("rect", {
|
|
1297
|
-
className: "
|
|
1566
|
+
className: "ta-pic-mark ta-pic-soft",
|
|
1298
1567
|
x: "20",
|
|
1299
1568
|
y: "42",
|
|
1300
1569
|
width: "58",
|
|
1301
1570
|
height: "5",
|
|
1302
1571
|
rx: "2.5"
|
|
1303
1572
|
}), /* @__PURE__ */ React.createElement("rect", {
|
|
1304
|
-
className: "
|
|
1573
|
+
className: "ta-pic-mark ta-pic-soft",
|
|
1305
1574
|
x: "20",
|
|
1306
1575
|
y: "51",
|
|
1307
1576
|
width: "40",
|
|
1308
1577
|
height: "5",
|
|
1309
1578
|
rx: "2.5"
|
|
1310
1579
|
}), /* @__PURE__ */ React.createElement("path", {
|
|
1311
|
-
className: "
|
|
1580
|
+
className: "ta-pic-mark",
|
|
1312
1581
|
d: "M126 34l3.2 8.3 8.3 3.2-8.3 3.2-3.2 8.3-3.2-8.3-8.3-3.2 8.3-3.2z"
|
|
1313
1582
|
}), /* @__PURE__ */ React.createElement("path", {
|
|
1314
|
-
className: "
|
|
1583
|
+
className: "ta-pic-mark ta-pic-soft",
|
|
1315
1584
|
d: "M141 60l1.6 4 4 1.6-4 1.6-1.6 4-1.6-4-4-1.6 4-1.6z"
|
|
1316
1585
|
}), /* @__PURE__ */ React.createElement("rect", {
|
|
1317
|
-
className: "
|
|
1586
|
+
className: "ta-pic-box",
|
|
1318
1587
|
x: "12",
|
|
1319
1588
|
y: "74",
|
|
1320
1589
|
width: "136",
|
|
@@ -1323,13 +1592,10 @@ function Skill() {
|
|
|
1323
1592
|
}));
|
|
1324
1593
|
}
|
|
1325
1594
|
var PICTURES = { card: Card, page: Page, command: Command, skill: Skill };
|
|
1326
|
-
function KindPicture({ kind }) {
|
|
1327
|
-
const Picture =
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
viewBox: "0 0 160 96",
|
|
1331
|
-
"aria-hidden": "true"
|
|
1332
|
-
}, /* @__PURE__ */ React.createElement(Picture, null));
|
|
1595
|
+
function KindPicture({ pi, kind }) {
|
|
1596
|
+
const Picture = pi.ui.Picture;
|
|
1597
|
+
const Shapes = PICTURES[kind];
|
|
1598
|
+
return /* @__PURE__ */ React.createElement(Picture, null, /* @__PURE__ */ React.createElement(Shapes, null));
|
|
1333
1599
|
}
|
|
1334
1600
|
|
|
1335
1601
|
// web-src/page.tsx
|
|
@@ -1411,6 +1677,8 @@ function MineView({ context }) {
|
|
|
1411
1677
|
const [starting, setStarting] = React.useState(false);
|
|
1412
1678
|
const groups = ExtensionsUtil.group(packages ?? []);
|
|
1413
1679
|
const Composer = pi.ui.Composer;
|
|
1680
|
+
const PictureCards = pi.ui.PictureCards;
|
|
1681
|
+
const Empty = pi.ui.Empty;
|
|
1414
1682
|
const Sparkles = icon(pi, "Sparkles");
|
|
1415
1683
|
const Upload = icon(pi, "Upload");
|
|
1416
1684
|
const Store = icon(pi, "Store", "PackageOpen");
|
|
@@ -1431,17 +1699,21 @@ function MineView({ context }) {
|
|
|
1431
1699
|
onSend: make
|
|
1432
1700
|
}), /* @__PURE__ */ React.createElement("div", {
|
|
1433
1701
|
className: "tax-kinds"
|
|
1434
|
-
},
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1702
|
+
}, /* @__PURE__ */ React.createElement(PictureCards, {
|
|
1703
|
+
columns: 4,
|
|
1704
|
+
compactColumns: 2,
|
|
1705
|
+
cards: words.examples.map((example) => ({
|
|
1706
|
+
key: example.kind,
|
|
1707
|
+
picture: /* @__PURE__ */ React.createElement(KindPicture, {
|
|
1708
|
+
pi,
|
|
1709
|
+
kind: example.kind
|
|
1710
|
+
}),
|
|
1711
|
+
label: example.label,
|
|
1712
|
+
hint: example.example,
|
|
1713
|
+
disabled: starting,
|
|
1714
|
+
onPick: () => void make(example.text)
|
|
1715
|
+
}))
|
|
1716
|
+
}))), /* @__PURE__ */ React.createElement("section", {
|
|
1445
1717
|
className: "tax-section"
|
|
1446
1718
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
1447
1719
|
className: "tax-section-head"
|
|
@@ -1455,9 +1727,11 @@ function MineView({ context }) {
|
|
|
1455
1727
|
size: 14
|
|
1456
1728
|
}), " ", words.import)), packages === undefined ? /* @__PURE__ */ React.createElement("div", {
|
|
1457
1729
|
className: "tax-empty"
|
|
1458
|
-
}, words.loading) : groups.mine.length === 0 ? /* @__PURE__ */ React.createElement(
|
|
1459
|
-
|
|
1460
|
-
|
|
1730
|
+
}, words.loading) : groups.mine.length === 0 ? /* @__PURE__ */ React.createElement(Empty, {
|
|
1731
|
+
compact: true,
|
|
1732
|
+
title: words.mineEmpty,
|
|
1733
|
+
hint: words.mineEmptyHint
|
|
1734
|
+
}, /* @__PURE__ */ React.createElement("button", {
|
|
1461
1735
|
type: "button",
|
|
1462
1736
|
className: "tax-button",
|
|
1463
1737
|
onClick: () => context.tab.set("market")
|
|
@@ -1519,14 +1793,19 @@ function ShareSteps({ pi, actions }) {
|
|
|
1519
1793
|
function PackageRow({ pi, actions, pkg }) {
|
|
1520
1794
|
const words = actions.words;
|
|
1521
1795
|
const mine = pkg.origin === "directory";
|
|
1522
|
-
const Icon = icon(pi, mine ? "Puzzle" : "PackageOpen");
|
|
1796
|
+
const Icon = icon(pi, pkg.icon ?? (mine ? "Puzzle" : "PackageOpen"), mine ? "Puzzle" : "PackageOpen");
|
|
1797
|
+
const title = TaPackageTextUtil.pick(pkg.title, pi.ui.language) ?? pkg.name;
|
|
1798
|
+
const summary = TaPackageTextUtil.pick(pkg.summary, pi.ui.language) ?? pkg.description;
|
|
1523
1799
|
const tags = [...pkg.resources.map((type) => words.kinds[type]), ...pkg.scope === "project" ? [words.project] : []];
|
|
1800
|
+
const share = () => pi.ui.shareExtension({ title, source: mine ? undefined : pkg.source, packageId: pkg.id });
|
|
1524
1801
|
const buttons = mine ? [
|
|
1525
1802
|
{ key: "change", label: words.change, icon: "Pencil", run: () => actions.change(pkg) },
|
|
1526
1803
|
{ key: "export", label: words.export, icon: "Download", run: () => actions.exportPackage(pkg) },
|
|
1804
|
+
{ key: "share", label: words.share, icon: "QrCode", run: async () => share() },
|
|
1527
1805
|
{ key: "remove", label: words.remove, icon: "Trash2", danger: true, run: () => actions.remove(pkg) }
|
|
1528
1806
|
] : [
|
|
1529
1807
|
{ key: "copy", label: words.copySource, icon: "Copy", run: () => actions.copySource(pkg) },
|
|
1808
|
+
{ key: "share", label: words.share, icon: "QrCode", run: async () => share() },
|
|
1530
1809
|
{ key: "remove", label: words.remove, icon: "Trash2", danger: true, run: () => actions.remove(pkg) }
|
|
1531
1810
|
];
|
|
1532
1811
|
return /* @__PURE__ */ React.createElement("div", {
|
|
@@ -1539,14 +1818,16 @@ function PackageRow({ pi, actions, pkg }) {
|
|
|
1539
1818
|
className: "tax-main"
|
|
1540
1819
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
1541
1820
|
className: "tax-name"
|
|
1542
|
-
}, /* @__PURE__ */ React.createElement("span",
|
|
1821
|
+
}, /* @__PURE__ */ React.createElement("span", {
|
|
1822
|
+
title: title === pkg.name ? undefined : pkg.name
|
|
1823
|
+
}, title), pkg.version && /* @__PURE__ */ React.createElement("span", {
|
|
1543
1824
|
className: "tax-version"
|
|
1544
1825
|
}, pkg.version), tags.map((tag) => /* @__PURE__ */ React.createElement("span", {
|
|
1545
1826
|
key: tag,
|
|
1546
1827
|
className: "tax-tag"
|
|
1547
|
-
}, tag))), (
|
|
1828
|
+
}, tag))), (summary || !mine) && /* @__PURE__ */ React.createElement("div", {
|
|
1548
1829
|
className: "tax-description"
|
|
1549
|
-
},
|
|
1830
|
+
}, summary || pkg.source)), /* @__PURE__ */ React.createElement("div", {
|
|
1550
1831
|
className: "tax-actions"
|
|
1551
1832
|
}, buttons.map((button) => {
|
|
1552
1833
|
const ButtonIcon = icon(pi, button.icon);
|
|
@@ -1564,13 +1845,118 @@ function PackageRow({ pi, actions, pkg }) {
|
|
|
1564
1845
|
type: "checkbox",
|
|
1565
1846
|
role: "switch",
|
|
1566
1847
|
className: "tax-switch",
|
|
1567
|
-
"aria-label": ExtensionWords.fill(words.turnOn, { name:
|
|
1848
|
+
"aria-label": ExtensionWords.fill(words.turnOn, { name: title }),
|
|
1568
1849
|
"aria-checked": pkg.enabled,
|
|
1569
1850
|
checked: pkg.enabled,
|
|
1570
1851
|
onChange: (event) => void actions.setEnabled(pkg, event.target.checked)
|
|
1571
1852
|
}));
|
|
1572
1853
|
}
|
|
1573
1854
|
|
|
1855
|
+
// web-src/search.ts
|
|
1856
|
+
var PAGE = "@celljs/ta-extensions/extensions";
|
|
1857
|
+
function matches(query, ...texts) {
|
|
1858
|
+
const text = texts.filter(Boolean).join(" ").toLowerCase();
|
|
1859
|
+
return query.trim().toLowerCase().split(/\s+/).filter(Boolean).every((word) => text.includes(word));
|
|
1860
|
+
}
|
|
1861
|
+
function registerSearches(context) {
|
|
1862
|
+
const { pi, store, market, actions } = context;
|
|
1863
|
+
const words = () => ExtensionWords.of(pi.ui.language);
|
|
1864
|
+
const subscribe = (listener) => store.subscribe(listener);
|
|
1865
|
+
const packages = () => store.state.packages ?? store.load().then(() => store.state.packages ?? []);
|
|
1866
|
+
const showMarket = (name) => {
|
|
1867
|
+
context.tab.set("market");
|
|
1868
|
+
context.selected.set(name);
|
|
1869
|
+
pi.ui.showView(PAGE);
|
|
1870
|
+
};
|
|
1871
|
+
const openPackage = async (pkg) => {
|
|
1872
|
+
if (!await pi.ui.showView(pkg.name)) {
|
|
1873
|
+
context.tab.set("mine");
|
|
1874
|
+
context.selected.set(undefined);
|
|
1875
|
+
pi.ui.showView(PAGE);
|
|
1876
|
+
}
|
|
1877
|
+
};
|
|
1878
|
+
const packageItem = (pkg) => {
|
|
1879
|
+
const title = TaPackageTextUtil.pick(pkg.title, pi.ui.language) ?? pkg.name;
|
|
1880
|
+
return {
|
|
1881
|
+
key: pkg.id,
|
|
1882
|
+
title,
|
|
1883
|
+
detail: TaPackageTextUtil.pick(pkg.summary, pi.ui.language) ?? pkg.description ?? (pkg.origin === "package" ? pkg.source : words().madeHere),
|
|
1884
|
+
icon: icon(pi, pkg.icon ?? "Puzzle", "Puzzle"),
|
|
1885
|
+
tint: pkg.name,
|
|
1886
|
+
open: () => void openPackage(pkg),
|
|
1887
|
+
menu: pkg.origin === "builtin" ? undefined : () => [
|
|
1888
|
+
[
|
|
1889
|
+
{
|
|
1890
|
+
key: "share",
|
|
1891
|
+
label: words().share,
|
|
1892
|
+
icon: icon(pi, "QrCode", "Share2"),
|
|
1893
|
+
run: () => pi.ui.shareExtension({ title, source: pkg.origin === "package" ? pkg.source : undefined, packageId: pkg.id })
|
|
1894
|
+
}
|
|
1895
|
+
]
|
|
1896
|
+
]
|
|
1897
|
+
};
|
|
1898
|
+
};
|
|
1899
|
+
const local = (key, title, order, keep) => ({
|
|
1900
|
+
key,
|
|
1901
|
+
title,
|
|
1902
|
+
order,
|
|
1903
|
+
subscribe,
|
|
1904
|
+
search: (query) => {
|
|
1905
|
+
const page = (list2) => ({
|
|
1906
|
+
items: list2.filter((pkg) => keep(pkg) && matches(query, pkg.name, TaPackageTextUtil.pick(pkg.title, pi.ui.language), TaPackageTextUtil.pick(pkg.summary, pi.ui.language), pkg.description)).map(packageItem)
|
|
1907
|
+
});
|
|
1908
|
+
const list = packages();
|
|
1909
|
+
return Array.isArray(list) ? page(list) : list.then(page);
|
|
1910
|
+
}
|
|
1911
|
+
});
|
|
1912
|
+
pi.registerSearch(local("installed", () => words().installedTitle, 10, (pkg) => pkg.origin !== "builtin"));
|
|
1913
|
+
pi.registerSearch(local("builtin", () => words().builtinTitle, 20, (pkg) => pkg.origin === "builtin"));
|
|
1914
|
+
const next = new Map;
|
|
1915
|
+
pi.registerSearch({
|
|
1916
|
+
key: "market",
|
|
1917
|
+
title: () => words().tabMarket,
|
|
1918
|
+
order: 30,
|
|
1919
|
+
remote: true,
|
|
1920
|
+
subscribe,
|
|
1921
|
+
search: async (query, offset) => {
|
|
1922
|
+
const trimmed = query.trim();
|
|
1923
|
+
const from = offset === 0 ? 0 : next.get(trimmed);
|
|
1924
|
+
if (from === undefined) {
|
|
1925
|
+
return { items: [] };
|
|
1926
|
+
}
|
|
1927
|
+
const result = await pi.callHost("searchMarket", trimmed, from);
|
|
1928
|
+
if (result.next === undefined) {
|
|
1929
|
+
next.delete(trimmed);
|
|
1930
|
+
} else {
|
|
1931
|
+
next.set(trimmed, result.next);
|
|
1932
|
+
}
|
|
1933
|
+
const installed = new Set((store.state.packages ?? []).map((pkg) => pkg.name));
|
|
1934
|
+
const say = words();
|
|
1935
|
+
return {
|
|
1936
|
+
more: result.next !== undefined,
|
|
1937
|
+
items: result.packages.map((pkg) => ({
|
|
1938
|
+
key: `npm:${pkg.name}`,
|
|
1939
|
+
title: pkg.name,
|
|
1940
|
+
detail: [pkg.downloads ? ExtensionWords.fill(say.perMonth, { count: MarketUtil.compact(pkg.downloads) }) : undefined, pkg.description].filter(Boolean).join(" · "),
|
|
1941
|
+
tint: pkg.name,
|
|
1942
|
+
open: () => showMarket(pkg.name),
|
|
1943
|
+
action: installed.has(pkg.name) || market.state.installing.has(pkg.name) ? undefined : { label: say.install, run: () => void actions.installFromMarket(pkg.name) },
|
|
1944
|
+
menu: () => [
|
|
1945
|
+
[
|
|
1946
|
+
{
|
|
1947
|
+
key: "share",
|
|
1948
|
+
label: say.share,
|
|
1949
|
+
icon: icon(pi, "QrCode", "Share2"),
|
|
1950
|
+
run: () => pi.ui.shareExtension({ title: pkg.name, source: `npm:${pkg.name}` })
|
|
1951
|
+
}
|
|
1952
|
+
]
|
|
1953
|
+
]
|
|
1954
|
+
}))
|
|
1955
|
+
};
|
|
1956
|
+
}
|
|
1957
|
+
});
|
|
1958
|
+
}
|
|
1959
|
+
|
|
1574
1960
|
// web-src/signal.ts
|
|
1575
1961
|
class Signal {
|
|
1576
1962
|
value;
|
|
@@ -1601,7 +1987,7 @@ class Signal {
|
|
|
1601
1987
|
// web-src/market-style.ts
|
|
1602
1988
|
var MARKET_STYLE = `
|
|
1603
1989
|
.tax-tabs { display: inline-flex; align-self: flex-start; gap: 2px; margin-bottom: -10px; padding: 3px; border-radius: 10px; background: var(--ta-chip); }
|
|
1604
|
-
.tax-tab { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 14px 0 11px; border: 0; border-radius: 7px; background: none; color: var(--ta-secondary); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; transition: background 140ms, color 140ms, box-shadow 140ms; }
|
|
1990
|
+
.tax-tab { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 14px 0 11px; border: 0; border-radius: 7px; background: none; color: var(--ta-secondary); font: inherit; font-size: calc(13px * var(--ta-font-scale)); font-weight: 500; cursor: pointer; transition: background 140ms, color 140ms, box-shadow 140ms; }
|
|
1605
1991
|
.tax-tab:hover { color: var(--ta-text); }
|
|
1606
1992
|
.tax-tab.tax-active { background: var(--ta-hover-strong); color: var(--ta-text); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
|
|
1607
1993
|
:root[data-theme='light'] .tax-tab.tax-active { background: var(--ta-card); box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 .5px rgba(0, 0, 0, .06); }
|
|
@@ -1610,18 +1996,18 @@ var MARKET_STYLE = `
|
|
|
1610
1996
|
.tax-market { display: flex; flex-direction: column; gap: 14px; }
|
|
1611
1997
|
.tax-search { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 8px 0 15px; border: 1px solid var(--ta-border-field); border-radius: 12px; background: var(--ta-input); color: var(--ta-muted); transition: border-color 140ms, box-shadow 140ms; }
|
|
1612
1998
|
.tax-search:focus-within { border-color: var(--ta-border-focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ta-border-focus) 16%, transparent); }
|
|
1613
|
-
.tax-search input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: none; color: var(--ta-text); font: inherit; font-size: 14px; outline: none; }
|
|
1999
|
+
.tax-search input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: none; color: var(--ta-text); font: inherit; font-size: calc(14px * var(--ta-font-scale)); outline: none; }
|
|
1614
2000
|
.tax-search input::placeholder { color: var(--ta-muted); }
|
|
1615
2001
|
.tax-search input::-webkit-search-cancel-button { display: none; }
|
|
1616
2002
|
.tax-search-clear { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex: none; padding: 0; border: 0; border-radius: 7px; background: none; color: var(--ta-muted); cursor: pointer; }
|
|
1617
2003
|
.tax-search-clear:hover { background: var(--ta-hover); color: var(--ta-text); }
|
|
1618
2004
|
.tax-topics { display: flex; flex-wrap: wrap; gap: 6px; }
|
|
1619
|
-
.tax-topic { height: 28px; padding: 0 12px; border: 1px solid var(--ta-border-muted); border-radius: 14px; background: none; color: var(--ta-secondary); font: inherit; font-size: 12.5px; cursor: pointer; transition: background 120ms, border-color 120ms, color 120ms; }
|
|
2005
|
+
.tax-topic { height: 28px; padding: 0 12px; border: 1px solid var(--ta-border-muted); border-radius: 14px; background: none; color: var(--ta-secondary); font: inherit; font-size: calc(12.5px * var(--ta-font-scale)); cursor: pointer; transition: background 120ms, border-color 120ms, color 120ms; }
|
|
1620
2006
|
.tax-topic:hover { background: var(--ta-hover); color: var(--ta-text); }
|
|
1621
2007
|
.tax-topic.tax-active { border-color: color-mix(in srgb, var(--tax-accent) 55%, transparent); background: color-mix(in srgb, var(--tax-accent) 12%, transparent); color: var(--ta-text); }
|
|
1622
2008
|
.tax-market .tax-section-head { margin-top: 4px; min-height: 22px; }
|
|
1623
2009
|
.tax-head-spin { color: var(--ta-muted); }
|
|
1624
|
-
.tax-count-note { color: var(--ta-muted); font-size: 12px; }
|
|
2010
|
+
.tax-count-note { color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale)); }
|
|
1625
2011
|
.tax-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
|
|
1626
2012
|
@media (max-width: 640px) { .tax-grid { grid-template-columns: minmax(0, 1fr); } }
|
|
1627
2013
|
.tax-card { display: flex; flex-direction: column; gap: 10px; min-height: 150px; padding: 14px 14px 12px; border: 1px solid var(--ta-border-muted); border-radius: 14px; box-sizing: border-box; cursor: pointer; outline: none; transition: border-color 140ms, background 140ms, box-shadow 180ms, transform 180ms var(--ta-ease); }
|
|
@@ -1630,23 +2016,23 @@ var MARKET_STYLE = `
|
|
|
1630
2016
|
.tax-card:active { transform: scale(.995); }
|
|
1631
2017
|
.tax-card-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
|
|
1632
2018
|
.tax-card-title { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
|
|
1633
|
-
.tax-card-name { overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
|
|
2019
|
+
.tax-card-name { overflow: hidden; font-size: calc(14px * var(--ta-font-scale)); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
|
|
1634
2020
|
.tax-scope { color: var(--ta-muted); font-weight: 500; }
|
|
1635
|
-
.tax-card-meta { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--ta-muted); font-size: 12px; }
|
|
2021
|
+
.tax-card-meta { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale)); }
|
|
1636
2022
|
.tax-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1637
2023
|
.tax-downloads { display: inline-flex; align-items: center; gap: 2px; flex: none; }
|
|
1638
|
-
.tax-card-description { display: -webkit-box; margin: 0; overflow: hidden; color: var(--ta-secondary); font-size: 12.5px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; }
|
|
2024
|
+
.tax-card-description { display: -webkit-box; margin: 0; overflow: hidden; color: var(--ta-secondary); font-size: calc(12.5px * var(--ta-font-scale)); line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; }
|
|
1639
2025
|
.tax-card-foot { display: flex; align-items: center; gap: 6px; margin-top: auto; min-height: 17px; }
|
|
1640
|
-
.tax-card-time { margin-left: auto; color: var(--ta-muted); font-size: 11.5px; white-space: nowrap; }
|
|
2026
|
+
.tax-card-time { margin-left: auto; color: var(--ta-muted); font-size: calc(11.5px * var(--ta-font-scale)); white-space: nowrap; }
|
|
1641
2027
|
.tax-face { display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 26%; background: hsl(var(--tax-hue) 70% 50% / .13); color: hsl(var(--tax-hue) 55% 38%); font-weight: 700; letter-spacing: -.02em; user-select: none; }
|
|
1642
2028
|
:root:not([data-theme='light']) .tax-face { background: hsl(var(--tax-hue) 60% 55% / .17); color: hsl(var(--tax-hue) 75% 74%); }
|
|
1643
|
-
.tax-install { display: inline-flex; align-items: center; justify-content: center; gap: 5px; flex: none; height: 28px; padding: 0 14px; border: 0; border-radius: 14px; background: color-mix(in srgb, var(--ta-green) 14%, transparent); color: color-mix(in srgb, var(--ta-green) 82%, var(--ta-text)); font: inherit; font-size: 12.5px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background 140ms, color 140ms, transform 120ms var(--ta-ease), filter 140ms; }
|
|
2029
|
+
.tax-install { display: inline-flex; align-items: center; justify-content: center; gap: 5px; flex: none; height: 28px; padding: 0 14px; border: 0; border-radius: 14px; background: color-mix(in srgb, var(--ta-green) 14%, transparent); color: color-mix(in srgb, var(--ta-green) 82%, var(--ta-text)); font: inherit; font-size: calc(12.5px * var(--ta-font-scale)); font-weight: 600; white-space: nowrap; cursor: pointer; transition: background 140ms, color 140ms, transform 120ms var(--ta-ease), filter 140ms; }
|
|
1644
2030
|
.tax-install:hover { background: color-mix(in srgb, var(--ta-green) 24%, transparent); }
|
|
1645
2031
|
.tax-install:active { transform: scale(.95); }
|
|
1646
2032
|
.tax-install:focus-visible { outline: 2px solid var(--ta-border-focus); outline-offset: 2px; }
|
|
1647
2033
|
.tax-install-done, .tax-install-busy { background: var(--ta-chip); color: var(--ta-muted); font-weight: 500; cursor: default; }
|
|
1648
2034
|
.tax-install-busy { color: var(--ta-secondary); }
|
|
1649
|
-
.tax-install-large { height: 34px; padding: 0 22px; border-radius: 9px; font-size: 13.5px; }
|
|
2035
|
+
.tax-install-large { height: 34px; padding: 0 22px; border-radius: 9px; font-size: calc(13.5px * var(--ta-font-scale)); }
|
|
1650
2036
|
button.tax-install-large { background: var(--ta-green); color: var(--ta-brand-text); }
|
|
1651
2037
|
button.tax-install-large:hover { background: var(--ta-green); filter: brightness(1.07); }
|
|
1652
2038
|
.tax-spin { display: inline-flex; animation: tax-spin 900ms linear infinite; }
|
|
@@ -1654,20 +2040,20 @@ button.tax-install-large:hover { background: var(--ta-green); filter: brightness
|
|
|
1654
2040
|
.tax-skeleton { cursor: default; border-color: transparent; background: linear-gradient(100deg, var(--ta-hover) 40%, var(--ta-hover-strong) 50%, var(--ta-hover) 60%) 0 0 / 200% 100%; animation: tax-shimmer 1.4s linear infinite; opacity: .6; }
|
|
1655
2041
|
.tax-skeleton:hover { border-color: transparent; box-shadow: none; transform: none; }
|
|
1656
2042
|
@keyframes tax-shimmer { to { background-position: -200% 0; } }
|
|
1657
|
-
.tax-more { padding: 6px 0 2px; color: var(--ta-muted); font-size: 12px; text-align: center; }
|
|
2043
|
+
.tax-more { padding: 6px 0 2px; color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale)); text-align: center; }
|
|
1658
2044
|
.tax-market-error { display: flex; flex-direction: column; align-items: center; gap: 8px; }
|
|
1659
2045
|
.tax-market-error strong { color: var(--ta-text); font-weight: 600; }
|
|
1660
|
-
.tax-market-error span { max-width: 100%; overflow-wrap: anywhere; font-size: 12.5px; }
|
|
2046
|
+
.tax-market-error span { max-width: 100%; overflow-wrap: anywhere; font-size: calc(12.5px * var(--ta-font-scale)); }
|
|
1661
2047
|
.tax-market-note { text-align: center; }
|
|
1662
2048
|
.tax-detail { display: flex; flex-direction: column; gap: 20px; animation: tax-in 220ms var(--ta-ease); }
|
|
1663
2049
|
@keyframes tax-in { from { opacity: 0; transform: translateY(6px); } }
|
|
1664
|
-
.tax-back { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; height: 28px; margin: 0 0 -6px -8px; padding: 0 10px 0 6px; border: 0; border-radius: 7px; background: none; color: var(--ta-secondary); font: inherit; font-size: 13px; cursor: pointer; }
|
|
2050
|
+
.tax-back { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; height: 28px; margin: 0 0 -6px -8px; padding: 0 10px 0 6px; border: 0; border-radius: 7px; background: none; color: var(--ta-secondary); font: inherit; font-size: calc(13px * var(--ta-font-scale)); cursor: pointer; }
|
|
1665
2051
|
.tax-back:hover { background: var(--ta-hover); color: var(--ta-text); }
|
|
1666
2052
|
.tax-detail-head { display: flex; align-items: flex-start; gap: 20px; }
|
|
1667
2053
|
.tax-detail-title { display: flex; flex-direction: column; flex: 1; min-width: 0; }
|
|
1668
|
-
.tax-detail-title h1 { margin: 2px 0 0; font-size: 22px; font-weight: 650; letter-spacing: -.01em; line-height: 1.25; overflow-wrap: anywhere; }
|
|
1669
|
-
.tax-detail-description { margin: 6px 0 0; color: var(--ta-secondary); font-size: 14px; line-height: 1.55; }
|
|
1670
|
-
.tax-detail-facts { display: flex; flex-wrap: wrap; align-items: center; row-gap: 4px; margin-top: 10px; color: var(--ta-muted); font-size: 12.5px; }
|
|
2054
|
+
.tax-detail-title h1 { margin: 2px 0 0; font-size: calc(22px * var(--ta-font-scale)); font-weight: 650; letter-spacing: -.01em; line-height: 1.25; overflow-wrap: anywhere; }
|
|
2055
|
+
.tax-detail-description { margin: 6px 0 0; color: var(--ta-secondary); font-size: calc(14px * var(--ta-font-scale)); line-height: 1.55; }
|
|
2056
|
+
.tax-detail-facts { display: flex; flex-wrap: wrap; align-items: center; row-gap: 4px; margin-top: 10px; color: var(--ta-muted); font-size: calc(12.5px * var(--ta-font-scale)); }
|
|
1671
2057
|
.tax-detail-facts .tax-tag { margin-right: 6px; }
|
|
1672
2058
|
.tax-detail-facts .tax-tag + .tax-fact { margin-left: 4px; }
|
|
1673
2059
|
.tax-fact + .tax-fact::before { content: '·'; margin: 0 7px; }
|
|
@@ -1676,7 +2062,7 @@ button.tax-install-large:hover { background: var(--ta-green); filter: brightness
|
|
|
1676
2062
|
.tax-button-quiet:hover { color: var(--ta-text); }
|
|
1677
2063
|
.tax-button-quiet svg { color: var(--ta-muted); }
|
|
1678
2064
|
.tax-preview { display: block; width: 100%; max-height: 380px; border: 1px solid var(--ta-border-muted); border-radius: 12px; background: var(--ta-raised); object-fit: contain; }
|
|
1679
|
-
.tax-readme { padding-top: 20px; border-top: 1px solid var(--ta-border-muted); font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
|
|
2065
|
+
.tax-readme { padding-top: 20px; border-top: 1px solid var(--ta-border-muted); font-size: calc(14px * var(--ta-font-scale)); min-width: 0; overflow-wrap: anywhere; }
|
|
1680
2066
|
.tax-readme img { max-width: 100%; height: auto; }
|
|
1681
2067
|
.tax-readme-loading { display: flex; flex-direction: column; gap: 12px; }
|
|
1682
2068
|
.tax-readme-loading span { height: 12px; border-radius: 6px; background: linear-gradient(100deg, var(--ta-hover) 40%, var(--ta-hover-strong) 50%, var(--ta-hover) 60%) 0 0 / 200% 100%; animation: tax-shimmer 1.4s linear infinite; }
|
|
@@ -1688,44 +2074,25 @@ button.tax-install-large:hover { background: var(--ta-green); filter: brightness
|
|
|
1688
2074
|
.tax-detail-title { display: contents; }
|
|
1689
2075
|
.tax-detail-title > :not(h1) { grid-column: 1 / -1; }
|
|
1690
2076
|
.tax-detail-head .tax-face { width: 52px !important; height: 52px !important; font-size: 19px !important; }
|
|
1691
|
-
.tax-detail-title h1 { margin: 0; font-size: 19px; }
|
|
2077
|
+
.tax-detail-title h1 { margin: 0; font-size: calc(19px * var(--ta-font-scale)); }
|
|
1692
2078
|
.tax-detail-description { margin-top: 12px; }
|
|
1693
2079
|
}
|
|
1694
2080
|
`;
|
|
1695
2081
|
|
|
1696
2082
|
// web-src/style.ts
|
|
1697
2083
|
var STYLE = `
|
|
1698
|
-
.tax-page { --tax-accent: var(--ta-green); position: relative; height: 100%; overflow: auto; color: var(--ta-text); font-size: 13.5px; }
|
|
2084
|
+
.tax-page { --tax-accent: var(--ta-green); position: relative; height: 100%; overflow: auto; color: var(--ta-text); font-size: calc(13.5px * var(--ta-font-scale)); }
|
|
1699
2085
|
.tax-body { display: flex; flex-direction: column; gap: 32px; max-width: 760px; margin: 0 auto; padding: 28px 24px 56px; box-sizing: border-box; }
|
|
1700
2086
|
.tax-hero { display: flex; flex-direction: column; gap: 10px; }
|
|
1701
|
-
.tax-hero h1 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
|
|
2087
|
+
.tax-hero h1 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: calc(20px * var(--ta-font-scale)); font-weight: 600; letter-spacing: -0.01em; }
|
|
1702
2088
|
.tax-hero h1 svg { color: var(--tax-accent); }
|
|
1703
2089
|
.tax-hero > p { margin: 0 0 6px; color: var(--ta-muted); }
|
|
1704
|
-
.tax-kinds {
|
|
1705
|
-
@media (max-width: 640px) { .tax-kinds { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
|
|
1706
|
-
.tax-kind { display: flex; flex-direction: column; gap: 8px; padding: 8px 8px 10px; border: 1px solid var(--ta-border-muted); border-radius: 12px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: border-color 140ms, background 140ms, transform 140ms var(--ta-ease); }
|
|
1707
|
-
.tax-kind:hover { border-color: color-mix(in srgb, var(--tax-accent) 55%, var(--ta-border)); background: var(--ta-hover); }
|
|
1708
|
-
.tax-kind:hover .tax-pic-accent { fill: color-mix(in srgb, var(--tax-accent) 26%, transparent); }
|
|
1709
|
-
.tax-kind:active { transform: scale(.98); }
|
|
1710
|
-
.tax-kind:disabled { opacity: .55; cursor: default; }
|
|
1711
|
-
.tax-kind-label { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; padding: 0 4px; min-width: 0; }
|
|
1712
|
-
.tax-kind-label strong { font-size: 13px; font-weight: 600; }
|
|
1713
|
-
.tax-kind-label span { overflow: hidden; color: var(--ta-muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
|
|
1714
|
-
.tax-pic { display: block; width: 100%; height: auto; border-radius: 8px; }
|
|
1715
|
-
.tax-pic-frame { fill: var(--ta-raised); stroke: var(--ta-border-muted); stroke-width: 1; }
|
|
1716
|
-
.tax-pic-pane { fill: var(--ta-hover); }
|
|
1717
|
-
.tax-pic-line { fill: var(--ta-hover-strong); }
|
|
1718
|
-
.tax-pic-box { fill: none; stroke: var(--ta-border); stroke-width: 1; }
|
|
1719
|
-
.tax-pic-accent { fill: color-mix(in srgb, var(--tax-accent) 16%, transparent); stroke: color-mix(in srgb, var(--tax-accent) 70%, transparent); stroke-width: 1; transition: fill 140ms; }
|
|
1720
|
-
.tax-pic-mark { fill: var(--tax-accent); }
|
|
1721
|
-
.tax-pic-soft { opacity: .45; }
|
|
1722
|
-
.tax-pic-hand { fill: none; stroke: var(--ta-raised); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
|
|
1723
|
-
.tax-pic-text { fill: var(--tax-accent); font-family: var(--ta-mono); font-size: 8px; font-weight: 600; }
|
|
2090
|
+
.tax-kinds { margin-top: 6px; }
|
|
1724
2091
|
.tax-section { display: flex; flex-direction: column; gap: 8px; }
|
|
1725
2092
|
.tax-section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; }
|
|
1726
|
-
.tax-section-head h2 { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--ta-secondary); font-size: 12.5px; font-weight: 600; }
|
|
1727
|
-
.tax-count { padding: 0 6px; border-radius: 8px; background: var(--ta-chip); color: var(--ta-muted); font-size: 11px; font-weight: 500; line-height: 16px; }
|
|
1728
|
-
.tax-button { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--ta-border-muted); border-radius: 8px; background: var(--ta-raised); color: var(--ta-text); font: inherit; font-size: 13px; cursor: pointer; transition: background 120ms, border-color 120ms; }
|
|
2093
|
+
.tax-section-head h2 { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--ta-secondary); font-size: calc(12.5px * var(--ta-font-scale)); font-weight: 600; }
|
|
2094
|
+
.tax-count { padding: 0 6px; border-radius: 8px; background: var(--ta-chip); color: var(--ta-muted); font-size: calc(11px * var(--ta-font-scale)); font-weight: 500; line-height: calc(16px * var(--ta-font-scale)); }
|
|
2095
|
+
.tax-button { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--ta-border-muted); border-radius: 8px; background: var(--ta-raised); color: var(--ta-text); font: inherit; font-size: calc(13px * var(--ta-font-scale)); cursor: pointer; transition: background 120ms, border-color 120ms; }
|
|
1729
2096
|
.tax-button:hover { background: var(--ta-hover); border-color: var(--ta-border); }
|
|
1730
2097
|
.tax-button:disabled { opacity: .55; cursor: default; }
|
|
1731
2098
|
.tax-list { border: 1px solid var(--ta-border-muted); border-radius: 12px; overflow: hidden; }
|
|
@@ -1737,9 +2104,9 @@ var STYLE = `
|
|
|
1737
2104
|
.tax-main { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; transition: opacity 160ms; }
|
|
1738
2105
|
.tax-name { display: flex; align-items: center; gap: 6px; min-width: 0; font-weight: 600; }
|
|
1739
2106
|
.tax-name > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1740
|
-
.tax-version { flex: none; color: var(--ta-muted); font-size: 12px; font-weight: 400; }
|
|
1741
|
-
.tax-description { overflow: hidden; color: var(--ta-secondary); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
|
|
1742
|
-
.tax-tag { flex: none; padding: 0 6px; border-radius: 5px; background: var(--ta-chip); color: var(--ta-muted); font-size: 11px; font-weight: 400; line-height: 17px; }
|
|
2107
|
+
.tax-version { flex: none; color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale)); font-weight: 400; }
|
|
2108
|
+
.tax-description { overflow: hidden; color: var(--ta-secondary); font-size: calc(12.5px * var(--ta-font-scale)); text-overflow: ellipsis; white-space: nowrap; }
|
|
2109
|
+
.tax-tag { flex: none; padding: 0 6px; border-radius: 5px; background: var(--ta-chip); color: var(--ta-muted); font-size: calc(11px * var(--ta-font-scale)); font-weight: 400; line-height: calc(17px * var(--ta-font-scale)); }
|
|
1743
2110
|
.tax-off .tax-main { opacity: .5; }
|
|
1744
2111
|
.tax-off .tax-icon { color: var(--ta-muted); }
|
|
1745
2112
|
.tax-actions { display: flex; gap: 2px; flex: none; opacity: 0; transition: opacity 120ms; }
|
|
@@ -1756,22 +2123,22 @@ var STYLE = `
|
|
|
1756
2123
|
.tax-empty { padding: 16px; border: 1px dashed var(--ta-border-muted); border-radius: 12px; color: var(--ta-muted); text-align: center; }
|
|
1757
2124
|
.tax-share { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px 16px 16px; border: 1px solid var(--ta-border-muted); border-radius: 12px; }
|
|
1758
2125
|
.tax-steps { display: flex; align-items: flex-start; justify-content: center; gap: 10px; width: 100%; }
|
|
1759
|
-
.tax-step { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 120px; color: var(--ta-secondary); font-size: 12.5px; text-align: center; }
|
|
2126
|
+
.tax-step { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 120px; color: var(--ta-secondary); font-size: calc(12.5px * var(--ta-font-scale)); text-align: center; }
|
|
1760
2127
|
.tax-step-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; background: color-mix(in srgb, var(--tax-accent) 12%, transparent); color: var(--tax-accent); }
|
|
1761
2128
|
.tax-step-arrow { display: inline-flex; align-items: center; height: 44px; color: var(--ta-muted); }
|
|
1762
|
-
.tax-note { color: var(--ta-muted); font-size: 12.5px; }
|
|
1763
|
-
.tax-note code { padding: 1px 5px; border-radius: 4px; background: var(--ta-code); font-family: var(--ta-mono); font-size: 12px; }
|
|
1764
|
-
.tax-drop-overlay { position: absolute; inset: 12px; z-index: 5; display: flex; align-items: center; justify-content: center; border: 2px dashed var(--ta-border-focus); border-radius: 16px; background: color-mix(in srgb, var(--ta-main) 85%, transparent); color: var(--ta-text); font-size: 15px; font-weight: 600; pointer-events: none; }
|
|
2129
|
+
.tax-note { color: var(--ta-muted); font-size: calc(12.5px * var(--ta-font-scale)); }
|
|
2130
|
+
.tax-note code { padding: 1px 5px; border-radius: 4px; background: var(--ta-code); font-family: var(--ta-mono); font-size: calc(12px * var(--ta-font-scale)); }
|
|
2131
|
+
.tax-drop-overlay { position: absolute; inset: 12px; z-index: 5; display: flex; align-items: center; justify-content: center; border: 2px dashed var(--ta-border-focus); border-radius: 16px; background: color-mix(in srgb, var(--ta-main) 85%, transparent); color: var(--ta-text); font-size: calc(15px * var(--ta-font-scale)); font-weight: 600; pointer-events: none; }
|
|
1765
2132
|
.tax-dialog { display: flex; flex-direction: column; gap: 14px; min-width: min(440px, 80vw); }
|
|
1766
2133
|
.tax-drop { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 16px; border: 1.5px dashed var(--ta-border); border-radius: 12px; color: var(--ta-secondary); text-align: center; transition: border-color 120ms, background 120ms; }
|
|
1767
2134
|
.tax-drop.tax-over { border-color: var(--ta-border-focus); background: var(--ta-hover); }
|
|
1768
2135
|
.tax-drop svg { color: var(--ta-muted); }
|
|
1769
2136
|
.tax-link { padding: 0; border: 0; background: none; color: var(--ta-link); font: inherit; cursor: pointer; }
|
|
1770
2137
|
.tax-link:hover { text-decoration: underline; }
|
|
1771
|
-
.tax-or { display: flex; align-items: center; gap: 10px; color: var(--ta-muted); font-size: 12px; }
|
|
2138
|
+
.tax-or { display: flex; align-items: center; gap: 10px; color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale)); }
|
|
1772
2139
|
.tax-or::before, .tax-or::after { content: ''; flex: 1; height: 1px; background: var(--ta-border-muted); }
|
|
1773
2140
|
.tax-source { display: flex; gap: 8px; }
|
|
1774
|
-
.tax-source input { flex: 1; min-width: 0; height: 34px; padding: 0 11px; border: 1px solid var(--ta-border-field); border-radius: 8px; background: var(--ta-input); color: var(--ta-text); font: inherit; font-size: 13px; outline: none; box-sizing: border-box; }
|
|
2141
|
+
.tax-source input { flex: 1; min-width: 0; height: 34px; padding: 0 11px; border: 1px solid var(--ta-border-field); border-radius: 8px; background: var(--ta-input); color: var(--ta-text); font: inherit; font-size: calc(13px * var(--ta-font-scale)); outline: none; box-sizing: border-box; }
|
|
1775
2142
|
.tax-source input:focus { border-color: var(--ta-border-focus); }
|
|
1776
2143
|
.tax-source .tax-button { height: 34px; }
|
|
1777
2144
|
`;
|
|
@@ -1816,6 +2183,7 @@ function activate(pi) {
|
|
|
1816
2183
|
},
|
|
1817
2184
|
order: 90
|
|
1818
2185
|
});
|
|
2186
|
+
registerSearches(context);
|
|
1819
2187
|
pi.on("agent_end", () => void store.load());
|
|
1820
2188
|
return removeStyle;
|
|
1821
2189
|
}
|