@reloop-sdk/vanilla 0.1.2
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/LICENSE +21 -0
- package/dist/index.cjs +97 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +13 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +69 -0
- package/dist/index.js.map +1 -0
- package/dist/reloop.global.global.js +6 -0
- package/dist/reloop.global.global.js.map +1 -0
- package/package.json +35 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Marty
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
createClient: () => import_core2.createClient,
|
|
24
|
+
mountWidget: () => mountWidget
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(src_exports);
|
|
27
|
+
|
|
28
|
+
// src/widget.ts
|
|
29
|
+
var import_core = require("@reloop-sdk/core");
|
|
30
|
+
var TYPES = ["bug", "idea", "praise"];
|
|
31
|
+
function mountWidget(config) {
|
|
32
|
+
const client = (0, import_core.createClient)({
|
|
33
|
+
apiKey: config.apiKey,
|
|
34
|
+
endpoint: config.endpoint
|
|
35
|
+
});
|
|
36
|
+
const root = document.createElement("div");
|
|
37
|
+
root.style.cssText = `position:fixed;bottom:20px;${config.position === "bottom-left" ? "left:20px" : "right:20px"};z-index:2147483000;font:14px system-ui,sans-serif`;
|
|
38
|
+
let open = false;
|
|
39
|
+
let type = "idea";
|
|
40
|
+
function render() {
|
|
41
|
+
root.innerHTML = "";
|
|
42
|
+
if (open) {
|
|
43
|
+
const panel = document.createElement("form");
|
|
44
|
+
panel.style.cssText = "width:300px;background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:16px;margin-bottom:12px;box-shadow:0 10px 30px rgba(0,0,0,.12)";
|
|
45
|
+
panel.innerHTML = `<strong style="display:block;margin-bottom:10px">${config.title ?? "Send feedback"}</strong>
|
|
46
|
+
<div data-tabs style="display:flex;gap:6px;margin-bottom:10px"></div>
|
|
47
|
+
<textarea name="message" rows="4" placeholder="Tell us what's on your mind\u2026"
|
|
48
|
+
style="width:100%;box-sizing:border-box;border-radius:8px;border:1px solid #e5e7eb;padding:8px;resize:vertical"></textarea>
|
|
49
|
+
<button type="submit" style="margin-top:10px;width:100%;padding:8px 0;border-radius:8px;border:none;background:#2563eb;color:#fff;cursor:pointer">Send</button>`;
|
|
50
|
+
const tabs = panel.querySelector("[data-tabs]");
|
|
51
|
+
for (const t of TYPES) {
|
|
52
|
+
const b = document.createElement("button");
|
|
53
|
+
b.type = "button";
|
|
54
|
+
b.textContent = t;
|
|
55
|
+
b.style.cssText = `flex:1;padding:6px 0;border-radius:8px;border:1px solid #e5e7eb;text-transform:capitalize;cursor:pointer;${type === t ? "background:#111827;color:#fff" : "background:#fff;color:#111827"}`;
|
|
56
|
+
b.onclick = () => {
|
|
57
|
+
type = t;
|
|
58
|
+
render();
|
|
59
|
+
};
|
|
60
|
+
tabs.appendChild(b);
|
|
61
|
+
}
|
|
62
|
+
panel.onsubmit = async (e) => {
|
|
63
|
+
e.preventDefault();
|
|
64
|
+
const ta = panel.querySelector("textarea");
|
|
65
|
+
if (!ta.value.trim()) return;
|
|
66
|
+
await client.submit({ type, message: ta.value });
|
|
67
|
+
panel.innerHTML = '<p>Thanks for the feedback! \u{1F64C}</p><button type="button" data-close>Close</button>';
|
|
68
|
+
panel.querySelector("[data-close]").onclick = () => {
|
|
69
|
+
open = false;
|
|
70
|
+
render();
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
root.appendChild(panel);
|
|
74
|
+
}
|
|
75
|
+
const launcher = document.createElement("button");
|
|
76
|
+
launcher.type = "button";
|
|
77
|
+
launcher.textContent = "\u{1F4AC} Feedback";
|
|
78
|
+
launcher.style.cssText = "padding:10px 16px;border-radius:999px;border:none;background:#111827;color:#fff;cursor:pointer;box-shadow:0 6px 20px rgba(0,0,0,.18)";
|
|
79
|
+
launcher.onclick = () => {
|
|
80
|
+
open = !open;
|
|
81
|
+
render();
|
|
82
|
+
};
|
|
83
|
+
root.appendChild(launcher);
|
|
84
|
+
}
|
|
85
|
+
render();
|
|
86
|
+
document.body.appendChild(root);
|
|
87
|
+
return client;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// src/index.ts
|
|
91
|
+
var import_core2 = require("@reloop-sdk/core");
|
|
92
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
93
|
+
0 && (module.exports = {
|
|
94
|
+
createClient,
|
|
95
|
+
mountWidget
|
|
96
|
+
});
|
|
97
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/widget.ts"],"sourcesContent":["export { mountWidget, type WidgetConfig } from \"./widget.js\";\nexport { createClient } from \"@reloop-sdk/core\";\nexport type {\n Feedback,\n FeedbackType,\n FeedbackUser,\n ReloopClient,\n ReloopOptions,\n} from \"@reloop-sdk/core\";\n","import { createClient, type FeedbackType, type ReloopClient } from \"@reloop-sdk/core\";\n\nexport interface WidgetConfig {\n apiKey: string;\n endpoint: string;\n title?: string;\n position?: \"bottom-right\" | \"bottom-left\";\n}\n\nconst TYPES: FeedbackType[] = [\"bug\", \"idea\", \"praise\"];\n\n/** Mounts the floating feedback widget and returns the underlying client. */\nexport function mountWidget(config: WidgetConfig): ReloopClient {\n const client = createClient({\n apiKey: config.apiKey,\n endpoint: config.endpoint,\n });\n\n const root = document.createElement(\"div\");\n root.style.cssText = `position:fixed;bottom:20px;${\n config.position === \"bottom-left\" ? \"left:20px\" : \"right:20px\"\n };z-index:2147483000;font:14px system-ui,sans-serif`;\n\n let open = false;\n let type: FeedbackType = \"idea\";\n\n function render() {\n root.innerHTML = \"\";\n if (open) {\n const panel = document.createElement(\"form\");\n panel.style.cssText =\n \"width:300px;background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:16px;margin-bottom:12px;box-shadow:0 10px 30px rgba(0,0,0,.12)\";\n panel.innerHTML = `<strong style=\"display:block;margin-bottom:10px\">${\n config.title ?? \"Send feedback\"\n }</strong>\n <div data-tabs style=\"display:flex;gap:6px;margin-bottom:10px\"></div>\n <textarea name=\"message\" rows=\"4\" placeholder=\"Tell us what's on your mind…\"\n style=\"width:100%;box-sizing:border-box;border-radius:8px;border:1px solid #e5e7eb;padding:8px;resize:vertical\"></textarea>\n <button type=\"submit\" style=\"margin-top:10px;width:100%;padding:8px 0;border-radius:8px;border:none;background:#2563eb;color:#fff;cursor:pointer\">Send</button>`;\n\n const tabs = panel.querySelector(\"[data-tabs]\") as HTMLElement;\n for (const t of TYPES) {\n const b = document.createElement(\"button\");\n b.type = \"button\";\n b.textContent = t;\n b.style.cssText = `flex:1;padding:6px 0;border-radius:8px;border:1px solid #e5e7eb;text-transform:capitalize;cursor:pointer;${\n type === t ? \"background:#111827;color:#fff\" : \"background:#fff;color:#111827\"\n }`;\n b.onclick = () => {\n type = t;\n render();\n };\n tabs.appendChild(b);\n }\n\n panel.onsubmit = async (e) => {\n e.preventDefault();\n const ta = panel.querySelector(\"textarea\") as HTMLTextAreaElement;\n if (!ta.value.trim()) return;\n await client.submit({ type, message: ta.value });\n panel.innerHTML =\n '<p>Thanks for the feedback! 🙌</p><button type=\"button\" data-close>Close</button>';\n (panel.querySelector(\"[data-close]\") as HTMLButtonElement).onclick = () => {\n open = false;\n render();\n };\n };\n root.appendChild(panel);\n }\n\n const launcher = document.createElement(\"button\");\n launcher.type = \"button\";\n launcher.textContent = \"💬 Feedback\";\n launcher.style.cssText =\n \"padding:10px 16px;border-radius:999px;border:none;background:#111827;color:#fff;cursor:pointer;box-shadow:0 6px 20px rgba(0,0,0,.18)\";\n launcher.onclick = () => {\n open = !open;\n render();\n };\n root.appendChild(launcher);\n }\n\n render();\n document.body.appendChild(root);\n return client;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,kBAAmE;AASnE,IAAM,QAAwB,CAAC,OAAO,QAAQ,QAAQ;AAG/C,SAAS,YAAY,QAAoC;AAC9D,QAAM,aAAS,0BAAa;AAAA,IAC1B,QAAQ,OAAO;AAAA,IACf,UAAU,OAAO;AAAA,EACnB,CAAC;AAED,QAAM,OAAO,SAAS,cAAc,KAAK;AACzC,OAAK,MAAM,UAAU,8BACnB,OAAO,aAAa,gBAAgB,cAAc,YACpD;AAEA,MAAI,OAAO;AACX,MAAI,OAAqB;AAEzB,WAAS,SAAS;AAChB,SAAK,YAAY;AACjB,QAAI,MAAM;AACR,YAAM,QAAQ,SAAS,cAAc,MAAM;AAC3C,YAAM,MAAM,UACV;AACF,YAAM,YAAY,oDAChB,OAAO,SAAS,eAClB;AAAA;AAAA;AAAA;AAAA;AAMA,YAAM,OAAO,MAAM,cAAc,aAAa;AAC9C,iBAAW,KAAK,OAAO;AACrB,cAAM,IAAI,SAAS,cAAc,QAAQ;AACzC,UAAE,OAAO;AACT,UAAE,cAAc;AAChB,UAAE,MAAM,UAAU,4GAChB,SAAS,IAAI,kCAAkC,+BACjD;AACA,UAAE,UAAU,MAAM;AAChB,iBAAO;AACP,iBAAO;AAAA,QACT;AACA,aAAK,YAAY,CAAC;AAAA,MACpB;AAEA,YAAM,WAAW,OAAO,MAAM;AAC5B,UAAE,eAAe;AACjB,cAAM,KAAK,MAAM,cAAc,UAAU;AACzC,YAAI,CAAC,GAAG,MAAM,KAAK,EAAG;AACtB,cAAM,OAAO,OAAO,EAAE,MAAM,SAAS,GAAG,MAAM,CAAC;AAC/C,cAAM,YACJ;AACF,QAAC,MAAM,cAAc,cAAc,EAAwB,UAAU,MAAM;AACzE,iBAAO;AACP,iBAAO;AAAA,QACT;AAAA,MACF;AACA,WAAK,YAAY,KAAK;AAAA,IACxB;AAEA,UAAM,WAAW,SAAS,cAAc,QAAQ;AAChD,aAAS,OAAO;AAChB,aAAS,cAAc;AACvB,aAAS,MAAM,UACb;AACF,aAAS,UAAU,MAAM;AACvB,aAAO,CAAC;AACR,aAAO;AAAA,IACT;AACA,SAAK,YAAY,QAAQ;AAAA,EAC3B;AAEA,SAAO;AACP,WAAS,KAAK,YAAY,IAAI;AAC9B,SAAO;AACT;;;ADpFA,IAAAA,eAA6B;","names":["import_core"]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReloopClient } from '@reloop-sdk/core';
|
|
2
|
+
export { Feedback, FeedbackType, FeedbackUser, ReloopClient, ReloopOptions, createClient } from '@reloop-sdk/core';
|
|
3
|
+
|
|
4
|
+
interface WidgetConfig {
|
|
5
|
+
apiKey: string;
|
|
6
|
+
endpoint: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
position?: "bottom-right" | "bottom-left";
|
|
9
|
+
}
|
|
10
|
+
/** Mounts the floating feedback widget and returns the underlying client. */
|
|
11
|
+
declare function mountWidget(config: WidgetConfig): ReloopClient;
|
|
12
|
+
|
|
13
|
+
export { type WidgetConfig, mountWidget };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReloopClient } from '@reloop-sdk/core';
|
|
2
|
+
export { Feedback, FeedbackType, FeedbackUser, ReloopClient, ReloopOptions, createClient } from '@reloop-sdk/core';
|
|
3
|
+
|
|
4
|
+
interface WidgetConfig {
|
|
5
|
+
apiKey: string;
|
|
6
|
+
endpoint: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
position?: "bottom-right" | "bottom-left";
|
|
9
|
+
}
|
|
10
|
+
/** Mounts the floating feedback widget and returns the underlying client. */
|
|
11
|
+
declare function mountWidget(config: WidgetConfig): ReloopClient;
|
|
12
|
+
|
|
13
|
+
export { type WidgetConfig, mountWidget };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// src/widget.ts
|
|
2
|
+
import { createClient } from "@reloop-sdk/core";
|
|
3
|
+
var TYPES = ["bug", "idea", "praise"];
|
|
4
|
+
function mountWidget(config) {
|
|
5
|
+
const client = createClient({
|
|
6
|
+
apiKey: config.apiKey,
|
|
7
|
+
endpoint: config.endpoint
|
|
8
|
+
});
|
|
9
|
+
const root = document.createElement("div");
|
|
10
|
+
root.style.cssText = `position:fixed;bottom:20px;${config.position === "bottom-left" ? "left:20px" : "right:20px"};z-index:2147483000;font:14px system-ui,sans-serif`;
|
|
11
|
+
let open = false;
|
|
12
|
+
let type = "idea";
|
|
13
|
+
function render() {
|
|
14
|
+
root.innerHTML = "";
|
|
15
|
+
if (open) {
|
|
16
|
+
const panel = document.createElement("form");
|
|
17
|
+
panel.style.cssText = "width:300px;background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:16px;margin-bottom:12px;box-shadow:0 10px 30px rgba(0,0,0,.12)";
|
|
18
|
+
panel.innerHTML = `<strong style="display:block;margin-bottom:10px">${config.title ?? "Send feedback"}</strong>
|
|
19
|
+
<div data-tabs style="display:flex;gap:6px;margin-bottom:10px"></div>
|
|
20
|
+
<textarea name="message" rows="4" placeholder="Tell us what's on your mind\u2026"
|
|
21
|
+
style="width:100%;box-sizing:border-box;border-radius:8px;border:1px solid #e5e7eb;padding:8px;resize:vertical"></textarea>
|
|
22
|
+
<button type="submit" style="margin-top:10px;width:100%;padding:8px 0;border-radius:8px;border:none;background:#2563eb;color:#fff;cursor:pointer">Send</button>`;
|
|
23
|
+
const tabs = panel.querySelector("[data-tabs]");
|
|
24
|
+
for (const t of TYPES) {
|
|
25
|
+
const b = document.createElement("button");
|
|
26
|
+
b.type = "button";
|
|
27
|
+
b.textContent = t;
|
|
28
|
+
b.style.cssText = `flex:1;padding:6px 0;border-radius:8px;border:1px solid #e5e7eb;text-transform:capitalize;cursor:pointer;${type === t ? "background:#111827;color:#fff" : "background:#fff;color:#111827"}`;
|
|
29
|
+
b.onclick = () => {
|
|
30
|
+
type = t;
|
|
31
|
+
render();
|
|
32
|
+
};
|
|
33
|
+
tabs.appendChild(b);
|
|
34
|
+
}
|
|
35
|
+
panel.onsubmit = async (e) => {
|
|
36
|
+
e.preventDefault();
|
|
37
|
+
const ta = panel.querySelector("textarea");
|
|
38
|
+
if (!ta.value.trim()) return;
|
|
39
|
+
await client.submit({ type, message: ta.value });
|
|
40
|
+
panel.innerHTML = '<p>Thanks for the feedback! \u{1F64C}</p><button type="button" data-close>Close</button>';
|
|
41
|
+
panel.querySelector("[data-close]").onclick = () => {
|
|
42
|
+
open = false;
|
|
43
|
+
render();
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
root.appendChild(panel);
|
|
47
|
+
}
|
|
48
|
+
const launcher = document.createElement("button");
|
|
49
|
+
launcher.type = "button";
|
|
50
|
+
launcher.textContent = "\u{1F4AC} Feedback";
|
|
51
|
+
launcher.style.cssText = "padding:10px 16px;border-radius:999px;border:none;background:#111827;color:#fff;cursor:pointer;box-shadow:0 6px 20px rgba(0,0,0,.18)";
|
|
52
|
+
launcher.onclick = () => {
|
|
53
|
+
open = !open;
|
|
54
|
+
render();
|
|
55
|
+
};
|
|
56
|
+
root.appendChild(launcher);
|
|
57
|
+
}
|
|
58
|
+
render();
|
|
59
|
+
document.body.appendChild(root);
|
|
60
|
+
return client;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// src/index.ts
|
|
64
|
+
import { createClient as createClient2 } from "@reloop-sdk/core";
|
|
65
|
+
export {
|
|
66
|
+
createClient2 as createClient,
|
|
67
|
+
mountWidget
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/widget.ts","../src/index.ts"],"sourcesContent":["import { createClient, type FeedbackType, type ReloopClient } from \"@reloop-sdk/core\";\n\nexport interface WidgetConfig {\n apiKey: string;\n endpoint: string;\n title?: string;\n position?: \"bottom-right\" | \"bottom-left\";\n}\n\nconst TYPES: FeedbackType[] = [\"bug\", \"idea\", \"praise\"];\n\n/** Mounts the floating feedback widget and returns the underlying client. */\nexport function mountWidget(config: WidgetConfig): ReloopClient {\n const client = createClient({\n apiKey: config.apiKey,\n endpoint: config.endpoint,\n });\n\n const root = document.createElement(\"div\");\n root.style.cssText = `position:fixed;bottom:20px;${\n config.position === \"bottom-left\" ? \"left:20px\" : \"right:20px\"\n };z-index:2147483000;font:14px system-ui,sans-serif`;\n\n let open = false;\n let type: FeedbackType = \"idea\";\n\n function render() {\n root.innerHTML = \"\";\n if (open) {\n const panel = document.createElement(\"form\");\n panel.style.cssText =\n \"width:300px;background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:16px;margin-bottom:12px;box-shadow:0 10px 30px rgba(0,0,0,.12)\";\n panel.innerHTML = `<strong style=\"display:block;margin-bottom:10px\">${\n config.title ?? \"Send feedback\"\n }</strong>\n <div data-tabs style=\"display:flex;gap:6px;margin-bottom:10px\"></div>\n <textarea name=\"message\" rows=\"4\" placeholder=\"Tell us what's on your mind…\"\n style=\"width:100%;box-sizing:border-box;border-radius:8px;border:1px solid #e5e7eb;padding:8px;resize:vertical\"></textarea>\n <button type=\"submit\" style=\"margin-top:10px;width:100%;padding:8px 0;border-radius:8px;border:none;background:#2563eb;color:#fff;cursor:pointer\">Send</button>`;\n\n const tabs = panel.querySelector(\"[data-tabs]\") as HTMLElement;\n for (const t of TYPES) {\n const b = document.createElement(\"button\");\n b.type = \"button\";\n b.textContent = t;\n b.style.cssText = `flex:1;padding:6px 0;border-radius:8px;border:1px solid #e5e7eb;text-transform:capitalize;cursor:pointer;${\n type === t ? \"background:#111827;color:#fff\" : \"background:#fff;color:#111827\"\n }`;\n b.onclick = () => {\n type = t;\n render();\n };\n tabs.appendChild(b);\n }\n\n panel.onsubmit = async (e) => {\n e.preventDefault();\n const ta = panel.querySelector(\"textarea\") as HTMLTextAreaElement;\n if (!ta.value.trim()) return;\n await client.submit({ type, message: ta.value });\n panel.innerHTML =\n '<p>Thanks for the feedback! 🙌</p><button type=\"button\" data-close>Close</button>';\n (panel.querySelector(\"[data-close]\") as HTMLButtonElement).onclick = () => {\n open = false;\n render();\n };\n };\n root.appendChild(panel);\n }\n\n const launcher = document.createElement(\"button\");\n launcher.type = \"button\";\n launcher.textContent = \"💬 Feedback\";\n launcher.style.cssText =\n \"padding:10px 16px;border-radius:999px;border:none;background:#111827;color:#fff;cursor:pointer;box-shadow:0 6px 20px rgba(0,0,0,.18)\";\n launcher.onclick = () => {\n open = !open;\n render();\n };\n root.appendChild(launcher);\n }\n\n render();\n document.body.appendChild(root);\n return client;\n}\n","export { mountWidget, type WidgetConfig } from \"./widget.js\";\nexport { createClient } from \"@reloop-sdk/core\";\nexport type {\n Feedback,\n FeedbackType,\n FeedbackUser,\n ReloopClient,\n ReloopOptions,\n} from \"@reloop-sdk/core\";\n"],"mappings":";AAAA,SAAS,oBAA0D;AASnE,IAAM,QAAwB,CAAC,OAAO,QAAQ,QAAQ;AAG/C,SAAS,YAAY,QAAoC;AAC9D,QAAM,SAAS,aAAa;AAAA,IAC1B,QAAQ,OAAO;AAAA,IACf,UAAU,OAAO;AAAA,EACnB,CAAC;AAED,QAAM,OAAO,SAAS,cAAc,KAAK;AACzC,OAAK,MAAM,UAAU,8BACnB,OAAO,aAAa,gBAAgB,cAAc,YACpD;AAEA,MAAI,OAAO;AACX,MAAI,OAAqB;AAEzB,WAAS,SAAS;AAChB,SAAK,YAAY;AACjB,QAAI,MAAM;AACR,YAAM,QAAQ,SAAS,cAAc,MAAM;AAC3C,YAAM,MAAM,UACV;AACF,YAAM,YAAY,oDAChB,OAAO,SAAS,eAClB;AAAA;AAAA;AAAA;AAAA;AAMA,YAAM,OAAO,MAAM,cAAc,aAAa;AAC9C,iBAAW,KAAK,OAAO;AACrB,cAAM,IAAI,SAAS,cAAc,QAAQ;AACzC,UAAE,OAAO;AACT,UAAE,cAAc;AAChB,UAAE,MAAM,UAAU,4GAChB,SAAS,IAAI,kCAAkC,+BACjD;AACA,UAAE,UAAU,MAAM;AAChB,iBAAO;AACP,iBAAO;AAAA,QACT;AACA,aAAK,YAAY,CAAC;AAAA,MACpB;AAEA,YAAM,WAAW,OAAO,MAAM;AAC5B,UAAE,eAAe;AACjB,cAAM,KAAK,MAAM,cAAc,UAAU;AACzC,YAAI,CAAC,GAAG,MAAM,KAAK,EAAG;AACtB,cAAM,OAAO,OAAO,EAAE,MAAM,SAAS,GAAG,MAAM,CAAC;AAC/C,cAAM,YACJ;AACF,QAAC,MAAM,cAAc,cAAc,EAAwB,UAAU,MAAM;AACzE,iBAAO;AACP,iBAAO;AAAA,QACT;AAAA,MACF;AACA,WAAK,YAAY,KAAK;AAAA,IACxB;AAEA,UAAM,WAAW,SAAS,cAAc,QAAQ;AAChD,aAAS,OAAO;AAChB,aAAS,cAAc;AACvB,aAAS,MAAM,UACb;AACF,aAAS,UAAU,MAAM;AACvB,aAAO,CAAC;AACR,aAAO;AAAA,IACT;AACA,SAAK,YAAY,QAAQ;AAAA,EAC3B;AAEA,SAAO;AACP,WAAS,KAAK,YAAY,IAAI;AAC9B,SAAO;AACT;;;ACpFA,SAAS,gBAAAA,qBAAoB;","names":["createClient"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";var Reloop=(()=>{var g=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var v=(e,t)=>{for(var o in t)g(e,o,{get:t[o],enumerable:!0})},C=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of T(t))!k.call(e,a)&&a!==o&&g(e,a,{get:()=>t[a],enumerable:!(r=w(t,a))||r.enumerable});return e};var S=e=>C(g({},"__esModule",{value:!0}),e);var M={};v(M,{mountWidget:()=>f});var m=typeof window<"u";function x(e){if(!e.apiKey)throw new Error("[reloop] apiKey is required");if(!e.endpoint)throw new Error("[reloop] endpoint is required");let t=e.flushInterval??3e3,o=e.batchSize??10,r=e.maxRetries??3,a=`${e.endpoint.replace(/\/+$/,"")}/api/ingest`,n=[],p=e.user,s;function b(){s||(s=setTimeout(()=>{s=void 0,i()},t))}async function c(d,l=0){try{let u=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.apiKey}`},body:JSON.stringify(d),keepalive:!0});if(!u.ok&&u.status>=500&&l<r)throw new Error(`server ${u.status}`)}catch(u){if(l<r){let y=2**l*500;return await new Promise(h=>setTimeout(h,y)),c(d,l+1)}typeof console<"u"&&console.warn("[reloop] dropped feedback batch:",u)}}async function i(){if(n.length===0)return;let d=n.slice(0,o);n=n.slice(o),await c({user:p,items:d}),n.length>0&&await i()}return m&&window.addEventListener("pagehide",()=>{if(n.length===0)return;let d={user:p,items:n};n=[];let l=JSON.stringify(d);navigator.sendBeacon&&navigator.sendBeacon(a,new Blob([l],{type:"application/json"}))}),{identify(d){p=d},async submit(d){n.push({...d,url:d.url??(m?window.location.href:void 0)}),n.length>=o?await i():b()},flush:i}}var E=["bug","idea","praise"];function f(e){let t=x({apiKey:e.apiKey,endpoint:e.endpoint}),o=document.createElement("div");o.style.cssText=`position:fixed;bottom:20px;${e.position==="bottom-left"?"left:20px":"right:20px"};z-index:2147483000;font:14px system-ui,sans-serif`;let r=!1,a="idea";function n(){if(o.innerHTML="",r){let s=document.createElement("form");s.style.cssText="width:300px;background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:16px;margin-bottom:12px;box-shadow:0 10px 30px rgba(0,0,0,.12)",s.innerHTML=`<strong style="display:block;margin-bottom:10px">${e.title??"Send feedback"}</strong>
|
|
2
|
+
<div data-tabs style="display:flex;gap:6px;margin-bottom:10px"></div>
|
|
3
|
+
<textarea name="message" rows="4" placeholder="Tell us what's on your mind\u2026"
|
|
4
|
+
style="width:100%;box-sizing:border-box;border-radius:8px;border:1px solid #e5e7eb;padding:8px;resize:vertical"></textarea>
|
|
5
|
+
<button type="submit" style="margin-top:10px;width:100%;padding:8px 0;border-radius:8px;border:none;background:#2563eb;color:#fff;cursor:pointer">Send</button>`;let b=s.querySelector("[data-tabs]");for(let c of E){let i=document.createElement("button");i.type="button",i.textContent=c,i.style.cssText=`flex:1;padding:6px 0;border-radius:8px;border:1px solid #e5e7eb;text-transform:capitalize;cursor:pointer;${a===c?"background:#111827;color:#fff":"background:#fff;color:#111827"}`,i.onclick=()=>{a=c,n()},b.appendChild(i)}s.onsubmit=async c=>{c.preventDefault();let i=s.querySelector("textarea");i.value.trim()&&(await t.submit({type:a,message:i.value}),s.innerHTML='<p>Thanks for the feedback! \u{1F64C}</p><button type="button" data-close>Close</button>',s.querySelector("[data-close]").onclick=()=>{r=!1,n()})},o.appendChild(s)}let p=document.createElement("button");p.type="button",p.textContent="\u{1F4AC} Feedback",p.style.cssText="padding:10px 16px;border-radius:999px;border:none;background:#111827;color:#fff;cursor:pointer;box-shadow:0 6px 20px rgba(0,0,0,.18)",p.onclick=()=>{r=!r,n()},o.appendChild(p)}return n(),document.body.appendChild(o),t}function L(){let e=document.currentScript??document.querySelector("script[data-reloop-key]");if(!e)return;let t=e.getAttribute("data-reloop-key"),o=e.getAttribute("data-reloop-endpoint");if(!t||!o)return;let r={apiKey:t,endpoint:o,title:e.getAttribute("data-reloop-title")??void 0,position:e.getAttribute("data-reloop-position")??"bottom-right"};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>f(r)):f(r)}L();return S(M);})();
|
|
6
|
+
//# sourceMappingURL=reloop.global.global.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/embed.ts","../../core/src/client.ts","../src/widget.ts"],"sourcesContent":["import { mountWidget, type WidgetConfig } from \"./widget.js\";\n\nexport { mountWidget };\n\n/**\n * Auto-init from the loading <script> tag:\n *\n * <script src=\"https://cdn/reloop.global.js\"\n * data-reloop-key=\"rl_pub_...\"\n * data-reloop-endpoint=\"https://feedback.example.com\"\n * data-reloop-position=\"bottom-right\"></script>\n */\nfunction autoInit() {\n const script =\n document.currentScript ??\n document.querySelector<HTMLScriptElement>(\"script[data-reloop-key]\");\n if (!script) return;\n\n const apiKey = script.getAttribute(\"data-reloop-key\");\n const endpoint = script.getAttribute(\"data-reloop-endpoint\");\n if (!apiKey || !endpoint) return;\n\n const config: WidgetConfig = {\n apiKey,\n endpoint,\n title: script.getAttribute(\"data-reloop-title\") ?? undefined,\n position:\n (script.getAttribute(\"data-reloop-position\") as WidgetConfig[\"position\"]) ??\n \"bottom-right\",\n };\n\n if (document.readyState === \"loading\") {\n document.addEventListener(\"DOMContentLoaded\", () => mountWidget(config));\n } else {\n mountWidget(config);\n }\n}\n\nautoInit();\n","import type {\n Feedback,\n FeedbackUser,\n IngestPayload,\n ReloopClient,\n ReloopOptions,\n} from \"./types.js\";\n\nconst isBrowser = typeof window !== \"undefined\";\n\nexport function createClient(options: ReloopOptions): ReloopClient {\n if (!options.apiKey) throw new Error(\"[reloop] apiKey is required\");\n if (!options.endpoint) throw new Error(\"[reloop] endpoint is required\");\n\n const flushInterval = options.flushInterval ?? 3000;\n const batchSize = options.batchSize ?? 10;\n const maxRetries = options.maxRetries ?? 3;\n const ingestUrl = `${options.endpoint.replace(/\\/+$/, \"\")}/api/ingest`;\n\n let queue: Feedback[] = [];\n let user: FeedbackUser | undefined = options.user;\n let timer: ReturnType<typeof setTimeout> | undefined;\n\n function scheduleFlush() {\n if (timer) return;\n timer = setTimeout(() => {\n timer = undefined;\n void flush();\n }, flushInterval);\n }\n\n async function send(payload: IngestPayload, attempt = 0): Promise<void> {\n try {\n const res = await fetch(ingestUrl, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: `Bearer ${options.apiKey}`,\n },\n body: JSON.stringify(payload),\n keepalive: true,\n });\n // 4xx (bad key / validation) is not retryable — drop it.\n if (!res.ok && res.status >= 500 && attempt < maxRetries) {\n throw new Error(`server ${res.status}`);\n }\n } catch (err) {\n if (attempt < maxRetries) {\n const backoff = 2 ** attempt * 500;\n await new Promise((r) => setTimeout(r, backoff));\n return send(payload, attempt + 1);\n }\n if (typeof console !== \"undefined\") {\n console.warn(\"[reloop] dropped feedback batch:\", err);\n }\n }\n }\n\n async function flush(): Promise<void> {\n if (queue.length === 0) return;\n const batch = queue.slice(0, batchSize);\n queue = queue.slice(batchSize);\n await send({ user, items: batch });\n if (queue.length > 0) await flush();\n }\n\n // Best-effort delivery when the page is closing.\n if (isBrowser) {\n window.addEventListener(\"pagehide\", () => {\n if (queue.length === 0) return;\n const payload: IngestPayload = { user, items: queue };\n queue = [];\n const body = JSON.stringify(payload);\n if (navigator.sendBeacon) {\n navigator.sendBeacon(\n ingestUrl,\n new Blob([body], { type: \"application/json\" }),\n );\n }\n });\n }\n\n return {\n identify(next: FeedbackUser) {\n user = next;\n },\n async submit(feedback: Feedback) {\n queue.push({\n ...feedback,\n url:\n feedback.url ??\n (isBrowser ? window.location.href : undefined),\n });\n if (queue.length >= batchSize) {\n await flush();\n } else {\n scheduleFlush();\n }\n },\n flush,\n };\n}\n","import { createClient, type FeedbackType, type ReloopClient } from \"@reloop-sdk/core\";\n\nexport interface WidgetConfig {\n apiKey: string;\n endpoint: string;\n title?: string;\n position?: \"bottom-right\" | \"bottom-left\";\n}\n\nconst TYPES: FeedbackType[] = [\"bug\", \"idea\", \"praise\"];\n\n/** Mounts the floating feedback widget and returns the underlying client. */\nexport function mountWidget(config: WidgetConfig): ReloopClient {\n const client = createClient({\n apiKey: config.apiKey,\n endpoint: config.endpoint,\n });\n\n const root = document.createElement(\"div\");\n root.style.cssText = `position:fixed;bottom:20px;${\n config.position === \"bottom-left\" ? \"left:20px\" : \"right:20px\"\n };z-index:2147483000;font:14px system-ui,sans-serif`;\n\n let open = false;\n let type: FeedbackType = \"idea\";\n\n function render() {\n root.innerHTML = \"\";\n if (open) {\n const panel = document.createElement(\"form\");\n panel.style.cssText =\n \"width:300px;background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:16px;margin-bottom:12px;box-shadow:0 10px 30px rgba(0,0,0,.12)\";\n panel.innerHTML = `<strong style=\"display:block;margin-bottom:10px\">${\n config.title ?? \"Send feedback\"\n }</strong>\n <div data-tabs style=\"display:flex;gap:6px;margin-bottom:10px\"></div>\n <textarea name=\"message\" rows=\"4\" placeholder=\"Tell us what's on your mind…\"\n style=\"width:100%;box-sizing:border-box;border-radius:8px;border:1px solid #e5e7eb;padding:8px;resize:vertical\"></textarea>\n <button type=\"submit\" style=\"margin-top:10px;width:100%;padding:8px 0;border-radius:8px;border:none;background:#2563eb;color:#fff;cursor:pointer\">Send</button>`;\n\n const tabs = panel.querySelector(\"[data-tabs]\") as HTMLElement;\n for (const t of TYPES) {\n const b = document.createElement(\"button\");\n b.type = \"button\";\n b.textContent = t;\n b.style.cssText = `flex:1;padding:6px 0;border-radius:8px;border:1px solid #e5e7eb;text-transform:capitalize;cursor:pointer;${\n type === t ? \"background:#111827;color:#fff\" : \"background:#fff;color:#111827\"\n }`;\n b.onclick = () => {\n type = t;\n render();\n };\n tabs.appendChild(b);\n }\n\n panel.onsubmit = async (e) => {\n e.preventDefault();\n const ta = panel.querySelector(\"textarea\") as HTMLTextAreaElement;\n if (!ta.value.trim()) return;\n await client.submit({ type, message: ta.value });\n panel.innerHTML =\n '<p>Thanks for the feedback! 🙌</p><button type=\"button\" data-close>Close</button>';\n (panel.querySelector(\"[data-close]\") as HTMLButtonElement).onclick = () => {\n open = false;\n render();\n };\n };\n root.appendChild(panel);\n }\n\n const launcher = document.createElement(\"button\");\n launcher.type = \"button\";\n launcher.textContent = \"💬 Feedback\";\n launcher.style.cssText =\n \"padding:10px 16px;border-radius:999px;border:none;background:#111827;color:#fff;cursor:pointer;box-shadow:0 6px 20px rgba(0,0,0,.18)\";\n launcher.onclick = () => {\n open = !open;\n render();\n };\n root.appendChild(launcher);\n }\n\n render();\n document.body.appendChild(root);\n return client;\n}\n"],"mappings":"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","names":["embed_exports","__export","mountWidget","isBrowser","createClient","options","flushInterval","batchSize","maxRetries","ingestUrl","queue","user","timer","scheduleFlush","flush","send","payload","attempt","res","err","backoff","r","batch","body","next","feedback","TYPES","mountWidget","config","client","createClient","root","open","type","render","panel","tabs","t","b","e","ta","launcher","autoInit","script","apiKey","endpoint","config","mountWidget"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@reloop-sdk/vanilla",
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "Standalone script-tag embeddable feedback widget",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"unpkg": "./dist/reloop.global.js",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"require": "./dist/index.cjs"
|
|
15
|
+
},
|
|
16
|
+
"./embed": "./dist/reloop.global.js"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist"
|
|
20
|
+
],
|
|
21
|
+
"sideEffects": true,
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@reloop-sdk/core": "0.1.2"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"tsup": "^8.3.5",
|
|
27
|
+
"typescript": "^5.7.2"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "tsup",
|
|
31
|
+
"dev": "tsup --watch",
|
|
32
|
+
"typecheck": "tsc --noEmit",
|
|
33
|
+
"clean": "rm -rf dist .turbo"
|
|
34
|
+
}
|
|
35
|
+
}
|