diff --git a/.gitignore b/.gitignore index b85bd162..ddc722a1 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,9 @@ jsconfig.json public/ resources/ +# packages +dist/ + # NPM node_modules/ .eslintcache diff --git a/README.md b/README.md index 3c667850..f5aa8429 100644 --- a/README.md +++ b/README.md @@ -303,9 +303,7 @@ Thanks to the [Hugo DoIt](https://github.com/HEIGE-PCloud/DoIt) theme and [Hexo - [Twikoo](https://twikoo.js.org/) - [github-corners](https://github.com/tholman/github-corners) - [giscus](https://giscus.app/zh-CN) -- [crypto-js](https://github.com/brix/crypto-js) - [pace](https://github.com/CodeByZach/pace) -- [xxhash-wasm](https://github.com/jungomi/xxhash-wasm) - [`` element](https://github.com/github/tab-container-element) - [`` element](https://github.com/Lruihao/json-viewer-element) diff --git a/README.zh-cn.md b/README.zh-cn.md index b78e5b42..a6cd6dcc 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -303,9 +303,7 @@ FixIt 主题多语言基本配置及自动翻译等详见 [内容管理](https:/ - [Twikoo](https://twikoo.js.org/) - [github-corners](https://github.com/tholman/github-corners) - [giscus](https://giscus.app/zh-CN) -- [crypto-js](https://github.com/brix/crypto-js) - [pace](https://github.com/CodeByZach/pace) -- [xxhash-wasm](https://github.com/jungomi/xxhash-wasm) - [`` element](https://github.com/github/tab-container-element) - [`` element](https://github.com/Lruihao/json-viewer-element) diff --git a/assets/css/unocss.css b/assets/css/unocss.css index 607156be..6e1108da 100644 --- a/assets/css/unocss.css +++ b/assets/css/unocss.css @@ -12,6 +12,7 @@ /* layer: shortcuts */ .z-fixed{z-index:200;} /* layer: default */ +.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0;} .visible{visibility:visible;} .absolute{position:absolute;} .fixed{position:fixed;} @@ -33,6 +34,7 @@ .my-4{margin-top:1rem;margin-bottom:1rem;} .me{margin-inline-end:1rem;} .me-1{margin-inline-end:0.25rem;} +.me-1\.5{margin-inline-end:0.375rem;} .me-2{margin-inline-end:0.5rem;} .ms-1{margin-inline-start:0.25rem;} .inline{display:inline;} @@ -94,6 +96,7 @@ } @media (max-width: 679.9px){ .max-sm\:hidden{display:none;} +.max-sm\:w-full{width:100%;} } @media (min-width: 680px){ .sm\:hidden{display:none;} diff --git a/assets/data/cdn/jsdelivr.yml b/assets/data/cdn/jsdelivr.yml index 2b593922..d4747fee 100644 --- a/assets/data/cdn/jsdelivr.yml +++ b/assets/data/cdn/jsdelivr.yml @@ -25,10 +25,6 @@ libFiles: # cookieconsent@3.1.1 https://github.com/osano/cookieconsent cookieconsentCSS: cookieconsent@3.1.1/build/cookieconsent.min.css cookieconsentJS: cookieconsent@3.1.1/build/cookieconsent.min.js - # crypto-js@4.2.0 https://github.com/brix/crypto-js - cryptoCoreJS: crypto-js@4.2.0/core.js - cryptoEncBase64JS: crypto-js@4.2.0/enc-base64.js - cryptoSha256JS: crypto-js@4.2.0/sha256.js # echarts@6.1.0 https://github.com/apache/echarts echartsJS: echarts@6.1.0/dist/echarts.min.js # @fortawesome/fontawesome-free@7.3.0 https://github.com/FortAwesome/Font-Awesome @@ -76,5 +72,3 @@ libFiles: # @waline/client@3.15.2 https://github.com/walinejs/waline walineCSS: '@waline/client@3.15.2/dist/waline.css' walineJS: '@waline/client@3.15.2/dist/waline.umd.js' - # xxhash-wasm@1.1.0 https://github.com/jungomi/xxhash-wasm - xxhashWasmJS: xxhash-wasm@1.1.0/umd/xxhash-wasm.js diff --git a/assets/data/cdn/unpkg.yml b/assets/data/cdn/unpkg.yml index 1f2b6e2d..48f1c6af 100644 --- a/assets/data/cdn/unpkg.yml +++ b/assets/data/cdn/unpkg.yml @@ -25,10 +25,6 @@ libFiles: # cookieconsent@3.1.1 https://github.com/osano/cookieconsent cookieconsentCSS: cookieconsent@3.1.1/build/cookieconsent.min.css cookieconsentJS: cookieconsent@3.1.1/build/cookieconsent.min.js - # crypto-js@4.2.0 https://github.com/brix/crypto-js - cryptoCoreJS: crypto-js@4.2.0/core.js - cryptoEncBase64JS: crypto-js@4.2.0/enc-base64.js - cryptoSha256JS: crypto-js@4.2.0/sha256.js # echarts@6.1.0 https://github.com/apache/echarts echartsJS: echarts@6.1.0/dist/echarts.min.js # @fortawesome/fontawesome-free@7.3.0 https://github.com/FortAwesome/Font-Awesome @@ -76,5 +72,3 @@ libFiles: # @waline/client@3.15.2 https://github.com/walinejs/waline walineCSS: '@waline/client@3.15.2/dist/waline.css' walineJS: '@waline/client@3.15.2/dist/waline.umd.js' - # xxhash-wasm@1.1.0 https://github.com/jungomi/xxhash-wasm - xxhashWasmJS: xxhash-wasm@1.1.0/umd/xxhash-wasm.js diff --git a/assets/js/core/event-bus.ts b/assets/js/core/event-bus.ts index 5284364a..2d477ae8 100644 --- a/assets/js/core/event-bus.ts +++ b/assets/js/core/event-bus.ts @@ -3,7 +3,7 @@ export interface FixItEventMap { 'fixit:switch-theme': { isDark: boolean, mode: string, isChanged: boolean } 'fixit:scroll': void 'fixit:resize': void - 'fixit:decrypted': void + 'fixit:decrypted': { target: Element } 'fixit:partial-decrypted': { target: Element } 'fixit:re-encrypt': void 'fixit:code-tab-sync': { lang: string, source: HTMLElement } diff --git a/assets/js/core/public-api.ts b/assets/js/core/public-api.ts index 3326ce3b..9170848c 100644 --- a/assets/js/core/public-api.ts +++ b/assets/js/core/public-api.ts @@ -43,7 +43,7 @@ export class PublicAPI implements FixItPublicAPI { this.pwa = new PWAModule(this.core) this.misc = new MiscModule(this.core) this.content = new ContentModule(this.core, this.code) - this.events = new EventsModule(this.core, this.toc, this.code) + this.events = new EventsModule(this.core, this.code) } get config() { return this.core.config } diff --git a/assets/js/lib/fixit-decryptor.ts b/assets/js/lib/fixit-decryptor.ts index faebf0f4..ed206054 100644 --- a/assets/js/lib/fixit-decryptor.ts +++ b/assets/js/lib/fixit-decryptor.ts @@ -2,16 +2,21 @@ * Encrypted content decryptor for FixIt pages and shortcodes. * * Responsibilities: - * - Validate password input and decrypt Base64 payloads into target containers. + * - Validate password input and decrypt AES-256-GCM payloads into target containers. * - Support both full-page and shortcode-scoped encrypted blocks. * - Persist and validate page-level decrypt cache with expiration. * - Emit and react to FixIt events for decrypted/partial-decrypted/reset flows. + * + * Encrypted payloads are stored in `