@linkdesk/ui 0.2.38 → 0.2.40
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/dist/index.js +74 -70
- package/dist/shell-provenance.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3111,14 +3111,14 @@ function oc(e, t, n) {
|
|
|
3111
3111
|
return A === 45 ? (e.consume(A), _) : Y(A);
|
|
3112
3112
|
}
|
|
3113
3113
|
function j(A) {
|
|
3114
|
-
return A === 47 ? (e.consume(A), a = "",
|
|
3114
|
+
return A === 47 ? (e.consume(A), a = "", J) : Y(A);
|
|
3115
3115
|
}
|
|
3116
|
-
function
|
|
3116
|
+
function J(A) {
|
|
3117
3117
|
if (A === 62) {
|
|
3118
3118
|
const Re = a.toLowerCase();
|
|
3119
3119
|
return Li.includes(Re) ? (e.consume(A), me) : Y(A);
|
|
3120
3120
|
}
|
|
3121
|
-
return Ce(A) && a.length < 8 ? (e.consume(A), a += String.fromCharCode(A),
|
|
3121
|
+
return Ce(A) && a.length < 8 ? (e.consume(A), a += String.fromCharCode(A), J) : Y(A);
|
|
3122
3122
|
}
|
|
3123
3123
|
function G(A) {
|
|
3124
3124
|
return A === 93 ? (e.consume(A), _) : Y(A);
|
|
@@ -3237,9 +3237,9 @@ function fc(e, t, n) {
|
|
|
3237
3237
|
return _ === 62 ? (e.consume(_), e.exit("htmlTextData"), e.exit("htmlText"), t) : n(_);
|
|
3238
3238
|
}
|
|
3239
3239
|
function j(_) {
|
|
3240
|
-
return e.exit("htmlTextData"), e.enter("lineEnding"), e.consume(_), e.exit("lineEnding"),
|
|
3240
|
+
return e.exit("htmlTextData"), e.enter("lineEnding"), e.consume(_), e.exit("lineEnding"), J;
|
|
3241
3241
|
}
|
|
3242
|
-
function
|
|
3242
|
+
function J(_) {
|
|
3243
3243
|
return ee(_) ? ne(e, G, "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(_) : G(_);
|
|
3244
3244
|
}
|
|
3245
3245
|
function G(_) {
|
|
@@ -3864,7 +3864,7 @@ function Zc(e, t, n) {
|
|
|
3864
3864
|
function z(O, Y) {
|
|
3865
3865
|
return X;
|
|
3866
3866
|
function X(M, D, W) {
|
|
3867
|
-
let j,
|
|
3867
|
+
let j, J, G, _;
|
|
3868
3868
|
return Array.isArray(M) ? (
|
|
3869
3869
|
/* c8 ignore next 1 */
|
|
3870
3870
|
ge(M)
|
|
@@ -3888,7 +3888,7 @@ function Zc(e, t, n) {
|
|
|
3888
3888
|
}
|
|
3889
3889
|
}
|
|
3890
3890
|
function ge(be) {
|
|
3891
|
-
return j = be,
|
|
3891
|
+
return j = be, J = 0, be.length === 0 ? W : A(be[J]);
|
|
3892
3892
|
}
|
|
3893
3893
|
function A(be) {
|
|
3894
3894
|
return Rt;
|
|
@@ -3908,7 +3908,7 @@ function Zc(e, t, n) {
|
|
|
3908
3908
|
return O(G, _), D;
|
|
3909
3909
|
}
|
|
3910
3910
|
function nt(be) {
|
|
3911
|
-
return _.restore(), ++
|
|
3911
|
+
return _.restore(), ++J < j.length ? A(j[J]) : W;
|
|
3912
3912
|
}
|
|
3913
3913
|
}
|
|
3914
3914
|
}
|
|
@@ -4144,7 +4144,7 @@ function l0(e) {
|
|
|
4144
4144
|
htmlTextData: g,
|
|
4145
4145
|
image: l(j),
|
|
4146
4146
|
label: G,
|
|
4147
|
-
labelText:
|
|
4147
|
+
labelText: J,
|
|
4148
4148
|
lineEnding: O,
|
|
4149
4149
|
link: l(W),
|
|
4150
4150
|
listItem: l(),
|
|
@@ -4414,7 +4414,7 @@ function l0(e) {
|
|
|
4414
4414
|
delete R.identifier, delete R.label;
|
|
4415
4415
|
this.data.referenceType = void 0;
|
|
4416
4416
|
}
|
|
4417
|
-
function
|
|
4417
|
+
function J(R) {
|
|
4418
4418
|
const q = this.sliceSerialize(R), K = this.stack[this.stack.length - 2];
|
|
4419
4419
|
K.label = a0(q), K.identifier = Pe(q).toLowerCase();
|
|
4420
4420
|
}
|
|
@@ -9368,10 +9368,10 @@ class Am {
|
|
|
9368
9368
|
this.isEol = !1;
|
|
9369
9369
|
}
|
|
9370
9370
|
}
|
|
9371
|
-
var
|
|
9371
|
+
var Z;
|
|
9372
9372
|
(function(e) {
|
|
9373
9373
|
e[e.CHARACTER = 0] = "CHARACTER", e[e.NULL_CHARACTER = 1] = "NULL_CHARACTER", e[e.WHITESPACE_CHARACTER = 2] = "WHITESPACE_CHARACTER", e[e.START_TAG = 3] = "START_TAG", e[e.END_TAG = 4] = "END_TAG", e[e.COMMENT = 5] = "COMMENT", e[e.DOCTYPE = 6] = "DOCTYPE", e[e.EOF = 7] = "EOF", e[e.HIBERNATION = 8] = "HIBERNATION";
|
|
9374
|
-
})(
|
|
9374
|
+
})(Z || (Z = {}));
|
|
9375
9375
|
function Qa(e, t) {
|
|
9376
9376
|
for (let n = e.attrs.length - 1; n >= 0; n--)
|
|
9377
9377
|
if (e.attrs[n].name === t)
|
|
@@ -10009,7 +10009,7 @@ class Fm {
|
|
|
10009
10009
|
//Token creation
|
|
10010
10010
|
_createStartTagToken() {
|
|
10011
10011
|
this.currentToken = {
|
|
10012
|
-
type:
|
|
10012
|
+
type: Z.START_TAG,
|
|
10013
10013
|
tagName: "",
|
|
10014
10014
|
tagID: s.UNKNOWN,
|
|
10015
10015
|
selfClosing: !1,
|
|
@@ -10020,7 +10020,7 @@ class Fm {
|
|
|
10020
10020
|
}
|
|
10021
10021
|
_createEndTagToken() {
|
|
10022
10022
|
this.currentToken = {
|
|
10023
|
-
type:
|
|
10023
|
+
type: Z.END_TAG,
|
|
10024
10024
|
tagName: "",
|
|
10025
10025
|
tagID: s.UNKNOWN,
|
|
10026
10026
|
selfClosing: !1,
|
|
@@ -10031,14 +10031,14 @@ class Fm {
|
|
|
10031
10031
|
}
|
|
10032
10032
|
_createCommentToken(t) {
|
|
10033
10033
|
this.currentToken = {
|
|
10034
|
-
type:
|
|
10034
|
+
type: Z.COMMENT,
|
|
10035
10035
|
data: "",
|
|
10036
10036
|
location: this.getCurrentLocation(t)
|
|
10037
10037
|
};
|
|
10038
10038
|
}
|
|
10039
10039
|
_createDoctypeToken(t) {
|
|
10040
10040
|
this.currentToken = {
|
|
10041
|
-
type:
|
|
10041
|
+
type: Z.DOCTYPE,
|
|
10042
10042
|
name: t,
|
|
10043
10043
|
forceQuirks: !1,
|
|
10044
10044
|
publicId: null,
|
|
@@ -10080,7 +10080,7 @@ class Fm {
|
|
|
10080
10080
|
}
|
|
10081
10081
|
emitCurrentTagToken() {
|
|
10082
10082
|
const t = this.currentToken;
|
|
10083
|
-
this.prepareToken(t), t.tagID = Ot(t.tagName), t.type ===
|
|
10083
|
+
this.prepareToken(t), t.tagID = Ot(t.tagName), t.type === Z.START_TAG ? (this.lastStartTagName = t.tagName, this.handler.onStartTag(t)) : (t.attrs.length > 0 && this._err(S.endTagWithAttributes), t.selfClosing && this._err(S.endTagWithTrailingSolidus), this.handler.onEndTag(t)), this.preprocessor.dropParsedChunk();
|
|
10084
10084
|
}
|
|
10085
10085
|
emitCurrentComment(t) {
|
|
10086
10086
|
this.prepareToken(t), this.handler.onComment(t), this.preprocessor.dropParsedChunk();
|
|
@@ -10091,15 +10091,15 @@ class Fm {
|
|
|
10091
10091
|
_emitCurrentCharacterToken(t) {
|
|
10092
10092
|
if (this.currentCharacterToken) {
|
|
10093
10093
|
switch (t && this.currentCharacterToken.location && (this.currentCharacterToken.location.endLine = t.startLine, this.currentCharacterToken.location.endCol = t.startCol, this.currentCharacterToken.location.endOffset = t.startOffset), this.currentCharacterToken.type) {
|
|
10094
|
-
case
|
|
10094
|
+
case Z.CHARACTER: {
|
|
10095
10095
|
this.handler.onCharacter(this.currentCharacterToken);
|
|
10096
10096
|
break;
|
|
10097
10097
|
}
|
|
10098
|
-
case
|
|
10098
|
+
case Z.NULL_CHARACTER: {
|
|
10099
10099
|
this.handler.onNullCharacter(this.currentCharacterToken);
|
|
10100
10100
|
break;
|
|
10101
10101
|
}
|
|
10102
|
-
case
|
|
10102
|
+
case Z.WHITESPACE_CHARACTER: {
|
|
10103
10103
|
this.handler.onWhitespaceCharacter(this.currentCharacterToken);
|
|
10104
10104
|
break;
|
|
10105
10105
|
}
|
|
@@ -10109,7 +10109,7 @@ class Fm {
|
|
|
10109
10109
|
}
|
|
10110
10110
|
_emitEOFToken() {
|
|
10111
10111
|
const t = this.getCurrentLocation(0);
|
|
10112
|
-
t && (t.endLine = t.startLine, t.endCol = t.startCol, t.endOffset = t.startOffset), this._emitCurrentCharacterToken(t), this.handler.onEof({ type:
|
|
10112
|
+
t && (t.endLine = t.startLine, t.endCol = t.startCol, t.endOffset = t.startOffset), this._emitCurrentCharacterToken(t), this.handler.onEof({ type: Z.EOF, location: t }), this.active = !1;
|
|
10113
10113
|
}
|
|
10114
10114
|
//Characters emission
|
|
10115
10115
|
//OPTIMIZATION: The specification uses only one type of character token (one token per character).
|
|
@@ -10130,13 +10130,13 @@ class Fm {
|
|
|
10130
10130
|
this._createCharacterToken(t, n);
|
|
10131
10131
|
}
|
|
10132
10132
|
_emitCodePoint(t) {
|
|
10133
|
-
const n = Ka(t) ?
|
|
10133
|
+
const n = Ka(t) ? Z.WHITESPACE_CHARACTER : t === p.NULL ? Z.NULL_CHARACTER : Z.CHARACTER;
|
|
10134
10134
|
this._appendCharToCurrentCharacterToken(n, String.fromCodePoint(t));
|
|
10135
10135
|
}
|
|
10136
10136
|
//NOTE: used when we emit characters explicitly.
|
|
10137
10137
|
//This is always for non-whitespace and non-null characters, which allows us to avoid additional checks.
|
|
10138
10138
|
_emitChars(t) {
|
|
10139
|
-
this._appendCharToCurrentCharacterToken(
|
|
10139
|
+
this._appendCharToCurrentCharacterToken(Z.CHARACTER, t);
|
|
10140
10140
|
}
|
|
10141
10141
|
// Character reference helpers
|
|
10142
10142
|
_startCharacterReference() {
|
|
@@ -12798,7 +12798,7 @@ class pu {
|
|
|
12798
12798
|
const r = n.location, i = this.treeAdapter.getTagName(t), u = (
|
|
12799
12799
|
// NOTE: For cases like <p> <p> </p> - First 'p' closes without a closing
|
|
12800
12800
|
// tag and for cases like <td> <p> </td> - 'p' closes without a closing tag.
|
|
12801
|
-
n.type ===
|
|
12801
|
+
n.type === Z.END_TAG && i === n.tagName ? {
|
|
12802
12802
|
endTag: { ...r },
|
|
12803
12803
|
endLine: r.endLine,
|
|
12804
12804
|
endCol: r.endCol,
|
|
@@ -12827,35 +12827,35 @@ class pu {
|
|
|
12827
12827
|
/** @protected */
|
|
12828
12828
|
_processToken(t) {
|
|
12829
12829
|
switch (t.type) {
|
|
12830
|
-
case
|
|
12830
|
+
case Z.CHARACTER: {
|
|
12831
12831
|
this.onCharacter(t);
|
|
12832
12832
|
break;
|
|
12833
12833
|
}
|
|
12834
|
-
case
|
|
12834
|
+
case Z.NULL_CHARACTER: {
|
|
12835
12835
|
this.onNullCharacter(t);
|
|
12836
12836
|
break;
|
|
12837
12837
|
}
|
|
12838
|
-
case
|
|
12838
|
+
case Z.COMMENT: {
|
|
12839
12839
|
this.onComment(t);
|
|
12840
12840
|
break;
|
|
12841
12841
|
}
|
|
12842
|
-
case
|
|
12842
|
+
case Z.DOCTYPE: {
|
|
12843
12843
|
this.onDoctype(t);
|
|
12844
12844
|
break;
|
|
12845
12845
|
}
|
|
12846
|
-
case
|
|
12846
|
+
case Z.START_TAG: {
|
|
12847
12847
|
this._processStartTag(t);
|
|
12848
12848
|
break;
|
|
12849
12849
|
}
|
|
12850
|
-
case
|
|
12850
|
+
case Z.END_TAG: {
|
|
12851
12851
|
this.onEndTag(t);
|
|
12852
12852
|
break;
|
|
12853
12853
|
}
|
|
12854
|
-
case
|
|
12854
|
+
case Z.EOF: {
|
|
12855
12855
|
this.onEof(t);
|
|
12856
12856
|
break;
|
|
12857
12857
|
}
|
|
12858
|
-
case
|
|
12858
|
+
case Z.WHITESPACE_CHARACTER: {
|
|
12859
12859
|
this.onWhitespaceCharacter(t);
|
|
12860
12860
|
break;
|
|
12861
12861
|
}
|
|
@@ -13730,7 +13730,7 @@ function S1(e, t) {
|
|
|
13730
13730
|
}
|
|
13731
13731
|
}
|
|
13732
13732
|
function Gt(e, t) {
|
|
13733
|
-
const n = t.type ===
|
|
13733
|
+
const n = t.type === Z.EOF ? S.openElementsLeftAfterEof : S.disallowedContentInNoscriptInHead;
|
|
13734
13734
|
e._err(t, n), e.openElements.pop(), e.insertionMode = b.IN_HEAD, e._processToken(t);
|
|
13735
13735
|
}
|
|
13736
13736
|
function L1(e, t) {
|
|
@@ -13789,27 +13789,27 @@ function Qt(e, t) {
|
|
|
13789
13789
|
}
|
|
13790
13790
|
function Un(e, t) {
|
|
13791
13791
|
switch (t.type) {
|
|
13792
|
-
case
|
|
13792
|
+
case Z.CHARACTER: {
|
|
13793
13793
|
us(e, t);
|
|
13794
13794
|
break;
|
|
13795
13795
|
}
|
|
13796
|
-
case
|
|
13796
|
+
case Z.WHITESPACE_CHARACTER: {
|
|
13797
13797
|
is(e, t);
|
|
13798
13798
|
break;
|
|
13799
13799
|
}
|
|
13800
|
-
case
|
|
13800
|
+
case Z.COMMENT: {
|
|
13801
13801
|
Lr(e, t);
|
|
13802
13802
|
break;
|
|
13803
13803
|
}
|
|
13804
|
-
case
|
|
13804
|
+
case Z.START_TAG: {
|
|
13805
13805
|
ke(e, t);
|
|
13806
13806
|
break;
|
|
13807
13807
|
}
|
|
13808
|
-
case
|
|
13808
|
+
case Z.END_TAG: {
|
|
13809
13809
|
zn(e, t);
|
|
13810
13810
|
break;
|
|
13811
13811
|
}
|
|
13812
|
-
case
|
|
13812
|
+
case Z.EOF: {
|
|
13813
13813
|
ls(e, t);
|
|
13814
13814
|
break;
|
|
13815
13815
|
}
|
|
@@ -14306,11 +14306,11 @@ function Ep(e, t) {
|
|
|
14306
14306
|
function lr(e, t) {
|
|
14307
14307
|
if (e.openElements.currentTagId !== void 0 && rs.has(e.openElements.currentTagId))
|
|
14308
14308
|
switch (e.pendingCharacterTokens.length = 0, e.hasNonWhitespacePendingCharacterToken = !1, e.originalInsertionMode = e.insertionMode, e.insertionMode = b.IN_TABLE_TEXT, t.type) {
|
|
14309
|
-
case
|
|
14309
|
+
case Z.CHARACTER: {
|
|
14310
14310
|
ds(e, t);
|
|
14311
14311
|
break;
|
|
14312
14312
|
}
|
|
14313
|
-
case
|
|
14313
|
+
case Z.WHITESPACE_CHARACTER: {
|
|
14314
14314
|
cs(e, t);
|
|
14315
14315
|
break;
|
|
14316
14316
|
}
|
|
@@ -14899,7 +14899,7 @@ function Gp(e, t) {
|
|
|
14899
14899
|
function Qp(e, t) {
|
|
14900
14900
|
t.parser.tokenizer.state > 4 && (t.parser.tokenizer.state = 0);
|
|
14901
14901
|
const n = {
|
|
14902
|
-
type:
|
|
14902
|
+
type: Z.CHARACTER,
|
|
14903
14903
|
chars: e.value,
|
|
14904
14904
|
location: sn(e)
|
|
14905
14905
|
};
|
|
@@ -14907,7 +14907,7 @@ function Qp(e, t) {
|
|
|
14907
14907
|
}
|
|
14908
14908
|
function Kp(e, t) {
|
|
14909
14909
|
const n = {
|
|
14910
|
-
type:
|
|
14910
|
+
type: Z.DOCTYPE,
|
|
14911
14911
|
name: "html",
|
|
14912
14912
|
forceQuirks: !1,
|
|
14913
14913
|
publicId: "",
|
|
@@ -14930,7 +14930,7 @@ function Xp(e, t) {
|
|
|
14930
14930
|
}
|
|
14931
14931
|
function As(e, t) {
|
|
14932
14932
|
const n = e.value, r = {
|
|
14933
|
-
type:
|
|
14933
|
+
type: Z.COMMENT,
|
|
14934
14934
|
data: n,
|
|
14935
14935
|
location: sn(e)
|
|
14936
14936
|
};
|
|
@@ -14989,7 +14989,7 @@ function eE(e, t) {
|
|
|
14989
14989
|
{ ...e, children: [] },
|
|
14990
14990
|
{ space: i === ot.svg ? "svg" : "html" }
|
|
14991
14991
|
), a = {
|
|
14992
|
-
type:
|
|
14992
|
+
type: Z.START_TAG,
|
|
14993
14993
|
tagName: n,
|
|
14994
14994
|
tagID: Ot(n),
|
|
14995
14995
|
// We always send start and end tags.
|
|
@@ -15007,7 +15007,7 @@ function tE(e, t) {
|
|
|
15007
15007
|
if (!t.parser.tokenizer.inForeignNode && Em.includes(n) || t.parser.tokenizer.state === fe.PLAINTEXT) return;
|
|
15008
15008
|
Dt(t, wn(e));
|
|
15009
15009
|
const r = {
|
|
15010
|
-
type:
|
|
15010
|
+
type: Z.END_TAG,
|
|
15011
15011
|
tagName: n,
|
|
15012
15012
|
tagID: Ot(n),
|
|
15013
15013
|
selfClosing: !1,
|
|
@@ -16020,6 +16020,10 @@ function Ls(e, t) {
|
|
|
16020
16020
|
id: n.command,
|
|
16021
16021
|
label: n.label ?? n.command,
|
|
16022
16022
|
group: t,
|
|
16023
|
+
// 2026-10-04:**键帽随 children 递归**——此前漏透传,任何走子面板的项键帽全丢
|
|
16024
|
+
// (汉堡把同组贡献项折进「文件」容器后,插件项从一级挪进子面板 ⇒ 键帽当场消失;
|
|
16025
|
+
// 顶栏的嵌套子菜单如「查看→界面→主侧栏」同病)。渲染层两级本就同款(见子面板分支)。
|
|
16026
|
+
shortcut: n.shortcut,
|
|
16023
16027
|
checked: n.checked,
|
|
16024
16028
|
commandArgs: n.commandArgs,
|
|
16025
16029
|
...r ? { children: r } : {}
|
|
@@ -16043,14 +16047,14 @@ function WT({ menuId: e, anchor: t, context: n, onClose: r, resolveChildren: i,
|
|
|
16043
16047
|
const h = He(() => {
|
|
16044
16048
|
const M = /* @__PURE__ */ new Map(), D = [];
|
|
16045
16049
|
for (const j of f) {
|
|
16046
|
-
const
|
|
16047
|
-
if (!j.command && !
|
|
16050
|
+
const J = j.children;
|
|
16051
|
+
if (!j.command && !J) continue;
|
|
16048
16052
|
const G = j.group ?? "__default";
|
|
16049
16053
|
M.has(G) || (M.set(G, []), D.push(G));
|
|
16050
16054
|
let _;
|
|
16051
|
-
if (
|
|
16052
|
-
_ = Ls(
|
|
16053
|
-
else if (
|
|
16055
|
+
if (J && J.length > 0)
|
|
16056
|
+
_ = Ls(J, G);
|
|
16057
|
+
else if (J && J.length === 0 && i) {
|
|
16054
16058
|
const me = i(j.command, n ?? {});
|
|
16055
16059
|
me && me.length > 0 && (_ = me.map((ge) => ({ id: ge.id, label: ge.label, group: G, checked: ge.checked, onSelect: ge.onSelect })));
|
|
16056
16060
|
}
|
|
@@ -16077,16 +16081,16 @@ function WT({ menuId: e, anchor: t, context: n, onClose: r, resolveChildren: i,
|
|
|
16077
16081
|
c.current && (clearTimeout(c.current), c.current = null), c.current = setTimeout(() => I((D) => D.slice(0, M)), 150);
|
|
16078
16082
|
}, []), L = le((M, D, W) => {
|
|
16079
16083
|
N();
|
|
16080
|
-
const j = M.getBoundingClientRect(),
|
|
16084
|
+
const j = M.getBoundingClientRect(), J = 160, G = j.right + J > window.innerWidth ? j.left - J - 4 : j.right + 4;
|
|
16081
16085
|
I((_) => [..._.slice(0, W), { x: G, y: j.top, items: D }]);
|
|
16082
16086
|
}, [N]), [x, P] = ae({ left: t.x, top: t.y }), [v, C] = ae(!1), z = v;
|
|
16083
16087
|
ie(() => {
|
|
16084
16088
|
if (!z) return;
|
|
16085
|
-
const M = (
|
|
16086
|
-
|
|
16087
|
-
}, D = () => r(), W = () => r(), j = (
|
|
16089
|
+
const M = (J) => {
|
|
16090
|
+
J.key === "Escape" && kE(o.current) && (E.length > 0 ? I((G) => G.slice(0, G.length - 1)) : r());
|
|
16091
|
+
}, D = () => r(), W = () => r(), j = (J) => {
|
|
16088
16092
|
var me;
|
|
16089
|
-
const G =
|
|
16093
|
+
const G = J.target;
|
|
16090
16094
|
(((me = o.current) == null ? void 0 : me.contains(G)) ?? !1) || [...l.current.values()].some((ge) => ge.contains(G)) || r();
|
|
16091
16095
|
};
|
|
16092
16096
|
return window.addEventListener("keydown", M), window.addEventListener("blur", D), window.addEventListener("wheel", W, !0), a !== "embedded" && window.addEventListener("mousedown", j, !0), () => {
|
|
@@ -16097,7 +16101,7 @@ function WT({ menuId: e, anchor: t, context: n, onClose: r, resolveChildren: i,
|
|
|
16097
16101
|
ie(() => {
|
|
16098
16102
|
if (!z) return;
|
|
16099
16103
|
const M = (D) => {
|
|
16100
|
-
var W, j,
|
|
16104
|
+
var W, j, J;
|
|
16101
16105
|
if (D.key === "ArrowDown")
|
|
16102
16106
|
D.preventDefault(), U((G) => Math.min(G + 1, O.length - 1));
|
|
16103
16107
|
else if (D.key === "ArrowUp")
|
|
@@ -16114,7 +16118,7 @@ function WT({ menuId: e, anchor: t, context: n, onClose: r, resolveChildren: i,
|
|
|
16114
16118
|
else if (D.key === "Enter" && V >= 0) {
|
|
16115
16119
|
D.preventDefault();
|
|
16116
16120
|
const G = O[V];
|
|
16117
|
-
G && (G.onSelect ? G.onSelect() : (
|
|
16121
|
+
G && (G.onSelect ? G.onSelect() : (J = (j = fr().commands) == null ? void 0 : j.executeCommand) == null || J.call(j, G.id, void 0, ...G.commandArgs ?? [], n), r());
|
|
16118
16122
|
}
|
|
16119
16123
|
};
|
|
16120
16124
|
return window.addEventListener("keydown", M), () => window.removeEventListener("keydown", M);
|
|
@@ -16135,13 +16139,13 @@ function WT({ menuId: e, anchor: t, context: n, onClose: r, resolveChildren: i,
|
|
|
16135
16139
|
}, [t.x, t.y, h.length]), ie(() => {
|
|
16136
16140
|
const M = o.current;
|
|
16137
16141
|
if (!M) return;
|
|
16138
|
-
const D = M.
|
|
16139
|
-
let
|
|
16140
|
-
|
|
16141
|
-
const
|
|
16142
|
+
const D = M.offsetWidth, W = M.offsetHeight;
|
|
16143
|
+
let j = t.x, J = Math.max(30, t.y);
|
|
16144
|
+
j + D > window.innerWidth && (j = Math.max(0, window.innerWidth - D - 4)), J + W > window.innerHeight && (J = Math.max(30, window.innerHeight - W - 4)), P({ left: j, top: J });
|
|
16145
|
+
const G = requestAnimationFrame(() => {
|
|
16142
16146
|
C(!0), M.classList.add("show");
|
|
16143
16147
|
});
|
|
16144
|
-
return () => cancelAnimationFrame(
|
|
16148
|
+
return () => cancelAnimationFrame(G);
|
|
16145
16149
|
}, [t.x, t.y, h.length]), ie(() => {
|
|
16146
16150
|
var M;
|
|
16147
16151
|
v && ((M = o.current) == null || M.focus());
|
|
@@ -16175,7 +16179,7 @@ function WT({ menuId: e, anchor: t, context: n, onClose: r, resolveChildren: i,
|
|
|
16175
16179
|
},
|
|
16176
16180
|
children: h.map((M, D) => {
|
|
16177
16181
|
if ("type" in M) return /* @__PURE__ */ w("div", { className: "ldk-ctx-divider" }, `div-${D}`);
|
|
16178
|
-
const W = X++, j = !!(M.children && M.children.length > 0),
|
|
16182
|
+
const W = X++, j = !!(M.children && M.children.length > 0), J = W === V, G = M.group === "delete";
|
|
16179
16183
|
return (
|
|
16180
16184
|
// E5.8#37.7.1:复合 key——共享命令 id 的动态项(面板视图清单全用同一 toggle 命令)会撞 key;
|
|
16181
16185
|
// 并入数组索引消歧(菜单项在菜单生命周期内静态,索引稳定)。
|
|
@@ -16185,7 +16189,7 @@ function WT({ menuId: e, anchor: t, context: n, onClose: r, resolveChildren: i,
|
|
|
16185
16189
|
ref: (_) => {
|
|
16186
16190
|
_ ? g.current.set(W, _) : g.current.delete(W);
|
|
16187
16191
|
},
|
|
16188
|
-
className: `ldk-ctx-item${
|
|
16192
|
+
className: `ldk-ctx-item${J ? " focused" : ""}${G ? " ldk-ctx-item-danger" : ""}`,
|
|
16189
16193
|
onClick: (_) => {
|
|
16190
16194
|
_.stopPropagation(), j || Y(M);
|
|
16191
16195
|
},
|
|
@@ -16219,24 +16223,24 @@ function WT({ menuId: e, anchor: t, context: n, onClose: r, resolveChildren: i,
|
|
|
16219
16223
|
onMouseEnter: N,
|
|
16220
16224
|
onMouseLeave: () => k(D + 1),
|
|
16221
16225
|
children: M.items.map((W, j) => {
|
|
16222
|
-
const
|
|
16226
|
+
const J = !!(W.children && W.children.length > 0);
|
|
16223
16227
|
return /* @__PURE__ */ re(
|
|
16224
16228
|
"div",
|
|
16225
16229
|
{
|
|
16226
16230
|
className: "ldk-ctx-item",
|
|
16227
16231
|
onClick: (G) => {
|
|
16228
|
-
G.stopPropagation(),
|
|
16232
|
+
G.stopPropagation(), J || Y(W);
|
|
16229
16233
|
},
|
|
16230
16234
|
onMouseEnter: (G) => {
|
|
16231
|
-
|
|
16235
|
+
J ? L(G.currentTarget, W.children, D + 1) : I((_) => _.slice(0, D + 1));
|
|
16232
16236
|
},
|
|
16233
16237
|
onMouseLeave: () => {
|
|
16234
|
-
|
|
16238
|
+
J && k(D + 2);
|
|
16235
16239
|
},
|
|
16236
16240
|
children: [
|
|
16237
16241
|
/* @__PURE__ */ w("span", { className: "ldk-ctx-item-check", "aria-hidden": "true", children: W.checked ? "✓" : "" }),
|
|
16238
16242
|
/* @__PURE__ */ w("span", { className: "ldk-ctx-item-label", children: W.label }),
|
|
16239
|
-
|
|
16243
|
+
J && /* @__PURE__ */ w("span", { className: "ctx-item-chevron", children: "›" }),
|
|
16240
16244
|
W.shortcut && /* @__PURE__ */ w(Nu, { label: W.shortcut, className: "ldk-ctx-item-shortcut" })
|
|
16241
16245
|
]
|
|
16242
16246
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linkdesk/ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.40",
|
|
4
4
|
"description": "@linkdesk/ui——LinkDesk 共享 UI 组件的类型契约 + dev 解析体。L9 集中供给:组件代码与样式在运行时由壳池 vendor 单实例供给(壳改一处全生态跟随);npm i 装的是类型与本地解析体,插件源码不 import 本包 css(lint 腿 check-ui-css-import 判红)。版本号自走(E6#166 对货不对号:2026-10-01 起与壳脱钩,壳发版只查作者面货不落后)。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|