Skip to content

Commit

Permalink
Merge branch 'release' into chore-mdx
Browse files Browse the repository at this point in the history
  • Loading branch information
pointhalo authored Jul 10, 2024
2 parents 12b16e7 + cb69dfb commit 2a075a3
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 25 deletions.
22 changes: 21 additions & 1 deletion gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,9 @@ exports.onPostBuild = async () => {

(()=>{
const jsFiles = glob.sync(`${publicPath}/*.js`);

const mapFiles = glob.sync(`${publicPath}/*.map`);
const replaceNames = {};

for (let file of jsFiles) {
const filename = path.basename(file);
const fileNameWithoutExt = filename.split('.')[0];
Expand All @@ -392,6 +393,25 @@ exports.onPostBuild = async () => {
fs.renameSync(file, path.join(path.dirname(file), finalFileName));
}
}

for (let file of mapFiles) {
const filename = path.basename(file);
const fileNameWithoutExt = filename.split('.')[0];
const originHash = fileNameWithoutExt.split('-').at(-1);

if (originHash && originHash!==fileNameWithoutExt) {
let fileNameWithoutExtWithHash = fileNameWithoutExt.replace(originHash, `${originHash}${numHash}`);
replaceNames[originHash] = `${originHash}${numHash}`;
fs.renameSync(file, path.join(path.dirname(file), `${fileNameWithoutExtWithHash}.js.map`));
} else {
let finalFileName = `${fileNameWithoutExt}${numHash}.js.map`;
replaceNames[filename] = finalFileName;
fs.renameSync(file, path.join(path.dirname(file), finalFileName));
}
}



const allFiles = glob.sync(`${publicPath}/**/*.{js,html,json}`);
for (let file of allFiles) {
const stats = fs.statSync(file);
Expand Down
64 changes: 41 additions & 23 deletions packages/semi-ui/pincode/_story/pincode.stories.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,52 @@
import React,{useState} from 'react';
import React, { useState, useRef } from 'react';
import PinCode from '../index';

export default {
title: 'PinCode'
}
title: 'PinCode',
};

export const PinCodeBasic = () => (
<>
<PinCode size={'small'} onComplete={v=>alert(v)} onChange={v=>{
console.log(v)
}}/>
<PinCode size={'default'} onComplete={v=>alert(v)} onChange={v=>{
console.log(v)
}}/>
<PinCode size={'large'} onComplete={v=>alert(v)} onChange={v=>{
console.log(v)
}}/>
<PinCode
size={'small'}
onComplete={v => alert(v)}
onChange={v => {
console.log(v);
}}
/>
<PinCode
size={'default'}
onComplete={v => alert(v)}
onChange={v => {
console.log(v);
}}
/>
<PinCode
size={'large'}
onComplete={v => alert(v)}
onChange={v => {
console.log(v);
}}
/>
</>
);

export const PinCodeControl = () => {
const [value,setValue] = useState("123");
const [value, setValue] = useState('123');
const ref = useRef();
return <>
<button onClick={()=>ref.current.focus(2)}>focus third</button>
<PinCode format={"mixed"} ref={ref}
onComplete={value=>console.log("pincode: ",value)}
value={value} onChange={v=>{
console.log(v)
setValue(v)
}}/>
</>
}
return (
<>
<button onClick={() => ref.current.focus(2)}>focus third</button>
<PinCode
format={'mixed'}
ref={ref}
onComplete={value => console.log('pincode: ', value)}
value={value}
onChange={v => {
console.log(v);
setValue(v);
}}
/>
</>
);
};
2 changes: 1 addition & 1 deletion src/components/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ const AppLayout = ({ type, location, children }) => {
<IntlProvider locale={locale} messages={messages}>
<LocaleProvider locale={semiLocaleSource}>
{
!isIde && (<div style={{ position: 'fixed', width: '100%', top: 0, zIndex: 999 }}>
!isIde && (<div style={{ position: 'fixed', width: '100%', top: 0, zIndex: 1001 }}>
<div className="skip-to-content">
<div>{locale === "zh-CN" ? '跳转到:' : 'skip to:'}</div>
<ol>
Expand Down

0 comments on commit 2a075a3

Please sign in to comment.