feedtack 0.5.0 → 0.5.1

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.
@@ -200,8 +200,8 @@ function getTargetMeta(element) {
200
200
  tagName: resolved.tagName,
201
201
  ancestors,
202
202
  boundingRect: {
203
- x: rect.x,
204
- y: rect.y,
203
+ x: rect.x + window.scrollX,
204
+ y: rect.y + window.scrollY,
205
205
  width: rect.width,
206
206
  height: rect.height
207
207
  }
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  getTargetMeta,
8
8
  getViewportMeta,
9
9
  themeToCSS
10
- } from "./chunk-NCW2V5JL.js";
10
+ } from "./chunk-PPM4AIJU.js";
11
11
 
12
12
  // src/adapters/ConsoleAdapter.ts
13
13
  var ConsoleAdapter = class {
@@ -2,6 +2,19 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React from 'react';
3
3
  import { e as FeedbackItem, F as FeedtackAdapter, o as FeedtackUser, n as FeedtackTheme } from '../theme-C-uctIoI.js';
4
4
 
5
+ /** Fixed palette of 6 colors for pin markers */
6
+ declare const PIN_PALETTE: readonly ["#ef4444", "#3b82f6", "#22c55e", "#f59e0b", "#a855f7", "#ec4899"];
7
+ type PinColor = (typeof PIN_PALETTE)[number];
8
+
9
+ interface FeedtackContextValue {
10
+ activatePinMode: () => void;
11
+ deactivatePinMode: () => void;
12
+ isPinModeActive: boolean;
13
+ selectedColor: string;
14
+ setSelectedColor: (color: string) => void;
15
+ pinPalette: readonly string[];
16
+ }
17
+
5
18
  interface FeedtackFlushEvent {
6
19
  pathname: string;
7
20
  items: FeedbackItem[];
@@ -40,13 +53,7 @@ interface FeedtackProviderProps {
40
53
  }
41
54
  declare function FeedtackProvider({ children, adapter, currentUser, hotkey, adminOnly, theme, classes, sentimentLabels, onError, disabled, renderPinIcon, onFlush, flushIdleMs, rescopeRoles, }: FeedtackProviderProps): react_jsx_runtime.JSX.Element;
42
55
 
43
- interface FeedtackContextValue {
44
- activatePinMode: () => void;
45
- deactivatePinMode: () => void;
46
- isPinModeActive: boolean;
47
- }
48
-
49
56
  /** Hook for host app to programmatically control feedtack */
50
57
  declare function useFeedtack(): FeedtackContextValue;
51
58
 
52
- export { type FeedtackClasses, type FeedtackFlushEvent, FeedtackProvider, type FeedtackProviderProps, type FeedtackSentimentLabels, useFeedtack };
59
+ export { type FeedtackClasses, type FeedtackContextValue, type FeedtackFlushEvent, FeedtackProvider, type FeedtackProviderProps, type FeedtackSentimentLabels, PIN_PALETTE, type PinColor, useFeedtack };
@@ -6,7 +6,7 @@ import {
6
6
  getTargetMeta,
7
7
  getViewportMeta,
8
8
  themeToCSS
9
- } from "../chunk-NCW2V5JL.js";
9
+ } from "../chunk-PPM4AIJU.js";
10
10
 
11
11
  // src/ui/colors.ts
12
12
  var PIN_PALETTE = [
@@ -1050,7 +1050,11 @@ function FeedtackProvider({
1050
1050
  } : state.activatePinMode,
1051
1051
  deactivatePinMode: disabled ? () => {
1052
1052
  } : state.deactivatePinMode,
1053
- isPinModeActive: disabled ? false : state.isPinModeActive
1053
+ isPinModeActive: disabled ? false : state.isPinModeActive,
1054
+ selectedColor: state.selectedColor,
1055
+ setSelectedColor: disabled ? () => {
1056
+ } : state.setSelectedColor,
1057
+ pinPalette: PIN_PALETTE
1054
1058
  },
1055
1059
  children: [
1056
1060
  children,
@@ -1187,5 +1191,6 @@ function useFeedtack() {
1187
1191
  }
1188
1192
  export {
1189
1193
  FeedtackProvider,
1194
+ PIN_PALETTE,
1190
1195
  useFeedtack
1191
1196
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "feedtack",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Click anywhere. Drop a pin. Get a payload a developer can act on.",
5
5
  "type": "module",
6
6
  "license": "MIT",