feedback-vos 1.0.34 → 1.0.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +113 -14
- package/dist/index.js +46 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +46 -18
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +3 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1406,7 +1406,7 @@ function getDefaultLanguage() {
|
|
|
1406
1406
|
}
|
|
1407
1407
|
function isWidgetEnabled() {
|
|
1408
1408
|
if (typeof process !== "undefined" && process.env.NEXT_PUBLIC_FEEDBACK_ENABLED !== void 0) {
|
|
1409
|
-
const enabled = process.env.NEXT_PUBLIC_FEEDBACK_ENABLED.toLowerCase();
|
|
1409
|
+
const enabled = String(process.env.NEXT_PUBLIC_FEEDBACK_ENABLED).toLowerCase().trim();
|
|
1410
1410
|
return enabled !== "false" && enabled !== "0";
|
|
1411
1411
|
}
|
|
1412
1412
|
return true;
|
|
@@ -1434,24 +1434,52 @@ function Widget({
|
|
|
1434
1434
|
const isLeft = position.includes("left");
|
|
1435
1435
|
const panelPositionClass = isTop ? "absolute top-full mt-2" : "absolute bottom-full mb-2";
|
|
1436
1436
|
const panelAlignmentClass = isLeft ? "left-0" : "right-0";
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1437
|
+
const getPositionStyles = () => {
|
|
1438
|
+
const baseStyles = {
|
|
1439
|
+
position: "fixed",
|
|
1440
|
+
zIndex: 9999
|
|
1441
|
+
};
|
|
1442
|
+
if (position === "bottom-right") {
|
|
1443
|
+
baseStyles.bottom = "1rem";
|
|
1444
|
+
baseStyles.right = "1rem";
|
|
1445
|
+
} else if (position === "bottom-left") {
|
|
1446
|
+
baseStyles.bottom = "1rem";
|
|
1447
|
+
baseStyles.left = "1rem";
|
|
1448
|
+
} else if (position === "top-right") {
|
|
1449
|
+
baseStyles.top = "1rem";
|
|
1450
|
+
baseStyles.right = "1rem";
|
|
1451
|
+
} else if (position === "top-left") {
|
|
1452
|
+
baseStyles.top = "1rem";
|
|
1453
|
+
baseStyles.left = "1rem";
|
|
1454
|
+
}
|
|
1455
|
+
return baseStyles;
|
|
1456
|
+
};
|
|
1457
|
+
return /* @__PURE__ */ jsx(
|
|
1458
|
+
"div",
|
|
1459
|
+
{
|
|
1460
|
+
"data-feedback-widget": "true",
|
|
1461
|
+
className: `fixed ${positionClasses[position]} z-50`,
|
|
1462
|
+
style: getPositionStyles(),
|
|
1463
|
+
children: /* @__PURE__ */ jsxs(Popover, { className: "relative", children: [
|
|
1464
|
+
/* @__PURE__ */ jsx(Popover.Panel, { className: `${panelPositionClass} ${panelAlignmentClass}`, children: /* @__PURE__ */ jsx(
|
|
1465
|
+
WidgetForm,
|
|
1466
|
+
{
|
|
1467
|
+
integration,
|
|
1468
|
+
githubConfig,
|
|
1469
|
+
language: finalLanguage,
|
|
1470
|
+
theme: finalTheme
|
|
1471
|
+
}
|
|
1472
|
+
) }),
|
|
1473
|
+
/* @__PURE__ */ jsxs(Popover.Button, { className: "bg-brand-500 rounded-full px-3 md:px-3 h-12 text-white flex items-center group focus:outline-none shadow-lg hover:shadow-xl transition-shadow", children: [
|
|
1474
|
+
/* @__PURE__ */ jsx(ChatTeardropDots, { className: "w-6 h-6 flex-shrink-0" }),
|
|
1475
|
+
/* @__PURE__ */ jsxs("span", { className: "max-w-0 overflow-hidden group-hover:max-w-xs md:group-hover:max-w-xs transition-all duration-500 ease-linear hidden md:block", children: [
|
|
1476
|
+
/* @__PURE__ */ jsx("span", { className: "pl-2" }),
|
|
1477
|
+
t.widget.button
|
|
1478
|
+
] })
|
|
1479
|
+
] })
|
|
1452
1480
|
] })
|
|
1453
|
-
|
|
1454
|
-
|
|
1481
|
+
}
|
|
1482
|
+
);
|
|
1455
1483
|
}
|
|
1456
1484
|
|
|
1457
1485
|
export { Widget };
|