From 2471e1034664c348cb9fa4646b306f48c44572ec Mon Sep 17 00:00:00 2001 From: fragosti Date: Fri, 28 Sep 2018 13:09:16 +0200 Subject: Have React setup with basic build working --- packages/instant/CHANGELOG.json | 1 + packages/instant/CHANGELOG.md | 1 + packages/instant/README.md | 79 ++++++++++++++++++++++ packages/instant/package.json | 70 +++++++++++++++++++ .../instant/src/components/zero_ex_instant.tsx | 5 ++ packages/instant/src/globals.d.ts | 6 ++ packages/instant/src/index.ts | 1 + packages/instant/tsconfig.json | 16 +++++ packages/instant/tslint.json | 3 + packages/instant/typedoc-tsconfig.json | 7 ++ packages/instant/webpack.config.js | 20 ++++++ 11 files changed, 209 insertions(+) create mode 100644 packages/instant/CHANGELOG.json create mode 100644 packages/instant/CHANGELOG.md create mode 100644 packages/instant/README.md create mode 100644 packages/instant/package.json create mode 100644 packages/instant/src/components/zero_ex_instant.tsx create mode 100644 packages/instant/src/globals.d.ts create mode 100644 packages/instant/src/index.ts create mode 100644 packages/instant/tsconfig.json create mode 100644 packages/instant/tslint.json create mode 100644 packages/instant/typedoc-tsconfig.json create mode 100644 packages/instant/webpack.config.js (limited to 'packages') diff --git a/packages/instant/CHANGELOG.json b/packages/instant/CHANGELOG.json new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/packages/instant/CHANGELOG.json @@ -0,0 +1 @@ +[] diff --git a/packages/instant/CHANGELOG.md b/packages/instant/CHANGELOG.md new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/packages/instant/CHANGELOG.md @@ -0,0 +1 @@ + diff --git a/packages/instant/README.md b/packages/instant/README.md new file mode 100644 index 000000000..ec114bd93 --- /dev/null +++ b/packages/instant/README.md @@ -0,0 +1,79 @@ +## @0xproject/instant + +## Installation + +```bash +yarn add @0xproject/instant +``` + +**Import** + +```typescript +import { ZeroExInstant } from '@0xproject/instant'; +``` + +or + +```javascript +var ZeroExInstant = require('@0xproject/instant').ZeroExInstant; +``` + +If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`: + +```json +"compilerOptions": { + "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"], +} +``` + +## Contributing + +We welcome improvements and fixes from the wider community! To report bugs within this package, please create an issue in this repository. + +Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started. + +### Install dependencies + +If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them: + +```bash +yarn config set workspaces-experimental true +``` + +Then install dependencies + +```bash +yarn install +``` + +### Build + +To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory: + +```bash +PKG=@0xproject/instant yarn build +``` + +Or continuously rebuild on change: + +```bash +PKG=@0xproject/instant yarn watch +``` + +### Clean + +```bash +yarn clean +``` + +### Lint + +```bash +yarn lint +``` + +### Run Tests + +```bash +yarn test +``` diff --git a/packages/instant/package.json b/packages/instant/package.json new file mode 100644 index 000000000..e1131b7e6 --- /dev/null +++ b/packages/instant/package.json @@ -0,0 +1,70 @@ +{ + "name": "@0xproject/instant", + "version": "0.0.1", + "engines": { + "node": ">=6.12" + }, + "description": "0x Instant React Component", + "main": "lib/src/index.js", + "types": "lib/src/index.d.ts", + "scripts": { + "watch_without_deps": "tsc -w", + "lint": "tslint --project .", + "test": "yarn run_mocha", + "rebuild_and_test": "run-s clean build test", + "test:coverage": "nyc npm run test --all && yarn coverage:report:lcov", + "coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info", + "test:circleci": "yarn test:coverage", + "run_mocha": "mocha --require source-map-support/register --require make-promises-safe lib/test/**/*_test.js --exit", + "clean": "shx rm -rf lib test_temp scripts", + "build": "webpack --mode production && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts", + "manual:postpublish": "yarn build; node ./scripts/postpublish.js" + }, + "config": { + "postpublish": { + "assets": [] + } + }, + "repository": { + "type": "git", + "url": "https://github.com/0xProject/0x-monorepo.git" + }, + "author": "Francesco Agosti", + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/0xProject/0x-monorepo/issues" + }, + "homepage": "https://github.com/0xProject/0x-monorepo/packages/instant/README.md", + "dependencies": { + "@0xproject/connect": "^2.0.4", + "@0xproject/types": "^1.1.1", + "@0xproject/typescript-typings": "^2.0.2", + "@0xproject/utils": "^1.0.11", + "@0xproject/web3-wrapper": "^3.0.1", + "ethereum-types": "^1.0.8", + "lodash": "^4.17.10", + "react": "^16.5.2", + "react-dom": "^16.5.2" + }, + "devDependencies": { + "@0xproject/tslint-config": "^1.0.7", + "@types/lodash": "^4.14.116", + "@types/node": "*", + "@types/react": "16.4.7", + "@types/react-dom": "^16.0.8", + "awesome-typescript-loader": "^5.2.1", + "copyfiles": "^1.2.0", + "make-promises-safe": "^1.1.0", + "npm-run-all": "^4.1.2", + "nyc": "^11.0.1", + "shx": "^0.2.2", + "tslint": "5.11.0", + "typedoc": "0.12.0", + "typescript": "3.0.1", + "webpack": "^4.20.2", + "webpack-cli": "^3.1.1" + }, + "publishConfig": { + "access": "private" + } +} diff --git a/packages/instant/src/components/zero_ex_instant.tsx b/packages/instant/src/components/zero_ex_instant.tsx new file mode 100644 index 000000000..67e1b683d --- /dev/null +++ b/packages/instant/src/components/zero_ex_instant.tsx @@ -0,0 +1,5 @@ +import * as React from 'react'; + +export interface ZeroExInstantProps {} + +export const ZeroExInstant: React.StatelessComponent = () =>
ZeroExInstant
; diff --git a/packages/instant/src/globals.d.ts b/packages/instant/src/globals.d.ts new file mode 100644 index 000000000..94e63a32d --- /dev/null +++ b/packages/instant/src/globals.d.ts @@ -0,0 +1,6 @@ +declare module '*.json' { + const json: any; + /* tslint:disable */ + export default json; + /* tslint:enable */ +} diff --git a/packages/instant/src/index.ts b/packages/instant/src/index.ts new file mode 100644 index 000000000..345246d09 --- /dev/null +++ b/packages/instant/src/index.ts @@ -0,0 +1 @@ +export { ZeroExInstant } from './components/zero_ex_instant'; diff --git a/packages/instant/tsconfig.json b/packages/instant/tsconfig.json new file mode 100644 index 000000000..69d2520fa --- /dev/null +++ b/packages/instant/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig", + "compilerOptions": { + "outDir": "lib", + "rootDir": ".", + "jsx": "react", + "allowSyntheticDefaultImports": true, + "noImplicitAny": true, + "module": "ESNext", + "moduleResolution": "node", + "lib": ["es2015"], + "target": "es5", + "sourceMap": true + }, + "include": ["./src/**/*", "./test/**/*"] +} diff --git a/packages/instant/tslint.json b/packages/instant/tslint.json new file mode 100644 index 000000000..ffaefe83a --- /dev/null +++ b/packages/instant/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": ["@0xproject/tslint-config"] +} diff --git a/packages/instant/typedoc-tsconfig.json b/packages/instant/typedoc-tsconfig.json new file mode 100644 index 000000000..c9b0af1ae --- /dev/null +++ b/packages/instant/typedoc-tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../typedoc-tsconfig", + "compilerOptions": { + "outDir": "lib" + }, + "include": ["./src/**/*", "./test/**/*"] +} diff --git a/packages/instant/webpack.config.js b/packages/instant/webpack.config.js new file mode 100644 index 000000000..f7500c69c --- /dev/null +++ b/packages/instant/webpack.config.js @@ -0,0 +1,20 @@ +const path = require('path'); +module.exports = { + entry: './src/index.ts', + output: { + filename: '[name].bundle.js', + path: path.resolve(__dirname, 'lib'), + }, + devtool: 'source-map', + resolve: { + extensions: ['.js', '.json', '.ts', '.tsx'], + }, + module: { + rules: [ + { + test: /\.(ts|tsx)$/, + loader: 'awesome-typescript-loader', + }, + ], + }, +}; -- cgit v1.2.3 From a64bee9f8375a5a21cdd070b253afc37c75c4338 Mon Sep 17 00:00:00 2001 From: fragosti Date: Tue, 2 Oct 2018 13:29:14 -0700 Subject: Tests are working with coverage --- packages/instant/jest.config.js | 10 ++++++++++ packages/instant/test/components/zero_ex_instant.test.tsx | 13 +++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 packages/instant/jest.config.js create mode 100644 packages/instant/test/components/zero_ex_instant.test.tsx (limited to 'packages') diff --git a/packages/instant/jest.config.js b/packages/instant/jest.config.js new file mode 100644 index 000000000..29c365835 --- /dev/null +++ b/packages/instant/jest.config.js @@ -0,0 +1,10 @@ +module.exports = { + roots: ['/test'], + coverageDirectory: 'coverage', + transform: { + '.*.tsx?$': 'ts-jest', + }, + testRegex: '(/__test__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$', + moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], + collectCoverageFrom: ['src/**/*.{ts,tsx}', '!src/index.tsx'], +}; diff --git a/packages/instant/test/components/zero_ex_instant.test.tsx b/packages/instant/test/components/zero_ex_instant.test.tsx new file mode 100644 index 000000000..5858732cf --- /dev/null +++ b/packages/instant/test/components/zero_ex_instant.test.tsx @@ -0,0 +1,13 @@ +import { configure, shallow } from 'enzyme'; +import * as Adapter from 'enzyme-adapter-react-16'; +import * as React from 'react'; + +configure({ adapter: new Adapter() }); + +import { ZeroExInstant } from '../../src'; + +describe('', () => { + it('shallow renders without crashing', () => { + shallow(); + }); +}); -- cgit v1.2.3 From 20f18c305495c0d9656bd0cbdfd322f60764c847 Mon Sep 17 00:00:00 2001 From: fragosti Date: Tue, 2 Oct 2018 13:34:32 -0700 Subject: Clean up package json --- packages/instant/package.json | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'packages') diff --git a/packages/instant/package.json b/packages/instant/package.json index e1131b7e6..7f1530fa8 100644 --- a/packages/instant/package.json +++ b/packages/instant/package.json @@ -10,13 +10,11 @@ "scripts": { "watch_without_deps": "tsc -w", "lint": "tslint --project .", - "test": "yarn run_mocha", + "test": "jest", + "test:coverage": "jest --coverage", "rebuild_and_test": "run-s clean build test", - "test:coverage": "nyc npm run test --all && yarn coverage:report:lcov", - "coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info", "test:circleci": "yarn test:coverage", - "run_mocha": "mocha --require source-map-support/register --require make-promises-safe lib/test/**/*_test.js --exit", - "clean": "shx rm -rf lib test_temp scripts", + "clean": "shx rm -rf lib coverage scripts", "build": "webpack --mode production && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts", "manual:postpublish": "yarn build; node ./scripts/postpublish.js" }, @@ -48,16 +46,22 @@ }, "devDependencies": { "@0xproject/tslint-config": "^1.0.7", + "@types/enzyme": "^3.1.14", + "@types/enzyme-adapter-react-16": "^1.0.3", "@types/lodash": "^4.14.116", "@types/node": "*", "@types/react": "16.4.7", "@types/react-dom": "^16.0.8", "awesome-typescript-loader": "^5.2.1", "copyfiles": "^1.2.0", + "enzyme": "^3.6.0", + "enzyme-adapter-react-16": "^1.5.0", + "jest": "^23.6.0", "make-promises-safe": "^1.1.0", "npm-run-all": "^4.1.2", "nyc": "^11.0.1", "shx": "^0.2.2", + "ts-jest": "^23.10.3", "tslint": "5.11.0", "typedoc": "0.12.0", "typescript": "3.0.1", -- cgit v1.2.3 From 2540660262313c2d53a2d38af190748857ba3f8d Mon Sep 17 00:00:00 2001 From: fragosti Date: Tue, 2 Oct 2018 15:48:00 -0700 Subject: Add dev environment --- packages/instant/package.json | 14 +++++++++++--- packages/instant/src/index.ts | 2 +- packages/instant/tsconfig.json | 5 +++-- packages/instant/webpack.config.js | 12 ++++++++++-- 4 files changed, 25 insertions(+), 8 deletions(-) (limited to 'packages') diff --git a/packages/instant/package.json b/packages/instant/package.json index 7f1530fa8..d33dfb7c3 100644 --- a/packages/instant/package.json +++ b/packages/instant/package.json @@ -8,19 +8,26 @@ "main": "lib/src/index.js", "types": "lib/src/index.d.ts", "scripts": { + "build": "yarn build:all", + "build:all": "run-p build:umd:prod build:commonjs", + "build:umd:prod": "webpack --mode production", + "build:commonjs": "tsc -b", "watch_without_deps": "tsc -w", + "dev": "webpack-dev-server --mode development", "lint": "tslint --project .", "test": "jest", "test:coverage": "jest --coverage", "rebuild_and_test": "run-s clean build test", "test:circleci": "yarn test:coverage", "clean": "shx rm -rf lib coverage scripts", - "build": "webpack --mode production && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts", "manual:postpublish": "yarn build; node ./scripts/postpublish.js" }, "config": { "postpublish": { - "assets": [] + "assets": [ + "packages/instant/public/index.js", + "packages/instant/public/index.min.js" + ] } }, "repository": { @@ -66,7 +73,8 @@ "typedoc": "0.12.0", "typescript": "3.0.1", "webpack": "^4.20.2", - "webpack-cli": "^3.1.1" + "webpack-cli": "^3.1.1", + "webpack-dev-server": "^3.1.9" }, "publishConfig": { "access": "private" diff --git a/packages/instant/src/index.ts b/packages/instant/src/index.ts index 345246d09..54059cdad 100644 --- a/packages/instant/src/index.ts +++ b/packages/instant/src/index.ts @@ -1 +1 @@ -export { ZeroExInstant } from './components/zero_ex_instant'; +export { ZeroExInstant, ZeroExInstantProps } from './components/zero_ex_instant'; diff --git a/packages/instant/tsconfig.json b/packages/instant/tsconfig.json index 69d2520fa..28a6190b8 100644 --- a/packages/instant/tsconfig.json +++ b/packages/instant/tsconfig.json @@ -8,9 +8,10 @@ "noImplicitAny": true, "module": "ESNext", "moduleResolution": "node", - "lib": ["es2015"], + "lib": ["es2015", "dom"], "target": "es5", "sourceMap": true }, - "include": ["./src/**/*", "./test/**/*"] + "include": ["./src/**/*", "./test/**/*"], + "exclude": ["./src/index.umd.ts"] } diff --git a/packages/instant/webpack.config.js b/packages/instant/webpack.config.js index f7500c69c..78a33ce90 100644 --- a/packages/instant/webpack.config.js +++ b/packages/instant/webpack.config.js @@ -1,9 +1,13 @@ const path = require('path'); +// The common js bundle (not this one) is built using tsc. +// The umd bundle (this one) has a different entrypoint. module.exports = { - entry: './src/index.ts', + entry: './src/index.umd.ts', output: { filename: '[name].bundle.js', - path: path.resolve(__dirname, 'lib'), + path: path.resolve(__dirname, 'public'), + library: 'zeroExInstant', + libraryTarget: 'umd', }, devtool: 'source-map', resolve: { @@ -17,4 +21,8 @@ module.exports = { }, ], }, + devServer: { + contentBase: path.join(__dirname, 'public'), + port: 5000, + }, }; -- cgit v1.2.3 From 8990b92dd66c65e0218edd42072dd8124f7694a8 Mon Sep 17 00:00:00 2001 From: fragosti Date: Tue, 2 Oct 2018 16:02:35 -0700 Subject: Add build:ci command --- packages/instant/package.json | 1 + 1 file changed, 1 insertion(+) (limited to 'packages') diff --git a/packages/instant/package.json b/packages/instant/package.json index d33dfb7c3..8eb3ab474 100644 --- a/packages/instant/package.json +++ b/packages/instant/package.json @@ -12,6 +12,7 @@ "build:all": "run-p build:umd:prod build:commonjs", "build:umd:prod": "webpack --mode production", "build:commonjs": "tsc -b", + "buld:ci": "yarn build", "watch_without_deps": "tsc -w", "dev": "webpack-dev-server --mode development", "lint": "tslint --project .", -- cgit v1.2.3 From dde918e9a0c616ab24bd061212f6024aceee508d Mon Sep 17 00:00:00 2001 From: fragosti Date: Tue, 2 Oct 2018 16:04:17 -0700 Subject: Add public dir --- packages/instant/public/index.html | 20 +++++++++++++++++++ packages/instant/public/main.bundle.js | 31 ++++++++++++++++++++++++++++++ packages/instant/public/main.bundle.js.map | 1 + packages/instant/src/index.umd.ts | 10 ++++++++++ 4 files changed, 62 insertions(+) create mode 100644 packages/instant/public/index.html create mode 100644 packages/instant/public/main.bundle.js create mode 100644 packages/instant/public/main.bundle.js.map create mode 100644 packages/instant/src/index.umd.ts (limited to 'packages') diff --git a/packages/instant/public/index.html b/packages/instant/public/index.html new file mode 100644 index 000000000..45968a3c9 --- /dev/null +++ b/packages/instant/public/index.html @@ -0,0 +1,20 @@ + + + + + + + 0x Instant Dev Environment + + + + +
+ + + + \ No newline at end of file diff --git a/packages/instant/public/main.bundle.js b/packages/instant/public/main.bundle.js new file mode 100644 index 000000000..479abea27 --- /dev/null +++ b/packages/instant/public/main.bundle.js @@ -0,0 +1,31 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.zeroExInstant=t():e.zeroExInstant=t()}(window,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(e,t,n){"use strict";e.exports=n(3)},function(e,t,n){"use strict"; +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,i,a=function(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),u=1;uP.length&&P.push(e)}function M(e,t,n){return null==e?0:function e(t,n,r,o){var a=typeof t;"undefined"!==a&&"boolean"!==a||(t=null);var u=!1;if(null===t)u=!0;else switch(a){case"string":case"number":u=!0;break;case"object":switch(t.$$typeof){case l:case i:u=!0}}if(u)return r(o,t,""===n?"."+I(t,0):n),1;if(u=0,n=""===n?".":n+":",Array.isArray(t))for(var c=0;cthis.eventPool.length&&this.eventPool.push(e)}function pe(e){e.eventPool=[],e.getPooled=fe,e.release=de}o(se.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=ue)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=ue)},persist:function(){this.isPersistent=ue},isPersistent:ce,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=ce,this._dispatchInstances=this._dispatchListeners=null}}),se.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},se.extend=function(e){function t(){}function n(){return r.apply(this,arguments)}var r=this;t.prototype=r.prototype;var l=new t;return o(l,n.prototype),n.prototype=l,n.prototype.constructor=n,n.Interface=o({},r.Interface,e),n.extend=r.extend,pe(n),n},pe(se);var me=se.extend({data:null}),he=se.extend({data:null}),ve=[9,13,27,32],ye=Q&&"CompositionEvent"in window,ge=null;Q&&"documentMode"in document&&(ge=document.documentMode);var be=Q&&"TextEvent"in window&&!ge,ke=Q&&(!ye||ge&&8=ge),we=String.fromCharCode(32),xe={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},Te=!1;function _e(e,t){switch(e){case"keyup":return-1!==ve.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function Ee(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Ce=!1;var Se={eventTypes:xe,extractEvents:function(e,t,n,r){var o=void 0,l=void 0;if(ye)e:{switch(e){case"compositionstart":o=xe.compositionStart;break e;case"compositionend":o=xe.compositionEnd;break e;case"compositionupdate":o=xe.compositionUpdate;break e}o=void 0}else Ce?_e(e,n)&&(o=xe.compositionEnd):"keydown"===e&&229===n.keyCode&&(o=xe.compositionStart);return o?(ke&&"ko"!==n.locale&&(Ce||o!==xe.compositionStart?o===xe.compositionEnd&&Ce&&(l=ae()):(le="value"in(oe=r)?oe.value:oe.textContent,Ce=!0)),o=me.getPooled(o,t,n,r),l?o.data=l:null!==(l=Ee(n))&&(o.data=l),K(o),l=o):l=null,(e=be?function(e,t){switch(e){case"compositionend":return Ee(t);case"keypress":return 32!==t.which?null:(Te=!0,we);case"textInput":return(e=t.data)===we&&Te?null:e;default:return null}}(e,n):function(e,t){if(Ce)return"compositionend"===e||!ye&&_e(e,t)?(e=ae(),ie=le=oe=null,Ce=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1