{"_id":"@amarajs/plugin-engine-browser","_rev":"2-0117772d6d0bd4c58e2cb6bec360b449","name":"@amarajs/plugin-engine-browser","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@amarajs/plugin-engine-browser","amdName":"AmaraBrowser","version":"0.1.0","description":"Coordinates with @amarajs/core to enable feature development for web applications.","jsnext:main":"src/index.js","main":"dist/amara-plugin-engine-browser.js","umd:main":"dist/amara-plugin-engine-browser.umd.js","scripts":{"bump":"standard-version","testonly":"mocha --compilers js:babel-register test/**/*.js","lint":"eslint src test","test":"flow && npm run lint && npm run testonly","build":"npm-run-all clean -p rollup:* -p minify:* -s size","clean":"rimraf dist && mkdirp dist","rollup:cjs":"rollup -c rollup.config.js -f cjs -n AmaraBrowser src/index.js -o dist/amara-plugin-engine-browser.js","rollup:umd":"rollup -c rollup.config.js -f umd -n AmaraBrowser src/index.js -o dist/amara-plugin-engine-browser.umd.js","minify:cjs":"uglifyjs dist/amara-plugin-engine-browser.js -cm toplevel -o dist/amara-plugin-engine-browser.min.js -p relative --source-map dist/amara-plugin-engine-browser.min.js.map","minify:umd":"uglifyjs dist/amara-plugin-engine-browser.umd.js -cm -o dist/amara-plugin-engine-browser.umd.min.js -p relative --source-map dist/amara-plugin-engine-browser.umd.min.js.map","size":"strip-json-comments --no-whitespace dist/amara-plugin-engine-browser.min.js | gzip-size | pretty-bytes","release":"npm run build -s && npm run bump && git push --follow-tags origin master && npm publish"},"keywords":["amara","amarajs","engine","browser"],"authors":["Dan Barnes <amarajs.framework@gmail.com>"],"repository":{"type":"git","url":"git+https://github.com/amarajs/plugin-engine-browser.git"},"license":"MIT","files":["src","dist"],"eslintConfig":{"parser":"babel-eslint","extends":"eslint:recommended","env":{"browser":true,"mocha":true,"node":true,"es6":true},"globals":{"expect":true},"rules":{"no-cond-assign":0}},"devDependencies":{"babel-core":"^6.9.1","babel-eslint":"^7.1.1","babel-plugin-transform-flow-strip-types":"^6.21.0","babel-preset-es2015":"^6.9.0","babel-preset-stage-0":"^6.5.0","babel-register":"^6.9.0","chai":"^3.5.0","eslint":"^3.13.1","flow-bin":"^0.44.0","gzip-size-cli":"^1.0.0","jsdom":"^11.6.2","mkdirp":"^0.5.1","mocha":"^3.2.0","npm-run-all":"^2.1.1","pretty-bytes-cli":"^2.0.0","rimraf":"^2.5.2","rollup":"^0.41.4","rollup-plugin-buble":"^0.15.0","rollup-plugin-flow":"^1.1.1","sinon":"^1.17.4","sinon-chai":"^2.8.0","standard-version":"^4.0.0","strip-json-comments-cli":"^1.0.1","uglify-js":"^2.6.2"},"gitHead":"8573df4aa97207c139d5348ae40cb11c976d2e6c","bugs":{"url":"https://github.com/amarajs/plugin-engine-browser/issues"},"homepage":"https://github.com/amarajs/plugin-engine-browser#readme","_id":"@amarajs/plugin-engine-browser@0.1.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"amarajs-dan","email":"amarajs.framework@gmail.com"},"dist":{"integrity":"sha512-HccpNYbRt5dxcpenu0o+zVz6FKM/w6DkBHTKd1kR9AI4kU/GKTJt0famXbPHY1fltppgxpvcRHk7uo81thIjXg==","shasum":"d962f57506e20c11f842d20602093fd60372cba5","tarball":"https://registry.npmjs.org/@amarajs/plugin-engine-browser/-/plugin-engine-browser-0.1.0.tgz","fileCount":10,"unpackedSize":48655,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD3fheume71LkRk1sdv026pGS8qtHcgRoDOBiOQ35K6KwIgEV/z1NK6gopIsXxXuKvxCc8yCrEc++hU+i8iWejxZtg="}]},"maintainers":[{"name":"amarajs-dan","email":"amarajs.framework@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-engine-browser_0.1.0_1522618250517_0.4796746593349728"},"_hasShrinkwrap":false}},"time":{"created":"2018-04-01T21:30:50.466Z","0.1.0":"2018-04-01T21:30:50.590Z","modified":"2022-04-04T13:43:42.953Z"},"maintainers":[{"name":"amarajs-dan","email":"amarajs.framework@gmail.com"}],"description":"Coordinates with @amarajs/core to enable feature development for web applications.","homepage":"https://github.com/amarajs/plugin-engine-browser#readme","keywords":["amara","amarajs","engine","browser"],"repository":{"type":"git","url":"git+https://github.com/amarajs/plugin-engine-browser.git"},"bugs":{"url":"https://github.com/amarajs/plugin-engine-browser/issues"},"license":"MIT","readme":"## @amarajs/plugin-engine-browser\n\nPlugin middleware for AmaraJS to work in web browsers.\n\n### Installation\n\n`npm install --save @amarajs/plugin-engine-browser`\n\n### Usage\n\n```javascript\nimport Amara from '@amarajs/core';\nimport AmaraBrowser from '@amarajs/plugin-engine-browser';\nconst amara = new Amara([\n    AmaraBrowser()\n]);\n```\n\n### Description\n\nThe `@amarajs/plugin-engine-browser` middleware provides `@amarajs/core` with the ability to map each feature's `target` selector strings to DOM nodes. For example:\n\n```javascript\namara.add({\n    type: 'some-custom-type',\n    // @amarajs/engine-plugin-browser will use these CSS\n    // query selectors to identify the DOM nodes this\n    // feature should be applied to\n    targets: ['div#main', 'span', 'a[href^=\"#\"]'],\n    apply: () => {}\n});\n```\n\n### Actions Dispatched\n\nThe `@amarajs/plugin-engine-browser` middleware dispatches an `\"engine:append-observed-attributes\"` action during bootstrap. This allows other middleware to specify which DOM attributes should be watched for changes. For example, `@amarajs/plugin-router` adds `\"route\"` to the list of observed attributes, ensuring that any features which target `[route]` attributes will be applied automatically by AmaraJS.\n\naction.type | action.payload\n--- | ---\n`\"engine:append-observed-attributes\"` | `Set<string>`\n\n```javascript\n// in custom middleware\n// watch for changes to \"modal\" attributes\nreturn function handler(action) {\n    switch (action.type) {\n    case 'engine:append-observed-attributes':\n        action.payload.add('modal');\n        break;\n    }\n};\n```\n\n### Customization\n\nThis plugin has no customization options.\n\n### Contributing\n\nIf you have a feature request, please create a new issue so the community can discuss it.\n\nIf you find a defect, please submit a bug report that includes a working link to reproduce the problem (for example, using [jsBin](https://jsbin.com)). Of course, pull requests to fix open issues are always welcome!\n\n### License\n\nThe MIT License (MIT)\n\nCopyright (c) Dan Barnes\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md"}