@siteping/widget 0.8.1 → 0.9.0

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 NeosiaNexus
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/README.md ADDED
@@ -0,0 +1,82 @@
1
+ [![npm version](https://img.shields.io/npm/v/@siteping/widget)](https://www.npmjs.com/package/@siteping/widget)
2
+ [![TypeScript](https://img.shields.io/badge/TypeScript-strict-blue)](https://www.typescriptlang.org/)
3
+
4
+ # @siteping/widget
5
+
6
+ **Client feedback, pinned to the pixel.**
7
+
8
+ A lightweight feedback widget that lets your clients annotate websites during development. Draw rectangles, leave comments, track bugs — directly on the live site.
9
+
10
+ Part of the [@siteping](https://github.com/NeosiaNexus/siteping) monorepo.
11
+
12
+ ## Install
13
+
14
+ ```bash
15
+ npm install @siteping/widget
16
+ ```
17
+
18
+ ## Quick Start
19
+
20
+ ```tsx
21
+ // app/layout.tsx (or any client component)
22
+ 'use client'
23
+
24
+ import { initSiteping } from '@siteping/widget'
25
+ import { useEffect } from 'react'
26
+
27
+ export default function Layout({ children }: { children: React.ReactNode }) {
28
+ useEffect(() => {
29
+ const { destroy } = initSiteping({
30
+ endpoint: '/api/siteping',
31
+ projectName: 'my-project',
32
+ })
33
+ return destroy
34
+ }, [])
35
+
36
+ return <html><body>{children}</body></html>
37
+ }
38
+ ```
39
+
40
+ You also need a server-side adapter — see [`@siteping/adapter-prisma`](https://www.npmjs.com/package/@siteping/adapter-prisma).
41
+
42
+ ## Configuration
43
+
44
+ ```ts
45
+ initSiteping({
46
+ // Required
47
+ endpoint: '/api/siteping',
48
+ projectName: 'my-project',
49
+
50
+ // Optional
51
+ position: 'bottom-right', // 'bottom-right' | 'bottom-left'
52
+ forceShow: false, // Show in production? Default: false
53
+
54
+ // Events
55
+ onOpen: () => {},
56
+ onClose: () => {},
57
+ onFeedbackSent: (feedback) => {},
58
+ onError: (error) => {},
59
+ onAnnotationStart: () => {},
60
+ onAnnotationEnd: () => {},
61
+ })
62
+ ```
63
+
64
+ ## Features
65
+
66
+ - Rectangle annotations with category + message
67
+ - DOM-anchored persistence (CSS selector + XPath + text snippet)
68
+ - Shadow DOM isolation (closed mode)
69
+ - Feedback panel with search, filters, resolve/unresolve
70
+ - Retry with backoff (queued in localStorage)
71
+ - Dev-only by default (auto-hides in production)
72
+
73
+ ## Related Packages
74
+
75
+ | Package | Description |
76
+ |---------|-------------|
77
+ | [`@siteping/adapter-prisma`](https://www.npmjs.com/package/@siteping/adapter-prisma) | Server-side Prisma adapter |
78
+ | [`@siteping/cli`](https://www.npmjs.com/package/@siteping/cli) | CLI for project setup |
79
+
80
+ ## License
81
+
82
+ [MIT](https://github.com/NeosiaNexus/siteping/blob/main/LICENSE)
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { SitepingConfig, SitepingInstance } from '@siteping/core';
2
- export { AnchorData, AnnotationPayload, AnnotationResponse, FeedbackPayload, FeedbackResponse, FeedbackStatus, FeedbackType, RectData, SitepingConfig, SitepingInstance } from '@siteping/core';
2
+ export { AnchorData, AnnotationPayload, AnnotationResponse, FeedbackPayload, FeedbackResponse, FeedbackStatus, FeedbackType, RectData, SitepingConfig, SitepingInstance, SitepingPublicEvents } from '@siteping/core';
3
3
 
4
4
  /**
5
5
  * Initialize the Siteping feedback widget.