@placeholderco/placeholder-ui 3.0.2 → 3.0.4
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/app.css +0 -19
- package/dist/layout/Sidenav.svelte +0 -15
- package/dist/ui/Button.svelte +8 -0
- package/dist/ui/Button.svelte.d.ts +4 -0
- package/dist/ui/Drawer.svelte +0 -15
- package/dist/ui/Link.svelte +4 -0
- package/dist/ui/Link.svelte.d.ts +2 -0
- package/dist/ui/Table.svelte +1 -1
- package/dist/ui/Table.svelte.d.ts +1 -1
- package/dist/util/NavigateTo.d.ts +6 -1
- package/dist/util/NavigateTo.js +24 -2
- package/dist/util/interceptLinkClick.js +19 -2
- package/package.json +26 -26
package/dist/app.css
CHANGED
|
@@ -85,9 +85,6 @@
|
|
|
85
85
|
--header-height: 46px;
|
|
86
86
|
--page-content-height: calc(100vh - var(--header-height));
|
|
87
87
|
|
|
88
|
-
--scrollbar-track: #fff;
|
|
89
|
-
--scrollbar-thumb: var(--ui-primary);
|
|
90
|
-
|
|
91
88
|
background-color: var(--page-bg);
|
|
92
89
|
color: var(--text-color);
|
|
93
90
|
font-family: var(--ui-font-family);
|
|
@@ -118,8 +115,6 @@
|
|
|
118
115
|
--placeholder-color: rgb(115 115 115);
|
|
119
116
|
--input-bg-color: rgb(33, 37, 41);
|
|
120
117
|
--label-color: rgb(141, 144, 149);
|
|
121
|
-
|
|
122
|
-
--scrollbar-track: #111;
|
|
123
118
|
}
|
|
124
119
|
|
|
125
120
|
body {
|
|
@@ -154,20 +149,6 @@ header .text-xl {
|
|
|
154
149
|
line-height: 1.75rem;
|
|
155
150
|
}
|
|
156
151
|
|
|
157
|
-
*::-webkit-scrollbar {
|
|
158
|
-
width: 19px;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
*::-webkit-scrollbar-track {
|
|
162
|
-
background: var(--scrollbar-track);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
*::-webkit-scrollbar-thumb {
|
|
166
|
-
background-color: var(--scrollbar-thumb);
|
|
167
|
-
border-radius: 10px;
|
|
168
|
-
border: 5px solid var(--scrollbar-track);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
152
|
.vstack {
|
|
172
153
|
gap: 1rem;
|
|
173
154
|
display: flex;
|
|
@@ -633,19 +633,4 @@
|
|
|
633
633
|
.sub-nav-item > .nav-item-row.active button.sub-nav-link {
|
|
634
634
|
font-weight: 500;
|
|
635
635
|
}
|
|
636
|
-
|
|
637
|
-
/* Scrollbar styling */
|
|
638
|
-
.sidenav-content::-webkit-scrollbar {
|
|
639
|
-
width: 6px;
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
.sidenav-content::-webkit-scrollbar-track {
|
|
643
|
-
background: transparent;
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
.sidenav-content::-webkit-scrollbar-thumb {
|
|
647
|
-
background-color: #343434;
|
|
648
|
-
border-radius: 3px;
|
|
649
|
-
border: none;
|
|
650
|
-
}
|
|
651
636
|
</style>
|
package/dist/ui/Button.svelte
CHANGED
|
@@ -28,6 +28,10 @@
|
|
|
28
28
|
iconSize?: string;
|
|
29
29
|
/** Link target attribute (when href is provided) */
|
|
30
30
|
target?: undefined | '_self' | '_blank';
|
|
31
|
+
/** Relationship attribute (when href is provided). `rel="external"` skips client-side navigation */
|
|
32
|
+
rel?: string;
|
|
33
|
+
/** Download the linked URL instead of navigating (when href is provided). `true` keeps the server's filename */
|
|
34
|
+
download?: boolean | string;
|
|
31
35
|
/** Button type attribute (when rendered as a button, not a link) */
|
|
32
36
|
type?: 'button' | 'submit' | 'reset';
|
|
33
37
|
/** Additional CSS classes */
|
|
@@ -51,6 +55,8 @@
|
|
|
51
55
|
rightSvg = undefined,
|
|
52
56
|
iconSize = '18px',
|
|
53
57
|
target = undefined,
|
|
58
|
+
rel = undefined,
|
|
59
|
+
download = undefined,
|
|
54
60
|
type = 'button',
|
|
55
61
|
class: buttonClass = '',
|
|
56
62
|
children,
|
|
@@ -89,6 +95,8 @@
|
|
|
89
95
|
{#if isLink && href && !disabled}
|
|
90
96
|
<a
|
|
91
97
|
{target}
|
|
98
|
+
{rel}
|
|
99
|
+
download={download === true ? '' : download || undefined}
|
|
92
100
|
class={elClass}
|
|
93
101
|
aria-label={ariaLabel}
|
|
94
102
|
href={href?.startsWith('/') ? resolve(href as any) : href}
|
|
@@ -22,6 +22,10 @@ export interface ButtonProps {
|
|
|
22
22
|
iconSize?: string;
|
|
23
23
|
/** Link target attribute (when href is provided) */
|
|
24
24
|
target?: undefined | '_self' | '_blank';
|
|
25
|
+
/** Relationship attribute (when href is provided). `rel="external"` skips client-side navigation */
|
|
26
|
+
rel?: string;
|
|
27
|
+
/** Download the linked URL instead of navigating (when href is provided). `true` keeps the server's filename */
|
|
28
|
+
download?: boolean | string;
|
|
25
29
|
/** Button type attribute (when rendered as a button, not a link) */
|
|
26
30
|
type?: 'button' | 'submit' | 'reset';
|
|
27
31
|
/** Additional CSS classes */
|
package/dist/ui/Drawer.svelte
CHANGED
|
@@ -559,19 +559,4 @@
|
|
|
559
559
|
.sub-nav-item > .nav-item-row.active button.sub-nav-link {
|
|
560
560
|
font-weight: 500;
|
|
561
561
|
}
|
|
562
|
-
|
|
563
|
-
/* Scrollbar styling */
|
|
564
|
-
.drawer-content::-webkit-scrollbar {
|
|
565
|
-
width: 6px;
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
.drawer-content::-webkit-scrollbar-track {
|
|
569
|
-
background: transparent;
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
.drawer-content::-webkit-scrollbar-thumb {
|
|
573
|
-
background-color: #343434;
|
|
574
|
-
border-radius: 3px;
|
|
575
|
-
border: none;
|
|
576
|
-
}
|
|
577
562
|
</style>
|
package/dist/ui/Link.svelte
CHANGED
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
rel?: string;
|
|
11
11
|
/** Link target attribute */
|
|
12
12
|
target?: '_self' | '_blank' | undefined;
|
|
13
|
+
/** Download the linked URL instead of navigating. `true` keeps the server's filename */
|
|
14
|
+
download?: boolean | string;
|
|
13
15
|
/** Additional CSS classes */
|
|
14
16
|
class?: string;
|
|
15
17
|
/** Link content */
|
|
@@ -24,6 +26,7 @@
|
|
|
24
26
|
href,
|
|
25
27
|
rel = '',
|
|
26
28
|
target = undefined,
|
|
29
|
+
download = undefined,
|
|
27
30
|
class: classes = '',
|
|
28
31
|
children,
|
|
29
32
|
onclick,
|
|
@@ -36,6 +39,7 @@
|
|
|
36
39
|
class={classes}
|
|
37
40
|
href={href?.startsWith('/') ? resolve(href as any) : href}
|
|
38
41
|
{rel}
|
|
42
|
+
download={download === true ? '' : download || undefined}
|
|
39
43
|
aria-current={ariaCurrent}
|
|
40
44
|
onclick={(e) => interceptLinkClick(e, { href, target, onclick })}
|
|
41
45
|
data-sveltekit-preload-data="hover"
|
package/dist/ui/Link.svelte.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ export interface LinkProps {
|
|
|
6
6
|
rel?: string;
|
|
7
7
|
/** Link target attribute */
|
|
8
8
|
target?: '_self' | '_blank' | undefined;
|
|
9
|
+
/** Download the linked URL instead of navigating. `true` keeps the server's filename */
|
|
10
|
+
download?: boolean | string;
|
|
9
11
|
/** Additional CSS classes */
|
|
10
12
|
class?: string;
|
|
11
13
|
/** Link content */
|
package/dist/ui/Table.svelte
CHANGED
|
@@ -84,6 +84,6 @@ export interface TableProps<T = any> {
|
|
|
84
84
|
* Use with `onsort` when the server returns pre-sorted rows. */
|
|
85
85
|
manualSort?: boolean;
|
|
86
86
|
}
|
|
87
|
-
declare const Table: import("svelte").Component<TableProps<any>, {}, "
|
|
87
|
+
declare const Table: import("svelte").Component<TableProps<any>, {}, "selectedRows" | "expandedKeys" | "page" | "sortKey" | "sortDirection">;
|
|
88
88
|
type Table = ReturnType<typeof Table>;
|
|
89
89
|
export default Table;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Navigates client-side when the URL is a page route in the app. URLs the client router can't
|
|
3
|
+
* reach (`+server.ts` endpoints, static files, external URLs) fall back to a full browser
|
|
4
|
+
* navigation. Cancelled navigations resolve quietly; any other failure rejects.
|
|
5
|
+
*/
|
|
6
|
+
export declare function navigateTo(url: string): Promise<void>;
|
package/dist/util/NavigateTo.js
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
import { goto } from '$app/navigation';
|
|
2
2
|
import { resolve } from '$app/paths';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
// SvelteKit puts the error code in the message in both dev and prod builds
|
|
4
|
+
const FALLBACK_ERRORS = ['/e/kit/navigation_route_missing', '/e/kit/navigation_external_url'];
|
|
5
|
+
// Rejections for navigations superseded by another one, or cancelled via beforeNavigate
|
|
6
|
+
const CANCELLED_ERRORS = ['navigation cancelled', 'navigation aborted'];
|
|
7
|
+
/**
|
|
8
|
+
* Navigates client-side when the URL is a page route in the app. URLs the client router can't
|
|
9
|
+
* reach (`+server.ts` endpoints, static files, external URLs) fall back to a full browser
|
|
10
|
+
* navigation. Cancelled navigations resolve quietly; any other failure rejects.
|
|
11
|
+
*/
|
|
12
|
+
export async function navigateTo(url) {
|
|
13
|
+
const resolved = resolve(url);
|
|
14
|
+
try {
|
|
15
|
+
await goto(resolved);
|
|
16
|
+
}
|
|
17
|
+
catch (error) {
|
|
18
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
19
|
+
if (FALLBACK_ERRORS.some((code) => message.includes(code))) {
|
|
20
|
+
window.location.assign(resolved);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (CANCELLED_ERRORS.includes(message))
|
|
24
|
+
return;
|
|
25
|
+
throw error;
|
|
26
|
+
}
|
|
5
27
|
}
|
|
@@ -26,8 +26,25 @@ export function interceptLinkClick(event, options) {
|
|
|
26
26
|
if (event.button !== 0) {
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
|
+
// Honour SvelteKit's standard opt-outs from client-side navigation
|
|
30
|
+
const anchor = event.currentTarget instanceof HTMLAnchorElement ? event.currentTarget : null;
|
|
31
|
+
if (anchor && isClientNavOptOut(anchor)) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
29
34
|
// Prevent default navigation and use SvelteKit's client-side navigation
|
|
30
35
|
event.preventDefault();
|
|
31
|
-
|
|
32
|
-
|
|
36
|
+
navigateTo(href).catch((error) => {
|
|
37
|
+
console.error(error);
|
|
38
|
+
// The click must still go somewhere, as a plain anchor would
|
|
39
|
+
window.location.assign(anchor?.href ?? href);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/** `download`, `rel="external"` and `data-sveltekit-reload` (on the link or an ancestor) */
|
|
43
|
+
function isClientNavOptOut(anchor) {
|
|
44
|
+
if (anchor.hasAttribute('download'))
|
|
45
|
+
return true;
|
|
46
|
+
if (anchor.relList.contains('external'))
|
|
47
|
+
return true;
|
|
48
|
+
const reload = anchor.closest('[data-sveltekit-reload]')?.getAttribute('data-sveltekit-reload');
|
|
49
|
+
return reload != null && reload !== 'off';
|
|
33
50
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@placeholderco/placeholder-ui",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.4",
|
|
4
4
|
"description": "A modern, customizable Svelte 5 UI component library with comprehensive theming support. Re-brand it with a single config object.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Placeholderco",
|
|
@@ -53,22 +53,22 @@
|
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@sveltejs/adapter-static": "^4.0.0",
|
|
56
|
-
"@sveltejs/kit": "^3.0
|
|
57
|
-
"@sveltejs/package": "^3.0.
|
|
56
|
+
"@sveltejs/kit": "^3.1.0",
|
|
57
|
+
"@sveltejs/package": "^3.0.1",
|
|
58
58
|
"@sveltejs/vite-plugin-svelte": "^7.3.1",
|
|
59
|
-
"@types/node": "^26.6.
|
|
59
|
+
"@types/node": "^26.6.5",
|
|
60
60
|
"globals": "^17.13.0",
|
|
61
|
-
"prettier": "^3.9.
|
|
61
|
+
"prettier": "^3.9.10",
|
|
62
62
|
"prettier-plugin-svelte": "^4.1.1",
|
|
63
63
|
"publint": "^0.3.25",
|
|
64
64
|
"rimraf": "^6.1.3",
|
|
65
65
|
"svelte": "^5.57.2",
|
|
66
|
-
"svelte-check": "^4.7.
|
|
66
|
+
"svelte-check": "^4.7.7",
|
|
67
67
|
"typescript": "^6.0.3",
|
|
68
|
-
"vite": "^8.3.
|
|
68
|
+
"vite": "^8.3.5"
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@codemirror/autocomplete": "^6.20.
|
|
71
|
+
"@codemirror/autocomplete": "^6.20.4",
|
|
72
72
|
"@codemirror/commands": "^6.11.1",
|
|
73
73
|
"@codemirror/lang-css": "^6.3.1",
|
|
74
74
|
"@codemirror/lang-html": "^6.4.12",
|
|
@@ -82,25 +82,25 @@
|
|
|
82
82
|
"@codemirror/search": "^6.7.2",
|
|
83
83
|
"@codemirror/state": "^6.7.6",
|
|
84
84
|
"@codemirror/theme-one-dark": "^6.1.3",
|
|
85
|
-
"@codemirror/view": "^6.43.
|
|
85
|
+
"@codemirror/view": "^6.43.15",
|
|
86
86
|
"@lezer/highlight": "^1.2.5",
|
|
87
|
-
"@tiptap/core": "^3.
|
|
88
|
-
"@tiptap/extension-bubble-menu": "^3.
|
|
89
|
-
"@tiptap/extension-code-block": "^3.
|
|
90
|
-
"@tiptap/extension-collaboration": "^3.
|
|
91
|
-
"@tiptap/extension-collaboration-caret": "^3.
|
|
92
|
-
"@tiptap/extension-color": "^3.
|
|
93
|
-
"@tiptap/extension-image": "^3.
|
|
94
|
-
"@tiptap/extension-link": "^3.
|
|
95
|
-
"@tiptap/extension-placeholder": "^3.
|
|
96
|
-
"@tiptap/extension-subscript": "^3.
|
|
97
|
-
"@tiptap/extension-superscript": "^3.
|
|
98
|
-
"@tiptap/extension-table": "^3.
|
|
99
|
-
"@tiptap/extension-text-align": "^3.
|
|
100
|
-
"@tiptap/extension-text-style": "^3.
|
|
101
|
-
"@tiptap/extension-underline": "^3.
|
|
102
|
-
"@tiptap/pm": "^3.
|
|
103
|
-
"@tiptap/starter-kit": "^3.
|
|
87
|
+
"@tiptap/core": "^3.32.0",
|
|
88
|
+
"@tiptap/extension-bubble-menu": "^3.32.0",
|
|
89
|
+
"@tiptap/extension-code-block": "^3.32.0",
|
|
90
|
+
"@tiptap/extension-collaboration": "^3.32.0",
|
|
91
|
+
"@tiptap/extension-collaboration-caret": "^3.32.0",
|
|
92
|
+
"@tiptap/extension-color": "^3.32.0",
|
|
93
|
+
"@tiptap/extension-image": "^3.32.0",
|
|
94
|
+
"@tiptap/extension-link": "^3.32.0",
|
|
95
|
+
"@tiptap/extension-placeholder": "^3.32.0",
|
|
96
|
+
"@tiptap/extension-subscript": "^3.32.0",
|
|
97
|
+
"@tiptap/extension-superscript": "^3.32.0",
|
|
98
|
+
"@tiptap/extension-table": "^3.32.0",
|
|
99
|
+
"@tiptap/extension-text-align": "^3.32.0",
|
|
100
|
+
"@tiptap/extension-text-style": "^3.32.0",
|
|
101
|
+
"@tiptap/extension-underline": "^3.32.0",
|
|
102
|
+
"@tiptap/pm": "^3.32.0",
|
|
103
|
+
"@tiptap/starter-kit": "^3.32.0",
|
|
104
104
|
"dayjs": "^1.11.23",
|
|
105
105
|
"svelte-sonner": "^1.2.1",
|
|
106
106
|
"yjs": "^13.6.33"
|