禅模式 插件 修改

prozen插件的基础上,做了个性化修改

原本进入禅模式之后,只有主屏全屏

修改成进入禅模式后,主屏+左侧边栏的目录

/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/

var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// main.ts
var main_exports = {};
__export(main_exports, {
  default: () => Prozen
});
module.exports = __toCommonJS(main_exports);
var import_obsidian = require("obsidian");

const ZEN_MODE_STYLE_ID = "prozen-step1-style";
const ZEN_MODE_BODY_CLASS = "prozen-zen-active";
const ZEN_ACTIVE_LEAF_CLASS = "prozen-active-leaf-ontop";

const ZEN_STYLES = `
  /* 
   * This hides the far-left icon bar (Ribbon), the main status bar (bottom-right),
   * the new vault profile section (bottom-left), and the sidebar collapse icon (top-left).
  */
  body.${ZEN_MODE_BODY_CLASS} .workspace-ribbon,
  body.${ZEN_MODE_BODY_CLASS} .status-bar,
  body.${ZEN_MODE_BODY_CLASS} .workspace-sidedock-vault-profile,
  body.${ZEN_MODE_BODY_CLASS} .workspace-split.mod-left-split .clickable-icon {
    display: none !important;
  }

  /* 
  =================================================================
   功能:鼠标悬停时显示左侧边栏顶部图标
  =================================================================
  */
  body.${ZEN_MODE_BODY_CLASS} .workspace-split.mod-left-split .workspace-tab-header {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
  }
  
  body.${ZEN_MODE_BODY_CLASS} .workspace-split.mod-left-split .workspace-tab-header:hover {
    opacity: 1;
  }
  /* ================================================================= */

  /* 
  =================================================================
   功能:自定义 Quiet Outline 插件样式
  =================================================================
  */
  /* 增大字号 */
  body.${ZEN_MODE_BODY_CLASS} .quiet-outline .n-tree.ellipsis .n-tree-node .n-tree-node-content p {
    font-size: 24px !important;
  }

  /* 增加行高以匹配新字号,防止文字堆叠 */
  body.${ZEN_MODE_BODY_CLASS} .quiet-outline .n-tree-node-content {
    height: 38px !important; /* 给予足够的垂直空间 */
  }

  /* 将大纲整体左移 */
  body.${ZEN_MODE_BODY_CLASS} .quiet-outline .n-tree {
    margin-left: +20px;
  }

  /* 【新】默认隐藏层级滑块 */
  body.${ZEN_MODE_BODY_CLASS} .quiet-outline .n-slider {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
  }

  /* 【新】当鼠标悬停在整个大纲区域时,显示滑块 */
  body.${ZEN_MODE_BODY_CLASS} .quiet-outline:hover .n-slider {
    opacity: 1;
  }
  /* ================================================================= */

  /* 
  =================================================================
   功能:将侧边栏置于光晕效果顶层,防止文字被遮挡
  =================================================================
  */
  body.${ZEN_MODE_BODY_CLASS} .workspace-split.mod-left-split {
    position: relative; /* 建立新的堆叠环境 */
    z-index: calc(var(--layer-modal) + 1); /* 将层级提升到光晕(modal)之上 */
  }
  /* ================================================================= */

  /* 
  =================================================================
   【新增代码】功能:为 horizontal-main-container 添加内边距和间距
  =================================================================
  */
  body.${ZEN_MODE_BODY_CLASS} .horizontal-main-container {
    padding: 16px;
    gap: 0px;
  }
  /* ================================================================= */


  /* --- The rest of the logic for layout and halo remains the same --- */

  /* Hide the entire central pane container */
  body.${ZEN_MODE_BODY_CLASS} .mod-root-split > .workspace-split:not(.mod-left-split) {
    visibility: hidden;
  }

  /* The layout logic for the active pane */
  body.${ZEN_MODE_BODY_CLASS} .workspace-leaf.${ZEN_ACTIVE_LEAF_CLASS} {
    visibility: visible;
    position: fixed !important;
    top: 0;
    left: var(--prozen-left-sidebar-width, 0px);
    width: calc(100% - var(--prozen-left-sidebar-width, 0px));
    height: 100vh;
    z-index: var(--layer-sidedock); 
  }

  /* The single, seamless halo overlay */
  body.${ZEN_MODE_BODY_CLASS}::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: var(--layer-modal);
    pointer-events: none;
    background-image: linear-gradient(
      90deg, 
      rgba(0,0,0,var(--vignette-opacity)) 0%, 
      transparent var(--vignette-scale-linear), 
      transparent calc(100% - var(--vignette-scale-linear)), 
      rgba(0,0,0,var(--vignette-opacity)) 100%
    );
  }
`;

var DEFAULT_SETTINGS = {
  animationDuration: 2,
  showHeader: false,
  showScroll: false,
  showGraphControls: false,
  forceReadable: true,
  vignetteOpacity: 0.75,
  vignetteScaleLinear: 20,
  vignetteScaleRadial: 75
};

var Prozen = class extends import_obsidian.Plugin {
  styleEl = null;
  originalSidebarStyleWidth = null;

  async onload() {
    await this.loadSettings();
    
    this.styleEl = document.createElement('style');
    this.styleEl.id = ZEN_MODE_STYLE_ID;
    this.styleEl.innerHTML = ZEN_STYLES;
    document.head.appendChild(this.styleEl);

    this.addCommand({
      id: "zenmode",
      name: "终极专注模式 (全屏, 保留侧边栏, 聚焦单屏)",
      callback: this.fullscreenMode.bind(this)
    });
    this.addSettingTab(new ProzenSettingTab(this.app, this));
  }

  onunload() {
    if (document.fullscreenElement) {
      document.exitFullscreen();
    }
    this.cleanupZenMode();
    const existingStyle = document.getElementById(ZEN_MODE_STYLE_ID);
    if (existingStyle) {
      existingStyle.remove();
    }
  }

  async loadSettings() {
    this.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData());
  }

  async saveSettings() {
    await this.saveData(this.settings);
  }

  fullscreenMode() {
    const activeLeaf = this.app.workspace.getActiveViewOfType(import_obsidian.ItemView)?.leaf;
    if (!activeLeaf) return;

    if (!document.fullscreenElement) {
      // --- Enter Zen Mode ---
      document.body.requestFullscreen();

      const root = document.documentElement;
      root.style.setProperty("--vignette-opacity", this.settings.vignetteOpacity);
      root.style.setProperty("--vignette-scale-linear", this.settings.vignetteScaleLinear + "%");
      
      const leftSidebar = document.querySelector('.workspace-split.mod-left-split');
      
      let effectiveSidebarWidth = 0;

      if (leftSidebar && !leftSidebar.classList.contains('is-collapsed')) {
        this.originalSidebarStyleWidth = leftSidebar.style.width || "";

        const originalSidebarWidth = leftSidebar.offsetWidth;
        const newSidebarWidth = originalSidebarWidth + 100;

        leftSidebar.style.width = `${newSidebarWidth}px`;
        effectiveSidebarWidth = newSidebarWidth;
      }
      
      document.body.style.setProperty('--prozen-left-sidebar-width', `${effectiveSidebarWidth}px`);

      document.body.classList.add(ZEN_MODE_BODY_CLASS);
      activeLeaf.containerEl.classList.add(ZEN_ACTIVE_LEAF_CLASS);

      this.addStyles(activeLeaf);
      
      document.onfullscreenchange = () => {
        if (!document.fullscreenElement) {
          this.cleanupZenMode(activeLeaf);
        }
      };
    } else {
      document.exitFullscreen();
    }
  }
  
  cleanupZenMode(activeLeaf) {
    const leaf = activeLeaf || this.app.workspace.getActiveViewOfType(import_obsidian.ItemView)?.leaf;

    document.body.classList.remove(ZEN_MODE_BODY_CLASS);
    document.body.style.removeProperty('--prozen-left-sidebar-width');
    
    const leftSidebar = document.querySelector('.workspace-split.mod-left-split');
    if (leftSidebar && this.originalSidebarStyleWidth !== null) {
      leftSidebar.style.width = this.originalSidebarStyleWidth;
      this.originalSidebarStyleWidth = null; 
    }

    const activeZenLeaf = document.querySelector(`.${ZEN_ACTIVE_LEAF_CLASS}`);
    if (activeZenLeaf) activeZenLeaf.classList.remove(ZEN_ACTIVE_LEAF_CLASS);

    if (leaf) this.removeStyles(leaf);
    
    document.onfullscreenchange = null;
  }

  addStyles(leaf) {
    const viewEl = leaf.view.contentEl;
    const header = leaf.view.headerEl;
    const isGraph = leaf.view.getViewType() === "graph";
    let graphControls;
    if (isGraph) {
      graphControls = leaf.view.dataEngine?.controlsEl;
    }
    if (!this.settings.showScroll) {
      viewEl.classList.add("noscroll");
    }
    if (isGraph && !this.settings.showGraphControls && graphControls) {
      graphControls.classList.add("hide");
    }
    if (!isGraph && this.settings.forceReadable) {
      if (leaf.view.editMode?.editorEl) {
        leaf.view.editMode.editorEl.classList.add("is-readable-line-width");
      }
    }
    const root = document.documentElement;
    root.style.setProperty("--fadeIn-duration", this.settings.animationDuration + "s");
    viewEl.classList.add("animate"); 
    this.settings.showHeader ? header.classList.add("animate") : header.classList.add("hide");
  }

  removeStyles(leaf) {
    const viewEl = leaf.view.contentEl;
    const header = leaf.view.headerEl;
    const isGraph = leaf.view.getViewType() === "graph";
    let graphControls;
    if (isGraph) {
      graphControls = leaf.view.dataEngine?.controlsEl;
      if (graphControls) {
        graphControls.classList.remove("animate", "hide");
      }
    } else if (!this.app.vault.getConfig("readableLineLength")) {
        if (leaf.view.editMode?.editorEl) {
          leaf.view.editMode.editorEl.classList.remove("is-readable-line-width");
        }
    }
    viewEl.classList.remove("animate", "noscroll");
    header.classList.remove("animate", "hide");
  }
};

var ProzenSettingTab = class extends import_obsidian.PluginSettingTab {
  constructor(app, plugin) {
    super(app, plugin);
    this.plugin = plugin;
  }
  display() {
    const { containerEl } = this;
    containerEl.empty();
    this.containerEl.createEl("h3", {
      text: "镜头模糊"
    });
    let vignetteOpacityNumber;
    new import_obsidian.Setting(containerEl).setName("不透明度").setDesc("暗角效果的昏暗程度。设置为0可关闭暗角效果。").addSlider((slider) => slider.setLimits(0, 1, 0.01).setValue(this.plugin.settings.vignetteOpacity).onChange(async (value) => {
      vignetteOpacityNumber.innerText = " " + value.toString();
      this.plugin.settings.vignetteOpacity = value;
      await this.plugin.saveSettings();
    })).settingEl.createDiv("", (el) => {
      vignetteOpacityNumber = el;
      el.style.minWidth = "2.0em";
      el.style.textAlign = "right";
      el.innerText = " " + this.plugin.settings.vignetteOpacity.toString();
    });
    let vignetteScaleLinearNumber;
    new import_obsidian.Setting(containerEl).setName("文本视图中的比例").setDesc("确定从屏幕两侧向屏幕中心传播的晕影的距离,以线性渐变的方式。").addSlider((slider) => slider.setLimits(5, 50, 5).setValue(this.plugin.settings.vignetteScaleLinear).onChange(async (value) => {
      vignetteScaleLinearNumber.innerText = " " + value.toString();
      this.plugin.settings.vignetteScaleLinear = value;
      await this.plugin.saveSettings();
    })).settingEl.createDiv("", (el) => {
      vignetteScaleLinearNumber = el;
      el.style.minWidth = "2.0em";
      el.style.textAlign = "right";
      el.innerText = " " + this.plugin.settings.vignetteScaleLinear.toString();
    });
    let vignetteScaleRadialNumber;
    new import_obsidian.Setting(containerEl).setName("图形视图中的比例").setDesc("确定了从屏幕边缘向屏幕中心传播晕影的距离,以径向渐变方式。").addSlider((slider) => slider.setLimits(5, 100, 5).setValue(this.plugin.settings.vignetteScaleRadial).onChange(async (value) => {
      vignetteScaleRadialNumber.innerText = " " + value.toString();
      this.plugin.settings.vignetteScaleRadial = value;
      await this.plugin.saveSettings();
    })).settingEl.createDiv("", (el) => {
      vignetteScaleRadialNumber = el;
      el.style.minWidth = "2.0em";
      el.style.textAlign = "right";
      el.innerText = " " + this.plugin.settings.vignetteScaleRadial.toString();
    });
    this.containerEl.createEl("h3", {
      text: "动画"
    });
    new import_obsidian.Setting(containerEl).setName("淡入时长").setDesc("进入禅模式时淡入动画的持续时间(以秒为单位)").addText((text) => text.setPlaceholder("1.2").setValue(String(this.plugin.settings.animationDuration)).onChange(async (value) => {
      this.plugin.settings.animationDuration = Number(value);
      await this.plugin.saveSettings();
    }));
    this.containerEl.createEl("h3", {
      text: "元素切换"
    });
    new import_obsidian.Setting(containerEl).setName("显示标题").setDesc("在禅定模式下显示标签页标题").addToggle((toggle) => toggle.setValue(this.plugin.settings.showHeader).onChange(async (value) => {
      this.plugin.settings.showHeader = value;
      await this.plugin.saveSettings();
    }));
    new import_obsidian.Setting(containerEl).setName("显示滚动条").setDesc("在禅定模式下显示滚动条。如果滚动条被隐藏,仍然可以通过鼠标滚轮、箭头键、触控板等进行滚动。").addToggle((toggle) => toggle.setValue(this.plugin.settings.showScroll).onChange(async (value) => {
      this.plugin.settings.showScroll = value;
      await this.plugin.saveSettings();
    }));
    new import_obsidian.Setting(containerEl).setName("显示图形控件").setDesc("在禅定模式下显示图形视图的控件").addToggle((toggle) => toggle.setValue(this.plugin.settings.showGraphControls).onChange(async (value) => {
      this.plugin.settings.showGraphControls = value;
      await this.plugin.saveSettings();
    }));
    this.containerEl.createEl("h3", {
      text: "其他"
    });
    new import_obsidian.Setting(containerEl).setName("强制内容居中").setDesc("在禅模式中居中文本内容,即使在常规视图中占据整个屏幕宽度(忽略在禅模式中关闭“编辑器 -> 可读行长度”)").addToggle((toggle) => toggle.setValue(this.plugin.settings.forceReadable).onChange(async (value) => {
      this.plugin.settings.forceReadable = value;
      await this.plugin.saveSettings();
    }));
  }
};


/* nosourcemap */

更健壮的代码
如果鼠标脱离了主屏 会选择就近使用过的主屏 进入禅模式
而不是吧大纲放大

/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/

var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// main.ts
var main_exports = {};
__export(main_exports, {
  default: () => Prozen
});
module.exports = __toCommonJS(main_exports);
var import_obsidian = require("obsidian");

const ZEN_MODE_STYLE_ID = "prozen-step1-style";
const ZEN_MODE_BODY_CLASS = "prozen-zen-active";
const ZEN_ACTIVE_LEAF_CLASS = "prozen-active-leaf-ontop";

const ZEN_STYLES = `
  /* 
   * This hides the far-left icon bar (Ribbon), the main status bar (bottom-right),
   * the new vault profile section (bottom-left), and the sidebar collapse icon (top-left).
  */
  body.${ZEN_MODE_BODY_CLASS} .workspace-ribbon,
  body.${ZEN_MODE_BODY_CLASS} .status-bar,
  body.${ZEN_MODE_BODY_CLASS} .workspace-sidedock-vault-profile,
  body.${ZEN_MODE_BODY_CLASS} .workspace-split.mod-left-split .clickable-icon {
    display: none !important;
  }

  /* 
  =================================================================
   功能:鼠标悬停时显示左侧边栏顶部图标
  =================================================================
  */
  body.${ZEN_MODE_BODY_CLASS} .workspace-split.mod-left-split .workspace-tab-header {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
  }
  
  body.${ZEN_MODE_BODY_CLASS} .workspace-split.mod-left-split .workspace-tab-header:hover {
    opacity: 1;
  }
  /* ================================================================= */

  /* 
  =================================================================
   功能:自定义 Quiet Outline 插件样式
  =================================================================
  */
  /* 增大字号 */
  body.${ZEN_MODE_BODY_CLASS} .quiet-outline .n-tree.ellipsis .n-tree-node .n-tree-node-content p {
    font-size: 24px !important;
  }

  /* 增加行高以匹配新字号,防止文字堆叠 */
  body.${ZEN_MODE_BODY_CLASS} .quiet-outline .n-tree-node-content {
    height: 38px !important; /* 给予足够的垂直空间 */
  }

  /* 将大纲整体左移 */
  body.${ZEN_MODE_BODY_CLASS} .quiet-outline .n-tree {
    margin-left: +20px;
  }

  /* 【新】默认隐藏层级滑块 */
  body.${ZEN_MODE_BODY_CLASS} .quiet-outline .n-slider {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
  }

  /* 【新】当鼠标悬停在整个大纲区域时,显示滑块 */
  body.${ZEN_MODE_BODY_CLASS} .quiet-outline:hover .n-slider {
    opacity: 1;
  }
  /* ================================================================= */

  /* 
  =================================================================
   功能:将侧边栏置于光晕效果顶层,防止文字被遮挡
  =================================================================
  */
  body.${ZEN_MODE_BODY_CLASS} .workspace-split.mod-left-split {
    position: relative; /* 建立新的堆叠环境 */
    z-index: calc(var(--layer-modal) + 1); /* 将层级提升到光晕(modal)之上 */
  }
  /* ================================================================= */


  /* --- The rest of the logic for layout and halo remains the same --- */

  /* Hide the entire central pane container */
  body.${ZEN_MODE_BODY_CLASS} .mod-root-split > .workspace-split:not(.mod-left-split) {
    visibility: hidden;
  }

  /* The layout logic for the active pane */
  body.${ZEN_MODE_BODY_CLASS} .workspace-leaf.${ZEN_ACTIVE_LEAF_CLASS} {
    visibility: visible;
    position: fixed !important;
    top: 0;
    left: var(--prozen-left-sidebar-width, 0px);
    width: calc(100% - var(--prozen-left-sidebar-width, 0px));
    height: 100vh;
    z-index: var(--layer-sidedock); 
  }

  /* The single, seamless halo overlay */
  body.${ZEN_MODE_BODY_CLASS}::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: var(--layer-modal);
    pointer-events: none;
    background-image: linear-gradient(
      90deg, 
      rgba(0,0,0,var(--vignette-opacity)) 0%, 
      transparent var(--vignette-scale-linear), 
      transparent calc(100% - var(--vignette-scale-linear)), 
      rgba(0,0,0,var(--vignette-opacity)) 100%
    );
  }
`;

var DEFAULT_SETTINGS = {
  animationDuration: 2,
  showHeader: false,
  showScroll: false,
  showGraphControls: false,
  forceReadable: true,
  vignetteOpacity: 0.75,
  vignetteScaleLinear: 20,
  vignetteScaleRadial: 75
};

var Prozen = class extends import_obsidian.Plugin {
  styleEl = null;
  originalSidebarStyleWidth = null;

  isZenModeActive = false;
  zenModeLeaf = null;

  async onload() {
    await this.loadSettings();
    
    this.styleEl = document.createElement('style');
    this.styleEl.id = ZEN_MODE_STYLE_ID;
    this.styleEl.innerHTML = ZEN_STYLES;
    document.head.appendChild(this.styleEl);

    this.addCommand({
      id: "zenmode",
      name: "终极专注模式 (全屏, 保留侧边栏, 聚焦单屏)",
      callback: this.fullscreenMode.bind(this)
    });
    this.addSettingTab(new ProzenSettingTab(this.app, this));
  }

  onunload() {
    if (document.fullscreenElement) {
      document.exitFullscreen();
    }
    this.cleanupZenMode(); 
    const existingStyle = document.getElementById(ZEN_MODE_STYLE_ID);
    if (existingStyle) {
      existingStyle.remove();
    }
  }

  async loadSettings() {
    this.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData());
  }

  async saveSettings() {
    await this.saveData(this.settings);
  }

  fullscreenMode() {
    if (this.isZenModeActive) {
      if (document.fullscreenElement) {
        document.exitFullscreen();
      } else {
        this.cleanupZenMode();
      }
      return;
    }

    // --- 【最终健壮性优化 v2】: 严格检查窗口是否在主工作区 ---
    let targetLeaf = null;

    // 1. 优先选择当前激活的、且在主工作区的窗口 (rootSplit)。
    const activeLeaf = this.app.workspace.getActiveViewOfType(import_obsidian.ItemView)?.leaf;
    if (activeLeaf && activeLeaf.getRoot() === this.app.workspace.rootSplit) {
        targetLeaf = activeLeaf;
    }

    // 2. 如果没有(例如焦点在侧边栏),则查找最近使用的窗口,但必须验证它也在主工作区。
    if (!targetLeaf) {
        const mostRecentLeaf = this.app.workspace.getMostRecentLeaf();
        if (mostRecentLeaf && mostRecentLeaf.getRoot() === this.app.workspace.rootSplit) {
            targetLeaf = mostRecentLeaf;
        }
    }

    // 3. 作为最终备选,如果以上都失败,则主动在主工作区寻找任何一个笔记窗口。
    if (!targetLeaf) {
        const leavesInMain = this.app.workspace.getLeavesOfType("markdown").filter(l => l.getRoot() === this.app.workspace.rootSplit);
        if (leavesInMain.length > 0) {
            targetLeaf = leavesInMain[0]; // 使用找到的第一个
        }
    }
    // --- 优化结束 ---

    if (!targetLeaf) {
      new import_obsidian.Notice("无法在主工作区找到可进入专注模式的窗口。");
      return;
    }

    this.zenModeLeaf = targetLeaf;
    this.isZenModeActive = true;

    document.body.requestFullscreen();

    const root = document.documentElement;
    root.style.setProperty("--vignette-opacity", this.settings.vignetteOpacity);
    root.style.setProperty("--vignette-scale-linear", this.settings.vignetteScaleLinear + "%");
    
    const leftSidebar = document.querySelector('.workspace-split.mod-left-split');
    
    let effectiveSidebarWidth = 0;

    if (leftSidebar && !leftSidebar.classList.contains('is-collapsed')) {
      this.originalSidebarStyleWidth = leftSidebar.style.width || "";

      const originalSidebarWidth = leftSidebar.offsetWidth;
      const newSidebarWidth = originalSidebarWidth + 100;

      leftSidebar.style.width = `${newSidebarWidth}px`;
      effectiveSidebarWidth = newSidebarWidth;
    }
    
    document.body.style.setProperty('--prozen-left-sidebar-width', `${effectiveSidebarWidth}px`);

    document.body.classList.add(ZEN_MODE_BODY_CLASS);
    this.zenModeLeaf.containerEl.classList.add(ZEN_ACTIVE_LEAF_CLASS);

    this.addStyles(this.zenModeLeaf);
    
    document.onfullscreenchange = () => {
      if (!document.fullscreenElement) {
        this.cleanupZenMode();
      }
    };
  }
  
  cleanupZenMode() {
    if (!this.isZenModeActive) {
      return;
    }
    
    const leaf = this.zenModeLeaf;

    document.body.classList.remove(ZEN_MODE_BODY_CLASS);
    document.body.style.removeProperty('--prozen-left-sidebar-width');
    
    const leftSidebar = document.querySelector('.workspace-split.mod-left-split');
    if (leftSidebar && this.originalSidebarStyleWidth !== null) {
      leftSidebar.style.width = this.originalSidebarStyleWidth;
      this.originalSidebarStyleWidth = null; 
    }

    const activeZenLeaf = document.querySelector(`.${ZEN_ACTIVE_LEAF_CLASS}`);
    if (activeZenLeaf) activeZenLeaf.classList.remove(ZEN_ACTIVE_LEAF_CLASS);

    if (leaf) {
        this.removeStyles(leaf);
    }
    
    this.isZenModeActive = false;
    this.zenModeLeaf = null;
    document.onfullscreenchange = null;
  }

  addStyles(leaf) {
    const viewEl = leaf.view.contentEl;
    const header = leaf.view.headerEl;
    const isGraph = leaf.view.getViewType() === "graph";
    let graphControls;
    if (isGraph) {
      graphControls = leaf.view.dataEngine?.controlsEl;
    }
    if (!this.settings.showScroll) {
      viewEl.classList.add("noscroll");
    }
    if (isGraph && !this.settings.showGraphControls && graphControls) {
      graphControls.classList.add("hide");
    }
    if (!isGraph && this.settings.forceReadable) {
      if (leaf.view.editMode?.editorEl) {
        leaf.view.editMode.editorEl.classList.add("is-readable-line-width");
      }
    }
    const root = document.documentElement;
    root.style.setProperty("--fadeIn-duration", this.settings.animationDuration + "s");
    viewEl.classList.add("animate"); 
    this.settings.showHeader ? header.classList.add("animate") : header.classList.add("hide");
  }

  removeStyles(leaf) {
    const viewEl = leaf.view.contentEl;
    const header = leaf.view.headerEl;
    const isGraph = leaf.view.getViewType() === "graph";
    let graphControls;
    if (isGraph) {
      graphControls = leaf.view.dataEngine?.controlsEl;
      if (graphControls) {
        graphControls.classList.remove("animate", "hide");
      }
    } else if (!this.app.vault.getConfig("readableLineLength")) {
        if (leaf.view.editMode?.editorEl) {
          leaf.view.editMode.editorEl.classList.remove("is-readable-line-width");
        }
    }
    viewEl.classList.remove("animate", "noscroll");
    header.classList.remove("animate", "hide");
  }
};

var ProzenSettingTab = class extends import_obsidian.PluginSettingTab {
  constructor(app, plugin) {
    super(app, plugin);
    this.plugin = plugin;
  }
  display() {
    const { containerEl } = this;
    containerEl.empty();
    this.containerEl.createEl("h3", {
      text: "镜头模糊"
    });
    let vignetteOpacityNumber;
    new import_obsidian.Setting(containerEl).setName("不透明度").setDesc("暗角效果的昏暗程度。设置为0可关闭暗角效果。").addSlider((slider) => slider.setLimits(0, 1, 0.01).setValue(this.plugin.settings.vignetteOpacity).onChange(async (value) => {
      vignetteOpacityNumber.innerText = " " + value.toString();
      this.plugin.settings.vignetteOpacity = value;
      await this.plugin.saveSettings();
    })).settingEl.createDiv("", (el) => {
      vignetteOpacityNumber = el;
      el.style.minWidth = "2.0em";
      el.style.textAlign = "right";
      el.innerText = " " + this.plugin.settings.vignetteOpacity.toString();
    });
    let vignetteScaleLinearNumber;
    new import_obsidian.Setting(containerEl).setName("文本视图中的比例").setDesc("确定从屏幕两侧向屏幕中心传播的晕影的距离,以线性渐变的方式。").addSlider((slider) => slider.setLimits(5, 50, 5).setValue(this.plugin.settings.vignetteScaleLinear).onChange(async (value) => {
      vignetteScaleLinearNumber.innerText = " " + value.toString();
      this.plugin.settings.vignetteScaleLinear = value;
      await this.plugin.saveSettings();
    })).settingEl.createDiv("", (el) => {
      vignetteScaleLinearNumber = el;
      el.style.minWidth = "2.0em";
      el.style.textAlign = "right";
      el.innerText = " " + this.plugin.settings.vignetteScaleLinear.toString();
    });
    let vignetteScaleRadialNumber;
    new import_obsidian.Setting(containerEl).setName("图形视图中的比例").setDesc("确定了从屏幕边缘向屏幕中心传播晕影的距离,以径向渐变方式。").addSlider((slider) => slider.setLimits(5, 100, 5).setValue(this.plugin.settings.vignetteScaleRadial).onChange(async (value) => {
      vignetteScaleRadialNumber.innerText = " " + value.toString();
      this.plugin.settings.vignetteScaleRadial = value;
      await this.plugin.saveSettings();
    })).settingEl.createDiv("", (el) => {
      vignetteScaleRadialNumber = el;
      el.style.minWidth = "2.0em";
      el.style.textAlign = "right";
      el.innerText = " " + this.plugin.settings.vignetteScaleRadial.toString();
    });
    this.containerEl.createEl("h3", {
      text: "动画"
    });
    new import_obsidian.Setting(containerEl).setName("淡入时长").setDesc("进入禅模式时淡入动画的持续时间(以秒为单位)").addText((text) => text.setPlaceholder("1.2").setValue(String(this.plugin.settings.animationDuration)).onChange(async (value) => {
      this.plugin.settings.animationDuration = Number(value);
      await this.plugin.saveSettings();
    }));
    this.containerEl.createEl("h3", {
      text: "元素切换"
    });
    new import_obsidian.Setting(containerEl).setName("显示标题").setDesc("在禅定模式下显示标签页标题").addToggle((toggle) => toggle.setValue(this.plugin.settings.showHeader).onChange(async (value) => {
      this.plugin.settings.showHeader = value;
      await this.plugin.saveSettings();
    }));
    new import_obsidian.Setting(containerEl).setName("显示滚动条").setDesc("在禅定模式下显示滚动条。如果滚动条被隐藏,仍然可以通过鼠标滚轮、箭头键、触控板等进行滚动。").addToggle((toggle) => toggle.setValue(this.plugin.settings.showScroll).onChange(async (value) => {
      this.plugin.settings.showScroll = value;
      await this.plugin.saveSettings();
    }));
    new import_obsidian.Setting(containerEl).setName("显示图形控件").setDesc("在禅定模式下显示图形视图的控件").addToggle((toggle) => toggle.setValue(this.plugin.settings.showGraphControls).onChange(async (value) => {
      this.plugin.settings.showGraphControls = value;
      await this.plugin.saveSettings();
    }));
    this.containerEl.createEl("h3", {
      text: "其他"
    });
    new import_obsidian.Setting(containerEl).setName("强制内容居中").setDesc("在禅模式中居中文本内容,即使在常规视图中占据整个屏幕宽度(忽略在禅模式中关闭“编辑器 -> 可读行长度”)").addToggle((toggle) => toggle.setValue(this.plugin.settings.forceReadable).onChange(async (value) => {
      this.plugin.settings.forceReadable = value;
      await this.plugin.saveSettings();
    }));
  }
};


/* nosourcemap */

再次修改 添加了文件目录 字体放大

/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/

var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// main.ts
var main_exports = {};
__export(main_exports, {
  default: () => Prozen
});
module.exports = __toCommonJS(main_exports);
var import_obsidian = require("obsidian");

const ZEN_MODE_STYLE_ID = "prozen-step1-style";
const ZEN_MODE_BODY_CLASS = "prozen-zen-active";
const ZEN_ACTIVE_LEAF_CLASS = "prozen-active-leaf-ontop";

const ZEN_STYLES = `
  /* 
   * This hides the far-left icon bar (Ribbon), the main status bar (bottom-right),
   * the new vault profile section (bottom-left), and the sidebar collapse icon (top-left).
  */
  body.${ZEN_MODE_BODY_CLASS} .workspace-ribbon,
  body.${ZEN_MODE_BODY_CLASS} .status-bar,
  body.${ZEN_MODE_BODY_CLASS} .workspace-sidedock-vault-profile,
  body.${ZEN_MODE_BODY_CLASS} .workspace-split.mod-left-split .clickable-icon {
    display: none !important;
  }

  /* 
  =================================================================
   功能:鼠标悬停时显示左侧边栏顶部图标
  =================================================================
  */
  body.${ZEN_MODE_BODY_CLASS} .workspace-split.mod-left-split .workspace-tab-header {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
  }
  
  body.${ZEN_MODE_BODY_CLASS} .workspace-split.mod-left-split .workspace-tab-header:hover {
    opacity: 1;
  }
  /* ================================================================= */

  /* 
  =================================================================
   功能:自定义 Quiet Outline 插件样式
  =================================================================
  */
  /* 增大字号 */
  body.${ZEN_MODE_BODY_CLASS} .quiet-outline .n-tree.ellipsis .n-tree-node .n-tree-node-content p {
    font-size: 24px !important;
  }

  /* 增加行高以匹配新字号,防止文字堆叠 */
  body.${ZEN_MODE_BODY_CLASS} .quiet-outline .n-tree-node-content {
    height: 38px !important; /* 给予足够的垂直空间 */
  }

  /* 将大纲整体左移 */
  body.${ZEN_MODE_BODY_CLASS} .quiet-outline .n-tree {
    margin-left: +20px;
  }

  /* 【新】默认隐藏层级滑块 */
  body.${ZEN_MODE_BODY_CLASS} .quiet-outline .n-slider {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
  }

  /* 【新】当鼠标悬停在整个大纲区域时,显示滑块 */
  body.${ZEN_MODE_BODY_CLASS} .quiet-outline:hover .n-slider {
    opacity: 1;
  }
  /* ================================================================= */

  /* 
  =================================================================
   【新增】功能:自定义文件浏览器样式 (File Explorer)
  =================================================================
  */
  /* 增大字号 */
  body.${ZEN_MODE_BODY_CLASS} .nav-file-title-content,
  body.${ZEN_MODE_BODY_CLASS} .nav-folder-title-content {
    font-size: 24px !important;
  }

  /* 增加行高以匹配新字号,防止文字堆叠 */
  body.${ZEN_MODE_BODY_CLASS} .nav-file-title,
  body.${ZEN_MODE_BODY_CLASS} .nav-folder-title {
    height: 38px !important; /* 给予足够的垂直空间 */
  }
  /* ================================================================= */

  /* 
  =================================================================
   功能:将侧边栏置于光晕效果顶层,防止文字被遮挡
  =================================================================
  */
  body.${ZEN_MODE_BODY_CLASS} .workspace-split.mod-left-split {
    position: relative; /* 建立新的堆叠环境 */
    z-index: calc(var(--layer-modal) + 1); /* 将层级提升到光晕(modal)之上 */
  }
  /* ================================================================= */


  /* --- The rest of the logic for layout and halo remains the same --- */

  /* Hide the entire central pane container */
  body.${ZEN_MODE_BODY_CLASS} .mod-root-split > .workspace-split:not(.mod-left-split) {
    visibility: hidden;
  }

  /* The layout logic for the active pane */
  body.${ZEN_MODE_BODY_CLASS} .workspace-leaf.${ZEN_ACTIVE_LEAF_CLASS} {
    visibility: visible;
    position: fixed !important;
    top: 0;
    left: var(--prozen-left-sidebar-width, 0px);
    width: calc(100% - var(--prozen-left-sidebar-width, 0px));
    height: 100vh;
    z-index: var(--layer-sidedock); 
  }

  /* The single, seamless halo overlay */
  body.${ZEN_MODE_BODY_CLASS}::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: var(--layer-modal);
    pointer-events: none;
    background-image: linear-gradient(
      90deg, 
      rgba(0,0,0,var(--vignette-opacity)) 0%, 
      transparent var(--vignette-scale-linear), 
      transparent calc(100% - var(--vignette-scale-linear)), 
      rgba(0,0,0,var(--vignette-opacity)) 100%
    );
  }
`;

var DEFAULT_SETTINGS = {
  animationDuration: 2,
  showHeader: false,
  showScroll: false,
  showGraphControls: false,
  forceReadable: true,
  vignetteOpacity: 0.75,
  vignetteScaleLinear: 20,
  vignetteScaleRadial: 75
};

var Prozen = class extends import_obsidian.Plugin {
  styleEl = null;
  originalSidebarStyleWidth = null;

  isZenModeActive = false;
  zenModeLeaf = null;

  async onload() {
    await this.loadSettings();
    
    this.styleEl = document.createElement('style');
    this.styleEl.id = ZEN_MODE_STYLE_ID;
    this.styleEl.innerHTML = ZEN_STYLES;
    document.head.appendChild(this.styleEl);

    this.addCommand({
      id: "zenmode",
      name: "终极专注模式 (全屏, 保留侧边栏, 聚焦单屏)",
      callback: this.fullscreenMode.bind(this)
    });
    this.addSettingTab(new ProzenSettingTab(this.app, this));
  }

  onunload() {
    if (document.fullscreenElement) {
      document.exitFullscreen();
    }
    this.cleanupZenMode(); 
    const existingStyle = document.getElementById(ZEN_MODE_STYLE_ID);
    if (existingStyle) {
      existingStyle.remove();
    }
  }

  async loadSettings() {
    this.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData());
  }

  async saveSettings() {
    await this.saveData(this.settings);
  }

  fullscreenMode() {
    if (this.isZenModeActive) {
      if (document.fullscreenElement) {
        document.exitFullscreen();
      } else {
        this.cleanupZenMode();
      }
      return;
    }

    // --- 【最终健壮性优化 v2】: 严格检查窗口是否在主工作区 ---
    let targetLeaf = null;

    // 1. 优先选择当前激活的、且在主工作区的窗口 (rootSplit)。
    const activeLeaf = this.app.workspace.getActiveViewOfType(import_obsidian.ItemView)?.leaf;
    if (activeLeaf && activeLeaf.getRoot() === this.app.workspace.rootSplit) {
        targetLeaf = activeLeaf;
    }

    // 2. 如果没有(例如焦点在侧边栏),则查找最近使用的窗口,但必须验证它也在主工作区。
    if (!targetLeaf) {
        const mostRecentLeaf = this.app.workspace.getMostRecentLeaf();
        if (mostRecentLeaf && mostRecentLeaf.getRoot() === this.app.workspace.rootSplit) {
            targetLeaf = mostRecentLeaf;
        }
    }

    // 3. 作为最终备选,如果以上都失败,则主动在主工作区寻找任何一个笔记窗口。
    if (!targetLeaf) {
        const leavesInMain = this.app.workspace.getLeavesOfType("markdown").filter(l => l.getRoot() === this.app.workspace.rootSplit);
        if (leavesInMain.length > 0) {
            targetLeaf = leavesInMain[0]; // 使用找到的第一个
        }
    }
    // --- 优化结束 ---

    if (!targetLeaf) {
      new import_obsidian.Notice("无法在主工作区找到可进入专注模式的窗口。");
      return;
    }

    this.zenModeLeaf = targetLeaf;
    this.isZenModeActive = true;

    document.body.requestFullscreen();

    const root = document.documentElement;
    root.style.setProperty("--vignette-opacity", this.settings.vignetteOpacity);
    root.style.setProperty("--vignette-scale-linear", this.settings.vignetteScaleLinear + "%");
    
    const leftSidebar = document.querySelector('.workspace-split.mod-left-split');
    
    let effectiveSidebarWidth = 0;

    if (leftSidebar && !leftSidebar.classList.contains('is-collapsed')) {
      this.originalSidebarStyleWidth = leftSidebar.style.width || "";

      const originalSidebarWidth = leftSidebar.offsetWidth;
      const newSidebarWidth = originalSidebarWidth + 100;

      leftSidebar.style.width = `${newSidebarWidth}px`;
      effectiveSidebarWidth = newSidebarWidth;
    }
    
    document.body.style.setProperty('--prozen-left-sidebar-width', `${effectiveSidebarWidth}px`);

    document.body.classList.add(ZEN_MODE_BODY_CLASS);
    this.zenModeLeaf.containerEl.classList.add(ZEN_ACTIVE_LEAF_CLASS);

    this.addStyles(this.zenModeLeaf);
    
    document.onfullscreenchange = () => {
      if (!document.fullscreenElement) {
        this.cleanupZenMode();
      }
    };
  }
  
  cleanupZenMode() {
    if (!this.isZenModeActive) {
      return;
    }
    
    const leaf = this.zenModeLeaf;

    document.body.classList.remove(ZEN_MODE_BODY_CLASS);
    document.body.style.removeProperty('--prozen-left-sidebar-width');
    
    const leftSidebar = document.querySelector('.workspace-split.mod-left-split');
    if (leftSidebar && this.originalSidebarStyleWidth !== null) {
      leftSidebar.style.width = this.originalSidebarStyleWidth;
      this.originalSidebarStyleWidth = null; 
    }

    const activeZenLeaf = document.querySelector(`.${ZEN_ACTIVE_LEAF_CLASS}`);
    if (activeZenLeaf) activeZenLeaf.classList.remove(ZEN_ACTIVE_LEAF_CLASS);

    if (leaf) {
        this.removeStyles(leaf);
    }
    
    this.isZenModeActive = false;
    this.zenModeLeaf = null;
    document.onfullscreenchange = null;
  }

  addStyles(leaf) {
    const viewEl = leaf.view.contentEl;
    const header = leaf.view.headerEl;
    const isGraph = leaf.view.getViewType() === "graph";
    let graphControls;
    if (isGraph) {
      graphControls = leaf.view.dataEngine?.controlsEl;
    }
    if (!this.settings.showScroll) {
      viewEl.classList.add("noscroll");
    }
    if (isGraph && !this.settings.showGraphControls && graphControls) {
      graphControls.classList.add("hide");
    }
    if (!isGraph && this.settings.forceReadable) {
      if (leaf.view.editMode?.editorEl) {
        leaf.view.editMode.editorEl.classList.add("is-readable-line-width");
      }
    }
    const root = document.documentElement;
    root.style.setProperty("--fadeIn-duration", this.settings.animationDuration + "s");
    viewEl.classList.add("animate"); 
    this.settings.showHeader ? header.classList.add("animate") : header.classList.add("hide");
  }

  removeStyles(leaf) {
    const viewEl = leaf.view.contentEl;
    const header = leaf.view.headerEl;
    const isGraph = leaf.view.getViewType() === "graph";
    let graphControls;
    if (isGraph) {
      graphControls = leaf.view.dataEngine?.controlsEl;
      if (graphControls) {
        graphControls.classList.remove("animate", "hide");
      }
    } else if (!this.app.vault.getConfig("readableLineLength")) {
        if (leaf.view.editMode?.editorEl) {
          leaf.view.editMode.editorEl.classList.remove("is-readable-line-width");
        }
    }
    viewEl.classList.remove("animate", "noscroll");
    header.classList.remove("animate", "hide");
  }
};

var ProzenSettingTab = class extends import_obsidian.PluginSettingTab {
  constructor(app, plugin) {
    super(app, plugin);
    this.plugin = plugin;
  }
  display() {
    const { containerEl } = this;
    containerEl.empty();
    this.containerEl.createEl("h3", {
      text: "镜头模糊"
    });
    let vignetteOpacityNumber;
    new import_obsidian.Setting(containerEl).setName("不透明度").setDesc("暗角效果的昏暗程度。设置为0可关闭暗角效果。").addSlider((slider) => slider.setLimits(0, 1, 0.01).setValue(this.plugin.settings.vignetteOpacity).onChange(async (value) => {
      vignetteOpacityNumber.innerText = " " + value.toString();
      this.plugin.settings.vignetteOpacity = value;
      await this.plugin.saveSettings();
    })).settingEl.createDiv("", (el) => {
      vignetteOpacityNumber = el;
      el.style.minWidth = "2.0em";
      el.style.textAlign = "right";
      el.innerText = " " + this.plugin.settings.vignetteOpacity.toString();
    });
    let vignetteScaleLinearNumber;
    new import_obsidian.Setting(containerEl).setName("文本视图中的比例").setDesc("确定从屏幕两侧向屏幕中心传播的晕影的距离,以线性渐变的方式。").addSlider((slider) => slider.setLimits(5, 50, 5).setValue(this.plugin.settings.vignetteScaleLinear).onChange(async (value) => {
      vignetteScaleLinearNumber.innerText = " " + value.toString();
      this.plugin.settings.vignetteScaleLinear = value;
      await this.plugin.saveSettings();
    })).settingEl.createDiv("", (el) => {
      vignetteScaleLinearNumber = el;
      el.style.minWidth = "2.0em";
      el.style.textAlign = "right";
      el.innerText = " " + this.plugin.settings.vignetteScaleLinear.toString();
    });
    let vignetteScaleRadialNumber;
    new import_obsidian.Setting(containerEl).setName("图形视图中的比例").setDesc("确定了从屏幕边缘向屏幕中心传播晕影的距离,以径向渐变方式。").addSlider((slider) => slider.setLimits(5, 100, 5).setValue(this.plugin.settings.vignetteScaleRadial).onChange(async (value) => {
      vignetteScaleRadialNumber.innerText = " " + value.toString();
      this.plugin.settings.vignetteScaleRadial = value;
      await this.plugin.saveSettings();
    })).settingEl.createDiv("", (el) => {
      vignetteScaleRadialNumber = el;
      el.style.minWidth = "2.0em";
      el.style.textAlign = "right";
      el.innerText = " " + this.plugin.settings.vignetteScaleRadial.toString();
    });
    this.containerEl.createEl("h3", {
      text: "动画"
    });
    new import_obsidian.Setting(containerEl).setName("淡入时长").setDesc("进入禅模式时淡入动画的持续时间(以秒为单位)").addText((text) => text.setPlaceholder("1.2").setValue(String(this.plugin.settings.animationDuration)).onChange(async (value) => {
      this.plugin.settings.animationDuration = Number(value);
      await this.plugin.saveSettings();
    }));
    this.containerEl.createEl("h3", {
      text: "元素切换"
    });
    new import_obsidian.Setting(containerEl).setName("显示标题").setDesc("在禅定模式下显示标签页标题").addToggle((toggle) => toggle.setValue(this.plugin.settings.showHeader).onChange(async (value) => {
      this.plugin.settings.showHeader = value;
      await this.plugin.saveSettings();
    }));
    new import_obsidian.Setting(containerEl).setName("显示滚动条").setDesc("在禅定模式下显示滚动条。如果滚动条被隐藏,仍然可以通过鼠标滚轮、箭头键、触控板等进行滚动。").addToggle((toggle) => toggle.setValue(this.plugin.settings.showScroll).onChange(async (value) => {
      this.plugin.settings.showScroll = value;
      await this.plugin.saveSettings();
    }));
    new import_obsidian.Setting(containerEl).setName("显示图形控件").setDesc("在禅定模式下显示图形视图的控件").addToggle((toggle) => toggle.setValue(this.plugin.settings.showGraphControls).onChange(async (value) => {
      this.plugin.settings.showGraphControls = value;
      await this.plugin.saveSettings();
    }));
    this.containerEl.createEl("h3", {
      text: "其他"
    });
    new import_obsidian.Setting(containerEl).setName("强制内容居中").setDesc("在禅模式中居中文本内容,即使在常规视图中占据整个屏幕宽度(忽略在禅模式中关闭“编辑器 -> 可读行长度”)").addToggle((toggle) => toggle.setValue(this.plugin.settings.forceReadable).onChange(async (value) => {
      this.plugin.settings.forceReadable = value;
      await this.plugin.saveSettings();
    }));
  }
};


/* nosourcemap */

非禅模式下 大光圈 遮罩

/*
=================================================================
  Obsidian 全局样式整合版 - 釜底抽薪终极方案
  - 放弃全局覆盖层,将光晕作为底层背景,从根本上避免层级冲突。
=================================================================
*/

/* 1. 自定义暗黑主题颜色 (可选,保持不变) */
.theme-dark {
  --color-d-gray-100: #1E1E1E;
  --background-primary: var(--color-d-gray-100);
}

/*
 * 2. 【核心】将光晕效果作为应用最底层背景
*/
body {
  /* 定义光晕参数 */
  --v-opacity: 0.75;
  --v-scale-linear: 20%;

  /* 利用多重背景实现:底层是光晕,上层是原来的背景色 */
  background-image:
    /* 上层:光晕渐变 */
    linear-gradient(
      90deg,
      rgba(0,0,0,var(--v-opacity)) 0%,
      transparent var(--v-scale-linear),
      transparent calc(100% - var(--v-scale-linear)),
      rgba(0,0,0,var(--v-opacity)) 100%
    ),
    /* 底层:原来的背景色 (如果需要的话) */
    none;

  /* 确保背景填满窗口且不重复 */
  background-attachment: fixed;
  background-size: cover;
}

/*
 * 3. 【关键】将上层所有UI组件的背景色去除,使其“透明化”
 *   从而能够透出我们在 body 上绘制的光晕背景。
*/
.workspace-split.mod-root,
.workspace-ribbon,
.status-bar,
.titlebar {
  /*
   * 这是本方案唯一需要做的重要事情。
   * 我们没有改变任何 z-index,所以不会有任何遮挡问题。
  */
  background: transparent !important;
}

.workspace-ribbon .sidebar-toggle-button {
background-color: #0A0A0A;
}


body:not(.is-mobile) .workspace-split.mod-left-split .workspace-sidedock-vault-profile {
  background-color: #0A0A0A;
  background-image: linear-gradient(
    to right,        /* 方向:从左到右 */
    #0E0E0E,
    #1E1E1E
  );}


.mod-linux .titlebar-button, .mod-windows .titlebar-button {
  background-color: #0A0A0A;

}







.n-slider .n-slider-dots .n-slider-dot {
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 0.3s ease, visibility 0.3s ease !important;
}

.n-slider .n-slider-rail .n-slider-rail__fill {
    display: none !important;
}

/* 隐藏轨道线但保留元素 */
.n-slider .n-slider-rail {
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
}

/* 默认隐藏滑块手柄 */
.n-slider .n-slider-handles .n-slider-handle {
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 0.3s ease, visibility 0.3s ease !important;
    background-color: #404040;
    box-shadow: var(--n-handle-box-shadow);
}

/* 鼠标悬停时显示滑块手柄 */
.n-slider:hover .n-slider-handles .n-slider-handle {
    opacity: 1 !important;
    visibility: visible !important;
}