duckylib 0.1.10 → 0.1.12
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.
|
@@ -41,7 +41,13 @@
|
|
|
41
41
|
if(button.onclick) {
|
|
42
42
|
await button.onclick(e)
|
|
43
43
|
} else {
|
|
44
|
-
if(browser && button.href)
|
|
44
|
+
if(browser && button.href) {
|
|
45
|
+
if(button.href.startsWith("/")) {
|
|
46
|
+
window.open(button.href, "_self")
|
|
47
|
+
} else {
|
|
48
|
+
confirm(`${button.href} will open in a new tab.\n\nContinue?`) ? window.open(button.href, "_blank") : () => {};
|
|
49
|
+
}
|
|
50
|
+
}
|
|
45
51
|
}
|
|
46
52
|
}}>{#if button.href && !button.onclick}<Row heightPx="fit" gapEm={0.66}><Text inheritColor={true} weight="bolder">{button.text}</Text><Symbol name="open_in_new" sizePx={18} inheritColor={true} /></Row>{:else}<Text inheritColor={true} weight="bolder">{button.text}</Text>{/if}</button>
|
|
47
53
|
{/each}
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
defaultNav?: boolean;
|
|
39
39
|
|
|
40
40
|
authFeatures?: boolean;
|
|
41
|
+
loginButtonLabel?: string;
|
|
41
42
|
onlogin?: (() => Promise<void>) | null;
|
|
42
43
|
onlogout?: (() => Promise<void>) | null;
|
|
43
44
|
|
|
@@ -70,6 +71,7 @@
|
|
|
70
71
|
label = "",
|
|
71
72
|
|
|
72
73
|
authFeatures = false,
|
|
74
|
+
loginButtonLabel,
|
|
73
75
|
onlogin = null,
|
|
74
76
|
onlogout = null,
|
|
75
77
|
|
|
@@ -166,7 +168,7 @@
|
|
|
166
168
|
{#if user !== null && onlogout}
|
|
167
169
|
<UserToast {user} {onlogout} />
|
|
168
170
|
{:else if onlogin}
|
|
169
|
-
<LoginButton {onlogin} label=
|
|
171
|
+
<LoginButton {onlogin} label={loginButtonLabel ? loginButtonLabel : "Log In"} />
|
|
170
172
|
{/if}
|
|
171
173
|
</Row>
|
|
172
174
|
{/if}
|
package/dist/index.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export {default as Typewriter} from "./components/text/Typewriter.svelte";
|
|
|
24
24
|
export {default as Heading} from "./components/text/Heading.svelte";
|
|
25
25
|
export {default as Text} from "./components/text/Text.svelte";
|
|
26
26
|
export {default as Code} from "./components/text/Code.svelte";
|
|
27
|
+
export {default as Symbol} from "./components/text/Symbol.svelte";
|
|
27
28
|
|
|
28
29
|
export * from "./types.ts"
|
|
29
30
|
export * from "./styles/globals.css"
|
package/dist/index.js
CHANGED
|
@@ -19,6 +19,7 @@ export { default as Typewriter } from "./components/text/Typewriter.svelte";
|
|
|
19
19
|
export { default as Heading } from "./components/text/Heading.svelte";
|
|
20
20
|
export { default as Text } from "./components/text/Text.svelte";
|
|
21
21
|
export { default as Code } from "./components/text/Code.svelte";
|
|
22
|
+
export { default as Symbol } from "./components/text/Symbol.svelte";
|
|
22
23
|
export * from "./types.js";
|
|
23
24
|
export * from "./styles/globals.css";
|
|
24
25
|
export * from "./styles/fonts.css";
|
|
@@ -76,9 +77,6 @@ export function getUserData() {
|
|
|
76
77
|
}
|
|
77
78
|
export function setUserData(user) {
|
|
78
79
|
console.log("SET USER DATA", user);
|
|
79
|
-
// if(b) {
|
|
80
80
|
if (window !== undefined)
|
|
81
|
-
window.localStorage.setItem("userData", JSON.stringify(user));
|
|
82
|
-
// writable()
|
|
83
|
-
// }
|
|
81
|
+
window.localStorage.setItem("userData", JSON.stringify(user) || "null");
|
|
84
82
|
}
|