From 2d2916975c289eca17bf4397c41a0f7e5600f36a Mon Sep 17 00:00:00 2001 From: Folyd Date: Wed, 16 Oct 2024 14:06:52 +0800 Subject: [PATCH] Release version 2.0.0 --- README-ZH.md | 2 +- README.md | 2 +- docs/content/changelog.md | 19 +++++++++++++++++++ docs/templates/index.html | 2 +- extension/content-script-bundle.js | 2 +- 5 files changed, 23 insertions(+), 4 deletions(-) diff --git a/README-ZH.md b/README-ZH.md index 6e567df..6609799 100644 --- a/README-ZH.md +++ b/README-ZH.md @@ -7,7 +7,7 @@ [![Chrome Web Store](https://img.shields.io/chrome-web-store/v/ennpfpdlaclocpomkiablnmbppdnlhoh.svg)](https://chrome.google.com/webstore/detail/rust-search-extension/ennpfpdlaclocpomkiablnmbppdnlhoh) [![Mozilla Add-on](https://img.shields.io/amo/v/rust-search-extension?color=%2320123A)](https://addons.mozilla.org/firefox/addon/rust-search-extension/) -[![Microsoft Edge](https://img.shields.io/badge/microsoft--edge-v1.13.0-1D4F8C)](https://microsoftedge.microsoft.com/addons/detail/olemfibpaicdoooacpfffccidjjagmoe) +[![Microsoft Edge](https://img.shields.io/badge/microsoft--edge-v2.0.0-1D4F8C)](https://microsoftedge.microsoft.com/addons/detail/olemfibpaicdoooacpfffccidjjagmoe) [![license-mit](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/huhu/rust-search-extension/blob/master/LICENSE-MIT) [![license-apache](https://img.shields.io/badge/license-Apache-yellow.svg)](https://github.com/huhu/rust-search-extension/blob/master/LICENSE-APACHE) [![Discord](https://img.shields.io/discord/711895914494558250?label=chat&logo=discord)](https://discord.gg/xucZNVd) diff --git a/README.md b/README.md index 79d7f51..10d9e1d 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ [![Chrome Web Store](https://img.shields.io/chrome-web-store/v/ennpfpdlaclocpomkiablnmbppdnlhoh.svg)](https://chrome.google.com/webstore/detail/rust-search-extension/ennpfpdlaclocpomkiablnmbppdnlhoh) [![Mozilla Add-on](https://img.shields.io/amo/v/rust-search-extension?color=%2320123A)](https://addons.mozilla.org/firefox/addon/rust-search-extension/) -[![Microsoft Edge](https://img.shields.io/badge/microsoft--edge-v1.13.0-1D4F8C)](https://microsoftedge.microsoft.com/addons/detail/olemfibpaicdoooacpfffccidjjagmoe) +[![Microsoft Edge](https://img.shields.io/badge/microsoft--edge-v2.0.0-1D4F8C)](https://microsoftedge.microsoft.com/addons/detail/olemfibpaicdoooacpfffccidjjagmoe) [![license-mit](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/huhu/rust-search-extension/blob/master/LICENSE-MIT) [![license-apache](https://img.shields.io/badge/license-Apache-yellow.svg)](https://github.com/huhu/rust-search-extension/blob/master/LICENSE-APACHE) [![Discord](https://img.shields.io/discord/711895914494558250?label=chat&logo=discord)](https://discord.gg/xucZNVd) diff --git a/docs/content/changelog.md b/docs/content/changelog.md index 16593e0..eabd63e 100644 --- a/docs/content/changelog.md +++ b/docs/content/changelog.md @@ -4,6 +4,25 @@ description = "Changelog" weight = 3 +++ +# v2.0.0 - 2024-10-16 + +- Integrate omnibox search into manage page +- Split IndexSetter from IndexManager +- Migrate Firefox version to Manifest V3. close #201 +- Sunset rustc docs search (#281) +- Support description shards (#285) +- Support all stdlib crates +- Bug fix: + - chore: fix typo (#273) + - Fix offline mode not working on Chrome + - Fix search of extern crates (#276) + - Fix docs.rs TOC if headings contain inline code (#278) + - Fix crate indexing by upgrading item types for old crate doc (#277) + - Fix optional dependency nowrap, close #274 + - Fix source code mode and levenshtein bug + - Fix docs.rs svg icons + + # v1.13.0 - 2024-02-14 - Migrate std docs index to `Map`. diff --git a/docs/templates/index.html b/docs/templates/index.html index 75f8d64..e214288 100644 --- a/docs/templates/index.html +++ b/docs/templates/index.html @@ -49,7 +49,7 @@
- Current version 1.13.0 + Current version 2.0.0 {var u=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var y=(t,e)=>{for(var s in e)u(t,s,{get:e[s],enumerable:!0})},C=(t,e,s,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of w(e))!h.call(t,r)&&r!==s&&u(t,r,{get:()=>e[r],enumerable:!(i=p(e,r))||i.enumerable});return t};var S=t=>C(u({},"__esModule",{value:!0}),t);var n=(t,e,s)=>new Promise((i,r)=>{var c=o=>{try{g(s.next(o))}catch(d){r(d)}},l=o=>{try{g(s.throw(o))}catch(d){r(d)}},g=o=>o.done?i(o.value):Promise.resolve(o.value).then(c,l);g((s=s.apply(t,e)).next())});var b={};y(b,{CrateDocManager:()=>I,IndexSetter:()=>m,settings:()=>x,storage:()=>a});var f=null;chrome&&chrome.storage?f={getAllItems:()=>new Promise(t=>{chrome.storage.local.get(null,t)}),getItem:t=>new Promise(e=>{chrome.storage.local.get(t,s=>{e(s?s[t]:null)})}),setItem:(t,e)=>new Promise(s=>{chrome.storage.local.set({[t]:e},s)}),removeItem:t=>new Promise(e=>{chrome.storage.local.remove(t,e)})}:f={getAllItems:()=>new Promise(t=>{}),getItem:t=>new Promise(e=>{let s=localStorage.getItem(t);if(s)try{s=JSON.parse(s)}catch(i){}e(s)}),setItem:(t,e)=>new Promise(s=>{e instanceof Object&&(e=JSON.stringify(e)),localStorage.setItem(t,e),s()}),removeItem:t=>new Promise(e=>{localStorage.removeItem(t),e()})};var a=f;var P={get autoUpdate(){return n(this,null,function*(){return(yield a.getItem("auto-update"))||!1})},set autoUpdate(t){a.setItem("auto-update",t)},get isOfflineMode(){return n(this,null,function*(){return(yield a.getItem("offline-mode"))||!1})},set isOfflineMode(t){a.setItem("offline-mode",t)},get offlineDocPath(){return n(this,null,function*(){return(yield a.getItem("offline-path"))||""})},set offlineDocPath(t){a.setItem("offline-path",t)},get crateRegistry(){return n(this,null,function*(){return(yield a.getItem("crate-registry"))||"crates.io"})},set crateRegistry(t){a.setItem("crate-registry",t)},get defaultSearch(){return n(this,null,function*(){return(yield a.getItem("default-search"))||{thirdPartyDocs:!1,docsRs:!0,attributes:!0}})},set defaultSearch(t){a.setItem("default-search",t)},get showMacroRailroad(){return n(this,null,function*(){let t=yield a.getItem("show-macro-railroad");return t===void 0?!0:t})},set showMacroRailroad(t){a.setItem("show-macro-railroad",t)},get keepCratesUpToDate(){return n(this,null,function*(){let t=yield a.getItem("keep-crates-up-to-date");return t===void 0?!1:t})},set keepCratesUpToDate(t){a.setItem("keep-crates-up-to-date",t)}},x=P;var m=class t{static setStdStableIndex(e){a.setItem("index-std-stable",e)}static setStdNightlyIndex(e){a.setItem("index-std-nightly",e)}static setDescShards(e,s){s&&a.setItem(`desc-shards-${e}`,s)}static setBookIndex(e){a.setItem("index-book",e)}static setLabelIndex(e){a.setItem("index-label",e)}static setRfcIndex(e){a.setItem("index-rfc",e)}static setCrateMapping(e){a.setItem("index-crate-mapping",e)}static setCrateIndex(e){a.setItem("index-crate",e)}static setLintIndex(e){a.setItem("index-lint",e)}static setCaniuseIndex(e){a.setItem("index-caniuse",e)}static setRustcIndex(e){a.setItem("index-rustc",e)}static setTargetIndex(e){a.setItem("index-target",e)}static setCommandIndex(e){a.setItem("index-command",e)}static updateAllIndex(){t.setBookIndex(booksIndex),t.setCaniuseIndex(caniuseIndex),t.setCommandIndex(commandsIndex),t.setCrateIndex(crateIndex),t.setCrateMapping(mapping),t.setLabelIndex(labelsIndex),t.setLintIndex(lintsIndex),t.setRfcIndex(rfcsIndex),t.setRustcIndex(rustcIndex),t.setStdStableIndex(searchIndex),t.setTargetIndex(targetsIndex)}};var I=class t{static getCrates(){return n(this,null,function*(){return(yield a.getItem("crates"))||{}})}static getCrateByName(e){return n(this,null,function*(){let s=yield t.getCrates();if(s[e])return s[e];{let i=Object.entries(s).find(([r,{crateName:c}])=>c==e);return i?i[1]:null}})}static getCrateSearchIndex(e){return n(this,null,function*(){let s=yield a.getItem(`@${e}`);if(s)return s;{let i=yield t.getCrates(),r=Object.entries(i).find(([c,{crateName:l}])=>l==e);if(r){let c=r[0];return new Map(yield a.getItem(`@${c}`))}else return null}})}static addCrate(g){return n(this,arguments,function*({libName:e,crateVersion:s,crateTitle:i,searchIndex:r,crateName:c,descShards:l}){yield a.setItem(`@${e}`,r);let o=i,d=yield t.getCrates();e in d?d[e]={version:s,doc:o,time:d[e].time,crateName:c}:d[e]={version:s,doc:o,time:Date.now(),crateName:c},yield a.setItem("crates",d),m.setDescShards(e,l)})}static removeCrate(e){return n(this,null,function*(){let s=yield t.getCrates();delete s[e],yield a.setItem("crates",s),yield a.removeItem(`@${e}`),yield a.removeItem(`desc-shards-${e}`)})}};return S(b);})(); +var rse=(()=>{var f=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var C=(t,e)=>{for(var r in e)f(t,r,{get:e[r],enumerable:!0})},S=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of h(e))!y.call(t,s)&&s!==r&&f(t,s,{get:()=>e[s],enumerable:!(n=w(e,s))||n.enumerable});return t};var b=t=>S(f({},"__esModule",{value:!0}),t);var i=(t,e,r)=>new Promise((n,s)=>{var c=o=>{try{u(r.next(o))}catch(d){s(d)}},l=o=>{try{u(r.throw(o))}catch(d){s(d)}},u=o=>o.done?n(o.value):Promise.resolve(o.value).then(c,l);u((r=r.apply(t,e)).next())});var O={};C(O,{CrateDocManager:()=>I,IndexSetter:()=>m,settings:()=>x,storage:()=>a});var g=class t{static browserType(){let e=navigator.userAgent.toLowerCase();return e.indexOf("edg")!==-1?"edge":e.indexOf("chrome")!==-1?"chrome":e.indexOf("safari")!==-1?"safari":e.indexOf("gecko")!==-1?"firefox":"unknown"}static isRunningInWebExtension(){return typeof chrome=="object"&&chrome.runtime}static omniboxPageSize(){return{firefox:6,edge:7,chrome:8,unknown:6}[t.browserType()]}static escape(e){return e=e||"",t.browserType()==="firefox"?e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'"):t.escapeAmpersand(e).replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}static escapeAmpersand(e){return e.replace(" & "," & ")}static normalizeDate(e){let r=""+(e.getMonth()+1),n=""+e.getDate();return[e.getFullYear(),r.padStart(2,"0"),n.padStart(2,"0")].join("-")}static capitalize(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""}static eliminateTags(e){return e?e.replace(/<\/?(match|dim|code|em|strong|span)>/g,""):""}};var p=null;g.isRunningInWebExtension()?p={getAllItems:()=>new Promise(t=>{chrome.storage.local.get(null,t)}),getItem:t=>new Promise(e=>{chrome.storage.local.get(t,r=>{e(r?r[t]:null)})}),setItem:(t,e)=>new Promise(r=>{chrome.storage.local.set({[t]:e},r)}),removeItem:t=>new Promise(e=>{chrome.storage.local.remove(t,e)})}:p={getAllItems:()=>new Promise(t=>{}),getItem:t=>new Promise(e=>{let r=localStorage.getItem(t);if(r)try{r=JSON.parse(r)}catch(n){}e(r)}),setItem:(t,e)=>new Promise(r=>{e instanceof Object&&(e=JSON.stringify(e)),localStorage.setItem(t,e),r()}),removeItem:t=>new Promise(e=>{localStorage.removeItem(t),e()})};var a=p;var P={get autoUpdate(){return i(this,null,function*(){return(yield a.getItem("auto-update"))||!1})},set autoUpdate(t){a.setItem("auto-update",t)},get isOfflineMode(){return i(this,null,function*(){return(yield a.getItem("offline-mode"))||!1})},set isOfflineMode(t){a.setItem("offline-mode",t)},get offlineDocPath(){return i(this,null,function*(){return(yield a.getItem("offline-path"))||""})},set offlineDocPath(t){a.setItem("offline-path",t)},get crateRegistry(){return i(this,null,function*(){return(yield a.getItem("crate-registry"))||"crates.io"})},set crateRegistry(t){a.setItem("crate-registry",t)},get defaultSearch(){return i(this,null,function*(){return(yield a.getItem("default-search"))||{thirdPartyDocs:!1,docsRs:!0,attributes:!0}})},set defaultSearch(t){a.setItem("default-search",t)},get showMacroRailroad(){return i(this,null,function*(){let t=yield a.getItem("show-macro-railroad");return t===void 0?!0:t})},set showMacroRailroad(t){a.setItem("show-macro-railroad",t)},get keepCratesUpToDate(){return i(this,null,function*(){let t=yield a.getItem("keep-crates-up-to-date");return t===void 0?!1:t})},set keepCratesUpToDate(t){a.setItem("keep-crates-up-to-date",t)}},x=P;var m=class t{static setStdStableIndex(e){a.setItem("index-std-stable",e)}static setStdNightlyIndex(e){a.setItem("index-std-nightly",e)}static setDescShards(e,r){r&&a.setItem(`desc-shards-${e}`,r)}static setBookIndex(e){a.setItem("index-book",e)}static setLabelIndex(e){a.setItem("index-label",e)}static setRfcIndex(e){a.setItem("index-rfc",e)}static setCrateMapping(e){a.setItem("index-crate-mapping",e)}static setCrateIndex(e){a.setItem("index-crate",e)}static setLintIndex(e){a.setItem("index-lint",e)}static setCaniuseIndex(e){a.setItem("index-caniuse",e)}static setRustcIndex(e){a.setItem("index-rustc",e)}static setTargetIndex(e){a.setItem("index-target",e)}static setCommandIndex(e){a.setItem("index-command",e)}static updateAllIndex(){t.setBookIndex(booksIndex),t.setCaniuseIndex(caniuseIndex),t.setCommandIndex(commandsIndex),t.setCrateIndex(crateIndex),t.setCrateMapping(mapping),t.setLabelIndex(labelsIndex),t.setLintIndex(lintsIndex),t.setRfcIndex(rfcsIndex),t.setRustcIndex(rustcIndex),t.setStdStableIndex(searchIndex),t.setTargetIndex(targetsIndex)}};var I=class t{static getCrates(){return i(this,null,function*(){return(yield a.getItem("crates"))||{}})}static getCrateByName(e){return i(this,null,function*(){let r=yield t.getCrates();if(r[e])return r[e];{let n=Object.entries(r).find(([s,{crateName:c}])=>c==e);return n?n[1]:null}})}static getCrateSearchIndex(e){return i(this,null,function*(){let r=yield a.getItem(`@${e}`);if(r)return new Map(r);{let n=yield t.getCrates(),s=Object.entries(n).find(([c,{crateName:l}])=>l==e);if(s){let c=s[0];return new Map(yield a.getItem(`@${c}`))}else return null}})}static addCrate(u){return i(this,arguments,function*({libName:e,crateVersion:r,crateTitle:n,searchIndex:s,crateName:c,descShards:l}){yield a.setItem(`@${e}`,s);let o=n,d=yield t.getCrates();e in d?d[e]={version:r,doc:o,time:d[e].time,crateName:c}:d[e]={version:r,doc:o,time:Date.now(),crateName:c},yield a.setItem("crates",d),m.setDescShards(e,l)})}static removeCrate(e){return i(this,null,function*(){let r=yield t.getCrates();delete r[e],yield a.setItem("crates",r),yield a.removeItem(`@${e}`),yield a.removeItem(`desc-shards-${e}`)})}};return b(O);})();