@webority/tokens 0.107.0 → 0.108.0
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/dist/canvas/webority-phone.json +1 -1
- package/dist/canvas/webority-web-390.json +1 -1
- package/dist/canvas/webority-web.json +1 -1
- package/dist/meanings.json +1 -1
- package/dist/upgrade/classes.js +2 -0
- package/dist/upgrade/components.js +3 -0
- package/dist/upgrade/index.js +2 -2
- package/dist/upgrade/razorTags.js +2 -0
- package/dist/upgrade/source.js +3 -3
- package/package.json +1 -1
- package/renames/0.108.0.json +299 -0
- package/renames/renames.d.ts +40 -0
package/dist/meanings.json
CHANGED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=new Set([`.css`,`.scss`,`.sass`,`.less`]),t=new Set([`.cshtml`,`.razor`,`.html`]),n=new Set([`.js`,`.jsx`,`.ts`,`.tsx`,`.mjs`,`.cjs`,`.mts`,`.cts`]),r=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),i=e=>{let t=/\.[^./]*$/.exec(e);return t?t[0].toLowerCase():``},a=e=>{let t=[0];for(let n=0;n<e.length;n++)e[n]===`
|
|
2
|
+
`&&t.push(n+1);return t},o=(e,t)=>{let n=0,r=e.length-1;for(;n<r;){let i=n+r+1>>1;e[i]<=t?n=i:r=i-1}return n+1},s=(e,t)=>e<t?-1:+(e>t);function c(c,l,u){let d=i(l),f=e.has(d)?`selector`:t.has(d)?`attribute`:n.has(d)?`literal`:void 0;if(u.length===0||f===void 0)return{text:c,hits:[],findings:[]};let p=new Map(u),m=[...p.keys()].sort((e,t)=>t.length-e.length).map(r).join(`|`),h=RegExp(`(?<![\\w-])(${m})(?![\\w-])`,`g`),g=a(c),_=[],v=(e,t)=>e.replace(h,(e,n,r)=>{let i=p.get(e);return _.push({line:o(g,t+r),from:e,to:i}),i}),y=c;return y=f===`selector`?c.replace(RegExp(`\\.(${m})(?![\\w-])`,`g`),(e,t,n)=>{let r=p.get(t);return _.push({line:o(g,n),from:`.${t}`,to:`.${r}`}),`.${r}`}):f===`attribute`?c.replace(/(?<=\s)class\s*=\s*(["'])([^"'\n]*)\1/g,(e,t,n,r)=>{let i=v(n,r+e.length-1-n.length);return`${e.slice(0,e.length-1-n.length)}${i}${t}`}):c.replace(/(["'`])([^"'`\n]*)\1/g,(e,t,n,r)=>`${t}${v(n,r+1)}${t}`),_.sort((e,t)=>e.line-t.line||s(e.from,t.from)),{text:y,hits:_,findings:[]}}export{c as applyClasses};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var e=new Set([`.js`,`.jsx`,`.ts`,`.tsx`]),t=`[A-Za-z_$][\\w$]*`,n=RegExp(`^(type\\s+)?(${t})(?:\\s+as\\s+(${t}))?$`),r=/[A-Za-z_$][\w$:.-]*/y,i=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),a=e=>{let t=/\.[^./]*$/.exec(e);return t?t[0].toLowerCase():``},o=e=>{let t=[0];for(let n=0;n<e.length;n++)e[n]===`
|
|
2
|
+
`&&t.push(n+1);return t},s=(e,t)=>{let n=0,r=e.length-1;for(;n<r;){let i=n+r+1>>1;e[i]<=t?n=i:r=i-1}return n+1},c=(e,t)=>e<t?-1:+(e>t),l=e=>`${e.typeKw}${e.name}${e.alias===void 0?``:` as ${e.alias}`}`;function u(e){return e.split(`,`).map(e=>e.trim()).filter(e=>e!==``).map(e=>{let t=n.exec(e);if(t===null)throw Error(`cannot read the import specifier "${e}"`);return{typeKw:t[1]===void 0?``:`type `,name:t[2],alias:t[3]}})}function d(e,n){let r=RegExp(`\\bimport\\s+(type\\s+)?(?:(${t})\\s*,\\s*)?\\{([^{}]*)\\}\\s*from\\s*(["'])${i(n)}\\4(;?)`,`g`);return[...e.matchAll(r)].map(e=>({start:e.index,end:e.index+e[0].length,typeKw:e[1]===void 0?``:`type `,defaultName:e[2],specs:u(e[3]),quote:e[4],semi:e[5],pkg:n}))}function f(e,t){let n=0,r=``;for(let i=t;i<e.length;i++){let t=e[i];if(r)t===`\\`?i++:t===r&&(r=``);else if(t===`"`||t===`'`||t==="`")r=t;else if(t===`{`)n++;else if(t===`}`)n--;else if(t===`>`&&n===0)return i}return-1}function p(e,t){let n=0,r=``;for(let i=t;i<e.length;i++){let t=e[i];if(r)t===`\\`?i++:t===r&&(r=``);else if(t===`"`||t===`'`||t==="`")r=t;else if(t===`{`)n++;else if(t===`}`&&(n--,n===0))return i+1}throw Error(`unbalanced braces in a JSX attribute`)}function m(e,t,n){let i=[],a=t;for(;a<n;){let t=e[a];if(/\s/.test(t)){a++;continue}if(t===`{`){a=p(e,a);continue}r.lastIndex=a;let n=r.exec(e);if(n===null)break;let o=a,s=a+n[0].length,c=s;for(;/\s/.test(e[c]??``);)c++;if(e[c]!==`=`){i.push({name:n[0],nameStart:o,nameEnd:s,kind:`none`}),a=s;continue}for(c++;/\s/.test(e[c]??``);)c++;let l=e[c];if(l===`"`||l===`'`){let t=e.indexOf(l,c+1);if(t===-1)throw Error(`unterminated value of JSX attribute "${n[0]}"`);i.push({name:n[0],nameStart:o,nameEnd:s,kind:`quoted`,innerStart:c+1,innerEnd:t,inner:e.slice(c+1,t)}),a=t+1}else if(l===`{`){let t=p(e,c);i.push({name:n[0],nameStart:o,nameEnd:s,kind:`braced`,innerStart:c+1,innerEnd:t-1,inner:e.slice(c+1,t-1)}),a=t}else throw Error(`cannot read the value of JSX attribute "${n[0]}"`)}return i}function h(e){if(e.kind===`quoted`)return{start:e.innerStart,end:e.innerEnd,value:e.inner};if(e.kind===`braced`){let t=/^(\s*)(["'])([^"'\n]*)\2\s*$/.exec(e.inner);if(t!==null){let n=e.innerStart+t[1].length+1;return{start:n,end:n+t[3].length,value:t[3]}}}}function g(e,t){let n=[],r=`<${t}`;for(let t=e.indexOf(r);t!==-1;t=e.indexOf(r,t+1)){let i=t+r.length;if(!/[\s/>]/.test(e[i]??``))continue;let a=f(e,i);a!==-1&&n.push({nameEnd:i,end:a})}return n}function _(e,t,n){let r=d(e,n.package),a=r.flatMap(e=>e.specs.filter(e=>e.name===n.from).map(t=>({st:e,spec:t})))[0];if(a===void 0)return{text:e,hits:[],findings:[]};let{st:c,spec:u}=a,f=u.alias??n.from,p=u.alias??n.to,_=p!==f,v=n.from!==n.to&&u.alias===void 0&&r.some(e=>e.specs.some(e=>e!==u&&e.name===n.to&&e.alias===void 0)),y=o(e),b=[],x=[],S=[];if(n.from!==n.to){let t=v?c.specs.filter(e=>e!==u):c.specs.map(e=>e===u?{...e,name:n.to}:e),r=[];if(c.defaultName!==void 0&&r.push(c.defaultName),t.length>0&&r.push(`{ ${t.map(l).join(`, `)} }`),r.length===0){let t=e[c.end]===`
|
|
3
|
+
`?c.end+1:c.end;b.push({start:c.start,end:t,text:``})}else b.push({start:c.start,end:c.end,text:`import ${c.typeKw}${r.join(`, `)} from ${c.quote}${c.pkg}${c.quote}${c.semi}`});x.push({line:s(y,c.start),from:n.from,to:n.to})}let C=e=>Object.hasOwn(n.renameProps,e)?n.renameProps[e]:e;for(let{nameEnd:r,end:i}of g(e,f)){let a=s(y,r),o=m(e,r,i);for(let e of o){let t=C(e.name);t!==e.name&&(b.push({start:e.nameStart,end:e.nameEnd,text:t}),x.push({line:s(y,e.nameStart),from:e.name,to:t}))}let c=o.map(e=>C(e.name));for(let e of o){let t=C(e.name);if(!Object.hasOwn(n.valueMaps,t))continue;let r=h(e);if(r!==void 0&&Object.hasOwn(n.valueMaps[t],r.value)){let e=n.valueMaps[t][r.value];b.push({start:r.start,end:r.end,text:e}),x.push({line:s(y,r.start),from:`${t}="${r.value}"`,to:`${t}="${e}"`})}}let l=Object.entries(n.addProps).filter(([e])=>!c.includes(e)).map(([e,t])=>` ${e}=${typeof t==`string`?`"${t}"`:`{${t}}`}`);l.length>0&&b.push({start:r,end:r,text:l.join(``)}),(_||l.length>0)&&x.push({line:a,from:`<${f}`,to:`<${p}${l.join(``)}`}),_&&b.push({start:r-f.length,end:r,text:p});for(let[e,r]of Object.entries(n.removeProps))o.some(t=>t.name===e)&&S.push({file:t,line:a,path:`<${n.from}> ${e}`,message:r})}if(_)for(let t of e.matchAll(RegExp(`</${i(f)}(?=\\s*>)`,`g`))){let e=t.index+2;b.push({start:e,end:e+f.length,text:p}),x.push({line:s(y,e),from:`</${f}`,to:`</${p}`})}b.sort((e,t)=>t.start-e.start||t.end-e.end);let w=e;for(let e of b)w=w.slice(0,e.start)+e.text+w.slice(e.end);return{text:w,hits:x,findings:S}}function v(t,n,r){if(r.length===0||!e.has(a(n)))return{text:t,hits:[],findings:[]};let i=t,o=[],s=[];for(let e of r){let t=_(i,n,e);i=t.text,o.push(...t.hits),s.push(...t.findings)}return o.sort((e,t)=>e.line-t.line||c(e.from,t.from)),s.sort((e,t)=>e.line-t.line||c(e.path,t.path)),{text:i,hits:o,findings:s}}export{v as applyComponents};
|
package/dist/upgrade/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{brand as e}from"../build.js";import{applyCssTable as
|
|
1
|
+
import{brand as e}from"../build.js";import{applyClasses as t}from"./classes.js";import{applyComponents as n}from"./components.js";import{applyCssTable as r,isCssTarget as i}from"./css.js";import{applyRazorAttributes as a}from"./razorAttributes.js";import{applyRazorTags as o}from"./razorTags.js";import{applyMarkup as s,applySource as c}from"./source.js";import{applyComponentProps as l,applyPropSplits as u,applyPropValues as d,applyProps as f,applyThemeReads as p}from"./themeReads.js";import{createRequire as m}from"node:module";import{existsSync as h,readFileSync as g,readdirSync as _,writeFileSync as v}from"node:fs";import{dirname as y,join as b}from"node:path";import{fileURLToPath as x,pathToFileURL as S}from"node:url";import{spawnSync as C}from"node:child_process";var w=/^\d+\.\d+\.\d+$/,T=/^(?:workspace:|file:|link:)/,E=`WEBORITY_UPGRADE_FROM`;function D(e){if(typeof e!=`string`||!w.test(e))throw Error(`invalid version "${e}"`)}function O(e,t){D(e),D(t);let n=e.split(`.`).map(Number),r=t.split(`.`).map(Number);for(let e=0;e<3;e++)if(n[e]!==r[e])return n[e]-r[e];return 0}function k(){let e=y(x(import.meta.url));for(;;){let t=b(e,`package.json`);if(h(t)&&JSON.parse(g(t,`utf8`)).name===`@webority/tokens`)return e;let n=y(e);if(n===e)throw Error(`cannot find the @webority/tokens package folder`);e=n}}function A(e){let t=[];for(let n of _(e)){if(!n.endsWith(`.json`))continue;let r=n.slice(0,-5);w.test(r)&&t.push({version:r,table:JSON.parse(g(b(e,n),`utf8`))})}return t.sort((e,t)=>O(e.version,t.version))}function j(e,t){let n=C(`git`,[`ls-files`,`-z`,`--`,...t],{cwd:e,encoding:`utf8`,windowsHide:!0,maxBuffer:64*1024*1024});if(n.status!==0)throw Error(`not a git repository: ${e}`);let r=n.stdout.split(`\0`).filter(Boolean).map(e=>e.split(`\\`).join(`/`)).filter(t=>h(b(e,t)));return[...new Set(r)]}function M(e,t){let n=j(e,t??[`.`]);if(t!==void 0&&n.length===0)throw Error(`no tracked files under ${t.join(`, `)}`);return n}function N(e){return e.split(`/`).includes(`node_modules`)}var P=new Set([`node_modules`,`vendor`,`vendors`,`external`]),F=/\.(?:min|bundle)\.(?:js|css)$/;function I(e){let t=e.split(`/`);return t.some(e=>P.has(e))||t.some((e,n)=>e===`lib`&&t[n-1]===`wwwroot`)?!0:F.test(e)}function L(e,t){return[...new Set([...e,...t])]}function R(e,t,n){return A(e).filter(e=>O(e.version,t)>0&&O(e.version,n)<=0).map(e=>e.table)}function z(e,m,h,_,y){_&&y(`dry run: nothing written`);let x=[],S=[],C=[];for(let w of m){if(!i(w)||I(w))continue;let m=g(b(e,w),`utf8`),T=m,E=e=>{for(let t of e)x.push({file:w,line:t.line,from:t.from,to:t.to}),y(`${w}:${t.line} ${t.from} -> ${t.to}`)},D=e=>{S.push({file:w,line:e.line,name:e.name,hint:e.hint}),y(`choose ${w}:${e.line} ${e.name}: ${e.hint}`)},O=e=>{for(let t of e)t.message.startsWith(`skipped, it does not parse`)?y(`skipped ${w}: ${t.message}`):D({line:t.line,name:t.path,hint:t.message})};for(let e of h){let i=r(T,w,e);T=i.text,E(i.hits);for(let e of i.choose)D(e);for(let e of i.checkRole)y(`verify ${w}:${e.line} ${e.from} -> ${e.to}`);let m=p(T,w,e.themeReads);T=m.text,E(m.hits),O(m.findings);let h=[t=>f(t,w,e.props),t=>l(t,w,e.componentProps),t=>d(t,w,e.propValues),t=>u(t,w,e.propSplits),t=>a(t,w,e.razorAttributes),t=>n(t,w,e.components??[]),t=>o(t,w,e.razorTags??[]),n=>t(n,w,e.classes??[]),t=>s(t,w,e.markup),t=>c(t,w,e.source)];for(let e of h){let t=e(T);T=t.text,E(t.hits),O(t.findings)}}T!==m&&(C.push(w),_||v(b(e,w),T,`utf8`))}return{hits:x,choose:S,changedFiles:C}}function B(e){let t=/^([ \t]+)\S/m.exec(e);return t?t[1]:4}function V(e,t,n,r,i){let a=[];for(let o of j(e,[`package.json`,`:(glob)**/package.json`])){if(N(o))continue;let s=g(b(e,o),`utf8`),c=JSON.parse(s),l=!1;for(let e of[`dependencies`,`devDependencies`]){let r=c[e];if(r)for(let e of n.npm){if(!Object.hasOwn(r,e))continue;let n=r[e];T.test(n)||n===t||(r[e]=t,l=!0,i(`pin ${o}: ${e} ${n} -> ${t}`))}}if(l&&(a.push(o),r)){let t=JSON.stringify(c,null,B(s));s.endsWith(`
|
|
2
2
|
`)&&(t+=`
|
|
3
3
|
`),s.includes(`\r
|
|
4
4
|
`)&&(t=t.replace(/\n/g,`\r
|
|
5
|
-
`)),
|
|
5
|
+
`)),v(b(e,o),t,`utf8`)}}return a}function H(e,t,n,r,i){let a=[];for(let o of j(e,[`Directory.Packages.props`,`:(glob)**/Directory.Packages.props`])){if(N(o))continue;let s=g(b(e,o),`utf8`),c=!1,l=s.replace(/<PackageVersion\b[^>]*>/g,e=>{let r=/\sInclude="([^"]*)"/.exec(e)?.[1],a=/\sVersion="([^"]*)"/.exec(e)?.[1];return r===void 0||a===void 0||!n.nuget.includes(r)||a===t?e:(i(`pin ${o}: ${r} ${a} -> ${t}`),c=!0,e.replace(/(\sVersion=")[^"]*(")/,`$1${t}$2`))});c&&(a.push(o),r&&v(b(e,o),l,`utf8`))}return a}function U(e){let t;try{t=m(b(e,`package.json`)).resolve(`@webority/repo-checks/lockstep.json`)}catch{throw Error(`add @webority/repo-checks at the lockstep version and run again`)}return JSON.parse(g(t,`utf8`))}function W(e,t,n){return C(e,t,{cwd:n.cwd,env:process.env,stdio:`inherit`,windowsHide:!0,shell:process.platform===`win32`})}async function G({root:e,version:t,from:n}){let r=m(b(e,`package.json`)).resolve(`@webority/tokens`);process.env[E]=n;try{return await(await import(S(r).href)).upgrade({root:e,version:t,dryRun:!1})}finally{delete process.env[E]}}async function K({root:e,version:t,dryRun:n,from:r,dir:i,log:a,brandFn:o}){let s=A(i);if(!n&&!s.some(e=>e.version===t))throw Error(`no rename table for ${t}`);let c=s.filter(e=>O(e.version,r)>0&&O(e.version,t)<=0).map(e=>e.table),l=z(e,M(e),c,n,a);return n||await o({root:e}),l}async function q({root:e,version:t,dryRun:n,deps:r,log:i}){let a=b(e,`node_modules`,`@webority`,`tokens`,`package.json`);if(!h(a))throw Error(`@webority/tokens is not installed; add it at the lockstep version and run again`);let o=JSON.parse(g(a,`utf8`)).version,s=U(e),c=[...V(e,t,s,!n,i),...H(e,t,s,!n,i)];if(n){i(`dry run: install skipped; tables are those of the installed ${o}`);let n=R(r.renamesDir??b(e,`node_modules`,`@webority`,`tokens`,`renames`),o,t),a=z(e,M(e),n,!0,i);return{...a,changedFiles:L(c,a.changedFiles)}}let{status:l}=await(r.run??W)(`corepack`,[`pnpm`,`install`],{cwd:e});if(l!==0)throw Error(`pnpm install failed with exit code ${l}`);let u=await(r.reenter??G)({root:e,version:t,dryRun:!1,from:o});return{...u,changedFiles:L(c,u.changedFiles)}}async function J(t,n={}){let r=t.version;D(r);let i=t.root??process.cwd(),a=t.dryRun??!1,o=n.log??console.log,s=()=>n.renamesDir??b(k(),`renames`);if(Array.isArray(t.paths)&&t.paths.length>0){let e=A(s()).filter(e=>e.version===r).map(e=>e.table);if(e.length===0)throw Error(`no rename table for ${r}`);return z(i,M(i,t.paths),e,a,o)}if(!h(b(i,`.webority`,`design.json`)))throw Error(`write .webority/design.json (design-map.md) and run again`);let c=process.env[E];return c?K({root:i,version:r,dryRun:a,from:c,dir:s(),log:o,brandFn:n.brand??e}):q({root:i,version:r,dryRun:a,deps:n,log:o})}export{J as upgrade};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=new Set([`.cshtml`,`.razor`]),t=/(\s*)([^\s=/>"']+)(?:(\s*=\s*)(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/y,n=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),r=e=>{let t=/\.[^./]*$/.exec(e);return t?t[0].toLowerCase():``},i=e=>{let t=[0];for(let n=0;n<e.length;n++)e[n]===`
|
|
2
|
+
`&&t.push(n+1);return t},a=(e,t)=>{let n=0,r=e.length-1;for(;n<r;){let i=n+r+1>>1;e[i]<=t?n=i:r=i-1}return n+1},o=(e,t)=>e<t?-1:+(e>t);function s(e,t){let n=``;for(let r=t;r<e.length;r++){let t=e[r];if(n)t===n&&(n=``);else if(t===`"`||t===`'`)n=t;else if(t===`>`)return r}return-1}function c(e,t){let n=`<${t}`,r=[];for(let t=e.indexOf(n);t!==-1;t=e.indexOf(n,t+1)){let i=t+n.length;if(!/[\s/>]/.test(e[i]??``))continue;let a=s(e,i);a!==-1&&r.push({nameEnd:i,end:a})}return r}function l(e,n,r){let i=[],a=n;for(;;){t.lastIndex=a;let n=t.exec(e);if(n===null||n.index+n[0].length>r)break;let o=n.index+n[1].length,s={name:n[2],nameStart:o,nameEnd:o+n[2].length,kind:`none`};if(n[4]!==void 0||n[5]!==void 0){let e=n[4]??n[5],t=n.index+n[0].length-1;s.kind=`quoted`,s.value=e,s.valueStart=t-e.length,s.valueEnd=t,s.attrEnd=n.index+n[0].length}else n[6]===void 0?s.attrEnd=s.nameEnd:(s.kind=`bare`,s.attrEnd=n.index+n[0].length);s.wsStart=n.index,i.push(s),a=n.index+n[0].length}return i}function u(e,t,r,i){let o=[],s=[],u=[],d=e=>Object.hasOwn(t.renameAttributes,e)?t.renameAttributes[e]:e,f=t.from!==t.to;for(let{nameEnd:n,end:p}of c(e,t.from)){let c=a(r,n),m=e.slice(n,p).trimEnd().endsWith(`/`),h=l(e,n,p);for(let[e,n]of Object.entries(t.removeAttributes))h.some(t=>t.name===e)&&u.push({file:i,line:c,path:`<${t.from}> ${e}`,message:n});let g=[];for(let e of h){let t=d(e.name);t!==e.name&&(o.push({start:e.nameStart,end:e.nameEnd,text:t}),s.push({line:a(r,e.nameStart),from:e.name,to:t}))}let _=h.map(e=>d(e.name));for(let e of h){let n=d(e.name);if(e.kind!==`quoted`||!Object.hasOwn(t.valueMaps,n)||!Object.hasOwn(t.valueMaps[n],e.value))continue;let i=t.valueMaps[n][e.value];o.push({start:e.valueStart,end:e.valueEnd,text:i}),s.push({line:a(r,e.valueStart),from:`${n}="${e.value}"`,to:`${n}="${i}"`})}for(let[e,n]of Object.entries(t.addAttributes))_.includes(e)||g.push(` ${e}="${n}"`);g.length>0&&o.push({start:n,end:n,text:g.join(``)}),(f||g.length>0)&&s.push({line:c,from:`<${t.from}`,to:`<${t.to}${g.join(``)}`}),f&&o.push({start:n-t.from.length,end:n,text:t.to});let v=t.attributeToContent===void 0?void 0:h.find(e=>e.name===t.attributeToContent);if(v===void 0)continue;if(v.kind!==`quoted`){u.push({file:i,line:c,path:`<${t.from}> ${v.name}`,message:`${v.name} must hold a value that becomes the element content; set it by hand`});continue}if(o.push({start:v.wsStart,end:v.attrEnd,text:``}),s.push({line:c,from:`${v.name}="${v.value}"`,to:`element content`}),m){let n=e.lastIndexOf(`/`,p);for(;/\s/.test(e[n-1]??``);)n--;o.push({start:n,end:p+1,text:`>${v.value}</${t.to}>`});continue}let y=e.indexOf(`</${t.from}`,p+1);if(y===-1)throw Error(`no closing </${t.from}> for the element at ${i}:${c}`);if(e.slice(p+1,y).trim()!==``){u.push({file:i,line:c,path:`<${t.from}> ${v.name}`,message:`the element already has content; move ${v.name} into it by hand`}),o.pop(),s.pop();continue}o.push({start:p+1,end:y,text:v.value})}if(f)for(let i of e.matchAll(RegExp(`</${n(t.from)}(?=\\s*>)`,`g`))){let e=i.index+2;o.push({start:e,end:e+t.from.length,text:t.to}),s.push({line:a(r,e),from:`</${t.from}`,to:`</${t.to}`})}return{edits:o,hits:s,findings:u}}function d(e,t,n){let{edits:r,hits:a,findings:o}=u(e,n,i(e),t);r.sort((e,t)=>t.start-e.start||t.end-e.end);let s=e;for(let e of r)s=s.slice(0,e.start)+e.text+s.slice(e.end);return{text:s,hits:a,findings:o}}function f(t,n,i){if(i.length===0||!e.has(r(n)))return{text:t,hits:[],findings:[]};let a=t,s=[],c=[];for(let e of i){let t=d(a,n,e);a=t.text,s.push(...t.hits),c.push(...t.findings)}return s.sort((e,t)=>e.line-t.line||o(e.from,t.from)),c.sort((e,t)=>e.line-t.line||o(e.path,t.path)),{text:a,hits:s,findings:c}}export{f as applyRazorTags};
|
package/dist/upgrade/source.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import e from"node:path";var t=new Set([`.js`,`.jsx`,`.mjs`,`.cjs`,`.ts`,`.tsx`,`.mts`,`.cts`]),n=`["'\`]`,
|
|
2
|
-
`&&t.push(n+1);return t},
|
|
3
|
-
`),r=[];for(let e of t){let t=new RegExp(e.pattern);for(let i=0;i<n.length;i++){let a=t.exec(n[i]);a!==null&&r.push({line:i+1,path:a[0],message:e.hint})}}return r};function
|
|
1
|
+
import e from"node:path";var t=new Set([`.js`,`.jsx`,`.mjs`,`.cjs`,`.ts`,`.tsx`,`.mts`,`.cts`]),n=new Set([`.cshtml`,`.razor`,`.html`]),r=`["'\`]`,i=`[A-Za-z_$][\\w$]*`,a=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),o=e=>[...e].sort((e,t)=>t.length-e.length).map(a).join(`|`),s=e=>{let t=[0];for(let n=0;n<e.length;n++)e[n]===`
|
|
2
|
+
`&&t.push(n+1);return t},c=(e,t)=>{let n=0,r=e.length-1;for(;n<r;){let i=n+r+1>>1;e[i]<=t?n=i:r=i-1}return n+1},l=(e,t)=>e<t?-1:+(e>t),u=(e,t,n)=>{if(t.length===0)return e;let i=new Map(t),a=RegExp(`(${r})(${o(i.keys())})\\1`,`g`),l=s(e);return e.replace(a,(e,t,r,a)=>{let o=i.get(r);return n.push({line:c(l,a),from:r,to:o}),`${t}${o}${t}`})},d=(e,t,n)=>{let r=e;for(let e of t){let t=e.receiver===void 0?void 0:RegExp(`^(?:${e.receiver})$`),o=RegExp(`(${i})(\\?\\.|\\.)${a(e.from)}(?![\\w$])`,`g`),l=s(r);r=r.replace(o,(r,i,a,o)=>t!==void 0&&!t.test(i)?r:(n.push({line:c(l,o),from:`${i}${a}${e.from}`,to:`${i}${a}${e.to}`}),`${i}${a}${e.to}`))}return r},f=(e,t)=>{let n=e.split(`
|
|
3
|
+
`),r=[];for(let e of t){let t=new RegExp(e.pattern);for(let i=0;i<n.length;i++){let a=t.exec(n[i]);a!==null&&r.push({line:i+1,path:a[0],message:e.hint})}}return r};function p(n,r,i){if(i===void 0||!t.has(e.extname(r).toLowerCase()))return{text:n,hits:[],findings:[]};let a=[],o=d(u(n,i.literals,a),i.members,a),s=f(o,i.flags);return a.sort((e,t)=>e.line-t.line||l(e.from,t.from)),s.sort((e,t)=>e.line-t.line||l(e.path,t.path)),{text:o,hits:a,findings:s}}function m(t,r,i){if(i===void 0||!n.has(e.extname(r).toLowerCase()))return{text:t,hits:[],findings:[]};let a=[],o=u(t,i.literals,a),s=f(o,i.flags);return a.sort((e,t)=>e.line-t.line||l(e.from,t.from)),s.sort((e,t)=>e.line-t.line||l(e.path,t.path)),{text:o,hits:a,findings:s}}export{t as SOURCE_EXTENSIONS,m as applyMarkup,p as applySource};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority/tokens",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.108.0",
|
|
4
4
|
"description": "The Webority design tokens in one W3C Design Tokens source (palette, scale, meaning and component tiers, with light and dark, web and phone, and 390 and 1440 widths), and the webority command that brands a product, upgrades it between releases and checks it against the token source.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "module",
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.108.0",
|
|
3
|
+
"css": { "rename": [], "reads": [], "choose": {}, "checkRole": [] },
|
|
4
|
+
"themeReads": [],
|
|
5
|
+
"props": [],
|
|
6
|
+
"componentProps": [],
|
|
7
|
+
"propValues": [],
|
|
8
|
+
"propSplits": [],
|
|
9
|
+
"razorAttributes": [],
|
|
10
|
+
"components": [
|
|
11
|
+
{
|
|
12
|
+
"package": "@webority/ui-react",
|
|
13
|
+
"from": "AppSelectMini",
|
|
14
|
+
"to": "AppSelect",
|
|
15
|
+
"addProps": { "compact": true },
|
|
16
|
+
"renameProps": { "prefix": "valuePrefix", "ariaLabel": "aria-label" },
|
|
17
|
+
"valueMaps": {},
|
|
18
|
+
"removeProps": {}
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"package": "@webority/ui-react",
|
|
22
|
+
"from": "AppInfoList",
|
|
23
|
+
"to": "AppDescriptions",
|
|
24
|
+
"addProps": { "layout": "list", "columns": 1 },
|
|
25
|
+
"renameProps": {},
|
|
26
|
+
"valueMaps": {},
|
|
27
|
+
"removeProps": {}
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"package": "@webority/ui-react",
|
|
31
|
+
"from": "AppLogoPicker",
|
|
32
|
+
"to": "AppImagePicker",
|
|
33
|
+
"addProps": {},
|
|
34
|
+
"renameProps": {},
|
|
35
|
+
"valueMaps": {},
|
|
36
|
+
"removeProps": {}
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"package": "@webority/ui-react",
|
|
40
|
+
"from": "AppAvatarPicker",
|
|
41
|
+
"to": "AppImagePicker",
|
|
42
|
+
"addProps": { "kind": "avatar" },
|
|
43
|
+
"renameProps": { "initials": "fallback" },
|
|
44
|
+
"valueMaps": {},
|
|
45
|
+
"removeProps": {}
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"package": "@webority/ui-react",
|
|
49
|
+
"from": "AppPagination",
|
|
50
|
+
"to": "AppTablePagination",
|
|
51
|
+
"addProps": { "variant": "standalone" },
|
|
52
|
+
"renameProps": { "onChange": "onPageChange" },
|
|
53
|
+
"valueMaps": {},
|
|
54
|
+
"removeProps": {}
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"package": "@webority/ui-react",
|
|
58
|
+
"from": "AppSidebarMenu",
|
|
59
|
+
"to": "AppDrawer",
|
|
60
|
+
"addProps": { "sheet": false, "width": "420px" },
|
|
61
|
+
"renameProps": { "show": "open", "onHide": "onClose", "onEntered": "onOpened", "onExited": "onClosed" },
|
|
62
|
+
"valueMaps": { "side": { "right": "end", "left": "start" } },
|
|
63
|
+
"removeProps": {
|
|
64
|
+
"backdrop": "removed: AppDrawer always draws its backdrop; use staticBackdrop to stop a click closing it",
|
|
65
|
+
"scroll": "removed: the page behind a drawer never scrolls",
|
|
66
|
+
"keyboard": "removed: Escape always closes; set dismissible={false} for a drawer only an action closes",
|
|
67
|
+
"responsive": "removed: no inline mode; render the content in the page at that width instead",
|
|
68
|
+
"closeButton": "removed: set dismissible={false}"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"package": "@webority/ui-react",
|
|
73
|
+
"from": "AppTableEmptyState",
|
|
74
|
+
"to": "AppEmptyState",
|
|
75
|
+
"addProps": { "variant": "table" },
|
|
76
|
+
"renameProps": {},
|
|
77
|
+
"valueMaps": {},
|
|
78
|
+
"removeProps": {}
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"package": "@webority/ui-react",
|
|
82
|
+
"from": "AppStepper",
|
|
83
|
+
"to": "AppStepper",
|
|
84
|
+
"addProps": {},
|
|
85
|
+
"renameProps": { "activeStep": "active" },
|
|
86
|
+
"valueMaps": {},
|
|
87
|
+
"removeProps": {}
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
"razorTags": [
|
|
91
|
+
{
|
|
92
|
+
"from": "app-select-mini",
|
|
93
|
+
"to": "app-select",
|
|
94
|
+
"addAttributes": { "compact": "true" },
|
|
95
|
+
"renameAttributes": { "prefix": "value-prefix" },
|
|
96
|
+
"valueMaps": {},
|
|
97
|
+
"removeAttributes": {}
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"from": "app-info-list",
|
|
101
|
+
"to": "app-descriptions",
|
|
102
|
+
"addAttributes": { "layout": "list", "columns": "1" },
|
|
103
|
+
"renameAttributes": {},
|
|
104
|
+
"valueMaps": {},
|
|
105
|
+
"removeAttributes": {}
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"from": "app-info-row",
|
|
109
|
+
"to": "app-description",
|
|
110
|
+
"addAttributes": {},
|
|
111
|
+
"renameAttributes": {},
|
|
112
|
+
"valueMaps": {},
|
|
113
|
+
"removeAttributes": {},
|
|
114
|
+
"attributeToContent": "value"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"from": "app-logo-picker",
|
|
118
|
+
"to": "app-image-picker",
|
|
119
|
+
"addAttributes": {},
|
|
120
|
+
"renameAttributes": {},
|
|
121
|
+
"valueMaps": {},
|
|
122
|
+
"removeAttributes": {}
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"from": "app-avatar-picker",
|
|
126
|
+
"to": "app-image-picker",
|
|
127
|
+
"addAttributes": { "kind": "avatar" },
|
|
128
|
+
"renameAttributes": { "initials": "fallback" },
|
|
129
|
+
"valueMaps": {},
|
|
130
|
+
"removeAttributes": {}
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"from": "app-pagination",
|
|
134
|
+
"to": "app-table-pagination",
|
|
135
|
+
"addAttributes": { "variant": "standalone" },
|
|
136
|
+
"renameAttributes": {},
|
|
137
|
+
"valueMaps": {},
|
|
138
|
+
"removeAttributes": {}
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"from": "app-table-pagination",
|
|
142
|
+
"to": "app-table-pagination",
|
|
143
|
+
"addAttributes": {},
|
|
144
|
+
"renameAttributes": {},
|
|
145
|
+
"valueMaps": {},
|
|
146
|
+
"removeAttributes": {
|
|
147
|
+
"base-href": "removed: pass href-template=\"@Model.Query.PageHrefTemplate(path)\" (it carries {page} and {pageSize})",
|
|
148
|
+
"page-param": "removed: write the parameter name into href-template",
|
|
149
|
+
"page-size-param": "removed: write the parameter name into href-template"
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"from": "app-sidebar-menu",
|
|
154
|
+
"to": "app-drawer",
|
|
155
|
+
"addAttributes": { "sheet": "false", "width": "420px" },
|
|
156
|
+
"renameAttributes": {},
|
|
157
|
+
"valueMaps": { "side": { "right": "end", "left": "start" } },
|
|
158
|
+
"removeAttributes": {
|
|
159
|
+
"backdrop": "removed: use static-backdrop",
|
|
160
|
+
"scroll": "removed",
|
|
161
|
+
"keyboard": "removed: use dismissible=\"false\"",
|
|
162
|
+
"responsive": "removed",
|
|
163
|
+
"close-button": "removed: use dismissible=\"false\""
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"from": "app-sidebar-header",
|
|
168
|
+
"to": "app-drawer-header",
|
|
169
|
+
"addAttributes": {},
|
|
170
|
+
"renameAttributes": {},
|
|
171
|
+
"valueMaps": {},
|
|
172
|
+
"removeAttributes": {}
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"from": "app-sidebar-footer",
|
|
176
|
+
"to": "app-drawer-footer",
|
|
177
|
+
"addAttributes": {},
|
|
178
|
+
"renameAttributes": {},
|
|
179
|
+
"valueMaps": {},
|
|
180
|
+
"removeAttributes": {}
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"from": "app-table-empty-state",
|
|
184
|
+
"to": "app-empty-state",
|
|
185
|
+
"addAttributes": { "variant": "table" },
|
|
186
|
+
"renameAttributes": {},
|
|
187
|
+
"valueMaps": {},
|
|
188
|
+
"removeAttributes": {}
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"from": "app-stepper",
|
|
192
|
+
"to": "app-stepper",
|
|
193
|
+
"addAttributes": {},
|
|
194
|
+
"renameAttributes": { "active-step": "active" },
|
|
195
|
+
"valueMaps": {},
|
|
196
|
+
"removeAttributes": {}
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"from": "app-compare-row",
|
|
200
|
+
"to": "app-compare-row",
|
|
201
|
+
"addAttributes": {},
|
|
202
|
+
"renameAttributes": {},
|
|
203
|
+
"valueMaps": {},
|
|
204
|
+
"removeAttributes": { "values": "removed: write one <app-compare-cell> child per value, in column order" }
|
|
205
|
+
}
|
|
206
|
+
],
|
|
207
|
+
"classes": [
|
|
208
|
+
["faq-list", "wui-accordion"],
|
|
209
|
+
["faq-item", "wui-accordion-item"],
|
|
210
|
+
["faq-q", "wui-accordion-trigger"],
|
|
211
|
+
["faq-q-icon", "wui-accordion-icon"],
|
|
212
|
+
["faq-a-wrap", "wui-accordion-panel"],
|
|
213
|
+
["faq-a-inner", "wui-accordion-body"],
|
|
214
|
+
["set-uploader", "wui-image-picker"],
|
|
215
|
+
["set-uploader-field", "wui-image-picker-field"],
|
|
216
|
+
["set-uploader-field--inline", "wui-image-picker-field-inline"],
|
|
217
|
+
["set-uploader-field--profile", "wui-image-picker-field-profile"],
|
|
218
|
+
["set-uploader--avatar", "wui-image-picker-avatar"],
|
|
219
|
+
["set-uploader--rounded", "wui-image-picker-rounded"],
|
|
220
|
+
["set-uploader--square", "wui-image-picker-square"],
|
|
221
|
+
["set-uploader-ring", "wui-image-picker-ring"],
|
|
222
|
+
["set-uploader-img", "wui-image-picker-img"],
|
|
223
|
+
["set-uploader-logo", "wui-image-picker-logo"],
|
|
224
|
+
["set-uploader-overlay", "wui-image-picker-overlay"],
|
|
225
|
+
["set-uploader-remove", "wui-image-picker-remove"],
|
|
226
|
+
["set-uploader-meta", "wui-image-picker-meta"],
|
|
227
|
+
["set-uploader-hint", "wui-image-picker-hint"],
|
|
228
|
+
["set-uploader-title", "wui-image-picker-title"],
|
|
229
|
+
["set-uploader-subtitle", "wui-image-picker-subtitle"],
|
|
230
|
+
["set-uploader-row", "wui-image-picker-row"],
|
|
231
|
+
["set-uploader-shell", "wui-image-picker-shell"],
|
|
232
|
+
["wui-avatar-picker", "wui-image-picker-buttons"],
|
|
233
|
+
["wui-avatar-picker-actions", "wui-image-picker-buttons-actions"],
|
|
234
|
+
["wui-avatar-picker-badge", "wui-image-picker-buttons-badge"],
|
|
235
|
+
["wui-avatar-picker-camera", "wui-image-picker-buttons-camera"],
|
|
236
|
+
["wui-avatar-picker-face", "wui-image-picker-buttons-face"],
|
|
237
|
+
["wui-avatar-picker-img", "wui-image-picker-buttons-img"],
|
|
238
|
+
["wui-avatar-picker-placeholder", "wui-image-picker-buttons-placeholder"],
|
|
239
|
+
["tbl-empty", "wui-empty-state-table"]
|
|
240
|
+
],
|
|
241
|
+
"markup": {
|
|
242
|
+
"literals": [
|
|
243
|
+
["wui:avatar-picker:change", "wui:image-picker:change"],
|
|
244
|
+
["wui:avatar-picker:remove", "wui:image-picker:remove"],
|
|
245
|
+
["data-app-logo-remove", "data-wui-image-picker-remove"],
|
|
246
|
+
["[data-app-logo-remove]", "[data-wui-image-picker-remove]"]
|
|
247
|
+
],
|
|
248
|
+
"flags": [
|
|
249
|
+
{
|
|
250
|
+
"pattern": "data-bs-toggle=\"offcanvas\"|data-bs-dismiss=\"offcanvas\"",
|
|
251
|
+
"hint": "the side panel is <app-drawer>: open it with data-wui-drawer-open=\"#id\", close with data-wui-drawer-close"
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"pattern": "<app-menubar",
|
|
255
|
+
"hint": "removed in 0.108.0 with no successor: use <app-navigation-menu> for site navigation or <app-dropdown> for a menu"
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"pattern": "class=\"[^\"]*\\b(info-row|info-value|info-list|info-icon|info-key|info-meta)\\b",
|
|
259
|
+
"hint": "the info list is <app-descriptions layout=\"list\">: rows are .descs-item, values .descs-value"
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"pattern": "\\btbl-empty-(icon|title|text|action)\\b",
|
|
263
|
+
"hint": "inside the table empty state use .empty-state-icon, -title, -message, -action under .wui-empty-state-table"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"pattern": "\\b(pagination-nav|page-ellipsis)\\b",
|
|
267
|
+
"hint": "the standalone pager is .table-pagination.wui-table-pagination-standalone"
|
|
268
|
+
}
|
|
269
|
+
]
|
|
270
|
+
},
|
|
271
|
+
"source": {
|
|
272
|
+
"literals": [
|
|
273
|
+
["wui:avatar-picker:change", "wui:image-picker:change"],
|
|
274
|
+
["wui:avatar-picker:remove", "wui:image-picker:remove"],
|
|
275
|
+
["data-app-logo-remove", "data-wui-image-picker-remove"],
|
|
276
|
+
["[data-app-logo-remove]", "[data-wui-image-picker-remove]"]
|
|
277
|
+
],
|
|
278
|
+
"members": [],
|
|
279
|
+
"flags": [
|
|
280
|
+
{
|
|
281
|
+
"pattern": "\\b(AppSelectMini|AppInfoList|AppLogoPicker|AppAvatarPicker|AppPagination|AppSidebarMenu|AppTableEmptyState|AppMenubar)\\b",
|
|
282
|
+
"hint": "a 0.108.0 removed name outside an import or a JSX tag (a list, a string, a doc): use its successor from the 0.108.0 CHANGELOG Breaking section"
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"pattern": "hidden\\.bs\\.offcanvas|shown\\.bs\\.offcanvas|bootstrap\\.Offcanvas",
|
|
286
|
+
"hint": "the drawer element raises wui-drawer-opened and wui-drawer-closed; it has no Bootstrap Offcanvas API"
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
"pattern": "\\.info-(row|value|list|icon|key|meta)\\b",
|
|
290
|
+
"hint": "the info list is AppDescriptions layout=\"list\": rows are .descs-item, values .descs-value"
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
"pattern": "\\btbl-empty-(icon|title|text|action)\\b",
|
|
294
|
+
"hint": "inside the table empty state use .empty-state-icon, -title, -message, -action under .wui-empty-state-table"
|
|
295
|
+
},
|
|
296
|
+
{ "pattern": "side=\\{?[\"'](top|bottom)[\"']", "hint": "AppDrawer opens from start or end only" }
|
|
297
|
+
]
|
|
298
|
+
}
|
|
299
|
+
}
|
package/renames/renames.d.ts
CHANGED
|
@@ -55,6 +55,42 @@ export interface ComponentPropRule {
|
|
|
55
55
|
flag?: string;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
/** A React component a release merged into another or renamed: an import of `from` from `package` becomes `to` (merged into an existing import of `to` when one is there), and each `<from>` element becomes `<to>`. */
|
|
59
|
+
export interface ComponentRule {
|
|
60
|
+
package: string;
|
|
61
|
+
from: string;
|
|
62
|
+
to: string;
|
|
63
|
+
/** Written on each converted element that does not carry the prop: a string as a quoted attribute, a boolean or number in braces. */
|
|
64
|
+
addProps: Readonly<Record<string, string | number | boolean>>;
|
|
65
|
+
/** Prop names renamed on the converted element. */
|
|
66
|
+
renameProps: Readonly<Record<string, string>>;
|
|
67
|
+
/** Quoted string values rewritten per prop (new prop name), after renameProps. */
|
|
68
|
+
valueMaps: Readonly<Record<string, Readonly<Record<string, string>>>>;
|
|
69
|
+
/** Props the target does not take: left in place and reported with the hint. */
|
|
70
|
+
removeProps: Readonly<Record<string, string>>;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** A Razor tag a release merged or renamed: `<from` and `</from>` become `<to` and `</to>`. `from` equal to `to` changes attributes only. */
|
|
74
|
+
export interface RazorTagRule {
|
|
75
|
+
from: string;
|
|
76
|
+
to: string;
|
|
77
|
+
addAttributes: Readonly<Record<string, string>>;
|
|
78
|
+
renameAttributes: Readonly<Record<string, string>>;
|
|
79
|
+
valueMaps: Readonly<Record<string, Readonly<Record<string, string>>>>;
|
|
80
|
+
removeAttributes: Readonly<Record<string, string>>;
|
|
81
|
+
/** An attribute whose value becomes the element's content; a self-closing element gets a closing tag. */
|
|
82
|
+
attributeToContent?: string;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** A theme class renamed: the whole class token, in style selectors, class and className values, and string literals of script files. */
|
|
86
|
+
export type ClassRename = [from: string, to: string];
|
|
87
|
+
|
|
88
|
+
/** Razor and HTML text a release changed (.cshtml, .razor, .html). */
|
|
89
|
+
export interface MarkupRules {
|
|
90
|
+
literals: [string, string][];
|
|
91
|
+
flags: { pattern: string; hint: string }[];
|
|
92
|
+
}
|
|
93
|
+
|
|
58
94
|
export interface RenameTable {
|
|
59
95
|
version: string;
|
|
60
96
|
css: { rename: [string, string][]; reads: [string, string][]; choose: Record<string, string>; checkRole: string[] };
|
|
@@ -65,4 +101,8 @@ export interface RenameTable {
|
|
|
65
101
|
propSplits: PropSplitRule[];
|
|
66
102
|
razorAttributes: RazorAttributeRule[];
|
|
67
103
|
source?: SourceRules;
|
|
104
|
+
components?: ComponentRule[];
|
|
105
|
+
razorTags?: RazorTagRule[];
|
|
106
|
+
classes?: ClassRename[];
|
|
107
|
+
markup?: MarkupRules;
|
|
68
108
|
}
|