chore(release): v0.0.5

This commit is contained in:
BCS 2026-05-13 17:17:20 +08:00
parent 4dadf5c754
commit 5ef0c88470
10 changed files with 91 additions and 36 deletions

47
.github/workflows/release.yml vendored Normal file
View file

@ -0,0 +1,47 @@
name: Release Obsidian plugin
on:
push:
tags:
- "*"
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
attestations: write
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Build plugin
run: |
npm install
npm run build
- name: Attest main.js
uses: actions/attest-build-provenance@v2
with:
subject-path: main.js
- name: Attest styles.css
uses: actions/attest-build-provenance@v2
with:
subject-path: styles.css
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: |
main.js
manifest.json
styles.css
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View file

@ -2,6 +2,18 @@
All notable changes to this project will be documented in this file.
## [0.0.5] - 2026-05-13
### Fixed
- **Submission Compliance**: Addressed multiple warnings and errors flagged by the Obsidian community review process.
- Updated `minAppVersion` to `1.7.2` to support `Workspace.revealLeaf`.
- Fixed popout window compatibility by migrating `document` to `activeDocument` and `window` to `activeWindow`.
- Improved type safety across files by removing `any` usage in `src/BookmarkPanel.ts` and `src/BrowserPanel.ts`.
- Removed "General" heading from the settings tab.
- Replaced `document.createElement('webview')` with `createEl('webview')` for proper initialization.
- Re-named the command palette entry to "Open" to prevent redundant prefixing.
- Added a GitHub Actions workflow to generate artifact attestations for `main.js` and `styles.css`.
## [0.0.4] - 2026-04-21
### Fixed

File diff suppressed because one or more lines are too long

View file

@ -1,8 +1,8 @@
{
"id": "side-bookmark",
"name": "Side Bookmark",
"version": "0.0.4",
"minAppVersion": "0.15.0",
"version": "0.0.5",
"minAppVersion": "1.7.2",
"description": "A sidebar bookmark browser. Browse websites and manage bookmarks right in the sidebar.",
"author": "bcs1037",
"isDesktopOnly": true

View file

@ -1,6 +1,6 @@
{
"name": "side-bookmark",
"version": "0.0.4",
"version": "0.0.5",
"description": "A sidebar bookmark browser plugin for Obsidian",
"main": "main.js",
"type": "module",

View file

@ -402,7 +402,7 @@ export class BookmarkPanel {
if (!e.dataTransfer) return;
try {
const data = JSON.parse(e.dataTransfer.getData('text/plain'));
const data = JSON.parse(e.dataTransfer.getData('text/plain')) as { id?: string, type?: string };
if (!data.id || !data.type) return;
// If dropping a bookmark onto a folder, move it

View file

@ -92,24 +92,24 @@ export class BrowserPanel {
/** Go back in browser history */
goBack(): void {
if (this.webviewEl) {
const wv = this.webviewEl as unknown as Record<string, unknown>;
if (typeof wv.goBack === 'function') wv.goBack();
const wv = this.webviewEl as unknown as { goBack?: () => void };
wv.goBack?.();
}
}
/** Go forward in browser history */
goForward(): void {
if (this.webviewEl) {
const wv = this.webviewEl as unknown as Record<string, unknown>;
if (typeof wv.goForward === 'function') wv.goForward();
const wv = this.webviewEl as unknown as { goForward?: () => void };
wv.goForward?.();
}
}
/** Reload the current page */
reload(): void {
if (this.webviewEl) {
const wv = this.webviewEl as unknown as Record<string, unknown>;
if (typeof wv.reload === 'function') wv.reload();
const wv = this.webviewEl as unknown as { reload?: () => void };
wv.reload?.();
}
}
@ -142,17 +142,16 @@ export class BrowserPanel {
/** Create or update the webview element */
private createOrUpdateWebview(url: string): void {
// Remove existing webview
if (this.webviewEl) {
this.webviewEl.remove();
}
this.webviewContainer.empty();
// Create a new webview element (Electron's webview tag)
const webview = document.createElement('webview');
webview.setAttribute('src', url);
webview.setAttribute('allowpopups', '');
webview.addClass('sb-webview');
const webview = this.webviewContainer.createEl('webview' as keyof HTMLElementTagNameMap, {
attr: {
src: url,
allowpopups: ''
},
cls: 'sb-webview'
});
// Listen for navigation events
webview.addEventListener('did-navigate', ((e: CustomEvent) => {
@ -180,13 +179,13 @@ export class BrowserPanel {
webview.addEventListener('dom-ready', () => {
// Update URL from webview's actual URL
const wv = webview as unknown as Record<string, unknown>;
if (typeof wv.getURL === 'function') {
this.currentUrl = wv.getURL() as string;
const wv = webview as unknown as { getURL?: () => string, getTitle?: () => string };
if (wv.getURL) {
this.currentUrl = wv.getURL();
this.urlInput.value = this.currentUrl;
}
if (typeof wv.getTitle === 'function') {
this.currentTitle = wv.getTitle() as string;
if (wv.getTitle) {
this.currentTitle = wv.getTitle();
}
});
@ -198,8 +197,6 @@ export class BrowserPanel {
}
}) as EventListener);
this.webviewContainer.empty();
this.webviewContainer.appendChild(webview);
this.webviewEl = webview;
}
}

View file

@ -32,7 +32,7 @@ export default class SideBookmarkPlugin extends Plugin {
this.addCommand({
id: 'open',
name: 'Open side bookmark',
name: 'Open',
callback: () => {
void this.activateView();
},
@ -42,20 +42,20 @@ export default class SideBookmarkPlugin extends Plugin {
this.addSettingTab(new SideBookmarkSettingTab(this.app, this));
// Register global link interception (capture phase, runs before Obsidian's handlers)
this.registerDomEvent(document, 'click', this.handleLinkClick.bind(this), true);
this.registerDomEvent(activeDocument, 'click', this.handleLinkClick.bind(this), true);
// Track modifier keys for window.open interception bypass
this.registerDomEvent(document, 'keydown', (e: KeyboardEvent) => {
this.registerDomEvent(activeDocument, 'keydown', (e: KeyboardEvent) => {
if (e.key === 'Meta' || e.key === 'Control' || e.metaKey || e.ctrlKey) {
this.modifierKeyPressed = true;
}
});
this.registerDomEvent(document, 'keyup', (e: KeyboardEvent) => {
this.registerDomEvent(activeDocument, 'keyup', (e: KeyboardEvent) => {
if (e.key === 'Meta' || e.key === 'Control' || (!e.metaKey && !e.ctrlKey)) {
this.modifierKeyPressed = false;
}
});
this.registerDomEvent(window, 'blur', () => {
this.registerDomEvent(activeWindow, 'blur', () => {
this.modifierKeyPressed = false;
});

View file

@ -18,8 +18,6 @@ export class SideBookmarkSettingTab extends PluginSettingTab {
const { containerEl } = this;
containerEl.empty();
new Setting(containerEl).setName('General').setHeading();
new Setting(containerEl)
.setName('Default homepage')
.setDesc('The URL to load when the plugin opens.')

View file

@ -2,5 +2,6 @@
"0.0.1": "0.15.0",
"0.0.2": "0.15.0",
"0.0.3": "0.15.0",
"0.0.4": "0.15.0"
"0.0.4": "0.15.0",
"0.0.5": "1.7.2"
}