minecodex 2.0.9 → 2.0.11

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.
@@ -34,7 +34,10 @@ function reconcile() {
34
34
  }, { signal });
35
35
  // 作为原生按钮组的独立子项,继承组内 gap,不放进铃铛的 Tooltip 包装层。
36
36
  let anchor = bell;
37
- while (anchor.parentElement && getComputedStyle(anchor.parentElement).display !== "flex") {
37
+ while (anchor.parentElement && anchor.parentElement !== sidebar) {
38
+ const layout = getComputedStyle(anchor.parentElement);
39
+ // 跳过零间距的通知包装层,接入真正带原生 gap 的按钮组。
40
+ if (["flex", "inline-flex"].includes(layout.display) && Number.parseFloat(layout.columnGap) > 0) break;
38
41
  anchor = anchor.parentElement;
39
42
  }
40
43
  anchor.after(button);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "minecodex",
3
- "version": "2.0.9",
3
+ "version": "2.0.11",
4
4
  "description": "Lightweight, local-first plugins for the Codex desktop app.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -2,7 +2,10 @@
2
2
  export function tokenRequirements(source, bindings) {
3
3
  const nativeNames=new Map(Object.entries(bindings).map(([native,project])=>[project,native]));
4
4
  const requirements=new Map();
5
+ const localNames=new Set([...source.matchAll(/(--mcx-[a-z0-9-]+)\s*:/g)].map(match=>match[1]));
5
6
  for (const match of source.matchAll(/var\((--mcx-[a-z0-9-]+)\s*([,)])/g)) {
7
+ // 插件声明的局部变量不属于原生映射;其消费的共享变量仍独立检查。
8
+ if (!nativeNames.has(match[1]) && localNames.has(match[1])) continue;
6
9
  const name=nativeNames.get(match[1]) ?? match[1];
7
10
  requirements.set(name,{name,required:match[2] === ")" || requirements.get(name)?.required === true,
8
11
  ...(nativeNames.has(match[1]) ? {} : {unmapped:true})});
@@ -8,8 +8,9 @@ export function installComposerMenu(signal, ui) {
8
8
  ui.layer(node, "floating");
9
9
  const rect = body.getBoundingClientRect();
10
10
  const root = anchor.closest("[data-codex-composer-root], [data-chatgpt-composer]");
11
- // 首页 Add 向下展开;已有会话保留向上的输入框菜单。
12
- const below = root?.getAttribute("data-composer-placement") === "home";
11
+ const nativeSide = anchor.closest("[data-dropdown-overlay-side]")?.getAttribute("data-dropdown-overlay-side");
12
+ // 新会话跟随原生 Add 方向,不能仅凭 home 将 Codex 模式改为向下。
13
+ const below = root?.getAttribute("data-composer-placement") === "home" && nativeSide === "bottom";
13
14
  const zoom = Number.parseFloat(getComputedStyle(node).zoom) || 1;
14
15
  node.style.left = `${rect.left / zoom}px`;
15
16
  node.style.top = `${(below ? rect.bottom + gap : rect.top - gap) / zoom}px`;