dumi 2.1.21 → 2.1.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.
- package/README.md +2 -6
- package/compiled/_internal/searchWorker.min.js +1 -1
- package/dist/assetParsers/atom.js +1 -1
- package/dist/client/theme-api/useSiteSearch/index.d.ts +1 -0
- package/dist/loaders/markdown/transformer/rehypeEnhancedTag.js +1 -0
- package/package.json +1 -1
- package/theme-default/slots/ColorSwitch/index.less +4 -2
- package/theme-default/slots/RtlSwitch/index.less +2 -1
- package/theme-default/slots/SocialIcon/index.less +2 -1
package/README.md
CHANGED
|
@@ -10,13 +10,9 @@ dumi is a static site generator for component library development.
|
|
|
10
10
|
|
|
11
11
|
To view more online examples and docs, please visit [dumi official site](https://d.umijs.org).
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Contributing
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
$ pnpm install
|
|
17
|
-
$ pnpm dev
|
|
18
|
-
$ pnpm docs:dev
|
|
19
|
-
```
|
|
15
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md)
|
|
20
16
|
|
|
21
17
|
## Badge
|
|
22
18
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var P=Object.create;var
|
|
1
|
+
"use strict";(()=>{var P=Object.create;var I=Object.defineProperty;var z=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames,R=Object.getOwnPropertySymbols,B=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty,L=Object.prototype.propertyIsEnumerable;var O=(e,t,i)=>t in e?I(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,M=(e,t)=>{for(var i in t||(t={}))E.call(t,i)&&O(e,i,t[i]);if(R)for(var i of R(t))L.call(t,i)&&O(e,i,t[i]);return e};var F=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var N=(e,t,i,h)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of D(t))!E.call(e,a)&&a!==i&&I(e,a,{get:()=>t[a],enumerable:!(h=z(t,a))||h.enumerable});return e};var W=(e,t,i)=>(i=e!=null?P(B(e)):{},N(t||!e||!e.__esModule?I(i,"default",{value:e,enumerable:!0}):i,e));var j=F((K,w)=>{w.exports=function(e){var t={};function i(h){if(t[h])return t[h].exports;var a=t[h]={exports:{},id:h,loaded:!1};return e[h].call(a.exports,a,a.exports,i),a.loaded=!0,a.exports}return i.m=e,i.c=t,i.p="",i(0)}([function(e,t,i){e.exports=i(1)},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var h=i(2);Object.defineProperty(t,"combineChunks",{enumerable:!0,get:function(){return h.combineChunks}}),Object.defineProperty(t,"fillInChunks",{enumerable:!0,get:function(){return h.fillInChunks}}),Object.defineProperty(t,"findAll",{enumerable:!0,get:function(){return h.findAll}}),Object.defineProperty(t,"findChunks",{enumerable:!0,get:function(){return h.findChunks}})},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=t.findAll=function(s){var n=s.autoEscape,c=s.caseSensitive,f=c===void 0?!1:c,p=s.findChunks,u=p===void 0?a:p,g=s.sanitize,v=s.searchWords,T=s.textToHighlight;return o({chunksToHighlight:h({chunks:u({autoEscape:n,caseSensitive:f,sanitize:g,searchWords:v,textToHighlight:T})}),totalLength:T?T.length:0})},h=t.combineChunks=function(s){var n=s.chunks;return n=n.sort(function(c,f){return c.start-f.start}).reduce(function(c,f){if(c.length===0)return[f];var p=c.pop();if(f.start<=p.end){var u=Math.max(p.end,f.end);c.push({highlight:!1,start:p.start,end:u})}else c.push(p,f);return c},[]),n},a=function(s){var n=s.autoEscape,c=s.caseSensitive,f=s.sanitize,p=f===void 0?d:f,u=s.searchWords,g=s.textToHighlight;return g=p(g),u.filter(function(v){return v}).reduce(function(v,T){T=p(T),n&&(T=r(T));for(var m=new RegExp(T,c?"g":"gi"),x=void 0;x=m.exec(g);){var S=x.index,$=m.lastIndex;$>S&&v.push({highlight:!1,start:S,end:$}),x.index===m.lastIndex&&m.lastIndex++}return v},[])};t.findChunks=a;var o=t.fillInChunks=function(s){var n=s.chunksToHighlight,c=s.totalLength,f=[],p=function(v,T,m){T-v>0&&f.push({start:v,end:T,highlight:m})};if(n.length===0)p(0,c,!1);else{var u=0;n.forEach(function(g){p(u,g.start,!1),p(g.start,g.end,!0),u=g.end}),p(u,c,!1)}return f};function d(l){return l}function r(l){return l.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}}])});var C=W(j());var H="tab";function k(e,t,i,h,a){let o=a!==void 0,d=h.reduce((r,l)=>(l.tocIndex===a&&(r[l.paraId]=(r[l.paraId]||"").concat(l.value)),r),[]).filter(Boolean);return Boolean(d.length)||o?{rawTitle:e,title:t,link:i,paragraphs:h.reduce((r,l)=>{var s,n;return l.tocIndex===a&&((n=r[s=l.paraId])!=null||(r[s]=""),r[l.paraId]+=l.value),r},[]).filter(Boolean)}:null}function y(e){return[e.title,e.subtitle].filter(Boolean).join(" ")}function _(e,t,i){let h=[],a=Object.values(t).reduce((o,d)=>{var r,l;return d.asset&&((l=o[r=d.routeId])!=null||(o[r]=[]),o[d.routeId].push(d)),o},{});return Object.values(e).forEach(o=>{var d;if("meta"in o&&!("isLayout"in o)){let r=o.meta,l=o.path.replace(/^([^/])/,"/$1")||"/",s=i.find(u=>l===u.link||l.startsWith(`${u.activePath}/`)),n=(a[o.id]||[]).map(u=>{var g;return(g=u.asset)==null?void 0:g.id}),c=k("",y(r.frontmatter),l,r.texts),f=r.toc.reduce((u,g,v)=>(!n.includes(g.id)&&g.depth>1&&u.push(k(g.title,`${y(r.frontmatter)} - ${g.title}`,`${l}#${g.id}`,r.texts,v)),u),[]),p=(r.tabs||[]).reduce((u,{key:g,meta:v})=>{let T=k("",`${y(r.frontmatter)} - ${v.frontmatter.title}`,`${l}?${H}=${g}`,v.texts);return T&&u.push(T),u.push(...v.toc.map((m,x)=>k(m.title,`${y(r.frontmatter)} - ${v.frontmatter.title} - ${m.title}`,`${l}?${H}=${g}#${m.id}`,v.texts,x))),u},[]);h.push({navTitle:s==null?void 0:s.title,navOrder:s?i.indexOf(s):1/0,title:y(r.frontmatter),link:l,sections:[...c?[c]:[],...f,...p],demos:((d=a[o.id])==null?void 0:d.map(u=>({link:`${l}#${u.asset.id}`,rawTitle:u.asset.title||"",title:u.asset.title||y(r.frontmatter),description:u.asset.description||"",keywords:u.asset.keywords||[]})))||[]})}}),h}function b(e="",t,i=1){let h=(0,C.findAll)({textToHighlight:e,searchWords:t,autoEscape:!0}),a={};return[h.map(({start:o,end:d,highlight:r},l)=>{let s={text:e.slice(o,d)};return l===0&&!r&&h.length>1&&s.text.length>20&&(s.text=`...${s.text.slice(-20)}`),r&&(s.highlighted=!0,a[t.find(n=>s.text.includes(n))]=i),s}),a]}function Y(e,t){let i=t.split(" "),h=new RegExp(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(" ","|"),"i"),a={};return e.forEach(o=>{var l,s;let d=o.title,r=[];if(o.sections.forEach(n=>{for(let c of n.paragraphs)if(h.test(c)){let[f,p]=b(n.title,i,10),[u,g]=b(c,i);r.push({type:"content",link:n.link,priority:Object.values(M(M({},g),p)).reduce((v,T)=>v+T,0),highlightTitleTexts:f,highlightTexts:u,pageTitle:d});return}if(h.test(n.rawTitle)){let[c,f]=b(n.title,i,10);r.push({type:"title",link:n.link,priority:Object.values(f).reduce((p,u)=>p+u,0),highlightTitleTexts:c,highlightTexts:b(n.paragraphs[0]||"",i)[0],pageTitle:d})}}),o.demos.forEach(n=>{if(h.test(n.rawTitle)||h.test(n.description)){let[c,f]=b(n.title,i,10),[p,u]=b(n.description,i);r.push({type:"demo",link:n.link,priority:Object.values(M(M({},u),f)).reduce((g,v)=>g+v,0),highlightTitleTexts:c,highlightTexts:p,pageTitle:d})}}),h.test(o.title)){let[n,c]=b(o.title,i,100);r.push({type:"page",link:o.link,priority:Object.values(c).reduce((f,p)=>f+p,0),highlightTitleTexts:n,highlightTexts:b(((l=o.sections[0])==null?void 0:l.paragraphs[0])||"",i)[0],pageTitle:d})}if(r.length){let n=o.navTitle||"$ROOT";(s=a[n])!=null||(a[n]={title:o.navTitle,priority:o.navOrder*1e3,hints:[]}),a[n].hints.push(...r)}}),Object.values(a).forEach(({hints:o})=>{o.sort((d,r)=>r.priority-d.priority)}),Object.values(a).sort((o,d)=>d.priority-o.priority)}var A;self.onmessage=({data:e})=>{switch(e.action){case"generate-metadata":A=_(e.args.routes,e.args.demos,e.args.nav);break;case"get-search-result":self.postMessage(Y(A,e.args.keywords));break;default:}};})();
|
|
@@ -131,7 +131,7 @@ var AtomAssetsParser = class {
|
|
|
131
131
|
}, 100);
|
|
132
132
|
this.watcher = import_plugin_utils.chokidar.watch(this.watchArgs.paths, this.watchArgs.options).on("all", (ev, file) => {
|
|
133
133
|
if (["add", "change"].includes(ev) && /((?<!\.d)\.ts|\.(jsx?|tsx))$/.test(file)) {
|
|
134
|
-
this.unresolvedFiles.push(import_path.default.join(this.
|
|
134
|
+
this.unresolvedFiles.push(import_path.default.join(this.watchArgs.options.cwd, file));
|
|
135
135
|
lazyParse();
|
|
136
136
|
}
|
|
137
137
|
});
|
package/package.json
CHANGED
|
@@ -12,13 +12,15 @@
|
|
|
12
12
|
inset-inline-end: -15px;
|
|
13
13
|
transform: none;
|
|
14
14
|
|
|
15
|
-
[class*='-switch'] +
|
|
15
|
+
[class*='-switch'] + &,
|
|
16
|
+
[class*='-select'] + & {
|
|
16
17
|
inset-inline-end: 0;
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
21
|
|
|
21
|
-
[class*='-switch'] +
|
|
22
|
+
[class*='-switch'] + &,
|
|
23
|
+
[class*='-select'] + & {
|
|
22
24
|
margin-inline-start: 15px;
|
|
23
25
|
margin-inline-end: -15px;
|
|
24
26
|
padding-inline: 15px;
|