minecodex 2.0.37 → 2.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -89
- package/features/markdown-reading/assets/qv-dependencies.js +4412 -0
- package/features/markdown-reading/assets/qv-export.js +2 -0
- package/features/markdown-reading/assets/qv-loading.css +4 -0
- package/features/markdown-reading/assets/qv-template.json +1 -0
- package/features/markdown-reading/codex-feature.json +6 -1
- package/features/markdown-reading/src/adapters/codex/mermaid-viewer.mjs +95 -0
- package/features/markdown-reading/src/adapters/codex/mermaid.mjs +91 -0
- package/features/markdown-reading/src/adapters/codex/preview.mjs +2 -2
- package/features/markdown-reading/src/adapters/codex/reading-runtime.mjs +10 -0
- package/features/markdown-reading/src/adapters/codex/table-actions.mjs +14 -0
- package/features/markdown-reading/src/injection-source.mjs +16 -1
- package/features/markdown-reading/src/markdown-reading.mjs +5 -3
- package/features/markdown-reading/src/mermaid/export.mjs +83 -0
- package/features/markdown-reading/src/mermaid/frame.mjs +109 -0
- package/features/markdown-reading/src/mermaid/loading.mjs +27 -0
- package/features/markdown-reading/src/mermaid/theme.css +8 -0
- package/features/markdown-reading/src/mermaid/viewport.mjs +75 -0
- package/features/markdown-reading/vendor/qv/LICENSE +21 -0
- package/features/markdown-reading/vendor/qv/THIRD_PARTY_NOTICES.txt +3009 -0
- package/features/markdown-reading/vendor/qv/provenance.json +55 -0
- package/features/usage-meter/src/adapters/codex/renderer.mjs +11 -3
- package/features/usage-meter/src/usage-meter.mjs +19 -4
- package/package.json +14 -4
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"project": "QuickerVisulize",
|
|
3
|
+
"commit": "07005ddce591a0407fca82cc03aa4f5586eac2ba",
|
|
4
|
+
"files": {
|
|
5
|
+
"mermaid-xy-model.js": "764ea99121ec89053f21ce8a9a2fa933f900a1790124e3d6ae06c0f587024b76",
|
|
6
|
+
"mermaid-timeline-model.js": "851c21aa0e79ddd916e5a9d387f7878dae78f160ec7d2c47621901c5ccddcfc8",
|
|
7
|
+
"mermaid-class-model.js": "74a215193bcfbf7052e9ea188223f6468e92924b5c0763d9c8badec8e7f69b8f",
|
|
8
|
+
"mermaid-gantt-model.js": "aebcb753b4f3d128dee6807e0cb6077b92f4b35c5f9da0acdf61b9a43bc30e6b",
|
|
9
|
+
"mermaid-navigation.js": "791a63eeb4e6f0cabbb49ff7ccc13d954124c99a4d3d549ec6176cbdd7e19049",
|
|
10
|
+
"mermaid-presentation.js": "e66a45c6c88427ab1b17bedddd5a799573e458c8ae140f7a1a573de0fc7a8a43",
|
|
11
|
+
"mermaid-c4-layout.js": "d1d1469754fa039b46e414c35567ae452c6c312525b5092c51c170245773b6df",
|
|
12
|
+
"mermaid-kanban-model.js": "6093fd04f24f47ed30114d299623cd0ac50ad35e3a372f77d87eb2651c2d71da",
|
|
13
|
+
"mermaid-timeline.js": "55742310c9a7a532d0bcd0f0939601afea8b21b69f09d3450b74ca093ba1a382",
|
|
14
|
+
"mermaid-journey.js": "edd7aef2357ce4dd8b3aac6e6a7861341d977adc488d11c5b67a261dc49b3a83",
|
|
15
|
+
"mermaid-sequence.js": "bf2417ba3003d1dcdaf7da168aaad21b614366ab2da4158c2cefe281ed298258",
|
|
16
|
+
"mermaid-radar.js": "8d5051fb923b340c0394ed8942830f9e84090fec587540885d23710a199dc5db",
|
|
17
|
+
"mermaid-gantt.js": "e9187bbb16a43ca7846c42c7728e1d5e4e4d09b2183d3b832eaab8825c1a10e8",
|
|
18
|
+
"mermaid-c4.js": "cf871a5082aa6365d837e41d2a47b3e7c4346cb3240b49eb76d119c688a27d8d",
|
|
19
|
+
"mermaid-journey-model.js": "5268939151b31966d553f8941d481142d9c1ae1bdfaacb1ec8de1a521c8d2493",
|
|
20
|
+
"mermaid-layout.js": "01cf444fa3daa2e5eb901363ca43077d02a690d4841530981863be508b302d6c",
|
|
21
|
+
"mermaid-xy.js": "9288bbff0c9937b3654cc7b8790815ed3d663798138a0fe09e71844a1e9c80e8",
|
|
22
|
+
"mermaid-block-model.js": "b0ebd80c20d6353bac2b734fb8bc7f9e53cb335b7c58260b3d41ef1571ba53a0",
|
|
23
|
+
"mermaid-quadrant.js": "097e4702a6856a93c0d13753d22294ed5ac5685670e337f0bcf6b0ba9c2cab96",
|
|
24
|
+
"mermaid-radar-model.js": "259f0f4f04f82198af9f9d2fa8f30088dde9c0d7d7feaac774219a65e2adfd17",
|
|
25
|
+
"mermaid-c4-model.js": "1461030c686649ec44c72d57ec60df7dbef1c556fe2683c36612f2fb7ab58162",
|
|
26
|
+
"mermaid-viewport.js": "2e12ed469a4925f82af8d0bc334a6601d2df48fb68e88ceb7eda0586ed8d0743",
|
|
27
|
+
"mermaid-mindmap.js": "f7d954f9efc0f051ab14cf96e244b2cc3198c992ccdf8a36b8dedf6ae2621288",
|
|
28
|
+
"mermaid-state-model.js": "933ce449000ea83579ef3b96e99e8a345ec2cb5bcfa24344a1ff4aa9f1a8c623",
|
|
29
|
+
"mermaid-model.js": "94c953ded8b60baf4157d8e9a371736d3c8adc7884efd69a7c274b55d90e70f4",
|
|
30
|
+
"mermaid-pie.js": "935d7a6d1ffb312ad5678be6130a19f60976bd0fa66ffd82792673f02c71b6c1",
|
|
31
|
+
"mermaid-class.js": "289a671f265af9c1984ccf9998e638391db2b9bc0b904a64193104d5d7d20042",
|
|
32
|
+
"mermaid-mindmap-model.js": "dde10d6e5a92fe128007311f7a4b370f4fa5a2c0d58e42299dd04dd05fd2e65e",
|
|
33
|
+
"mermaid-architecture-reader.js": "2b9bab5f75dfc0e6c42b09301c6cb40e86a0b27bf5403517de4aaaa14943fc8a",
|
|
34
|
+
"mermaid-pie-model.js": "d0e21d7e00c8ca5fa9b411f0fe0fb774bbbe2c0ba790772b9b92e78ab3eb626b",
|
|
35
|
+
"mermaid-sankey-model.js": "73a34dc038e328e9b5b759818e79275baa52ceed0b74ab4476c96a0df6db5204",
|
|
36
|
+
"mermaid-er.js": "237773cbfec13807e0eb0f844f4bebba429b05cd6b15cc8920387b294ce240bb",
|
|
37
|
+
"mermaid-block-layout.js": "cf1a7143b3c535fa155e51f6e6aaf8f4893de2bb3528729840d9315f6d8fe891",
|
|
38
|
+
"mermaid-block.js": "600a741577cb566039dd2893173f708f5fa6e2c2695799edac6300ece1776cbf",
|
|
39
|
+
"mermaid-kanban.js": "b2c95fc35aaf3226ebc971914bfa62387017a670f54e529d5720ce14dec37574",
|
|
40
|
+
"mermaid-sequence-model.js": "e36cc27cd1580adfe84ff2e9438f3798a7c269c522dc3703c9bcd66ba1fe1e77",
|
|
41
|
+
"mermaid-sankey.js": "86f72f55da3faa0e63b79fc7bce84a91304bf55e9cfb4c86b85e643166447604",
|
|
42
|
+
"mermaid-state.js": "0b9f058c82ac0373b26009a020ba89014f33dd4f6a94678025d63d07a1da2509",
|
|
43
|
+
"mermaid-er-model.js": "a19467729fe8c868b3f03e3ff41140a7f4890f217bc234f436b8f8382086ab16",
|
|
44
|
+
"mermaid-quadrant-model.js": "775448876b802fae5f1148d92ab99c491168be87aea6aecf2a92ce27fbb5c939",
|
|
45
|
+
"mermaid.html": "36d7e6994c8c8eebb13fffe79b67a82cd6d336d66142ee62784cfe8650c0ad9e",
|
|
46
|
+
"donut-chart.html": "70578f946929abfd284e61c64ab06a2812cdc2374bf8cb6a6f0bbb7c0c167363",
|
|
47
|
+
"radar-chart.html": "4f18a77b7ec77c495758177a01c930574aa23c533c588c82ced86719f635790a",
|
|
48
|
+
"chart-loading.html": "700f7879be8e22b82a8d03be7ce9abf188f2db4a71f9a91229d2bb338add5b6b"
|
|
49
|
+
},
|
|
50
|
+
"generated": {
|
|
51
|
+
"chart-presets.js": "mermaid_presets.py compile_presets",
|
|
52
|
+
"loading.mjs": "chart-loading.html dot-field drawing; Preview owns readiness and cleanup"
|
|
53
|
+
},
|
|
54
|
+
"adaptation": "offline dependencies and static motion; model, layout, drawing and presentation retained"
|
|
55
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export function createUsageAdapter(signal, codex, invalidate) {
|
|
2
2
|
let client=null,unsubscribe=null;
|
|
3
|
-
function remainingWindows(data) {
|
|
3
|
+
function remainingWindows(data, updatedAt) {
|
|
4
4
|
const windows = [data?.rate_limit?.primary_window, data?.rate_limit?.secondary_window];
|
|
5
5
|
const remaining = seconds => {
|
|
6
6
|
const window = windows.find(window => window?.limit_window_seconds === seconds);
|
|
@@ -8,7 +8,15 @@ function remainingWindows(data) {
|
|
|
8
8
|
? Math.round(Math.max(0, Math.min(100, 100 - window.used_percent))) : null;
|
|
9
9
|
};
|
|
10
10
|
const weekly = remaining(604800), fiveHour = remaining(18000);
|
|
11
|
-
|
|
11
|
+
const resetAt = seconds => {
|
|
12
|
+
const window = windows.find(window => window?.limit_window_seconds === seconds);
|
|
13
|
+
if (typeof window?.reset_at === "number" && Number.isFinite(window.reset_at) && window.reset_at > 0) return window.reset_at * 1000;
|
|
14
|
+
// 相对秒数绑定缓存更新时间,不能随着每次读取顺延。
|
|
15
|
+
if (typeof window?.reset_after_seconds === "number" && Number.isFinite(window.reset_after_seconds) && window.reset_after_seconds >= 0 && Number.isFinite(updatedAt) && updatedAt > 0) return updatedAt + window.reset_after_seconds * 1000;
|
|
16
|
+
return null;
|
|
17
|
+
};
|
|
18
|
+
return weekly == null ? null : { weekly, fiveHour, primary: fiveHour ?? weekly,
|
|
19
|
+
resetAt: { weekly: resetAt(604800), fiveHour: fiveHour == null ? null : resetAt(18000) } };
|
|
12
20
|
}
|
|
13
21
|
function nativeContext(rail) {
|
|
14
22
|
const result = { auth:null,client:null,router:null };
|
|
@@ -27,7 +35,7 @@ function currentWindows(context) {
|
|
|
27
35
|
const data = client?.getQueryData(["rate-limit-status"]);
|
|
28
36
|
// 账号与缓存必须同时一致;旧账号的最后一次响应不能留在导航栏。
|
|
29
37
|
if (!data || data.user_id !== auth.userId || data.account_id !== auth.accountId) return null;
|
|
30
|
-
return remainingWindows(data);
|
|
38
|
+
return remainingWindows(data, client.getQueryState?.(["rate-limit-status"])?.dataUpdatedAt);
|
|
31
39
|
}
|
|
32
40
|
function findAvatar(rail) {
|
|
33
41
|
const buttons = [...(rail?.querySelectorAll("button") ?? [])];
|
|
@@ -25,6 +25,8 @@ style.textContent = `
|
|
|
25
25
|
#${TIP_ID} dl { display:grid; grid-template-columns:auto auto; gap:2px 16px; margin:0; }
|
|
26
26
|
#${TIP_ID} dt { text-align:left; }
|
|
27
27
|
#${TIP_ID} dd { margin:0; text-align:right; font-variant-numeric:tabular-nums; }
|
|
28
|
+
#${TIP_ID} .mcx-usage-group { display:grid; grid-template-columns:subgrid; grid-column:1 / -1; gap:2px 16px; }
|
|
29
|
+
#${TIP_ID} .mcx-usage-group + .mcx-usage-group { border-top:1px solid color-mix(in srgb,var(--mcx-color-border-subtle) 50%,transparent); margin-top:calc(var(--mcx-spacing) * 1); padding-top:calc(var(--mcx-spacing) * 1); }
|
|
28
30
|
`;
|
|
29
31
|
document.head.append(style);
|
|
30
32
|
|
|
@@ -45,6 +47,7 @@ function quotaArc(start, end, clockwise) {
|
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
function draw(windows) {
|
|
50
|
+
record.windows = windows;
|
|
48
51
|
const svg = svgNode("svg", { viewBox: "0 0 32 32", class: "mcx-usage-ring", "aria-hidden": "true" });
|
|
49
52
|
if (windows.fiveHour != null) {
|
|
50
53
|
// 左下、右下各留 24° 圆头中心间距;两段都从左下切口扣减。
|
|
@@ -74,13 +77,24 @@ function draw(windows) {
|
|
|
74
77
|
number.setAttribute("data-digits", String(number.textContent.length));
|
|
75
78
|
record.button.replaceChildren(svg, number);
|
|
76
79
|
const list = document.createElement("dl");
|
|
77
|
-
const rows = windows.fiveHour == null ? [] : [["5h Limit", windows.fiveHour]];
|
|
78
|
-
rows.push(["Weekly Limit", windows.weekly]);
|
|
79
|
-
for (const [label, percent] of rows) {
|
|
80
|
+
const rows = windows.fiveHour == null ? [] : [["5h Limit", windows.fiveHour, windows.resetAt?.fiveHour]];
|
|
81
|
+
rows.push(["Weekly Limit", windows.weekly, windows.resetAt?.weekly]);
|
|
82
|
+
for (const [label, percent, resetAt] of rows) {
|
|
83
|
+
const group = document.createElement("div");
|
|
84
|
+
group.className = "mcx-usage-group";
|
|
80
85
|
const term = document.createElement("dt"), value = document.createElement("dd");
|
|
81
86
|
term.textContent = label;
|
|
82
87
|
value.textContent = `${percent}%`;
|
|
83
|
-
|
|
88
|
+
group.append(term, value);
|
|
89
|
+
const date = new Date(resetAt);
|
|
90
|
+
if (resetAt != null && Number.isFinite(date.getTime())) {
|
|
91
|
+
const resetTerm = document.createElement("dt"), resetValue = document.createElement("dd");
|
|
92
|
+
resetTerm.textContent = "Reset in";
|
|
93
|
+
const pad = value => String(value).padStart(2, "0");
|
|
94
|
+
resetValue.textContent = `${pad(date.getMonth() + 1)}/${pad(date.getDate())} ${pad(date.getHours())}:${pad(date.getMinutes())}`;
|
|
95
|
+
group.append(resetTerm, resetValue);
|
|
96
|
+
}
|
|
97
|
+
list.append(group);
|
|
84
98
|
}
|
|
85
99
|
record.tooltip.replaceChildren(list);
|
|
86
100
|
record.button.setAttribute("aria-label", rows.map(([label, percent]) => `${label} ${percent}%`).join(", "));
|
|
@@ -100,6 +114,7 @@ function positionTooltip() {
|
|
|
100
114
|
function showTooltip() {
|
|
101
115
|
clearTimeout(hoverTimer);
|
|
102
116
|
if (!record) return;
|
|
117
|
+
draw(record.windows);
|
|
103
118
|
record.tooltip.hidden = false;
|
|
104
119
|
record.button.setAttribute("aria-describedby", TIP_ID);
|
|
105
120
|
positionTooltip();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "minecodex",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.39",
|
|
4
4
|
"description": "Lightweight, local-first plugins for the Codex desktop app.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -76,7 +76,10 @@
|
|
|
76
76
|
"apps/dashboard/transport.js",
|
|
77
77
|
"packages/plugin/src",
|
|
78
78
|
"packages/plugin/assets",
|
|
79
|
-
"packages/plugin/plugin.json"
|
|
79
|
+
"packages/plugin/plugin.json",
|
|
80
|
+
"features/markdown-reading/vendor/qv/LICENSE",
|
|
81
|
+
"features/markdown-reading/vendor/qv/provenance.json",
|
|
82
|
+
"features/markdown-reading/vendor/qv/THIRD_PARTY_NOTICES.txt"
|
|
80
83
|
],
|
|
81
84
|
"engines": {
|
|
82
85
|
"node": ">=22.5.0"
|
|
@@ -94,7 +97,8 @@
|
|
|
94
97
|
"test:ui": "node --test packages/ui/test/*.test.mjs",
|
|
95
98
|
"build:icons": "node scripts/build-brand-icons.mjs",
|
|
96
99
|
"build:plugin": "node scripts/build-plugin.mjs",
|
|
97
|
-
"test:plugin": "node --test packages/plugin/test/*.test.mjs"
|
|
100
|
+
"test:plugin": "node --test packages/plugin/test/*.test.mjs",
|
|
101
|
+
"build:mermaid": "node scripts/build-qv-mermaid.mjs"
|
|
98
102
|
},
|
|
99
103
|
"repository": {
|
|
100
104
|
"type": "git",
|
|
@@ -122,6 +126,12 @@
|
|
|
122
126
|
"zod": "^4.6.5"
|
|
123
127
|
},
|
|
124
128
|
"devDependencies": {
|
|
125
|
-
"
|
|
129
|
+
"d3": "7.9.0",
|
|
130
|
+
"d3-sankey": "0.12.3",
|
|
131
|
+
"elkjs": "0.10.0",
|
|
132
|
+
"esbuild": "^0.28.2",
|
|
133
|
+
"html-to-image": "1.11.13",
|
|
134
|
+
"lucide": "0.468.0",
|
|
135
|
+
"mermaid": "11.12.0"
|
|
126
136
|
}
|
|
127
137
|
}
|