update feedback widget package information

This commit is contained in:
Matthias Nannt
2023-02-13 09:58:01 +01:00
parent fb82e92471
commit 113a573573
4 changed files with 24 additions and 4 deletions

View File

@@ -1,18 +1,19 @@
{
"name": "@formbricks/feedback",
"version": "0.2.1",
"version": "0.3.0",
"source": "src/index.ts",
"main": "./dist/index.js",
"main": "./dist/index.cjs",
"types": "./dist/index.d.ts",
"jsdelivr": "./dist/index.umd.js",
"unpkg": "./dist/index.umd.js",
"type": "module",
"license": "Apache-2.0",
"exports": {
"types": "./dist/src/index.d.ts",
"require": "./dist/index.cjs",
"default": "./dist/index.modern.js"
},
"module": "./dist/index.module.js",
"module": "./dist/index.js",
"scripts": {
"build": "node ./html-to-ts && microbundle --define process.env.NODE_ENV=production",
"dev": "node ./html-to-ts && microbundle watch --define process.env.NODE_ENV=production",

View File

@@ -52,15 +52,19 @@ const trap = createFocusTrap(containerElement, {
function applyConfig() {
if (config.contact) {
//@ts-ignore
const contactNameElements = document.getElementsByClassName("formbricks__contact-name");
//@ts-ignore
for (const elem of contactNameElements) {
elem.innerHTML = config.contact.name;
}
const contactPositionElements = document.getElementsByClassName("formbricks__contact-position");
//@ts-ignore
for (const elem of contactPositionElements) {
elem.innerHTML = config.contact.position;
}
const contactImageElements = document.getElementsByClassName("formbricks__contact-image");
//@ts-ignore
for (const elem of contactImageElements) {
(<HTMLImageElement>elem).src = config.contact.imgUrl;
}
@@ -225,6 +229,7 @@ function changeType(e: Event) {
if (typeSwitchElem !== null && typeElem !== null) {
// replace children with feedback type elements (icon & text)
typeSwitchElem.innerHTML = "";
//@ts-ignore
typeSwitchElem.replaceChildren(...typeElem.cloneNode(true).childNodes);
// add chevron
const chevronElem = document.createElement("div");

View File

@@ -1,4 +1,4 @@
{
"extends": "@formbricks/tsconfig/base.json",
"extends": "@formbricks/tsconfig/js-library.json",
"include": ["src", "types"]
}

View File

@@ -0,0 +1,14 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Node 16",
"extends": "./base.json",
"compilerOptions": {
"lib": ["ESNext", "DOM"],
"module": "esnext",
"target": "ES2021",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
}
}