New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@bruit/component

Package Overview
Dependencies
Maintainers
1
Versions
162
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bruit/component - npm Package Compare versions

Comparing version 0.2.18 to 0.2.19

dist/bruit/bruit.bfff3dxu.js

4

dist/bruit.js
/*!
* Built with http://stenciljs.com
* 2018-11-13T11:01:27
* 2018-11-14T10:00:22
*/
!function(e,t,r,n,i,s,o,u,c,a,d,l,p,h){for(d=e.bruit=e.bruit||{},(l=t.createElement("style")).innerHTML="bruit-io{visibility:hidden}.hydrated{visibility:inherit}",l.setAttribute("data-styles",""),p=t.head.querySelector("meta[charset]"),t.head.insertBefore(l,p?p.nextSibling:t.head.firstChild),function(e,t,r){(e["s-apps"]=e["s-apps"]||[]).push("bruit"),r.componentOnReady||(r.componentOnReady=function(){var t=this;function r(r){if(t.nodeName.indexOf("-")>0){for(var n=e["s-apps"],i=0,s=0;s<n.length;s++)if(e[n[s]].componentOnReady){if(e[n[s]].componentOnReady(t,r))return;i++}if(i<n.length)return void(e["s-cr"]=e["s-cr"]||[]).push([t,r])}r(null)}return e.Promise?new e.Promise(r):{then:r}})}(e,0,a),i=i||d.resourcesUrl,l=(p=t.querySelectorAll("script")).length-1;l>=0&&!(h=p[l]).src&&!h.hasAttribute("data-resources-url");l--);p=h.getAttribute("data-resources-url"),!i&&p&&(i=p),!i&&h.src&&(i=(p=h.src.split("/").slice(0,-1)).join("/")+(p.length?"/":"")+"bruit/"),l=t.createElement("script"),function(e,t,r,n){return!(t.search.indexOf("core=esm")>0)&&(!(!(t.search.indexOf("core=es5")>0||"file:"===t.protocol)&&e.customElements&&e.customElements.define&&e.fetch&&e.CSS&&e.CSS.supports&&e.CSS.supports("color","var(--c)")&&"noModule"in r)||function(e){try{return new Function('import("")'),!1}catch(e){}return!0}())}(e,e.location,l)?l.src=i+"bruit.pd4esvid.js":(l.src=i+"bruit.4vn8dnd7.js",l.setAttribute("type","module"),l.setAttribute("crossorigin",!0)),l.setAttribute("data-resources-url",i),l.setAttribute("data-namespace","bruit"),t.head.appendChild(l)}(window,document,0,0,0,0,0,0,0,HTMLElement.prototype);
!function(e,t,r,n,i,s,o,u,c,a,l,d,p,f){for(l=e.bruit=e.bruit||{},(d=t.createElement("style")).innerHTML="bruit-io{visibility:hidden}.hydrated{visibility:inherit}",d.setAttribute("data-styles",""),p=t.head.querySelector("meta[charset]"),t.head.insertBefore(d,p?p.nextSibling:t.head.firstChild),function(e,t,r){(e["s-apps"]=e["s-apps"]||[]).push("bruit"),r.componentOnReady||(r.componentOnReady=function(){var t=this;function r(r){if(t.nodeName.indexOf("-")>0){for(var n=e["s-apps"],i=0,s=0;s<n.length;s++)if(e[n[s]].componentOnReady){if(e[n[s]].componentOnReady(t,r))return;i++}if(i<n.length)return void(e["s-cr"]=e["s-cr"]||[]).push([t,r])}r(null)}return e.Promise?new e.Promise(r):{then:r}})}(e,0,a),i=i||l.resourcesUrl,d=(p=t.querySelectorAll("script")).length-1;d>=0&&!(f=p[d]).src&&!f.hasAttribute("data-resources-url");d--);p=f.getAttribute("data-resources-url"),!i&&p&&(i=p),!i&&f.src&&(i=(p=f.src.split("/").slice(0,-1)).join("/")+(p.length?"/":"")+"bruit/"),d=t.createElement("script"),function(e,t,r,n){return!(t.search.indexOf("core=esm")>0)&&(!(!(t.search.indexOf("core=es5")>0||"file:"===t.protocol)&&e.customElements&&e.customElements.define&&e.fetch&&e.CSS&&e.CSS.supports&&e.CSS.supports("color","var(--c)")&&"noModule"in r)||function(e){try{return new Function('import("")'),!1}catch(e){}return!0}())}(e,e.location,d)?d.src=i+"bruit.ngk8nc1o.js":(d.src=i+"bruit.bfff3dxu.js",d.setAttribute("type","module"),d.setAttribute("crossorigin",!0)),d.setAttribute("data-resources-url",i),d.setAttribute("data-namespace","bruit"),t.head.appendChild(d)}(window,document,0,0,0,0,0,0,0,HTMLElement.prototype);
export class ConsoleTool {
static init(config) {
if (!(!!window.cordova ||
(document.URL.indexOf('http://localhost') !== 0 && document.URL.indexOf('http://127.0.0.1') !== 0) ||
(config.logLevels.click ||
config.logLevels.debug ||
config.logLevels.error ||
config.logLevels.info ||
config.logLevels.log ||
config.logLevels.network ||
config.logLevels.url ||
config.logLevels.warn))) {
ConsoleTool.LOG_ENABLED = false;
console.info('BRUIT.IO - logs reports are disabled in localhost mode');
}
ConsoleTool.BUFFER_SIZE = config.maxLogLines;

@@ -90,4 +103,3 @@ ConsoleTool.configure(config.logLevels);

}
if (!console.overloaded) {
console.log('[FeedlogService] - will overload console');
if (this.LOG_ENABLED && !console.overloaded) {
console.overloaded = true;

@@ -146,3 +158,3 @@ console.logArray = function () {

else {
console.log('[FeedlogService] - console already overloaded');
console.info('BRUIT.IO - console already overloaded or disabled');
}

@@ -182,1 +194,2 @@ }

ConsoleTool.logArray = [];
ConsoleTool.LOG_ENABLED = true;

@@ -18,3 +18,2 @@ import { BrtFieldType } from '@bruit/types/dist/enums/brt-field-type';

this._config = new BruitConfig(newConfig);
console.log(this._config);
}

@@ -27,14 +26,15 @@ else {

componentWillLoad() {
console.log('bruit started ...');
this.initConfig(this.config);
ConsoleTool.init(this._config);
if (this._config.logLevels.network) {
HttpTool.init();
if (ConsoleTool.LOG_ENABLED) {
if (this._config.logLevels.network) {
HttpTool.init();
}
if (this._config.logLevels.click) {
ClickTool.init();
}
if (this._config.logLevels.url) {
UrlTool.init();
}
}
if (this._config.logLevels.click) {
ClickTool.init();
}
if (this._config.logLevels.url) {
UrlTool.init();
}
this._haveInnerElement = !!this.bruitElement.innerHTML;

@@ -41,0 +41,0 @@ }

// bruit: Host Data, ES Module/es2017 Target
export const BruitIo = ["bruit-io","58ps8erg",1,[["_config",16],["bruitElement",64],["config",1],["data",1],["dataFn",1],["modalBrtField",16],["modalError",16],["modalOpened",16]]];
export const BruitIo = ["bruit-io","dzjylavh",1,[["_config",16],["bruitElement",64],["config",1],["data",1],["dataFn",1],["modalBrtField",16],["modalError",16],["modalOpened",16]]];
// bruit: Host Data, ES Module/es5 Target
export var BruitIo = ["bruit-io","58ps8erg",1,[["_config",16],["bruitElement",64],["config",1],["data",1],["dataFn",1],["modalBrtField",16],["modalError",16],["modalOpened",16]]];
export var BruitIo = ["bruit-io","dzjylavh",1,[["_config",16],["bruitElement",64],["config",1],["data",1],["dataFn",1],["modalBrtField",16],["modalError",16],["modalOpened",16]]];

@@ -5,2 +5,3 @@ import { BruitConfig } from './../models/bruit-config.class';

private static logArray;
static LOG_ENABLED: boolean;
static init(config: BruitConfig): void;

@@ -7,0 +8,0 @@ private static configure;

{
"name": "@bruit/component",
"version": "0.2.18",
"version": "0.2.19",
"description": "send your feedbacks with bruit.io",

@@ -47,5 +47,5 @@ "private": false,

"dependencies": {
"@bruit/types": "^0.1.22",
"@bruit/types": "^0.1.23",
"html2canvas": "^1.0.0-alpha.12"
}
}
<p align="center">
<h1 align="center">Bruit.io</h1>
<p align="center">BRuit is a User Issues Tool</p>
<h1 align="center">bruit.io</h1>
</p>

@@ -19,3 +18,3 @@ <p align="center">

</p>
<p align="center"> Bruit.io is a WebComponent built on Stencil.js</p>
<p align="center"> bruit.io is a Web Component built with Stencil.js</p>
<p align="center">

@@ -26,3 +25,3 @@ <a href="https://developer.mozilla.org/docs/Web/Web_Components"><img src="https://cdn.freebiesupply.com/logos/large/2x/web-components-logo-png-transparent.png" height="50px"/></a>

<p align="center">
Available on all frameworks that support WebComponents such as
Available on all frameworks that support Web Components such as
</p>

@@ -44,5 +43,5 @@ <p align="center">

Bruit.io is a tool to get your users feedbacks, designed to be as simple to use as possible, following the Web Component standards. Users' feedbacks are sent directly to your favorite project management tools 🎉 .
bruit.io is a tool to get your users feedbacks, designed to be as simple to use as possible, following the Web Components standards. Users' feedbacks are sent directly to your favorite project management tools 🎉 .
Bruit.io is built around an open source Web Component and a backend reciving the users feedback.
bruit.io is built around an open source Web Component and a backend reciving the users feedback.

@@ -67,4 +66,2 @@ And we do no data retention at all about those feedbacks 👏

&nbsp;&nbsp;&nbsp;&nbsp;**[BrtLogLevels](#BrtLogLevels)**<br>
&nbsp;&nbsp;&nbsp;&nbsp;**[BrtData](#BrtData)**<br>
&nbsp;&nbsp;&nbsp;&nbsp;**[BrtError](#BrtError)**<br>
**[Add data in feedbacks](#add-data-in-feedback)**<br>

@@ -76,5 +73,5 @@ **[Handle errors](#handle-errors)**<br>

# Install
# Installation
In command line
bruit.io can be installed either with a command line

@@ -85,3 +82,3 @@ ```bash

Or by directly modifying your index.html file
Or by directly modifying your `index.html` file

@@ -96,16 +93,18 @@ ```html

Simply add the following tag wherever you want in your project
Simply add this tag wherever you want in your project:
```html
<bruit-io> element to click </bruit-io>
<bruit-io>
... optional element to click ...
</bruit-io>
```
with properties :
These properties are available on the component:
- [_config_](#configuration) (required)
- [_config_](#configuration) (**required**)
- [_data_](#Add-data-in-feedback) (optional)
- [_dataFn_](#Add-data-in-feedback) (optional)
- [_onError_](#Handle-errors) (event) (optional)
- [_onError_](#Handle-errors) (optional)
**integration code examples :**
Integration code examples are available for these platforms:

@@ -157,3 +156,3 @@ <p align="center">

| ------------------ | ----------------------------- | ---------------------------------------------------------------------------- | -------- | ------------------------------- |
| **apiKey** | string | your personal api key [(create an api key)](https://bruit.io/) | **yes** | - |
| **apiKey** | string | your personal api key [(create an api key)](https://bruit.io/get-started) | **yes** | - |
| **form** | array<[BrtField](#brtfield)> | inputs list for the generated form | **yes** | - |

@@ -167,3 +166,3 @@ | labels | [BrtLabels](#brtlabels) | describes the labels of the modal (title / button / ...) | no | [see](#brtlabels) |

- Typescript import :
Typescript import :

@@ -202,3 +201,3 @@ ```javascript

- Typescript import:
Typescript import:

@@ -227,3 +226,3 @@ ```javascript

- Typescript import:
Typescript import:

@@ -236,3 +235,3 @@ ```javascript

🎨 If you feel like an artist, you may use BrtColors to change the theme of the modal.
If you feel like an artist 🎨 , you may use BrtColors to change the theme of the modal.

@@ -261,3 +260,3 @@ This gives the possiblity to change the header, body, background, errors and focus colors.

- Typescript import:
Typescript import:

@@ -272,3 +271,3 @@ ```javascript

To disable a type, just set with the related type to false in the logLevels section:
To disable a type, just set the related type to false in the logLevels section:

@@ -299,10 +298,10 @@ ```json

- special types:
bruit.io adds special types of logs:
- `network` type is for your fetch and xmlHttpRequest calls.
- `click` type is for mouse click event.
- `url` type log all url changing
- `url` type logs all url changing
- Typescript import:
Typescript import:

@@ -313,25 +312,22 @@ ```javascript

# Automatically add data in the feedback
# Add data to the feedback
It is possible to automatically had technical data in the feedback, for example the version number of your application, the identifier of the user sending the feedback, etc.
If you have data that can be retrieved synchronously, you can use `data`.
This is done by using either the `data` or `dataFn` property on the component.
For asynchronous data, you can use `dataFn`.
## data
`data` property is used for send synchronous data.
`data` property is used to send an array of objects to add to the feedback to the component.
Just give him an `BrtData` array.
The property takes a `BrtData` array as a value.
## dataFn
`dataFn` property is used for send asynchronous data.
`dataFn` property takes a function as a value. The function should return either an array of `BrtData` or a promise of an array of `BrtData`.
Give him an `Promise` of `BrtData` array. Your promise will be called upon to submit the feedback.
### _BrtData_
- Format :
Used to pass additional data to the feedback (ie the application version number)

@@ -347,4 +343,11 @@ ```ts

- import if using Typescript :
Attribute | Type | Description | Mandatory
----- | ----- | ----- | -----
**label** | string | a label for the data | **yes**
type | string | the type of the data | no
**value** | any | the value to send | **yes**
id | string | an identifier for the data | no
Typescript import:
```javascript

@@ -358,5 +361,5 @@ import { BrtData } from '@bruit/component';

`bruit-io` emit `onError` event when an error occured.
`bruit-io` emits `onError` events when an error occurs.
An error is composed by a `code` and a `text`. it is of type `BrtError`.
An error is of type `BrtError`, composed by a `code` and a `text`.

@@ -367,3 +370,3 @@ [more information about errors](https://github.com/Moventes/bruit.io/blob/master/DOC_ERRORS.md)

- Format :
Format of the errors which may be sent by the component.

@@ -377,3 +380,3 @@ ```ts

- import if using Typescript :
Typescript import:

@@ -388,3 +391,3 @@ ```javascript

Integrating `bruit-io` component to a project without a JavaScript framework is straight forward. If you're using a simple HTML page, you can add bruit component via a script tag.
Integrating `bruit-io` component to a project without a JavaScript framework is straight forward. If you're using a simple HTML page, you can add bruit.io component via a script tag.

@@ -395,3 +398,3 @@ ```html

<head>
<script src="https://unpkg.com/@bruit/component/dist/test-components.js"></script>
<script src="https://unpkg.com/@bruit/component/dist/bruit.js"></script>
</head>

@@ -415,3 +418,3 @@ <body>

Using `bruit-io` component within an Angular CLI project is a two-step process. We need to:
Using `bruit-io` component within an Angular project is a two-step process. You need to:

@@ -423,5 +426,5 @@ 1. Include the `CUSTOM_ELEMENTS_SCHEMA` in the modules that use the components

Including the `CUSTOM_ELEMENTS_SCHEMA` in the module allows the use of the web components in the HTML markup without the compiler producing errors. Here is an example of adding it to `AppModule`:
Including the `CUSTOM_ELEMENTS_SCHEMA` in the module allows the use of Web Components in the HTML files. Here is an example of adding it to `AppModule`:
```tsx
```ts
import { BrowserModule } from '@angular/platform-browser';

@@ -440,9 +443,9 @@ import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';

The `CUSTOM_ELEMENTS_SCHEMA` needs to be included in any module that uses custom elements.
The `CUSTOM_ELEMENTS_SCHEMA` needs to be included in any module that uses bruit.io.
### Calling defineCustomElements
Bruit component include a main function that is used to load the components in the collection. That function is called `defineCustomElements()` and it needs to be called once during the bootstrapping of your application. One convenient place to do this is in `main.ts` as such:
bruit.io component includes a function used to load itself in the application window object. That function is called `defineCustomElements()` and needs to be executed once during the bootstrapping of your application. One convenient place to add it is in the `main.ts` file as follows:
```tsx
```ts
import { enableProdMode } from '@angular/core';

@@ -466,3 +469,3 @@ import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

### Using bruit-io in your angular component
### Using bruit.io in an Angular component

@@ -488,3 +491,3 @@ ```html

bruitDataPromise():Promise<Array<BrtData>>{
bruitDataPromise(): Promise<Array<BrtData>>{
return this.api.getUser().then( user =>

@@ -513,3 +516,3 @@ [

With an application built using the `create-react-app` script the easiest way to include the `bruit-io` component is to call `defineCustomElements(window)` from the `index.js` file.
With an application built using React CLI (namely `create-react-app`), the easiest way is to include the `bruit-io` component by calling the `defineCustomElements(window)` method in the `index.js` file.

@@ -536,3 +539,3 @@ ```tsx

In order to use the `bruit-io` component within the Vue app, the application must be modified to define the custom elements and to inform the Vue compiler which elements to ignore during compilation. This can all be done within the `main.js` file. For example:
In order to use the `bruit-io` Web Component inside of a Vue application, it should be modified to define the custom elements and to inform the Vue compiler which elements to ignore during compilation. This can all be done within the `main.js` file as follows:

@@ -558,7 +561,7 @@ ```tsx

Contributing to Bruit.io may involve writing TypeScript, TSX, Stencil, SCSS or Markdown depending on the component you are working on. We are looking for help in any of these areas!
Contributing to bruit.io may involve writing TypeScript, TSX, Stencil, SCSS or Markdown depending on the component you are working on. We are looking for help in any of these areas!
# Having troubles ?
- [issues Github](https://github.com/Moventes/bruit.io/issues)
- [Github issues](https://github.com/Moventes/bruit.io/issues)
- [StackOverflow](https://stackoverflow.com/questions/tagged/bruit.io)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc