@feedlog-ai/webcomponents 0.0.41 → 0.0.42
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/cjs/feedlog-button_3.cjs.entry.js +1 -1
- package/dist/cjs/feedlog-issues-client.cjs.entry.js +1 -1
- package/dist/cjs/{purify.es-ppGw41aq.js → purify.es-CfCgypMZ.js} +15 -4
- package/dist/components/feedlog-issue.js +1 -1
- package/dist/components/feedlog-issues-client.js +1 -1
- package/dist/components/feedlog-issues-list.js +1 -1
- package/dist/components/feedlog-issues.js +1 -1
- package/dist/components/{p-CVEXMLCP.js → p-DLNSSGDc.js} +1 -1
- package/dist/components/{p-DsLDsYLY.js → p-RVHxnHRU.js} +1 -1
- package/dist/components/{p-2RPRQcjh.js → p-TX_JzdfG.js} +3 -3
- package/dist/esm/feedlog-button_3.entry.js +1 -1
- package/dist/esm/feedlog-issues-client.entry.js +1 -1
- package/dist/esm/{purify.es-Bow7VsVH.js → purify.es-B8AIqnOZ.js} +15 -4
- package/dist/feedlog-toolkit/feedlog-toolkit.esm.js +1 -1
- package/dist/feedlog-toolkit/{p-8ab2cdd9.entry.js → p-0a9a5af2.entry.js} +1 -1
- package/dist/feedlog-toolkit/p-B8AIqnOZ.js +2 -0
- package/dist/feedlog-toolkit/{p-c1e83493.entry.js → p-a7dcf9b6.entry.js} +1 -1
- package/hydrate/index.js +15 -4
- package/hydrate/index.mjs +15 -4
- package/package.json +2 -2
- package/dist/feedlog-toolkit/p-Bow7VsVH.js +0 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-CXKBwRlh.js');
|
|
4
|
-
var purify_es = require('./purify.es-
|
|
4
|
+
var purify_es = require('./purify.es-CfCgypMZ.js');
|
|
5
5
|
|
|
6
6
|
const feedlogButtonCss = () => `:host{display:inline-block;font-family:ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;--feedlog-background:#ffffff;--feedlog-foreground:oklch(0.145 0 0);--feedlog-primary:#030213;--feedlog-primary-foreground:oklch(1 0 0);--feedlog-secondary:oklch(0.95 0.0058 264.53);--feedlog-secondary-foreground:#030213;--feedlog-muted:#ececf0;--feedlog-accent:#e9ebef;--feedlog-accent-foreground:#030213;--feedlog-border:rgba(0, 0, 0, 0.1);--feedlog-input:transparent;--feedlog-ring:oklch(0.708 0 0);--feedlog-destructive:#d4183d;--feedlog-radius:0.625rem}:host(.dark){--feedlog-background:oklch(0.145 0 0);--feedlog-foreground:oklch(0.985 0 0);--feedlog-primary:oklch(0.985 0 0);--feedlog-primary-foreground:oklch(0.205 0 0);--feedlog-secondary:oklch(0.269 0 0);--feedlog-secondary-foreground:oklch(0.985 0 0);--feedlog-muted:oklch(0.269 0 0);--feedlog-accent:oklch(0.269 0 0);--feedlog-accent-foreground:oklch(0.985 0 0);--feedlog-border:oklch(0.269 0 0);--feedlog-input:oklch(0.269 0 0);--feedlog-ring:oklch(0.439 0 0);--feedlog-destructive:oklch(0.396 0.141 25.723)}button{display:inline-flex;align-items:center;justify-content:center;gap:0.5rem;white-space:nowrap;font-size:0.875rem;font-weight:500;border-radius:calc(var(--feedlog-radius) - 2px);border:1px solid transparent;cursor:pointer;transition:all 0.15s ease;outline:none;font-family:inherit}button:disabled{opacity:0.5;cursor:not-allowed;pointer-events:none}button:focus-visible{border-color:var(--feedlog-ring);box-shadow:0 0 0 3px color-mix(in oklab, var(--feedlog-ring) 50%, transparent)}.button-default{background-color:var(--feedlog-primary);color:var(--feedlog-primary-foreground);border-color:transparent}.button-default:hover:not(:disabled){background-color:color-mix(in oklab, var(--feedlog-primary) 90%, transparent)}.button-outline{background-color:var(--feedlog-background);color:var(--feedlog-foreground);border-color:var(--feedlog-border)}.button-outline:hover:not(:disabled){background-color:var(--feedlog-accent);color:var(--feedlog-accent-foreground)}:host(.dark) .button-outline{background-color:transparent;border-color:var(--feedlog-input)}:host(.dark) .button-outline:hover:not(:disabled){background-color:color-mix(in oklab, var(--feedlog-accent) 50%, transparent)}.button-ghost{background-color:transparent;color:var(--feedlog-foreground);border-color:transparent}.button-ghost:hover:not(:disabled){background-color:var(--feedlog-accent);color:var(--feedlog-accent-foreground)}.button-destructive{background-color:var(--feedlog-destructive);color:#ffffff;border-color:transparent}.button-destructive:hover:not(:disabled){background-color:color-mix(in oklab, var(--feedlog-destructive) 90%, transparent)}:host(.dark) .button-destructive{background-color:color-mix(in oklab, var(--feedlog-destructive) 60%, transparent)}.button-size-sm{height:2rem;padding:0 0.75rem;font-size:0.75rem}.button-size-sm:has(svg:only-child){width:2rem;padding:0}.button-size-default{height:2.25rem;padding:0.5rem 1rem}.button-size-lg{height:2.5rem;padding:0.625rem 1.5rem;font-size:1rem}button svg{pointer-events:none;flex-shrink:0;width:1rem;height:1rem}`;
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-CXKBwRlh.js');
|
|
4
|
-
var purify_es = require('./purify.es-
|
|
4
|
+
var purify_es = require('./purify.es-CfCgypMZ.js');
|
|
5
5
|
|
|
6
6
|
function getDefaultExportFromCjs (x) {
|
|
7
7
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
/*! @license DOMPurify 3.3.
|
|
3
|
+
/*! @license DOMPurify 3.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.3/LICENSE */
|
|
4
4
|
|
|
5
5
|
const {
|
|
6
6
|
entries,
|
|
@@ -298,7 +298,7 @@ const _createHooksMap = function _createHooksMap() {
|
|
|
298
298
|
function createDOMPurify() {
|
|
299
299
|
let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
|
|
300
300
|
const DOMPurify = root => createDOMPurify(root);
|
|
301
|
-
DOMPurify.version = '3.3.
|
|
301
|
+
DOMPurify.version = '3.3.3';
|
|
302
302
|
DOMPurify.removed = [];
|
|
303
303
|
if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
|
|
304
304
|
// Not running in a browser, provide a factory function
|
|
@@ -593,7 +593,7 @@ function createDOMPurify() {
|
|
|
593
593
|
/* Parse profile info */
|
|
594
594
|
if (USE_PROFILES) {
|
|
595
595
|
ALLOWED_TAGS = addToSet({}, text);
|
|
596
|
-
ALLOWED_ATTR =
|
|
596
|
+
ALLOWED_ATTR = create(null);
|
|
597
597
|
if (USE_PROFILES.html === true) {
|
|
598
598
|
addToSet(ALLOWED_TAGS, html$1);
|
|
599
599
|
addToSet(ALLOWED_ATTR, html);
|
|
@@ -614,6 +614,13 @@ function createDOMPurify() {
|
|
|
614
614
|
addToSet(ALLOWED_ATTR, xml);
|
|
615
615
|
}
|
|
616
616
|
}
|
|
617
|
+
/* Prevent function-based ADD_ATTR / ADD_TAGS from leaking across calls */
|
|
618
|
+
if (!objectHasOwnProperty(cfg, 'ADD_TAGS')) {
|
|
619
|
+
EXTRA_ELEMENT_HANDLING.tagCheck = null;
|
|
620
|
+
}
|
|
621
|
+
if (!objectHasOwnProperty(cfg, 'ADD_ATTR')) {
|
|
622
|
+
EXTRA_ELEMENT_HANDLING.attributeCheck = null;
|
|
623
|
+
}
|
|
617
624
|
/* Merge configuration parameters */
|
|
618
625
|
if (cfg.ADD_TAGS) {
|
|
619
626
|
if (typeof cfg.ADD_TAGS === 'function') {
|
|
@@ -1011,6 +1018,10 @@ function createDOMPurify() {
|
|
|
1011
1018
|
*/
|
|
1012
1019
|
// eslint-disable-next-line complexity
|
|
1013
1020
|
const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {
|
|
1021
|
+
/* FORBID_ATTR must always win, even if ADD_ATTR predicate would allow it */
|
|
1022
|
+
if (FORBID_ATTR[lcName]) {
|
|
1023
|
+
return false;
|
|
1024
|
+
}
|
|
1014
1025
|
/* Make sure attribute cannot clobber */
|
|
1015
1026
|
if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {
|
|
1016
1027
|
return false;
|
|
@@ -1103,7 +1114,7 @@ function createDOMPurify() {
|
|
|
1103
1114
|
value = SANITIZE_NAMED_PROPS_PREFIX + value;
|
|
1104
1115
|
}
|
|
1105
1116
|
/* Work around a security issue with comments inside attributes */
|
|
1106
|
-
if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title|textarea)/i, value)) {
|
|
1117
|
+
if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, value)) {
|
|
1107
1118
|
_removeAttribute(name, currentNode);
|
|
1108
1119
|
continue;
|
|
1109
1120
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as o,d as s}from"./p-
|
|
1
|
+
import{F as o,d as s}from"./p-TX_JzdfG.js";const p=o,r=s;export{p as FeedlogIssue,r as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t,p as e,H as s,c as i,h as o}from"./index.js";import{p as r,d as n}from"./p-2RPRQcjh.js";import{d as h}from"./p-DzATWlAC.js";import{d as u}from"./p-DMdb-G26.js";import{d as a}from"./p-DsLDsYLY.js";import{d as l}from"./p-CVEXMLCP.js";function c(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function d(t){if(t.__esModule)return t;var e=t.default;if("function"==typeof e){var s=function t(){return this instanceof t?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};s.prototype=e.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(t).forEach((function(e){var i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(s,e,i.get?i:{enumerable:!0,get:function(){return t[e]}})})),s}var p,f,m=d(r),g=c(f?p:(f=1,p=self.DOMPurify||(self.DOMPurify=m.default||m)));function b(t){return"string"!=typeof t?"":g.sanitize(t,{USE_PROFILES:{html:!0}})}class w extends Error{constructor(t,e,s){super(t),this.statusCode=e,this.originalError=s,this.name="FeedlogError",Object.setPrototypeOf(this,w.prototype)}}class y extends w{constructor(t){super(t),this.name="FeedlogValidationError",Object.setPrototypeOf(this,y.prototype)}}class v extends w{constructor(t,e,s){super(t,e,s),this.name="FeedlogNetworkError",Object.setPrototypeOf(this,v.prototype)}}class I extends w{constructor(t="Request timed out"){super(t),this.name="FeedlogTimeoutError",Object.setPrototypeOf(this,I.prototype)}}class j{constructor(t){if(this.config={credentials:"include",...t},this.apiKey=this.config.apiKey,!this.apiKey)throw new y("apiKey is required in FeedlogSDKConfig");this.endpoint=this.config.endpoint||"https://api.feedlog.app",this.timeout=this.config.timeout||3e4,this.endpoint=this.endpoint.replace(/\/$/,"")}async fetchIssues(t={}){try{const e=this.buildIssuesUrl(t),s=await this.fetchWithTimeout(e,{method:"GET",headers:this.getAuthHeaders(),credentials:this.config.credentials||"include"});if(!s.ok)throw new v("Failed to fetch issues: "+s.statusText,s.status);const i=await s.json();return this.validateIssuesResponse(i)}catch(t){this.wrapFetchError(t,"Failed to fetch issues")}}async toggleUpvote(t){if(!t||"string"!=typeof t)throw new y("Issue ID is required");try{const e=`${this.endpoint}/api/issues/${encodeURIComponent(t)}/upvote`,s=await this.fetchWithTimeout(e,{method:"POST",headers:this.getAuthHeaders(),credentials:this.config.credentials||"include",body:JSON.stringify({})});if(404===s.status)throw new v("Issue not found",404);if(401===s.status)throw new v("Unauthorized",401);if(403===s.status)throw new v("Forbidden: Domain not allowed for this repository",403);if(!s.ok)throw new v("Failed to toggle upvote: "+s.statusText,s.status);const i=await s.json();return this.validateUpvoteResponse(i)}catch(t){this.wrapFetchError(t,"Failed to toggle upvote")}}buildIssuesUrl(t){const e=new URL(this.endpoint+"/api/issues");if(t.repositoryIds){const s=Array.isArray(t.repositoryIds)?t.repositoryIds:[t.repositoryIds];for(const t of s)e.searchParams.append("repositoryIds",t)}if(t.type&&e.searchParams.set("type",t.type),t.sortBy&&e.searchParams.set("sortBy",t.sortBy),t.cursor&&e.searchParams.set("cursor",t.cursor),void 0!==t.limit){const s=Number(t.limit);e.searchParams.set("limit",(Number.isFinite(s)?Math.max(1,Math.min(100,Math.floor(s))):10)+"")}return""+e}getAuthHeaders(){return{"Content-Type":"application/json","x-api-key":this.apiKey}}wrapFetchError(t,e){if(t instanceof w)throw t;if(t instanceof TypeError&&t.message.includes("fetch"))throw new v("Network error: Unable to reach API",void 0,t);throw new w(`${e}: ${t instanceof Error?t.message:"Unknown error"}`,void 0,t)}async fetchWithTimeout(t,e){const s=new AbortController,i=setTimeout((()=>s.abort()),this.timeout);try{const o=await fetch(t,{...e,signal:s.signal});return clearTimeout(i),o}catch(t){if(clearTimeout(i),t instanceof Error&&"AbortError"===t.name)throw new I(`Request timed out after ${this.timeout}ms`);throw t}}validateIssuesResponse(t){if(!t||"object"!=typeof t)throw new y("Invalid API response: expected object");const e=t;if(!Array.isArray(e.issues))throw new y("Invalid API response: issues must be an array");if(!e.pagination||"object"!=typeof e.pagination)throw new y("Invalid API response: pagination is required");return{issues:e.issues.map((t=>this.validateIssue(t))),pagination:{cursor:e.pagination.cursor,hasMore:!!e.pagination.hasMore}}}validateIssue(t){if(!t||"object"!=typeof t)throw new y("Invalid issue: expected object");const e=t;if("string"!=typeof e.id)throw new y("Invalid issue: id is required and must be a string");if(!["bug","enhancement"].includes(e.type+""))throw new y('Invalid issue: type must be "bug" or "enhancement"');if(!["open","in_progress","closed"].includes(e.status+""))throw new y('Invalid issue: status must be "open", "in_progress", or "closed"');if(!e.repository||"object"!=typeof e.repository)throw new y("Invalid issue: repository is required");const s=e.repository;if("string"!=typeof s.id)throw new y("Invalid issue: repository must have id");const i=null!==e.githubIssueLink&&"string"==typeof e.githubIssueLink?e.githubIssueLink+"":null,o=e.title,r=null!=o&&""!==o?b(o+""):null,n=e.body,h=null!=n&&""!==n?b(n+""):null,u=s.name,a=null!=u&&""!==u?u+"":null,l=s.description,c=null!=l&&""!==l?b(l+""):null,d="number"==typeof e.revision&&Number.isFinite(e.revision)?e.revision:1,p="number"==typeof e.upvoteCount&&Number.isFinite(e.upvoteCount)?e.upvoteCount:0,f="string"==typeof e.updatedAt&&e.updatedAt.length>0?e.updatedAt:(new Date).toISOString(),m="string"==typeof e.createdAt&&e.createdAt.length>0?e.createdAt:(new Date).toISOString();return{id:e.id+"",githubIssueLink:i,type:e.type||"bug",status:e.status||"open",pinnedAt:e.pinnedAt?e.pinnedAt+"":null,revision:d,title:r,body:h,repository:{id:s.id+"",name:a,description:c},updatedAt:f,createdAt:m,upvoteCount:p,hasUpvoted:!!e.hasUpvoted}}validateUpvoteResponse(t){if(!t||"object"!=typeof t)throw new y("Invalid upvote response: expected object");const e=t;if("boolean"!=typeof e.upvoted)throw new y("Invalid upvote response: upvoted must be a boolean");if("number"!=typeof e.upvoteCount)throw new y("Invalid upvote response: upvoteCount must be a number");if("string"!=typeof e.anonymousUserId)throw new y("Invalid upvote response: anonymousUserId must be a string");return{upvoted:e.upvoted,upvoteCount:e.upvoteCount,anonymousUserId:e.anonymousUserId}}getEndpoint(){return this.endpoint}getTimeout(){return this.timeout}}const E=e(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.feedlogUpvote=i(this,"feedlogUpvote"),this.feedlogError=i(this,"feedlogError"),this.maxWidth="42rem",this.theme="light",this.issues=[],this.loading=!0,this.error=null,this.cursor=null,this.hasMore=!1,this.isLoadingMore=!1,this.sdk=null,this.fetchRequestId=0,this.isDisconnected=!1,this.upvoteRequestIds=new Map,this.handleUpvote=async t=>{if(!this.sdk||this.isDisconnected)return;const{issueId:e,currentUpvoted:s,currentCount:i}=t.detail,o=(this.upvoteRequestIds.get(e)||0)+1;this.upvoteRequestIds.set(e,o),this.issues=this.issues.map((t=>t.id===e?Object.assign(Object.assign({},t),{hasUpvoted:!s,upvoteCount:s?i-1:i+1}):t));try{const t=await this.sdk.toggleUpvote(e);if(this.isDisconnected||this.upvoteRequestIds.get(e)!==o)return;this.issues=this.issues.map((s=>s.id===e?Object.assign(Object.assign({},s),{hasUpvoted:t.upvoted,upvoteCount:t.upvoteCount}):s)),this.feedlogUpvote.emit({issueId:e,upvoted:t.upvoted,upvoteCount:t.upvoteCount})}catch(t){if(this.isDisconnected||this.upvoteRequestIds.get(e)!==o)return;this.issues=this.issues.map((t=>t.id===e?Object.assign(Object.assign({},t),{hasUpvoted:s,upvoteCount:i}):t)),this.feedlogError.emit({error:t instanceof Error?t.message:"Failed to toggle upvote"})}}}componentWillLoad(){if(this.previousType=this.type,this.previousLimit=this.limit,this.previousSortBy=this.sortBy,this.initializeSDK(),!(this.issues.length>0)||this.loading)return this.fetchIssues()}disconnectedCallback(){this.isDisconnected=!0,this.fetchRequestId++}componentDidUpdate(){(this.previousType!==this.type||this.previousLimit!==this.limit||this.previousSortBy!==this.sortBy)&&(this.fetchRequestId++,this.cursor=null,this.hasMore=!1,this.issues=[],this.fetchIssues().catch((()=>{})),this.previousType=this.type,this.previousLimit=this.limit,this.previousSortBy=this.sortBy)}initializeSDK(){try{if(!this.apiKey)throw Error("API key is required for the Feedlog SDK");this.sdk=new j(Object.assign({apiKey:this.apiKey},this.endpoint&&{endpoint:this.endpoint})),this.error=null}catch(t){const e=t instanceof Error?t.message:"Failed to initialize SDK";this.error=e,this.feedlogError.emit({error:e})}}buildFetchParams(){const t={};return this.type&&(t.type=this.type),this.sortBy&&(t.sortBy=this.sortBy),this.limit&&(t.limit=this.limit),this.cursor&&(t.cursor=this.cursor),t}async fetchIssues(){if(!this.sdk)return;const t=this.fetchRequestId;try{this.loading=!0,this.error=null;const e=this.buildFetchParams(),s=await this.sdk.fetchIssues(e);if(this.isDisconnected||t!==this.fetchRequestId)return;this.issues=s.issues,this.cursor=s.pagination.cursor,this.hasMore=s.pagination.hasMore}catch(e){if(this.isDisconnected||t!==this.fetchRequestId)return;const s=e instanceof Error?e.message:"Couldn't load updates";this.error=s,this.issues=[],this.feedlogError.emit({error:s,code:null==e?void 0:e.statusCode})}finally{this.isDisconnected||t!==this.fetchRequestId||(this.loading=!1,this.isLoadingMore=!1)}}async loadMore(){if(!this.sdk||!this.hasMore||this.isLoadingMore||this.loading)return;const t=this.fetchRequestId;this.isLoadingMore=!0;try{const e=this.buildFetchParams(),s=await this.sdk.fetchIssues(e);if(this.isDisconnected||t!==this.fetchRequestId)return;this.issues=[...this.issues,...s.issues],this.cursor=s.pagination.cursor,this.hasMore=s.pagination.hasMore}catch(e){if(this.isDisconnected||t!==this.fetchRequestId)return;this.feedlogError.emit({error:e instanceof Error?e.message:"Failed to load more issues",code:null==e?void 0:e.statusCode})}finally{this.isDisconnected||t!==this.fetchRequestId||(this.isLoadingMore=!1)}}render(){var t,e;const s=null===(e=null===(t=this.el)||void 0===t?void 0:t.style)||void 0===e?void 0:e.getPropertyValue("--feedlog-background");return o("feedlog-issues",{key:"4467ffabd5f18f9af6c8407622fb2554981b54bd",style:s?{"--feedlog-background":s}:void 0,issues:this.issues,limit:this.limit,maxWidth:this.maxWidth,theme:this.theme,heading:this.heading,subtitle:this.subtitle,emptyStateTitle:this.emptyStateTitle,emptyStateMessage:this.emptyStateMessage,getIssueUrl:this.getIssueUrl,loading:this.loading,error:this.error,hasMore:this.hasMore,isLoadingMore:this.isLoadingMore,onFeedlogUpvote:this.handleUpvote,onFeedlogLoadMore:async()=>this.loadMore()})}get el(){return this}},[1,"feedlog-issues-client",{apiKey:[1,"api-key"],type:[1],limit:[2],sortBy:[1,"sort-by"],endpoint:[1],maxWidth:[1,"max-width"],theme:[1],heading:[1],subtitle:[1],emptyStateTitle:[1,"empty-state-title"],emptyStateMessage:[1,"empty-state-message"],getIssueUrl:[16],issues:[32],loading:[32],error:[32],cursor:[32],hasMore:[32],isLoadingMore:[32]}]);function U(){"undefined"!=typeof customElements&&["feedlog-issues-client","feedlog-badge","feedlog-button","feedlog-issue","feedlog-issues","feedlog-issues-list"].forEach((e=>{switch(e){case"feedlog-issues-client":customElements.get(t(e))||customElements.define(t(e),E);break;case"feedlog-badge":customElements.get(t(e))||h();break;case"feedlog-button":customElements.get(t(e))||u();break;case"feedlog-issue":customElements.get(t(e))||n();break;case"feedlog-issues":customElements.get(t(e))||a();break;case"feedlog-issues-list":customElements.get(t(e))||l()}}))}U();const F=E,O=U;export{F as FeedlogIssuesClient,O as defineCustomElement}
|
|
1
|
+
import{t,p as e,H as s,c as i,h as o}from"./index.js";import{p as r,d as n}from"./p-TX_JzdfG.js";import{d as h}from"./p-DzATWlAC.js";import{d as u}from"./p-DMdb-G26.js";import{d as a}from"./p-RVHxnHRU.js";import{d as l}from"./p-DLNSSGDc.js";function c(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function d(t){if(t.__esModule)return t;var e=t.default;if("function"==typeof e){var s=function t(){return this instanceof t?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};s.prototype=e.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(t).forEach((function(e){var i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(s,e,i.get?i:{enumerable:!0,get:function(){return t[e]}})})),s}var f,p,m=d(r),g=c(p?f:(p=1,f=self.DOMPurify||(self.DOMPurify=m.default||m)));function b(t){return"string"!=typeof t?"":g.sanitize(t,{USE_PROFILES:{html:!0}})}class w extends Error{constructor(t,e,s){super(t),this.statusCode=e,this.originalError=s,this.name="FeedlogError",Object.setPrototypeOf(this,w.prototype)}}class y extends w{constructor(t){super(t),this.name="FeedlogValidationError",Object.setPrototypeOf(this,y.prototype)}}class v extends w{constructor(t,e,s){super(t,e,s),this.name="FeedlogNetworkError",Object.setPrototypeOf(this,v.prototype)}}class I extends w{constructor(t="Request timed out"){super(t),this.name="FeedlogTimeoutError",Object.setPrototypeOf(this,I.prototype)}}class j{constructor(t){if(this.config={credentials:"include",...t},this.apiKey=this.config.apiKey,!this.apiKey)throw new y("apiKey is required in FeedlogSDKConfig");this.endpoint=this.config.endpoint||"https://api.feedlog.app",this.timeout=this.config.timeout||3e4,this.endpoint=this.endpoint.replace(/\/$/,"")}async fetchIssues(t={}){try{const e=this.buildIssuesUrl(t),s=await this.fetchWithTimeout(e,{method:"GET",headers:this.getAuthHeaders(),credentials:this.config.credentials||"include"});if(!s.ok)throw new v("Failed to fetch issues: "+s.statusText,s.status);const i=await s.json();return this.validateIssuesResponse(i)}catch(t){this.wrapFetchError(t,"Failed to fetch issues")}}async toggleUpvote(t){if(!t||"string"!=typeof t)throw new y("Issue ID is required");try{const e=`${this.endpoint}/api/issues/${encodeURIComponent(t)}/upvote`,s=await this.fetchWithTimeout(e,{method:"POST",headers:this.getAuthHeaders(),credentials:this.config.credentials||"include",body:JSON.stringify({})});if(404===s.status)throw new v("Issue not found",404);if(401===s.status)throw new v("Unauthorized",401);if(403===s.status)throw new v("Forbidden: Domain not allowed for this repository",403);if(!s.ok)throw new v("Failed to toggle upvote: "+s.statusText,s.status);const i=await s.json();return this.validateUpvoteResponse(i)}catch(t){this.wrapFetchError(t,"Failed to toggle upvote")}}buildIssuesUrl(t){const e=new URL(this.endpoint+"/api/issues");if(t.repositoryIds){const s=Array.isArray(t.repositoryIds)?t.repositoryIds:[t.repositoryIds];for(const t of s)e.searchParams.append("repositoryIds",t)}if(t.type&&e.searchParams.set("type",t.type),t.sortBy&&e.searchParams.set("sortBy",t.sortBy),t.cursor&&e.searchParams.set("cursor",t.cursor),void 0!==t.limit){const s=Number(t.limit);e.searchParams.set("limit",(Number.isFinite(s)?Math.max(1,Math.min(100,Math.floor(s))):10)+"")}return""+e}getAuthHeaders(){return{"Content-Type":"application/json","x-api-key":this.apiKey}}wrapFetchError(t,e){if(t instanceof w)throw t;if(t instanceof TypeError&&t.message.includes("fetch"))throw new v("Network error: Unable to reach API",void 0,t);throw new w(`${e}: ${t instanceof Error?t.message:"Unknown error"}`,void 0,t)}async fetchWithTimeout(t,e){const s=new AbortController,i=setTimeout((()=>s.abort()),this.timeout);try{const o=await fetch(t,{...e,signal:s.signal});return clearTimeout(i),o}catch(t){if(clearTimeout(i),t instanceof Error&&"AbortError"===t.name)throw new I(`Request timed out after ${this.timeout}ms`);throw t}}validateIssuesResponse(t){if(!t||"object"!=typeof t)throw new y("Invalid API response: expected object");const e=t;if(!Array.isArray(e.issues))throw new y("Invalid API response: issues must be an array");if(!e.pagination||"object"!=typeof e.pagination)throw new y("Invalid API response: pagination is required");return{issues:e.issues.map((t=>this.validateIssue(t))),pagination:{cursor:e.pagination.cursor,hasMore:!!e.pagination.hasMore}}}validateIssue(t){if(!t||"object"!=typeof t)throw new y("Invalid issue: expected object");const e=t;if("string"!=typeof e.id)throw new y("Invalid issue: id is required and must be a string");if(!["bug","enhancement"].includes(e.type+""))throw new y('Invalid issue: type must be "bug" or "enhancement"');if(!["open","in_progress","closed"].includes(e.status+""))throw new y('Invalid issue: status must be "open", "in_progress", or "closed"');if(!e.repository||"object"!=typeof e.repository)throw new y("Invalid issue: repository is required");const s=e.repository;if("string"!=typeof s.id)throw new y("Invalid issue: repository must have id");const i=null!==e.githubIssueLink&&"string"==typeof e.githubIssueLink?e.githubIssueLink+"":null,o=e.title,r=null!=o&&""!==o?b(o+""):null,n=e.body,h=null!=n&&""!==n?b(n+""):null,u=s.name,a=null!=u&&""!==u?u+"":null,l=s.description,c=null!=l&&""!==l?b(l+""):null,d="number"==typeof e.revision&&Number.isFinite(e.revision)?e.revision:1,f="number"==typeof e.upvoteCount&&Number.isFinite(e.upvoteCount)?e.upvoteCount:0,p="string"==typeof e.updatedAt&&e.updatedAt.length>0?e.updatedAt:(new Date).toISOString(),m="string"==typeof e.createdAt&&e.createdAt.length>0?e.createdAt:(new Date).toISOString();return{id:e.id+"",githubIssueLink:i,type:e.type||"bug",status:e.status||"open",pinnedAt:e.pinnedAt?e.pinnedAt+"":null,revision:d,title:r,body:h,repository:{id:s.id+"",name:a,description:c},updatedAt:p,createdAt:m,upvoteCount:f,hasUpvoted:!!e.hasUpvoted}}validateUpvoteResponse(t){if(!t||"object"!=typeof t)throw new y("Invalid upvote response: expected object");const e=t;if("boolean"!=typeof e.upvoted)throw new y("Invalid upvote response: upvoted must be a boolean");if("number"!=typeof e.upvoteCount)throw new y("Invalid upvote response: upvoteCount must be a number");if("string"!=typeof e.anonymousUserId)throw new y("Invalid upvote response: anonymousUserId must be a string");return{upvoted:e.upvoted,upvoteCount:e.upvoteCount,anonymousUserId:e.anonymousUserId}}getEndpoint(){return this.endpoint}getTimeout(){return this.timeout}}const E=e(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.feedlogUpvote=i(this,"feedlogUpvote"),this.feedlogError=i(this,"feedlogError"),this.maxWidth="42rem",this.theme="light",this.issues=[],this.loading=!0,this.error=null,this.cursor=null,this.hasMore=!1,this.isLoadingMore=!1,this.sdk=null,this.fetchRequestId=0,this.isDisconnected=!1,this.upvoteRequestIds=new Map,this.handleUpvote=async t=>{if(!this.sdk||this.isDisconnected)return;const{issueId:e,currentUpvoted:s,currentCount:i}=t.detail,o=(this.upvoteRequestIds.get(e)||0)+1;this.upvoteRequestIds.set(e,o),this.issues=this.issues.map((t=>t.id===e?Object.assign(Object.assign({},t),{hasUpvoted:!s,upvoteCount:s?i-1:i+1}):t));try{const t=await this.sdk.toggleUpvote(e);if(this.isDisconnected||this.upvoteRequestIds.get(e)!==o)return;this.issues=this.issues.map((s=>s.id===e?Object.assign(Object.assign({},s),{hasUpvoted:t.upvoted,upvoteCount:t.upvoteCount}):s)),this.feedlogUpvote.emit({issueId:e,upvoted:t.upvoted,upvoteCount:t.upvoteCount})}catch(t){if(this.isDisconnected||this.upvoteRequestIds.get(e)!==o)return;this.issues=this.issues.map((t=>t.id===e?Object.assign(Object.assign({},t),{hasUpvoted:s,upvoteCount:i}):t)),this.feedlogError.emit({error:t instanceof Error?t.message:"Failed to toggle upvote"})}}}componentWillLoad(){if(this.previousType=this.type,this.previousLimit=this.limit,this.previousSortBy=this.sortBy,this.initializeSDK(),!(this.issues.length>0)||this.loading)return this.fetchIssues()}disconnectedCallback(){this.isDisconnected=!0,this.fetchRequestId++}componentDidUpdate(){(this.previousType!==this.type||this.previousLimit!==this.limit||this.previousSortBy!==this.sortBy)&&(this.fetchRequestId++,this.cursor=null,this.hasMore=!1,this.issues=[],this.fetchIssues().catch((()=>{})),this.previousType=this.type,this.previousLimit=this.limit,this.previousSortBy=this.sortBy)}initializeSDK(){try{if(!this.apiKey)throw Error("API key is required for the Feedlog SDK");this.sdk=new j(Object.assign({apiKey:this.apiKey},this.endpoint&&{endpoint:this.endpoint})),this.error=null}catch(t){const e=t instanceof Error?t.message:"Failed to initialize SDK";this.error=e,this.feedlogError.emit({error:e})}}buildFetchParams(){const t={};return this.type&&(t.type=this.type),this.sortBy&&(t.sortBy=this.sortBy),this.limit&&(t.limit=this.limit),this.cursor&&(t.cursor=this.cursor),t}async fetchIssues(){if(!this.sdk)return;const t=this.fetchRequestId;try{this.loading=!0,this.error=null;const e=this.buildFetchParams(),s=await this.sdk.fetchIssues(e);if(this.isDisconnected||t!==this.fetchRequestId)return;this.issues=s.issues,this.cursor=s.pagination.cursor,this.hasMore=s.pagination.hasMore}catch(e){if(this.isDisconnected||t!==this.fetchRequestId)return;const s=e instanceof Error?e.message:"Couldn't load updates";this.error=s,this.issues=[],this.feedlogError.emit({error:s,code:null==e?void 0:e.statusCode})}finally{this.isDisconnected||t!==this.fetchRequestId||(this.loading=!1,this.isLoadingMore=!1)}}async loadMore(){if(!this.sdk||!this.hasMore||this.isLoadingMore||this.loading)return;const t=this.fetchRequestId;this.isLoadingMore=!0;try{const e=this.buildFetchParams(),s=await this.sdk.fetchIssues(e);if(this.isDisconnected||t!==this.fetchRequestId)return;this.issues=[...this.issues,...s.issues],this.cursor=s.pagination.cursor,this.hasMore=s.pagination.hasMore}catch(e){if(this.isDisconnected||t!==this.fetchRequestId)return;this.feedlogError.emit({error:e instanceof Error?e.message:"Failed to load more issues",code:null==e?void 0:e.statusCode})}finally{this.isDisconnected||t!==this.fetchRequestId||(this.isLoadingMore=!1)}}render(){var t,e;const s=null===(e=null===(t=this.el)||void 0===t?void 0:t.style)||void 0===e?void 0:e.getPropertyValue("--feedlog-background");return o("feedlog-issues",{key:"4467ffabd5f18f9af6c8407622fb2554981b54bd",style:s?{"--feedlog-background":s}:void 0,issues:this.issues,limit:this.limit,maxWidth:this.maxWidth,theme:this.theme,heading:this.heading,subtitle:this.subtitle,emptyStateTitle:this.emptyStateTitle,emptyStateMessage:this.emptyStateMessage,getIssueUrl:this.getIssueUrl,loading:this.loading,error:this.error,hasMore:this.hasMore,isLoadingMore:this.isLoadingMore,onFeedlogUpvote:this.handleUpvote,onFeedlogLoadMore:async()=>this.loadMore()})}get el(){return this}},[1,"feedlog-issues-client",{apiKey:[1,"api-key"],type:[1],limit:[2],sortBy:[1,"sort-by"],endpoint:[1],maxWidth:[1,"max-width"],theme:[1],heading:[1],subtitle:[1],emptyStateTitle:[1,"empty-state-title"],emptyStateMessage:[1,"empty-state-message"],getIssueUrl:[16],issues:[32],loading:[32],error:[32],cursor:[32],hasMore:[32],isLoadingMore:[32]}]);function U(){"undefined"!=typeof customElements&&["feedlog-issues-client","feedlog-badge","feedlog-button","feedlog-issue","feedlog-issues","feedlog-issues-list"].forEach((e=>{switch(e){case"feedlog-issues-client":customElements.get(t(e))||customElements.define(t(e),E);break;case"feedlog-badge":customElements.get(t(e))||h();break;case"feedlog-button":customElements.get(t(e))||u();break;case"feedlog-issue":customElements.get(t(e))||n();break;case"feedlog-issues":customElements.get(t(e))||a();break;case"feedlog-issues-list":customElements.get(t(e))||l()}}))}U();const F=E,O=U;export{F as FeedlogIssuesClient,O as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as o,d as s}from"./p-
|
|
1
|
+
import{F as o,d as s}from"./p-DLNSSGDc.js";const p=o,r=s;export{p as FeedlogIssuesList,r as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as
|
|
1
|
+
import{F as o,d as s}from"./p-RVHxnHRU.js";const p=o,r=s;export{p as FeedlogIssues,r as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e,p as t,H as s,c as i,h as o,a as r}from"./index.js";import{d as a}from"./p-DzATWlAC.js";import{d as l}from"./p-
|
|
1
|
+
import{t as e,p as t,H as s,c as i,h as o,a as r}from"./index.js";import{d as a}from"./p-DzATWlAC.js";import{d as l}from"./p-TX_JzdfG.js";const n=t(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.feedlogUpvote=i(this,"feedlogUpvote"),this.issues=[],this.theme="light",this.currentPage=1,this.handleUpvote=e=>{e.stopPropagation(),this.feedlogUpvote.emit(e.detail)}}resetPage(){this.currentPage=1}renderEmptyStateIllustration(){return o("svg",{class:"empty-state-illustration",xmlns:"http://www.w3.org/2000/svg",width:"120",height:"96",viewBox:"0 0 120 96",fill:"none","aria-hidden":"true"},o("path",{d:"M20 36h80v44c0 4.4-3.6 8-8 8H28c-4.4 0-8-3.6-8-8V36z",fill:"var(--feedlog-empty-illustration-bg)",stroke:"var(--feedlog-empty-illustration-stroke)","stroke-width":"1.5","stroke-linejoin":"round"}),o("path",{d:"M20 36l20-24h40l20 24",fill:"none",stroke:"var(--feedlog-empty-illustration-stroke)","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),o("path",{d:"M44 52h32M44 60h24M44 68h28",stroke:"var(--feedlog-empty-illustration-muted)","stroke-width":"1.25","stroke-linecap":"round"}))}getVisibleIssues(){if(0===this.issues.length)return[];if(null==this.limit||this.issues.length<=this.limit)return this.issues;const e=(this.currentPage-1)*this.limit;return this.issues.slice(e,e+this.limit)}getPageNumbers(){if(null==this.limit)return[];const e=Math.ceil(this.issues.length/this.limit);if(e<=1)return[];const t=new Set([1,e]),s=Math.max(1,this.currentPage-1),i=Math.min(e,this.currentPage+1);for(let e=s;e<=i;e++)t.add(e);const o=Array.from(t).sort(((e,t)=>e-t)),r=[];for(let e=0;e<o.length;e++)e>0&&o[e]-o[e-1]>1&&r.push("ellipsis"),r.push(o[e]);return r}goToPage(e){const t=null!=this.limit?Math.ceil(this.issues.length/this.limit):1;this.currentPage=Math.max(1,Math.min(e,t))}renderPagination(){if(null==this.limit||this.issues.length<=this.limit)return null;const e=Math.ceil(this.issues.length/this.limit),t=this.getPageNumbers();return o("nav",{class:"pagination","aria-label":"Issues pagination"},o("button",{type:"button",class:"pagination-btn pagination-arrow","aria-label":"Previous page",disabled:this.currentPage<=1,onClick:()=>this.goToPage(this.currentPage-1)},"‹"),t.map(((e,t)=>"ellipsis"===e?o("span",{key:`ellipsis-${t}`,class:"pagination-ellipsis","aria-hidden":"true"},"…"):o("button",{key:`page-${e}`,type:"button",class:"pagination-btn","aria-current":e===this.currentPage?"page":void 0,onClick:()=>this.goToPage(e)},e))),o("button",{type:"button",class:"pagination-btn pagination-arrow","aria-label":"Next page",disabled:this.currentPage>=e,onClick:()=>this.goToPage(this.currentPage+1)},"›"))}render(){const e=this.getVisibleIssues();return o(r,{key:"7721ed64730cd8e6b508fc829767ea79b2531628",class:"dark"===this.theme?"dark":""},o("div",{key:"6a2d83f46ce2391294cef018ec243dd13d06a063",class:"issues-list"},0===e.length?o("div",{class:"empty-state"},this.emptyStateTitle&&this.emptyStateMessage?o("div",{class:"empty-state-content"},this.renderEmptyStateIllustration(),o("h2",{class:"empty-state-title"},this.emptyStateTitle),o("p",{class:"empty-state-message"},this.emptyStateMessage)):o("p",null,"No issues found")):e.map((e=>{var t,s;return o("feedlog-issue",{key:e.id,issue:e,issueUrl:null!==(s=null===(t=this.getIssueUrl)||void 0===t?void 0:t.call(this,e))&&void 0!==s?s:void 0,theme:this.theme,onFeedlogUpvote:e=>this.handleUpvote(e)})}))),this.renderPagination())}static get watchers(){return{issues:[{resetPage:0}],limit:[{resetPage:0}]}}static get style(){return":host{display:block;--feedlog-muted-foreground:#64748b;--feedlog-foreground:oklch(0.145 0 0);--feedlog-empty-illustration-bg:oklch(0.96 0.01 260);--feedlog-empty-illustration-stroke:oklch(0.75 0.02 260);--feedlog-empty-illustration-muted:oklch(0.82 0.01 260)}:host(.dark){--feedlog-muted-foreground:oklch(0.72 0.02 260);--feedlog-foreground:oklch(0.985 0 0);--feedlog-empty-illustration-bg:oklch(0.28 0.02 260);--feedlog-empty-illustration-stroke:oklch(0.45 0.02 260);--feedlog-empty-illustration-muted:oklch(0.38 0.01 260)}.issues-list{display:flex;flex-direction:column;gap:0.5rem}.empty-state{text-align:center;padding:3rem 1.5rem;color:var(--feedlog-muted-foreground);font-size:0.875rem}.empty-state-content{display:flex;flex-direction:column;align-items:center;text-align:center;max-width:20rem;margin-inline:auto}.empty-state-illustration{margin-bottom:1.5rem;opacity:0.9}.empty-state-title{margin:0 0 0.5rem 0;font-size:1.125rem;font-weight:600;color:var(--feedlog-foreground);line-height:1.4}.empty-state-message{margin:0;font-size:0.875rem;color:var(--feedlog-muted-foreground);line-height:1.5}.pagination{display:flex;align-items:center;justify-content:center;gap:0.25rem;margin-top:1.5rem;flex-wrap:wrap}.pagination-btn{min-width:2rem;height:2rem;padding:0 0.5rem;color:var(--feedlog-foreground);background:transparent;border:1px solid var(--feedlog-border, oklch(0.9 0 0));border-radius:var(--feedlog-radius, 0.375rem);font-size:0.875rem;font-weight:500;cursor:pointer;transition:background-color 0.15s, border-color 0.15s}.pagination-btn:hover:not(:disabled){background:var(--feedlog-muted, oklch(0.96 0 0))}.pagination-btn[aria-current='page']{background:var(--feedlog-accent-color, oklch(0.55 0.2 250));color:white;border-color:var(--feedlog-accent-color, oklch(0.55 0.2 250))}.pagination-btn:disabled{opacity:0.5;cursor:not-allowed}.pagination-arrow{font-size:1.25rem;line-height:1}.pagination-ellipsis{padding:0 0.25rem;color:var(--feedlog-muted-foreground);font-size:0.875rem}:host(.dark) .pagination-btn{border-color:oklch(0.4 0.02 260)}:host(.dark) .pagination-btn:hover:not(:disabled){background:oklch(0.35 0.02 260)}"}},[1,"feedlog-issues-list",{issues:[16],limit:[2],theme:[1],getIssueUrl:[16],emptyStateTitle:[1,"empty-state-title"],emptyStateMessage:[1,"empty-state-message"],currentPage:[32]},void 0,{issues:[{resetPage:0}],limit:[{resetPage:0}]}]);function d(){"undefined"!=typeof customElements&&["feedlog-issues-list","feedlog-badge","feedlog-issue"].forEach((t=>{switch(t){case"feedlog-issues-list":customElements.get(e(t))||customElements.define(e(t),n);break;case"feedlog-badge":customElements.get(e(t))||a();break;case"feedlog-issue":customElements.get(e(t))||l()}}))}d();export{n as F,d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e,p as o,H as t,c as s,h as i,a as r}from"./index.js";import{d
|
|
1
|
+
import{t as e,p as o,H as t,c as s,h as i,a as r}from"./index.js";import{d}from"./p-DzATWlAC.js";import{d as a}from"./p-DMdb-G26.js";import{d as l}from"./p-TX_JzdfG.js";import{d as n}from"./p-DLNSSGDc.js";const c=o(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.feedlogUpvote=s(this,"feedlogUpvote"),this.feedlogLoadMore=s(this,"feedlogLoadMore"),this.issues=[],this.maxWidth="42rem",this.theme="light",this.loading=!1,this.error=null,this.hasMore=!1,this.isLoadingMore=!1,this.handleUpvote=e=>{e.stopPropagation(),this.feedlogUpvote.emit(e.detail)},this.handleLoadMore=()=>{this.feedlogLoadMore.emit()}}renderErrorIcon(){return i("svg",{class:"error-icon",xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},i("circle",{cx:"12",cy:"12",r:"10"}),i("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),i("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"}))}renderIssuesList(){var e,o;return i("feedlog-issues-list",{issues:this.issues,limit:this.limit,theme:this.theme,getIssueUrl:this.getIssueUrl,emptyStateTitle:null!==(e=this.emptyStateTitle)&&void 0!==e?e:"No updates yet",emptyStateMessage:null!==(o=this.emptyStateMessage)&&void 0!==o?o:"Check back later for new updates.",onFeedlogUpvote:e=>this.handleUpvote(e)})}render(){return i(r,{key:"15ca787d3e5b45331a6582ea908b35b94b3a528c",class:"dark"===this.theme?"dark":""},i("div",{key:"79d655ca18778660f0156fbdec54764491eaac49",class:"issues-container",style:{maxWidth:this.maxWidth}},(this.heading||this.subtitle)&&i("header",{key:"e9e1b05451f55db894a1b6248dde4d9d90a96068",class:"issues-header"},i("div",{key:"b2921e777986f9c6afc3ba1cbf8023311c868b34",class:"header-content"},this.heading&&i("h1",{key:"e484da412ff1a92b876f3075489e60be273076b3",class:"issues-title"},this.heading),this.subtitle&&i("p",{key:"5030cbb2fdf2deab3681c1177a14e2b540d2ea33",class:"issues-subtitle"},this.subtitle))),this.loading&&i("div",{key:"f3fb2c02af4637832c518714f670ca2ae2624d49",class:"loading-state",role:"status","aria-label":"Loading issues"},i("div",{key:"14e60e4174d22dd2474677a7ec6365d053fe40e7",class:"loading-skeletons"},[1,2,3].map((e=>i("div",{key:e,class:"skeleton-card"},i("div",{class:"skeleton-content"},i("div",{class:"skeleton-header"},i("div",{class:"skeleton-badge"}),i("div",{class:"skeleton-timestamp"})),i("div",{class:"skeleton-main"},i("div",{class:"skeleton-title"}),i("div",{class:"skeleton-body"},i("div",{class:"skeleton-line"}),i("div",{class:"skeleton-line short"})),i("div",{class:"skeleton-repo"})),i("div",{class:"skeleton-footer"},i("div",{class:"skeleton-upvote"})))))))),this.error&&i("div",{key:"0c301ece57faeee2c6bbf2a4e346a88b6bc535cc",class:"error-state",role:"alert"},i("div",{key:"bab84dcbca74730ba44162c57baf65454ffb78c0",class:"error-state-content"},this.renderErrorIcon(),i("h2",{key:"247b25d17323d08ec9c527ebec1352600614f3be",class:"error-state-title"},"Something went wrong"),i("p",{key:"45501981e34a2a163e20724881945a0b75ef57d1",class:"error-state-message"},this.error))),!this.loading&&!this.error&&i("div",{key:"ca5a2697c898b61121c16a9d1f4320ad35a0bf84"},this.renderIssuesList(),this.hasMore&&i("div",{key:"1896d074714f083c3e171d0516d1d71155cbcd6a",class:"load-more-container"},i("feedlog-button",{key:"b34a2081a91b14e13aa4ace4d67b4d812f4a1d77",onFeedlogClick:this.handleLoadMore,disabled:this.isLoadingMore,variant:"outline"},this.isLoadingMore?"Loading...":"Load More Issues")))))}static get style(){return":host{display:block;font-family:ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;--feedlog-theme-bg:#ffffff;--feedlog-foreground:oklch(0.145 0 0);--feedlog-card:#ffffff;--feedlog-card-foreground:oklch(0.145 0 0);--feedlog-muted:#ececf0;--feedlog-muted-foreground:#717182;--feedlog-border:rgba(0, 0, 0, 0.1);--feedlog-accent-color:#2563eb;--feedlog-destructive:#d4183d;--feedlog-blue-400:oklch(0.707 0.165 254.624);--feedlog-blue-600:oklch(0.546 0.245 262.881);--feedlog-blue-100:oklch(0.932 0.032 255.585);--feedlog-red-100:#fce7f3;--feedlog-red-400:#f472b6;--feedlog-red-600:#db2777;--feedlog-radius:0.625rem;--feedlog-gap:0.5rem;--feedlog-padding:2rem;--feedlog-min-height:100%;--feedlog-shadow:0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.08)}:host(.dark){--feedlog-theme-bg:oklch(0.18 0.01 260);--feedlog-foreground:oklch(0.985 0 0);--feedlog-card:oklch(0.24 0.01 260);--feedlog-card-foreground:oklch(0.985 0 0);--feedlog-muted:oklch(0.32 0.01 260);--feedlog-muted-foreground:oklch(0.72 0.02 260);--feedlog-border:oklch(0.34 0.01 260);--feedlog-accent-color:#3b82f6;--feedlog-destructive:oklch(0.396 0.141 25.723);--feedlog-blue-400:oklch(0.707 0.165 254.624);--feedlog-blue-600:oklch(0.546 0.245 262.881);--feedlog-shadow:0 1px 3px 0 rgba(0, 0, 0, 0.3)}.issues-container{min-height:var(--feedlog-min-height);background-color:var(--feedlog-background, var(--feedlog-theme-bg, #ffffff));padding:var(--feedlog-padding);margin:0 auto;border-radius:var(--feedlog-radius)}.issues-header{margin-bottom:1.5rem;display:flex;align-items:flex-start;justify-content:space-between}.header-content{flex:1}.issues-title{color:var(--feedlog-foreground);margin:0 0 0.25rem 0;font-size:1.5rem;font-weight:500;line-height:1.5}.issues-subtitle{color:var(--feedlog-muted-foreground);font-size:0.875rem;margin:0}.loading-state{padding:0}.loading-skeletons{display:flex;flex-direction:column;gap:var(--feedlog-gap)}.skeleton-card{background-color:var(--feedlog-card);border:1px solid var(--feedlog-border);border-radius:var(--feedlog-radius);box-shadow:var(--feedlog-shadow);position:relative;overflow:hidden}.skeleton-card::before{content:'';position:absolute;left:0;top:0;bottom:0;width:3px;background:var(--feedlog-muted)}.skeleton-content{padding:1.25rem;padding-left:calc(1.25rem + 3px);display:flex;flex-direction:column;gap:0.875rem}.skeleton-header{display:flex;align-items:center;justify-content:space-between;gap:0.75rem}.skeleton-badge{width:4.5rem;height:1.25rem;border-radius:0.375rem;background-color:var(--feedlog-muted);animation:skeleton-pulse 1.5s ease-in-out infinite}.skeleton-timestamp{width:3rem;height:0.75rem;border-radius:0.25rem;background-color:var(--feedlog-muted);animation:skeleton-pulse 1.5s ease-in-out infinite 0.2s}.skeleton-main{display:flex;flex-direction:column;gap:0.5rem}.skeleton-title{height:0.9375rem;border-radius:0.25rem;background-color:var(--feedlog-muted);animation:skeleton-pulse 1.5s ease-in-out infinite 0.1s;width:85%}.skeleton-body{display:flex;flex-direction:column;gap:0.375rem}.skeleton-line{height:0.8125rem;border-radius:0.25rem;background-color:var(--feedlog-muted);animation:skeleton-pulse 1.5s ease-in-out infinite 0.15s;width:100%}.skeleton-line.short{width:70%}.skeleton-repo{width:6rem;height:0.75rem;border-radius:0.25rem;background-color:var(--feedlog-muted);animation:skeleton-pulse 1.5s ease-in-out infinite 0.25s}.skeleton-footer{display:flex;justify-content:flex-end}.skeleton-upvote{width:2.5rem;height:2rem;border-radius:0.5rem;background-color:var(--feedlog-muted);animation:skeleton-pulse 1.5s ease-in-out infinite 0.3s}@keyframes skeleton-pulse{0%,100%{opacity:1}50%{opacity:0.5}}.error-state{display:flex;align-items:center;justify-content:center;padding:3rem 2rem;min-height:12rem}.error-state-content{display:flex;flex-direction:column;align-items:center;text-align:center;max-width:20rem;padding:2rem}.error-icon{color:var(--feedlog-muted-foreground);opacity:0.8;margin-bottom:1rem}.error-state-title{margin:0 0 0.5rem 0;font-size:1.125rem;font-weight:600;color:var(--feedlog-foreground);line-height:1.4}.error-state-message{margin:0 0 1.25rem 0;font-size:0.875rem;color:var(--feedlog-muted-foreground);line-height:1.5}.load-more-container{display:flex;justify-content:center;padding:2rem 0;gap:1rem}"}},[1,"feedlog-issues",{issues:[16],maxWidth:[1,"max-width"],limit:[2],theme:[1025],heading:[1],subtitle:[1],emptyStateTitle:[1,"empty-state-title"],emptyStateMessage:[1,"empty-state-message"],loading:[4],error:[1],hasMore:[4,"has-more"],isLoadingMore:[4,"is-loading-more"],getIssueUrl:[16]}]);function f(){"undefined"!=typeof customElements&&["feedlog-issues","feedlog-badge","feedlog-button","feedlog-issue","feedlog-issues-list"].forEach((o=>{switch(o){case"feedlog-issues":customElements.get(e(o))||customElements.define(e(o),c);break;case"feedlog-badge":customElements.get(e(o))||d();break;case"feedlog-button":customElements.get(e(o))||a();break;case"feedlog-issue":customElements.get(e(o))||l();break;case"feedlog-issues-list":customElements.get(e(o))||n()}}))}f();export{c as F,f as d}
|