@siteping/widget 0.10.0 → 0.10.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/README.md +55 -2
- package/dist/{chunk-BC2J5J47.js → chunk-33HB3HZI.js} +3 -3
- package/dist/chunk-33HB3HZI.js.map +1 -0
- package/dist/de-MAGIJBFC.js +2 -0
- package/dist/de-MAGIJBFC.js.map +1 -0
- package/dist/es-HEVFJPRI.js +2 -0
- package/dist/es-HEVFJPRI.js.map +1 -0
- package/dist/fr-OM2PHLDH.js +2 -0
- package/dist/fr-OM2PHLDH.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.global.js +108 -97
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +73 -62
- package/dist/index.js.map +1 -1
- package/dist/it-OQVYHKKV.js +2 -0
- package/dist/it-OQVYHKKV.js.map +1 -0
- package/dist/{panel-YIFL7JMG.js → panel-BSNEQHAQ.js} +2 -2
- package/dist/{panel-YIFL7JMG.js.map → panel-BSNEQHAQ.js.map} +1 -1
- package/dist/pt-VUUNL42H.js +2 -0
- package/dist/pt-VUUNL42H.js.map +1 -0
- package/dist/react.js +73 -62
- package/dist/react.js.map +1 -1
- package/dist/ru-NDWY7Y36.js +2 -0
- package/dist/ru-NDWY7Y36.js.map +1 -0
- package/dist/siteping-core.d.ts +1 -1
- package/dist/types.d.ts +61 -3
- package/package.json +2 -2
- package/dist/chunk-BC2J5J47.js.map +0 -1
- package/dist/de-QELS3SWK.js +0 -2
- package/dist/de-QELS3SWK.js.map +0 -1
- package/dist/es-CYTPFERY.js +0 -2
- package/dist/es-CYTPFERY.js.map +0 -1
- package/dist/fr-4XLS426K.js +0 -2
- package/dist/fr-4XLS426K.js.map +0 -1
- package/dist/it-ZYXUTNWT.js +0 -2
- package/dist/it-ZYXUTNWT.js.map +0 -1
- package/dist/pt-W7J2A2O3.js +0 -2
- package/dist/pt-W7J2A2O3.js.map +0 -1
- package/dist/ru-AE6EJFY7.js +0 -2
- package/dist/ru-AE6EJFY7.js.map +0 -1
package/README.md
CHANGED
|
@@ -68,17 +68,20 @@ All configuration options for `initSiteping()`:
|
|
|
68
68
|
|--------|------|---------|-------------|
|
|
69
69
|
| `endpoint` | `string` | — | Your API route (e.g. `/api/siteping`). Required unless `store` is provided |
|
|
70
70
|
| `store` | `SitepingStore` | — | Direct store for client-side mode. When set, bypasses HTTP |
|
|
71
|
+
| `apiKey` | `string` | — | Sent as `Authorization: Bearer <apiKey>` on every HTTP request. **Visible to every visitor** — see [Authentication](#authentication) before using it on a public site. Ignored in store mode |
|
|
72
|
+
| `headers` | `Record<string, string>` or `() => headers` (sync or async) | — | Extra HTTP request headers, static or computed per request (e.g. a short-lived session token). An explicit `Authorization` entry overrides `apiKey`. Ignored in store mode |
|
|
71
73
|
| `projectName` | `string` | — | **Required.** Scopes feedbacks to this project |
|
|
72
74
|
| `position` | `'bottom-right' \| 'bottom-left'` | `'bottom-right'` | Widget FAB position |
|
|
73
75
|
| `accentColor` | `string` | `'#0066ff'` | Widget accent color — hex color (`#RGB`, `#RRGGBB`, `#RRGGBBAA`) |
|
|
74
76
|
| `theme` | `'light' \| 'dark' \| 'auto'` | `'light'` | Widget color theme |
|
|
75
77
|
| `locale` | `'en' \| 'fr' \| 'de' \| 'es' \| 'it' \| 'pt' \| 'ru'` | `'en'` | Widget UI language. Unknown locales fall back to English |
|
|
76
|
-
| `forceShow` | `boolean` | `false` | Render the widget even when it would normally be skipped — bypasses **both** the production guard and the mobile-viewport guard |
|
|
78
|
+
| `forceShow` | `boolean` | `false` | Render the widget even when it would normally be skipped — bypasses **both** the production guard and the mobile-viewport guard. Does **not** bypass the SSR guard (the widget never renders without a DOM) |
|
|
77
79
|
| `minViewportWidth` | `number` | `768` | Minimum viewport width (px) for the widget to render; below it `onSkip('mobile')` fires. Set `0` to allow mobile viewports |
|
|
78
80
|
| `debug` | `boolean` | `false` | Enable debug logging to console |
|
|
79
81
|
| `identity` | `{ name: string; email: string }` | — | Pre-fill author identity from the host (SSO). When set, the widget skips the identity modal |
|
|
80
82
|
| `deepLink` | `boolean \| { param?: string }` | `false` | On initial load, focus the annotation referenced by `?siteping=<id>` (or a custom query key). SPA navigations are ignored — use `focusFeedback()` for route-change focus |
|
|
81
83
|
| `watchNavigation` | `boolean` | `true` | Auto re-fetch feedbacks on client-side (SPA) navigation. The widget patches the History API + listens for `popstate`/`hashchange`, so the panel list and markers follow route changes even when the widget is mounted once in a persistent layout (e.g. Next.js App Router). Re-fetches data only — it never re-scrolls. Set `false` to opt out and drive updates via `refresh()` |
|
|
84
|
+
| `enableRightClickComment` | `boolean` | `false` | Right-click anywhere on the page to instantly open the comment composer at the cursor. Modifier-key right-clicks (Shift/Ctrl/Alt/Meta) fall through to the native context menu. Right-clicks on SitePing's own UI are ignored. Note: on Android, `contextmenu` fires on long-press — relevant for ≥768 px tablets where the widget loads |
|
|
82
85
|
|
|
83
86
|
> **Custom translations** — Use `registerLocale(code, translations)` to add your own locale at runtime.
|
|
84
87
|
|
|
@@ -92,7 +95,7 @@ All configuration options for `initSiteping()`:
|
|
|
92
95
|
| `onError` | `(error) => void` | Called on API or internal errors |
|
|
93
96
|
| `onAnnotationStart` | `() => void` | Called when annotation drawing starts |
|
|
94
97
|
| `onAnnotationEnd` | `() => void` | Called when annotation drawing ends |
|
|
95
|
-
| `onSkip` | `(reason) => void` | Called when widget is skipped (production/mobile) |
|
|
98
|
+
| `onSkip` | `(reason) => void` | Called when widget is skipped (production/mobile/ssr) |
|
|
96
99
|
|
|
97
100
|
```ts
|
|
98
101
|
initSiteping({
|
|
@@ -114,6 +117,56 @@ initSiteping({
|
|
|
114
117
|
})
|
|
115
118
|
```
|
|
116
119
|
|
|
120
|
+
### Authentication
|
|
121
|
+
|
|
122
|
+
With the default [`@siteping/adapter-prisma`](https://www.npmjs.com/package/@siteping/adapter-prisma) handlers and an `apiKey` configured server-side, **POST** and **OPTIONS** stay public — anonymous visitors can keep submitting feedback with zero widget config — while **GET**, **PATCH**, and **DELETE** require `Authorization: Bearer <apiKey>`. Without auth, the widget can submit but cannot list markers, resolve, or delete. See the [adapter-prisma Authentication docs](https://www.npmjs.com/package/@siteping/adapter-prisma#authentication) for the server-side setup.
|
|
123
|
+
|
|
124
|
+
For **internal tools already behind your own login**, a static key is fine:
|
|
125
|
+
|
|
126
|
+
```ts
|
|
127
|
+
initSiteping({
|
|
128
|
+
endpoint: '/api/siteping',
|
|
129
|
+
projectName: 'my-project',
|
|
130
|
+
apiKey: process.env.NEXT_PUBLIC_SITEPING_KEY, // shipped to the browser!
|
|
131
|
+
})
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
> **⚠️ The widget runs in every visitor's browser.** Anything you put in `apiKey` (or static `headers`) is readable in your page source and grants GET/PATCH/DELETE on your feedback API. Never ship a static key on a public site.
|
|
135
|
+
|
|
136
|
+
For **public sites**, use the `headers` callback to send a short-lived token minted by your backend for the signed-in reviewer. It runs once per request (sync or async), and an explicit `Authorization` entry overrides `apiKey`:
|
|
137
|
+
|
|
138
|
+
```ts
|
|
139
|
+
initSiteping({
|
|
140
|
+
endpoint: '/api/siteping',
|
|
141
|
+
projectName: 'my-project',
|
|
142
|
+
headers: async () => {
|
|
143
|
+
const { token } = await fetch('/api/siteping-token').then((r) => r.json())
|
|
144
|
+
return { Authorization: `Bearer ${token}` }
|
|
145
|
+
},
|
|
146
|
+
})
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Queued offline feedbacks never store headers — auth is re-computed when the queue is flushed on the next page load.
|
|
150
|
+
|
|
151
|
+
Two constraints to know:
|
|
152
|
+
|
|
153
|
+
- **Values are read at init.** Changing `apiKey` or swapping the `headers` value after `initSiteping()` has run has no effect until you destroy and re-init. The `headers` **callback** is the escape hatch: it's invoked on every request, so read rotating tokens from a ref or module variable inside it rather than closing over React state.
|
|
154
|
+
- **Cross-origin:** adapter-prisma's CORS preflight allows the `Content-Type` and `Authorization` headers only. Put credentials in `Authorization` (not a custom header name), or keep the endpoint same-origin.
|
|
155
|
+
|
|
156
|
+
### How production detection works
|
|
157
|
+
|
|
158
|
+
The widget skips rendering when `NODE_ENV` is `production`. The shipped bundle
|
|
159
|
+
keeps the literal `process.env.NODE_ENV` expression, so:
|
|
160
|
+
|
|
161
|
+
- **Bundled apps** (Next.js, Vite, webpack…): your bundler inlines its
|
|
162
|
+
environment at build time — the widget auto-hides in production builds and
|
|
163
|
+
shows in dev builds.
|
|
164
|
+
- **Node/SSR and test runners**: the real `process.env.NODE_ENV` is read at
|
|
165
|
+
runtime (server-side, the widget always skips with `onSkip('ssr')`).
|
|
166
|
+
- **Plain `<script>` tags** with no bundler and no `process` global: there is
|
|
167
|
+
no environment signal, so the widget renders — gate the `<script>` tag
|
|
168
|
+
yourself, or use `onSkip`/`forceShow` to control visibility explicitly.
|
|
169
|
+
|
|
117
170
|
## Return value API
|
|
118
171
|
|
|
119
172
|
`initSiteping()` returns a `SitepingInstance` with the following methods:
|
|
@@ -35,7 +35,7 @@ function c(t){let n=document.createRange().createContextualFragment(t).firstElem
|
|
|
35
35
|
--sp-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.04);
|
|
36
36
|
--sp-shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.12), 0 8px 16px rgba(0, 0, 0, 0.06);
|
|
37
37
|
--sp-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
|
38
|
-
`}function K(t){return typeof t=="object"&&t!==null}function ge(t,e){return K(t)&&e in t}var P=["en","fr","de","es","it","pt","ru"];var be=["open","in_progress","resolved","wont_fix"],z=["resolved","wont_fix"];function C(t){return z.includes(t)}function xe(t){return {cssSelector:t.anchor.cssSelector,xpath:t.anchor.xpath,textSnippet:t.anchor.textSnippet,elementTag:t.anchor.elementTag,elementId:t.anchor.elementId,textPrefix:t.anchor.textPrefix,textSuffix:t.anchor.textSuffix,fingerprint:t.anchor.fingerprint,neighborText:t.anchor.neighborText,anchorKey:t.anchor.anchorKey??null,xPct:t.rect.xPct,yPct:t.rect.yPct,wPct:t.rect.wPct,hPct:t.rect.hPct,scrollX:t.scrollX,scrollY:t.scrollY,viewportW:t.viewportW,viewportH:t.viewportH,devicePixelRatio:t.devicePixelRatio}}var E=class extends Error{code;retryable;constructor(e,s,n){super(e),this.code=s,this.retryable=n,this.name="SitepingError";}},O=class extends E{constructor(e){super(e,"NETWORK",true),this.name="SitepingNetworkError";}},N=class extends E{constructor(e){super(e,"VALIDATION",false),this.name="SitepingValidationError";}},D=class extends E{constructor(e){super(e,"AUTH",false),this.name="SitepingAuthError";}};var U={"panel.title":"Feedbacks","panel.ariaLabel":"Siteping feedback panel","panel.feedbackList":"Feedback list","panel.loading":"Loading feedbacks","panel.close":"Close panel","panel.deleteAll":"Delete all","panel.deleteAllConfirmTitle":"Delete all","panel.deleteAllConfirmMessage":"Delete all feedbacks for this project? This action cannot be undone.","panel.search":"Search...","panel.searchAria":"Search feedbacks","panel.filterAll":"All","panel.loadError":"Failed to load","panel.retry":"Retry","panel.empty":"No feedback yet","panel.showMore":"Show more","panel.showLess":"Show less","panel.resolve":"Resolve","panel.reopen":"Reopen","panel.delete":"Delete","panel.cancel":"Cancel","panel.confirmDelete":"Delete","panel.loadMore":"Load more ({remaining} remaining)","panel.statusAll":"All","panel.statusOpen":"Open","panel.statusResolved":"Resolved","panel.statusInProgress":"In progress","panel.statusWontFix":"Won't fix","type.label":"Type","type.question":"Question","type.change":"Change","type.bug":"Bug","type.other":"Other","status.label":"Status","scope.label":"Scope","scope.thisPage":"This page","scope.thisType":"This type","scope.all":"All pages","fab.aria":"Siteping \u2014 Feedback menu","fab.messages":"Show sidebar","fab.annotate":"Create new annotation","fab.annotations":"Show or hide markers","annotator.instruction":"Draw a rectangle on the area to comment","annotator.cancel":"Cancel","popup.ariaLabel":"Feedback form","popup.placeholder":"Describe your feedback...","popup.textareaAria":"Feedback message","popup.submitHintMac":"\u2318+Enter to send","popup.submitHintOther":"Ctrl+Enter to send","popup.cancel":"Cancel","popup.submit":"Send","identity.title":"Identify yourself","identity.nameLabel":"Name","identity.namePlaceholder":"Your name","identity.emailLabel":"Email","identity.emailPlaceholder":"your@email.com","identity.cancel":"Cancel","identity.submit":"Continue","marker.approximate":"Approximate position (confidence: {confidence}%)","marker.aria":"Feedback #{number}: {type} \u2014 {message}","marker.count":"{count} feedback markers displayed","fab.badge":"{count} unresolved feedbacks","feedback.sent.confirmation":"Feedback sent successfully","feedback.error.message":"Failed to send feedback","feedback.deleted.confirmation":"Feedback deleted","badge.count":"{count} unresolved feedbacks","bulk.selectAll":"Select all","bulk.selected":"{count} selected","bulk.resolve":"Resolve","bulk.delete":"Delete","bulk.deselect":"Deselect","sort.newest":"Newest first","sort.oldest":"Oldest first","sort.byType":"By type","sort.openFirst":"Open first","sort.label":"Sort","group.byPage":"By page","group.feedbacks":"{count} feedbacks","stats.open":"Open","stats.resolved":"Resolved","stats.bugs":"Bugs","stats.progress":"{percent}% resolved","detail.back":"Back","detail.title":"Feedback #{number}","detail.status":"Status","detail.message":"Message","detail.screenshot":"Screenshot","detail.screenshotAlt":"Screenshot of the annotated area","detail.metadata":"Details","detail.annotation":"Annotation","detail.page":"Page","detail.author":"Author","detail.date":"Created","detail.viewport":"Viewport","detail.browser":"Browser","detail.resolvedAt":"Resolved at","detail.closedAt":"Closed at","detail.goToAnnotation":"Go to annotation","detail.element":"Element","detail.selector":"Selector","detail.position":"Position","detail.resolve":"Resolve","detail.reopen":"Reopen","detail.delete":"Delete","detail.diagnostics":"Diagnostics","detail.diagnostics.console":"Console","detail.diagnostics.network":"Failed network","detail.diagnostics.expand":"Show diagnostics","detail.diagnostics.collapse":"Hide diagnostics","detail.diagnostics.noEntries":"No entries","shortcuts.title":"Keyboard shortcuts","shortcuts.navigate":"Navigate feedbacks","shortcuts.resolve":"Resolve / Reopen","shortcuts.delete":"Delete","shortcuts.search":"Focus search","shortcuts.select":"Toggle selection","shortcuts.help":"Show shortcuts","shortcuts.close":"Close","shortcuts.hint":"Keyboard shortcuts","export.label":"Export","export.csv":"Export CSV","export.json":"Export JSON"};var T={en:U},ve=new Set(P.filter(t=>t!=="en"));function V(t){return ve.has(t)}function Y(t){return (t.split("-")[0]??t).toLowerCase()}async function Pt(t){let e=Y(t),s=T[e];if(s)return s;if(!V(e))return null;let n;switch(e){case "de":n=await import('./de-
|
|
38
|
+
`}function K(t){return typeof t=="object"&&t!==null}function ge(t,e){return K(t)&&e in t}var P=["en","fr","de","es","it","pt","ru"];var be=["open","in_progress","resolved","wont_fix"],z=["resolved","wont_fix"];function C(t){return z.includes(t)}function xe(t){return {cssSelector:t.anchor.cssSelector,xpath:t.anchor.xpath,textSnippet:t.anchor.textSnippet,elementTag:t.anchor.elementTag,elementId:t.anchor.elementId,textPrefix:t.anchor.textPrefix,textSuffix:t.anchor.textSuffix,fingerprint:t.anchor.fingerprint,neighborText:t.anchor.neighborText,anchorKey:t.anchor.anchorKey??null,xPct:t.rect.xPct,yPct:t.rect.yPct,wPct:t.rect.wPct,hPct:t.rect.hPct,scrollX:t.scrollX,scrollY:t.scrollY,viewportW:t.viewportW,viewportH:t.viewportH,devicePixelRatio:t.devicePixelRatio}}var E=class extends Error{code;retryable;constructor(e,s,n){super(e),this.code=s,this.retryable=n,this.name="SitepingError";}},O=class extends E{constructor(e){super(e,"NETWORK",true),this.name="SitepingNetworkError";}},N=class extends E{constructor(e){super(e,"VALIDATION",false),this.name="SitepingValidationError";}},D=class extends E{constructor(e){super(e,"AUTH",false),this.name="SitepingAuthError";}};var U={"panel.title":"Feedbacks","panel.ariaLabel":"Siteping feedback panel","panel.feedbackList":"Feedback list","panel.loading":"Loading feedbacks","panel.close":"Close panel","panel.deleteAll":"Delete all","panel.deleteAllConfirmTitle":"Delete all","panel.deleteAllConfirmMessage":"Delete all feedbacks for this project? This action cannot be undone.","panel.search":"Search...","panel.searchAria":"Search feedbacks","panel.filterAll":"All","panel.loadError":"Failed to load","panel.retry":"Retry","panel.empty":"No feedback yet","panel.showMore":"Show more","panel.showLess":"Show less","panel.resolve":"Resolve","panel.reopen":"Reopen","panel.delete":"Delete","panel.cancel":"Cancel","panel.confirmDelete":"Delete","panel.loadMore":"Load more ({remaining} remaining)","panel.statusAll":"All","panel.statusOpen":"Open","panel.statusResolved":"Resolved","panel.statusInProgress":"In progress","panel.statusWontFix":"Won't fix","type.label":"Type","type.question":"Question","type.change":"Change","type.bug":"Bug","type.other":"Other","status.label":"Status","scope.label":"Scope","scope.thisPage":"This page","scope.thisType":"This type","scope.all":"All pages","fab.aria":"Siteping \u2014 Feedback menu","fab.messages":"Show sidebar","fab.annotate":"Create new annotation","fab.annotations":"Show or hide markers","annotator.instruction":"Draw a rectangle on the area to comment \u2014 or press Enter to comment on the last focused element","annotator.instantInstruction":"Comment on the clicked spot","annotator.cancel":"Cancel","popup.ariaLabel":"Feedback form","popup.placeholder":"Describe your feedback...","popup.textareaAria":"Feedback message","popup.submitHintMac":"\u2318+Enter to send","popup.submitHintOther":"Ctrl+Enter to send","popup.cancel":"Cancel","popup.submit":"Send","identity.title":"Identify yourself","identity.nameLabel":"Name","identity.namePlaceholder":"Your name","identity.emailLabel":"Email","identity.emailPlaceholder":"your@email.com","identity.cancel":"Cancel","identity.submit":"Continue","marker.approximate":"Approximate position (confidence: {confidence}%)","marker.aria":"Feedback #{number}: {type} \u2014 {message}","marker.count":"{count} feedback markers displayed","fab.badge":"{count} unresolved feedbacks","feedback.sent.confirmation":"Feedback sent successfully","feedback.error.message":"Failed to send feedback","feedback.deleted.confirmation":"Feedback deleted","badge.count":"{count} unresolved feedbacks","bulk.selectAll":"Select all","bulk.selected":"{count} selected","bulk.resolve":"Resolve","bulk.delete":"Delete","bulk.deselect":"Deselect","sort.newest":"Newest first","sort.oldest":"Oldest first","sort.byType":"By type","sort.openFirst":"Open first","sort.label":"Sort","group.byPage":"By page","group.feedbacks":"{count} feedbacks","stats.open":"Open","stats.resolved":"Resolved","stats.bugs":"Bugs","stats.progress":"{percent}% resolved","detail.back":"Back","detail.title":"Feedback #{number}","detail.status":"Status","detail.message":"Message","detail.screenshot":"Screenshot","detail.screenshotAlt":"Screenshot of the annotated area","detail.metadata":"Details","detail.annotation":"Annotation","detail.page":"Page","detail.author":"Author","detail.date":"Created","detail.viewport":"Viewport","detail.browser":"Browser","detail.resolvedAt":"Resolved at","detail.closedAt":"Closed at","detail.goToAnnotation":"Go to annotation","detail.element":"Element","detail.selector":"Selector","detail.position":"Position","detail.resolve":"Resolve","detail.reopen":"Reopen","detail.delete":"Delete","detail.diagnostics":"Diagnostics","detail.diagnostics.console":"Console","detail.diagnostics.network":"Failed network","detail.diagnostics.expand":"Show diagnostics","detail.diagnostics.collapse":"Hide diagnostics","detail.diagnostics.noEntries":"No entries","shortcuts.title":"Keyboard shortcuts","shortcuts.navigate":"Navigate feedbacks","shortcuts.resolve":"Resolve / Reopen","shortcuts.delete":"Delete","shortcuts.search":"Focus search","shortcuts.select":"Toggle selection","shortcuts.help":"Show shortcuts","shortcuts.close":"Close","shortcuts.hint":"Keyboard shortcuts","export.label":"Export","export.csv":"Export CSV","export.json":"Export JSON"};var T={en:U},ve=new Set(P.filter(t=>t!=="en"));function V(t){return ve.has(t)}function Y(t){return (t.split("-")[0]??t).toLowerCase()}async function Pt(t){let e=Y(t),s=T[e];if(s)return s;if(!V(e))return null;let n;switch(e){case "de":n=await import('./de-MAGIJBFC.js');break;case "es":n=await import('./es-HEVFJPRI.js');break;case "fr":n=await import('./fr-OM2PHLDH.js');break;case "it":n=await import('./it-OQVYHKKV.js');break;case "pt":n=await import('./pt-VUUNL42H.js');break;case "ru":n=await import('./ru-NDWY7Y36.js');break;default:return null}let r=n[e];return r?(T[e]=r,r):null}function Ot(t){let e=Y(t);return e!=="en"&&!T[e]&&!V(e)&&console.warn(`[siteping] Unknown locale "${t}", falling back to "en"`),s=>(T[e]??T.en)?.[s]??T.en?.[s]??s}function Nt(t,e){switch(t){case "question":return e("type.question");case "change":return e("type.change");case "bug":return e("type.bug");case "other":return e("type.other");default:return t}}function G(t,e){switch(t){case "open":return e("panel.statusOpen");case "in_progress":return e("panel.statusInProgress");case "resolved":return e("panel.statusResolved");case "wont_fix":return e("panel.statusWontFix");default:return t}}var fe='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>',me='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="3" width="18" height="18" rx="2"/><line x1="3" y1="9" x2="21" y2="9"/><line x1="3" y1="15" x2="21" y2="15"/><line x1="9" y1="3" x2="9" y2="21"/><line x1="15" y1="3" x2="15" y2="21"/></svg>',ye='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 3H6a2 2 0 0 0-2 2v4a2 2 0 0 1-2 2 2 2 0 0 1 2 2v4a2 2 0 0 0 2 2h2"/><path d="M16 3h2a2 2 0 0 1 2 2v4a2 2 0 0 0 2 2 2 2 0 0 0-2 2v4a2 2 0 0 1-2 2h-2"/></svg>',It=`
|
|
39
39
|
/* ============================
|
|
40
40
|
Export Button & Menu
|
|
41
41
|
============================ */
|
|
@@ -1792,5 +1792,5 @@ function c(t){let n=document.createRange().createContextualFragment(t).firstElem
|
|
|
1792
1792
|
transition-duration: 0.01ms !important;
|
|
1793
1793
|
}
|
|
1794
1794
|
}
|
|
1795
|
-
`,Ue='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>',ae=class{constructor(e,s,n){this.t=n;this.keyMap=new Map([["j",()=>s.onNavigate("down")],["k",()=>s.onNavigate("up")],["r",()=>s.onResolve()],["d",()=>s.onDelete()],["f",()=>s.onFocusSearch()],["/",()=>s.onFocusSearch()],["x",()=>s.onToggleSelect()],["?",()=>this.toggleHelp()]]),this.helpOverlay=this.buildOverlay(),this.hintButton=this.buildHintButton(),this.boundHandler=r=>this.handleKeydown(r);}t;helpOverlay;hintButton;keyMap;boundHandler;shadowRoot=null;enabled=false;helpVisible=false;destroyed=false;enable(e){if(this.destroyed||this.enabled)return;e&&(this.shadowRoot=e),(this.shadowRoot??document).addEventListener("keydown",this.boundHandler),this.enabled=true;}disable(){if(!this.enabled)return;(this.shadowRoot??document).removeEventListener("keydown",this.boundHandler),this.enabled=false,this.helpVisible&&this.hideHelp();}toggleHelp(){this.helpVisible?this.hideHelp():this.showHelp();}destroy(){this.destroyed||(this.disable(),this.helpOverlay.remove(),this.hintButton.remove(),this.destroyed=true);}handleKeydown(e){if(e.key==="Escape"){this.helpVisible&&(e.preventDefault(),e.stopPropagation(),this.hideHelp());return}if(this.helpVisible)return;let s=e.composedPath()[0];if(s){let r=s.tagName?.toLowerCase();if(r==="input"||r==="textarea"||r==="select"||s.isContentEditable)return}if(e.ctrlKey||e.altKey||e.metaKey)return;let n=this.keyMap.get(e.key);n&&(e.preventDefault(),e.stopPropagation(),n());}showHelp(){this.helpVisible=true,this.helpOverlay.classList.add("sp-shortcuts-overlay--visible"),this.helpOverlay.querySelector(".sp-shortcuts-close")?.focus();}hideHelp(){this.helpVisible=false,this.helpOverlay.classList.remove("sp-shortcuts-overlay--visible");}buildOverlay(){let e=o("div",{class:"sp-shortcuts-overlay"});e.setAttribute("role","dialog"),e.setAttribute("aria-modal","true"),e.setAttribute("aria-label",this.t("shortcuts.title")),e.addEventListener("click",d=>{d.target===e&&this.hideHelp();});let s=o("div",{class:"sp-shortcuts-card"}),n=o("div",{class:"sp-shortcuts-title"});n.appendChild(c(Ke));let r=o("span");a(r,this.t("shortcuts.title")),n.appendChild(r),s.appendChild(n);let i=document.createElement("button");i.className="sp-shortcuts-close",i.setAttribute("aria-label",this.t("shortcuts.close")),i.appendChild(c(Ue)),i.addEventListener("click",()=>this.hideHelp()),s.appendChild(i);let l=o("div",{class:"sp-shortcuts-grid"});for(let d of ze){let p=o("div",{class:"sp-shortcuts-row"}),h=o("div",{class:"sp-shortcuts-keys"});d.keys.forEach((v,m)=>{if(m>0){let g=o("span",{class:"sp-shortcuts-separator"});a(g,"/"),h.appendChild(g);}let f=o("span",{class:"sp-kbd"});a(f,v),h.appendChild(f);});let u=o("span",{class:"sp-shortcuts-desc"});a(u,this.t(d.label)),p.appendChild(h),p.appendChild(u),l.appendChild(p);}return s.appendChild(l),e.appendChild(s),e}buildHintButton(){let e=document.createElement("button");return e.className="sp-shortcuts-hint",e.setAttribute("aria-label",this.t("shortcuts.hint")),a(e,"?"),e.addEventListener("click",s=>{s.stopPropagation(),this.toggleHelp();}),e}};export{ie as $,$ as A,gt as B,E as C,O as D,N as E,D as F,ge as G,be as H,z as I,C as J,xe as K,Pt as L,Ot as M,Nt as N,G as O,It as P,X as Q,$t as R,J as S,Gt as T,se as U,Qt as V,Jt as W,Zt as X,re as Y,es as Z,rs as _,c as a,as as aa,o as b,ls as ba,a as c,ps as ca,F as d,ae as da,Ve as e,Ge as f,qe as g,We as h,Xe as i,Qe as j,Je as k,Ze as l,et as m,tt as n,st as o,nt as p,rt as q,ot as r,it as s,at as t,lt as u,pt as v,ct as w,M as x,ut as y,ht as z};//# sourceMappingURL=chunk-
|
|
1796
|
-
//# sourceMappingURL=chunk-
|
|
1795
|
+
`,Ue='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>',ae=class{constructor(e,s,n){this.t=n;this.keyMap=new Map([["j",()=>s.onNavigate("down")],["k",()=>s.onNavigate("up")],["r",()=>s.onResolve()],["d",()=>s.onDelete()],["f",()=>s.onFocusSearch()],["/",()=>s.onFocusSearch()],["x",()=>s.onToggleSelect()],["?",()=>this.toggleHelp()]]),this.helpOverlay=this.buildOverlay(),this.hintButton=this.buildHintButton(),this.boundHandler=r=>this.handleKeydown(r);}t;helpOverlay;hintButton;keyMap;boundHandler;shadowRoot=null;enabled=false;helpVisible=false;destroyed=false;enable(e){if(this.destroyed||this.enabled)return;e&&(this.shadowRoot=e),(this.shadowRoot??document).addEventListener("keydown",this.boundHandler),this.enabled=true;}disable(){if(!this.enabled)return;(this.shadowRoot??document).removeEventListener("keydown",this.boundHandler),this.enabled=false,this.helpVisible&&this.hideHelp();}toggleHelp(){this.helpVisible?this.hideHelp():this.showHelp();}destroy(){this.destroyed||(this.disable(),this.helpOverlay.remove(),this.hintButton.remove(),this.destroyed=true);}handleKeydown(e){if(e.key==="Escape"){this.helpVisible&&(e.preventDefault(),e.stopPropagation(),this.hideHelp());return}if(this.helpVisible)return;let s=e.composedPath()[0];if(s){let r=s.tagName?.toLowerCase();if(r==="input"||r==="textarea"||r==="select"||s.isContentEditable)return}if(e.ctrlKey||e.altKey||e.metaKey)return;let n=this.keyMap.get(e.key);n&&(e.preventDefault(),e.stopPropagation(),n());}showHelp(){this.helpVisible=true,this.helpOverlay.classList.add("sp-shortcuts-overlay--visible"),this.helpOverlay.querySelector(".sp-shortcuts-close")?.focus();}hideHelp(){this.helpVisible=false,this.helpOverlay.classList.remove("sp-shortcuts-overlay--visible");}buildOverlay(){let e=o("div",{class:"sp-shortcuts-overlay"});e.setAttribute("role","dialog"),e.setAttribute("aria-modal","true"),e.setAttribute("aria-label",this.t("shortcuts.title")),e.addEventListener("click",d=>{d.target===e&&this.hideHelp();});let s=o("div",{class:"sp-shortcuts-card"}),n=o("div",{class:"sp-shortcuts-title"});n.appendChild(c(Ke));let r=o("span");a(r,this.t("shortcuts.title")),n.appendChild(r),s.appendChild(n);let i=document.createElement("button");i.className="sp-shortcuts-close",i.setAttribute("aria-label",this.t("shortcuts.close")),i.appendChild(c(Ue)),i.addEventListener("click",()=>this.hideHelp()),s.appendChild(i);let l=o("div",{class:"sp-shortcuts-grid"});for(let d of ze){let p=o("div",{class:"sp-shortcuts-row"}),h=o("div",{class:"sp-shortcuts-keys"});d.keys.forEach((v,m)=>{if(m>0){let g=o("span",{class:"sp-shortcuts-separator"});a(g,"/"),h.appendChild(g);}let f=o("span",{class:"sp-kbd"});a(f,v),h.appendChild(f);});let u=o("span",{class:"sp-shortcuts-desc"});a(u,this.t(d.label)),p.appendChild(h),p.appendChild(u),l.appendChild(p);}return s.appendChild(l),e.appendChild(s),e}buildHintButton(){let e=document.createElement("button");return e.className="sp-shortcuts-hint",e.setAttribute("aria-label",this.t("shortcuts.hint")),a(e,"?"),e.addEventListener("click",s=>{s.stopPropagation(),this.toggleHelp();}),e}};export{ie as $,$ as A,gt as B,E as C,O as D,N as E,D as F,ge as G,be as H,z as I,C as J,xe as K,Pt as L,Ot as M,Nt as N,G as O,It as P,X as Q,$t as R,J as S,Gt as T,se as U,Qt as V,Jt as W,Zt as X,re as Y,es as Z,rs as _,c as a,as as aa,o as b,ls as ba,a as c,ps as ca,F as d,ae as da,Ve as e,Ge as f,qe as g,We as h,Xe as i,Qe as j,Je as k,Ze as l,et as m,tt as n,st as o,nt as p,rt as q,ot as r,it as s,at as t,lt as u,pt as v,ct as w,M as x,ut as y,ht as z};//# sourceMappingURL=chunk-33HB3HZI.js.map
|
|
1796
|
+
//# sourceMappingURL=chunk-33HB3HZI.js.map
|