@feedlog-ai/webcomponents 0.0.12 → 0.0.14
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-badge.cjs.entry.js +1 -1
- package/dist/cjs/feedlog-button_2.cjs.entry.js +4 -8
- package/dist/cjs/feedlog-card.cjs.entry.js +1 -1
- package/dist/cjs/feedlog-github-issues-client.cjs.entry.js +1 -1
- package/dist/cjs/feedlog-github-issues.cjs.entry.js +1 -1
- package/dist/cjs/feedlog-issues-list.cjs.entry.js +4 -8
- package/dist/cjs/feedlog-toolkit.cjs.js +1 -1
- package/dist/cjs/{index-DnsqTPII.js → index-5lluu_3h.js} +37 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/feedlog-issue/feedlog-issue.js +3 -7
- package/dist/collection/components/feedlog-issues-list/feedlog-issues-list.js +3 -7
- package/dist/components/feedlog-github-issues-client.js +1 -1
- package/dist/components/feedlog-github-issues.js +1 -1
- package/dist/components/feedlog-issue.js +1 -1
- package/dist/components/feedlog-issues-list.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{p-BxyIMDYk.js → p-BBQ4xWrx.js} +1 -1
- package/dist/components/p-CJZ3rL6v.js +1 -0
- package/dist/esm/feedlog-badge.entry.js +1 -1
- package/dist/esm/feedlog-button_2.entry.js +4 -8
- package/dist/esm/feedlog-card.entry.js +1 -1
- package/dist/esm/feedlog-github-issues-client.entry.js +1 -1
- package/dist/esm/feedlog-github-issues.entry.js +1 -1
- package/dist/esm/feedlog-issues-list.entry.js +4 -8
- package/dist/esm/feedlog-toolkit.js +2 -2
- package/dist/esm/{index-rs_66Oq4.js → index-CkB6Yzeb.js} +37 -0
- package/dist/esm/loader.js +2 -2
- package/dist/feedlog-toolkit/feedlog-toolkit.esm.js +1 -1
- package/dist/feedlog-toolkit/p-52ec57f8.entry.js +1 -0
- package/dist/feedlog-toolkit/{p-50a467a3.entry.js → p-5df44120.entry.js} +1 -1
- package/dist/feedlog-toolkit/{p-f5626239.entry.js → p-767ecb94.entry.js} +1 -1
- package/dist/feedlog-toolkit/{p-774e08fd.entry.js → p-95fea2f4.entry.js} +1 -1
- package/dist/feedlog-toolkit/p-CkB6Yzeb.js +2 -0
- package/dist/feedlog-toolkit/p-c19a4d1b.entry.js +1 -0
- package/dist/feedlog-toolkit/{p-4e90285c.entry.js → p-cdb2b098.entry.js} +1 -1
- package/package.json +4 -4
- package/dist/components/p-BLmN8b4F.js +0 -1
- package/dist/feedlog-toolkit/p-1ff506c3.entry.js +0 -1
- package/dist/feedlog-toolkit/p-40ff5447.entry.js +0 -1
- package/dist/feedlog-toolkit/p-rs_66Oq4.js +0 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-5lluu_3h.js');
|
|
4
4
|
|
|
5
5
|
const feedlogBadgeCss = () => `:host{display:inline-block;--feedlog-badge-font-size:0.75rem;--feedlog-badge-font-weight:500;--feedlog-badge-padding-x:0.5rem;--feedlog-badge-padding-y:0.125rem;--feedlog-badge-border-radius:calc(0.625rem - 2px);--feedlog-blue-500:oklch(0.623 0.214 259.815);--feedlog-blue-600:oklch(0.546 0.245 262.881);--feedlog-blue-700:oklch(0.488 0.243 264.376);--feedlog-destructive:#d4183d;--feedlog-destructive-hover:#b91c1c}:host(.dark){--feedlog-blue-500:oklch(0.623 0.214 259.815);--feedlog-blue-600:oklch(0.546 0.245 262.881);--feedlog-destructive:oklch(0.396 0.141 25.723);--feedlog-destructive-hover:oklch(0.45 0.16 25.723)}.badge{display:inline-flex;align-items:center;justify-content:center;font-size:var(--feedlog-badge-font-size);font-weight:var(--feedlog-badge-font-weight);padding:var(--feedlog-badge-padding-y) var(--feedlog-badge-padding-x);border-radius:var(--feedlog-badge-border-radius);white-space:nowrap;transition:background-color 0.15s ease;font-family:inherit}.badge-default{background-color:var(--feedlog-blue-600);color:#ffffff}.badge-default:hover{background-color:var(--feedlog-blue-700)}:host(.dark) .badge-default{background-color:var(--feedlog-blue-500)}:host(.dark) .badge-default:hover{background-color:var(--feedlog-blue-600)}.badge-enhancement{background-color:var(--feedlog-blue-600);color:#ffffff}.badge-enhancement:hover{background-color:var(--feedlog-blue-700)}:host(.dark) .badge-enhancement{background-color:var(--feedlog-blue-500)}:host(.dark) .badge-enhancement:hover{background-color:var(--feedlog-blue-600)}.badge-destructive{background-color:var(--feedlog-destructive);color:#ffffff}.badge-destructive:hover{background-color:var(--feedlog-destructive-hover)}`;
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-5lluu_3h.js');
|
|
4
4
|
|
|
5
5
|
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}`;
|
|
6
6
|
|
|
@@ -40,13 +40,9 @@ FeedlogButton.style = feedlogButtonCss();
|
|
|
40
40
|
const feedlogIssueCss = () => `:host{display: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-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}:host(.dark){--feedlog-background:oklch(0.145 0 0);--feedlog-foreground:oklch(0.985 0 0);--feedlog-card:oklch(0.145 0 0);--feedlog-card-foreground:oklch(0.985 0 0);--feedlog-muted:oklch(0.269 0 0);--feedlog-muted-foreground:oklch(0.708 0 0);--feedlog-border:oklch(0.269 0 0);--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-blue-900-30:color-mix(in oklab, oklch(0.379 0.146 265.522) 30%, transparent);--feedlog-red-900-30:color-mix(in oklab, oklch(0.396 0.141 25.723) 30%, transparent)}.issue-card{background-color:var(--feedlog-card);border:1px solid var(--feedlog-border);border-radius:var(--feedlog-radius);box-shadow:0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);transition:box-shadow 0.15s ease;position:relative}.issue-card:hover{box-shadow:0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)}.issue-content{padding:1.5rem;display:flex;flex-direction:column;gap:1rem}.issue-header{display:flex;align-items:center;gap:0.5rem;justify-content:space-between}.issue-type-badge{width:fit-content}.pinned-indicator{font-size:1rem;opacity:0.7}.issue-main{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem}.issue-details{flex:1;min-width:0}.issue-title{color:var(--feedlog-card-foreground);font-size:0.875rem;font-weight:600;margin:0 0 0.375rem 0;line-height:1.4;word-break:break-word}.issue-body{color:var(--feedlog-muted-foreground);font-size:0.75rem;line-height:1.625;margin:0 0 0.75rem 0;word-break:break-word;white-space:pre-wrap}.issue-repository{display:flex;align-items:center;gap:0.5rem;font-size:0.75rem;color:var(--feedlog-muted-foreground);margin-bottom:0.5rem}.repo-name{font-weight:500}.github-number{color:var(--feedlog-blue-600);font-weight:600}:host(.dark) .github-number{color:var(--feedlog-blue-400)}.upvote-button{display:flex;flex-direction:column;align-items:center;gap:0.125rem;padding:0.5rem 0.75rem;border-radius:0.5rem;background-color:var(--feedlog-muted);border:1px solid transparent;cursor:pointer;transition:all 0.15s ease;flex-shrink:0;font-size:0.75rem;font-weight:600}.upvote-button:hover{background-color:var(--feedlog-blue-100);border-color:var(--feedlog-blue-400)}.upvote-button.upvoted{background-color:var(--feedlog-red-100);border-color:var(--feedlog-red-400)}.upvote-button.upvoted:hover{background-color:var(--feedlog-red-100);border-color:var(--feedlog-red-600)}:host(.dark) .upvote-button:hover{background-color:var(--feedlog-blue-900-30);border-color:var(--feedlog-blue-600)}:host(.dark) .upvote-button.upvoted{background-color:var(--feedlog-red-900-30);border-color:var(--feedlog-red-600)}.upvote-icon{width:1rem;height:1rem;stroke-width:2}.upvote-icon.filled{color:var(--feedlog-red-600)}.upvote-icon.outline{color:var(--feedlog-blue-600)}:host(.dark) .upvote-icon.outline{color:var(--feedlog-blue-400)}.upvote-count{font-size:0.75rem;font-weight:600;color:var(--feedlog-card-foreground)}.issue-footer{display:flex;flex-direction:column;gap:0.25rem;font-size:0.75rem}.issue-date{color:var(--feedlog-muted-foreground);cursor:help}`;
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
|
-
* Heart icon SVG component
|
|
43
|
+
* Heart icon SVG component - renders filled or outline based on prop
|
|
44
44
|
*/
|
|
45
|
-
const
|
|
46
|
-
/**
|
|
47
|
-
* Heart icon SVG component (outline)
|
|
48
|
-
*/
|
|
49
|
-
const HeartOutlineIcon = () => (index.h("svg", { class: "upvote-icon outline", xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, index.h("path", { d: "M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z" })));
|
|
45
|
+
const HeartIcon = ({ filled }) => (index.h("svg", { class: `upvote-icon ${filled ? 'filled' : 'outline'}`, xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: filled ? 'currentColor' : 'none', stroke: filled ? 'none' : 'currentColor', "stroke-width": filled ? undefined : '2', "stroke-linecap": filled ? undefined : 'round', "stroke-linejoin": filled ? undefined : 'round' }, index.h("path", { d: "M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z" })));
|
|
50
46
|
const FeedlogIssueComponent = class {
|
|
51
47
|
constructor(hostRef) {
|
|
52
48
|
index.registerInstance(this, hostRef);
|
|
@@ -92,7 +88,7 @@ const FeedlogIssueComponent = class {
|
|
|
92
88
|
const { issue } = this;
|
|
93
89
|
if (!issue)
|
|
94
90
|
return null;
|
|
95
|
-
return (index.h(index.Host, { class: this.theme === 'dark' ? 'dark' : '' }, index.h("div", { class: "issue-card" }, index.h("div", { class: "issue-content" }, index.h("div", { class: "issue-header" }, index.h("div", { class: "issue-type-badge" }, issue.type === 'bug' ? (index.h("feedlog-badge", { variant: "destructive" }, "Bug")) : (index.h("feedlog-badge", { variant: "enhancement" }, "Enhancement"))), issue.pinnedAt && (index.h("div", { class: "pinned-indicator", title: "Pinned issue" }, "\uD83D\uDCCC"))), index.h("div", { class: "issue-main" }, index.h("div", { class: "issue-details" }, index.h("h3", { class: "issue-title" }, issue.title), index.h("p", { class: "issue-body" }, issue.body), index.h("div", { class: "issue-repository" }, index.h("span", { class: "repo-name" }, issue.repository.owner, "/", issue.repository.name))), issue.type !== 'bug' && (index.h("button", { class: `upvote-button ${issue.hasUpvoted ? 'upvoted' : ''}`, onClick: (e) => this.handleUpvote(e), title: issue.hasUpvoted ? 'Remove upvote' : 'Upvote this issue' },
|
|
91
|
+
return (index.h(index.Host, { class: this.theme === 'dark' ? 'dark' : '' }, index.h("div", { class: "issue-card" }, index.h("div", { class: "issue-content" }, index.h("div", { class: "issue-header" }, index.h("div", { class: "issue-type-badge" }, issue.type === 'bug' ? (index.h("feedlog-badge", { variant: "destructive" }, "Bug")) : (index.h("feedlog-badge", { variant: "enhancement" }, "Enhancement"))), issue.pinnedAt && (index.h("div", { class: "pinned-indicator", title: "Pinned issue" }, "\uD83D\uDCCC"))), index.h("div", { class: "issue-main" }, index.h("div", { class: "issue-details" }, index.h("h3", { class: "issue-title" }, issue.title), index.h("p", { class: "issue-body" }, issue.body), index.h("div", { class: "issue-repository" }, index.h("span", { class: "repo-name" }, issue.repository.owner, "/", issue.repository.name))), issue.type !== 'bug' && (index.h("button", { class: `upvote-button ${issue.hasUpvoted ? 'upvoted' : ''}`, onClick: (e) => this.handleUpvote(e), title: issue.hasUpvoted ? 'Remove upvote' : 'Upvote this issue' }, index.h(HeartIcon, { filled: issue.hasUpvoted }), index.h("span", { class: "upvote-count" }, issue.upvoteCount)))), index.h("div", { class: "issue-footer" }, index.h("span", { class: "issue-date", title: `Updated: ${issue.updatedAt}` }, "Updated ", this.formatDate(issue.updatedAt)), index.h("span", { class: "issue-date", title: `Created: ${issue.createdAt}` }, "Created ", this.formatDate(issue.createdAt)))))));
|
|
96
92
|
}
|
|
97
93
|
};
|
|
98
94
|
FeedlogIssueComponent.style = feedlogIssueCss();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-5lluu_3h.js');
|
|
4
4
|
|
|
5
5
|
const feedlogCardCss = () => `:host{display:block;font-family:ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;--feedlog-card:#ffffff;--feedlog-card-foreground:oklch(0.145 0 0);--feedlog-border:rgba(0, 0, 0, 0.1);--feedlog-radius:0.625rem;--feedlog-card-shadow:0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);--feedlog-card-hover-shadow:0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)}:host(.dark){--feedlog-card:oklch(0.145 0 0);--feedlog-card-foreground:oklch(0.985 0 0);--feedlog-border:oklch(0.269 0 0);--feedlog-card-shadow:0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);--feedlog-card-hover-shadow:0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3)}.feedlog-card{background-color:var(--feedlog-card);color:var(--feedlog-card-foreground);border:1px solid var(--feedlog-border);border-radius:var(--feedlog-radius);box-shadow:var(--feedlog-card-shadow);transition:box-shadow 0.15s ease;position:relative}.feedlog-card:hover{box-shadow:var(--feedlog-card-hover-shadow)}::slotted([slot="header"]){display:block}::slotted([slot="content"]){display:block}::slotted([slot="footer"]){display:block}`;
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-5lluu_3h.js');
|
|
4
4
|
|
|
5
5
|
const feedlogGithubIssuesCss = () => `:host{display: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-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}:host(.dark){--feedlog-background:oklch(0.145 0 0);--feedlog-foreground:oklch(0.985 0 0);--feedlog-card:oklch(0.145 0 0);--feedlog-card-foreground:oklch(0.985 0 0);--feedlog-muted:oklch(0.269 0 0);--feedlog-muted-foreground:oklch(0.708 0 0);--feedlog-border:oklch(0.269 0 0);--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-blue-900-30:color-mix(in oklab, oklch(0.379 0.146 265.522) 30%, transparent);--feedlog-red-900-30:color-mix(in oklab, oklch(0.396 0.141 25.723) 30%, transparent)}.github-issues-container{min-height:100vh;background-color:var(--feedlog-background);padding:var(--feedlog-padding);margin:0 auto}.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,.error-state{padding:2rem;text-align:center;color:var(--feedlog-muted-foreground)}.error-state{color:var(--feedlog-destructive)}.issues-list{display:flex;flex-direction:column;gap:var(--feedlog-gap)}.empty-state{text-align:center;padding:3rem 1.5rem;color:var(--feedlog-muted-foreground);font-size:0.875rem}.load-more-container{display:flex;justify-content:center;padding:2rem 0;gap:1rem}`;
|
|
6
6
|
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-5lluu_3h.js');
|
|
4
4
|
|
|
5
5
|
const feedlogIssuesListCss = () => `:host{display: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-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}:host(.dark){--feedlog-background:oklch(0.145 0 0);--feedlog-foreground:oklch(0.985 0 0);--feedlog-card:oklch(0.145 0 0);--feedlog-card-foreground:oklch(0.985 0 0);--feedlog-muted:oklch(0.269 0 0);--feedlog-muted-foreground:oklch(0.708 0 0);--feedlog-border:oklch(0.269 0 0);--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-blue-900-30:color-mix(in oklab, oklch(0.379 0.146 265.522) 30%, transparent);--feedlog-red-900-30:color-mix(in oklab, oklch(0.396 0.141 25.723) 30%, transparent)}.issues-list{display:flex;flex-direction:column;gap:var(--feedlog-gap)}.empty-state{text-align:center;padding:3rem 1.5rem;color:var(--feedlog-muted-foreground);font-size:0.875rem}.issue-card{background-color:var(--feedlog-card);border:1px solid var(--feedlog-border);border-radius:var(--feedlog-radius);box-shadow:0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);transition:box-shadow 0.15s ease;position:relative}.issue-card:hover{box-shadow:0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)}.issue-content{padding:1.5rem;display:flex;flex-direction:column;gap:1rem}.issue-header{display:flex;align-items:center;gap:0.5rem;justify-content:space-between}.issue-type-badge{width:fit-content}.pinned-indicator{font-size:1rem;opacity:0.7}.issue-main{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem}.issue-details{flex:1;min-width:0}.issue-title{margin:0 0 0.5rem 0;font-size:1rem;font-weight:600;color:var(--feedlog-card-foreground);line-height:1.5;word-wrap:break-word}.issue-body{margin:0 0 0.75rem 0;font-size:0.875rem;color:var(--feedlog-muted-foreground);line-height:1.5;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;word-wrap:break-word}.issue-repository{display:flex;align-items:center;gap:0.5rem;font-size:0.75rem;color:var(--feedlog-muted-foreground)}.repo-name{font-weight:500}.github-number{background-color:var(--feedlog-muted);padding:0.125rem 0.375rem;border-radius:0.25rem;font-family:ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace}.upvote-button{display:flex;align-items:center;gap:0.375rem;padding:0.5rem 0.75rem;background-color:var(--feedlog-muted);border:1px solid var(--feedlog-border);border-radius:var(--feedlog-radius);color:var(--feedlog-muted-foreground);font-size:0.875rem;font-weight:500;cursor:pointer;transition:all 0.15s ease;white-space:nowrap}.upvote-button:hover{background-color:var(--feedlog-accent-color);color:white}.upvote-button.upvoted{background-color:var(--feedlog-destructive);color:white;border-color:var(--feedlog-destructive)}.upvote-button.upvoted:hover{background-color:var(--feedlog-red-600);border-color:var(--feedlog-red-600)}.upvote-icon{width:1rem;height:1rem;flex-shrink:0}.upvote-icon.filled{color:currentColor}.upvote-icon.outline{stroke:currentColor}.upvote-count{font-variant-numeric:tabular-nums}.issue-footer{display:flex;align-items:center;gap:1rem;font-size:0.75rem;color:var(--feedlog-muted-foreground)}.issue-date{white-space:nowrap}@media (max-width: 640px){.issue-content{padding:1rem;gap:0.75rem}.issue-main{flex-direction:column;align-items:stretch;gap:0.75rem}.upvote-button{align-self:flex-start}.issue-footer{flex-direction:column;align-items:flex-start;gap:0.25rem}}`;
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* Heart icon SVG component
|
|
8
|
+
* Heart icon SVG component - renders filled or outline based on prop
|
|
9
9
|
*/
|
|
10
|
-
const
|
|
11
|
-
/**
|
|
12
|
-
* Heart icon SVG component (outline)
|
|
13
|
-
*/
|
|
14
|
-
const HeartOutlineIcon = () => (index.h("svg", { class: "upvote-icon outline", xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, index.h("path", { d: "M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z" })));
|
|
10
|
+
const HeartIcon = ({ filled }) => (index.h("svg", { class: `upvote-icon ${filled ? 'filled' : 'outline'}`, xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: filled ? 'currentColor' : 'none', stroke: filled ? 'none' : 'currentColor', "stroke-width": filled ? undefined : '2', "stroke-linecap": filled ? undefined : 'round', "stroke-linejoin": filled ? undefined : 'round' }, index.h("path", { d: "M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z" })));
|
|
15
11
|
const FeedlogIssuesList = class {
|
|
16
12
|
constructor(hostRef) {
|
|
17
13
|
index.registerInstance(this, hostRef);
|
|
@@ -58,7 +54,7 @@ const FeedlogIssuesList = class {
|
|
|
58
54
|
}
|
|
59
55
|
}
|
|
60
56
|
render() {
|
|
61
|
-
return (index.h(index.Host, { key: '
|
|
57
|
+
return (index.h(index.Host, { key: 'ca131697a47a0e062454d7ec3b8b29d112d50e4b', class: this.theme === 'dark' ? 'dark' : '' }, index.h("div", { key: 'e5738dadb712834eedb6a1508c1049e8ae5328f7', class: "issues-list" }, this.issues.length === 0 ? (index.h("div", { class: "empty-state" }, index.h("p", null, "No issues found"))) : (this.issues.map(issue => (index.h("div", { key: issue.id, class: "issue-card" }, index.h("div", { class: "issue-content" }, index.h("div", { class: "issue-header" }, index.h("div", { class: "issue-type-badge" }, issue.type === 'bug' ? (index.h("feedlog-badge", { variant: "destructive" }, "Bug")) : (index.h("feedlog-badge", { variant: "enhancement" }, "Enhancement"))), issue.pinnedAt && (index.h("div", { class: "pinned-indicator", title: "Pinned issue" }, "\uD83D\uDCCC"))), index.h("div", { class: "issue-main" }, index.h("div", { class: "issue-details" }, index.h("h3", { class: "issue-title" }, issue.title), index.h("p", { class: "issue-body" }, issue.body), index.h("div", { class: "issue-repository" }, index.h("span", { class: "repo-name" }, issue.repository.owner, "/", issue.repository.name))), index.h("button", { class: `upvote-button ${issue.hasUpvoted ? 'upvoted' : ''}`, onClick: e => this.handleUpvote(e, issue), title: issue.hasUpvoted ? 'Remove upvote' : 'Upvote this issue' }, index.h(HeartIcon, { filled: issue.hasUpvoted }), index.h("span", { class: "upvote-count" }, issue.upvoteCount))), index.h("div", { class: "issue-footer" }, index.h("span", { class: "issue-date", title: `Updated: ${issue.updatedAt}` }, "Updated ", this.formatDate(issue.updatedAt)), index.h("span", { class: "issue-date", title: `Created: ${issue.createdAt}` }, "Created ", this.formatDate(issue.createdAt)))))))))));
|
|
62
58
|
}
|
|
63
59
|
};
|
|
64
60
|
FeedlogIssuesList.style = feedlogIssuesListCss();
|
|
@@ -2042,6 +2042,13 @@ var h = (nodeName, vnodeData, ...children) => {
|
|
|
2042
2042
|
}
|
|
2043
2043
|
}
|
|
2044
2044
|
}
|
|
2045
|
+
if (typeof nodeName === "function") {
|
|
2046
|
+
return nodeName(
|
|
2047
|
+
vnodeData === null ? {} : vnodeData,
|
|
2048
|
+
vNodeChildren,
|
|
2049
|
+
vdomFnUtils
|
|
2050
|
+
);
|
|
2051
|
+
}
|
|
2045
2052
|
const vnode = newVNode(nodeName, null);
|
|
2046
2053
|
vnode.$attrs$ = vnodeData;
|
|
2047
2054
|
if (vNodeChildren.length > 0) {
|
|
@@ -2070,6 +2077,36 @@ var newVNode = (tag, text) => {
|
|
|
2070
2077
|
};
|
|
2071
2078
|
var Host = {};
|
|
2072
2079
|
var isHost = (node) => node && node.$tag$ === Host;
|
|
2080
|
+
var vdomFnUtils = {
|
|
2081
|
+
forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
|
|
2082
|
+
map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate)
|
|
2083
|
+
};
|
|
2084
|
+
var convertToPublic = (node) => ({
|
|
2085
|
+
vattrs: node.$attrs$,
|
|
2086
|
+
vchildren: node.$children$,
|
|
2087
|
+
vkey: node.$key$,
|
|
2088
|
+
vname: node.$name$,
|
|
2089
|
+
vtag: node.$tag$,
|
|
2090
|
+
vtext: node.$text$
|
|
2091
|
+
});
|
|
2092
|
+
var convertToPrivate = (node) => {
|
|
2093
|
+
if (typeof node.vtag === "function") {
|
|
2094
|
+
const vnodeData = { ...node.vattrs };
|
|
2095
|
+
if (node.vkey) {
|
|
2096
|
+
vnodeData.key = node.vkey;
|
|
2097
|
+
}
|
|
2098
|
+
if (node.vname) {
|
|
2099
|
+
vnodeData.name = node.vname;
|
|
2100
|
+
}
|
|
2101
|
+
return h(node.vtag, vnodeData, ...node.vchildren || []);
|
|
2102
|
+
}
|
|
2103
|
+
const vnode = newVNode(node.vtag, node.vtext);
|
|
2104
|
+
vnode.$attrs$ = node.vattrs;
|
|
2105
|
+
vnode.$children$ = node.vchildren;
|
|
2106
|
+
vnode.$key$ = node.vkey;
|
|
2107
|
+
vnode.$name$ = node.vname;
|
|
2108
|
+
return vnode;
|
|
2109
|
+
};
|
|
2073
2110
|
var createSupportsRuleRe = (selector) => {
|
|
2074
2111
|
const safeSelector2 = escapeRegExpSpecialCharacters(selector);
|
|
2075
2112
|
return new RegExp(
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
/**
|
|
3
|
-
* Heart icon SVG component
|
|
3
|
+
* Heart icon SVG component - renders filled or outline based on prop
|
|
4
4
|
*/
|
|
5
|
-
const
|
|
6
|
-
/**
|
|
7
|
-
* Heart icon SVG component (outline)
|
|
8
|
-
*/
|
|
9
|
-
const HeartOutlineIcon = () => (h("svg", { class: "upvote-icon outline", xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("path", { d: "M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z" })));
|
|
5
|
+
const HeartIcon = ({ filled }) => (h("svg", { class: `upvote-icon ${filled ? 'filled' : 'outline'}`, xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: filled ? 'currentColor' : 'none', stroke: filled ? 'none' : 'currentColor', "stroke-width": filled ? undefined : '2', "stroke-linecap": filled ? undefined : 'round', "stroke-linejoin": filled ? undefined : 'round' }, h("path", { d: "M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z" })));
|
|
10
6
|
/**
|
|
11
7
|
* Feedlog Issue Component
|
|
12
8
|
*
|
|
@@ -55,7 +51,7 @@ export class FeedlogIssueComponent {
|
|
|
55
51
|
const { issue } = this;
|
|
56
52
|
if (!issue)
|
|
57
53
|
return null;
|
|
58
|
-
return (h(Host, { class: this.theme === 'dark' ? 'dark' : '' }, h("div", { class: "issue-card" }, h("div", { class: "issue-content" }, h("div", { class: "issue-header" }, h("div", { class: "issue-type-badge" }, issue.type === 'bug' ? (h("feedlog-badge", { variant: "destructive" }, "Bug")) : (h("feedlog-badge", { variant: "enhancement" }, "Enhancement"))), issue.pinnedAt && (h("div", { class: "pinned-indicator", title: "Pinned issue" }, "\uD83D\uDCCC"))), h("div", { class: "issue-main" }, h("div", { class: "issue-details" }, h("h3", { class: "issue-title" }, issue.title), h("p", { class: "issue-body" }, issue.body), h("div", { class: "issue-repository" }, h("span", { class: "repo-name" }, issue.repository.owner, "/", issue.repository.name))), issue.type !== 'bug' && (h("button", { class: `upvote-button ${issue.hasUpvoted ? 'upvoted' : ''}`, onClick: (e) => this.handleUpvote(e), title: issue.hasUpvoted ? 'Remove upvote' : 'Upvote this issue' }, issue.hasUpvoted
|
|
54
|
+
return (h(Host, { class: this.theme === 'dark' ? 'dark' : '' }, h("div", { class: "issue-card" }, h("div", { class: "issue-content" }, h("div", { class: "issue-header" }, h("div", { class: "issue-type-badge" }, issue.type === 'bug' ? (h("feedlog-badge", { variant: "destructive" }, "Bug")) : (h("feedlog-badge", { variant: "enhancement" }, "Enhancement"))), issue.pinnedAt && (h("div", { class: "pinned-indicator", title: "Pinned issue" }, "\uD83D\uDCCC"))), h("div", { class: "issue-main" }, h("div", { class: "issue-details" }, h("h3", { class: "issue-title" }, issue.title), h("p", { class: "issue-body" }, issue.body), h("div", { class: "issue-repository" }, h("span", { class: "repo-name" }, issue.repository.owner, "/", issue.repository.name))), issue.type !== 'bug' && (h("button", { class: `upvote-button ${issue.hasUpvoted ? 'upvoted' : ''}`, onClick: (e) => this.handleUpvote(e), title: issue.hasUpvoted ? 'Remove upvote' : 'Upvote this issue' }, h(HeartIcon, { filled: issue.hasUpvoted }), h("span", { class: "upvote-count" }, issue.upvoteCount)))), h("div", { class: "issue-footer" }, h("span", { class: "issue-date", title: `Updated: ${issue.updatedAt}` }, "Updated ", this.formatDate(issue.updatedAt)), h("span", { class: "issue-date", title: `Created: ${issue.createdAt}` }, "Created ", this.formatDate(issue.createdAt)))))));
|
|
59
55
|
}
|
|
60
56
|
static get is() { return "feedlog-issue"; }
|
|
61
57
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
/**
|
|
3
|
-
* Heart icon SVG component
|
|
3
|
+
* Heart icon SVG component - renders filled or outline based on prop
|
|
4
4
|
*/
|
|
5
|
-
const
|
|
6
|
-
/**
|
|
7
|
-
* Heart icon SVG component (outline)
|
|
8
|
-
*/
|
|
9
|
-
const HeartOutlineIcon = () => (h("svg", { class: "upvote-icon outline", xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("path", { d: "M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z" })));
|
|
5
|
+
const HeartIcon = ({ filled }) => (h("svg", { class: `upvote-icon ${filled ? 'filled' : 'outline'}`, xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: filled ? 'currentColor' : 'none', stroke: filled ? 'none' : 'currentColor', "stroke-width": filled ? undefined : '2', "stroke-linecap": filled ? undefined : 'round', "stroke-linejoin": filled ? undefined : 'round' }, h("path", { d: "M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z" })));
|
|
10
6
|
/**
|
|
11
7
|
* Feedlog Issues List Component
|
|
12
8
|
*
|
|
@@ -56,7 +52,7 @@ export class FeedlogIssuesList {
|
|
|
56
52
|
}
|
|
57
53
|
}
|
|
58
54
|
render() {
|
|
59
|
-
return (h(Host, { key: '
|
|
55
|
+
return (h(Host, { key: 'ca131697a47a0e062454d7ec3b8b29d112d50e4b', class: this.theme === 'dark' ? 'dark' : '' }, h("div", { key: 'e5738dadb712834eedb6a1508c1049e8ae5328f7', class: "issues-list" }, this.issues.length === 0 ? (h("div", { class: "empty-state" }, h("p", null, "No issues found"))) : (this.issues.map(issue => (h("div", { key: issue.id, class: "issue-card" }, h("div", { class: "issue-content" }, h("div", { class: "issue-header" }, h("div", { class: "issue-type-badge" }, issue.type === 'bug' ? (h("feedlog-badge", { variant: "destructive" }, "Bug")) : (h("feedlog-badge", { variant: "enhancement" }, "Enhancement"))), issue.pinnedAt && (h("div", { class: "pinned-indicator", title: "Pinned issue" }, "\uD83D\uDCCC"))), h("div", { class: "issue-main" }, h("div", { class: "issue-details" }, h("h3", { class: "issue-title" }, issue.title), h("p", { class: "issue-body" }, issue.body), h("div", { class: "issue-repository" }, h("span", { class: "repo-name" }, issue.repository.owner, "/", issue.repository.name))), h("button", { class: `upvote-button ${issue.hasUpvoted ? 'upvoted' : ''}`, onClick: e => this.handleUpvote(e, issue), title: issue.hasUpvoted ? 'Remove upvote' : 'Upvote this issue' }, h(HeartIcon, { filled: issue.hasUpvoted }), h("span", { class: "upvote-count" }, issue.upvoteCount))), h("div", { class: "issue-footer" }, h("span", { class: "issue-date", title: `Updated: ${issue.updatedAt}` }, "Updated ", this.formatDate(issue.updatedAt)), h("span", { class: "issue-date", title: `Created: ${issue.createdAt}` }, "Created ", this.formatDate(issue.createdAt)))))))))));
|
|
60
56
|
}
|
|
61
57
|
static get is() { return "feedlog-issues-list"; }
|
|
62
58
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t,p as e,H as s,c as i,h as o}from"./index.js";import{d as r}from"./p-CHtSMTyP.js";import{d as n}from"./p-DMdb-G26.js";import{d as h}from"./p-BxyIMDYk.js";import{d as a}from"./p-BLmN8b4F.js";function u(t){if("string"!=typeof t)return"";let e=t.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"");return e=e.replace(/\s*on\w+\s*=\s*["'][^"']*["']/gi,""),e=e.replace(/\s*on\w+\s*=\s*[^\s>]*/gi,""),e=e.replace(/<iframe\b[^<]*(?:(?!<\/iframe>)<[^<]*)*<\/iframe>/gi,""),e=e.replace(/<style\b[^<]*(?:(?!<\/style>)<[^<]*)*<\/style>/gi,""),e=e.replace(/<(embed|object)\b[^<]*>/gi,""),e=e.replace(/javascript:/gi,""),e=e.replace(/data:(?!image\/(?:png|jpg|jpeg|gif|webp);)/gi,""),e}class c extends Error{constructor(t,e,s){super(t),this.statusCode=e,this.originalError=s,this.name="FeedlogError",Object.setPrototypeOf(this,c.prototype)}}class d extends c{constructor(t){super(t),this.name="FeedlogValidationError",Object.setPrototypeOf(this,d.prototype)}}class l extends c{constructor(t,e,s){super(t,e,s),this.name="FeedlogNetworkError",Object.setPrototypeOf(this,l.prototype)}}class p extends c{constructor(t="Request timed out"){super(t),this.name="FeedlogTimeoutError",Object.setPrototypeOf(this,p.prototype)}}class f{constructor(t){if(this.config={credentials:"include",...t},this.apiKey=this.config.apiKey,!this.apiKey)throw new d("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 l("Failed to fetch issues: "+s.statusText,s.status);const i=await s.json();return this.validateIssuesResponse(i)}catch(t){if(t instanceof c)throw t;if(t instanceof TypeError&&t.message.includes("fetch"))throw new l("Network error: Unable to reach API",void 0,t);throw new c("Failed to fetch issues: "+(t instanceof Error?t.message:"Unknown error"),void 0,t)}}async toggleUpvote(t){if(!t||"string"!=typeof t)throw new d("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 l("Issue not found",404);if(401===s.status)throw new l("Unauthorized",401);if(403===s.status)throw new l("Forbidden: Domain not allowed for this repository",403);if(!s.ok)throw new l("Failed to toggle upvote: "+s.statusText,s.status);const i=await s.json();return this.validateUpvoteResponse(i)}catch(t){if(t instanceof c)throw t;if(t instanceof TypeError&&t.message.includes("fetch"))throw new l("Network error: Unable to reach API",void 0,t);throw new c("Failed to toggle upvote: "+(t instanceof Error?t.message:"Unknown error"),void 0,t)}}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)}return t.type&&e.searchParams.set("type",t.type),t.cursor&&e.searchParams.set("cursor",t.cursor),void 0!==t.limit&&e.searchParams.set("limit",""+t.limit),""+e}getAuthHeaders(){const t={"Content-Type":"application/json"};return this.apiKey&&(t["x-api-key"]=this.apiKey),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 p(`Request timed out after ${this.timeout}ms`);throw t}}validateIssuesResponse(t){if(!t||"object"!=typeof t)throw new d("Invalid API response: expected object");const e=t;if(!Array.isArray(e.issues))throw new d("Invalid API response: issues must be an array");if(!e.pagination||"object"!=typeof e.pagination)throw new d("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 d("Invalid issue: expected object");const e=t;if("string"!=typeof e.id)throw new d("Invalid issue: id is required and must be a string");if("string"!=typeof e.title)throw new d("Invalid issue: title is required and must be a string");if(!["bug","enhancement"].includes(e.type+""))throw new d('Invalid issue: type must be "bug" or "enhancement"');if(!["open","closed"].includes(e.status+""))throw new d('Invalid issue: status must be "open" or "closed"');if(!e.repository||"object"!=typeof e.repository)throw new d("Invalid issue: repository is required");const s=e.repository;if("string"!=typeof s.id||"string"!=typeof s.name||"string"!=typeof s.owner)throw new d("Invalid issue: repository must have id, name, and owner");const i=u(e.title+""),o=u((e.body||"")+"");return{id:e.id+"",type:e.type||"bug",status:e.status||"open",pinnedAt:e.pinnedAt?e.pinnedAt+"":null,revision:Number(e.revision)||1,title:i,body:o,repository:{id:s.id+"",name:s.name+"",owner:s.owner+""},updatedAt:e.updatedAt+""||(new Date).toISOString(),createdAt:e.createdAt+""||(new Date).toISOString(),upvoteCount:Number(e.upvoteCount)||0,hasUpvoted:!!e.hasUpvoted}}validateUpvoteResponse(t){if(!t||"object"!=typeof t)throw new d("Invalid upvote response: expected object");const e=t;if("boolean"!=typeof e.upvoted)throw new d("Invalid upvote response: upvoted must be a boolean");if("number"!=typeof e.upvoteCount)throw new d("Invalid upvote response: upvoteCount must be a number");if("string"!=typeof e.anonymousUserId)throw new d("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 w=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(){this.previousType=this.type,this.previousLimit=this.limit,this.initializeSDK(),this.fetchIssues()}disconnectedCallback(){this.isDisconnected=!0,this.fetchRequestId++}componentDidUpdate(){(this.previousType!==this.type||this.previousLimit!==this.limit)&&(this.fetchRequestId++,this.cursor=null,this.hasMore=!1,this.issues=[],this.fetchIssues(),this.previousType=this.type,this.previousLimit=this.limit)}initializeSDK(){try{if(!this.apiKey)throw Error("API key is required for the Feedlog SDK");this.sdk=new f(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})}}async fetchIssues(){if(!this.sdk)return;const t=this.fetchRequestId;try{this.loading=!0,this.error=null;const e={};this.type&&(e.type=this.type),this.limit&&(e.limit=this.limit),this.cursor&&(e.cursor=this.cursor);const 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:"Failed to fetch issues";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.type&&(e.type=this.type),this.limit&&(e.limit=this.limit),this.cursor&&(e.cursor=this.cursor);const 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(){return o("feedlog-github-issues",{key:"bb63dd29e99dfd9418b6cb12a1f45dff086378ab",issues:this.issues,maxWidth:this.maxWidth,theme:this.theme,heading:this.heading,subtitle:this.subtitle,loading:this.loading,error:this.error,hasMore:this.hasMore,isLoadingMore:this.isLoadingMore,onFeedlogUpvote:this.handleUpvote,onFeedlogLoadMore:async()=>this.loadMore()})}},[1,"feedlog-github-issues-client",{apiKey:[1,"api-key"],type:[1],limit:[2],endpoint:[1],maxWidth:[1,"max-width"],theme:[1],heading:[1],subtitle:[1],issues:[32],loading:[32],error:[32],cursor:[32],hasMore:[32],isLoadingMore:[32]}]);function g(){"undefined"!=typeof customElements&&["feedlog-github-issues-client","feedlog-badge","feedlog-button","feedlog-github-issues","feedlog-issue"].forEach((e=>{switch(e){case"feedlog-github-issues-client":customElements.get(t(e))||customElements.define(t(e),w);break;case"feedlog-badge":customElements.get(t(e))||r();break;case"feedlog-button":customElements.get(t(e))||n();break;case"feedlog-github-issues":customElements.get(t(e))||h();break;case"feedlog-issue":customElements.get(t(e))||a()}}))}g();const b=w,m=g;export{b as FeedlogGithubIssuesClient,m as defineCustomElement}
|
|
1
|
+
import{t,p as e,H as s,c as i,h as o}from"./index.js";import{d as r}from"./p-CHtSMTyP.js";import{d as n}from"./p-DMdb-G26.js";import{d as h}from"./p-BBQ4xWrx.js";import{d as a}from"./p-CJZ3rL6v.js";function u(t){if("string"!=typeof t)return"";let e=t.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"");return e=e.replace(/\s*on\w+\s*=\s*["'][^"']*["']/gi,""),e=e.replace(/\s*on\w+\s*=\s*[^\s>]*/gi,""),e=e.replace(/<iframe\b[^<]*(?:(?!<\/iframe>)<[^<]*)*<\/iframe>/gi,""),e=e.replace(/<style\b[^<]*(?:(?!<\/style>)<[^<]*)*<\/style>/gi,""),e=e.replace(/<(embed|object)\b[^<]*>/gi,""),e=e.replace(/javascript:/gi,""),e=e.replace(/data:(?!image\/(?:png|jpg|jpeg|gif|webp);)/gi,""),e}class c extends Error{constructor(t,e,s){super(t),this.statusCode=e,this.originalError=s,this.name="FeedlogError",Object.setPrototypeOf(this,c.prototype)}}class d extends c{constructor(t){super(t),this.name="FeedlogValidationError",Object.setPrototypeOf(this,d.prototype)}}class l extends c{constructor(t,e,s){super(t,e,s),this.name="FeedlogNetworkError",Object.setPrototypeOf(this,l.prototype)}}class p extends c{constructor(t="Request timed out"){super(t),this.name="FeedlogTimeoutError",Object.setPrototypeOf(this,p.prototype)}}class f{constructor(t){if(this.config={credentials:"include",...t},this.apiKey=this.config.apiKey,!this.apiKey)throw new d("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 l("Failed to fetch issues: "+s.statusText,s.status);const i=await s.json();return this.validateIssuesResponse(i)}catch(t){if(t instanceof c)throw t;if(t instanceof TypeError&&t.message.includes("fetch"))throw new l("Network error: Unable to reach API",void 0,t);throw new c("Failed to fetch issues: "+(t instanceof Error?t.message:"Unknown error"),void 0,t)}}async toggleUpvote(t){if(!t||"string"!=typeof t)throw new d("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 l("Issue not found",404);if(401===s.status)throw new l("Unauthorized",401);if(403===s.status)throw new l("Forbidden: Domain not allowed for this repository",403);if(!s.ok)throw new l("Failed to toggle upvote: "+s.statusText,s.status);const i=await s.json();return this.validateUpvoteResponse(i)}catch(t){if(t instanceof c)throw t;if(t instanceof TypeError&&t.message.includes("fetch"))throw new l("Network error: Unable to reach API",void 0,t);throw new c("Failed to toggle upvote: "+(t instanceof Error?t.message:"Unknown error"),void 0,t)}}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)}return t.type&&e.searchParams.set("type",t.type),t.cursor&&e.searchParams.set("cursor",t.cursor),void 0!==t.limit&&e.searchParams.set("limit",""+t.limit),""+e}getAuthHeaders(){const t={"Content-Type":"application/json"};return this.apiKey&&(t["x-api-key"]=this.apiKey),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 p(`Request timed out after ${this.timeout}ms`);throw t}}validateIssuesResponse(t){if(!t||"object"!=typeof t)throw new d("Invalid API response: expected object");const e=t;if(!Array.isArray(e.issues))throw new d("Invalid API response: issues must be an array");if(!e.pagination||"object"!=typeof e.pagination)throw new d("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 d("Invalid issue: expected object");const e=t;if("string"!=typeof e.id)throw new d("Invalid issue: id is required and must be a string");if("string"!=typeof e.title)throw new d("Invalid issue: title is required and must be a string");if(!["bug","enhancement"].includes(e.type+""))throw new d('Invalid issue: type must be "bug" or "enhancement"');if(!["open","closed"].includes(e.status+""))throw new d('Invalid issue: status must be "open" or "closed"');if(!e.repository||"object"!=typeof e.repository)throw new d("Invalid issue: repository is required");const s=e.repository;if("string"!=typeof s.id||"string"!=typeof s.name||"string"!=typeof s.owner)throw new d("Invalid issue: repository must have id, name, and owner");const i=u(e.title+""),o=u((e.body||"")+"");return{id:e.id+"",type:e.type||"bug",status:e.status||"open",pinnedAt:e.pinnedAt?e.pinnedAt+"":null,revision:Number(e.revision)||1,title:i,body:o,repository:{id:s.id+"",name:s.name+"",owner:s.owner+""},updatedAt:e.updatedAt+""||(new Date).toISOString(),createdAt:e.createdAt+""||(new Date).toISOString(),upvoteCount:Number(e.upvoteCount)||0,hasUpvoted:!!e.hasUpvoted}}validateUpvoteResponse(t){if(!t||"object"!=typeof t)throw new d("Invalid upvote response: expected object");const e=t;if("boolean"!=typeof e.upvoted)throw new d("Invalid upvote response: upvoted must be a boolean");if("number"!=typeof e.upvoteCount)throw new d("Invalid upvote response: upvoteCount must be a number");if("string"!=typeof e.anonymousUserId)throw new d("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 w=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(){this.previousType=this.type,this.previousLimit=this.limit,this.initializeSDK(),this.fetchIssues()}disconnectedCallback(){this.isDisconnected=!0,this.fetchRequestId++}componentDidUpdate(){(this.previousType!==this.type||this.previousLimit!==this.limit)&&(this.fetchRequestId++,this.cursor=null,this.hasMore=!1,this.issues=[],this.fetchIssues(),this.previousType=this.type,this.previousLimit=this.limit)}initializeSDK(){try{if(!this.apiKey)throw Error("API key is required for the Feedlog SDK");this.sdk=new f(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})}}async fetchIssues(){if(!this.sdk)return;const t=this.fetchRequestId;try{this.loading=!0,this.error=null;const e={};this.type&&(e.type=this.type),this.limit&&(e.limit=this.limit),this.cursor&&(e.cursor=this.cursor);const 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:"Failed to fetch issues";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.type&&(e.type=this.type),this.limit&&(e.limit=this.limit),this.cursor&&(e.cursor=this.cursor);const 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(){return o("feedlog-github-issues",{key:"bb63dd29e99dfd9418b6cb12a1f45dff086378ab",issues:this.issues,maxWidth:this.maxWidth,theme:this.theme,heading:this.heading,subtitle:this.subtitle,loading:this.loading,error:this.error,hasMore:this.hasMore,isLoadingMore:this.isLoadingMore,onFeedlogUpvote:this.handleUpvote,onFeedlogLoadMore:async()=>this.loadMore()})}},[1,"feedlog-github-issues-client",{apiKey:[1,"api-key"],type:[1],limit:[2],endpoint:[1],maxWidth:[1,"max-width"],theme:[1],heading:[1],subtitle:[1],issues:[32],loading:[32],error:[32],cursor:[32],hasMore:[32],isLoadingMore:[32]}]);function g(){"undefined"!=typeof customElements&&["feedlog-github-issues-client","feedlog-badge","feedlog-button","feedlog-github-issues","feedlog-issue"].forEach((e=>{switch(e){case"feedlog-github-issues-client":customElements.get(t(e))||customElements.define(t(e),w);break;case"feedlog-badge":customElements.get(t(e))||r();break;case"feedlog-button":customElements.get(t(e))||n();break;case"feedlog-github-issues":customElements.get(t(e))||h();break;case"feedlog-issue":customElements.get(t(e))||a()}}))}g();const b=w,m=g;export{b as FeedlogGithubIssuesClient,m as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as o,d as
|
|
1
|
+
import{F as o,d as r}from"./p-BBQ4xWrx.js";const s=o,p=r;export{s as FeedlogGithubIssues,p as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as o,d as
|
|
1
|
+
import{F as o,d as r}from"./p-CJZ3rL6v.js";const s=o,p=r;export{s as FeedlogIssue,p as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e,p as o,H as t,c as r,h as s,a as d}from"./index.js";import{d as i}from"./p-CHtSMTyP.js";const a=o(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.feedlogUpvote=r(this,"feedlogUpvote"),this.issues=[],this.theme="light",this.handleUpvote=(e,o)=>{e.stopPropagation(),this.feedlogUpvote.emit({issueId:o.id,currentUpvoted:o.hasUpvoted,currentCount:o.upvoteCount})}}formatDate(e){try{const o=new Date(e),t=Math.floor(((new Date).getTime()-o.getTime())/1e3);return t<60?"just now":t<3600?Math.floor(t/60)+"m ago":t<86400?Math.floor(t/3600)+"h ago":t<604800?Math.floor(t/86400)+"d ago":t<2592e3?Math.floor(t/604800)+"w ago":o.toLocaleDateString()}catch(e){return"unknown date"}}render(){return s(d,{key:"
|
|
1
|
+
import{t as e,p as o,H as t,c as r,h as s,a as d}from"./index.js";import{d as i}from"./p-CHtSMTyP.js";const a=({filled:e})=>s("svg",{class:"upvote-icon "+(e?"filled":"outline"),xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:e?"currentColor":"none",stroke:e?"none":"currentColor","stroke-width":e?void 0:"2","stroke-linecap":e?void 0:"round","stroke-linejoin":e?void 0:"round"},s("path",{d:"M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"})),l=o(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.feedlogUpvote=r(this,"feedlogUpvote"),this.issues=[],this.theme="light",this.handleUpvote=(e,o)=>{e.stopPropagation(),this.feedlogUpvote.emit({issueId:o.id,currentUpvoted:o.hasUpvoted,currentCount:o.upvoteCount})}}formatDate(e){try{const o=new Date(e),t=Math.floor(((new Date).getTime()-o.getTime())/1e3);return t<60?"just now":t<3600?Math.floor(t/60)+"m ago":t<86400?Math.floor(t/3600)+"h ago":t<604800?Math.floor(t/86400)+"d ago":t<2592e3?Math.floor(t/604800)+"w ago":o.toLocaleDateString()}catch(e){return"unknown date"}}render(){return s(d,{key:"ca131697a47a0e062454d7ec3b8b29d112d50e4b",class:"dark"===this.theme?"dark":""},s("div",{key:"e5738dadb712834eedb6a1508c1049e8ae5328f7",class:"issues-list"},0===this.issues.length?s("div",{class:"empty-state"},s("p",null,"No issues found")):this.issues.map((e=>s("div",{key:e.id,class:"issue-card"},s("div",{class:"issue-content"},s("div",{class:"issue-header"},s("div",{class:"issue-type-badge"},"bug"===e.type?s("feedlog-badge",{variant:"destructive"},"Bug"):s("feedlog-badge",{variant:"enhancement"},"Enhancement")),e.pinnedAt&&s("div",{class:"pinned-indicator",title:"Pinned issue"},"📌")),s("div",{class:"issue-main"},s("div",{class:"issue-details"},s("h3",{class:"issue-title"},e.title),s("p",{class:"issue-body"},e.body),s("div",{class:"issue-repository"},s("span",{class:"repo-name"},e.repository.owner,"/",e.repository.name))),s("button",{class:"upvote-button "+(e.hasUpvoted?"upvoted":""),onClick:o=>this.handleUpvote(o,e),title:e.hasUpvoted?"Remove upvote":"Upvote this issue"},s(a,{filled:e.hasUpvoted}),s("span",{class:"upvote-count"},e.upvoteCount))),s("div",{class:"issue-footer"},s("span",{class:"issue-date",title:"Updated: "+e.updatedAt},"Updated ",this.formatDate(e.updatedAt)),s("span",{class:"issue-date",title:"Created: "+e.createdAt},"Created ",this.formatDate(e.createdAt)))))))))}static get style(){return":host{display: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-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}:host(.dark){--feedlog-background:oklch(0.145 0 0);--feedlog-foreground:oklch(0.985 0 0);--feedlog-card:oklch(0.145 0 0);--feedlog-card-foreground:oklch(0.985 0 0);--feedlog-muted:oklch(0.269 0 0);--feedlog-muted-foreground:oklch(0.708 0 0);--feedlog-border:oklch(0.269 0 0);--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-blue-900-30:color-mix(in oklab, oklch(0.379 0.146 265.522) 30%, transparent);--feedlog-red-900-30:color-mix(in oklab, oklch(0.396 0.141 25.723) 30%, transparent)}.issues-list{display:flex;flex-direction:column;gap:var(--feedlog-gap)}.empty-state{text-align:center;padding:3rem 1.5rem;color:var(--feedlog-muted-foreground);font-size:0.875rem}.issue-card{background-color:var(--feedlog-card);border:1px solid var(--feedlog-border);border-radius:var(--feedlog-radius);box-shadow:0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);transition:box-shadow 0.15s ease;position:relative}.issue-card:hover{box-shadow:0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)}.issue-content{padding:1.5rem;display:flex;flex-direction:column;gap:1rem}.issue-header{display:flex;align-items:center;gap:0.5rem;justify-content:space-between}.issue-type-badge{width:fit-content}.pinned-indicator{font-size:1rem;opacity:0.7}.issue-main{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem}.issue-details{flex:1;min-width:0}.issue-title{margin:0 0 0.5rem 0;font-size:1rem;font-weight:600;color:var(--feedlog-card-foreground);line-height:1.5;word-wrap:break-word}.issue-body{margin:0 0 0.75rem 0;font-size:0.875rem;color:var(--feedlog-muted-foreground);line-height:1.5;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;word-wrap:break-word}.issue-repository{display:flex;align-items:center;gap:0.5rem;font-size:0.75rem;color:var(--feedlog-muted-foreground)}.repo-name{font-weight:500}.github-number{background-color:var(--feedlog-muted);padding:0.125rem 0.375rem;border-radius:0.25rem;font-family:ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace}.upvote-button{display:flex;align-items:center;gap:0.375rem;padding:0.5rem 0.75rem;background-color:var(--feedlog-muted);border:1px solid var(--feedlog-border);border-radius:var(--feedlog-radius);color:var(--feedlog-muted-foreground);font-size:0.875rem;font-weight:500;cursor:pointer;transition:all 0.15s ease;white-space:nowrap}.upvote-button:hover{background-color:var(--feedlog-accent-color);color:white}.upvote-button.upvoted{background-color:var(--feedlog-destructive);color:white;border-color:var(--feedlog-destructive)}.upvote-button.upvoted:hover{background-color:var(--feedlog-red-600);border-color:var(--feedlog-red-600)}.upvote-icon{width:1rem;height:1rem;flex-shrink:0}.upvote-icon.filled{color:currentColor}.upvote-icon.outline{stroke:currentColor}.upvote-count{font-variant-numeric:tabular-nums}.issue-footer{display:flex;align-items:center;gap:1rem;font-size:0.75rem;color:var(--feedlog-muted-foreground)}.issue-date{white-space:nowrap}@media (max-width: 640px){.issue-content{padding:1rem;gap:0.75rem}.issue-main{flex-direction:column;align-items:stretch;gap:0.75rem}.upvote-button{align-self:flex-start}.issue-footer{flex-direction:column;align-items:flex-start;gap:0.25rem}}"}},[1,"feedlog-issues-list",{issues:[16],theme:[1]}]);function n(){"undefined"!=typeof customElements&&["feedlog-issues-list","feedlog-badge"].forEach((o=>{switch(o){case"feedlog-issues-list":customElements.get(e(o))||customElements.define(e(o),l);break;case"feedlog-badge":customElements.get(e(o))||i()}}))}n();const c=l,u=n;export{c as FeedlogIssuesList,u as defineCustomElement}
|