@feedlog-ai/webcomponents 0.0.9 → 0.0.10
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_3.cjs.entry.js +14 -15
- package/dist/cjs/feedlog-github-issues-client.cjs.entry.js +1 -1
- package/dist/cjs/feedlog-github-issues.cjs.entry.js +5 -2
- package/dist/cjs/feedlog-toolkit.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/feedlog-github-issues/feedlog-github-issues.css +36 -1
- package/dist/collection/components/feedlog-github-issues/feedlog-github-issues.js +7 -4
- package/dist/collection/components/feedlog-github-issues-client/feedlog-github-issues-client.js +1 -1
- package/dist/collection/components/{feedlog-issues-list/feedlog-issues-list.css → feedlog-issue/feedlog-issue.css} +0 -13
- package/dist/collection/components/{feedlog-issues-list/feedlog-issues-list.js → feedlog-issue/feedlog-issue.js} +24 -26
- package/dist/collection/components/feedlog-issue/feedlog-issue.stories.js +113 -0
- package/dist/collection/components/index.js +1 -1
- package/dist/components/feedlog-github-issues-client.js +1 -1
- package/dist/components/feedlog-github-issues.js +1 -1
- package/dist/components/{feedlog-issues-list.d.ts → feedlog-issue.d.ts} +4 -4
- package/dist/components/feedlog-issue.js +1 -0
- package/dist/components/p-5qPAHrMz.js +1 -0
- package/dist/components/p-DaNa3wCt.js +1 -0
- package/dist/esm/feedlog-badge_3.entry.js +14 -15
- package/dist/esm/feedlog-github-issues-client.entry.js +1 -1
- package/dist/esm/feedlog-github-issues.entry.js +5 -2
- package/dist/esm/feedlog-toolkit.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/feedlog-toolkit/feedlog-toolkit.esm.js +1 -1
- package/dist/feedlog-toolkit/{p-964cfcd8.entry.js → p-8c5e3a0b.entry.js} +1 -1
- package/dist/feedlog-toolkit/p-95fea2f4.entry.js +1 -0
- package/dist/feedlog-toolkit/{p-4874f7e8.entry.js → p-bbb8c3b6.entry.js} +1 -1
- package/dist/types/components/feedlog-github-issues/feedlog-github-issues.d.ts +4 -3
- package/dist/types/components/feedlog-github-issues-client/feedlog-github-issues-client.d.ts +2 -2
- package/dist/types/components/{feedlog-issues-list/feedlog-issues-list.d.ts → feedlog-issue/feedlog-issue.d.ts} +8 -8
- package/dist/types/components/feedlog-issue/feedlog-issue.stories.d.ts +12 -0
- package/dist/types/components/index.d.ts +1 -1
- package/dist/types/components.d.ts +36 -38
- package/package.json +2 -2
- package/dist/components/feedlog-issues-list.js +0 -1
- package/dist/components/p-C7AZiNqt.js +0 -1
- package/dist/components/p-rh0Uv7Ks.js +0 -1
- package/dist/feedlog-toolkit/p-f16f2491.entry.js +0 -1
|
@@ -53,7 +53,7 @@ const FeedlogButton = class {
|
|
|
53
53
|
};
|
|
54
54
|
FeedlogButton.style = feedlogButtonCss();
|
|
55
55
|
|
|
56
|
-
const
|
|
56
|
+
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}`;
|
|
57
57
|
|
|
58
58
|
/**
|
|
59
59
|
* Heart icon SVG component (filled)
|
|
@@ -63,30 +63,23 @@ const HeartFilledIcon = () => (index.h("svg", { class: "upvote-icon filled", xml
|
|
|
63
63
|
* Heart icon SVG component (outline)
|
|
64
64
|
*/
|
|
65
65
|
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" })));
|
|
66
|
-
const
|
|
66
|
+
const FeedlogIssueComponent = class {
|
|
67
67
|
constructor(hostRef) {
|
|
68
68
|
index.registerInstance(this, hostRef);
|
|
69
69
|
this.feedlogUpvote = index.createEvent(this, "feedlogUpvote");
|
|
70
|
-
/**
|
|
71
|
-
* Array of issues to display
|
|
72
|
-
*/
|
|
73
|
-
this.issues = [];
|
|
74
70
|
/**
|
|
75
71
|
* Theme variant: 'light' or 'dark'
|
|
76
72
|
*/
|
|
77
73
|
this.theme = 'light';
|
|
78
|
-
this.handleUpvote = (event
|
|
74
|
+
this.handleUpvote = (event) => {
|
|
79
75
|
event.stopPropagation();
|
|
80
76
|
this.feedlogUpvote.emit({
|
|
81
|
-
issueId: issue.id,
|
|
82
|
-
currentUpvoted: issue.hasUpvoted,
|
|
83
|
-
currentCount: issue.upvoteCount,
|
|
77
|
+
issueId: this.issue.id,
|
|
78
|
+
currentUpvoted: this.issue.hasUpvoted,
|
|
79
|
+
currentCount: this.issue.upvoteCount,
|
|
84
80
|
});
|
|
85
81
|
};
|
|
86
82
|
}
|
|
87
|
-
render() {
|
|
88
|
-
return (index.h(index.Host, { key: '81b2b973309388f09d20629da416b92545567618', class: this.theme === 'dark' ? 'dark' : '' }, index.h("div", { key: 'ed22c88736ee13621f39b3095f71c361b0d04b44', 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))), issue.type !== 'bug' && (index.h("button", { class: `upvote-button ${issue.hasUpvoted ? 'upvoted' : ''}`, onClick: (e) => this.handleUpvote(e, issue), title: issue.hasUpvoted ? 'Remove upvote' : 'Upvote this issue' }, issue.hasUpvoted ? index.h(HeartFilledIcon, null) : index.h(HeartOutlineIcon, null), 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)))))))))));
|
|
89
|
-
}
|
|
90
83
|
/**
|
|
91
84
|
* Format an ISO date string to a relative time string
|
|
92
85
|
*/
|
|
@@ -111,9 +104,15 @@ const FeedlogIssuesList = class {
|
|
|
111
104
|
return 'unknown date';
|
|
112
105
|
}
|
|
113
106
|
}
|
|
107
|
+
render() {
|
|
108
|
+
const { issue } = this;
|
|
109
|
+
if (!issue)
|
|
110
|
+
return null;
|
|
111
|
+
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' }, issue.hasUpvoted ? index.h(HeartFilledIcon, null) : index.h(HeartOutlineIcon, null), 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)))))));
|
|
112
|
+
}
|
|
114
113
|
};
|
|
115
|
-
|
|
114
|
+
FeedlogIssueComponent.style = feedlogIssueCss();
|
|
116
115
|
|
|
117
116
|
exports.feedlog_badge = FeedlogBadge;
|
|
118
117
|
exports.feedlog_button = FeedlogButton;
|
|
119
|
-
exports.
|
|
118
|
+
exports.feedlog_issue = FeedlogIssueComponent;
|
|
@@ -485,7 +485,7 @@ const FeedlogGithubIssuesClient = class {
|
|
|
485
485
|
}
|
|
486
486
|
}
|
|
487
487
|
render() {
|
|
488
|
-
return (index.h("feedlog-github-issues", { key: '
|
|
488
|
+
return (index.h("feedlog-github-issues", { key: '9b12fc472a905e7117b383ccdf2c0a995f480366', 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() }));
|
|
489
489
|
}
|
|
490
490
|
};
|
|
491
491
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var index = require('./index-5lluu_3h.js');
|
|
4
4
|
|
|
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-muted-foreground:#717182;--feedlog-destructive:#d4183d;--feedlog-padding:2rem}:host(.dark){--feedlog-background:oklch(0.145 0 0);--feedlog-foreground:oklch(0.985 0 0);--feedlog-muted-foreground:oklch(0.708 0 0);--feedlog-destructive:oklch(0.
|
|
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
|
|
|
7
7
|
const FeedlogGithubIssues = class {
|
|
8
8
|
constructor(hostRef) {
|
|
@@ -52,11 +52,14 @@ const FeedlogGithubIssues = class {
|
|
|
52
52
|
componentWillLoad() {
|
|
53
53
|
this.currentTheme = this.theme;
|
|
54
54
|
}
|
|
55
|
+
renderIssuesList() {
|
|
56
|
+
return (index.h("div", { 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("feedlog-issue", { key: issue.id, issue: issue, theme: this.currentTheme, onFeedlogUpvote: (e) => this.handleUpvote(e) }))))));
|
|
57
|
+
}
|
|
55
58
|
render() {
|
|
56
59
|
const containerStyle = {
|
|
57
60
|
maxWidth: this.maxWidth,
|
|
58
61
|
};
|
|
59
|
-
return (index.h(index.Host, { key: '
|
|
62
|
+
return (index.h(index.Host, { key: '3d3f6aaaf7efc9bf81476e1ff793d68a8fc46db1', class: this.currentTheme === 'dark' ? 'dark' : '' }, index.h("div", { key: 'b3114878ce3b649bb1dbec9eb2502bad2c2dfe27', class: "github-issues-container", style: containerStyle }, (this.heading || this.subtitle) && (index.h("header", { key: '3effa7137e3138b8709f12442beaaf58f7873e91', class: "issues-header" }, index.h("div", { key: '7904676ced41f4c738c265a571d2a447155f13f3', class: "header-content" }, this.heading && index.h("h1", { key: 'f139c2087642ede74542be0064273d92f27938d7', class: "issues-title" }, this.heading), this.subtitle && index.h("p", { key: 'c3af89d4abfb48ba225f362031705a14833f0ab7', class: "issues-subtitle" }, this.subtitle)))), this.loading && (index.h("div", { key: '1ed8c88a52808bbfb3a1ac86c9535cb87f32773a', class: "loading-state" }, index.h("p", { key: 'd093c2edcfaba2c136c6915bfe183f7e8f25de8b' }, "Loading issues..."))), this.error && (index.h("div", { key: '05ab37ee5c061a321fc7a8c407af04cae269f304', class: "error-state" }, index.h("p", { key: '7388ef1b66265953f30b65618f2b96c519702bdb' }, "Error: ", this.error))), !this.loading && !this.error && (index.h("div", { key: '5968b7ad6c13c7d0edf0a497eb51bd88978def9c' }, this.renderIssuesList(), this.hasMore && (index.h("div", { key: '7cfe136735f497f239a5be2befa6c3add99c7bcb', class: "load-more-container" }, index.h("feedlog-button", { key: '6fcdaf69873d51518d58baa9c3f8dba8a705ad5f', onFeedlogClick: this.handleLoadMore, disabled: this.isLoadingMore, variant: "outline" }, this.isLoadingMore ? 'Loading...' : 'Load More Issues'))))))));
|
|
60
63
|
}
|
|
61
64
|
};
|
|
62
65
|
FeedlogGithubIssues.style = feedlogGithubIssuesCss();
|
|
@@ -18,7 +18,7 @@ var patchBrowser = () => {
|
|
|
18
18
|
|
|
19
19
|
patchBrowser().then(async (options) => {
|
|
20
20
|
await index.globalScripts();
|
|
21
|
-
return index.bootstrapLazy([["feedlog-card.cjs",[[257,"feedlog-card"]]],["feedlog-badge_3.cjs",[[1,"feedlog-
|
|
21
|
+
return index.bootstrapLazy([["feedlog-card.cjs",[[257,"feedlog-card"]]],["feedlog-badge_3.cjs",[[1,"feedlog-issue",{"issue":[16],"theme":[1]}],[257,"feedlog-button",{"variant":[1],"size":[1],"disabled":[4],"type":[1]}],[257,"feedlog-badge",{"variant":[1]}]]],["feedlog-github-issues.cjs",[[1,"feedlog-github-issues",{"issues":[16],"maxWidth":[1,"max-width"],"theme":[1025],"heading":[1],"subtitle":[1],"loading":[4],"error":[1],"hasMore":[4,"has-more"],"isLoadingMore":[4,"is-loading-more"],"currentTheme":[32]}]]],["feedlog-github-issues-client.cjs",[[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]}]]]], options);
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
exports.setNonce = index.setNonce;
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -5,7 +5,7 @@ var index = require('./index-5lluu_3h.js');
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
6
6
|
if (typeof window === 'undefined') return undefined;
|
|
7
7
|
await index.globalScripts();
|
|
8
|
-
return index.bootstrapLazy([["feedlog-card.cjs",[[257,"feedlog-card"]]],["feedlog-badge_3.cjs",[[1,"feedlog-
|
|
8
|
+
return index.bootstrapLazy([["feedlog-card.cjs",[[257,"feedlog-card"]]],["feedlog-badge_3.cjs",[[1,"feedlog-issue",{"issue":[16],"theme":[1]}],[257,"feedlog-button",{"variant":[1],"size":[1],"disabled":[4],"type":[1]}],[257,"feedlog-badge",{"variant":[1]}]]],["feedlog-github-issues.cjs",[[1,"feedlog-github-issues",{"issues":[16],"maxWidth":[1,"max-width"],"theme":[1025],"heading":[1],"subtitle":[1],"loading":[4],"error":[1],"hasMore":[4,"has-more"],"isLoadingMore":[4,"is-loading-more"],"currentTheme":[32]}]]],["feedlog-github-issues-client.cjs",[[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]}]]]], options);
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
exports.setNonce = index.setNonce;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"components/feedlog-button/feedlog-button.js",
|
|
6
6
|
"components/feedlog-github-issues/feedlog-github-issues.js",
|
|
7
7
|
"components/feedlog-github-issues-client/feedlog-github-issues-client.js",
|
|
8
|
-
"components/feedlog-
|
|
8
|
+
"components/feedlog-issue/feedlog-issue.js"
|
|
9
9
|
],
|
|
10
10
|
"compiler": {
|
|
11
11
|
"name": "@stencil/core",
|
|
@@ -5,8 +5,21 @@
|
|
|
5
5
|
/* Light theme defaults */
|
|
6
6
|
--feedlog-background: #ffffff;
|
|
7
7
|
--feedlog-foreground: oklch(0.145 0 0);
|
|
8
|
+
--feedlog-card: #ffffff;
|
|
9
|
+
--feedlog-card-foreground: oklch(0.145 0 0);
|
|
10
|
+
--feedlog-muted: #ececf0;
|
|
8
11
|
--feedlog-muted-foreground: #717182;
|
|
12
|
+
--feedlog-border: rgba(0, 0, 0, 0.1);
|
|
13
|
+
--feedlog-accent-color: #2563eb;
|
|
9
14
|
--feedlog-destructive: #d4183d;
|
|
15
|
+
--feedlog-blue-400: oklch(0.707 0.165 254.624);
|
|
16
|
+
--feedlog-blue-600: oklch(0.546 0.245 262.881);
|
|
17
|
+
--feedlog-blue-100: oklch(0.932 0.032 255.585);
|
|
18
|
+
--feedlog-red-100: #fce7f3;
|
|
19
|
+
--feedlog-red-400: #f472b6;
|
|
20
|
+
--feedlog-red-600: #db2777;
|
|
21
|
+
--feedlog-radius: 0.625rem;
|
|
22
|
+
--feedlog-gap: 0.5rem;
|
|
10
23
|
--feedlog-padding: 2rem;
|
|
11
24
|
}
|
|
12
25
|
|
|
@@ -14,8 +27,17 @@
|
|
|
14
27
|
/* Dark theme values */
|
|
15
28
|
--feedlog-background: oklch(0.145 0 0);
|
|
16
29
|
--feedlog-foreground: oklch(0.985 0 0);
|
|
30
|
+
--feedlog-card: oklch(0.145 0 0);
|
|
31
|
+
--feedlog-card-foreground: oklch(0.985 0 0);
|
|
32
|
+
--feedlog-muted: oklch(0.269 0 0);
|
|
17
33
|
--feedlog-muted-foreground: oklch(0.708 0 0);
|
|
18
|
-
--feedlog-
|
|
34
|
+
--feedlog-border: oklch(0.269 0 0);
|
|
35
|
+
--feedlog-accent-color: #3b82f6;
|
|
36
|
+
--feedlog-destructive: oklch(0.396 0.141 25.723);
|
|
37
|
+
--feedlog-blue-400: oklch(0.707 0.165 254.624);
|
|
38
|
+
--feedlog-blue-600: oklch(0.546 0.245 262.881);
|
|
39
|
+
--feedlog-blue-900-30: color-mix(in oklab, oklch(0.379 0.146 265.522) 30%, transparent);
|
|
40
|
+
--feedlog-red-900-30: color-mix(in oklab, oklch(0.396 0.141 25.723) 30%, transparent);
|
|
19
41
|
}
|
|
20
42
|
|
|
21
43
|
.github-issues-container {
|
|
@@ -61,6 +83,19 @@
|
|
|
61
83
|
color: var(--feedlog-destructive);
|
|
62
84
|
}
|
|
63
85
|
|
|
86
|
+
.issues-list {
|
|
87
|
+
display: flex;
|
|
88
|
+
flex-direction: column;
|
|
89
|
+
gap: var(--feedlog-gap);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.empty-state {
|
|
93
|
+
text-align: center;
|
|
94
|
+
padding: 3rem 1.5rem;
|
|
95
|
+
color: var(--feedlog-muted-foreground);
|
|
96
|
+
font-size: 0.875rem;
|
|
97
|
+
}
|
|
98
|
+
|
|
64
99
|
.load-more-container {
|
|
65
100
|
display: flex;
|
|
66
101
|
justify-content: center;
|
|
@@ -3,7 +3,7 @@ import { h, Host } from "@stencil/core";
|
|
|
3
3
|
* Feedlog GitHub Issues Component
|
|
4
4
|
*
|
|
5
5
|
* Component for displaying GitHub issues with support for bugs and enhancements.
|
|
6
|
-
*
|
|
6
|
+
* Includes full list rendering, loading/error states, and pagination support.
|
|
7
7
|
*/
|
|
8
8
|
export class FeedlogGithubIssues {
|
|
9
9
|
constructor() {
|
|
@@ -50,11 +50,14 @@ export class FeedlogGithubIssues {
|
|
|
50
50
|
componentWillLoad() {
|
|
51
51
|
this.currentTheme = this.theme;
|
|
52
52
|
}
|
|
53
|
+
renderIssuesList() {
|
|
54
|
+
return (h("div", { class: "issues-list" }, this.issues.length === 0 ? (h("div", { class: "empty-state" }, h("p", null, "No issues found"))) : (this.issues.map(issue => (h("feedlog-issue", { key: issue.id, issue: issue, theme: this.currentTheme, onFeedlogUpvote: (e) => this.handleUpvote(e) }))))));
|
|
55
|
+
}
|
|
53
56
|
render() {
|
|
54
57
|
const containerStyle = {
|
|
55
58
|
maxWidth: this.maxWidth,
|
|
56
59
|
};
|
|
57
|
-
return (h(Host, { key: '
|
|
60
|
+
return (h(Host, { key: '3d3f6aaaf7efc9bf81476e1ff793d68a8fc46db1', class: this.currentTheme === 'dark' ? 'dark' : '' }, h("div", { key: 'b3114878ce3b649bb1dbec9eb2502bad2c2dfe27', class: "github-issues-container", style: containerStyle }, (this.heading || this.subtitle) && (h("header", { key: '3effa7137e3138b8709f12442beaaf58f7873e91', class: "issues-header" }, h("div", { key: '7904676ced41f4c738c265a571d2a447155f13f3', class: "header-content" }, this.heading && h("h1", { key: 'f139c2087642ede74542be0064273d92f27938d7', class: "issues-title" }, this.heading), this.subtitle && h("p", { key: 'c3af89d4abfb48ba225f362031705a14833f0ab7', class: "issues-subtitle" }, this.subtitle)))), this.loading && (h("div", { key: '1ed8c88a52808bbfb3a1ac86c9535cb87f32773a', class: "loading-state" }, h("p", { key: 'd093c2edcfaba2c136c6915bfe183f7e8f25de8b' }, "Loading issues..."))), this.error && (h("div", { key: '05ab37ee5c061a321fc7a8c407af04cae269f304', class: "error-state" }, h("p", { key: '7388ef1b66265953f30b65618f2b96c519702bdb' }, "Error: ", this.error))), !this.loading && !this.error && (h("div", { key: '5968b7ad6c13c7d0edf0a497eb51bd88978def9c' }, this.renderIssuesList(), this.hasMore && (h("div", { key: '7cfe136735f497f239a5be2befa6c3add99c7bcb', class: "load-more-container" }, h("feedlog-button", { key: '6fcdaf69873d51518d58baa9c3f8dba8a705ad5f', onFeedlogClick: this.handleLoadMore, disabled: this.isLoadingMore, variant: "outline" }, this.isLoadingMore ? 'Loading...' : 'Load More Issues'))))))));
|
|
58
61
|
}
|
|
59
62
|
static get is() { return "feedlog-github-issues"; }
|
|
60
63
|
static get encapsulation() { return "shadow"; }
|
|
@@ -74,10 +77,10 @@ export class FeedlogGithubIssues {
|
|
|
74
77
|
"type": "unknown",
|
|
75
78
|
"mutable": false,
|
|
76
79
|
"complexType": {
|
|
77
|
-
"original": "
|
|
80
|
+
"original": "FeedlogIssueType[]",
|
|
78
81
|
"resolved": "FeedlogIssue[]",
|
|
79
82
|
"references": {
|
|
80
|
-
"
|
|
83
|
+
"FeedlogIssueType": {
|
|
81
84
|
"location": "import",
|
|
82
85
|
"path": "@feedlog-ai/core",
|
|
83
86
|
"id": "../core/dist/index.d.ts::FeedlogIssue"
|
package/dist/collection/components/feedlog-github-issues-client/feedlog-github-issues-client.js
CHANGED
|
@@ -154,7 +154,7 @@ export class FeedlogGithubIssuesClient {
|
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
render() {
|
|
157
|
-
return (h("feedlog-github-issues", { key: '
|
|
157
|
+
return (h("feedlog-github-issues", { key: '9b12fc472a905e7117b383ccdf2c0a995f480366', 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() }));
|
|
158
158
|
}
|
|
159
159
|
static get is() { return "feedlog-github-issues-client"; }
|
|
160
160
|
static get encapsulation() { return "shadow"; }
|
|
@@ -39,19 +39,6 @@
|
|
|
39
39
|
--feedlog-red-900-30: color-mix(in oklab, oklch(0.396 0.141 25.723) 30%, transparent);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
.issues-list {
|
|
43
|
-
display: flex;
|
|
44
|
-
flex-direction: column;
|
|
45
|
-
gap: var(--feedlog-gap);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.empty-state {
|
|
49
|
-
text-align: center;
|
|
50
|
-
padding: 3rem 1.5rem;
|
|
51
|
-
color: var(--feedlog-muted-foreground);
|
|
52
|
-
font-size: 0.875rem;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
42
|
.issue-card {
|
|
56
43
|
background-color: var(--feedlog-card);
|
|
57
44
|
border: 1px solid var(--feedlog-border);
|
|
@@ -8,32 +8,25 @@ const HeartFilledIcon = () => (h("svg", { class: "upvote-icon filled", xmlns: "h
|
|
|
8
8
|
*/
|
|
9
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" })));
|
|
10
10
|
/**
|
|
11
|
-
* Feedlog
|
|
11
|
+
* Feedlog Issue Component
|
|
12
12
|
*
|
|
13
|
-
* A component for displaying a
|
|
13
|
+
* A component for displaying a single GitHub issue.
|
|
14
14
|
*/
|
|
15
|
-
export class
|
|
15
|
+
export class FeedlogIssueComponent {
|
|
16
16
|
constructor() {
|
|
17
|
-
/**
|
|
18
|
-
* Array of issues to display
|
|
19
|
-
*/
|
|
20
|
-
this.issues = [];
|
|
21
17
|
/**
|
|
22
18
|
* Theme variant: 'light' or 'dark'
|
|
23
19
|
*/
|
|
24
20
|
this.theme = 'light';
|
|
25
|
-
this.handleUpvote = (event
|
|
21
|
+
this.handleUpvote = (event) => {
|
|
26
22
|
event.stopPropagation();
|
|
27
23
|
this.feedlogUpvote.emit({
|
|
28
|
-
issueId: issue.id,
|
|
29
|
-
currentUpvoted: issue.hasUpvoted,
|
|
30
|
-
currentCount: issue.upvoteCount,
|
|
24
|
+
issueId: this.issue.id,
|
|
25
|
+
currentUpvoted: this.issue.hasUpvoted,
|
|
26
|
+
currentCount: this.issue.upvoteCount,
|
|
31
27
|
});
|
|
32
28
|
};
|
|
33
29
|
}
|
|
34
|
-
render() {
|
|
35
|
-
return (h(Host, { key: '81b2b973309388f09d20629da416b92545567618', class: this.theme === 'dark' ? 'dark' : '' }, h("div", { key: 'ed22c88736ee13621f39b3095f71c361b0d04b44', 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))), issue.type !== 'bug' && (h("button", { class: `upvote-button ${issue.hasUpvoted ? 'upvoted' : ''}`, onClick: (e) => this.handleUpvote(e, issue), title: issue.hasUpvoted ? 'Remove upvote' : 'Upvote this issue' }, issue.hasUpvoted ? h(HeartFilledIcon, null) : h(HeartOutlineIcon, null), 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)))))))))));
|
|
36
|
-
}
|
|
37
30
|
/**
|
|
38
31
|
* Format an ISO date string to a relative time string
|
|
39
32
|
*/
|
|
@@ -58,43 +51,48 @@ export class FeedlogIssuesList {
|
|
|
58
51
|
return 'unknown date';
|
|
59
52
|
}
|
|
60
53
|
}
|
|
61
|
-
|
|
54
|
+
render() {
|
|
55
|
+
const { issue } = this;
|
|
56
|
+
if (!issue)
|
|
57
|
+
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 ? h(HeartFilledIcon, null) : h(HeartOutlineIcon, null), 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
|
+
}
|
|
60
|
+
static get is() { return "feedlog-issue"; }
|
|
62
61
|
static get encapsulation() { return "shadow"; }
|
|
63
62
|
static get originalStyleUrls() {
|
|
64
63
|
return {
|
|
65
|
-
"$": ["feedlog-
|
|
64
|
+
"$": ["feedlog-issue.css"]
|
|
66
65
|
};
|
|
67
66
|
}
|
|
68
67
|
static get styleUrls() {
|
|
69
68
|
return {
|
|
70
|
-
"$": ["feedlog-
|
|
69
|
+
"$": ["feedlog-issue.css"]
|
|
71
70
|
};
|
|
72
71
|
}
|
|
73
72
|
static get properties() {
|
|
74
73
|
return {
|
|
75
|
-
"
|
|
74
|
+
"issue": {
|
|
76
75
|
"type": "unknown",
|
|
77
76
|
"mutable": false,
|
|
78
77
|
"complexType": {
|
|
79
|
-
"original": "
|
|
80
|
-
"resolved": "FeedlogIssue
|
|
78
|
+
"original": "FeedlogIssueType",
|
|
79
|
+
"resolved": "FeedlogIssue",
|
|
81
80
|
"references": {
|
|
82
|
-
"
|
|
81
|
+
"FeedlogIssueType": {
|
|
83
82
|
"location": "import",
|
|
84
83
|
"path": "@feedlog-ai/core",
|
|
85
84
|
"id": "../core/dist/index.d.ts::FeedlogIssue"
|
|
86
85
|
}
|
|
87
86
|
}
|
|
88
87
|
},
|
|
89
|
-
"required":
|
|
88
|
+
"required": true,
|
|
90
89
|
"optional": false,
|
|
91
90
|
"docs": {
|
|
92
91
|
"tags": [],
|
|
93
|
-
"text": "
|
|
92
|
+
"text": "The issue to display"
|
|
94
93
|
},
|
|
95
94
|
"getter": false,
|
|
96
|
-
"setter": false
|
|
97
|
-
"defaultValue": "[]"
|
|
95
|
+
"setter": false
|
|
98
96
|
},
|
|
99
97
|
"theme": {
|
|
100
98
|
"type": "string",
|
|
@@ -127,7 +125,7 @@ export class FeedlogIssuesList {
|
|
|
127
125
|
"composed": true,
|
|
128
126
|
"docs": {
|
|
129
127
|
"tags": [],
|
|
130
|
-
"text": "Event emitted when
|
|
128
|
+
"text": "Event emitted when the issue is upvoted"
|
|
131
129
|
},
|
|
132
130
|
"complexType": {
|
|
133
131
|
"original": "{\n issueId: string;\n currentUpvoted: boolean;\n currentCount: number;\n }",
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
const sampleBugIssue = {
|
|
3
|
+
id: 'issue-bug-1',
|
|
4
|
+
title: 'Charts not rendering on mobile',
|
|
5
|
+
body: 'The chart components are not properly responsive on smaller screens. They overflow the container and break the layout.',
|
|
6
|
+
type: 'bug',
|
|
7
|
+
status: 'open',
|
|
8
|
+
pinnedAt: null,
|
|
9
|
+
revision: 1,
|
|
10
|
+
repository: {
|
|
11
|
+
id: 'repo-1',
|
|
12
|
+
name: 'feedlog-toolkit',
|
|
13
|
+
owner: 'feedlog',
|
|
14
|
+
},
|
|
15
|
+
updatedAt: new Date(Date.now() - 5 * 60 * 60 * 1000).toISOString(), // 5 hours ago
|
|
16
|
+
createdAt: new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString(), // 1 week ago
|
|
17
|
+
upvoteCount: 3,
|
|
18
|
+
hasUpvoted: false,
|
|
19
|
+
};
|
|
20
|
+
const sampleEnhancementIssue = {
|
|
21
|
+
id: 'issue-enhancement-1',
|
|
22
|
+
title: 'Add dark mode support',
|
|
23
|
+
body: 'It would be great to have a dark mode option for the dashboard. This would reduce eye strain for users working late at night.',
|
|
24
|
+
type: 'enhancement',
|
|
25
|
+
status: 'open',
|
|
26
|
+
pinnedAt: null,
|
|
27
|
+
revision: 1,
|
|
28
|
+
repository: {
|
|
29
|
+
id: 'repo-1',
|
|
30
|
+
name: 'feedlog-toolkit',
|
|
31
|
+
owner: 'feedlog',
|
|
32
|
+
},
|
|
33
|
+
updatedAt: new Date(Date.now() - 2 * 60 * 60 * 1000).toISOString(), // 2 hours ago
|
|
34
|
+
createdAt: new Date(Date.now() - 10 * 24 * 60 * 60 * 1000).toISOString(), // 10 days ago
|
|
35
|
+
upvoteCount: 24,
|
|
36
|
+
hasUpvoted: false,
|
|
37
|
+
};
|
|
38
|
+
const sampleUpvotedEnhancementIssue = Object.assign(Object.assign({}, sampleEnhancementIssue), { id: 'issue-enhancement-upvoted', hasUpvoted: true });
|
|
39
|
+
const samplePinnedIssue = Object.assign(Object.assign({}, sampleEnhancementIssue), { id: 'issue-enhancement-pinned', pinnedAt: new Date(Date.now() - 3 * 24 * 60 * 60 * 1000).toISOString() });
|
|
40
|
+
const meta = {
|
|
41
|
+
title: 'Components/Issue',
|
|
42
|
+
component: 'feedlog-issue',
|
|
43
|
+
parameters: {
|
|
44
|
+
layout: 'centered',
|
|
45
|
+
},
|
|
46
|
+
argTypes: {
|
|
47
|
+
issue: {
|
|
48
|
+
control: 'object',
|
|
49
|
+
description: 'The issue to display',
|
|
50
|
+
},
|
|
51
|
+
theme: {
|
|
52
|
+
control: 'select',
|
|
53
|
+
options: ['light', 'dark'],
|
|
54
|
+
description: 'Theme variant',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
args: {
|
|
58
|
+
issue: sampleEnhancementIssue,
|
|
59
|
+
theme: 'light',
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
export default meta;
|
|
63
|
+
export const Default = {
|
|
64
|
+
args: {
|
|
65
|
+
issue: sampleEnhancementIssue,
|
|
66
|
+
},
|
|
67
|
+
render: (props) => h("feedlog-issue", Object.assign({}, props)),
|
|
68
|
+
};
|
|
69
|
+
export const Bug = {
|
|
70
|
+
args: {
|
|
71
|
+
issue: sampleBugIssue,
|
|
72
|
+
},
|
|
73
|
+
render: (props) => h("feedlog-issue", Object.assign({}, props)),
|
|
74
|
+
};
|
|
75
|
+
export const Upvoted = {
|
|
76
|
+
args: {
|
|
77
|
+
issue: sampleUpvotedEnhancementIssue,
|
|
78
|
+
},
|
|
79
|
+
render: (props) => h("feedlog-issue", Object.assign({}, props)),
|
|
80
|
+
};
|
|
81
|
+
export const Pinned = {
|
|
82
|
+
args: {
|
|
83
|
+
issue: samplePinnedIssue,
|
|
84
|
+
},
|
|
85
|
+
render: (props) => h("feedlog-issue", Object.assign({}, props)),
|
|
86
|
+
};
|
|
87
|
+
export const DarkTheme = {
|
|
88
|
+
args: {
|
|
89
|
+
issue: sampleEnhancementIssue,
|
|
90
|
+
theme: 'dark',
|
|
91
|
+
},
|
|
92
|
+
render: (props) => h("feedlog-issue", Object.assign({}, props)),
|
|
93
|
+
};
|
|
94
|
+
export const DarkThemeBug = {
|
|
95
|
+
args: {
|
|
96
|
+
issue: sampleBugIssue,
|
|
97
|
+
theme: 'dark',
|
|
98
|
+
},
|
|
99
|
+
render: (props) => h("feedlog-issue", Object.assign({}, props)),
|
|
100
|
+
};
|
|
101
|
+
export const DarkThemePinned = {
|
|
102
|
+
args: {
|
|
103
|
+
issue: samplePinnedIssue,
|
|
104
|
+
theme: 'dark',
|
|
105
|
+
},
|
|
106
|
+
render: (props) => h("feedlog-issue", Object.assign({}, props)),
|
|
107
|
+
};
|
|
108
|
+
export const HighUpvoteCount = {
|
|
109
|
+
args: {
|
|
110
|
+
issue: Object.assign(Object.assign({}, sampleEnhancementIssue), { id: 'issue-high-upvote', upvoteCount: 156 }),
|
|
111
|
+
},
|
|
112
|
+
render: (props) => h("feedlog-issue", Object.assign({}, props)),
|
|
113
|
+
};
|
|
@@ -3,4 +3,4 @@ export * from './feedlog-badge/feedlog-badge';
|
|
|
3
3
|
export * from './feedlog-button/feedlog-button';
|
|
4
4
|
export * from './feedlog-github-issues/feedlog-github-issues';
|
|
5
5
|
export * from './feedlog-github-issues-client/feedlog-github-issues-client';
|
|
6
|
-
export * from './feedlog-
|
|
6
|
+
export * from './feedlog-issue/feedlog-issue';
|
|
@@ -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-
|
|
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-5qPAHrMz.js";import{d as a}from"./p-DaNa3wCt.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.handleUpvote=async t=>{if(!this.sdk)return;const{issueId:e,currentUpvoted:s,currentCount:i}=t.detail;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);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){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()}componentDidUpdate(){(this.previousType!==this.type||this.previousLimit!==this.limit)&&(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)try{this.loading=!0,this.error=null;const t={};this.type&&(t.type=this.type),this.limit&&(t.limit=this.limit),this.cursor&&(t.cursor=this.cursor);const e=await this.sdk.fetchIssues(t);this.issues=e.issues,this.cursor=e.pagination.cursor,this.hasMore=e.pagination.hasMore}catch(t){const e=t instanceof Error?t.message:"Failed to fetch issues";this.error=e,this.issues=[],this.feedlogError.emit({error:e,code:null==t?void 0:t.statusCode})}finally{this.loading=!1,this.isLoadingMore=!1}}async loadMore(){if(this.sdk&&this.hasMore&&!this.isLoadingMore&&!this.loading){this.isLoadingMore=!0;try{const t={};this.type&&(t.type=this.type),this.limit&&(t.limit=this.limit),this.cursor&&(t.cursor=this.cursor);const e=await this.sdk.fetchIssues(t);this.issues=[...this.issues,...e.issues],this.cursor=e.pagination.cursor,this.hasMore=e.pagination.hasMore}catch(t){this.feedlogError.emit({error:t instanceof Error?t.message:"Failed to load more issues",code:null==t?void 0:t.statusCode})}finally{this.isLoadingMore=!1}}}render(){return o("feedlog-github-issues",{key:"9b12fc472a905e7117b383ccdf2c0a995f480366",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 m=w,b=g;export{m as FeedlogGithubIssuesClient,b as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as
|
|
1
|
+
import{F as o,d as r}from"./p-5qPAHrMz.js";const s=o,p=r;export{s as FeedlogGithubIssues,p as defineCustomElement}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Components, JSX } from "../types/components";
|
|
2
2
|
|
|
3
|
-
interface
|
|
4
|
-
export const
|
|
5
|
-
prototype:
|
|
6
|
-
new ():
|
|
3
|
+
interface FeedlogIssue extends Components.FeedlogIssue, HTMLElement {}
|
|
4
|
+
export const FeedlogIssue: {
|
|
5
|
+
prototype: FeedlogIssue;
|
|
6
|
+
new (): FeedlogIssue;
|
|
7
7
|
};
|
|
8
8
|
/**
|
|
9
9
|
* Used to define this component and all nested components recursively.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as a,d as o}from"./p-DaNa3wCt.js";const s=a,t=o;export{s as FeedlogIssue,t as defineCustomElement}
|