dsh-jianji 1.0.21 → 1.0.22
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./index-
|
|
1
|
+
import{t as e}from"./index-CzDcNt06.js";var t=class extends e{constructor(){super(...arguments),this.pending=[],this.deliveredNotifications=[],this.hasNotificationSupport=()=>{if(!(`Notification`in window)||!Notification.requestPermission)return!1;if(Notification.permission!==`granted`)try{new Notification(``)}catch(e){if(e instanceof Error&&e.name===`TypeError`)return!1}return!0}}async getDeliveredNotifications(){let e=[];for(let t of this.deliveredNotifications){let n={title:t.title,id:parseInt(t.tag),body:t.body};e.push(n)}return{notifications:e}}async removeDeliveredNotifications(e){for(let t of e.notifications){let e=this.deliveredNotifications.find(e=>e.tag===String(t.id));e?.close(),this.deliveredNotifications=this.deliveredNotifications.filter(()=>!e)}}async removeDeliveredNotificationsById(e){for(let t of e.ids){let e=this.deliveredNotifications.find(e=>e.tag===String(t));e?.close(),this.deliveredNotifications=this.deliveredNotifications.filter(t=>t!==e)}}async removeAllDeliveredNotifications(){for(let e of this.deliveredNotifications)e.close();this.deliveredNotifications=[]}async getByIds(e){let t=e.ids.map(e=>String(e)),n=this.pending.filter(e=>t.includes(String(e.id))),r=this.deliveredNotifications.filter(e=>t.includes(e.tag)).map(e=>this.deliveredToSchema(e));return{notifications:[...n,...r]}}async getAll(e){let t=[...this.pending],n=this.deliveredNotifications.map(e=>this.deliveredToSchema(e));return e?.state===`SCHEDULED`?{notifications:t}:e?.state===`TRIGGERED`?{notifications:n}:{notifications:[...t,...n]}}deliveredToSchema(e){return{title:e.title,id:parseInt(e.tag),body:e.body}}async createChannel(){throw this.unimplemented(`Not implemented on web.`)}async deleteChannel(){throw this.unimplemented(`Not implemented on web.`)}async listChannels(){throw this.unimplemented(`Not implemented on web.`)}async schedule(e){if(!this.hasNotificationSupport())throw this.unavailable(`Notifications not supported in this browser.`);for(let t of e.notifications)this.sendNotification(t);return{notifications:e.notifications.map(e=>({id:e.id}))}}async update(e){if(!this.hasNotificationSupport())throw this.unavailable(`Notifications not supported in this browser.`);let t=[];for(let n of e.notifications){let e=this.pending.findIndex(e=>e.id===n.id);e!==-1&&(this.pending.splice(e,1),this.sendNotification(n),t.push(n))}return{notifications:t.map(e=>({id:e.id}))}}async getPending(){return{notifications:this.pending}}async cancelAll(){this.pending=[]}async registerActionTypes(){throw this.unimplemented(`Not implemented on web.`)}async cancel(e){this.pending=this.pending.filter(t=>!e.notifications.find(e=>e.id===t.id))}async areEnabled(){let{display:e}=await this.checkPermissions();return{value:e===`granted`}}async changeExactNotificationSetting(){throw this.unimplemented(`Not implemented on web.`)}async checkExactNotificationSetting(){throw this.unimplemented(`Not implemented on web.`)}async requestPermissions(){if(!this.hasNotificationSupport())throw this.unavailable(`Notifications not supported in this browser.`);return{display:this.transformNotificationPermission(await Notification.requestPermission())}}async checkPermissions(){if(!this.hasNotificationSupport())throw this.unavailable(`Notifications not supported in this browser.`);return{display:this.transformNotificationPermission(Notification.permission)}}transformNotificationPermission(e){switch(e){case`granted`:return`granted`;case`denied`:return`denied`;default:return`prompt`}}sendPending(){let e=[],t=new Date().getTime();for(let n of this.pending)n.schedule?.at&&n.schedule.at.getTime()<=t&&(this.buildNotification(n),e.push(n));this.pending=this.pending.filter(t=>!e.find(e=>e===t))}sendNotification(e){if(e.schedule?.at){let t=e.schedule.at.getTime()-new Date().getTime();this.pending.push(e),setTimeout(()=>{this.sendPending()},t)}else this.buildNotification(e)}buildNotification(e){let t=new Notification(e.title,{body:e.body,tag:String(e.id)});return t.addEventListener(`click`,this.onClick.bind(this,e),!1),t.addEventListener(`show`,this.onShow.bind(this,e),!1),t.addEventListener(`close`,()=>{this.deliveredNotifications=this.deliveredNotifications.filter(()=>!this)},!1),this.deliveredNotifications.push(t),t}onClick(e){let t={actionId:`tap`,notification:e};this.notifyListeners(`localNotificationActionPerformed`,t)}onShow(e){this.notifyListeners(`localNotificationReceived`,e)}};export{t as LocalNotificationsWeb};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./index-
|
|
1
|
+
import{t as e}from"./index-CzDcNt06.js";var t=class extends e{constructor(){super(),this.handleVisibilityChange=()=>{let e={isActive:document.hidden!==!0};this.notifyListeners(`appStateChange`,e),document.hidden?this.notifyListeners(`pause`,null):this.notifyListeners(`resume`,null)},document.addEventListener(`visibilitychange`,this.handleVisibilityChange,!1)}exitApp(){throw this.unimplemented(`Not implemented on web.`)}async getInfo(){throw this.unimplemented(`Not implemented on web.`)}async getLaunchUrl(){return{url:``}}async getState(){return{isActive:document.hidden!==!0}}async minimizeApp(){throw this.unimplemented(`Not implemented on web.`)}async toggleBackButtonHandler(){throw this.unimplemented(`Not implemented on web.`)}async getAppLanguage(){return{value:navigator.language.split(`-`)[0].toLowerCase()}}};export{t as AppWeb};
|
package/dist/index.html
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
<link rel="icon" href="./assets/icon-BGGQCemX.svg" type="image/svg+xml">
|
|
15
15
|
<link rel="apple-touch-icon" href="./assets/icon-180.png">
|
|
16
16
|
<title>简记 · 待办、记录与灵感</title>
|
|
17
|
-
<script type="module" crossorigin src="./assets/index-
|
|
17
|
+
<script type="module" crossorigin src="./assets/index-CzDcNt06.js"></script>
|
|
18
18
|
<link rel="stylesheet" crossorigin href="./assets/index-BWhLFINV.css">
|
|
19
19
|
</head>
|
|
20
20
|
<body>
|
|
@@ -607,8 +607,9 @@
|
|
|
607
607
|
<input id="branchInput" type="text" value="master" autocomplete="off">
|
|
608
608
|
</div>
|
|
609
609
|
<div class="field">
|
|
610
|
-
<label class="field-label" for="pathInput"
|
|
611
|
-
<input id="pathInput" type="text"
|
|
610
|
+
<label class="field-label" for="pathInput">数据目录</label>
|
|
611
|
+
<input id="pathInput" type="text" placeholder="留空则使用仓库根目录" autocomplete="off">
|
|
612
|
+
<span class="field-hint">自动维护 records.json、todos.json 和 inspirations.json。</span>
|
|
612
613
|
</div>
|
|
613
614
|
</div>
|
|
614
615
|
<div class="field">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-jianji",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.22",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "DeepSeek Harness 的简记插件:待办、记录、主题灵感、标签与一键派发",
|
|
6
6
|
"main": "plugin/index.js",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"start": "npm run build && node server/index.js",
|
|
49
49
|
"serve": "npm start",
|
|
50
50
|
"prepare": "git config core.hooksPath .githooks",
|
|
51
|
-
"check": "node --check src/app.js && node --check src/recognizer.js && node --check src/reminders.js && node --check src/updater.js && node --check src/widget.js && node --check server/index.js && node --check scripts/build-android.js && node --check scripts/bump-version.js && node --check scripts/commit-convention.js && node --check scripts/check-commit-message.js && node --check scripts/generate-release-notes.js",
|
|
51
|
+
"check": "node --check src/app.js && node --check src/sync-files.js && node --check src/recognizer.js && node --check src/reminders.js && node --check src/updater.js && node --check src/widget.js && node --check server/index.js && node --check scripts/build-android.js && node --check scripts/bump-version.js && node --check scripts/commit-convention.js && node --check scripts/check-commit-message.js && node --check scripts/generate-release-notes.js",
|
|
52
52
|
"check:commits": "node scripts/generate-release-notes.js --check-only",
|
|
53
53
|
"release:notes": "node scripts/generate-release-notes.js",
|
|
54
54
|
"android:sync": "npm run build && cap sync android",
|