Huge News!Announcing our $40M Series B led by Abstract Ventures.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.7.2 to 0.7.3

23

dist/collection/api/feedback.js

@@ -0,4 +1,5 @@

import { BrtFieldType } from '@bruit/types/dist/enums/brt-field-type';
import { NavigatorTool } from '../bruit-tools/navigator';
import { ScreenTool } from '../bruit-tools/screen';
import { Api } from './api';
import { ScreenTool } from '../bruit-tools/screen';
import { NavigatorTool } from '../bruit-tools/navigator';
export class Feedback {

@@ -32,12 +33,9 @@ constructor(apiKey) {

}
async send(formData, data = [], dataFn) {
async send(formFields, data = [], dataFn) {
try {
const agreementField = formData.find(field => field.id === 'agreement');
const agreementField = formFields.find(field => field.id === 'agreement');
const agreement = agreementField ? agreementField.value : true;
const dataFromFn = await this.getDataFromFn(dataFn);
this.data = [
...formData.map(ff => ({ type: ff.type, value: ff.value, label: ff.label, id: ff.id })),
...data,
...dataFromFn
];
const formData = formFields.map(field => this.fieldToData(field));
this.data = [...formData, ...data, ...dataFromFn];
return Api.postFeedback({

@@ -72,2 +70,9 @@ apiKey: this.apiKey,

}
fieldToData(field) {
const data = { type: field.type, value: field.value, label: field.label, id: field.id };
if (data.type === BrtFieldType.RATING) {
data.max = field.max || 5;
}
return data;
}
}

@@ -1,2 +0,2 @@

import { BrtFeedback, BrtCookies, BrtNavigatorInfo, BrtScreenInfo, BrtLog, BrtData, BrtField, BrtServiceWorker } from '@bruit/types';
import { BrtCookies, BrtData, BrtFeedback, BrtField, BrtLog, BrtNavigatorInfo, BrtScreenInfo, BrtServiceWorker } from '@bruit/types';
export declare class Feedback implements BrtFeedback {

@@ -16,7 +16,7 @@ apiKey: string;

*
* @param formData
* @param formFields
* @param data
* @param dataFn
*/
send(formData: Array<BrtField>, data?: Array<BrtData>, dataFn?: () => Array<BrtData> | Promise<Array<BrtData>>): Promise<any>;
send(formFields: Array<BrtField>, data?: Array<BrtData>, dataFn?: () => Array<BrtData> | Promise<Array<BrtData>>): Promise<any>;
/**

@@ -29,2 +29,9 @@ *

private getDataFromFn;
/**
*
* @param field : BrtField from form
*
* @return a BrtData
*/
private fieldToData;
}
{
"name": "@bruit/component",
"version": "0.7.2",
"version": "0.7.3",
"description": "send your feedbacks with bruit.io",

@@ -30,3 +30,4 @@ "keywords": [

"test.watch": "stencil test --spec --e2e --watchAll",
"docs": "stencil build --docs"
"docs": "stencil build --docs",
"prepublishOnly": "npm i && npm run build && node script/git-tag"
},

@@ -33,0 +34,0 @@ "devDependencies": {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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