dsh-chat-link-actions 0.2.12 → 0.2.13
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/client.js +9 -5
- package/package.json +1 -1
package/client.js
CHANGED
|
@@ -332,7 +332,8 @@ window.__ModuleLoader__.load({
|
|
|
332
332
|
var FIBER_KEY = /^__(?:reactFiber|reactInternalInstance)\$/;
|
|
333
333
|
|
|
334
334
|
/** 可能带文件的属性名。 */
|
|
335
|
-
var PROP_KEYS = ["destination", "path", "src", "href"];
|
|
335
|
+
var PROP_KEYS = ["destination", "path", "absolutePath", "filePath", "localPath", "assetPath", "sourcePath", "src", "href"];
|
|
336
|
+
var PROP_CONTAINERS = ["file", "asset", "attachment", "source", "item"];
|
|
336
337
|
|
|
337
338
|
/** Strip the line suffix a Markdown file link carries (`path#L12`). */
|
|
338
339
|
function stripLineSuffix(value) {
|
|
@@ -343,10 +344,13 @@ window.__ModuleLoader__.load({
|
|
|
343
344
|
/** Read the path a component's props carry, if any. */
|
|
344
345
|
function pathFromProps(props) {
|
|
345
346
|
if (props === null || typeof props !== "object") return null;
|
|
346
|
-
var
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
347
|
+
for (var c = 0; c < PROP_CONTAINERS.length; c += 1) {
|
|
348
|
+
var box = props[PROP_CONTAINERS[c]];
|
|
349
|
+
if (box === null || typeof box !== "object") continue;
|
|
350
|
+
for (var k = 0; k < PROP_KEYS.length; k += 1) {
|
|
351
|
+
var nested = normalizeCandidate(stripLineSuffix(box[PROP_KEYS[k]]));
|
|
352
|
+
if (nested !== null) return nested;
|
|
353
|
+
}
|
|
350
354
|
}
|
|
351
355
|
for (var i = 0; i < PROP_KEYS.length; i += 1) {
|
|
352
356
|
var fromProp = normalizeCandidate(stripLineSuffix(props[PROP_KEYS[i]]));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-chat-link-actions",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.13",
|
|
4
4
|
"description": "Right-click actions on file links in the DSH transcript: quote the path into the composer, or reveal the file in the OS file manager. Menus are drawn in the app's own style, never the system one.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|