@feedlog-ai/webcomponents 0.0.36 → 0.0.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -17
- package/dist/cjs/feedlog-badge.cjs.entry.js +3 -3
- package/dist/cjs/feedlog-button_3.cjs.entry.js +16 -1385
- package/dist/cjs/feedlog-card.cjs.entry.js +3 -3
- package/dist/cjs/feedlog-issues-client.cjs.entry.js +102 -74
- package/dist/cjs/feedlog-issues.cjs.entry.js +4 -11
- package/dist/cjs/feedlog-toolkit.cjs.js +2 -2
- package/dist/cjs/{index-CXKBwRlh.js → index-prPyjPBk.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/purify.es-ppGw41aq.js +1384 -0
- package/dist/collection/components/feedlog-badge/feedlog-badge.css +35 -45
- package/dist/collection/components/feedlog-badge/feedlog-badge.js +1 -1
- package/dist/collection/components/feedlog-button/feedlog-button.css +16 -66
- package/dist/collection/components/feedlog-button/feedlog-button.js +1 -1
- package/dist/collection/components/feedlog-card/feedlog-card.css +22 -24
- package/dist/collection/components/feedlog-card/feedlog-card.js +1 -1
- package/dist/collection/components/feedlog-card/feedlog-card.stories.js +1 -1
- package/dist/collection/components/feedlog-issue/feedlog-issue.css +99 -187
- package/dist/collection/components/feedlog-issue/feedlog-issue.js +1 -1
- package/dist/collection/components/feedlog-issue/feedlog-issue.stories.js +19 -19
- package/dist/collection/components/feedlog-issues/feedlog-issues.css +34 -63
- package/dist/collection/components/feedlog-issues/feedlog-issues.js +2 -14
- package/dist/collection/components/feedlog-issues/feedlog-issues.stories.js +72 -52
- package/dist/collection/components/feedlog-issues-client/feedlog-issues-client.js +22 -28
- package/dist/collection/components/feedlog-issues-list/feedlog-issues-list.js +3 -3
- package/dist/collection/utils/markdown.js +6 -1
- package/dist/components/feedlog-badge.js +1 -1
- package/dist/components/feedlog-button.js +1 -1
- package/dist/components/feedlog-card.js +1 -1
- package/dist/components/feedlog-issue.js +1 -1
- package/dist/components/feedlog-issues-client.js +1 -1
- package/dist/components/feedlog-issues-list.js +1 -1
- package/dist/components/feedlog-issues.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/p-BoxVrJId.js +1 -0
- package/dist/components/{p-BRjVS8bz.js → p-CvIMO_S7.js} +2 -2
- package/dist/components/p-DFD585IK.js +1 -0
- package/dist/components/p-I6NOP29P.js +1 -0
- package/dist/components/p-fDVosM5p.js +1 -0
- package/dist/esm/feedlog-badge.entry.js +3 -3
- package/dist/esm/feedlog-button_3.entry.js +15 -1384
- package/dist/esm/feedlog-card.entry.js +3 -3
- package/dist/esm/feedlog-issues-client.entry.js +102 -74
- package/dist/esm/feedlog-issues.entry.js +4 -11
- package/dist/esm/feedlog-toolkit.js +3 -3
- package/dist/esm/{index-CgNWSmzU.js → index-Cu1eYdKa.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/purify.es-Bow7VsVH.js +1381 -0
- package/dist/feedlog-toolkit/feedlog-toolkit.css +1 -1
- package/dist/feedlog-toolkit/feedlog-toolkit.esm.js +1 -1
- package/dist/feedlog-toolkit/p-001d7353.entry.js +1 -0
- package/dist/feedlog-toolkit/p-556062d0.entry.js +1 -0
- package/dist/feedlog-toolkit/p-62554649.entry.js +1 -0
- package/dist/feedlog-toolkit/p-Bow7VsVH.js +2 -0
- package/dist/feedlog-toolkit/p-Cu1eYdKa.js +2 -0
- package/dist/feedlog-toolkit/p-b558fc9f.entry.js +1 -0
- package/dist/feedlog-toolkit/p-ca90ade9.entry.js +1 -0
- package/dist/types/components/feedlog-issues/feedlog-issues.d.ts +0 -5
- package/dist/types/components/feedlog-issues-client/feedlog-issues-client.d.ts +1 -0
- package/dist/types/index.d.ts +1 -1
- package/hydrate/index.js +130 -101
- package/hydrate/index.mjs +130 -101
- package/package.json +4 -7
- package/dist/components/p-BBbiSGNf.js +0 -1
- package/dist/components/p-CuFKEckF.js +0 -1
- package/dist/components/p-DMdb-G26.js +0 -1
- package/dist/components/p-DzATWlAC.js +0 -1
- package/dist/feedlog-toolkit/p-32663f65.entry.js +0 -1
- package/dist/feedlog-toolkit/p-891c349f.entry.js +0 -3
- package/dist/feedlog-toolkit/p-CgNWSmzU.js +0 -2
- package/dist/feedlog-toolkit/p-b51c95a6.entry.js +0 -1
- package/dist/feedlog-toolkit/p-da0268a8.entry.js +0 -1
- package/dist/feedlog-toolkit/p-f22117ae.entry.js +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-
|
|
1
|
+
import { r as registerInstance, h } from './index-Cu1eYdKa.js';
|
|
2
2
|
|
|
3
|
-
const feedlogCardCss = () => `:host{display:block;font-family:
|
|
3
|
+
const feedlogCardCss = () => `:host{display:block;font-family:var(--feedlog-font-family)}.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-shadow-sm);transition:box-shadow 0.15s ease;position:relative;display:flex;flex-direction:column}.feedlog-card:hover{box-shadow:var(--feedlog-shadow)}.feedlog-card-header{padding:var(--feedlog-space-6);display:flex;flex-direction:column;gap:var(--feedlog-space-1)}.feedlog-card-content{padding:var(--feedlog-space-6);padding-top:0}.feedlog-card-footer{padding:var(--feedlog-space-6);padding-top:0;display:flex;align-items:center}::slotted([slot="header"]),::slotted([slot="content"]),::slotted([slot="footer"]){display:block}`;
|
|
4
4
|
|
|
5
5
|
const FeedlogCard = class {
|
|
6
6
|
constructor(hostRef) {
|
|
7
7
|
registerInstance(this, hostRef);
|
|
8
8
|
}
|
|
9
9
|
render() {
|
|
10
|
-
return (h("div", { key: '
|
|
10
|
+
return (h("div", { key: 'c95d00e338fcf8d985407cda878f50d173c86c71', class: "feedlog-card", part: "base" }, h("div", { key: '5001f2e08495d54abb59ddcada568c9ff4c6fb87', class: "feedlog-card-header", part: "header" }, h("slot", { key: 'b6c6f18a458249aedfb4a95679d4592cfcac4187', name: "header" })), h("div", { key: '99faa1bd9af52fb23cb304e0a87d35b8e14a6358', class: "feedlog-card-content", part: "content" }, h("slot", { key: '44370b05b0c2335d6c7271f2807189a7a208be71', name: "content" })), h("div", { key: 'e3876d4f589f9ecf917b5a9b5919363c19d08c93', class: "feedlog-card-footer", part: "footer" }, h("slot", { key: 'be69074d341c8e88f9227d2f035f22838469b035', name: "footer" }))));
|
|
11
11
|
}
|
|
12
12
|
};
|
|
13
13
|
FeedlogCard.style = feedlogCardCss();
|
|
@@ -1,36 +1,64 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, a as getElement } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, a as getElement } from './index-Cu1eYdKa.js';
|
|
2
|
+
import { p as purify_es } from './purify.es-Bow7VsVH.js';
|
|
3
|
+
|
|
4
|
+
function getDefaultExportFromCjs (x) {
|
|
5
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
function getAugmentedNamespace(n) {
|
|
9
|
+
if (n.__esModule) return n;
|
|
10
|
+
var f = n.default;
|
|
11
|
+
if (typeof f == "function") {
|
|
12
|
+
var a = function a () {
|
|
13
|
+
if (this instanceof a) {
|
|
14
|
+
return Reflect.construct(f, arguments, this.constructor);
|
|
15
|
+
}
|
|
16
|
+
return f.apply(this, arguments);
|
|
17
|
+
};
|
|
18
|
+
a.prototype = f.prototype;
|
|
19
|
+
} else a = {};
|
|
20
|
+
Object.defineProperty(a, '__esModule', {value: true});
|
|
21
|
+
Object.keys(n).forEach(function (k) {
|
|
22
|
+
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
23
|
+
Object.defineProperty(a, k, d.get ? d : {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function () {
|
|
26
|
+
return n[k];
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
return a;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
var require$$0 = /*@__PURE__*/getAugmentedNamespace(purify_es);
|
|
34
|
+
|
|
35
|
+
var browser;
|
|
36
|
+
var hasRequiredBrowser;
|
|
37
|
+
|
|
38
|
+
function requireBrowser () {
|
|
39
|
+
if (hasRequiredBrowser) return browser;
|
|
40
|
+
hasRequiredBrowser = 1;
|
|
41
|
+
browser = self.DOMPurify || (self.DOMPurify = require$$0.default || require$$0);
|
|
42
|
+
return browser;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
var browserExports = requireBrowser();
|
|
46
|
+
var DOMPurify = /*@__PURE__*/getDefaultExportFromCjs(browserExports);
|
|
2
47
|
|
|
3
48
|
/**
|
|
4
49
|
* HTML and XSS sanitization utilities
|
|
5
50
|
*/
|
|
6
51
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* Sanitize HTML by removing dangerous tags and attributes
|
|
12
|
-
* Removes script tags, event handlers, and other potentially malicious content
|
|
52
|
+
* Sanitize HTML using DOMPurify (safe for untrusted content).
|
|
53
|
+
* Removes scripts, dangerous URLs, and unsafe attributes.
|
|
13
54
|
*/
|
|
14
55
|
function sanitizeHtml(html) {
|
|
15
56
|
if (typeof html !== 'string') {
|
|
16
57
|
return '';
|
|
17
58
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
sanitized = sanitized.replace(/\s*on\w+\s*=\s*["'][^"']*["']/gi, '');
|
|
22
|
-
sanitized = sanitized.replace(/\s*on\w+\s*=\s*[^\s>]*/gi, '');
|
|
23
|
-
// Remove iframe tags
|
|
24
|
-
sanitized = sanitized.replace(/<iframe\b[^<]*(?:(?!<\/iframe>)<[^<]*)*<\/iframe>/gi, '');
|
|
25
|
-
// Remove style tags
|
|
26
|
-
sanitized = sanitized.replace(/<style\b[^<]*(?:(?!<\/style>)<[^<]*)*<\/style>/gi, '');
|
|
27
|
-
// Remove embed and object tags
|
|
28
|
-
sanitized = sanitized.replace(/<(embed|object)\b[^<]*>/gi, '');
|
|
29
|
-
// Remove javascript: protocol
|
|
30
|
-
sanitized = sanitized.replace(/javascript:/gi, '');
|
|
31
|
-
// Remove data: protocol for potentially dangerous mime types
|
|
32
|
-
sanitized = sanitized.replace(/data:(?!image\/(?:png|jpg|jpeg|gif|webp);)/gi, '');
|
|
33
|
-
return sanitized;
|
|
59
|
+
return DOMPurify.sanitize(html, {
|
|
60
|
+
USE_PROFILES: { html: true },
|
|
61
|
+
});
|
|
34
62
|
}
|
|
35
63
|
|
|
36
64
|
/**
|
|
@@ -111,13 +139,7 @@ class FeedlogSDK {
|
|
|
111
139
|
return this.validateIssuesResponse(data);
|
|
112
140
|
}
|
|
113
141
|
catch (error) {
|
|
114
|
-
|
|
115
|
-
throw error;
|
|
116
|
-
}
|
|
117
|
-
if (error instanceof TypeError && error.message.includes('fetch')) {
|
|
118
|
-
throw new FeedlogNetworkError('Network error: Unable to reach API', undefined, error);
|
|
119
|
-
}
|
|
120
|
-
throw new FeedlogError(`Failed to fetch issues: ${error instanceof Error ? error.message : 'Unknown error'}`, undefined, error);
|
|
142
|
+
this.wrapFetchError(error, 'Failed to fetch issues');
|
|
121
143
|
}
|
|
122
144
|
}
|
|
123
145
|
/**
|
|
@@ -152,13 +174,7 @@ class FeedlogSDK {
|
|
|
152
174
|
return this.validateUpvoteResponse(data);
|
|
153
175
|
}
|
|
154
176
|
catch (error) {
|
|
155
|
-
|
|
156
|
-
throw error;
|
|
157
|
-
}
|
|
158
|
-
if (error instanceof TypeError && error.message.includes('fetch')) {
|
|
159
|
-
throw new FeedlogNetworkError('Network error: Unable to reach API', undefined, error);
|
|
160
|
-
}
|
|
161
|
-
throw new FeedlogError(`Failed to toggle upvote: ${error instanceof Error ? error.message : 'Unknown error'}`, undefined, error);
|
|
177
|
+
this.wrapFetchError(error, 'Failed to toggle upvote');
|
|
162
178
|
}
|
|
163
179
|
}
|
|
164
180
|
/**
|
|
@@ -185,7 +201,9 @@ class FeedlogSDK {
|
|
|
185
201
|
url.searchParams.set('cursor', params.cursor);
|
|
186
202
|
}
|
|
187
203
|
if (params.limit !== undefined) {
|
|
188
|
-
|
|
204
|
+
const n = Number(params.limit);
|
|
205
|
+
const clamped = Number.isFinite(n) ? Math.max(1, Math.min(100, Math.floor(n))) : 10;
|
|
206
|
+
url.searchParams.set('limit', String(clamped));
|
|
189
207
|
}
|
|
190
208
|
return url.toString();
|
|
191
209
|
}
|
|
@@ -193,13 +211,19 @@ class FeedlogSDK {
|
|
|
193
211
|
* Get request headers
|
|
194
212
|
*/
|
|
195
213
|
getAuthHeaders() {
|
|
196
|
-
|
|
214
|
+
return {
|
|
197
215
|
'Content-Type': 'application/json',
|
|
216
|
+
'x-api-key': this.apiKey,
|
|
198
217
|
};
|
|
199
|
-
|
|
200
|
-
|
|
218
|
+
}
|
|
219
|
+
wrapFetchError(error, context) {
|
|
220
|
+
if (error instanceof FeedlogError) {
|
|
221
|
+
throw error;
|
|
222
|
+
}
|
|
223
|
+
if (error instanceof TypeError && error.message.includes('fetch')) {
|
|
224
|
+
throw new FeedlogNetworkError('Network error: Unable to reach API', undefined, error);
|
|
201
225
|
}
|
|
202
|
-
|
|
226
|
+
throw new FeedlogError(`${context}: ${error instanceof Error ? error.message : 'Unknown error'}`, undefined, error);
|
|
203
227
|
}
|
|
204
228
|
/**
|
|
205
229
|
* Fetch with timeout support using AbortController
|
|
@@ -284,13 +308,23 @@ class FeedlogSDK {
|
|
|
284
308
|
const repoName = rawRepoName != null && rawRepoName !== '' ? String(rawRepoName) : null;
|
|
285
309
|
const rawRepoDesc = repo.description;
|
|
286
310
|
const repoDescription = rawRepoDesc != null && rawRepoDesc !== '' ? sanitizeHtml(String(rawRepoDesc)) : null;
|
|
311
|
+
const revision = typeof issue.revision === 'number' && Number.isFinite(issue.revision) ? issue.revision : 1;
|
|
312
|
+
const upvoteCount = typeof issue.upvoteCount === 'number' && Number.isFinite(issue.upvoteCount)
|
|
313
|
+
? issue.upvoteCount
|
|
314
|
+
: 0;
|
|
315
|
+
const updatedAt = typeof issue.updatedAt === 'string' && issue.updatedAt.length > 0
|
|
316
|
+
? issue.updatedAt
|
|
317
|
+
: new Date().toISOString();
|
|
318
|
+
const createdAt = typeof issue.createdAt === 'string' && issue.createdAt.length > 0
|
|
319
|
+
? issue.createdAt
|
|
320
|
+
: new Date().toISOString();
|
|
287
321
|
return {
|
|
288
322
|
id: String(issue.id),
|
|
289
323
|
githubIssueLink,
|
|
290
324
|
type: issue.type || 'bug',
|
|
291
325
|
status: issue.status || 'open',
|
|
292
326
|
pinnedAt: issue.pinnedAt ? String(issue.pinnedAt) : null,
|
|
293
|
-
revision
|
|
327
|
+
revision,
|
|
294
328
|
title: sanitizedTitle,
|
|
295
329
|
body: sanitizedBody,
|
|
296
330
|
repository: {
|
|
@@ -298,9 +332,9 @@ class FeedlogSDK {
|
|
|
298
332
|
name: repoName,
|
|
299
333
|
description: repoDescription,
|
|
300
334
|
},
|
|
301
|
-
updatedAt
|
|
302
|
-
createdAt
|
|
303
|
-
upvoteCount
|
|
335
|
+
updatedAt,
|
|
336
|
+
createdAt,
|
|
337
|
+
upvoteCount,
|
|
304
338
|
hasUpvoted: Boolean(issue.hasUpvoted),
|
|
305
339
|
};
|
|
306
340
|
}
|
|
@@ -435,7 +469,9 @@ const FeedlogIssuesClient = class {
|
|
|
435
469
|
this.cursor = null;
|
|
436
470
|
this.hasMore = false;
|
|
437
471
|
this.issues = [];
|
|
438
|
-
this.fetchIssues()
|
|
472
|
+
void this.fetchIssues().catch(() => {
|
|
473
|
+
/* errors handled inside fetchIssues */
|
|
474
|
+
});
|
|
439
475
|
this.previousType = this.type;
|
|
440
476
|
this.previousLimit = this.limit;
|
|
441
477
|
this.previousSortBy = this.sortBy;
|
|
@@ -455,6 +491,22 @@ const FeedlogIssuesClient = class {
|
|
|
455
491
|
this.feedlogError.emit({ error: errorMsg });
|
|
456
492
|
}
|
|
457
493
|
}
|
|
494
|
+
buildFetchParams() {
|
|
495
|
+
const params = {};
|
|
496
|
+
if (this.type) {
|
|
497
|
+
params.type = this.type;
|
|
498
|
+
}
|
|
499
|
+
if (this.sortBy) {
|
|
500
|
+
params.sortBy = this.sortBy;
|
|
501
|
+
}
|
|
502
|
+
if (this.limit) {
|
|
503
|
+
params.limit = this.limit;
|
|
504
|
+
}
|
|
505
|
+
if (this.cursor) {
|
|
506
|
+
params.cursor = this.cursor;
|
|
507
|
+
}
|
|
508
|
+
return params;
|
|
509
|
+
}
|
|
458
510
|
async fetchIssues() {
|
|
459
511
|
if (!this.sdk) {
|
|
460
512
|
return;
|
|
@@ -464,19 +516,7 @@ const FeedlogIssuesClient = class {
|
|
|
464
516
|
try {
|
|
465
517
|
this.loading = true;
|
|
466
518
|
this.error = null;
|
|
467
|
-
const params =
|
|
468
|
-
if (this.type) {
|
|
469
|
-
params.type = this.type;
|
|
470
|
-
}
|
|
471
|
-
if (this.sortBy) {
|
|
472
|
-
params.sortBy = this.sortBy;
|
|
473
|
-
}
|
|
474
|
-
if (this.limit) {
|
|
475
|
-
params.limit = this.limit;
|
|
476
|
-
}
|
|
477
|
-
if (this.cursor) {
|
|
478
|
-
params.cursor = this.cursor;
|
|
479
|
-
}
|
|
519
|
+
const params = this.buildFetchParams();
|
|
480
520
|
const response = await this.sdk.fetchIssues(params);
|
|
481
521
|
// Ignore response if component disconnected or a newer request was made
|
|
482
522
|
if (this.isDisconnected || currentRequestId !== this.fetchRequestId) {
|
|
@@ -515,19 +555,7 @@ const FeedlogIssuesClient = class {
|
|
|
515
555
|
const currentRequestId = this.fetchRequestId;
|
|
516
556
|
this.isLoadingMore = true;
|
|
517
557
|
try {
|
|
518
|
-
const params =
|
|
519
|
-
if (this.type) {
|
|
520
|
-
params.type = this.type;
|
|
521
|
-
}
|
|
522
|
-
if (this.sortBy) {
|
|
523
|
-
params.sortBy = this.sortBy;
|
|
524
|
-
}
|
|
525
|
-
if (this.limit) {
|
|
526
|
-
params.limit = this.limit;
|
|
527
|
-
}
|
|
528
|
-
if (this.cursor) {
|
|
529
|
-
params.cursor = this.cursor;
|
|
530
|
-
}
|
|
558
|
+
const params = this.buildFetchParams();
|
|
531
559
|
const response = await this.sdk.fetchIssues(params);
|
|
532
560
|
// Ignore response if component disconnected or a newer request was made
|
|
533
561
|
if (this.isDisconnected || currentRequestId !== this.fetchRequestId) {
|
|
@@ -562,7 +590,7 @@ const FeedlogIssuesClient = class {
|
|
|
562
590
|
const style = hostBg
|
|
563
591
|
? { '--feedlog-background': hostBg }
|
|
564
592
|
: undefined;
|
|
565
|
-
return (h("feedlog-issues", { key: '
|
|
593
|
+
return (h("feedlog-issues", { key: '2d9528bb33630664824ab584e10208359d579eb6', style: style, issues: this.issues, limit: this.limit, maxWidth: this.maxWidth, theme: this.theme, heading: this.heading, subtitle: this.subtitle, emptyStateTitle: this.emptyStateTitle, emptyStateMessage: this.emptyStateMessage, getIssueUrl: this.getIssueUrl, loading: this.loading, error: this.error, hasMore: this.hasMore, isLoadingMore: this.isLoadingMore, onFeedlogUpvote: this.handleUpvote, onFeedlogLoadMore: async () => this.loadMore(), part: "base" }, h("slot", { key: 'efe89b9fd0f337af7930823762296487ebcb758e', name: "header", slot: "header" }), h("slot", { key: 'ffebd688ebf25bb464ceefd6a161f7140e03933b', name: "loading", slot: "loading" }), h("slot", { key: 'b59010966b6f7768814ba838c05ffd62cfd1c26a', name: "error", slot: "error" }), h("slot", { key: '99b1abfcbb62703b3642fb02d79d8d1488421ee3', name: "empty-state", slot: "empty-state" }), h("slot", { key: 'c47c1dc83e8434b8f66d1b42b65e812aa5e1f8ee', name: "load-more", slot: "load-more" })));
|
|
566
594
|
}
|
|
567
595
|
get el() { return getElement(this); }
|
|
568
596
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host } from './index-Cu1eYdKa.js';
|
|
2
2
|
|
|
3
|
-
const feedlogIssuesCss = () => `:host{display:block;font-family:
|
|
3
|
+
const feedlogIssuesCss = () => `:host{display:block;font-family:var(--feedlog-font-family);--feedlog-theme-bg:var(--feedlog-background);--feedlog-gap:var(--feedlog-space-2);--feedlog-padding:var(--feedlog-space-8);--feedlog-min-height:100%}:host(.dark){--feedlog-theme-bg:var(--feedlog-background)}.issues-container{min-height:var(--feedlog-min-height);background-color:var(--feedlog-background, var(--feedlog-theme-bg, #ffffff));padding:var(--feedlog-padding);margin:0 auto;border-radius:var(--feedlog-radius-lg)}.issues-header{margin-bottom:var(--feedlog-space-6);display:flex;align-items:flex-start;justify-content:space-between}.header-content{flex:1}.issues-title{color:var(--feedlog-foreground);margin:0 0 var(--feedlog-space-1) 0;font-size:var(--feedlog-text-xl);font-weight:var(--feedlog-font-semibold);line-height:1.5}.issues-subtitle{color:var(--feedlog-muted-foreground);font-size:var(--feedlog-text-sm);margin:0}.loading-state{padding:0}.loading-skeletons{display:flex;flex-direction:column;gap:var(--feedlog-gap)}.skeleton-card{background-color:var(--feedlog-card);border:1px solid var(--feedlog-border);border-radius:var(--feedlog-radius);box-shadow:var(--feedlog-shadow-sm);position:relative;overflow:hidden}.skeleton-card::before{content:'';position:absolute;left:0;top:0;bottom:0;width:3px;background:var(--feedlog-muted)}.skeleton-content{padding:var(--feedlog-space-5);padding-left:calc(var(--feedlog-space-5) + 3px);display:flex;flex-direction:column;gap:var(--feedlog-space-3)}.skeleton-header{display:flex;align-items:center;justify-content:space-between;gap:var(--feedlog-space-3)}.skeleton-badge{width:4.5rem;height:1.25rem;border-radius:var(--feedlog-radius-sm);background-color:var(--feedlog-muted);animation:skeleton-pulse 1.5s ease-in-out infinite}.skeleton-timestamp{width:3rem;height:0.75rem;border-radius:var(--feedlog-radius-sm);background-color:var(--feedlog-muted);animation:skeleton-pulse 1.5s ease-in-out infinite 0.2s}.skeleton-main{display:flex;flex-direction:column;gap:var(--feedlog-space-2)}.skeleton-title{height:0.9375rem;border-radius:var(--feedlog-radius-sm);background-color:var(--feedlog-muted);animation:skeleton-pulse 1.5s ease-in-out infinite 0.1s;width:85%}.skeleton-body{display:flex;flex-direction:column;gap:var(--feedlog-space-1)}.skeleton-line{height:0.8125rem;border-radius:var(--feedlog-radius-sm);background-color:var(--feedlog-muted);animation:skeleton-pulse 1.5s ease-in-out infinite 0.15s;width:100%}.skeleton-line.short{width:70%}.skeleton-repo{width:6rem;height:0.75rem;border-radius:var(--feedlog-radius-sm);background-color:var(--feedlog-muted);animation:skeleton-pulse 1.5s ease-in-out infinite 0.25s}.skeleton-footer{display:flex;justify-content:flex-end}.skeleton-upvote{width:2.5rem;height:2rem;border-radius:var(--feedlog-radius);background-color:var(--feedlog-muted);animation:skeleton-pulse 1.5s ease-in-out infinite 0.3s}@keyframes skeleton-pulse{0%,100%{opacity:1}50%{opacity:0.5}}.error-state{display:flex;align-items:center;justify-content:center;padding:var(--feedlog-space-10) var(--feedlog-space-8);min-height:12rem}.error-state-content{display:flex;flex-direction:column;align-items:center;text-align:center;max-width:20rem;padding:var(--feedlog-space-8)}.error-icon{color:var(--feedlog-muted-foreground);opacity:0.8;margin-bottom:var(--feedlog-space-4)}.error-state-title{margin:0 0 var(--feedlog-space-2) 0;font-size:var(--feedlog-text-lg);font-weight:var(--feedlog-font-semibold);color:var(--feedlog-foreground);line-height:1.4}.error-state-message{margin:0 0 var(--feedlog-space-5) 0;font-size:var(--feedlog-text-sm);color:var(--feedlog-muted-foreground);line-height:1.5}.load-more-container{display:flex;justify-content:center;padding:var(--feedlog-space-8) 0;gap:var(--feedlog-space-4)}`;
|
|
4
4
|
|
|
5
5
|
const FeedlogIssues = class {
|
|
6
6
|
constructor(hostRef) {
|
|
@@ -35,10 +35,6 @@ const FeedlogIssues = class {
|
|
|
35
35
|
* Whether more issues are currently loading
|
|
36
36
|
*/
|
|
37
37
|
this.isLoadingMore = false;
|
|
38
|
-
/**
|
|
39
|
-
* Internal state for theme
|
|
40
|
-
*/
|
|
41
|
-
this.currentTheme = 'light';
|
|
42
38
|
this.handleUpvote = (event) => {
|
|
43
39
|
event.stopPropagation();
|
|
44
40
|
this.feedlogUpvote.emit(event.detail);
|
|
@@ -47,21 +43,18 @@ const FeedlogIssues = class {
|
|
|
47
43
|
this.feedlogLoadMore.emit();
|
|
48
44
|
};
|
|
49
45
|
}
|
|
50
|
-
componentWillLoad() {
|
|
51
|
-
this.currentTheme = this.theme;
|
|
52
|
-
}
|
|
53
46
|
renderErrorIcon() {
|
|
54
47
|
return (h("svg", { class: "error-icon", xmlns: "http://www.w3.org/2000/svg", width: "48", height: "48", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("circle", { cx: "12", cy: "12", r: "10" }), h("line", { x1: "12", y1: "8", x2: "12", y2: "12" }), h("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" })));
|
|
55
48
|
}
|
|
56
49
|
renderIssuesList() {
|
|
57
50
|
var _a, _b;
|
|
58
|
-
return (h("feedlog-issues-list", { issues: this.issues, limit: this.limit, theme: this.
|
|
51
|
+
return (h("feedlog-issues-list", { issues: this.issues, limit: this.limit, theme: this.theme, getIssueUrl: this.getIssueUrl, emptyStateTitle: (_a = this.emptyStateTitle) !== null && _a !== void 0 ? _a : 'No updates yet', emptyStateMessage: (_b = this.emptyStateMessage) !== null && _b !== void 0 ? _b : 'Check back later for new updates.', onFeedlogUpvote: (e) => this.handleUpvote(e), part: "issues-list" }, h("slot", { name: "empty-state", slot: "empty-state" })));
|
|
59
52
|
}
|
|
60
53
|
render() {
|
|
61
54
|
const containerStyle = {
|
|
62
55
|
maxWidth: this.maxWidth,
|
|
63
56
|
};
|
|
64
|
-
return (h(Host, { key: '
|
|
57
|
+
return (h(Host, { key: '79835dd61383b41124f48d204977951236a7f8ce', class: this.theme === 'dark' ? 'dark' : '' }, h("div", { key: '62228927cba9bd4cf58d8b4f3ec2751ba423dd67', class: "issues-container", style: containerStyle, part: "base" }, h("slot", { key: 'c57d46adc472c2b03857db3e07cc5b549bd110f1', name: "header" }, (this.heading || this.subtitle) && (h("header", { key: '080059a002a373d76bee863b368a12ffdba59384', class: "issues-header", part: "header" }, h("div", { key: 'db85f995fb6f1f9fe961ea6726cf82da17fc9c2d', class: "header-content", part: "header-content" }, this.heading && (h("h1", { key: 'e7b510ecd2039072b384d6dcb531ebf0b091010b', class: "issues-title", part: "title" }, this.heading)), this.subtitle && (h("p", { key: '323f9a635b6a1c2ca9d955d12dc1925c0be59cf8', class: "issues-subtitle", part: "subtitle" }, this.subtitle)))))), this.loading && (h("slot", { key: 'ba63923aa7cac4b3ab050b423d5f65dcbbe81677', name: "loading" }, h("div", { key: '4bf1fc0d367acb0285eb124875c42e541939d388', class: "loading-state", role: "status", "aria-label": "Loading issues", part: "loading-state" }, h("div", { key: 'fa369824bd1cb8e3b5c393613952611658e6919a', class: "loading-skeletons", part: "loading-skeletons" }, [1, 2, 3].map(i => (h("div", { key: i, class: "skeleton-card", part: "skeleton-card" }, h("div", { class: "skeleton-content", part: "skeleton-content" }, h("div", { class: "skeleton-header", part: "skeleton-header" }, h("div", { class: "skeleton-badge", part: "skeleton-badge" }), h("div", { class: "skeleton-timestamp", part: "skeleton-timestamp" })), h("div", { class: "skeleton-main", part: "skeleton-main" }, h("div", { class: "skeleton-title", part: "skeleton-title" }), h("div", { class: "skeleton-body", part: "skeleton-body" }, h("div", { class: "skeleton-line", part: "skeleton-line" }), h("div", { class: "skeleton-line short", part: "skeleton-line short" })), h("div", { class: "skeleton-repo", part: "skeleton-repo" })), h("div", { class: "skeleton-footer", part: "skeleton-footer" }, h("div", { class: "skeleton-upvote", part: "skeleton-upvote" })))))))))), this.error && (h("slot", { key: '5ad8c400e465213de6e9d1f2a4d5e70c86a7ca2d', name: "error" }, h("div", { key: '0a1a62f25e9ccac249ea7426cc7839e95a24b60f', class: "error-state", role: "alert", part: "error-state" }, h("div", { key: '3286f0ab99dbead8e7949317de510e643bfbc897', class: "error-state-content", part: "error-state-content" }, this.renderErrorIcon(), h("h2", { key: '78319f0bbc6cc972bb2a4478134194b0592c13ba', class: "error-state-title", part: "error-title" }, "Something went wrong"), h("p", { key: 'ba262bf4d991326d36a04667b1109fed008d7cfd', class: "error-state-message", part: "error-message" }, this.error))))), !this.loading && !this.error && (h("div", { key: 'adc09c9a78afb9c163d23813eebb23a4c031be52', part: "list-container" }, this.renderIssuesList(), this.hasMore && (h("slot", { key: '26010e848f5fc2976f0ab0c1d7f134efb023f173', name: "load-more" }, h("div", { key: 'adbfb37d368383405dc9edd136ed7c0003b8cb67', class: "load-more-container", part: "load-more-container" }, h("feedlog-button", { key: '8d00e17e29dd9148e71e86cb178b9e058f50ce32', onFeedlogClick: this.handleLoadMore, disabled: this.isLoadingMore, variant: "outline", part: "load-more-btn" }, this.isLoadingMore ? 'Loading...' : 'Load More Issues')))))))));
|
|
65
58
|
}
|
|
66
59
|
};
|
|
67
60
|
FeedlogIssues.style = feedlogIssuesCss();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as promiseResolve, g as globalScripts, b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { p as promiseResolve, g as globalScripts, b as bootstrapLazy } from './index-Cu1eYdKa.js';
|
|
2
|
+
export { s as setNonce } from './index-Cu1eYdKa.js';
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
5
|
Stencil Client Patch Browser v4.40.1 | MIT Licensed | https://stenciljs.com
|
|
@@ -16,5 +16,5 @@ var patchBrowser = () => {
|
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(async (options) => {
|
|
18
18
|
await globalScripts();
|
|
19
|
-
return bootstrapLazy([["feedlog-card",[[257,"feedlog-card"]]],["feedlog-badge",[[257,"feedlog-badge",{"variant":[1]}]]],["feedlog-button_3",[[
|
|
19
|
+
return bootstrapLazy([["feedlog-card",[[257,"feedlog-card"]]],["feedlog-badge",[[257,"feedlog-badge",{"variant":[1]}]]],["feedlog-button_3",[[257,"feedlog-issues-list",{"issues":[16],"limit":[2],"theme":[1],"getIssueUrl":[16],"emptyStateTitle":[1,"empty-state-title"],"emptyStateMessage":[1,"empty-state-message"],"currentPage":[32]},null,{"issues":[{"resetPage":0}],"limit":[{"resetPage":0}]}],[257,"feedlog-button",{"variant":[1],"size":[1],"disabled":[4],"type":[1]}],[257,"feedlog-issue",{"issue":[16],"issueUrl":[1,"issue-url"],"theme":[1]}]]],["feedlog-issues",[[257,"feedlog-issues",{"issues":[16],"maxWidth":[1,"max-width"],"limit":[2],"theme":[1025],"heading":[1],"subtitle":[1],"emptyStateTitle":[1,"empty-state-title"],"emptyStateMessage":[1,"empty-state-message"],"loading":[4],"error":[1],"hasMore":[4,"has-more"],"isLoadingMore":[4,"is-loading-more"],"getIssueUrl":[16]}]]],["feedlog-issues-client",[[257,"feedlog-issues-client",{"apiKey":[1,"api-key"],"type":[1],"limit":[2],"sortBy":[1,"sort-by"],"endpoint":[1],"maxWidth":[1,"max-width"],"theme":[1],"heading":[1],"subtitle":[1],"emptyStateTitle":[1,"empty-state-title"],"emptyStateMessage":[1,"empty-state-message"],"getIssueUrl":[16],"issues":[32],"loading":[32],"error":[32],"cursor":[32],"hasMore":[32],"isLoadingMore":[32]}]]]], options);
|
|
20
20
|
});
|
|
@@ -2,7 +2,7 @@ const NAMESPACE = 'feedlog-toolkit';
|
|
|
2
2
|
const BUILD = /* feedlog-toolkit */ { hotModuleReplacement: false, hydratedSelectorName: "hydrated", lazyLoad: true, propChangeCallback: true, state: true, updatable: true};
|
|
3
3
|
|
|
4
4
|
const globalScripts = () => {};
|
|
5
|
-
const globalStyles = ":root{--feedlog-
|
|
5
|
+
const globalStyles = ":root{--feedlog-background:#ffffff;--feedlog-foreground:#09090b;--feedlog-card:#ffffff;--feedlog-card-foreground:#09090b;--feedlog-popover:#ffffff;--feedlog-popover-foreground:#09090b;--feedlog-primary:#18181b;--feedlog-primary-foreground:#fafafa;--feedlog-secondary:#f4f4f5;--feedlog-secondary-foreground:#18181b;--feedlog-muted:#f4f4f5;--feedlog-muted-foreground:#71717a;--feedlog-accent:#f4f4f5;--feedlog-accent-foreground:#18181b;--feedlog-destructive:#ef4444;--feedlog-destructive-foreground:#fafafa;--feedlog-success:#22c55e;--feedlog-success-foreground:#ffffff;--feedlog-warning:#f59e0b;--feedlog-warning-foreground:#ffffff;--feedlog-border:#f0f0f2;--feedlog-input:#e4e4e7;--feedlog-ring:#18181b;--feedlog-badge-enhancement-bg:#eef2ff;--feedlog-badge-enhancement-text:#4338ca;--feedlog-badge-secondary-bg:#f1f5f9;--feedlog-badge-secondary-text:#475569;--feedlog-badge-destructive-bg:#fef2f2;--feedlog-badge-destructive-text:#b91c1c;--feedlog-space-1:0.25rem;--feedlog-space-2:0.5rem;--feedlog-space-3:0.75rem;--feedlog-space-4:1rem;--feedlog-space-5:1.25rem;--feedlog-space-6:1.5rem;--feedlog-space-8:2rem;--feedlog-space-10:2.5rem;--feedlog-font-family:ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif;--feedlog-font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;--feedlog-text-xs:0.75rem;--feedlog-text-sm:0.875rem;--feedlog-text-base:1rem;--feedlog-text-lg:1.125rem;--feedlog-text-xl:1.25rem;--feedlog-font-normal:400;--feedlog-font-medium:500;--feedlog-font-semibold:600;--feedlog-font-bold:700;--feedlog-radius-sm:0.25rem;--feedlog-radius:0.5rem;--feedlog-radius-lg:0.75rem;--feedlog-radius-full:9999px;--feedlog-shadow-sm:0 2px 8px -2px rgba(0, 0, 0, 0.05);--feedlog-shadow:0 4px 20px -2px rgba(0, 0, 0, 0.05);--feedlog-shadow-md:0 8px 30px -4px rgba(0, 0, 0, 0.06)}.dark{--feedlog-background:#09090b;--feedlog-foreground:#fafafa;--feedlog-card:#09090b;--feedlog-card-foreground:#fafafa;--feedlog-popover:#09090b;--feedlog-popover-foreground:#fafafa;--feedlog-primary:#fafafa;--feedlog-primary-foreground:#18181b;--feedlog-secondary:#27272a;--feedlog-secondary-foreground:#fafafa;--feedlog-muted:#27272a;--feedlog-muted-foreground:#a1a1aa;--feedlog-accent:#27272a;--feedlog-accent-foreground:#fafafa;--feedlog-destructive:#7f1d1d;--feedlog-destructive-foreground:#fafafa;--feedlog-success:#14532d;--feedlog-success-foreground:#fafafa;--feedlog-warning:#78350f;--feedlog-warning-foreground:#fafafa;--feedlog-border:#27272a;--feedlog-input:#27272a;--feedlog-ring:#d4d4d8;--feedlog-badge-enhancement-bg:rgba(67, 56, 202, 0.2);--feedlog-badge-enhancement-text:#c7d2fe;--feedlog-badge-secondary-bg:rgba(71, 85, 105, 0.2);--feedlog-badge-secondary-text:#cbd5e1;--feedlog-badge-destructive-bg:rgba(185, 28, 28, 0.2);--feedlog-badge-destructive-text:#fecaca}";
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
8
|
Stencil Client Platform v4.40.1 | MIT Licensed | https://stenciljs.com
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { g as globalScripts, b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { g as globalScripts, b as bootstrapLazy } from './index-Cu1eYdKa.js';
|
|
2
|
+
export { s as setNonce } from './index-Cu1eYdKa.js';
|
|
3
3
|
|
|
4
4
|
const defineCustomElements = async (win, options) => {
|
|
5
5
|
if (typeof window === 'undefined') return undefined;
|
|
6
6
|
await globalScripts();
|
|
7
|
-
return bootstrapLazy([["feedlog-card",[[257,"feedlog-card"]]],["feedlog-badge",[[257,"feedlog-badge",{"variant":[1]}]]],["feedlog-button_3",[[
|
|
7
|
+
return bootstrapLazy([["feedlog-card",[[257,"feedlog-card"]]],["feedlog-badge",[[257,"feedlog-badge",{"variant":[1]}]]],["feedlog-button_3",[[257,"feedlog-issues-list",{"issues":[16],"limit":[2],"theme":[1],"getIssueUrl":[16],"emptyStateTitle":[1,"empty-state-title"],"emptyStateMessage":[1,"empty-state-message"],"currentPage":[32]},null,{"issues":[{"resetPage":0}],"limit":[{"resetPage":0}]}],[257,"feedlog-button",{"variant":[1],"size":[1],"disabled":[4],"type":[1]}],[257,"feedlog-issue",{"issue":[16],"issueUrl":[1,"issue-url"],"theme":[1]}]]],["feedlog-issues",[[257,"feedlog-issues",{"issues":[16],"maxWidth":[1,"max-width"],"limit":[2],"theme":[1025],"heading":[1],"subtitle":[1],"emptyStateTitle":[1,"empty-state-title"],"emptyStateMessage":[1,"empty-state-message"],"loading":[4],"error":[1],"hasMore":[4,"has-more"],"isLoadingMore":[4,"is-loading-more"],"getIssueUrl":[16]}]]],["feedlog-issues-client",[[257,"feedlog-issues-client",{"apiKey":[1,"api-key"],"type":[1],"limit":[2],"sortBy":[1,"sort-by"],"endpoint":[1],"maxWidth":[1,"max-width"],"theme":[1],"heading":[1],"subtitle":[1],"emptyStateTitle":[1,"empty-state-title"],"emptyStateMessage":[1,"empty-state-message"],"getIssueUrl":[16],"issues":[32],"loading":[32],"error":[32],"cursor":[32],"hasMore":[32],"isLoadingMore":[32]}]]]], options);
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export { defineCustomElements };
|