├── .circleci └── config.yml ├── .editorconfig ├── .eslintrc.js ├── .gitattributes ├── .gitignore ├── .npmignore ├── .yarn ├── plugins │ └── @yarnpkg │ │ ├── plugin-interactive-tools.cjs │ │ └── plugin-workspace-tools.cjs └── releases │ └── yarn-3.6.1.cjs ├── .yarnrc.yml ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── babel.config.js ├── example ├── App.js ├── app.json ├── assets │ ├── adaptive-icon.png │ ├── favicon.png │ ├── icon.png │ └── splash.png ├── babel.config.js ├── metro.config.js ├── package.json ├── src │ └── App.tsx └── tsconfig.json ├── lefthook.yml ├── package.json ├── src ├── CarouselDots │ ├── Dot │ │ ├── index.tsx │ │ └── utils.ts │ ├── InvisibleFiller │ │ ├── index.tsx │ │ └── styles.ts │ ├── index.tsx │ ├── interface.ts │ ├── styles.ts │ └── use-previous.ts └── index.tsx ├── tsconfig.build.json ├── tsconfig.json └── yarn.lock /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2.1 2 | 3 | executors: 4 | default: 5 | docker: 6 | - image: circleci/node:10 7 | working_directory: ~/project 8 | 9 | commands: 10 | attach_project: 11 | steps: 12 | - attach_workspace: 13 | at: ~/project 14 | 15 | jobs: 16 | install-dependencies: 17 | executor: default 18 | steps: 19 | - checkout 20 | - attach_project 21 | - restore_cache: 22 | keys: 23 | - dependencies-{{ checksum "package.json" }} 24 | - dependencies- 25 | - restore_cache: 26 | keys: 27 | - dependencies-example-{{ checksum "example/package.json" }} 28 | - dependencies-example- 29 | - run: 30 | name: Install dependencies 31 | command: | 32 | yarn install --cwd example --frozen-lockfile 33 | yarn install --frozen-lockfile 34 | - save_cache: 35 | key: dependencies-{{ checksum "package.json" }} 36 | paths: node_modules 37 | - save_cache: 38 | key: dependencies-example-{{ checksum "example/package.json" }} 39 | paths: example/node_modules 40 | - persist_to_workspace: 41 | root: . 42 | paths: . 43 | 44 | lint: 45 | executor: default 46 | steps: 47 | - attach_project 48 | - run: 49 | name: Lint files 50 | command: | 51 | yarn lint 52 | 53 | typescript: 54 | executor: default 55 | steps: 56 | - attach_project 57 | - run: 58 | name: Typecheck files 59 | command: | 60 | yarn typescript 61 | 62 | unit-tests: 63 | executor: default 64 | steps: 65 | - attach_project 66 | - run: 67 | name: Run unit tests 68 | command: | 69 | yarn test --coverage 70 | - store_artifacts: 71 | path: coverage 72 | destination: coverage 73 | 74 | build-package: 75 | executor: default 76 | steps: 77 | - attach_project 78 | - run: 79 | name: Build package 80 | command: | 81 | yarn prepare 82 | 83 | workflows: 84 | build-and-test: 85 | jobs: 86 | - install-dependencies 87 | - lint: 88 | requires: 89 | - install-dependencies 90 | - typescript: 91 | requires: 92 | - install-dependencies 93 | - unit-tests: 94 | requires: 95 | - install-dependencies 96 | - build-package: 97 | requires: 98 | - install-dependencies 99 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | [*] 8 | 9 | indent_style = space 10 | indent_size = 2 11 | 12 | end_of_line = lf 13 | charset = utf-8 14 | trim_trailing_whitespace = true 15 | insert_final_newline = true 16 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | plugins: ['jest', '@typescript-eslint', 'import'], 4 | extends: [ 5 | '@react-native', 6 | 'eslint:recommended', 7 | 'plugin:@typescript-eslint/eslint-recommended', 8 | 'plugin:@typescript-eslint/recommended', 9 | 'plugin:import/recommended', 10 | 'plugin:import/typescript', 11 | ], 12 | rules: { 13 | '@typescript-eslint/no-explicit-any': 'warn', 14 | 'react/react-in-jsx-scope': 'off', 15 | // TODO: Change to 'error' when we fix the warnings 16 | '@typescript-eslint/no-magic-numbers': 'off', 17 | 'import/no-duplicates': 'error', 18 | '@typescript-eslint/no-unused-vars': 'error', 19 | '@typescript-eslint/no-shadow': 'error', 20 | '@typescript-eslint/no-non-null-assertion': 'off', 21 | '@typescript-eslint/no-var-requires': 'off', 22 | 'no-console': 'error', 23 | 'comma-dangle': 'off', 24 | 'no-shadow': 'off', 25 | 'max-params': ['error', 3], 26 | 'react-native/no-color-literals': 'off', 27 | 'react-native/no-inline-styles': 'off', 28 | 'require-await': 'error', 29 | 'no-bitwise': 'off', 30 | 'import/no-named-as-default': 'error', 31 | 'import/no-unresolved': 'off', 32 | 'import/order': [ 33 | 'error', 34 | { 35 | 'alphabetize': { order: 'ignore', caseInsensitive: true }, 36 | 'groups': [ 37 | ['builtin', 'external', 'type', 'internal'], 38 | 'parent', 39 | ['sibling', 'index'], 40 | ], 41 | 'distinctGroup': false, 42 | 'pathGroupsExcludedImportTypes': ['builtin'], 43 | 'newlines-between': 'always', 44 | }, 45 | ], 46 | }, 47 | overrides: [ 48 | { 49 | files: ['*.js', '*.jsx'], 50 | parser: '@babel/eslint-parser', 51 | }, 52 | { 53 | files: ['*.ts', '*.tsx'], 54 | parser: '@typescript-eslint/parser', 55 | }, 56 | { 57 | files: ['app/**/styles.js', 'app/**/styles.ts'], 58 | rules: { 59 | 'react-native/sort-styles': [ 60 | 'error', 61 | 'asc', 62 | { ignoreClassNames: true }, 63 | ], 64 | '@typescript-eslint/no-magic-numbers': 'off', 65 | }, 66 | }, 67 | ], 68 | settings: { 69 | 'import/ignore': ['node_modules'], 70 | 'import/resolver': { 71 | node: { 72 | paths: ['app'], 73 | settings: { 74 | 'import/resolver': { 75 | node: { 76 | paths: ['app'], 77 | extensions: [ 78 | '.ios.js', 79 | '.android.js', 80 | '.ts', 81 | '.tsx', 82 | '.js', 83 | '.jsx', 84 | '.json', 85 | ], 86 | }, 87 | }, 88 | }, 89 | }, 90 | }, 91 | }, 92 | }; 93 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | # specific for windows script files 3 | *.bat text eol=crlf -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # XDE 6 | .expo/ 7 | 8 | # VSCode 9 | .vscode/ 10 | jsconfig.json 11 | 12 | # Xcode 13 | # 14 | build/ 15 | *.pbxuser 16 | !default.pbxuser 17 | *.mode1v3 18 | !default.mode1v3 19 | *.mode2v3 20 | !default.mode2v3 21 | *.perspectivev3 22 | !default.perspectivev3 23 | xcuserdata 24 | *.xccheckout 25 | *.moved-aside 26 | DerivedData 27 | *.hmap 28 | *.ipa 29 | *.xcuserstate 30 | project.xcworkspace 31 | 32 | # Android/IJ 33 | # 34 | .idea 35 | .gradle 36 | local.properties 37 | android.iml 38 | 39 | # Cocoapods 40 | # 41 | example/ios/Pods 42 | 43 | # node.js 44 | # 45 | node_modules/ 46 | npm-debug.log 47 | yarn-debug.log 48 | yarn-error.log 49 | 50 | # Yarn 51 | .yarn/* 52 | !.yarn/patches 53 | !.yarn/plugins 54 | !.yarn/releases 55 | !.yarn/sdks 56 | !.yarn/versions 57 | 58 | # BUCK 59 | buck-out/ 60 | \.buckd/ 61 | android/app/libs 62 | android/keystores/debug.keystore 63 | 64 | # Expo 65 | .expo/* 66 | 67 | # generated by bob 68 | lib/ 69 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | lib 2 | node_modules 3 | example 4 | android 5 | ios 6 | *.log -------------------------------------------------------------------------------- /.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | //prettier-ignore 3 | module.exports = { 4 | name: "@yarnpkg/plugin-workspace-tools", 5 | factory: function (require) { 6 | var plugin=(()=>{var yr=Object.create;var we=Object.defineProperty;var _r=Object.getOwnPropertyDescriptor;var Er=Object.getOwnPropertyNames;var br=Object.getPrototypeOf,xr=Object.prototype.hasOwnProperty;var W=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(r,t)=>(typeof require<"u"?require:r)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var q=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),Cr=(e,r)=>{for(var t in r)we(e,t,{get:r[t],enumerable:!0})},Je=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of Er(r))!xr.call(e,s)&&s!==t&&we(e,s,{get:()=>r[s],enumerable:!(n=_r(r,s))||n.enumerable});return e};var Be=(e,r,t)=>(t=e!=null?yr(br(e)):{},Je(r||!e||!e.__esModule?we(t,"default",{value:e,enumerable:!0}):t,e)),wr=e=>Je(we({},"__esModule",{value:!0}),e);var ve=q(ee=>{"use strict";ee.isInteger=e=>typeof e=="number"?Number.isInteger(e):typeof e=="string"&&e.trim()!==""?Number.isInteger(Number(e)):!1;ee.find=(e,r)=>e.nodes.find(t=>t.type===r);ee.exceedsLimit=(e,r,t=1,n)=>n===!1||!ee.isInteger(e)||!ee.isInteger(r)?!1:(Number(r)-Number(e))/Number(t)>=n;ee.escapeNode=(e,r=0,t)=>{let n=e.nodes[r];!n||(t&&n.type===t||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0)};ee.encloseBrace=e=>e.type!=="brace"?!1:e.commas>>0+e.ranges>>0===0?(e.invalid=!0,!0):!1;ee.isInvalidBrace=e=>e.type!=="brace"?!1:e.invalid===!0||e.dollar?!0:e.commas>>0+e.ranges>>0===0||e.open!==!0||e.close!==!0?(e.invalid=!0,!0):!1;ee.isOpenOrClose=e=>e.type==="open"||e.type==="close"?!0:e.open===!0||e.close===!0;ee.reduce=e=>e.reduce((r,t)=>(t.type==="text"&&r.push(t.value),t.type==="range"&&(t.type="text"),r),[]);ee.flatten=(...e)=>{let r=[],t=n=>{for(let s=0;s{"use strict";var tt=ve();rt.exports=(e,r={})=>{let t=(n,s={})=>{let i=r.escapeInvalid&&tt.isInvalidBrace(s),a=n.invalid===!0&&r.escapeInvalid===!0,c="";if(n.value)return(i||a)&&tt.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let p of n.nodes)c+=t(p);return c};return t(e)}});var st=q((Vn,nt)=>{"use strict";nt.exports=function(e){return typeof e=="number"?e-e===0:typeof e=="string"&&e.trim()!==""?Number.isFinite?Number.isFinite(+e):isFinite(+e):!1}});var ht=q((Jn,pt)=>{"use strict";var at=st(),le=(e,r,t)=>{if(at(e)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(r===void 0||e===r)return String(e);if(at(r)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n={relaxZeros:!0,...t};typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let s=String(n.relaxZeros),i=String(n.shorthand),a=String(n.capture),c=String(n.wrap),p=e+":"+r+"="+s+i+a+c;if(le.cache.hasOwnProperty(p))return le.cache[p].result;let m=Math.min(e,r),h=Math.max(e,r);if(Math.abs(m-h)===1){let y=e+"|"+r;return n.capture?`(${y})`:n.wrap===!1?y:`(?:${y})`}let R=ft(e)||ft(r),f={min:e,max:r,a:m,b:h},$=[],_=[];if(R&&(f.isPadded=R,f.maxLen=String(f.max).length),m<0){let y=h<0?Math.abs(h):1;_=it(y,Math.abs(m),f,n),m=f.a=0}return h>=0&&($=it(m,h,f,n)),f.negatives=_,f.positives=$,f.result=Sr(_,$,n),n.capture===!0?f.result=`(${f.result})`:n.wrap!==!1&&$.length+_.length>1&&(f.result=`(?:${f.result})`),le.cache[p]=f,f.result};function Sr(e,r,t){let n=Pe(e,r,"-",!1,t)||[],s=Pe(r,e,"",!1,t)||[],i=Pe(e,r,"-?",!0,t)||[];return n.concat(i).concat(s).join("|")}function vr(e,r){let t=1,n=1,s=ut(e,t),i=new Set([r]);for(;e<=s&&s<=r;)i.add(s),t+=1,s=ut(e,t);for(s=ct(r+1,n)-1;e1&&c.count.pop(),c.count.push(h.count[0]),c.string=c.pattern+lt(c.count),a=m+1;continue}t.isPadded&&(R=Lr(m,t,n)),h.string=R+h.pattern+lt(h.count),i.push(h),a=m+1,c=h}return i}function Pe(e,r,t,n,s){let i=[];for(let a of e){let{string:c}=a;!n&&!ot(r,"string",c)&&i.push(t+c),n&&ot(r,"string",c)&&i.push(t+c)}return i}function $r(e,r){let t=[];for(let n=0;nr?1:r>e?-1:0}function ot(e,r,t){return e.some(n=>n[r]===t)}function ut(e,r){return Number(String(e).slice(0,-r)+"9".repeat(r))}function ct(e,r){return e-e%Math.pow(10,r)}function lt(e){let[r=0,t=""]=e;return t||r>1?`{${r+(t?","+t:"")}}`:""}function kr(e,r,t){return`[${e}${r-e===1?"":"-"}${r}]`}function ft(e){return/^-?(0+)\d/.test(e)}function Lr(e,r,t){if(!r.isPadded)return e;let n=Math.abs(r.maxLen-String(e).length),s=t.relaxZeros!==!1;switch(n){case 0:return"";case 1:return s?"0?":"0";case 2:return s?"0{0,2}":"00";default:return s?`0{0,${n}}`:`0{${n}}`}}le.cache={};le.clearCache=()=>le.cache={};pt.exports=le});var Ue=q((es,Et)=>{"use strict";var Or=W("util"),At=ht(),dt=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),Nr=e=>r=>e===!0?Number(r):String(r),Me=e=>typeof e=="number"||typeof e=="string"&&e!=="",Ae=e=>Number.isInteger(+e),De=e=>{let r=`${e}`,t=-1;if(r[0]==="-"&&(r=r.slice(1)),r==="0")return!1;for(;r[++t]==="0";);return t>0},Ir=(e,r,t)=>typeof e=="string"||typeof r=="string"?!0:t.stringify===!0,Br=(e,r,t)=>{if(r>0){let n=e[0]==="-"?"-":"";n&&(e=e.slice(1)),e=n+e.padStart(n?r-1:r,"0")}return t===!1?String(e):e},gt=(e,r)=>{let t=e[0]==="-"?"-":"";for(t&&(e=e.slice(1),r--);e.length{e.negatives.sort((a,c)=>ac?1:0),e.positives.sort((a,c)=>ac?1:0);let t=r.capture?"":"?:",n="",s="",i;return e.positives.length&&(n=e.positives.join("|")),e.negatives.length&&(s=`-(${t}${e.negatives.join("|")})`),n&&s?i=`${n}|${s}`:i=n||s,r.wrap?`(${t}${i})`:i},mt=(e,r,t,n)=>{if(t)return At(e,r,{wrap:!1,...n});let s=String.fromCharCode(e);if(e===r)return s;let i=String.fromCharCode(r);return`[${s}-${i}]`},Rt=(e,r,t)=>{if(Array.isArray(e)){let n=t.wrap===!0,s=t.capture?"":"?:";return n?`(${s}${e.join("|")})`:e.join("|")}return At(e,r,t)},yt=(...e)=>new RangeError("Invalid range arguments: "+Or.inspect(...e)),_t=(e,r,t)=>{if(t.strictRanges===!0)throw yt([e,r]);return[]},Mr=(e,r)=>{if(r.strictRanges===!0)throw new TypeError(`Expected step "${e}" to be a number`);return[]},Dr=(e,r,t=1,n={})=>{let s=Number(e),i=Number(r);if(!Number.isInteger(s)||!Number.isInteger(i)){if(n.strictRanges===!0)throw yt([e,r]);return[]}s===0&&(s=0),i===0&&(i=0);let a=s>i,c=String(e),p=String(r),m=String(t);t=Math.max(Math.abs(t),1);let h=De(c)||De(p)||De(m),R=h?Math.max(c.length,p.length,m.length):0,f=h===!1&&Ir(e,r,n)===!1,$=n.transform||Nr(f);if(n.toRegex&&t===1)return mt(gt(e,R),gt(r,R),!0,n);let _={negatives:[],positives:[]},y=T=>_[T<0?"negatives":"positives"].push(Math.abs(T)),E=[],S=0;for(;a?s>=i:s<=i;)n.toRegex===!0&&t>1?y(s):E.push(Br($(s,S),R,f)),s=a?s-t:s+t,S++;return n.toRegex===!0?t>1?Pr(_,n):Rt(E,null,{wrap:!1,...n}):E},Ur=(e,r,t=1,n={})=>{if(!Ae(e)&&e.length>1||!Ae(r)&&r.length>1)return _t(e,r,n);let s=n.transform||(f=>String.fromCharCode(f)),i=`${e}`.charCodeAt(0),a=`${r}`.charCodeAt(0),c=i>a,p=Math.min(i,a),m=Math.max(i,a);if(n.toRegex&&t===1)return mt(p,m,!1,n);let h=[],R=0;for(;c?i>=a:i<=a;)h.push(s(i,R)),i=c?i-t:i+t,R++;return n.toRegex===!0?Rt(h,null,{wrap:!1,options:n}):h},$e=(e,r,t,n={})=>{if(r==null&&Me(e))return[e];if(!Me(e)||!Me(r))return _t(e,r,n);if(typeof t=="function")return $e(e,r,1,{transform:t});if(dt(t))return $e(e,r,0,t);let s={...n};return s.capture===!0&&(s.wrap=!0),t=t||s.step||1,Ae(t)?Ae(e)&&Ae(r)?Dr(e,r,t,s):Ur(e,r,Math.max(Math.abs(t),1),s):t!=null&&!dt(t)?Mr(t,s):$e(e,r,1,t)};Et.exports=$e});var Ct=q((ts,xt)=>{"use strict";var Gr=Ue(),bt=ve(),qr=(e,r={})=>{let t=(n,s={})=>{let i=bt.isInvalidBrace(s),a=n.invalid===!0&&r.escapeInvalid===!0,c=i===!0||a===!0,p=r.escapeInvalid===!0?"\\":"",m="";if(n.isOpen===!0||n.isClose===!0)return p+n.value;if(n.type==="open")return c?p+n.value:"(";if(n.type==="close")return c?p+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":c?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let h=bt.reduce(n.nodes),R=Gr(...h,{...r,wrap:!1,toRegex:!0});if(R.length!==0)return h.length>1&&R.length>1?`(${R})`:R}if(n.nodes)for(let h of n.nodes)m+=t(h,n);return m};return t(e)};xt.exports=qr});var vt=q((rs,St)=>{"use strict";var Kr=Ue(),wt=He(),he=ve(),fe=(e="",r="",t=!1)=>{let n=[];if(e=[].concat(e),r=[].concat(r),!r.length)return e;if(!e.length)return t?he.flatten(r).map(s=>`{${s}}`):r;for(let s of e)if(Array.isArray(s))for(let i of s)n.push(fe(i,r,t));else for(let i of r)t===!0&&typeof i=="string"&&(i=`{${i}}`),n.push(Array.isArray(i)?fe(s,i,t):s+i);return he.flatten(n)},Wr=(e,r={})=>{let t=r.rangeLimit===void 0?1e3:r.rangeLimit,n=(s,i={})=>{s.queue=[];let a=i,c=i.queue;for(;a.type!=="brace"&&a.type!=="root"&&a.parent;)a=a.parent,c=a.queue;if(s.invalid||s.dollar){c.push(fe(c.pop(),wt(s,r)));return}if(s.type==="brace"&&s.invalid!==!0&&s.nodes.length===2){c.push(fe(c.pop(),["{}"]));return}if(s.nodes&&s.ranges>0){let R=he.reduce(s.nodes);if(he.exceedsLimit(...R,r.step,t))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let f=Kr(...R,r);f.length===0&&(f=wt(s,r)),c.push(fe(c.pop(),f)),s.nodes=[];return}let p=he.encloseBrace(s),m=s.queue,h=s;for(;h.type!=="brace"&&h.type!=="root"&&h.parent;)h=h.parent,m=h.queue;for(let R=0;R{"use strict";Ht.exports={MAX_LENGTH:1024*64,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:` 7 | `,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var Nt=q((ss,Ot)=>{"use strict";var jr=He(),{MAX_LENGTH:Tt,CHAR_BACKSLASH:Ge,CHAR_BACKTICK:Fr,CHAR_COMMA:Qr,CHAR_DOT:Xr,CHAR_LEFT_PARENTHESES:Zr,CHAR_RIGHT_PARENTHESES:Yr,CHAR_LEFT_CURLY_BRACE:zr,CHAR_RIGHT_CURLY_BRACE:Vr,CHAR_LEFT_SQUARE_BRACKET:kt,CHAR_RIGHT_SQUARE_BRACKET:Lt,CHAR_DOUBLE_QUOTE:Jr,CHAR_SINGLE_QUOTE:en,CHAR_NO_BREAK_SPACE:tn,CHAR_ZERO_WIDTH_NOBREAK_SPACE:rn}=$t(),nn=(e,r={})=>{if(typeof e!="string")throw new TypeError("Expected a string");let t=r||{},n=typeof t.maxLength=="number"?Math.min(Tt,t.maxLength):Tt;if(e.length>n)throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${n})`);let s={type:"root",input:e,nodes:[]},i=[s],a=s,c=s,p=0,m=e.length,h=0,R=0,f,$={},_=()=>e[h++],y=E=>{if(E.type==="text"&&c.type==="dot"&&(c.type="text"),c&&c.type==="text"&&E.type==="text"){c.value+=E.value;return}return a.nodes.push(E),E.parent=a,E.prev=c,c=E,E};for(y({type:"bos"});h0){if(a.ranges>0){a.ranges=0;let E=a.nodes.shift();a.nodes=[E,{type:"text",value:jr(a)}]}y({type:"comma",value:f}),a.commas++;continue}if(f===Xr&&R>0&&a.commas===0){let E=a.nodes;if(R===0||E.length===0){y({type:"text",value:f});continue}if(c.type==="dot"){if(a.range=[],c.value+=f,c.type="range",a.nodes.length!==3&&a.nodes.length!==5){a.invalid=!0,a.ranges=0,c.type="text";continue}a.ranges++,a.args=[];continue}if(c.type==="range"){E.pop();let S=E[E.length-1];S.value+=c.value+f,c=S,a.ranges--;continue}y({type:"dot",value:f});continue}y({type:"text",value:f})}do if(a=i.pop(),a.type!=="root"){a.nodes.forEach(T=>{T.nodes||(T.type==="open"&&(T.isOpen=!0),T.type==="close"&&(T.isClose=!0),T.nodes||(T.type="text"),T.invalid=!0)});let E=i[i.length-1],S=E.nodes.indexOf(a);E.nodes.splice(S,1,...a.nodes)}while(i.length>0);return y({type:"eos"}),s};Ot.exports=nn});var Pt=q((as,Bt)=>{"use strict";var It=He(),sn=Ct(),an=vt(),on=Nt(),Z=(e,r={})=>{let t=[];if(Array.isArray(e))for(let n of e){let s=Z.create(n,r);Array.isArray(s)?t.push(...s):t.push(s)}else t=[].concat(Z.create(e,r));return r&&r.expand===!0&&r.nodupes===!0&&(t=[...new Set(t)]),t};Z.parse=(e,r={})=>on(e,r);Z.stringify=(e,r={})=>It(typeof e=="string"?Z.parse(e,r):e,r);Z.compile=(e,r={})=>(typeof e=="string"&&(e=Z.parse(e,r)),sn(e,r));Z.expand=(e,r={})=>{typeof e=="string"&&(e=Z.parse(e,r));let t=an(e,r);return r.noempty===!0&&(t=t.filter(Boolean)),r.nodupes===!0&&(t=[...new Set(t)]),t};Z.create=(e,r={})=>e===""||e.length<3?[e]:r.expand!==!0?Z.compile(e,r):Z.expand(e,r);Bt.exports=Z});var me=q((is,qt)=>{"use strict";var un=W("path"),se="\\\\/",Mt=`[^${se}]`,ie="\\.",cn="\\+",ln="\\?",Te="\\/",fn="(?=.)",Dt="[^/]",qe=`(?:${Te}|$)`,Ut=`(?:^|${Te})`,Ke=`${ie}{1,2}${qe}`,pn=`(?!${ie})`,hn=`(?!${Ut}${Ke})`,dn=`(?!${ie}{0,1}${qe})`,gn=`(?!${Ke})`,An=`[^.${Te}]`,mn=`${Dt}*?`,Gt={DOT_LITERAL:ie,PLUS_LITERAL:cn,QMARK_LITERAL:ln,SLASH_LITERAL:Te,ONE_CHAR:fn,QMARK:Dt,END_ANCHOR:qe,DOTS_SLASH:Ke,NO_DOT:pn,NO_DOTS:hn,NO_DOT_SLASH:dn,NO_DOTS_SLASH:gn,QMARK_NO_DOT:An,STAR:mn,START_ANCHOR:Ut},Rn={...Gt,SLASH_LITERAL:`[${se}]`,QMARK:Mt,STAR:`${Mt}*?`,DOTS_SLASH:`${ie}{1,2}(?:[${se}]|$)`,NO_DOT:`(?!${ie})`,NO_DOTS:`(?!(?:^|[${se}])${ie}{1,2}(?:[${se}]|$))`,NO_DOT_SLASH:`(?!${ie}{0,1}(?:[${se}]|$))`,NO_DOTS_SLASH:`(?!${ie}{1,2}(?:[${se}]|$))`,QMARK_NO_DOT:`[^.${se}]`,START_ANCHOR:`(?:^|[${se}])`,END_ANCHOR:`(?:[${se}]|$)`},yn={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};qt.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:yn,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:un.sep,extglobChars(e){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(e){return e===!0?Rn:Gt}}});var Re=q(Q=>{"use strict";var _n=W("path"),En=process.platform==="win32",{REGEX_BACKSLASH:bn,REGEX_REMOVE_BACKSLASH:xn,REGEX_SPECIAL_CHARS:Cn,REGEX_SPECIAL_CHARS_GLOBAL:wn}=me();Q.isObject=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);Q.hasRegexChars=e=>Cn.test(e);Q.isRegexChar=e=>e.length===1&&Q.hasRegexChars(e);Q.escapeRegex=e=>e.replace(wn,"\\$1");Q.toPosixSlashes=e=>e.replace(bn,"/");Q.removeBackslashes=e=>e.replace(xn,r=>r==="\\"?"":r);Q.supportsLookbehinds=()=>{let e=process.version.slice(1).split(".").map(Number);return e.length===3&&e[0]>=9||e[0]===8&&e[1]>=10};Q.isWindows=e=>e&&typeof e.windows=="boolean"?e.windows:En===!0||_n.sep==="\\";Q.escapeLast=(e,r,t)=>{let n=e.lastIndexOf(r,t);return n===-1?e:e[n-1]==="\\"?Q.escapeLast(e,r,n-1):`${e.slice(0,n)}\\${e.slice(n)}`};Q.removePrefix=(e,r={})=>{let t=e;return t.startsWith("./")&&(t=t.slice(2),r.prefix="./"),t};Q.wrapOutput=(e,r={},t={})=>{let n=t.contains?"":"^",s=t.contains?"":"$",i=`${n}(?:${e})${s}`;return r.negated===!0&&(i=`(?:^(?!${i}).*$)`),i}});var Yt=q((us,Zt)=>{"use strict";var Kt=Re(),{CHAR_ASTERISK:We,CHAR_AT:Sn,CHAR_BACKWARD_SLASH:ye,CHAR_COMMA:vn,CHAR_DOT:je,CHAR_EXCLAMATION_MARK:Fe,CHAR_FORWARD_SLASH:Xt,CHAR_LEFT_CURLY_BRACE:Qe,CHAR_LEFT_PARENTHESES:Xe,CHAR_LEFT_SQUARE_BRACKET:Hn,CHAR_PLUS:$n,CHAR_QUESTION_MARK:Wt,CHAR_RIGHT_CURLY_BRACE:Tn,CHAR_RIGHT_PARENTHESES:jt,CHAR_RIGHT_SQUARE_BRACKET:kn}=me(),Ft=e=>e===Xt||e===ye,Qt=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)},Ln=(e,r)=>{let t=r||{},n=e.length-1,s=t.parts===!0||t.scanToEnd===!0,i=[],a=[],c=[],p=e,m=-1,h=0,R=0,f=!1,$=!1,_=!1,y=!1,E=!1,S=!1,T=!1,L=!1,z=!1,I=!1,re=0,K,g,v={value:"",depth:0,isGlob:!1},k=()=>m>=n,l=()=>p.charCodeAt(m+1),H=()=>(K=g,p.charCodeAt(++m));for(;m0&&(B=p.slice(0,h),p=p.slice(h),R-=h),w&&_===!0&&R>0?(w=p.slice(0,R),o=p.slice(R)):_===!0?(w="",o=p):w=p,w&&w!==""&&w!=="/"&&w!==p&&Ft(w.charCodeAt(w.length-1))&&(w=w.slice(0,-1)),t.unescape===!0&&(o&&(o=Kt.removeBackslashes(o)),w&&T===!0&&(w=Kt.removeBackslashes(w)));let u={prefix:B,input:e,start:h,base:w,glob:o,isBrace:f,isBracket:$,isGlob:_,isExtglob:y,isGlobstar:E,negated:L,negatedExtglob:z};if(t.tokens===!0&&(u.maxDepth=0,Ft(g)||a.push(v),u.tokens=a),t.parts===!0||t.tokens===!0){let P;for(let b=0;b{"use strict";var ke=me(),Y=Re(),{MAX_LENGTH:Le,POSIX_REGEX_SOURCE:On,REGEX_NON_SPECIAL_CHARS:Nn,REGEX_SPECIAL_CHARS_BACKREF:In,REPLACEMENTS:zt}=ke,Bn=(e,r)=>{if(typeof r.expandRange=="function")return r.expandRange(...e,r);e.sort();let t=`[${e.join("-")}]`;try{new RegExp(t)}catch{return e.map(s=>Y.escapeRegex(s)).join("..")}return t},de=(e,r)=>`Missing ${e}: "${r}" - use "\\\\${r}" to match literal characters`,Vt=(e,r)=>{if(typeof e!="string")throw new TypeError("Expected a string");e=zt[e]||e;let t={...r},n=typeof t.maxLength=="number"?Math.min(Le,t.maxLength):Le,s=e.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);let i={type:"bos",value:"",output:t.prepend||""},a=[i],c=t.capture?"":"?:",p=Y.isWindows(r),m=ke.globChars(p),h=ke.extglobChars(m),{DOT_LITERAL:R,PLUS_LITERAL:f,SLASH_LITERAL:$,ONE_CHAR:_,DOTS_SLASH:y,NO_DOT:E,NO_DOT_SLASH:S,NO_DOTS_SLASH:T,QMARK:L,QMARK_NO_DOT:z,STAR:I,START_ANCHOR:re}=m,K=A=>`(${c}(?:(?!${re}${A.dot?y:R}).)*?)`,g=t.dot?"":E,v=t.dot?L:z,k=t.bash===!0?K(t):I;t.capture&&(k=`(${k})`),typeof t.noext=="boolean"&&(t.noextglob=t.noext);let l={input:e,index:-1,start:0,dot:t.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:a};e=Y.removePrefix(e,l),s=e.length;let H=[],w=[],B=[],o=i,u,P=()=>l.index===s-1,b=l.peek=(A=1)=>e[l.index+A],V=l.advance=()=>e[++l.index]||"",J=()=>e.slice(l.index+1),X=(A="",O=0)=>{l.consumed+=A,l.index+=O},Ee=A=>{l.output+=A.output!=null?A.output:A.value,X(A.value)},mr=()=>{let A=1;for(;b()==="!"&&(b(2)!=="("||b(3)==="?");)V(),l.start++,A++;return A%2===0?!1:(l.negated=!0,l.start++,!0)},be=A=>{l[A]++,B.push(A)},oe=A=>{l[A]--,B.pop()},C=A=>{if(o.type==="globstar"){let O=l.braces>0&&(A.type==="comma"||A.type==="brace"),d=A.extglob===!0||H.length&&(A.type==="pipe"||A.type==="paren");A.type!=="slash"&&A.type!=="paren"&&!O&&!d&&(l.output=l.output.slice(0,-o.output.length),o.type="star",o.value="*",o.output=k,l.output+=o.output)}if(H.length&&A.type!=="paren"&&(H[H.length-1].inner+=A.value),(A.value||A.output)&&Ee(A),o&&o.type==="text"&&A.type==="text"){o.value+=A.value,o.output=(o.output||"")+A.value;return}A.prev=o,a.push(A),o=A},xe=(A,O)=>{let d={...h[O],conditions:1,inner:""};d.prev=o,d.parens=l.parens,d.output=l.output;let x=(t.capture?"(":"")+d.open;be("parens"),C({type:A,value:O,output:l.output?"":_}),C({type:"paren",extglob:!0,value:V(),output:x}),H.push(d)},Rr=A=>{let O=A.close+(t.capture?")":""),d;if(A.type==="negate"){let x=k;A.inner&&A.inner.length>1&&A.inner.includes("/")&&(x=K(t)),(x!==k||P()||/^\)+$/.test(J()))&&(O=A.close=`)$))${x}`),A.inner.includes("*")&&(d=J())&&/^\.[^\\/.]+$/.test(d)&&(O=A.close=`)${d})${x})`),A.prev.type==="bos"&&(l.negatedExtglob=!0)}C({type:"paren",extglob:!0,value:u,output:O}),oe("parens")};if(t.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let A=!1,O=e.replace(In,(d,x,M,j,G,Ie)=>j==="\\"?(A=!0,d):j==="?"?x?x+j+(G?L.repeat(G.length):""):Ie===0?v+(G?L.repeat(G.length):""):L.repeat(M.length):j==="."?R.repeat(M.length):j==="*"?x?x+j+(G?k:""):k:x?d:`\\${d}`);return A===!0&&(t.unescape===!0?O=O.replace(/\\/g,""):O=O.replace(/\\+/g,d=>d.length%2===0?"\\\\":d?"\\":"")),O===e&&t.contains===!0?(l.output=e,l):(l.output=Y.wrapOutput(O,l,r),l)}for(;!P();){if(u=V(),u==="\0")continue;if(u==="\\"){let d=b();if(d==="/"&&t.bash!==!0||d==="."||d===";")continue;if(!d){u+="\\",C({type:"text",value:u});continue}let x=/^\\+/.exec(J()),M=0;if(x&&x[0].length>2&&(M=x[0].length,l.index+=M,M%2!==0&&(u+="\\")),t.unescape===!0?u=V():u+=V(),l.brackets===0){C({type:"text",value:u});continue}}if(l.brackets>0&&(u!=="]"||o.value==="["||o.value==="[^")){if(t.posix!==!1&&u===":"){let d=o.value.slice(1);if(d.includes("[")&&(o.posix=!0,d.includes(":"))){let x=o.value.lastIndexOf("["),M=o.value.slice(0,x),j=o.value.slice(x+2),G=On[j];if(G){o.value=M+G,l.backtrack=!0,V(),!i.output&&a.indexOf(o)===1&&(i.output=_);continue}}}(u==="["&&b()!==":"||u==="-"&&b()==="]")&&(u=`\\${u}`),u==="]"&&(o.value==="["||o.value==="[^")&&(u=`\\${u}`),t.posix===!0&&u==="!"&&o.value==="["&&(u="^"),o.value+=u,Ee({value:u});continue}if(l.quotes===1&&u!=='"'){u=Y.escapeRegex(u),o.value+=u,Ee({value:u});continue}if(u==='"'){l.quotes=l.quotes===1?0:1,t.keepQuotes===!0&&C({type:"text",value:u});continue}if(u==="("){be("parens"),C({type:"paren",value:u});continue}if(u===")"){if(l.parens===0&&t.strictBrackets===!0)throw new SyntaxError(de("opening","("));let d=H[H.length-1];if(d&&l.parens===d.parens+1){Rr(H.pop());continue}C({type:"paren",value:u,output:l.parens?")":"\\)"}),oe("parens");continue}if(u==="["){if(t.nobracket===!0||!J().includes("]")){if(t.nobracket!==!0&&t.strictBrackets===!0)throw new SyntaxError(de("closing","]"));u=`\\${u}`}else be("brackets");C({type:"bracket",value:u});continue}if(u==="]"){if(t.nobracket===!0||o&&o.type==="bracket"&&o.value.length===1){C({type:"text",value:u,output:`\\${u}`});continue}if(l.brackets===0){if(t.strictBrackets===!0)throw new SyntaxError(de("opening","["));C({type:"text",value:u,output:`\\${u}`});continue}oe("brackets");let d=o.value.slice(1);if(o.posix!==!0&&d[0]==="^"&&!d.includes("/")&&(u=`/${u}`),o.value+=u,Ee({value:u}),t.literalBrackets===!1||Y.hasRegexChars(d))continue;let x=Y.escapeRegex(o.value);if(l.output=l.output.slice(0,-o.value.length),t.literalBrackets===!0){l.output+=x,o.value=x;continue}o.value=`(${c}${x}|${o.value})`,l.output+=o.value;continue}if(u==="{"&&t.nobrace!==!0){be("braces");let d={type:"brace",value:u,output:"(",outputIndex:l.output.length,tokensIndex:l.tokens.length};w.push(d),C(d);continue}if(u==="}"){let d=w[w.length-1];if(t.nobrace===!0||!d){C({type:"text",value:u,output:u});continue}let x=")";if(d.dots===!0){let M=a.slice(),j=[];for(let G=M.length-1;G>=0&&(a.pop(),M[G].type!=="brace");G--)M[G].type!=="dots"&&j.unshift(M[G].value);x=Bn(j,t),l.backtrack=!0}if(d.comma!==!0&&d.dots!==!0){let M=l.output.slice(0,d.outputIndex),j=l.tokens.slice(d.tokensIndex);d.value=d.output="\\{",u=x="\\}",l.output=M;for(let G of j)l.output+=G.output||G.value}C({type:"brace",value:u,output:x}),oe("braces"),w.pop();continue}if(u==="|"){H.length>0&&H[H.length-1].conditions++,C({type:"text",value:u});continue}if(u===","){let d=u,x=w[w.length-1];x&&B[B.length-1]==="braces"&&(x.comma=!0,d="|"),C({type:"comma",value:u,output:d});continue}if(u==="/"){if(o.type==="dot"&&l.index===l.start+1){l.start=l.index+1,l.consumed="",l.output="",a.pop(),o=i;continue}C({type:"slash",value:u,output:$});continue}if(u==="."){if(l.braces>0&&o.type==="dot"){o.value==="."&&(o.output=R);let d=w[w.length-1];o.type="dots",o.output+=u,o.value+=u,d.dots=!0;continue}if(l.braces+l.parens===0&&o.type!=="bos"&&o.type!=="slash"){C({type:"text",value:u,output:R});continue}C({type:"dot",value:u,output:R});continue}if(u==="?"){if(!(o&&o.value==="(")&&t.noextglob!==!0&&b()==="("&&b(2)!=="?"){xe("qmark",u);continue}if(o&&o.type==="paren"){let x=b(),M=u;if(x==="<"&&!Y.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(o.value==="("&&!/[!=<:]/.test(x)||x==="<"&&!/<([!=]|\w+>)/.test(J()))&&(M=`\\${u}`),C({type:"text",value:u,output:M});continue}if(t.dot!==!0&&(o.type==="slash"||o.type==="bos")){C({type:"qmark",value:u,output:z});continue}C({type:"qmark",value:u,output:L});continue}if(u==="!"){if(t.noextglob!==!0&&b()==="("&&(b(2)!=="?"||!/[!=<:]/.test(b(3)))){xe("negate",u);continue}if(t.nonegate!==!0&&l.index===0){mr();continue}}if(u==="+"){if(t.noextglob!==!0&&b()==="("&&b(2)!=="?"){xe("plus",u);continue}if(o&&o.value==="("||t.regex===!1){C({type:"plus",value:u,output:f});continue}if(o&&(o.type==="bracket"||o.type==="paren"||o.type==="brace")||l.parens>0){C({type:"plus",value:u});continue}C({type:"plus",value:f});continue}if(u==="@"){if(t.noextglob!==!0&&b()==="("&&b(2)!=="?"){C({type:"at",extglob:!0,value:u,output:""});continue}C({type:"text",value:u});continue}if(u!=="*"){(u==="$"||u==="^")&&(u=`\\${u}`);let d=Nn.exec(J());d&&(u+=d[0],l.index+=d[0].length),C({type:"text",value:u});continue}if(o&&(o.type==="globstar"||o.star===!0)){o.type="star",o.star=!0,o.value+=u,o.output=k,l.backtrack=!0,l.globstar=!0,X(u);continue}let A=J();if(t.noextglob!==!0&&/^\([^?]/.test(A)){xe("star",u);continue}if(o.type==="star"){if(t.noglobstar===!0){X(u);continue}let d=o.prev,x=d.prev,M=d.type==="slash"||d.type==="bos",j=x&&(x.type==="star"||x.type==="globstar");if(t.bash===!0&&(!M||A[0]&&A[0]!=="/")){C({type:"star",value:u,output:""});continue}let G=l.braces>0&&(d.type==="comma"||d.type==="brace"),Ie=H.length&&(d.type==="pipe"||d.type==="paren");if(!M&&d.type!=="paren"&&!G&&!Ie){C({type:"star",value:u,output:""});continue}for(;A.slice(0,3)==="/**";){let Ce=e[l.index+4];if(Ce&&Ce!=="/")break;A=A.slice(3),X("/**",3)}if(d.type==="bos"&&P()){o.type="globstar",o.value+=u,o.output=K(t),l.output=o.output,l.globstar=!0,X(u);continue}if(d.type==="slash"&&d.prev.type!=="bos"&&!j&&P()){l.output=l.output.slice(0,-(d.output+o.output).length),d.output=`(?:${d.output}`,o.type="globstar",o.output=K(t)+(t.strictSlashes?")":"|$)"),o.value+=u,l.globstar=!0,l.output+=d.output+o.output,X(u);continue}if(d.type==="slash"&&d.prev.type!=="bos"&&A[0]==="/"){let Ce=A[1]!==void 0?"|$":"";l.output=l.output.slice(0,-(d.output+o.output).length),d.output=`(?:${d.output}`,o.type="globstar",o.output=`${K(t)}${$}|${$}${Ce})`,o.value+=u,l.output+=d.output+o.output,l.globstar=!0,X(u+V()),C({type:"slash",value:"/",output:""});continue}if(d.type==="bos"&&A[0]==="/"){o.type="globstar",o.value+=u,o.output=`(?:^|${$}|${K(t)}${$})`,l.output=o.output,l.globstar=!0,X(u+V()),C({type:"slash",value:"/",output:""});continue}l.output=l.output.slice(0,-o.output.length),o.type="globstar",o.output=K(t),o.value+=u,l.output+=o.output,l.globstar=!0,X(u);continue}let O={type:"star",value:u,output:k};if(t.bash===!0){O.output=".*?",(o.type==="bos"||o.type==="slash")&&(O.output=g+O.output),C(O);continue}if(o&&(o.type==="bracket"||o.type==="paren")&&t.regex===!0){O.output=u,C(O);continue}(l.index===l.start||o.type==="slash"||o.type==="dot")&&(o.type==="dot"?(l.output+=S,o.output+=S):t.dot===!0?(l.output+=T,o.output+=T):(l.output+=g,o.output+=g),b()!=="*"&&(l.output+=_,o.output+=_)),C(O)}for(;l.brackets>0;){if(t.strictBrackets===!0)throw new SyntaxError(de("closing","]"));l.output=Y.escapeLast(l.output,"["),oe("brackets")}for(;l.parens>0;){if(t.strictBrackets===!0)throw new SyntaxError(de("closing",")"));l.output=Y.escapeLast(l.output,"("),oe("parens")}for(;l.braces>0;){if(t.strictBrackets===!0)throw new SyntaxError(de("closing","}"));l.output=Y.escapeLast(l.output,"{"),oe("braces")}if(t.strictSlashes!==!0&&(o.type==="star"||o.type==="bracket")&&C({type:"maybe_slash",value:"",output:`${$}?`}),l.backtrack===!0){l.output="";for(let A of l.tokens)l.output+=A.output!=null?A.output:A.value,A.suffix&&(l.output+=A.suffix)}return l};Vt.fastpaths=(e,r)=>{let t={...r},n=typeof t.maxLength=="number"?Math.min(Le,t.maxLength):Le,s=e.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);e=zt[e]||e;let i=Y.isWindows(r),{DOT_LITERAL:a,SLASH_LITERAL:c,ONE_CHAR:p,DOTS_SLASH:m,NO_DOT:h,NO_DOTS:R,NO_DOTS_SLASH:f,STAR:$,START_ANCHOR:_}=ke.globChars(i),y=t.dot?R:h,E=t.dot?f:h,S=t.capture?"":"?:",T={negated:!1,prefix:""},L=t.bash===!0?".*?":$;t.capture&&(L=`(${L})`);let z=g=>g.noglobstar===!0?L:`(${S}(?:(?!${_}${g.dot?m:a}).)*?)`,I=g=>{switch(g){case"*":return`${y}${p}${L}`;case".*":return`${a}${p}${L}`;case"*.*":return`${y}${L}${a}${p}${L}`;case"*/*":return`${y}${L}${c}${p}${E}${L}`;case"**":return y+z(t);case"**/*":return`(?:${y}${z(t)}${c})?${E}${p}${L}`;case"**/*.*":return`(?:${y}${z(t)}${c})?${E}${L}${a}${p}${L}`;case"**/.*":return`(?:${y}${z(t)}${c})?${a}${p}${L}`;default:{let v=/^(.*?)\.(\w+)$/.exec(g);if(!v)return;let k=I(v[1]);return k?k+a+v[2]:void 0}}},re=Y.removePrefix(e,T),K=I(re);return K&&t.strictSlashes!==!0&&(K+=`${c}?`),K};Jt.exports=Vt});var rr=q((ls,tr)=>{"use strict";var Pn=W("path"),Mn=Yt(),Ze=er(),Ye=Re(),Dn=me(),Un=e=>e&&typeof e=="object"&&!Array.isArray(e),D=(e,r,t=!1)=>{if(Array.isArray(e)){let h=e.map(f=>D(f,r,t));return f=>{for(let $ of h){let _=$(f);if(_)return _}return!1}}let n=Un(e)&&e.tokens&&e.input;if(e===""||typeof e!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let s=r||{},i=Ye.isWindows(r),a=n?D.compileRe(e,r):D.makeRe(e,r,!1,!0),c=a.state;delete a.state;let p=()=>!1;if(s.ignore){let h={...r,ignore:null,onMatch:null,onResult:null};p=D(s.ignore,h,t)}let m=(h,R=!1)=>{let{isMatch:f,match:$,output:_}=D.test(h,a,r,{glob:e,posix:i}),y={glob:e,state:c,regex:a,posix:i,input:h,output:_,match:$,isMatch:f};return typeof s.onResult=="function"&&s.onResult(y),f===!1?(y.isMatch=!1,R?y:!1):p(h)?(typeof s.onIgnore=="function"&&s.onIgnore(y),y.isMatch=!1,R?y:!1):(typeof s.onMatch=="function"&&s.onMatch(y),R?y:!0)};return t&&(m.state=c),m};D.test=(e,r,t,{glob:n,posix:s}={})=>{if(typeof e!="string")throw new TypeError("Expected input to be a string");if(e==="")return{isMatch:!1,output:""};let i=t||{},a=i.format||(s?Ye.toPosixSlashes:null),c=e===n,p=c&&a?a(e):e;return c===!1&&(p=a?a(e):e,c=p===n),(c===!1||i.capture===!0)&&(i.matchBase===!0||i.basename===!0?c=D.matchBase(e,r,t,s):c=r.exec(p)),{isMatch:Boolean(c),match:c,output:p}};D.matchBase=(e,r,t,n=Ye.isWindows(t))=>(r instanceof RegExp?r:D.makeRe(r,t)).test(Pn.basename(e));D.isMatch=(e,r,t)=>D(r,t)(e);D.parse=(e,r)=>Array.isArray(e)?e.map(t=>D.parse(t,r)):Ze(e,{...r,fastpaths:!1});D.scan=(e,r)=>Mn(e,r);D.compileRe=(e,r,t=!1,n=!1)=>{if(t===!0)return e.output;let s=r||{},i=s.contains?"":"^",a=s.contains?"":"$",c=`${i}(?:${e.output})${a}`;e&&e.negated===!0&&(c=`^(?!${c}).*$`);let p=D.toRegex(c,r);return n===!0&&(p.state=e),p};D.makeRe=(e,r={},t=!1,n=!1)=>{if(!e||typeof e!="string")throw new TypeError("Expected a non-empty string");let s={negated:!1,fastpaths:!0};return r.fastpaths!==!1&&(e[0]==="."||e[0]==="*")&&(s.output=Ze.fastpaths(e,r)),s.output||(s=Ze(e,r)),D.compileRe(s,r,t,n)};D.toRegex=(e,r)=>{try{let t=r||{};return new RegExp(e,t.flags||(t.nocase?"i":""))}catch(t){if(r&&r.debug===!0)throw t;return/$^/}};D.constants=Dn;tr.exports=D});var sr=q((fs,nr)=>{"use strict";nr.exports=rr()});var cr=q((ps,ur)=>{"use strict";var ir=W("util"),or=Pt(),ae=sr(),ze=Re(),ar=e=>e===""||e==="./",N=(e,r,t)=>{r=[].concat(r),e=[].concat(e);let n=new Set,s=new Set,i=new Set,a=0,c=h=>{i.add(h.output),t&&t.onResult&&t.onResult(h)};for(let h=0;h!n.has(h));if(t&&m.length===0){if(t.failglob===!0)throw new Error(`No matches found for "${r.join(", ")}"`);if(t.nonull===!0||t.nullglob===!0)return t.unescape?r.map(h=>h.replace(/\\/g,"")):r}return m};N.match=N;N.matcher=(e,r)=>ae(e,r);N.isMatch=(e,r,t)=>ae(r,t)(e);N.any=N.isMatch;N.not=(e,r,t={})=>{r=[].concat(r).map(String);let n=new Set,s=[],a=N(e,r,{...t,onResult:c=>{t.onResult&&t.onResult(c),s.push(c.output)}});for(let c of s)a.includes(c)||n.add(c);return[...n]};N.contains=(e,r,t)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${ir.inspect(e)}"`);if(Array.isArray(r))return r.some(n=>N.contains(e,n,t));if(typeof r=="string"){if(ar(e)||ar(r))return!1;if(e.includes(r)||e.startsWith("./")&&e.slice(2).includes(r))return!0}return N.isMatch(e,r,{...t,contains:!0})};N.matchKeys=(e,r,t)=>{if(!ze.isObject(e))throw new TypeError("Expected the first argument to be an object");let n=N(Object.keys(e),r,t),s={};for(let i of n)s[i]=e[i];return s};N.some=(e,r,t)=>{let n=[].concat(e);for(let s of[].concat(r)){let i=ae(String(s),t);if(n.some(a=>i(a)))return!0}return!1};N.every=(e,r,t)=>{let n=[].concat(e);for(let s of[].concat(r)){let i=ae(String(s),t);if(!n.every(a=>i(a)))return!1}return!0};N.all=(e,r,t)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${ir.inspect(e)}"`);return[].concat(r).every(n=>ae(n,t)(e))};N.capture=(e,r,t)=>{let n=ze.isWindows(t),i=ae.makeRe(String(e),{...t,capture:!0}).exec(n?ze.toPosixSlashes(r):r);if(i)return i.slice(1).map(a=>a===void 0?"":a)};N.makeRe=(...e)=>ae.makeRe(...e);N.scan=(...e)=>ae.scan(...e);N.parse=(e,r)=>{let t=[];for(let n of[].concat(e||[]))for(let s of or(String(n),r))t.push(ae.parse(s,r));return t};N.braces=(e,r)=>{if(typeof e!="string")throw new TypeError("Expected a string");return r&&r.nobrace===!0||!/\{.*\}/.test(e)?[e]:or(e,r)};N.braceExpand=(e,r)=>{if(typeof e!="string")throw new TypeError("Expected a string");return N.braces(e,{...r,expand:!0})};ur.exports=N});var fr=q((hs,lr)=>{"use strict";lr.exports=(e,...r)=>new Promise(t=>{t(e(...r))})});var hr=q((ds,Ve)=>{"use strict";var Gn=fr(),pr=e=>{if(e<1)throw new TypeError("Expected `concurrency` to be a number from 1 and up");let r=[],t=0,n=()=>{t--,r.length>0&&r.shift()()},s=(c,p,...m)=>{t++;let h=Gn(c,...m);p(h),h.then(n,n)},i=(c,p,...m)=>{tnew Promise(m=>i(c,m,...p));return Object.defineProperties(a,{activeCount:{get:()=>t},pendingCount:{get:()=>r.length}}),a};Ve.exports=pr;Ve.exports.default=pr});var jn={};Cr(jn,{default:()=>Wn});var Se=W("@yarnpkg/cli"),ne=W("@yarnpkg/core"),et=W("@yarnpkg/core"),ue=W("clipanion"),ce=class extends Se.BaseCommand{constructor(){super(...arguments);this.json=ue.Option.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.production=ue.Option.Boolean("--production",!1,{description:"Only install regular dependencies by omitting dev dependencies"});this.all=ue.Option.Boolean("-A,--all",!1,{description:"Install the entire project"});this.workspaces=ue.Option.Rest()}async execute(){let t=await ne.Configuration.find(this.context.cwd,this.context.plugins),{project:n,workspace:s}=await ne.Project.find(t,this.context.cwd),i=await ne.Cache.find(t);await n.restoreInstallState({restoreResolutions:!1});let a;if(this.all)a=new Set(n.workspaces);else if(this.workspaces.length===0){if(!s)throw new Se.WorkspaceRequiredError(n.cwd,this.context.cwd);a=new Set([s])}else a=new Set(this.workspaces.map(p=>n.getWorkspaceByIdent(et.structUtils.parseIdent(p))));for(let p of a)for(let m of this.production?["dependencies"]:ne.Manifest.hardDependencies)for(let h of p.manifest.getForScope(m).values()){let R=n.tryWorkspaceByDescriptor(h);R!==null&&a.add(R)}for(let p of n.workspaces)a.has(p)?this.production&&p.manifest.devDependencies.clear():(p.manifest.installConfig=p.manifest.installConfig||{},p.manifest.installConfig.selfReferences=!1,p.manifest.dependencies.clear(),p.manifest.devDependencies.clear(),p.manifest.peerDependencies.clear(),p.manifest.scripts.clear());return(await ne.StreamReport.start({configuration:t,json:this.json,stdout:this.context.stdout,includeLogs:!0},async p=>{await n.install({cache:i,report:p,persistProject:!1})})).exitCode()}};ce.paths=[["workspaces","focus"]],ce.usage=ue.Command.Usage({category:"Workspace-related commands",description:"install a single workspace and its dependencies",details:"\n This command will run an install as if the specified workspaces (and all other workspaces they depend on) were the only ones in the project. If no workspaces are explicitly listed, the active one will be assumed.\n\n Note that this command is only very moderately useful when using zero-installs, since the cache will contain all the packages anyway - meaning that the only difference between a full install and a focused install would just be a few extra lines in the `.pnp.cjs` file, at the cost of introducing an extra complexity.\n\n If the `-A,--all` flag is set, the entire project will be installed. Combine with `--production` to replicate the old `yarn install --production`.\n "});var Ne=W("@yarnpkg/cli"),ge=W("@yarnpkg/core"),_e=W("@yarnpkg/core"),F=W("@yarnpkg/core"),gr=W("@yarnpkg/plugin-git"),U=W("clipanion"),Oe=Be(cr()),Ar=Be(hr()),te=Be(W("typanion")),pe=class extends Ne.BaseCommand{constructor(){super(...arguments);this.recursive=U.Option.Boolean("-R,--recursive",!1,{description:"Find packages via dependencies/devDependencies instead of using the workspaces field"});this.from=U.Option.Array("--from",[],{description:"An array of glob pattern idents from which to base any recursion"});this.all=U.Option.Boolean("-A,--all",!1,{description:"Run the command on all workspaces of a project"});this.verbose=U.Option.Boolean("-v,--verbose",!1,{description:"Prefix each output line with the name of the originating workspace"});this.parallel=U.Option.Boolean("-p,--parallel",!1,{description:"Run the commands in parallel"});this.interlaced=U.Option.Boolean("-i,--interlaced",!1,{description:"Print the output of commands in real-time instead of buffering it"});this.jobs=U.Option.String("-j,--jobs",{description:"The maximum number of parallel tasks that the execution will be limited to; or `unlimited`",validator:te.isOneOf([te.isEnum(["unlimited"]),te.applyCascade(te.isNumber(),[te.isInteger(),te.isAtLeast(1)])])});this.topological=U.Option.Boolean("-t,--topological",!1,{description:"Run the command after all workspaces it depends on (regular) have finished"});this.topologicalDev=U.Option.Boolean("--topological-dev",!1,{description:"Run the command after all workspaces it depends on (regular + dev) have finished"});this.include=U.Option.Array("--include",[],{description:"An array of glob pattern idents; only matching workspaces will be traversed"});this.exclude=U.Option.Array("--exclude",[],{description:"An array of glob pattern idents; matching workspaces won't be traversed"});this.publicOnly=U.Option.Boolean("--no-private",{description:"Avoid running the command on private workspaces"});this.since=U.Option.String("--since",{description:"Only include workspaces that have been changed since the specified ref.",tolerateBoolean:!0});this.commandName=U.Option.String();this.args=U.Option.Proxy()}async execute(){let t=await ge.Configuration.find(this.context.cwd,this.context.plugins),{project:n,workspace:s}=await ge.Project.find(t,this.context.cwd);if(!this.all&&!s)throw new Ne.WorkspaceRequiredError(n.cwd,this.context.cwd);await n.restoreInstallState();let i=this.cli.process([this.commandName,...this.args]),a=i.path.length===1&&i.path[0]==="run"&&typeof i.scriptName<"u"?i.scriptName:null;if(i.path.length===0)throw new U.UsageError("Invalid subcommand name for iteration - use the 'run' keyword if you wish to execute a script");let c=this.all?n.topLevelWorkspace:s,p=this.since?Array.from(await gr.gitUtils.fetchChangedWorkspaces({ref:this.since,project:n})):[c,...this.from.length>0?c.getRecursiveWorkspaceChildren():[]],m=g=>Oe.default.isMatch(F.structUtils.stringifyIdent(g.locator),this.from),h=this.from.length>0?p.filter(m):p,R=new Set([...h,...h.map(g=>[...this.recursive?this.since?g.getRecursiveWorkspaceDependents():g.getRecursiveWorkspaceDependencies():g.getRecursiveWorkspaceChildren()]).flat()]),f=[],$=!1;if(a!=null&&a.includes(":")){for(let g of n.workspaces)if(g.manifest.scripts.has(a)&&($=!$,$===!1))break}for(let g of R)a&&!g.manifest.scripts.has(a)&&!$&&!(await ge.scriptUtils.getWorkspaceAccessibleBinaries(g)).has(a)||a===process.env.npm_lifecycle_event&&g.cwd===s.cwd||this.include.length>0&&!Oe.default.isMatch(F.structUtils.stringifyIdent(g.locator),this.include)||this.exclude.length>0&&Oe.default.isMatch(F.structUtils.stringifyIdent(g.locator),this.exclude)||this.publicOnly&&g.manifest.private===!0||f.push(g);let _=this.parallel?this.jobs==="unlimited"?1/0:Number(this.jobs)||Math.ceil(F.nodeUtils.availableParallelism()/2):1,y=_===1?!1:this.parallel,E=y?this.interlaced:!0,S=(0,Ar.default)(_),T=new Map,L=new Set,z=0,I=null,re=!1,K=await _e.StreamReport.start({configuration:t,stdout:this.context.stdout,includePrefix:!1},async g=>{let v=async(k,{commandIndex:l})=>{if(re)return-1;!y&&this.verbose&&l>1&&g.reportSeparator();let H=qn(k,{configuration:t,verbose:this.verbose,commandIndex:l}),[w,B]=dr(g,{prefix:H,interlaced:E}),[o,u]=dr(g,{prefix:H,interlaced:E});try{this.verbose&&g.reportInfo(null,`${H} Process started`);let P=Date.now(),b=await this.cli.run([this.commandName,...this.args],{cwd:k.cwd,stdout:w,stderr:o})||0;w.end(),o.end(),await B,await u;let V=Date.now();if(this.verbose){let J=t.get("enableTimers")?`, completed in ${F.formatUtils.pretty(t,V-P,F.formatUtils.Type.DURATION)}`:"";g.reportInfo(null,`${H} Process exited (exit code ${b})${J}`)}return b===130&&(re=!0,I=b),b}catch(P){throw w.end(),o.end(),await B,await u,P}};for(let k of f)T.set(k.anchoredLocator.locatorHash,k);for(;T.size>0&&!g.hasErrors();){let k=[];for(let[w,B]of T){if(L.has(B.anchoredDescriptor.descriptorHash))continue;let o=!0;if(this.topological||this.topologicalDev){let u=this.topologicalDev?new Map([...B.manifest.dependencies,...B.manifest.devDependencies]):B.manifest.dependencies;for(let P of u.values()){let b=n.tryWorkspaceByDescriptor(P);if(o=b===null||!T.has(b.anchoredLocator.locatorHash),!o)break}}if(!!o&&(L.add(B.anchoredDescriptor.descriptorHash),k.push(S(async()=>{let u=await v(B,{commandIndex:++z});return T.delete(w),L.delete(B.anchoredDescriptor.descriptorHash),u})),!y))break}if(k.length===0){let w=Array.from(T.values()).map(B=>F.structUtils.prettyLocator(t,B.anchoredLocator)).join(", ");g.reportError(_e.MessageName.CYCLIC_DEPENDENCIES,`Dependency cycle detected (${w})`);return}let H=(await Promise.all(k)).find(w=>w!==0);I===null&&(I=typeof H<"u"?1:I),(this.topological||this.topologicalDev)&&typeof H<"u"&&g.reportError(_e.MessageName.UNNAMED,"The command failed for workspaces that are depended upon by other workspaces; can't satisfy the dependency graph")}});return I!==null?I:K.exitCode()}};pe.paths=[["workspaces","foreach"]],pe.usage=U.Command.Usage({category:"Workspace-related commands",description:"run a command on all workspaces",details:"\n This command will run a given sub-command on current and all its descendant workspaces. Various flags can alter the exact behavior of the command:\n\n - If `-p,--parallel` is set, the commands will be ran in parallel; they'll by default be limited to a number of parallel tasks roughly equal to half your core number, but that can be overridden via `-j,--jobs`, or disabled by setting `-j unlimited`.\n\n - If `-p,--parallel` and `-i,--interlaced` are both set, Yarn will print the lines from the output as it receives them. If `-i,--interlaced` wasn't set, it would instead buffer the output from each process and print the resulting buffers only after their source processes have exited.\n\n - If `-t,--topological` is set, Yarn will only run the command after all workspaces that it depends on through the `dependencies` field have successfully finished executing. If `--topological-dev` is set, both the `dependencies` and `devDependencies` fields will be considered when figuring out the wait points.\n\n - If `-A,--all` is set, Yarn will run the command on all the workspaces of a project. By default yarn runs the command only on current and all its descendant workspaces.\n\n - If `-R,--recursive` is set, Yarn will find workspaces to run the command on by recursively evaluating `dependencies` and `devDependencies` fields, instead of looking at the `workspaces` fields.\n\n - If `--from` is set, Yarn will use the packages matching the 'from' glob as the starting point for any recursive search.\n\n - If `--since` is set, Yarn will only run the command on workspaces that have been modified since the specified ref. By default Yarn will use the refs specified by the `changesetBaseRefs` configuration option.\n\n - The command may apply to only some workspaces through the use of `--include` which acts as a whitelist. The `--exclude` flag will do the opposite and will be a list of packages that mustn't execute the script. Both flags accept glob patterns (if valid Idents and supported by [micromatch](https://github.com/micromatch/micromatch)). Make sure to escape the patterns, to prevent your own shell from trying to expand them.\n\n Adding the `-v,--verbose` flag will cause Yarn to print more information; in particular the name of the workspace that generated the output will be printed at the front of each line.\n\n If the command is `run` and the script being run does not exist the child workspace will be skipped without error.\n ",examples:[["Publish current and all descendant packages","yarn workspaces foreach npm publish --tolerate-republish"],["Run build script on current and all descendant packages","yarn workspaces foreach run build"],["Run build script on current and all descendant packages in parallel, building package dependencies first","yarn workspaces foreach -pt run build"],["Run build script on several packages and all their dependencies, building dependencies first","yarn workspaces foreach -ptR --from '{workspace-a,workspace-b}' run build"]]});function dr(e,{prefix:r,interlaced:t}){let n=e.createStreamReporter(r),s=new F.miscUtils.DefaultStream;s.pipe(n,{end:!1}),s.on("finish",()=>{n.end()});let i=new Promise(c=>{n.on("finish",()=>{c(s.active)})});if(t)return[s,i];let a=new F.miscUtils.BufferStream;return a.pipe(s,{end:!1}),a.on("finish",()=>{s.end()}),[a,i]}function qn(e,{configuration:r,commandIndex:t,verbose:n}){if(!n)return null;let i=`[${F.structUtils.stringifyIdent(e.locator)}]:`,a=["#2E86AB","#A23B72","#F18F01","#C73E1D","#CCE2A3"],c=a[t%a.length];return F.formatUtils.pretty(r,i,c)}var Kn={commands:[ce,pe]},Wn=Kn;return wr(jn);})(); 8 | /*! 9 | * fill-range 10 | * 11 | * Copyright (c) 2014-present, Jon Schlinkert. 12 | * Licensed under the MIT License. 13 | */ 14 | /*! 15 | * is-number 16 | * 17 | * Copyright (c) 2014-present, Jon Schlinkert. 18 | * Released under the MIT License. 19 | */ 20 | /*! 21 | * to-regex-range 22 | * 23 | * Copyright (c) 2015-present, Jon Schlinkert. 24 | * Released under the MIT License. 25 | */ 26 | return plugin; 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /.yarnrc.yml: -------------------------------------------------------------------------------- 1 | nodeLinker: node-modules 2 | nmHoistingLimits: workspaces 3 | 4 | plugins: 5 | - path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs 6 | spec: "@yarnpkg/plugin-interactive-tools" 7 | - path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs 8 | spec: "@yarnpkg/plugin-workspace-tools" 9 | 10 | yarnPath: .yarn/releases/yarn-3.6.1.cjs 11 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | 2 | # Contributor Covenant Code of Conduct 3 | 4 | ## Our Pledge 5 | 6 | We as members, contributors, and leaders pledge to make participation in our 7 | community a harassment-free experience for everyone, regardless of age, body 8 | size, visible or invisible disability, ethnicity, sex characteristics, gender 9 | identity and expression, level of experience, education, socio-economic status, 10 | nationality, personal appearance, race, caste, color, religion, or sexual 11 | identity and orientation. 12 | 13 | We pledge to act and interact in ways that contribute to an open, welcoming, 14 | diverse, inclusive, and healthy community. 15 | 16 | ## Our Standards 17 | 18 | Examples of behavior that contributes to a positive environment for our 19 | community include: 20 | 21 | * Demonstrating empathy and kindness toward other people 22 | * Being respectful of differing opinions, viewpoints, and experiences 23 | * Giving and gracefully accepting constructive feedback 24 | * Accepting responsibility and apologizing to those affected by our mistakes, 25 | and learning from the experience 26 | * Focusing on what is best not just for us as individuals, but for the overall 27 | community 28 | 29 | Examples of unacceptable behavior include: 30 | 31 | * The use of sexualized language or imagery, and sexual attention or advances of 32 | any kind 33 | * Trolling, insulting or derogatory comments, and personal or political attacks 34 | * Public or private harassment 35 | * Publishing others' private information, such as a physical or email address, 36 | without their explicit permission 37 | * Other conduct which could reasonably be considered inappropriate in a 38 | professional setting 39 | 40 | ## Enforcement Responsibilities 41 | 42 | Community leaders are responsible for clarifying and enforcing our standards of 43 | acceptable behavior and will take appropriate and fair corrective action in 44 | response to any behavior that they deem inappropriate, threatening, offensive, 45 | or harmful. 46 | 47 | Community leaders have the right and responsibility to remove, edit, or reject 48 | comments, commits, code, wiki edits, issues, and other contributions that are 49 | not aligned to this Code of Conduct, and will communicate reasons for moderation 50 | decisions when appropriate. 51 | 52 | ## Scope 53 | 54 | This Code of Conduct applies within all community spaces, and also applies when 55 | an individual is officially representing the community in public spaces. 56 | Examples of representing our community include using an official e-mail address, 57 | posting via an official social media account, or acting as an appointed 58 | representative at an online or offline event. 59 | 60 | ## Enforcement 61 | 62 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 63 | reported to the community leaders responsible for enforcement at 64 | [INSERT CONTACT METHOD]. 65 | All complaints will be reviewed and investigated promptly and fairly. 66 | 67 | All community leaders are obligated to respect the privacy and security of the 68 | reporter of any incident. 69 | 70 | ## Enforcement Guidelines 71 | 72 | Community leaders will follow these Community Impact Guidelines in determining 73 | the consequences for any action they deem in violation of this Code of Conduct: 74 | 75 | ### 1. Correction 76 | 77 | **Community Impact**: Use of inappropriate language or other behavior deemed 78 | unprofessional or unwelcome in the community. 79 | 80 | **Consequence**: A private, written warning from community leaders, providing 81 | clarity around the nature of the violation and an explanation of why the 82 | behavior was inappropriate. A public apology may be requested. 83 | 84 | ### 2. Warning 85 | 86 | **Community Impact**: A violation through a single incident or series of 87 | actions. 88 | 89 | **Consequence**: A warning with consequences for continued behavior. No 90 | interaction with the people involved, including unsolicited interaction with 91 | those enforcing the Code of Conduct, for a specified period of time. This 92 | includes avoiding interactions in community spaces as well as external channels 93 | like social media. Violating these terms may lead to a temporary or permanent 94 | ban. 95 | 96 | ### 3. Temporary Ban 97 | 98 | **Community Impact**: A serious violation of community standards, including 99 | sustained inappropriate behavior. 100 | 101 | **Consequence**: A temporary ban from any sort of interaction or public 102 | communication with the community for a specified period of time. No public or 103 | private interaction with the people involved, including unsolicited interaction 104 | with those enforcing the Code of Conduct, is allowed during this period. 105 | Violating these terms may lead to a permanent ban. 106 | 107 | ### 4. Permanent Ban 108 | 109 | **Community Impact**: Demonstrating a pattern of violation of community 110 | standards, including sustained inappropriate behavior, harassment of an 111 | individual, or aggression toward or disparagement of classes of individuals. 112 | 113 | **Consequence**: A permanent ban from any sort of public interaction within the 114 | community. 115 | 116 | ## Attribution 117 | 118 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 119 | version 2.1, available at 120 | [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. 121 | 122 | Community Impact Guidelines were inspired by 123 | [Mozilla's code of conduct enforcement ladder][Mozilla CoC]. 124 | 125 | For answers to common questions about this code of conduct, see the FAQ at 126 | [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at 127 | [https://www.contributor-covenant.org/translations][translations]. 128 | 129 | [homepage]: https://www.contributor-covenant.org 130 | [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html 131 | [Mozilla CoC]: https://github.com/mozilla/diversity 132 | [FAQ]: https://www.contributor-covenant.org/faq 133 | [translations]: https://www.contributor-covenant.org/translations 134 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Contributions are always welcome, no matter how large or small! 4 | 5 | We want this community to be friendly and respectful to each other. Please follow it in all your interactions with the project. Before contributing, please read the [code of conduct](./CODE_OF_CONDUCT.md). 6 | 7 | ## Development workflow 8 | 9 | This project is a monorepo managed using [Yarn workspaces](https://yarnpkg.com/features/workspaces). It contains the following packages: 10 | 11 | - The library package in the root directory. 12 | - An example app in the `example/` directory. 13 | 14 | To get started with the project, run `yarn` in the root directory to install the required dependencies for each package: 15 | 16 | ```sh 17 | yarn 18 | ``` 19 | 20 | > Since the project relies on Yarn workspaces, you cannot use [`npm`](https://github.com/npm/cli) for development. 21 | 22 | The [example app](/example/) demonstrates usage of the library. You need to run it to test any changes you make. 23 | 24 | It is configured to use the local version of the library, so any changes you make to the library's source code will be reflected in the example app. Changes to the library's JavaScript code will be reflected in the example app without a rebuild, but native code changes will require a rebuild of the example app. 25 | 26 | You can use various commands from the root directory to work with the project. 27 | 28 | To start the packager: 29 | 30 | ```sh 31 | yarn example start 32 | ``` 33 | 34 | To run the example app on Android: 35 | 36 | ```sh 37 | yarn example android 38 | ``` 39 | 40 | To run the example app on iOS: 41 | 42 | ```sh 43 | yarn example ios 44 | ``` 45 | 46 | To run the example app on Web: 47 | 48 | ```sh 49 | yarn example web 50 | ``` 51 | 52 | Make sure your code passes TypeScript and ESLint. Run the following to verify: 53 | 54 | ```sh 55 | yarn typecheck 56 | yarn lint 57 | ``` 58 | 59 | To fix formatting errors, run the following: 60 | 61 | ```sh 62 | yarn lint --fix 63 | ``` 64 | 65 | Remember to add tests for your change if possible. Run the unit tests by: 66 | 67 | ```sh 68 | yarn test 69 | ``` 70 | 71 | ### Commit message convention 72 | 73 | We follow the [conventional commits specification](https://www.conventionalcommits.org/en) for our commit messages: 74 | 75 | - `fix`: bug fixes, e.g. fix crash due to deprecated method. 76 | - `feat`: new features, e.g. add new method to the module. 77 | - `refactor`: code refactor, e.g. migrate from class components to hooks. 78 | - `docs`: changes into documentation, e.g. add usage example for the module.. 79 | - `test`: adding or updating tests, e.g. add integration tests using detox. 80 | - `chore`: tooling changes, e.g. change CI config. 81 | 82 | Our pre-commit hooks verify that your commit message matches this format when committing. 83 | 84 | ### Linting and tests 85 | 86 | [ESLint](https://eslint.org/), [Prettier](https://prettier.io/), [TypeScript](https://www.typescriptlang.org/) 87 | 88 | We use [TypeScript](https://www.typescriptlang.org/) for type checking, [ESLint](https://eslint.org/) with [Prettier](https://prettier.io/) for linting and formatting the code, and [Jest](https://jestjs.io/) for testing. 89 | 90 | Our pre-commit hooks verify that the linter and tests pass when committing. 91 | 92 | ### Publishing to npm 93 | 94 | We use [release-it](https://github.com/release-it/release-it) to make it easier to publish new versions. It handles common tasks like bumping version based on semver, creating tags and releases etc. 95 | 96 | To publish new versions, run the following: 97 | 98 | ```sh 99 | yarn release 100 | ``` 101 | 102 | ### Scripts 103 | 104 | The `package.json` file contains various scripts for common tasks: 105 | 106 | - `yarn`: setup project by installing dependencies. 107 | - `yarn typecheck`: type-check files with TypeScript. 108 | - `yarn lint`: lint files with ESLint. 109 | - `yarn test`: run unit tests with Jest. 110 | - `yarn example start`: start the Metro server for the example app. 111 | - `yarn example android`: run the example app on Android. 112 | - `yarn example ios`: run the example app on iOS. 113 | 114 | ### Sending a pull request 115 | 116 | > **Working on your first pull request?** You can learn how from this _free_ series: [How to Contribute to an Open Source Project on GitHub](https://app.egghead.io/playlists/how-to-contribute-to-an-open-source-project-on-github). 117 | 118 | When you're sending a pull request: 119 | 120 | - Prefer small pull requests focused on one change. 121 | - Verify that linters and tests are passing. 122 | - Review the documentation to make sure it looks good. 123 | - Follow the pull request template when opening a pull request. 124 | - For pull requests that change the API or implementation, discuss with maintainers first by opening an issue. 125 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Felipe Rodriguez Esturo 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # react-native-animated-dots-carousel 2 | 3 | ![versión npm](https://img.shields.io/npm/v/react-native-animated-dots-carousel.svg?color=68d5f7) 4 | ![Download npm](https://img.shields.io/npm/dw/react-native-animated-dots-carousel.svg?color=7551bb) 5 | [![MIT License][license-shield]][license-url] 6 | 7 | 8 | ## Table of Contents 9 | 10 | * [About the Project](#about-the-project) 11 | * [Built With](#built-with) 12 | * [Getting Started](#getting-started) 13 | * [Installation](#installation) 14 | * [Usage](#usage) 15 | * [Api Reference](#api-reference) 16 | * [Roadmap](#roadmap) 17 | * [Contributing](#contributing) 18 | * [License](#license) 19 | * [Contact](#contact) 20 | 21 | 22 | 23 | 24 | ## About The Project 25 | 26 | Package to configure you dots pagination carousel just like Instagram does. 27 | With this package you could make whatever configuration you might need on your projects. 28 | 29 | ## Examples 30 | 31 | Example 32 | 33 | Example 34 | 35 | Example 36 | 37 | Example 38 | 39 | Example 40 | 41 | Example 42 | 43 | 44 | ## Getting Started 45 | 46 | ### Installation 47 | 48 | Installation can be done through `npm` or `yarn`: 49 | 50 | For React < 17, use version `1.0.2` or below 51 | ```shell 52 | npm i react-native-animated-dots-carousel --save 53 | ``` 54 | 55 | ```shell 56 | yarn add react-native-animated-dots-carousel 57 | ``` 58 | 59 | In order to use version `2.0.0` or above, you will need `react-native-reanimated` >= 3.0.0 and `react-native-gesture-handle` >= 2.0.0 and React >= 17 60 | 61 | ## Usage 62 | 63 | ```js 64 | const { width } = Dimensions.get('window'); 65 | 66 | const images = [ 67 | { id: '1', uri: 'https://via.placeholder.com/800x400.png?text=Image+1' }, 68 | { id: '2', uri: 'https://via.placeholder.com/800x400.png?text=Image+2' }, 69 | { id: '3', uri: 'https://via.placeholder.com/800x400.png?text=Image+3' }, 70 | { id: '4', uri: 'https://via.placeholder.com/800x400.png?text=Image+4' }, 71 | { id: '5', uri: 'https://via.placeholder.com/800x400.png?text=Image+5' }, 72 | { id: '6', uri: 'https://via.placeholder.com/800x400.png?text=Image+6' }, 73 | { id: '7', uri: 'https://via.placeholder.com/800x400.png?text=Image+7' }, 74 | { id: '8', uri: 'https://via.placeholder.com/800x400.png?text=Image+8' }, 75 | { id: '9', uri: 'https://via.placeholder.com/800x400.png?text=Image+9' }, 76 | { id: '10', uri: 'https://via.placeholder.com/800x400.png?text=Image+10' }, 77 | ]; 78 | 79 | export default function App() { 80 | const [index, setIndex] = React.useState(0); 81 | const scrollViewRef = React.useRef(null); 82 | 83 | const handleScroll = (event: NativeSyntheticEvent) => { 84 | const contentOffsetX = event.nativeEvent.contentOffset.x; 85 | const finalIndex = Math.floor(contentOffsetX / width); 86 | setIndex(finalIndex); 87 | }; 88 | 89 | return ( 90 | 91 | 92 | 104 | {images.map((image) => ( 105 | 113 | 121 | 122 | ))} 123 | 124 | 125 | { 130 | scrollViewRef?.current?.scrollTo?.({ 131 | x: newIndex * width, 132 | animated: false, 133 | }); 134 | }, 135 | containerBackgroundColor: 'rgba(230,230,230, 0.5)', 136 | container: { 137 | alignItems: 'center', 138 | borderRadius: 15, 139 | height: 30, 140 | justifyContent: 'center', 141 | paddingHorizontal: 15, 142 | } 143 | }} 144 | currentIndex={index} 145 | maxIndicators={4} 146 | interpolateOpacityAndColor={true} 147 | activeIndicatorConfig={{ 148 | color: 'red', 149 | margin: 3, 150 | opacity: 1, 151 | size: 8, 152 | }} 153 | inactiveIndicatorConfig={{ 154 | color: 'white', 155 | margin: 3, 156 | opacity: 0.5, 157 | size: 8, 158 | }} 159 | decreasingDots={[ 160 | { 161 | config: { color: 'white', margin: 3, opacity: 0.5, size: 6 }, 162 | quantity: 1, 163 | }, 164 | { 165 | config: { color: 'white', margin: 3, opacity: 0.5, size: 4 }, 166 | quantity: 1, 167 | }, 168 | ]} 169 | /> 170 | 171 | 172 | 173 | ); 174 | } 175 | 176 | const styles = StyleSheet.create({ 177 | container: { 178 | flex: 1, 179 | alignItems: 'center', 180 | justifyContent: 'center', 181 | backgroundColor: 'black', 182 | }, 183 | }); 184 | ``` 185 | 186 | 187 | ### Api Reference 188 | 189 | #### DotConfig Interface 190 | ```js 191 | export interface DotConfig { 192 | size: number; 193 | opacity: number; 194 | color: string; 195 | margin: number; 196 | borderWidth?: number; 197 | borderColor?: string; 198 | } 199 | ``` 200 | 201 | #### DecreasingDot Interface 202 | 203 | ```js 204 | export interface DecreasingDot { 205 | quantity: number; 206 | config: DotConfig; 207 | } 208 | 209 | export interface ScrollableDotConfig { 210 | setIndex: Dispatch>; 211 | onNewIndex?: (index: number) => void; 212 | containerBackgroundColor: string; 213 | scrollableDotsContainer?: StyleProp; 214 | } 215 | 216 | ``` 217 | #### Props 218 | 219 | | **Prop** | **Type** | **Required(Default Value)** | **Description** | 220 | | --------------------------- | ----------------------------| ---------------------------- | --------------------------------------------------- | 221 | | `length` | `number` | required | Length of the list you want to associate with the carousel dots | 222 | | `currentIndex` | `number` | required | Current index of the list. | 223 | | `maxIndicators` | `number` | required | This number represents how many indicators you want to show, without decreasing size. Counting inactive indicators and the active indicator | 224 | | `activeIndicatorConfig` | `DotConfig` | required | This is an object with the configuration of the active indicator | 225 | | `inactiveIndicatorConfig` | `DotConfig` | required | This is an object with the configuration of the inactive indicator | 226 | | `decreasingDots` | `DecreasingDot[]` | required | This is a list where you have to define the quantiy per element and the dot config. The quantity represents how many dots with this config you want per side (simetrically). The size of this elements should be decreasing size if you want this to look nice. 227 | | `verticalOrientation` | `boolean` | false | If you want this oriented vertically or horizontally. Default is horizontally 228 | | `interpolateOpacityAndColor` | `boolean` | true | Default is true. With this setted to true you will be able to see an animation everytime the activeDot change. | 229 | | `duration` | `number` | 500 | Duration of the dots transition | 230 | | `scrollableDotsConfig` | `ScrollableDotConfig` | optional | This is used if you want the Scrollable Gesture animation on the dots (as in the first gif of the README), read the example of using in order to understand how to implement it | 231 | 232 | ##### Scrollable Dots Config - Props Explanation 233 | 234 | - `setIndex`: Setter function returned by `useState`, it should be the setter function associated to the index handler that you have for your carousel 235 | - `onNewIndex`: Function that will receive the new index every time it changes while scrolling, you should use this function to update your Carousel to the correct index or for whatever else you want 236 | - `containerBackgroundColor`: It is the background color that you will use for your container (it will show when you are doing the gesture, check the gifs above this README) 237 | - `container`: It is the way you want that container shown on the gifs above to look like, how much border you want on it, the padding, the margins, etc. 238 | 239 | 240 | ## Roadmap 241 | 242 | See the [open issues](https://github.com/felire/react-native-animated-dots-carousel/issues) for a list of proposed features (and known issues). 243 | 244 | 245 | 246 | 247 | ## Contributing 248 | 249 | Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**. 250 | 251 | 1. Fork the Project 252 | 2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`) 253 | 3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`) 254 | 4. Push to the Branch (`git push origin feature/AmazingFeature`) 255 | 5. Open a Pull Request 256 | 257 | 258 | 259 | 260 | ## License 261 | 262 | Distributed under the MIT License. See `LICENSE` for more information. 263 | 264 | 265 | 266 | 267 | ## Contact 268 | 269 | Project Link: [https://github.com/felire/react-native-animated-dots-carousel](https://github.com/felire/react-native-animated-dots-carousel) 270 | 271 | 272 | 273 | 274 | 275 | [license-shield]: https://img.shields.io/github/license/othneildrew/Best-README-Template.svg?style=flat-square 276 | [license-url]: https://github.com/felire/react-native-animated-dots-carousel/blob/master/LICENSE -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | ['module:react-native-builder-bob/babel-preset', { modules: 'commonjs' }], 4 | ], 5 | }; 6 | -------------------------------------------------------------------------------- /example/App.js: -------------------------------------------------------------------------------- 1 | export { default } from './src/App'; 2 | -------------------------------------------------------------------------------- /example/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "expo": { 3 | "name": "example", 4 | "slug": "example", 5 | "version": "1.0.0", 6 | "orientation": "portrait", 7 | "icon": "./assets/icon.png", 8 | "userInterfaceStyle": "light", 9 | "splash": { 10 | "image": "./assets/splash.png", 11 | "resizeMode": "contain", 12 | "backgroundColor": "#ffffff" 13 | }, 14 | "ios": { 15 | "supportsTablet": true, 16 | "bundleIdentifier": "animateddotscarousel.example" 17 | }, 18 | "android": { 19 | "adaptiveIcon": { 20 | "foregroundImage": "./assets/adaptive-icon.png", 21 | "backgroundColor": "#ffffff" 22 | }, 23 | "package": "animateddotscarousel.example" 24 | }, 25 | "web": { 26 | "favicon": "./assets/favicon.png" 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /example/assets/adaptive-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felire/react-native-animated-dots-carousel/67f477e7eff37ef3a1ae02efe4ee127b520a1856/example/assets/adaptive-icon.png -------------------------------------------------------------------------------- /example/assets/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felire/react-native-animated-dots-carousel/67f477e7eff37ef3a1ae02efe4ee127b520a1856/example/assets/favicon.png -------------------------------------------------------------------------------- /example/assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felire/react-native-animated-dots-carousel/67f477e7eff37ef3a1ae02efe4ee127b520a1856/example/assets/icon.png -------------------------------------------------------------------------------- /example/assets/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/felire/react-native-animated-dots-carousel/67f477e7eff37ef3a1ae02efe4ee127b520a1856/example/assets/splash.png -------------------------------------------------------------------------------- /example/babel.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const { getConfig } = require('react-native-builder-bob/babel-config'); 3 | 4 | const pkg = require('../package.json'); 5 | 6 | const root = path.resolve(__dirname, '..'); 7 | 8 | module.exports = function (api) { 9 | api.cache(true); 10 | 11 | return getConfig( 12 | { 13 | presets: ['babel-preset-expo'], 14 | }, 15 | { root, pkg } 16 | ); 17 | }; 18 | -------------------------------------------------------------------------------- /example/metro.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const { getConfig } = require('react-native-builder-bob/metro-config'); 3 | const { getDefaultConfig } = require('@expo/metro-config'); 4 | 5 | const pkg = require('../package.json'); 6 | 7 | const root = path.resolve(__dirname, '..'); 8 | 9 | /** 10 | * Metro configuration 11 | * https://facebook.github.io/metro/docs/configuration 12 | * 13 | * @type {import('metro-config').MetroConfig} 14 | */ 15 | module.exports = getConfig(getDefaultConfig(__dirname), { 16 | root, 17 | pkg, 18 | project: __dirname, 19 | }); 20 | -------------------------------------------------------------------------------- /example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-animated-dots-carousel-example", 3 | "version": "1.0.0", 4 | "main": "expo/AppEntry.js", 5 | "scripts": { 6 | "start": "expo start", 7 | "android": "expo start --android", 8 | "ios": "expo start --ios", 9 | "web": "expo start --web" 10 | }, 11 | "dependencies": { 12 | "@expo/metro-runtime": "~3.2.3", 13 | "expo": "~51.0.28", 14 | "expo-status-bar": "~1.12.1", 15 | "react": "18.2.0", 16 | "react-dom": "18.2.0", 17 | "react-native": "0.74.5", 18 | "react-native-gesture-handler": "^2.20.0", 19 | "react-native-reanimated": "3.10.1", 20 | "react-native-web": "~0.19.10" 21 | }, 22 | "devDependencies": { 23 | "@babel/core": "^7.20.0", 24 | "react-native-builder-bob": "^0.30.2" 25 | }, 26 | "private": true 27 | } 28 | -------------------------------------------------------------------------------- /example/src/App.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import { 3 | StyleSheet, 4 | SafeAreaView, 5 | Dimensions, 6 | ScrollView, 7 | View, 8 | Image, 9 | type NativeSyntheticEvent, 10 | type NativeScrollEvent, 11 | } from 'react-native'; 12 | import AnimatedDotsCarousel from 'react-native-animated-dots-carousel'; 13 | import { GestureHandlerRootView } from 'react-native-gesture-handler'; 14 | 15 | const { width } = Dimensions.get('window'); 16 | 17 | const images = [ 18 | { 19 | id: '1', 20 | uri: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPsAAADJCAMAAADSHrQyAAAAdVBMVEX+/v4AAAD////e3t58fHzZ2dnr6+uSkpJTU1NnZ2dxcXFZWVnx8fHk5OSsrKzn5+e/v78bGxtLS0ubm5s3NzchISHHx8fMzMwNDQ3S0tJhYWEwMDChoaFEREQ9PT2MjIyysrKFhYV3d3cmJia4uLgXFxcyMjL6RleWAAARRUlEQVR4nO2d6YKqOgyAS1hUBHcREXec93/EC7RlaZtCcc4dnTF/7rlTAnx2S9OkEOvvCvnpF/hB+bD/Tfmw/00h2X6/d41lX4q5nvsjeoiQOYB7Sc1ktgggFzsdGcp6X+iRmaneKCOF4m5tqpfOARcSQmrdD18HA/k6WGMPIIrv46mZHKwLQLCyVoZ6R8vPf+21tTHUGy+3LhBU5jsrDUzFPU2Id3cCovlVVRKsrRBuW9tUj+ysNUTWzFjPSzYEh/eco+ENC8liL8ox+CPER6LvGMQXiFP0VQP5T+y/1zGMjkT6M/b/lewtW8PuJ2hhFCBFsI/taImVkmiGFABsZmAtsLu6sxArWq9ghL4ouOgt5wPZYTaMPR/MsDsSHXv+QC37FAW8ZN/OnnnD6j3bo7+Ktt6DHaqoZfd2s+9mJzP0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C0AFoALQAWgAtABaAC0AFoALQAWgAtABaAC0AFoALQAWgAtABaAFKaRjdUFgWNgSbDtMASC6BmHMPJOzY99vUP3uvGMgbnRjWlm6+UtaxOVwDzsunde0ZB1dFObZpmL7ctgPnWtvtt2xjIAaKfigy2kkDYTa5GRyhkDWfJwMVNiQbZZjvjIPFoAIAfydNVCSxKWayyx6IsB52IXsLmxzF9lzxjGALPrHWGxNRMuAQDcA2OAnMDP+GlicxgW1rCGAeJ2nqp7YpzG3G3+Ysy2zMY0U23YRbLKGAcfT1SWVzOYsr40OXNcIJYZRay80AWAtkOEAem1hqyApqJhAGGxN7jCUs1/O5rEZ3uMoYBGRkBABABABABABABABABABABABABABABABABABABABABABABAC0gS88eO+7Dh4b79NoAUHgP8A5bX/ACXtbZ3wAeQ4Tf8AZAHPI3/9S27zb3z/ALfGAEJlrnDe269r9toA8wAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQB//9k=', 25 | }, 26 | { id: '3', uri: 'https://via.placeholder.com/800x400.png?text=Image+3' }, 27 | { id: '4', uri: 'https://via.placeholder.com/800x400.png?text=Image+4' }, 28 | { id: '5', uri: 'https://via.placeholder.com/800x400.png?text=Image+5' }, 29 | { id: '6', uri: 'https://via.placeholder.com/800x400.png?text=Image+6' }, 30 | { id: '7', uri: 'https://via.placeholder.com/800x400.png?text=Image+7' }, 31 | { id: '8', uri: 'https://via.placeholder.com/800x400.png?text=Image+8' }, 32 | { id: '9', uri: 'https://via.placeholder.com/800x400.png?text=Image+9' }, 33 | { id: '10', uri: 'https://via.placeholder.com/800x400.png?text=Image+10' }, 34 | ]; 35 | 36 | export default function App() { 37 | const [index, setIndex] = React.useState(0); 38 | const scrollViewRef = React.useRef(null); 39 | 40 | const handleScroll = (event: NativeSyntheticEvent) => { 41 | const contentOffsetX = event.nativeEvent.contentOffset.x; 42 | const finalIndex = Math.floor(contentOffsetX / width); 43 | setIndex(finalIndex); 44 | }; 45 | 46 | return ( 47 | 48 | 49 | 61 | {images.map((image) => ( 62 | 70 | 78 | 79 | ))} 80 | 81 | 82 | { 87 | scrollViewRef?.current?.scrollTo?.({ 88 | x: newIndex * width, 89 | animated: false, 90 | }); 91 | }, 92 | containerBackgroundColor: 'rgba(230,230,230, 0.5)', 93 | container: { 94 | alignItems: 'center', 95 | borderRadius: 15, 96 | height: 30, 97 | justifyContent: 'center', 98 | paddingHorizontal: 15, 99 | }, 100 | }} 101 | currentIndex={index} 102 | maxIndicators={4} 103 | interpolateOpacityAndColor={true} 104 | activeIndicatorConfig={{ 105 | color: 'red', 106 | margin: 3, 107 | opacity: 1, 108 | size: 8, 109 | }} 110 | inactiveIndicatorConfig={{ 111 | color: 'white', 112 | margin: 3, 113 | opacity: 0.5, 114 | size: 8, 115 | }} 116 | decreasingDots={[ 117 | { 118 | config: { color: 'white', margin: 3, opacity: 0.5, size: 6 }, 119 | quantity: 1, 120 | }, 121 | { 122 | config: { color: 'white', margin: 3, opacity: 0.5, size: 4 }, 123 | quantity: 1, 124 | }, 125 | ]} 126 | /> 127 | 128 | 129 | 130 | ); 131 | } 132 | 133 | const styles = StyleSheet.create({ 134 | container: { 135 | flex: 1, 136 | alignItems: 'center', 137 | justifyContent: 'center', 138 | backgroundColor: 'black', 139 | }, 140 | }); 141 | -------------------------------------------------------------------------------- /example/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig", 3 | "compilerOptions": { 4 | // Avoid expo-cli auto-generating a tsconfig 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /lefthook.yml: -------------------------------------------------------------------------------- 1 | pre-commit: 2 | parallel: true 3 | commands: 4 | lint: 5 | glob: "*.{js,ts,jsx,tsx}" 6 | run: npx eslint {staged_files} 7 | types: 8 | glob: "*.{js,ts, jsx, tsx}" 9 | run: npx tsc 10 | commit-msg: 11 | parallel: true 12 | commands: 13 | commitlint: 14 | run: npx commitlint --edit 15 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-animated-dots-carousel", 3 | "version": "2.0.1", 4 | "description": "Package to configure your dots pagination carousel just like Instagram does", 5 | "source": "src/index.tsx", 6 | "main": "src/index.tsx", 7 | "module": "src/index.tsx", 8 | "types": "src/index.d.ts", 9 | "exports": { 10 | ".": { 11 | "import": { 12 | "types": "./src/index.d.ts", 13 | "default": "./src/index.tsx" 14 | }, 15 | "require": { 16 | "types": "./src/index.d.ts", 17 | "default": "./src/index.tsx" 18 | } 19 | } 20 | }, 21 | "files": [ 22 | "src", 23 | "android", 24 | "ios", 25 | "cpp", 26 | "*.podspec", 27 | "!ios/build", 28 | "!android/build", 29 | "!android/gradle", 30 | "!android/gradlew", 31 | "!android/gradlew.bat", 32 | "!android/local.properties", 33 | "!**/__tests__", 34 | "!**/__fixtures__", 35 | "!**/__mocks__", 36 | "!**/.*" 37 | ], 38 | "scripts": { 39 | "example": "yarn workspace react-native-animated-dots-carousel-example", 40 | "test": "jest", 41 | "typecheck": "tsc", 42 | "lint": "eslint \"**/*.{js,ts,tsx}\"", 43 | "clean": "del-cli lib", 44 | "release": "release-it" 45 | }, 46 | "keywords": [ 47 | "react-native", 48 | "ios", 49 | "android" 50 | ], 51 | "repository": { 52 | "type": "git", 53 | "url": "git+https://github.com/felire/react-native-animated-dots-carousel.git" 54 | }, 55 | "author": "Felipe Rodriguez Esturo (https://github.com/felire)", 56 | "license": "MIT", 57 | "bugs": { 58 | "url": "https://github.com/felire/react-native-animated-dots-carousel/issues" 59 | }, 60 | "homepage": "https://github.com/felire/react-native-animated-dots-carousel#readme", 61 | "publishConfig": { 62 | "registry": "https://registry.npmjs.org/" 63 | }, 64 | "devDependencies": { 65 | "@commitlint/config-conventional": "^17.0.2", 66 | "@evilmartians/lefthook": "^1.5.0", 67 | "@react-native/eslint-config": "^0.73.1", 68 | "@release-it/conventional-changelog": "^5.0.0", 69 | "@types/jest": "^29.5.5", 70 | "@types/react": "^18.2.44", 71 | "commitlint": "^17.0.2", 72 | "del-cli": "^5.1.0", 73 | "eslint": "^8.46.0", 74 | "eslint-import-resolver-babel-module": "^5.3.2", 75 | "eslint-plugin-babel": "^5.3.1", 76 | "eslint-plugin-ft-flow": "^3.0.1", 77 | "eslint-plugin-import": "^2.27.5", 78 | "eslint-plugin-jest": "^27.6.0", 79 | "eslint-plugin-module-resolver": "^1.5.0", 80 | "eslint-plugin-prettier": "^4.2.1", 81 | "jest": "^29.7.0", 82 | "prettier": "^2.8.8", 83 | "react": "18.2.0", 84 | "react-native": "0.74.5", 85 | "react-native-builder-bob": "^0.30.2", 86 | "react-native-gesture-handler": "^2.20.0", 87 | "react-native-reanimated": "^3.15.4", 88 | "release-it": "^15.0.0", 89 | "typescript": "5.1.6" 90 | }, 91 | "resolutions": { 92 | "@types/react": "^18.2.44" 93 | }, 94 | "peerDependencies": { 95 | "react": "*", 96 | "react-native": "*", 97 | "react-native-gesture-handler": "*", 98 | "react-native-reanimated": "*" 99 | }, 100 | "workspaces": [ 101 | "example" 102 | ], 103 | "packageManager": "yarn@3.6.1", 104 | "jest": { 105 | "preset": "react-native", 106 | "modulePathIgnorePatterns": [ 107 | "/example/node_modules", 108 | "/lib/" 109 | ] 110 | }, 111 | "commitlint": { 112 | "extends": [ 113 | "@commitlint/config-conventional" 114 | ] 115 | }, 116 | "release-it": { 117 | "git": { 118 | "commitMessage": "chore: release ${version}", 119 | "tagName": "v${version}" 120 | }, 121 | "npm": { 122 | "publish": true 123 | }, 124 | "github": { 125 | "release": true 126 | }, 127 | "plugins": { 128 | "@release-it/conventional-changelog": { 129 | "preset": "angular" 130 | } 131 | } 132 | }, 133 | "eslintConfig": { 134 | "root": true, 135 | "extends": [ 136 | "@react-native", 137 | "prettier" 138 | ], 139 | "rules": { 140 | "react/react-in-jsx-scope": "off", 141 | "prettier/prettier": [ 142 | "error", 143 | { 144 | "quoteProps": "consistent", 145 | "singleQuote": true, 146 | "tabWidth": 2, 147 | "trailingComma": "es5", 148 | "useTabs": false 149 | } 150 | ] 151 | } 152 | }, 153 | "eslintIgnore": [ 154 | "node_modules/", 155 | "lib/" 156 | ], 157 | "prettier": { 158 | "quoteProps": "consistent", 159 | "singleQuote": true, 160 | "tabWidth": 2, 161 | "trailingComma": "es5", 162 | "useTabs": false 163 | }, 164 | "react-native-builder-bob": { 165 | "source": "src", 166 | "output": "lib", 167 | "targets": [ 168 | [ 169 | "commonjs", 170 | { 171 | "esm": true 172 | } 173 | ], 174 | [ 175 | "module", 176 | { 177 | "esm": true 178 | } 179 | ], 180 | [ 181 | "typescript", 182 | { 183 | "project": "tsconfig.build.json", 184 | "esm": true 185 | } 186 | ] 187 | ] 188 | }, 189 | "create-react-native-library": { 190 | "type": "library", 191 | "version": "0.41.2" 192 | } 193 | } 194 | -------------------------------------------------------------------------------- /src/CarouselDots/Dot/index.tsx: -------------------------------------------------------------------------------- 1 | import { useEffect, useState, useMemo } from 'react'; 2 | import Animated, { 3 | useSharedValue, 4 | withTiming, 5 | interpolate, 6 | interpolateColor, 7 | useAnimatedStyle, 8 | } from 'react-native-reanimated'; 9 | import type { CarouselState, DecreasingDot, DotConfig } from '../interface'; 10 | 11 | import usePrevious from '../use-previous'; 12 | 13 | import { getDotStyle } from './utils'; 14 | 15 | interface Dot { 16 | maxIndicators: number; 17 | activeIndicatorConfig: DotConfig; 18 | inactiveIndicatorConfig: DotConfig; 19 | decreasingDots: DecreasingDot[]; 20 | index: number; 21 | carouselState: CarouselState; 22 | verticalOrientation: boolean; 23 | interpolateOpacityAndColor: boolean; 24 | duration: number; 25 | length: number; 26 | } 27 | 28 | const Dot = ({ 29 | maxIndicators, 30 | activeIndicatorConfig, 31 | inactiveIndicatorConfig, 32 | decreasingDots, 33 | index, 34 | carouselState, 35 | verticalOrientation, 36 | interpolateOpacityAndColor, 37 | duration, 38 | length, 39 | }: Dot): JSX.Element => { 40 | const { currentIndex, state } = carouselState; 41 | 42 | const calculatedStyles = useMemo(() => { 43 | const dotStylesMap = new Map(); 44 | for (let stateI = 0; stateI <= maxIndicators; stateI++) { 45 | for (let currentIndexJ = 0; currentIndexJ <= length; currentIndexJ++) { 46 | const dotStyle = getDotStyle({ 47 | activeIndicatorConfig, 48 | currentIndex: currentIndexJ, 49 | decreasingDots, 50 | inactiveIndicatorConfig, 51 | index, 52 | indicatorState: stateI, 53 | maxIndicators, 54 | }); 55 | dotStylesMap.set(`${stateI}-${currentIndexJ}`, dotStyle); 56 | } 57 | } 58 | return dotStylesMap; 59 | }, [ 60 | activeIndicatorConfig, 61 | decreasingDots, 62 | inactiveIndicatorConfig, 63 | index, 64 | maxIndicators, 65 | length, 66 | ]); 67 | const [type, setType] = useState( 68 | calculatedStyles.get(`${state}-${currentIndex}`)! 69 | ); 70 | const prevType = usePrevious(type, type); 71 | const animatedValue = useSharedValue(0); 72 | 73 | useEffect(() => { 74 | setType(calculatedStyles.get(`${state}-${currentIndex}`)!); 75 | }, [calculatedStyles, currentIndex, state]); 76 | 77 | useEffect(() => { 78 | animatedValue.value = 0; 79 | animatedValue.value = withTiming(1, { duration }); 80 | }, [animatedValue, currentIndex, duration]); 81 | 82 | const animatedStyle = useAnimatedStyle(() => { 83 | const size = interpolate( 84 | animatedValue.value, 85 | [0, 1], 86 | [prevType.size, type.size] 87 | ); 88 | 89 | const backgroundColorInterpolated = interpolateColor( 90 | animatedValue.value, 91 | [0, 1], 92 | [prevType.color, type.color] 93 | ); 94 | 95 | const opacityInterpolated = interpolate( 96 | animatedValue.value, 97 | [0, 1], 98 | [prevType.opacity, type.opacity] 99 | ); 100 | return { 101 | backgroundColor: interpolateOpacityAndColor 102 | ? backgroundColorInterpolated 103 | : type.color, 104 | opacity: interpolateOpacityAndColor ? opacityInterpolated : type.opacity, 105 | height: size, 106 | width: size, 107 | }; 108 | }); 109 | return ( 110 | 122 | ); 123 | }; 124 | 125 | export default Dot; 126 | -------------------------------------------------------------------------------- /src/CarouselDots/Dot/utils.ts: -------------------------------------------------------------------------------- 1 | import type { DecreasingDot, DotConfig } from '../interface'; 2 | 3 | interface GetDotStyle { 4 | index: number; 5 | currentIndex: number; 6 | maxIndicators: number; 7 | activeIndicatorConfig: DotConfig; 8 | inactiveIndicatorConfig: DotConfig; 9 | decreasingDots: DecreasingDot[]; 10 | indicatorState: number; 11 | } 12 | 13 | export const getDotStyle = ({ 14 | index, 15 | currentIndex, 16 | maxIndicators, 17 | activeIndicatorConfig, 18 | inactiveIndicatorConfig, 19 | decreasingDots, 20 | indicatorState, 21 | }: GetDotStyle): DotConfig => { 22 | let dotConfig = decreasingDots[decreasingDots.length - 1]!.config; 23 | 24 | const rightRemnant = maxIndicators - indicatorState; 25 | const leftRemnant = indicatorState - 1; 26 | const leftDifference = currentIndex - leftRemnant; 27 | const rightDifference = currentIndex + rightRemnant; 28 | if (index >= leftDifference && index <= rightDifference) { 29 | dotConfig = inactiveIndicatorConfig; 30 | if (index === currentIndex) { 31 | dotConfig = activeIndicatorConfig; 32 | } 33 | } else { 34 | let leftMax = leftDifference; 35 | let rightMax = rightDifference; 36 | decreasingDots.forEach((dot) => { 37 | if ( 38 | (index >= leftMax - dot.quantity && index < leftMax) || 39 | (index <= rightMax + dot.quantity && index > rightMax) 40 | ) { 41 | dotConfig = dot.config; 42 | } 43 | leftMax -= dot.quantity; 44 | rightMax += dot.quantity; 45 | }); 46 | } 47 | return dotConfig; 48 | }; 49 | -------------------------------------------------------------------------------- /src/CarouselDots/InvisibleFiller/index.tsx: -------------------------------------------------------------------------------- 1 | import { View } from 'react-native'; 2 | 3 | import styles from './styles'; 4 | 5 | const InvisibleFiller = ({ 6 | size, 7 | verticalOrientation, 8 | }: { 9 | size: number; 10 | verticalOrientation: boolean; 11 | }): JSX.Element => { 12 | return ( 13 | 22 | ); 23 | }; 24 | 25 | export default InvisibleFiller; 26 | -------------------------------------------------------------------------------- /src/CarouselDots/InvisibleFiller/styles.ts: -------------------------------------------------------------------------------- 1 | import { StyleSheet } from 'react-native'; 2 | 3 | const styles = StyleSheet.create({ 4 | container: { 5 | opacity: 0, 6 | }, 7 | }); 8 | 9 | export default styles; 10 | -------------------------------------------------------------------------------- /src/CarouselDots/index.tsx: -------------------------------------------------------------------------------- 1 | import { useCallback, useEffect, useRef, useState, useMemo } from 'react'; 2 | import { I18nManager, View, ScrollView } from 'react-native'; 3 | import { GestureDetector, Gesture } from 'react-native-gesture-handler'; 4 | import { useSharedValue, runOnJS } from 'react-native-reanimated'; 5 | import type { 6 | CarouselState, 7 | DecreasingDot, 8 | DotConfig, 9 | ScrollableDotConfig, 10 | } from './interface'; 11 | 12 | import usePrevious from './use-previous'; 13 | import InvisibleFiller from './InvisibleFiller'; 14 | import Dot from './Dot'; 15 | import styles from './styles'; 16 | 17 | export interface CarouselDotsProps { 18 | length: number; 19 | currentIndex: number; 20 | maxIndicators: number; 21 | activeIndicatorConfig: DotConfig; 22 | inactiveIndicatorConfig: DotConfig; 23 | decreasingDots: DecreasingDot[]; 24 | verticalOrientation?: boolean; 25 | interpolateOpacityAndColor?: boolean; 26 | duration?: number; 27 | } 28 | 29 | const calculateDotSize = (dot: DotConfig): number => dot.size + 2 * dot.margin; 30 | const calculateDecreasingDotSize = (dot: DecreasingDot): number => { 31 | return calculateDotSize(dot.config) * (dot.quantity * 2); 32 | }; 33 | const calculateIndicatorDotSize = ( 34 | maxIndicators: number, 35 | activeIndicatorConfig: DotConfig, 36 | inactiveIndicatorConfig: DotConfig 37 | ): number => { 38 | return ( 39 | calculateDotSize(activeIndicatorConfig) + 40 | calculateDotSize(inactiveIndicatorConfig) * (maxIndicators - 1) 41 | ); 42 | }; 43 | 44 | const calculateOffsetSize = ( 45 | decreasingDot: DecreasingDot[], 46 | offset: number 47 | ): number => { 48 | const minimumSize = calculateDotSize( 49 | decreasingDot[decreasingDot.length - 1]!.config 50 | ); 51 | const result = decreasingDot.reduce( 52 | (acc, dot) => { 53 | if (acc.offset === 0) { 54 | return acc; 55 | } 56 | if (acc.offset - dot.quantity <= 0) { 57 | return { 58 | offset: 0, 59 | totalSize: acc.totalSize + calculateDotSize(dot.config) * acc.offset, 60 | }; 61 | } 62 | return { 63 | offset: acc.offset - dot.quantity, 64 | totalSize: acc.totalSize + calculateDotSize(dot.config) * dot.quantity, 65 | }; 66 | }, 67 | { offset, totalSize: 0 } 68 | ); 69 | return result.totalSize + result.offset * minimumSize; 70 | }; 71 | const CarouselDots = ({ 72 | length, 73 | currentIndex, 74 | maxIndicators, 75 | activeIndicatorConfig, 76 | inactiveIndicatorConfig, 77 | decreasingDots, 78 | verticalOrientation = false, 79 | interpolateOpacityAndColor = true, 80 | duration = 500, 81 | }: CarouselDotsProps): JSX.Element => { 82 | const refScrollView = useRef(null); 83 | const positiveMomentum = useRef(false); 84 | const prevIndex = usePrevious(currentIndex, currentIndex); 85 | const [carouselState, setCarouselState] = useState({ 86 | currentIndex, 87 | state: 1, 88 | }); 89 | const list = [...Array(length).keys()]; 90 | 91 | const offsetSizeMap = useMemo(() => { 92 | const map = new Map(); 93 | 94 | for (let i = 1 - maxIndicators; i < length; i++) { 95 | map.set(i, calculateOffsetSize(decreasingDots, i)); 96 | } 97 | 98 | return map; 99 | }, [decreasingDots, length, maxIndicators]); 100 | 101 | const scrollTo = useCallback( 102 | (index: number): void => { 103 | if (!refScrollView.current) { 104 | return; 105 | } 106 | const moveTo = positiveMomentum.current 107 | ? offsetSizeMap.get(index - maxIndicators + 1) 108 | : offsetSizeMap.get(index); 109 | 110 | refScrollView.current.scrollTo({ 111 | animated: true, 112 | x: moveTo, 113 | }); 114 | }, 115 | [maxIndicators, offsetSizeMap] 116 | ); 117 | useEffect(() => { 118 | positiveMomentum.current = currentIndex - prevIndex > 0; 119 | let internalState = carouselState.state; 120 | internalState += currentIndex - prevIndex; 121 | const finalState = internalState; 122 | if (internalState > maxIndicators) { 123 | internalState = maxIndicators; 124 | } 125 | if (internalState < 1) { 126 | internalState = 1; 127 | } 128 | if (internalState) { 129 | setCarouselState({ 130 | currentIndex, 131 | state: internalState, 132 | }); 133 | } 134 | 135 | if ( 136 | length > maxIndicators && 137 | (finalState > maxIndicators || finalState < 1) 138 | ) { 139 | scrollTo(currentIndex); 140 | } 141 | // eslint-disable-next-line react-hooks/exhaustive-deps 142 | }, [currentIndex, length, maxIndicators, scrollTo]); 143 | const containerSize = useMemo(() => { 144 | return ( 145 | decreasingDots.reduce( 146 | (acc, current) => calculateDecreasingDotSize(current) + acc, 147 | 0 148 | ) + 149 | calculateIndicatorDotSize( 150 | maxIndicators, 151 | activeIndicatorConfig, 152 | inactiveIndicatorConfig 153 | ) 154 | ); 155 | }, [ 156 | activeIndicatorConfig, 157 | decreasingDots, 158 | inactiveIndicatorConfig, 159 | maxIndicators, 160 | ]); 161 | 162 | if (length <= maxIndicators) { 163 | return ( 164 | 165 | {list.map((i) => { 166 | return ( 167 | 180 | ); 181 | })} 182 | 183 | ); 184 | } 185 | const invisibleFillerSize = 186 | decreasingDots.reduce( 187 | (acc, current) => calculateDecreasingDotSize(current) + acc, 188 | 0 189 | ) / 2; 190 | return ( 191 | 198 | 210 | 214 | {list.map((i) => { 215 | return ( 216 | 229 | ); 230 | })} 231 | 235 | 236 | 237 | ); 238 | }; 239 | 240 | interface CarouselDotsWrapperProps extends CarouselDotsProps { 241 | scrollableDotsConfig?: ScrollableDotConfig; 242 | } 243 | 244 | const MIN_TRANSLATION_DOT_ANIMATION = 15; 245 | 246 | const CarouselDotsWrapper = ({ 247 | scrollableDotsConfig, 248 | ...rest 249 | }: CarouselDotsWrapperProps) => { 250 | const [dotsCarouselActive, setDotsCarouselActive] = useState(false); 251 | const accDesplacementPos = useSharedValue(0); 252 | const accDesplacementNeg = useSharedValue(0); 253 | const lastTranslationX = useSharedValue(0); 254 | const prevMomentum = useSharedValue(null); 255 | const lastXOfMomentum = useSharedValue(null); 256 | const lastCallTime = useSharedValue(0); 257 | const throttleDelay = 150; 258 | 259 | const handleGoUp = (up: boolean) => { 260 | scrollableDotsConfig?.setIndex((prevActive) => { 261 | const newActive = up 262 | ? Math.min(prevActive + 1, rest.length - 1) 263 | : Math.max(prevActive - 1, 0); 264 | scrollableDotsConfig?.onNewIndex?.(newActive); 265 | return newActive; 266 | }); 267 | }; 268 | 269 | const throttledHandleGoUp = (momentum: boolean) => { 270 | const now = Date.now(); 271 | if (now - lastCallTime.value >= throttleDelay) { 272 | lastCallTime.value = now; 273 | runOnJS(handleGoUp)(momentum); 274 | } 275 | }; 276 | const gesture = Gesture.Pan() 277 | .onStart(() => { 278 | accDesplacementPos.value = 0; 279 | accDesplacementNeg.value = 0; 280 | runOnJS(setDotsCarouselActive)(true); 281 | }) 282 | .onUpdate((e) => { 283 | const momentum = e.translationX - lastTranslationX.value >= 0; 284 | lastTranslationX.value = e.translationX; 285 | if (prevMomentum.value !== momentum) { 286 | lastXOfMomentum.value = e.translationX; 287 | prevMomentum.value = momentum; 288 | accDesplacementPos.value = 0; 289 | accDesplacementNeg.value = 0; 290 | } 291 | if ( 292 | momentum && 293 | e.translationX >= 294 | MIN_TRANSLATION_DOT_ANIMATION + 295 | accDesplacementPos.value + 296 | (lastXOfMomentum.value || 0) 297 | ) { 298 | accDesplacementPos.value = 299 | e.translationX - (lastXOfMomentum.value || 0); 300 | runOnJS(throttledHandleGoUp)(true); 301 | } else if ( 302 | !momentum && 303 | e.translationX <= 304 | -MIN_TRANSLATION_DOT_ANIMATION + 305 | accDesplacementNeg.value + 306 | (lastXOfMomentum.value || 0) 307 | ) { 308 | accDesplacementNeg.value = 309 | e.translationX - (lastXOfMomentum.value || 0); 310 | runOnJS(throttledHandleGoUp)(false); 311 | } 312 | }) 313 | .onEnd(() => runOnJS(setDotsCarouselActive)(false)); 314 | 315 | return scrollableDotsConfig ? ( 316 | 317 | 327 | 328 | 329 | 330 | 331 | 332 | ) : ( 333 | 340 | 341 | 342 | ); 343 | }; 344 | export default CarouselDotsWrapper; 345 | -------------------------------------------------------------------------------- /src/CarouselDots/interface.ts: -------------------------------------------------------------------------------- 1 | import type { Dispatch, SetStateAction } from 'react'; 2 | import type { StyleProp, ViewStyle } from 'react-native'; 3 | 4 | export interface DotConfig { 5 | size: number; 6 | opacity: number; 7 | color: string; 8 | margin: number; 9 | borderWidth?: number; 10 | borderColor?: string; 11 | } 12 | export interface DecreasingDot { 13 | quantity: number; 14 | config: DotConfig; 15 | } 16 | 17 | export interface CarouselState { 18 | currentIndex: number; 19 | state: number; 20 | } 21 | 22 | export interface ScrollableDotConfig { 23 | setIndex: Dispatch>; 24 | onNewIndex?: (index: number) => void; 25 | containerBackgroundColor: string; 26 | container?: StyleProp; 27 | } 28 | -------------------------------------------------------------------------------- /src/CarouselDots/styles.ts: -------------------------------------------------------------------------------- 1 | import { StyleSheet } from 'react-native'; 2 | 3 | const styles = StyleSheet.create({ 4 | container: { 5 | flex: 1, 6 | flexDirection: 'row', 7 | alignItems: 'center', 8 | }, 9 | scrollContainer: { 10 | alignItems: 'center', 11 | justifyContent: 'center', 12 | }, 13 | scrollableDotsContainer: { 14 | alignItems: 'center', 15 | borderRadius: 15, 16 | height: 30, 17 | justifyContent: 'center', 18 | paddingHorizontal: 15, 19 | }, 20 | }); 21 | 22 | export default styles; 23 | -------------------------------------------------------------------------------- /src/CarouselDots/use-previous.ts: -------------------------------------------------------------------------------- 1 | import { useRef, useEffect } from 'react'; 2 | 3 | const usePrevious = (value: T, initialValue: T): T => { 4 | const ref = useRef(initialValue); 5 | useEffect((): void => { 6 | ref.current = value; 7 | }, [value]); 8 | return ref.current; 9 | }; 10 | 11 | export default usePrevious; 12 | -------------------------------------------------------------------------------- /src/index.tsx: -------------------------------------------------------------------------------- 1 | import type { CarouselDotsProps } from './CarouselDots'; 2 | 3 | import CarouselDots from './CarouselDots'; 4 | 5 | export * from './CarouselDots/interface'; 6 | export type { CarouselDotsProps }; 7 | 8 | export default CarouselDots; 9 | -------------------------------------------------------------------------------- /tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig", 3 | "exclude": ["example", "lib"] 4 | } 5 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "rootDir": ".", 4 | "paths": { 5 | "react-native-animated-dots-carousel": ["./src/index"] 6 | }, 7 | "allowUnreachableCode": false, 8 | "allowUnusedLabels": false, 9 | "esModuleInterop": true, 10 | "forceConsistentCasingInFileNames": true, 11 | "jsx": "react-jsx", 12 | "lib": ["ESNext"], 13 | "module": "ESNext", 14 | "moduleResolution": "Bundler", 15 | "noEmit": true, 16 | "noFallthroughCasesInSwitch": true, 17 | "noImplicitReturns": true, 18 | "noImplicitUseStrict": false, 19 | "noStrictGenericChecks": false, 20 | "noUncheckedIndexedAccess": true, 21 | "noUnusedLocals": true, 22 | "noUnusedParameters": true, 23 | "resolveJsonModule": true, 24 | "skipLibCheck": true, 25 | "strict": true, 26 | "target": "ESNext", 27 | "verbatimModuleSyntax": true 28 | } 29 | } 30 | --------------------------------------------------------------------------------