├── .npmrc
├── packages
├── nextjs
│ ├── template
│ │ ├── customRoutes.json
│ │ ├── src
│ │ │ └── app.jsx
│ │ ├── postcss.config.ejs
│ │ ├── babel.config.ejs
│ │ ├── tsconfig.json
│ │ └── pages
│ │ │ ├── _app.ejs
│ │ │ └── _document.jsx
│ ├── taro
│ │ ├── index.js
│ │ └── src
│ │ │ ├── media
│ │ │ └── index.ts
│ │ │ ├── internal
│ │ │ └── index.tsx
│ │ │ ├── ui
│ │ │ ├── index.ts
│ │ │ ├── navigationBar.ts
│ │ │ ├── background.ts
│ │ │ ├── menu.ts
│ │ │ └── roll.ts
│ │ │ ├── _util
│ │ │ ├── env.ts
│ │ │ ├── typings.ts
│ │ │ ├── dom.ts
│ │ │ ├── raf.ts
│ │ │ └── handler.ts
│ │ │ ├── device
│ │ │ ├── index.ts
│ │ │ ├── phone.ts
│ │ │ ├── vibrate.ts
│ │ │ ├── battery.ts
│ │ │ └── clipboard.ts
│ │ │ ├── basics
│ │ │ ├── performance.ts
│ │ │ ├── update.ts
│ │ │ ├── debug.ts
│ │ │ └── index.ts
│ │ │ ├── dom
│ │ │ ├── index.ts
│ │ │ └── nodesRef.ts
│ │ │ ├── canvas
│ │ │ ├── index.ts
│ │ │ ├── createCanvasContext.ts
│ │ │ ├── canvasToTempFilePath.ts
│ │ │ ├── canvasPutImageData.ts
│ │ │ └── canvasGetImageData.ts
│ │ │ ├── router.ts
│ │ │ └── location.ts
│ ├── router
│ │ ├── index.js
│ │ └── src
│ │ │ └── index.tsx
│ ├── components
│ │ └── src
│ │ │ └── index.ts
│ ├── src
│ │ ├── taroUtils
│ │ │ ├── index.ts
│ │ │ └── mergeTaroPages.ts
│ │ ├── constants.ts
│ │ ├── nextUtils
│ │ │ ├── isDynamicPage.ts
│ │ │ └── recursiveReadDir.ts
│ │ └── openBrowser.ts
│ ├── README.md
│ ├── babel
│ │ ├── after.js
│ │ ├── before.js
│ │ ├── taro-import-plugin.js
│ │ └── taro-app-plugin.js
│ ├── build
│ │ ├── getTSCommonConfig.js
│ │ ├── projectHelper.js
│ │ └── getBabelCommonConfig.js
│ ├── tsconfig.json
│ └── postcss
│ │ └── index.js
└── components
│ ├── src
│ ├── style
│ │ ├── index.ts
│ │ └── index.scss
│ ├── form
│ │ ├── style
│ │ │ └── index.ts
│ │ ├── index.md
│ │ ├── formContext.ts
│ │ ├── useField.ts
│ │ └── demos
│ │ │ └── demo1.scss
│ ├── icon
│ │ ├── style
│ │ │ └── index.ts
│ │ ├── index.md
│ │ ├── demos
│ │ │ └── demo1.scss
│ │ └── index.tsx
│ ├── label
│ │ ├── style
│ │ │ └── index.ts
│ │ └── index.tsx
│ ├── modal
│ │ └── style
│ │ │ └── index.ts
│ ├── video
│ │ ├── style
│ │ │ └── index.ts
│ │ ├── index.md
│ │ └── demos
│ │ │ └── demo1.tsx
│ ├── view
│ │ ├── style
│ │ │ └── index.ts
│ │ ├── index.md
│ │ ├── index.tsx
│ │ └── demos
│ │ │ ├── demo1.scss
│ │ │ └── demo1.tsx
│ ├── swiper-item
│ │ ├── style
│ │ │ └── index.ts
│ │ └── index.tsx
│ ├── picker-view-column
│ │ ├── style
│ │ │ └── index.ts
│ │ ├── index.md
│ │ └── index.tsx
│ ├── button
│ │ ├── style
│ │ │ ├── index.scss
│ │ │ └── index.ts
│ │ ├── index.md
│ │ └── demos
│ │ │ └── demo1.scss
│ ├── image
│ │ ├── style
│ │ │ ├── index.ts
│ │ │ └── index.scss
│ │ ├── index.md
│ │ └── demos
│ │ │ └── demo1.scss
│ ├── input
│ │ ├── style
│ │ │ ├── index.ts
│ │ │ └── index.scss
│ │ ├── index.md
│ │ └── demos
│ │ │ └── demo1.scss
│ ├── mask
│ │ ├── style
│ │ │ ├── index.ts
│ │ │ └── index.scss
│ │ └── index.tsx
│ ├── picker
│ │ ├── style
│ │ │ ├── index.js
│ │ │ └── index.scss
│ │ ├── constant.js
│ │ └── date.js
│ ├── switch
│ │ ├── style
│ │ │ ├── index.ts
│ │ │ └── index.scss
│ │ ├── index.md
│ │ ├── demos
│ │ │ └── demo1.scss
│ │ └── index.tsx
│ ├── text
│ │ ├── style
│ │ │ ├── index.scss
│ │ │ └── index.ts
│ │ ├── index.md
│ │ ├── demos
│ │ │ ├── demo1.scss
│ │ │ └── demo1.tsx
│ │ └── index.tsx
│ ├── navigator
│ │ ├── style
│ │ │ ├── index.ts
│ │ │ └── index.scss
│ │ ├── index.md
│ │ └── demos
│ │ │ ├── demo2.tsx
│ │ │ └── demo1.tsx
│ ├── picker-view
│ │ ├── style
│ │ │ └── index.ts
│ │ ├── index.md
│ │ └── demos
│ │ │ ├── demo1.scss
│ │ │ └── demo1.tsx
│ ├── progress
│ │ ├── style
│ │ │ ├── index.ts
│ │ │ └── index.scss
│ │ ├── index.md
│ │ └── demos
│ │ │ └── demo1.scss
│ ├── rich-text
│ │ ├── style
│ │ │ ├── index.ts
│ │ │ └── index.scss
│ │ ├── index.md
│ │ └── demos
│ │ │ ├── demo1.scss
│ │ │ └── demo1.tsx
│ ├── scroll-view
│ │ ├── style
│ │ │ ├── index.ts
│ │ │ └── index.scss
│ │ ├── index.md
│ │ └── demos
│ │ │ └── demo1.scss
│ ├── textarea
│ │ ├── style
│ │ │ ├── index.ts
│ │ │ └── index.scss
│ │ ├── demos
│ │ │ ├── demo1.scss
│ │ │ └── demo1.tsx
│ │ ├── index.md
│ │ ├── forceHiddenStyles.ts
│ │ └── getSizingData.ts
│ ├── web-view
│ │ ├── style
│ │ │ ├── index.ts
│ │ │ └── index.scss
│ │ └── index.tsx
│ ├── swiper
│ │ ├── style
│ │ │ ├── index.ts
│ │ │ └── index.scss
│ │ └── index.md
│ ├── toast
│ │ ├── style
│ │ │ ├── index.ts
│ │ │ └── index.scss
│ │ └── index.tsx
│ ├── preview
│ │ ├── style
│ │ │ ├── index.ts
│ │ │ └── index.scss
│ │ └── index.tsx
│ ├── _util
│ │ ├── dom
│ │ │ └── requestIdleCallback.ts
│ │ ├── children
│ │ │ └── toArray.ts
│ │ └── hooks
│ │ │ └── useMergedState.ts
│ └── index.ts
│ ├── taror-tools.config.js
│ ├── index.js
│ ├── .dumi
│ └── theme
│ │ └── components
│ │ ├── layout
│ │ └── index.scss
│ │ └── subMenu
│ │ └── index.scss
│ ├── webpack.config.js
│ ├── README.md
│ ├── tsconfig.json
│ ├── .umirc.ts
│ ├── index-style-only.js
│ └── package.json
├── examples
├── dynamic-routing
│ ├── src
│ │ ├── pages
│ │ │ ├── post
│ │ │ │ ├── index.tsx
│ │ │ │ ├── index.config.ts
│ │ │ │ ├── [id]
│ │ │ │ │ ├── index.tsx
│ │ │ │ │ └── [comment].tsx
│ │ │ │ └── view.tsx
│ │ │ └── index
│ │ │ │ └── index.tsx
│ │ ├── app.config.ts
│ │ ├── app.ts
│ │ ├── app.scss
│ │ └── index.html
│ ├── config
│ │ ├── dev.js
│ │ └── prod.js
│ ├── project.tt.json
│ ├── babel.config.js
│ ├── project.config.json
│ ├── README.md
│ ├── global.d.ts
│ ├── tsconfig.json
│ └── package.json
├── data-fetch
│ ├── src
│ │ ├── pages
│ │ │ ├── index
│ │ │ │ ├── index.config.ts
│ │ │ │ ├── index.h5.tsx
│ │ │ │ ├── view.tsx
│ │ │ │ └── index.tsx
│ │ │ └── stars
│ │ │ │ ├── index.h5.tsx
│ │ │ │ ├── view.tsx
│ │ │ │ └── index.tsx
│ │ ├── app.config.ts
│ │ ├── app.ts
│ │ ├── app.scss
│ │ └── index.html
│ ├── config
│ │ ├── dev.js
│ │ └── prod.js
│ ├── project.tt.json
│ ├── README.md
│ ├── babel.config.js
│ ├── project.config.json
│ ├── global.d.ts
│ ├── tsconfig.json
│ └── package.json
└── reactions
│ ├── src
│ ├── pages
│ │ └── index
│ │ │ ├── index.config.ts
│ │ │ ├── index.tsx
│ │ │ └── index.h5.tsx
│ ├── app.config.ts
│ ├── app.ts
│ ├── index.html
│ └── app.scss
│ ├── config
│ ├── dev.js
│ └── prod.js
│ ├── project.tt.json
│ ├── babel.config.js
│ ├── README.md
│ ├── project.config.json
│ ├── global.d.ts
│ ├── tsconfig.json
│ └── package.json
├── .vscode
└── settings.json
├── tests
├── integration
│ ├── dynamic-routing
│ │ ├── src
│ │ │ ├── pages
│ │ │ │ ├── index
│ │ │ │ │ ├── index.js
│ │ │ │ │ ├── view.js
│ │ │ │ │ └── [id].js
│ │ │ │ ├── me
│ │ │ │ │ ├── index.h5.js
│ │ │ │ │ ├── index.js
│ │ │ │ │ └── view.js
│ │ │ │ ├── post
│ │ │ │ │ ├── [id].js
│ │ │ │ │ ├── index.js
│ │ │ │ │ └── view.js
│ │ │ │ └── comment
│ │ │ │ │ ├── index.js
│ │ │ │ │ ├── view.js
│ │ │ │ │ └── [id]
│ │ │ │ │ ├── index.js
│ │ │ │ │ └── [comment].js
│ │ │ ├── app.js
│ │ │ └── app.config.js
│ │ └── config
│ │ │ ├── dev.js
│ │ │ ├── prod.js
│ │ │ └── index.js
│ ├── watch
│ │ ├── src
│ │ │ ├── app.js
│ │ │ └── app.config.js
│ │ └── config
│ │ │ ├── dev.js
│ │ │ ├── prod.js
│ │ │ └── index.js
│ └── config
│ │ ├── src
│ │ ├── app.js
│ │ ├── pages
│ │ │ └── index
│ │ │ │ └── index.js
│ │ └── app.config.js
│ │ ├── config
│ │ ├── dev.js
│ │ ├── prod.js
│ │ └── index.js
│ │ └── index.spec.ts
├── babel
│ ├── next-ssg-plugin
│ │ ├── __fixtures__
│ │ │ ├── full-re-export
│ │ │ │ ├── output.js
│ │ │ │ └── code.js
│ │ │ ├── remove-named-export
│ │ │ │ ├── output.js
│ │ │ │ └── code.js
│ │ │ ├── babel-style-memoized-function
│ │ │ │ ├── output.js
│ │ │ │ └── code.js
│ │ │ ├── remove-combined-named-export
│ │ │ │ ├── output.js
│ │ │ │ └── code.js
│ │ │ ├── remove-named-export-function
│ │ │ │ ├── output.js
│ │ │ │ └── code.js
│ │ │ ├── remove-named-export-variable
│ │ │ │ ├── output.js
│ │ │ │ └── code.js
│ │ │ ├── remove-re-exported-function
│ │ │ │ ├── output.js
│ │ │ │ └── code.js
│ │ │ ├── remove-named-export-async-function
│ │ │ │ ├── output.js
│ │ │ │ └── code.js
│ │ │ ├── remove-named-export-async-variable
│ │ │ │ ├── output.js
│ │ │ │ └── code.js
│ │ │ ├── class-declarations
│ │ │ │ ├── output.js
│ │ │ │ └── code.js
│ │ │ ├── remove-re-exported-variable
│ │ │ │ ├── output.js
│ │ │ │ └── code.js
│ │ │ ├── class-exports
│ │ │ │ ├── output.js
│ │ │ │ └── code.js
│ │ │ ├── retain-extra-named-export-variable
│ │ │ │ ├── output.js
│ │ │ │ └── code.js
│ │ │ ├── retain-extra-named-export-function
│ │ │ │ ├── output.js
│ │ │ │ └── code.js
│ │ │ ├── retain-extra-named-export
│ │ │ │ ├── output.js
│ │ │ │ └── code.js
│ │ │ ├── destructuring-assignment-array
│ │ │ │ ├── output.js
│ │ │ │ └── code.js
│ │ │ ├── destructuring-assignment-object
│ │ │ │ ├── output.js
│ │ │ │ └── code.js
│ │ │ ├── not-mix-up-bindings
│ │ │ │ ├── output.js
│ │ │ │ └── code.js
│ │ │ └── remove-re-exported-function-dependents-variables-functions-imports
│ │ │ │ ├── output.js
│ │ │ │ └── code.js
│ │ └── index.spec.js
│ ├── taro-app-plugin
│ │ ├── __fixtures__
│ │ │ └── basic
│ │ │ │ ├── output.js
│ │ │ │ └── code.js
│ │ └── index.spec.js
│ ├── next-app-plugin
│ │ ├── app.js
│ │ ├── __fixtures__
│ │ │ └── basic
│ │ │ │ ├── code.js
│ │ │ │ └── output.js
│ │ └── index.spec.js
│ ├── class-component-taro-router-plugin
│ │ ├── __fixtures__
│ │ │ ├── property
│ │ │ │ ├── code.js
│ │ │ │ └── output.js
│ │ │ ├── ignore-function-component
│ │ │ │ ├── code.js
│ │ │ │ └── output.js
│ │ │ ├── method
│ │ │ │ ├── code.js
│ │ │ │ └── output.js
│ │ │ └── trasformed
│ │ │ │ ├── code.js
│ │ │ │ └── output.js
│ │ └── index.spec.js
│ └── taro-import-plugin
│ │ ├── index.spec.js
│ │ └── __fixtures__
│ │ └── basic
│ │ ├── code.js
│ │ └── output.js
├── __fixtures__
│ ├── getNextExportedFunctions
│ │ ├── named.js
│ │ ├── function.js
│ │ └── variable.js
│ └── template
│ │ └── nextConfig
│ │ ├── default.js
│ │ └── basic.js
├── taro
│ ├── device
│ │ └── clipboard.spec.ts
│ └── dataCache.spec.ts
├── utils.spec.ts
└── template
│ └── nextConfig.spec.ts
├── jest.config.js
├── .editorconfig
├── lerna.json
├── tsconfig.json
├── LICENSE
├── package.json
├── typings
└── event-stream.d.ts
├── .eslintrc.js
└── .gitignore
/.npmrc:
--------------------------------------------------------------------------------
1 | registry=https://registry.npmjs.org/
2 |
--------------------------------------------------------------------------------
/packages/nextjs/template/customRoutes.json:
--------------------------------------------------------------------------------
1 | {}
2 |
--------------------------------------------------------------------------------
/packages/components/src/style/index.ts:
--------------------------------------------------------------------------------
1 | import './index.scss'
2 |
--------------------------------------------------------------------------------
/packages/nextjs/taro/index.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./lib')
2 |
--------------------------------------------------------------------------------
/packages/nextjs/router/index.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./lib')
2 |
--------------------------------------------------------------------------------
/packages/nextjs/components/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from '@taror/components'
2 |
--------------------------------------------------------------------------------
/packages/components/src/form/style/index.ts:
--------------------------------------------------------------------------------
1 | import '../../style/index.scss'
2 |
--------------------------------------------------------------------------------
/packages/components/src/icon/style/index.ts:
--------------------------------------------------------------------------------
1 | import '../../style/index.scss'
2 |
--------------------------------------------------------------------------------
/packages/components/src/label/style/index.ts:
--------------------------------------------------------------------------------
1 | import '../../style/index.scss'
2 |
--------------------------------------------------------------------------------
/packages/components/src/modal/style/index.ts:
--------------------------------------------------------------------------------
1 | import '../../style/index.scss'
2 |
--------------------------------------------------------------------------------
/packages/components/src/video/style/index.ts:
--------------------------------------------------------------------------------
1 | import '../../style/index.scss'
2 |
--------------------------------------------------------------------------------
/packages/components/src/view/style/index.ts:
--------------------------------------------------------------------------------
1 | import '../../style/index.scss'
2 |
--------------------------------------------------------------------------------
/examples/dynamic-routing/src/pages/post/index.tsx:
--------------------------------------------------------------------------------
1 | export {default} from './view';
2 |
--------------------------------------------------------------------------------
/packages/components/src/swiper-item/style/index.ts:
--------------------------------------------------------------------------------
1 | import '../../style/index.scss'
2 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "typescript.tsdk": "node_modules/typescript/lib"
3 | }
4 |
--------------------------------------------------------------------------------
/packages/components/src/picker-view-column/style/index.ts:
--------------------------------------------------------------------------------
1 | import '../../style/index.scss'
2 |
--------------------------------------------------------------------------------
/packages/nextjs/src/taroUtils/index.ts:
--------------------------------------------------------------------------------
1 | export {mergeTaroPages} from './mergeTaroPages'
2 |
--------------------------------------------------------------------------------
/tests/integration/dynamic-routing/src/pages/index/index.js:
--------------------------------------------------------------------------------
1 | export {default} from './view'
2 |
--------------------------------------------------------------------------------
/tests/integration/dynamic-routing/src/pages/me/index.h5.js:
--------------------------------------------------------------------------------
1 | export {default} from './view'
2 |
--------------------------------------------------------------------------------
/tests/integration/dynamic-routing/src/pages/me/index.js:
--------------------------------------------------------------------------------
1 | export {default} from './view'
2 |
--------------------------------------------------------------------------------
/tests/integration/dynamic-routing/src/pages/post/[id].js:
--------------------------------------------------------------------------------
1 | export {default} from './view'
2 |
--------------------------------------------------------------------------------
/tests/integration/dynamic-routing/src/pages/post/index.js:
--------------------------------------------------------------------------------
1 | export {default} from './view'
2 |
--------------------------------------------------------------------------------
/packages/nextjs/src/constants.ts:
--------------------------------------------------------------------------------
1 | export const SCRIPT_EXTS = ['.js', '.jsx', '.ts', '.tsx']
2 |
--------------------------------------------------------------------------------
/packages/nextjs/taro/src/media/index.ts:
--------------------------------------------------------------------------------
1 | export * from './image'
2 | export * from './video'
3 |
--------------------------------------------------------------------------------
/tests/babel/next-ssg-plugin/__fixtures__/full-re-export/output.js:
--------------------------------------------------------------------------------
1 | export { default } from "a";
2 |
--------------------------------------------------------------------------------
/tests/integration/dynamic-routing/src/pages/comment/index.js:
--------------------------------------------------------------------------------
1 | export {default} from './view'
2 |
--------------------------------------------------------------------------------
/packages/components/taror-tools.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | libraryName: 'taror'
3 | }
4 |
--------------------------------------------------------------------------------
/tests/integration/watch/src/app.js:
--------------------------------------------------------------------------------
1 | const App = ({children}) => children
2 |
3 | export default App
4 |
--------------------------------------------------------------------------------
/packages/components/index.js:
--------------------------------------------------------------------------------
1 | require('./index-style-only')
2 |
3 | module.exports = require('./src')
4 |
--------------------------------------------------------------------------------
/packages/components/src/button/style/index.scss:
--------------------------------------------------------------------------------
1 | .weui-btn:after {
2 | pointer-events: none;
3 | }
4 |
--------------------------------------------------------------------------------
/packages/components/src/button/style/index.ts:
--------------------------------------------------------------------------------
1 | import '../../style/index.scss'
2 | import './index.scss'
3 |
--------------------------------------------------------------------------------
/packages/components/src/image/style/index.ts:
--------------------------------------------------------------------------------
1 | import '../../style/index.scss'
2 | import './index.scss'
3 |
--------------------------------------------------------------------------------
/packages/components/src/input/style/index.ts:
--------------------------------------------------------------------------------
1 | import '../../style/index.scss'
2 | import './index.scss'
3 |
--------------------------------------------------------------------------------
/packages/components/src/mask/style/index.ts:
--------------------------------------------------------------------------------
1 | import '../../style/index.scss'
2 | import './index.scss'
3 |
--------------------------------------------------------------------------------
/packages/components/src/picker/style/index.js:
--------------------------------------------------------------------------------
1 | import '../../style/index.scss'
2 | import './index.scss'
3 |
--------------------------------------------------------------------------------
/packages/components/src/switch/style/index.ts:
--------------------------------------------------------------------------------
1 | import '../../style/index.scss'
2 | import './index.scss'
3 |
--------------------------------------------------------------------------------
/packages/components/src/text/style/index.scss:
--------------------------------------------------------------------------------
1 | .taro-text_selectable {
2 | user-select: text;
3 | }
4 |
--------------------------------------------------------------------------------
/packages/components/src/text/style/index.ts:
--------------------------------------------------------------------------------
1 | import '../../style/index.scss'
2 | import './index.scss'
3 |
--------------------------------------------------------------------------------
/tests/integration/config/src/app.js:
--------------------------------------------------------------------------------
1 | const App = ({children}) => children
2 |
3 | export default App
4 |
--------------------------------------------------------------------------------
/tests/integration/dynamic-routing/src/pages/me/view.js:
--------------------------------------------------------------------------------
1 | const Me = () => null
2 |
3 | export default Me
4 |
--------------------------------------------------------------------------------
/packages/components/src/navigator/style/index.ts:
--------------------------------------------------------------------------------
1 | import '../../style/index.scss'
2 | import './index.scss'
3 |
--------------------------------------------------------------------------------
/packages/components/src/picker-view/style/index.ts:
--------------------------------------------------------------------------------
1 | import '../../style/index.scss'
2 | import './index.scss'
3 |
--------------------------------------------------------------------------------
/packages/components/src/progress/style/index.ts:
--------------------------------------------------------------------------------
1 | import '../../style/index.scss'
2 | import './index.scss'
3 |
--------------------------------------------------------------------------------
/packages/components/src/rich-text/style/index.ts:
--------------------------------------------------------------------------------
1 | import '../../style/index.scss'
2 | import './index.scss'
3 |
--------------------------------------------------------------------------------
/packages/components/src/scroll-view/style/index.ts:
--------------------------------------------------------------------------------
1 | import '../../style/index.scss'
2 | import './index.scss'
3 |
--------------------------------------------------------------------------------
/packages/components/src/textarea/style/index.ts:
--------------------------------------------------------------------------------
1 | import '../../style/index.scss'
2 | import './index.scss'
3 |
--------------------------------------------------------------------------------
/packages/components/src/web-view/style/index.ts:
--------------------------------------------------------------------------------
1 | import '../../style/index.scss'
2 | import './index.scss'
3 |
--------------------------------------------------------------------------------
/tests/babel/next-ssg-plugin/__fixtures__/full-re-export/code.js:
--------------------------------------------------------------------------------
1 | export { getStaticProps, default } from 'a'
2 |
--------------------------------------------------------------------------------
/tests/integration/dynamic-routing/src/app.js:
--------------------------------------------------------------------------------
1 | const App = ({children}) => children
2 |
3 | export default App
4 |
--------------------------------------------------------------------------------
/tests/integration/dynamic-routing/src/pages/post/view.js:
--------------------------------------------------------------------------------
1 | const Post = () => null
2 |
3 | export default Post
4 |
--------------------------------------------------------------------------------
/examples/data-fetch/src/pages/index/index.config.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | navigationBarTitleText: '首页'
3 | }
4 |
--------------------------------------------------------------------------------
/packages/components/src/picker/style/index.scss:
--------------------------------------------------------------------------------
1 | .weui-picker, .weui-picker__hd {
2 | font-size: 12px;
3 | }
4 |
--------------------------------------------------------------------------------
/packages/components/src/rich-text/style/index.scss:
--------------------------------------------------------------------------------
1 | .taro-rich-text__selectable {
2 | user-select: auto;
3 | }
4 |
--------------------------------------------------------------------------------
/tests/integration/dynamic-routing/src/pages/index/view.js:
--------------------------------------------------------------------------------
1 | const Index = () => null
2 |
3 | export default Index
4 |
--------------------------------------------------------------------------------
/examples/dynamic-routing/src/pages/post/index.config.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | navigationBarTitleText: '首页'
3 | }
4 |
--------------------------------------------------------------------------------
/packages/components/src/textarea/demos/demo1.scss:
--------------------------------------------------------------------------------
1 | .taro-textarea {
2 | width: 100%;
3 | padding: 17px;
4 | }
5 |
--------------------------------------------------------------------------------
/tests/integration/config/src/pages/index/index.js:
--------------------------------------------------------------------------------
1 | const Index = () => 'hello, world!'
2 |
3 | export default Index
4 |
--------------------------------------------------------------------------------
/tests/integration/dynamic-routing/src/pages/comment/view.js:
--------------------------------------------------------------------------------
1 | const Comment = () => null
2 |
3 | export default Comment
4 |
--------------------------------------------------------------------------------
/packages/components/src/icon/index.md:
--------------------------------------------------------------------------------
1 | # Icon 图标
2 |
3 | 图片组件。
4 |
5 | ## 示例
6 |
7 |
8 |
--------------------------------------------------------------------------------
/packages/components/src/text/index.md:
--------------------------------------------------------------------------------
1 | # Text 文本
2 |
3 | 文本元素。
4 |
5 | ## 示例
6 |
7 |
8 |
--------------------------------------------------------------------------------
/tests/integration/config/src/app.config.js:
--------------------------------------------------------------------------------
1 | export default {
2 | pages: [
3 | 'pages/index/index'
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/tests/integration/watch/src/app.config.js:
--------------------------------------------------------------------------------
1 | export default {
2 | pages: [
3 | 'pages/index/index'
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/examples/reactions/src/pages/index/index.config.ts:
--------------------------------------------------------------------------------
1 | export default definePageConfig({
2 | navigationBarTitleText: '首页'
3 | })
4 |
--------------------------------------------------------------------------------
/packages/components/src/input/index.md:
--------------------------------------------------------------------------------
1 | # Input 输入框
2 |
3 | 输入框。
4 |
5 | ## 示例
6 |
7 |
8 |
--------------------------------------------------------------------------------
/packages/nextjs/README.md:
--------------------------------------------------------------------------------
1 | # Taro 插件,用于编译为 Next.js 应用
2 |
3 | 访问 https://github.com/NervJS/tarojs-plugin-platform-nextjs 完整文档。
4 |
--------------------------------------------------------------------------------
/packages/nextjs/taro/src/internal/index.tsx:
--------------------------------------------------------------------------------
1 | export * from './taroApp'
2 |
3 | export {default as TaroPage} from './taroPage'
4 |
--------------------------------------------------------------------------------
/packages/components/src/progress/index.md:
--------------------------------------------------------------------------------
1 | # Progress 进度条
2 |
3 | 进度条。
4 |
5 | ## 示例
6 |
7 |
8 |
--------------------------------------------------------------------------------
/packages/components/src/rich-text/index.md:
--------------------------------------------------------------------------------
1 | # RichText 富文本
2 |
3 | 富文本。
4 |
5 | ## 示例
6 |
7 |
8 |
--------------------------------------------------------------------------------
/packages/components/src/switch/index.md:
--------------------------------------------------------------------------------
1 | # Switch 开关选择器
2 |
3 | 开关选择器。
4 |
5 | ## 示例
6 |
7 |
8 |
--------------------------------------------------------------------------------
/tests/babel/next-ssg-plugin/__fixtures__/remove-named-export/output.js:
--------------------------------------------------------------------------------
1 | export default function Test() {
2 | return
8 |
--------------------------------------------------------------------------------
/packages/components/src/swiper/style/index.ts:
--------------------------------------------------------------------------------
1 | import 'swiper/swiper.scss'
2 | import '../../style/index.scss'
3 | import './index.scss'
4 |
--------------------------------------------------------------------------------
/tests/integration/watch/config/dev.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | env: {
3 | NODE_ENV: JSON.stringify('development')
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/tests/integration/watch/config/prod.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | env: {
3 | NODE_ENV: JSON.stringify('production')
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/tests/babel/next-ssg-plugin/__fixtures__/babel-style-memoized-function/output.js:
--------------------------------------------------------------------------------
1 | export default function Home() {
2 | return ;
3 | }
4 |
--------------------------------------------------------------------------------
/tests/babel/next-ssg-plugin/__fixtures__/remove-combined-named-export/output.js:
--------------------------------------------------------------------------------
1 | export default function Test() {
2 | return ;
3 | }
4 |
--------------------------------------------------------------------------------
/tests/babel/next-ssg-plugin/__fixtures__/remove-named-export-function/output.js:
--------------------------------------------------------------------------------
1 | export default function Test() {
2 | return ;
3 | }
4 |
--------------------------------------------------------------------------------
/tests/babel/next-ssg-plugin/__fixtures__/remove-named-export-variable/output.js:
--------------------------------------------------------------------------------
1 | export default function Test() {
2 | return ;
3 | }
4 |
--------------------------------------------------------------------------------
/tests/babel/next-ssg-plugin/__fixtures__/remove-re-exported-function/output.js:
--------------------------------------------------------------------------------
1 | export default function Test() {
2 | return ;
3 | }
4 |
--------------------------------------------------------------------------------
/tests/integration/config/config/dev.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | env: {
3 | NODE_ENV: JSON.stringify('development')
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/tests/integration/config/config/prod.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | env: {
3 | NODE_ENV: JSON.stringify('production')
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/packages/components/src/picker-view/index.md:
--------------------------------------------------------------------------------
1 | # PickerView 滚动选择器
2 |
3 | 可嵌页面的滚动选择器。
4 |
5 | ## 示例
6 |
7 |
8 |
--------------------------------------------------------------------------------
/packages/components/src/textarea/index.md:
--------------------------------------------------------------------------------
1 | # Textarea 多行输入框
2 |
3 | 多行输入框。内部不支持嵌套其他组件。
4 |
5 | ## 示例
6 |
7 |
8 |
--------------------------------------------------------------------------------
/tests/babel/next-ssg-plugin/__fixtures__/remove-named-export-async-function/output.js:
--------------------------------------------------------------------------------
1 | export default function Test() {
2 | return ;
3 | }
4 |
--------------------------------------------------------------------------------
/tests/babel/next-ssg-plugin/__fixtures__/remove-named-export-async-variable/output.js:
--------------------------------------------------------------------------------
1 | export default function Test() {
2 | return ;
3 | }
4 |
--------------------------------------------------------------------------------
/tests/integration/dynamic-routing/config/dev.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | env: {
3 | NODE_ENV: JSON.stringify('development')
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/tests/integration/dynamic-routing/config/prod.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | env: {
3 | NODE_ENV: JSON.stringify('production')
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/packages/components/.dumi/theme/components/layout/index.scss:
--------------------------------------------------------------------------------
1 | .__dumi-default-mobile-content>article {
2 | min-width: auto;
3 | width: 100%;
4 | }
5 |
--------------------------------------------------------------------------------
/packages/components/src/video/index.md:
--------------------------------------------------------------------------------
1 | # Video 视频
2 |
3 | 视频。video 组件默认宽度 300px 、高度 225px 。
4 |
5 | ## 示例
6 |
7 |
8 |
--------------------------------------------------------------------------------
/packages/components/.dumi/theme/components/subMenu/index.scss:
--------------------------------------------------------------------------------
1 | .__dumi-default-menu-inner ul li a {
2 | line-height: 1.4;
3 | padding: 12px 0;
4 | }
5 |
--------------------------------------------------------------------------------
/packages/components/src/picker/constant.js:
--------------------------------------------------------------------------------
1 | export const TOP = 102
2 |
3 | export const LINE_HEIGHT = 34
4 |
5 | export const MASK_HEIGHT = LINE_HEIGHT * 7
6 |
--------------------------------------------------------------------------------
/packages/components/webpack.config.js:
--------------------------------------------------------------------------------
1 | const getWebpackConfig = require('@taror/tools/lib/getWebpackConfig')
2 |
3 | module.exports = getWebpackConfig(false)
4 |
--------------------------------------------------------------------------------
/tests/babel/next-ssg-plugin/__fixtures__/class-declarations/output.js:
--------------------------------------------------------------------------------
1 | export class MyClass {}
2 | export default function Test() {
3 | return ;
4 | }
5 |
--------------------------------------------------------------------------------
/tests/babel/next-ssg-plugin/__fixtures__/remove-re-exported-variable/output.js:
--------------------------------------------------------------------------------
1 | const a = 2;
2 | export default function Test() {
3 | return ;
4 | }
5 |
--------------------------------------------------------------------------------
/packages/components/src/toast/style/index.ts:
--------------------------------------------------------------------------------
1 | import '../../style/index.scss'
2 | import './index.scss'
3 |
4 | // style dependencies
5 | import '../../mask/style'
6 |
--------------------------------------------------------------------------------
/packages/nextjs/src/nextUtils/isDynamicPage.ts:
--------------------------------------------------------------------------------
1 | export function isDynamicPage(str: string): boolean {
2 | return str.startsWith('[') && str.endsWith(']')
3 | }
4 |
--------------------------------------------------------------------------------
/packages/components/src/swiper/index.md:
--------------------------------------------------------------------------------
1 | # Swiper 视图容器
2 |
3 | 滑块视图容器。内部只允许使用 SwiperItem 组件描述滑块内容,否则会导致未定义的行为。
4 |
5 | ## 示例
6 |
7 |
8 |
--------------------------------------------------------------------------------
/tests/__fixtures__/getNextExportedFunctions/named.js:
--------------------------------------------------------------------------------
1 | export {default as getStaticPaths} from './getStaticPaths';
2 |
3 | export {getStaticProps} from './getStaticProps';
4 |
--------------------------------------------------------------------------------
/tests/babel/next-ssg-plugin/__fixtures__/class-exports/output.js:
--------------------------------------------------------------------------------
1 | export default class Test extends React.Component {
2 | render() {
3 | return ;
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/tests/babel/next-ssg-plugin/__fixtures__/retain-extra-named-export-variable/output.js:
--------------------------------------------------------------------------------
1 | export const foo = 2;
2 | export default function Test() {
3 | return ;
4 | }
5 |
--------------------------------------------------------------------------------
/packages/components/src/picker-view/demos/demo1.scss:
--------------------------------------------------------------------------------
1 | .item {
2 | text-align: center;
3 | }
4 |
5 | .selected-date {
6 | margin: 30px;
7 | text-align: center;
8 | }
9 |
--------------------------------------------------------------------------------
/tests/babel/next-ssg-plugin/__fixtures__/retain-extra-named-export-function/output.js:
--------------------------------------------------------------------------------
1 | export function Noop() {}
2 | export default function Test() {
3 | return ;
4 | }
5 |
--------------------------------------------------------------------------------
/tests/babel/next-ssg-plugin/__fixtures__/retain-extra-named-export/output.js:
--------------------------------------------------------------------------------
1 | export { foo, bar as baz } from ".";
2 | export default function Test() {
3 | return ;
4 | }
5 |
--------------------------------------------------------------------------------
/packages/components/src/image/index.md:
--------------------------------------------------------------------------------
1 | # Image 图片
2 |
3 | 图片,支持 JPG、PNG、GIF、BMP、WEBP 等格式。image 组件默认宽度 300px 、高度 225px 。
4 |
5 | ## 示例
6 |
7 |
8 |
--------------------------------------------------------------------------------
/packages/components/src/switch/style/index.scss:
--------------------------------------------------------------------------------
1 | .weui-agree__checkbox {
2 | width: 22px;
3 | height: 22px;
4 |
5 | &::before {
6 | font-size: 22px;
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/examples/data-fetch/config/dev.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | env: {
3 | NODE_ENV: '"development"'
4 | },
5 | defineConstants: {
6 | },
7 | mini: {},
8 | h5: {}
9 | }
10 |
--------------------------------------------------------------------------------
/examples/reactions/config/dev.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | env: {
3 | NODE_ENV: '"development"'
4 | },
5 | defineConstants: {
6 | },
7 | mini: {},
8 | h5: {}
9 | }
10 |
--------------------------------------------------------------------------------
/packages/nextjs/taro/src/ui/index.ts:
--------------------------------------------------------------------------------
1 | export * from './background'
2 | export * from './interactive'
3 | export * from './menu'
4 | export * from './navigationBar'
5 | export * from './roll'
6 |
--------------------------------------------------------------------------------
/examples/dynamic-routing/config/dev.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | env: {
3 | NODE_ENV: '"development"'
4 | },
5 | defineConstants: {
6 | },
7 | mini: {},
8 | h5: {}
9 | }
10 |
--------------------------------------------------------------------------------
/packages/components/src/view/index.md:
--------------------------------------------------------------------------------
1 | # View 视图容器
2 |
3 | 视图容器。相当于 HTML 中的 div 标签,可将页面分割为独立的、不同的部分。如果需要使用滚动视图,请使用 ScrollView 组件。
4 |
5 | ## 示例
6 |
7 |
8 |
--------------------------------------------------------------------------------
/packages/nextjs/taro/src/_util/env.ts:
--------------------------------------------------------------------------------
1 | export function isAndroid() {
2 | const {userAgent} = window.navigator
3 | return /(Android);?[\s\/]+([\d.]+)?|Baidu;.*P1/.test(userAgent)
4 | }
5 |
--------------------------------------------------------------------------------
/examples/dynamic-routing/src/pages/post/[id]/index.tsx:
--------------------------------------------------------------------------------
1 | export {default} from '../view';
2 |
3 | export const getServerSideProps = async () => {
4 | return {
5 | props: {}
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/packages/components/src/preview/style/index.ts:
--------------------------------------------------------------------------------
1 | import '../../style/index.scss'
2 | import './index.scss'
3 |
4 | // style dependencies
5 | import '../../mask/style'
6 | import '../../swiper/style'
7 |
--------------------------------------------------------------------------------
/tests/babel/next-ssg-plugin/__fixtures__/destructuring-assignment-array/output.js:
--------------------------------------------------------------------------------
1 | import other from "other";
2 | const [foo] = other;
3 | export default function Home() {
4 | return ;
5 | }
6 |
--------------------------------------------------------------------------------
/tests/babel/next-ssg-plugin/__fixtures__/remove-combined-named-export/code.js:
--------------------------------------------------------------------------------
1 | export { getStaticPaths, a as getStaticProps } from ".";
2 | export default function Test() {
3 | return ;
4 | }
5 |
--------------------------------------------------------------------------------
/examples/dynamic-routing/src/pages/post/[id]/[comment].tsx:
--------------------------------------------------------------------------------
1 | export {default} from '../view';
2 |
3 | export const getServerSideProps = async () => {
4 | return {
5 | props: {}
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/packages/components/src/picker-view-column/index.md:
--------------------------------------------------------------------------------
1 | # PickerViewColumn 滚动选择器子项
2 |
3 | 可嵌页面的滚动选择器子项。仅可放置于 PickerView 中,其孩子节点的高度会自动设置成与 picker-view 的选中框的高度一致。
4 |
5 | ## 示例
6 |
7 | 参见 PickerView 示例内容。
8 |
--------------------------------------------------------------------------------
/packages/components/src/scroll-view/index.md:
--------------------------------------------------------------------------------
1 | # ScrollView 可滚动视图区域
2 |
3 | 可滚动视图区域,可实现横向滚动和竖向滚动。使用竖向滚动时,需要给定该组件一个固定高度,可以通过 CSS 设置 height 。
4 |
5 | ## 示例
6 |
7 |
8 |
--------------------------------------------------------------------------------
/tests/integration/dynamic-routing/src/pages/index/[id].js:
--------------------------------------------------------------------------------
1 | export {default} from './view'
2 |
3 | export const getServerSideProps = async () => {
4 | return {
5 | props: {}
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/tests/babel/next-ssg-plugin/__fixtures__/destructuring-assignment-object/output.js:
--------------------------------------------------------------------------------
1 | import other from "other";
2 | const { a, cat: bar } = other;
3 | export default function Home() {
4 | return ;
5 | }
6 |
--------------------------------------------------------------------------------
/tests/integration/dynamic-routing/src/pages/comment/[id]/index.js:
--------------------------------------------------------------------------------
1 | export {default} from '../view'
2 |
3 | export const getServerSideProps = async () => {
4 | return {
5 | props: {}
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/jest.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
2 | module.exports = {
3 | preset: 'ts-jest',
4 | testEnvironment: 'node',
5 | testRegex: '(\\.|/)(test|spec)\\.[jt]sx?$'
6 | }
7 |
--------------------------------------------------------------------------------
/tests/babel/next-ssg-plugin/__fixtures__/retain-extra-named-export/code.js:
--------------------------------------------------------------------------------
1 | export { getStaticPaths, a as getStaticProps, foo, bar as baz } from '.';
2 | export default function Test() {
3 | return ;
4 | }
5 |
--------------------------------------------------------------------------------
/tests/integration/dynamic-routing/src/pages/comment/[id]/[comment].js:
--------------------------------------------------------------------------------
1 | export {default} from '../view'
2 |
3 | export const getServerSideProps = async () => {
4 | return {
5 | props: {}
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/examples/data-fetch/project.tt.json:
--------------------------------------------------------------------------------
1 | {
2 | "miniprogramRoot": "./",
3 | "projectname": "data",
4 | "appid": "testAppId",
5 | "setting": {
6 | "es6": false,
7 | "minified": false
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/examples/reactions/project.tt.json:
--------------------------------------------------------------------------------
1 | {
2 | "miniprogramRoot": "./",
3 | "projectname": "data",
4 | "appid": "testAppId",
5 | "setting": {
6 | "es6": false,
7 | "minified": false
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/tests/babel/next-ssg-plugin/__fixtures__/remove-named-export/code.js:
--------------------------------------------------------------------------------
1 | export { getStaticPaths } from ".";
2 | export { a as getStaticProps } from ".";
3 | export default function Test() {
4 | return ;
5 | };
6 |
--------------------------------------------------------------------------------
/examples/dynamic-routing/project.tt.json:
--------------------------------------------------------------------------------
1 | {
2 | "miniprogramRoot": "./",
3 | "projectname": "data",
4 | "appid": "testAppId",
5 | "setting": {
6 | "es6": false,
7 | "minified": false
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/packages/components/src/web-view/style/index.scss:
--------------------------------------------------------------------------------
1 | .taro-webview {
2 | position: fixed;
3 | top: 0;
4 | bottom: 0;
5 | width: 100%;
6 | height: 100%;
7 | border: none;
8 | z-index: 999;
9 | }
10 |
--------------------------------------------------------------------------------
/tests/integration/dynamic-routing/src/app.config.js:
--------------------------------------------------------------------------------
1 | export default {
2 | pages: [
3 | 'pages/index/index',
4 | 'pages/comment/index',
5 | 'pages/post/index',
6 | 'pages/me/index'
7 | ]
8 | }
9 |
--------------------------------------------------------------------------------
/tests/babel/taro-app-plugin/__fixtures__/basic/output.js:
--------------------------------------------------------------------------------
1 | import { Component } from "react";
2 |
3 | class App extends Component {
4 | render() {
5 | return this.props.children;
6 | }
7 | }
8 |
9 | export default App;
10 |
--------------------------------------------------------------------------------
/tests/babel/next-app-plugin/app.js:
--------------------------------------------------------------------------------
1 | import { Component } from "react";
2 | import "./app.scss";
3 |
4 | class App extends Component {
5 | render() {
6 | return this.props.children;
7 | }
8 | }
9 |
10 | export default App;
11 |
--------------------------------------------------------------------------------
/tests/babel/next-ssg-plugin/__fixtures__/remove-re-exported-function/code.js:
--------------------------------------------------------------------------------
1 | function getStaticPaths() {
2 | return [];
3 | }
4 |
5 | export { getStaticPaths }
6 |
7 | export default function Test() {
8 | return ;
9 | }
10 |
--------------------------------------------------------------------------------
/examples/data-fetch/README.md:
--------------------------------------------------------------------------------
1 | # 数据请求示例
2 |
3 | 通过导出 `getStaticProps` Next.js 将在构建阶段获取数据,并将页面预渲染为静态页面。
4 |
5 | ## 执行 Next.js
6 |
7 | ```bash
8 | yarn dev:nextjs
9 | ```
10 |
11 | ## 执行小程序
12 |
13 | ```bash
14 | yarn dev:swan
15 | ```
16 |
--------------------------------------------------------------------------------
/packages/components/src/navigator/index.md:
--------------------------------------------------------------------------------
1 | # Navigator 页面导航
2 |
3 | 页面链接,控制小程序的跳转,既可在当前小程序内部进行跳转,也可跳转至其他小程序。navigator 的子节点背景色应为透明色。
4 |
5 | ## 示例
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/tests/babel/next-ssg-plugin/__fixtures__/remove-re-exported-variable/code.js:
--------------------------------------------------------------------------------
1 | const getStaticPaths = () => {
2 | return [];
3 | }, a = 2
4 |
5 | export { getStaticPaths };
6 |
7 | export default function Test() {
8 | return ;
9 | }
10 |
--------------------------------------------------------------------------------
/tests/babel/next-ssg-plugin/__fixtures__/class-exports/code.js:
--------------------------------------------------------------------------------
1 | export function getStaticProps() {
2 | return { props: {} };
3 | }
4 |
5 | export default class Test extends React.Component {
6 | render() {
7 | return ;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/packages/components/src/input/demos/demo1.scss:
--------------------------------------------------------------------------------
1 | .normalInput {
2 | height: 51px;
3 | margin: 0 17px;
4 | }
5 |
6 | .textarea {
7 | min-height: 51px;
8 | margin: 0 17px;
9 | padding: 10px;
10 | background-color: #f8f8f8;
11 | }
12 |
--------------------------------------------------------------------------------
/packages/components/src/text/demos/demo1.scss:
--------------------------------------------------------------------------------
1 | .text-box {
2 | margin: 17px;
3 | }
4 |
5 | .text-block {
6 | display: block;
7 | height: 24px;
8 | overflow: hidden;
9 | white-space: nowrap;
10 | text-overflow: ellipsis;
11 | }
12 |
--------------------------------------------------------------------------------
/tests/babel/taro-app-plugin/__fixtures__/basic/code.js:
--------------------------------------------------------------------------------
1 | import { Component } from "react";
2 | import "./app.scss";
3 |
4 | class App extends Component {
5 | render() {
6 | return this.props.children;
7 | }
8 | }
9 |
10 | export default App;
11 |
--------------------------------------------------------------------------------
/packages/components/src/form/index.md:
--------------------------------------------------------------------------------
1 | # Form 表单
2 |
3 | 表单,将 Form 组件内用户输入的 Switch、Input、Checkbox、Slider、Radio、Picker 提交。当表单中 formType 为 submit 时,点击的 Button 组件会将表单组件中的 value 值进行提交,需要在表单组件中加上 name 来作为 key 。
4 |
5 | ## 示例
6 |
7 |
8 |
--------------------------------------------------------------------------------
/packages/components/src/progress/style/index.scss:
--------------------------------------------------------------------------------
1 | .weui-progress {
2 | &__bar {
3 | overflow: hidden;
4 | }
5 |
6 | &__inner-bar {
7 | width: 100%;
8 | height: 100%;
9 | transform-origin: left;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/tests/babel/next-ssg-plugin/__fixtures__/class-declarations/code.js:
--------------------------------------------------------------------------------
1 | function getStaticPaths() {
2 | return [];
3 | }
4 |
5 | export { getStaticPaths }
6 |
7 | export class MyClass {}
8 |
9 | export default function Test() {
10 | return ;
11 | }
12 |
--------------------------------------------------------------------------------
/tests/babel/next-ssg-plugin/__fixtures__/retain-extra-named-export-function/code.js:
--------------------------------------------------------------------------------
1 | export function getStaticProps() {
2 | return { props: {} }
3 | }
4 |
5 | export function Noop() {}
6 |
7 | export default function Test() {
8 | return ;
9 | }
10 |
--------------------------------------------------------------------------------
/packages/components/src/navigator/style/index.scss:
--------------------------------------------------------------------------------
1 | .taro-nav {
2 | display: block;
3 | width: auto;
4 | height: auto;
5 | color: inherit;
6 | }
7 |
8 | .navigator-hover {
9 | opacity: .7;
10 | background-color: rgba(0, 0, 0, .1)
11 | }
12 |
--------------------------------------------------------------------------------
/packages/components/README.md:
--------------------------------------------------------------------------------
1 | # Taro 组件的 React 实现
2 |
3 | ## 文档
4 |
5 | https://nervjs.github.io/tarojs-plugin-platform-nextjs/
6 |
7 | ## 安装
8 |
9 | ```bash
10 | npm install @taror/components
11 | ```
12 |
13 | ```bash
14 | yarn add @taror/components
15 | ```
16 |
--------------------------------------------------------------------------------
/tests/babel/class-component-taro-router-plugin/__fixtures__/property/code.js:
--------------------------------------------------------------------------------
1 | import Taro from "@tarojs/taro";
2 |
3 | export default class Index extends Component {
4 | $instance = Taro.getCurrentInstance();
5 |
6 | render() {
7 | return null;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/tests/babel/next-ssg-plugin/__fixtures__/babel-style-memoized-function/code.js:
--------------------------------------------------------------------------------
1 | function fn() {
2 | fn = function () {};
3 | return fn.apply(this, arguments);
4 | }
5 | export function getStaticProps() {
6 | fn;
7 | }
8 | export default function Home() { return ; }
9 |
--------------------------------------------------------------------------------
/packages/components/src/progress/demos/demo1.scss:
--------------------------------------------------------------------------------
1 | .progress,
2 | .inner-progress {
3 | margin: 35px 23px;
4 | }
5 |
6 | .inner-progress .progress-bar {
7 | border-radius: 25px;
8 | }
9 | .inner-progress .progress-inner-bar {
10 | border-radius: 25px;
11 | }
12 |
--------------------------------------------------------------------------------
/packages/nextjs/taro/src/device/index.ts:
--------------------------------------------------------------------------------
1 | export * from './accelerometer'
2 | export * from './battery'
3 | export * from './clipboard'
4 | export * from './compass'
5 | export * from './motion'
6 | export * from './network'
7 | export * from './phone'
8 | export * from './vibrate'
9 |
--------------------------------------------------------------------------------
/tests/babel/next-ssg-plugin/__fixtures__/remove-named-export-function/code.js:
--------------------------------------------------------------------------------
1 | export function getStaticPaths() {
2 | return []
3 | }
4 | export function getStaticProps() {
5 | return { props: {} }
6 | }
7 | export default function Test() {
8 | return
9 | }
10 |
--------------------------------------------------------------------------------
/examples/reactions/babel.config.js:
--------------------------------------------------------------------------------
1 | // babel-preset-taro 更多选项和默认值:
2 | // https://github.com/NervJS/taro/blob/next/packages/babel-preset-taro/README.md
3 | module.exports = {
4 | presets: [
5 | ['taro', {
6 | framework: 'react',
7 | ts: true
8 | }]
9 | ]
10 | }
11 |
--------------------------------------------------------------------------------
/tests/babel/next-ssg-plugin/__fixtures__/not-mix-up-bindings/output.js:
--------------------------------------------------------------------------------
1 | function Function1() {
2 | return {
3 | a: function bug(a) {
4 | return 2;
5 | },
6 | };
7 | }
8 |
9 | function Function2() {
10 | var bug = 1;
11 | return {
12 | bug,
13 | };
14 | }
15 |
--------------------------------------------------------------------------------
/examples/data-fetch/babel.config.js:
--------------------------------------------------------------------------------
1 | // babel-preset-taro 更多选项和默认值:
2 | // https://github.com/NervJS/taro/blob/next/packages/babel-preset-taro/README.md
3 | module.exports = {
4 | presets: [
5 | ['taro', {
6 | framework: 'react',
7 | ts: true
8 | }]
9 | ]
10 | }
11 |
--------------------------------------------------------------------------------
/tests/taro/device/clipboard.spec.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @jest-environment jsdom
3 | */
4 |
5 | import {getClipboardData} from 'tarojs-plugin-platform-nextjs/taro'
6 |
7 | it('storage', async () => {
8 | const {data: data1} = await getClipboardData()
9 | expect(data1).toBe('')
10 | })
11 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig is awesome: https://EditorConfig.org
2 |
3 | # top-most EditorConfig file
4 | root = true
5 |
6 | # Unix-style newlines with a newline ending every file
7 | [*]
8 | end_of_line = lf
9 | insert_final_newline = true
10 | indent_style = space
11 | indent_size = 4
12 |
--------------------------------------------------------------------------------
/examples/dynamic-routing/babel.config.js:
--------------------------------------------------------------------------------
1 | // babel-preset-taro 更多选项和默认值:
2 | // https://github.com/NervJS/taro/blob/next/packages/babel-preset-taro/README.md
3 | module.exports = {
4 | presets: [
5 | ['taro', {
6 | framework: 'react',
7 | ts: true
8 | }]
9 | ]
10 | }
11 |
--------------------------------------------------------------------------------
/tests/babel/class-component-taro-router-plugin/__fixtures__/ignore-function-component/code.js:
--------------------------------------------------------------------------------
1 | import Taro from "@tarojs/taro";
2 |
3 | function Index() {
4 | const $instance = Taro.getCurrentInstance();
5 | console.log($instance);
6 | return null;
7 | }
8 |
9 | export default Index;
10 |
--------------------------------------------------------------------------------
/tests/babel/class-component-taro-router-plugin/__fixtures__/ignore-function-component/output.js:
--------------------------------------------------------------------------------
1 | import Taro from "@tarojs/taro";
2 |
3 | function Index() {
4 | const $instance = Taro.getCurrentInstance();
5 | console.log($instance);
6 | return null;
7 | }
8 |
9 | export default Index;
10 |
--------------------------------------------------------------------------------
/tests/babel/next-ssg-plugin/__fixtures__/remove-named-export-variable/code.js:
--------------------------------------------------------------------------------
1 | export const getStaticPaths = () => {
2 | return [];
3 | }
4 |
5 | export const getStaticProps = function() {
6 | return { props: {} };
7 | }
8 |
9 | export default function Test() {
10 | return ;
11 | }
12 |
--------------------------------------------------------------------------------
/packages/components/src/switch/demos/demo1.scss:
--------------------------------------------------------------------------------
1 | .init-switch {
2 | margin: 14px 0 14px 17px;
3 | vertical-align: middle;
4 | }
5 |
6 | .init-switch-after {
7 | margin: 14px 0 14px 50px;
8 | vertical-align: middle;
9 | }
10 |
11 | .switch-text {
12 | vertical-align: middle;
13 | }
14 |
--------------------------------------------------------------------------------
/tests/babel/next-ssg-plugin/__fixtures__/remove-named-export-async-function/code.js:
--------------------------------------------------------------------------------
1 | export async function getStaticPaths() {
2 | return [];
3 | }
4 |
5 | export async function getStaticProps() {
6 | return { props: {} };
7 | }
8 |
9 | export default function Test() {
10 | return ;
11 | }
12 |
--------------------------------------------------------------------------------
/packages/components/src/picker-view-column/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | export interface PickerViewColumnProps {
4 | children?: React.ReactNode
5 | }
6 |
7 | const PickerViewColumn: React.FC