{"_id":"@bbface/near-bos-webcomponent-livepeer","name":"@bbface/near-bos-webcomponent-livepeer","dist-tags":{"latest":"0.0.5"},"versions":{"0.0.5":{"name":"@bbface/near-bos-webcomponent-livepeer","version":"0.0.5","homepage":"https://github.com/bb-face/near-bos-webcomponent","repository":{"type":"git","url":"git+https://github.com/bb-face/near-bos-webcomponent.git"},"publishConfig":{"access":"public"},"dependencies":{"@braintree/sanitize-url":"^6.0.2","@livepeer/react":"^4.1.0","@playwright/test":"^1.38.1","@radix-ui/react-popover":"^1.0.7","big.js":"^6.1.1","bn.js":"^5.1.1","bootstrap":"^5.3.1","bootstrap-icons":"^1.9.0","collections":"^5.1.12","dotenv":"^16.4.5","error-polyfill":"^0.1.2","livepeer":"^3.0.2","local-storage":"^2.0.0","lucide-react":"^0.367.0","near-api-js":"^2.1.3","near-social-vm":"git+https://github.com/NearSocial/VM.git","near-social-vm-types":"^1.0.0","prettier":"^2.7.1","qrcode.react":"^3.1.0","react":"^18.2.0","react-bootstrap":"^2.5.0","react-bootstrap-typeahead":"^6.1.2","react-dom":"^18.2.0","react-router-dom":"^6.20.0","socket.io-client":"^4.7.2","styled-components":"^5.3.6","tus-js-client":"^4.1.0","zustand":"^4.5.2"},"scripts":{"webpack":"webpack","dev":"yarn run webpack -- --env mode=development","prod":"yarn run webpack -- --env mode=production","prod:analyze":"yarn run prod -- --env presets=analyze","build":"yarn run prod","start":"yarn run dev && http-server -p 3000 dist --allowed-hosts=all","serve:prod":"http-server -p 3000 dist","generateimportmap":"(cd public && jspm link index.html -o index.html)","web4:deploy":"NEAR_ENV=mainnet npx web4-deploy dist psalomobos.near --nearfs","test":"npx playwright test"},"eslintConfig":{"extends":["react-app","react-app/jest"]},"browserslist":{"production":[">0.2%","not dead","not op_mini all"],"development":["last 1 chrome version","last 1 firefox version","last 1 safari version"]},"devDependencies":{"@babel/cli":"^7.15.4","@babel/core":"^7.15.5","@babel/preset-env":"^7.15.4","@babel/preset-react":"^7.14.5","assert":"^2.0.0","babel-loader":"^8.2.2","browserify-zlib":"^0.2.0","buffer":"^6.0.3","clean-webpack-plugin":"^4.0.0","copy-webpack-plugin":"^9.0.1","cross-env":"^7.0.3","crypto-browserify":"^3.12.0","css-loader":"^6.2.0","css-minimizer-webpack-plugin":"^3.0.2","html-webpack-plugin":"^5.3.2","http-server":"^14.1.1","https-browserify":"^1.0.0","jspm":"^3.1.0","mini-css-extract-plugin":"^2.2.2","os-browserify":"^0.3.0","path-browserify":"^1.0.1","postcss-loader":"^7.0.1","process":"^0.11.10","raw-loader":"^4.0.2","sass":"^1.66.1","sass-loader":"^13.1.0","stream-browserify":"^3.0.0","stream-http":"^3.2.0","style-loader":"^3.2.1","url":"^0.11.0","webpack":"^5.52.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.8.0","webpack-dev-server":"^4.1.0","webpack-manifest-plugin":"^5.0.0","webpack-merge":"^5.8.0"},"_id":"@bbface/near-bos-webcomponent-livepeer@0.0.5","gitHead":"5084f07cc4408933e6b928b43cd0623a203dbabf","description":"This is a Proof of Concept of embedding a NEAR BOS widget into any web application as a Web Component / Custom element.","bugs":{"url":"https://github.com/bb-face/near-bos-webcomponent/issues"},"_nodeVersion":"21.7.3","_npmVersion":"10.5.0","dist":{"integrity":"sha512-FfbJrUM0wRzNsii3owly+l+2Ib/V8iU5UGDIPtgWB+3qAaGeuNWKaRtsi42cI9AJ4YHS4JtbA/ghis3U3ZGSBw==","shasum":"d4584b54a783e86ece76e978b258908c79eb26a5","tarball":"https://registry.npmjs.org/@bbface/near-bos-webcomponent-livepeer/-/near-bos-webcomponent-livepeer-0.0.5.tgz","fileCount":9,"unpackedSize":6178183,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCTJtIR32atoQxJ2NIHsEXpQBgifosT3/B5WwjcBDAejQIgXxrZ2h0sG4SbN1PzYFFGHyhH/tBR+ilkY6kUJqBxbVE="}]},"_npmUser":{"name":"bbface","email":"stefano1990@gmail.com"},"directories":{},"maintainers":[{"name":"bbface","email":"stefano1990@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/near-bos-webcomponent-livepeer_0.0.5_1713992440554_0.7423140894466411"},"_hasShrinkwrap":false}},"time":{"created":"2024-04-24T21:00:40.402Z","0.0.5":"2024-04-24T21:00:40.824Z","modified":"2024-04-24T21:00:41.171Z"},"maintainers":[{"name":"bbface","email":"stefano1990@gmail.com"}],"description":"This is a Proof of Concept of embedding a NEAR BOS widget into any web application as a Web Component / Custom element.","homepage":"https://github.com/bb-face/near-bos-webcomponent","repository":{"type":"git","url":"git+https://github.com/bb-face/near-bos-webcomponent.git"},"bugs":{"url":"https://github.com/bb-face/near-bos-webcomponent/issues"},"readme":"# NEAR BOS Web Component ( custom element )\n\nThis is a Proof of Concept of embedding a NEAR BOS widget into any web application as a Web Component / Custom element.\n\nJust load react production react bundles into your index.html as shown below, and use the `near-social-viewer` custom element to embed the BOS widget.\n\n```html\n<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\">\n    <meta name=\"viewport\" content=\"width=device-width,initial-scale=1\">\n    <title>Near social</title>\n    <script defer=\"defer\" src=\"/runtime.REPLACE_WITH_BUNDLE_HASH.bundle.js\"></script>\n    <script defer=\"defer\" src=\"/main.REPLACE_WITH_BUNDLE_HASH.bundle.js\"></script></head>\n  <body>\n    <h1>NEAR BOS embeddable custom element</h1>\n    <near-social-viewer></near-social-viewer>\n  </body>\n</html>\n```\n\n\n## Setup & Development\n\nInitialize repo:\n```\nyarn\n```\n\nStart development version:\n```\nyarn start\n```\n\nProduction build:\n\n```\nyarn prod\n```\n\nServe the production build:\n\n```\nyarn serve prod\n```\n\n# Use redirectmap for development\n\nThe NEAR social VM supports a feature called `redirectMap` which allows you to load widgets from other sources than the on chain social db. An example redirect map can look like this:\n\n```json\n{\"devhub.near/widget/devhub.page.feed\": {\"code\": \"return 'hello';\"}}\n```\n\nThe result of applying this redirect map is that the widget `devhub.near/widget/devhub.page.feed` will be replaced by a string that says `hello`.\n\nThe `near-social-viewer` web component supports loading a redirect map from the session storage, which is useful when using the viewer for local development or test pipelines.\n\nBy setting the session storage key `nearSocialVMredirectMap` to the JSON value of the redirect map, the web component will pass this to the VM Widget config.\n\nYou can also use the same mechanism as [near-discovery](https://github.com/near/near-discovery/) where you can load components from a locally hosted [bos-loader](https://github.com/near/bos-loader) by adding the key `flags` to localStorage with the value `{\"bosLoaderUrl\": \"http://127.0.0.1:3030\" }`.\n\n\n# Configuring the default widget\n\nThe `near-social-viewer` web component supports three attributes:\n\n* `src` : the src of the widget to render (e.g. `devs.near/widget/default`)\n* `code`: raw, valid, stringified widget code to render (e.g. `\"return <p>hello world</p>\"`)\n* `initialProps`: initial properties to be passed to the rendered widget.\n\nYou can modify the default widget that is displayed via the configuration in `./bos.config.json`.\n\nMake changes to `web4/index` as shown below:\n\n```json\n{\n  \"account\": \"devs.near\",\n  \"web4\": {\n    \"index\": {\n      \"src\": \"devs.near/widget/default\",\n      // \"code\": \"return <p>Hello world!</p>\"\n      \"initialProps\": {\n        \"message\": \"hello world!\"\n      }\n    }\n  }\n}\n```\n\nThen be sure to build `yarn run prod` to see the changes take effect.\n","readmeFilename":"README.md"}