feedtack 0.0.2 → 0.0.3
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/dist/react/index.d.ts +8 -2
- package/dist/react/index.js +6 -6
- package/package.json +1 -1
package/dist/react/index.d.ts
CHANGED
|
@@ -14,6 +14,10 @@ interface FeedtackClasses {
|
|
|
14
14
|
/** Class added to each pin marker */
|
|
15
15
|
pinMarker?: string;
|
|
16
16
|
}
|
|
17
|
+
interface FeedtackSentimentLabels {
|
|
18
|
+
satisfied?: React.ReactNode;
|
|
19
|
+
dissatisfied?: React.ReactNode;
|
|
20
|
+
}
|
|
17
21
|
interface FeedtackProviderProps {
|
|
18
22
|
children: React.ReactNode;
|
|
19
23
|
adapter: FeedtackAdapter;
|
|
@@ -26,9 +30,11 @@ interface FeedtackProviderProps {
|
|
|
26
30
|
theme?: FeedtackTheme;
|
|
27
31
|
/** Additional class names for individual feedtack elements */
|
|
28
32
|
classes?: FeedtackClasses;
|
|
33
|
+
/** Custom labels/content for sentiment toggle buttons */
|
|
34
|
+
sentimentLabels?: FeedtackSentimentLabels;
|
|
29
35
|
onError?: (err: Error) => void;
|
|
30
36
|
}
|
|
31
|
-
declare function FeedtackProvider({ children, adapter, currentUser, hotkey, adminOnly, theme, classes, onError }: FeedtackProviderProps): react_jsx_runtime.JSX.Element;
|
|
37
|
+
declare function FeedtackProvider({ children, adapter, currentUser, hotkey, adminOnly, theme, classes, sentimentLabels, onError }: FeedtackProviderProps): react_jsx_runtime.JSX.Element;
|
|
32
38
|
|
|
33
39
|
interface FeedtackContextValue {
|
|
34
40
|
activatePinMode: () => void;
|
|
@@ -39,4 +45,4 @@ interface FeedtackContextValue {
|
|
|
39
45
|
/** Hook for host app to programmatically control feedtack */
|
|
40
46
|
declare function useFeedtack(): FeedtackContextValue;
|
|
41
47
|
|
|
42
|
-
export { type FeedtackClasses, FeedtackProvider, type FeedtackProviderProps, useFeedtack };
|
|
48
|
+
export { type FeedtackClasses, FeedtackProvider, type FeedtackProviderProps, type FeedtackSentimentLabels, useFeedtack };
|
package/dist/react/index.js
CHANGED
|
@@ -104,7 +104,7 @@ var FEEDTACK_STYLES = `
|
|
|
104
104
|
display: flex;
|
|
105
105
|
gap: 6px;
|
|
106
106
|
padding: 8px;
|
|
107
|
-
background: var(--ft-bg);
|
|
107
|
+
background: var(--ft-bg) !important;
|
|
108
108
|
border-radius: var(--ft-radius);
|
|
109
109
|
box-shadow: 0 2px 8px rgba(0,0,0,0.15);
|
|
110
110
|
position: fixed;
|
|
@@ -130,7 +130,7 @@ var FEEDTACK_STYLES = `
|
|
|
130
130
|
.feedtack-form {
|
|
131
131
|
position: absolute;
|
|
132
132
|
z-index: 2147483642;
|
|
133
|
-
background: var(--ft-bg);
|
|
133
|
+
background: var(--ft-bg) !important;
|
|
134
134
|
border-radius: calc(var(--ft-radius) + 2px);
|
|
135
135
|
box-shadow: 0 4px 20px rgba(0,0,0,0.18);
|
|
136
136
|
padding: 16px;
|
|
@@ -224,7 +224,7 @@ var FEEDTACK_STYLES = `
|
|
|
224
224
|
.feedtack-thread {
|
|
225
225
|
position: absolute;
|
|
226
226
|
z-index: 2147483642;
|
|
227
|
-
background: var(--ft-bg);
|
|
227
|
+
background: var(--ft-bg) !important;
|
|
228
228
|
border-radius: calc(var(--ft-radius) + 2px);
|
|
229
229
|
box-shadow: 0 4px 20px rgba(0,0,0,0.18);
|
|
230
230
|
padding: 16px;
|
|
@@ -281,7 +281,7 @@ function getAnchoredPosition(x, y) {
|
|
|
281
281
|
const bottom = clientY > vh - EDGE ? vh - clientY + FORM_HEIGHT : void 0;
|
|
282
282
|
return { left, right, top, bottom };
|
|
283
283
|
}
|
|
284
|
-
function FeedtackProvider({ children, adapter, currentUser, hotkey = "p", adminOnly = false, theme, classes = {}, onError }) {
|
|
284
|
+
function FeedtackProvider({ children, adapter, currentUser, hotkey = "p", adminOnly = false, theme, classes = {}, sentimentLabels = {}, onError }) {
|
|
285
285
|
const [isPinModeActive, setIsPinModeActive] = useState(false);
|
|
286
286
|
const [pendingPins, setPendingPins] = useState([]);
|
|
287
287
|
const [selectedColor, setSelectedColor] = useState(PIN_PALETTE[0]);
|
|
@@ -502,7 +502,7 @@ function FeedtackProvider({ children, adapter, currentUser, hotkey = "p", adminO
|
|
|
502
502
|
{
|
|
503
503
|
className: sentiment === "satisfied" ? "selected" : "",
|
|
504
504
|
onClick: () => setSentiment(sentiment === "satisfied" ? null : "satisfied"),
|
|
505
|
-
children: "\u{1F60A} Satisfied"
|
|
505
|
+
children: sentimentLabels.satisfied ?? "\u{1F60A} Satisfied"
|
|
506
506
|
}
|
|
507
507
|
),
|
|
508
508
|
/* @__PURE__ */ jsx(
|
|
@@ -510,7 +510,7 @@ function FeedtackProvider({ children, adapter, currentUser, hotkey = "p", adminO
|
|
|
510
510
|
{
|
|
511
511
|
className: sentiment === "dissatisfied" ? "selected" : "",
|
|
512
512
|
onClick: () => setSentiment(sentiment === "dissatisfied" ? null : "dissatisfied"),
|
|
513
|
-
children: "\u{1F61E} Dissatisfied"
|
|
513
|
+
children: sentimentLabels.dissatisfied ?? "\u{1F61E} Dissatisfied"
|
|
514
514
|
}
|
|
515
515
|
)
|
|
516
516
|
] }),
|