@joyautomation/salt 0.0.22 → 0.0.29
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/actions.js +2 -2
- package/dist/client.js +6 -6
- package/dist/components/Toggle.svelte +0 -2
- package/dist/components/forms/types.d.ts +1 -1
- package/dist/index.d.ts +10 -10
- package/dist/index.js +10 -10
- package/dist/state/notifications.svelte.js +3 -3
- package/dist/stores/notifications.js +4 -4
- package/dist/styles/buttons.scss +1 -1
- package/package.json +7 -1
package/dist/actions.js
CHANGED
|
@@ -3,13 +3,13 @@ export const setTheme = async ({ request, cookies }) => {
|
|
|
3
3
|
const theme = data.get('theme');
|
|
4
4
|
cookies.set(`theme`, theme, {
|
|
5
5
|
path: '/',
|
|
6
|
-
secure: false
|
|
6
|
+
secure: false
|
|
7
7
|
});
|
|
8
8
|
const themeName = theme === 'themeDark' ? 'dark mode' : 'light mode';
|
|
9
9
|
return {
|
|
10
10
|
context: 'setTheme',
|
|
11
11
|
type: 'success',
|
|
12
12
|
message: `You are now in ${themeName}.`,
|
|
13
|
-
theme
|
|
13
|
+
theme
|
|
14
14
|
};
|
|
15
15
|
};
|
package/dist/client.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export function setTheme(form) {
|
|
2
|
-
if (form?.context ===
|
|
3
|
-
if (form?.theme ===
|
|
4
|
-
document.body.classList.add(
|
|
5
|
-
document.body.classList.remove(
|
|
2
|
+
if (form?.context === 'setTheme') {
|
|
3
|
+
if (form?.theme === 'themeDark') {
|
|
4
|
+
document.body.classList.add('themeDark');
|
|
5
|
+
document.body.classList.remove('themeLight');
|
|
6
6
|
}
|
|
7
7
|
else {
|
|
8
|
-
document.body.classList.remove(
|
|
9
|
-
document.body.classList.add(
|
|
8
|
+
document.body.classList.remove('themeDark');
|
|
9
|
+
document.body.classList.add('themeLight');
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export * as actions from
|
|
2
|
-
export * as client from
|
|
3
|
-
export { default as Toggle } from
|
|
4
|
-
export { default as ThemeButton } from
|
|
5
|
-
export { default as Toast } from
|
|
6
|
-
export { default as Icon } from
|
|
7
|
-
export * as icons from
|
|
8
|
-
export * as state from
|
|
9
|
-
export { default as ThemeSwitch } from
|
|
10
|
-
export { themeState, getEffectiveTheme, type Theme } from
|
|
1
|
+
export * as actions from './actions.js';
|
|
2
|
+
export * as client from './client.js';
|
|
3
|
+
export { default as Toggle } from './components/Toggle.svelte';
|
|
4
|
+
export { default as ThemeButton } from './components/ThemeButton.svelte';
|
|
5
|
+
export { default as Toast } from './components/Toast.svelte';
|
|
6
|
+
export { default as Icon } from './components/Icon.svelte';
|
|
7
|
+
export * as icons from './components/icons/index.js';
|
|
8
|
+
export * as state from './state/notifications.svelte';
|
|
9
|
+
export { default as ThemeSwitch } from './components/ThemeSwitch.svelte';
|
|
10
|
+
export { themeState, getEffectiveTheme, type Theme } from './theme.svelte';
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export * as actions from
|
|
2
|
-
export * as client from
|
|
3
|
-
export { default as Toggle } from
|
|
4
|
-
export { default as ThemeButton } from
|
|
5
|
-
export { default as Toast } from
|
|
6
|
-
export { default as Icon } from
|
|
7
|
-
export * as icons from
|
|
8
|
-
export * as state from
|
|
9
|
-
export { default as ThemeSwitch } from
|
|
10
|
-
export { themeState, getEffectiveTheme } from
|
|
1
|
+
export * as actions from './actions.js';
|
|
2
|
+
export * as client from './client.js';
|
|
3
|
+
export { default as Toggle } from './components/Toggle.svelte';
|
|
4
|
+
export { default as ThemeButton } from './components/ThemeButton.svelte';
|
|
5
|
+
export { default as Toast } from './components/Toast.svelte';
|
|
6
|
+
export { default as Icon } from './components/Icon.svelte';
|
|
7
|
+
export * as icons from './components/icons/index.js';
|
|
8
|
+
export * as state from './state/notifications.svelte';
|
|
9
|
+
export { default as ThemeSwitch } from './components/ThemeSwitch.svelte';
|
|
10
|
+
export { themeState, getEffectiveTheme } from './theme.svelte';
|
|
@@ -2,7 +2,7 @@ import { writable } from 'svelte/store';
|
|
|
2
2
|
import { nanoid } from 'nanoid';
|
|
3
3
|
const initializer = [];
|
|
4
4
|
export const notifications = $state({
|
|
5
|
-
current: initializer
|
|
5
|
+
current: initializer
|
|
6
6
|
});
|
|
7
7
|
export function addNotification(notification) {
|
|
8
8
|
const id = nanoid();
|
|
@@ -10,8 +10,8 @@ export function addNotification(notification) {
|
|
|
10
10
|
...notifications.current,
|
|
11
11
|
{
|
|
12
12
|
id,
|
|
13
|
-
...notification
|
|
14
|
-
}
|
|
13
|
+
...notification
|
|
14
|
+
}
|
|
15
15
|
];
|
|
16
16
|
setTimeout(() => {
|
|
17
17
|
notifications.current = notifications.current.filter((n) => n.id !== id);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { writable } from
|
|
2
|
-
import { nanoid } from
|
|
1
|
+
import { writable } from 'svelte/store';
|
|
2
|
+
import { nanoid } from 'nanoid';
|
|
3
3
|
const initializer = [];
|
|
4
4
|
export const notifications = writable(initializer);
|
|
5
5
|
export function addNotification(notification) {
|
|
@@ -8,8 +8,8 @@ export function addNotification(notification) {
|
|
|
8
8
|
...notifications,
|
|
9
9
|
{
|
|
10
10
|
id,
|
|
11
|
-
...notification
|
|
12
|
-
}
|
|
11
|
+
...notification
|
|
12
|
+
}
|
|
13
13
|
]);
|
|
14
14
|
setTimeout(() => {
|
|
15
15
|
notifications.update((notifications) => notifications.filter((n) => n.id !== id));
|
package/dist/styles/buttons.scss
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@joyautomation/salt",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.29",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "vite dev",
|
|
6
6
|
"build": "vite build && npm run package",
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"svelte": "5.0.0-next.244"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
+
"@eslint/js": "^9.25.1",
|
|
37
38
|
"@playwright/test": "^1.52.0",
|
|
38
39
|
"@sveltejs/adapter-auto": "^6.0.0",
|
|
39
40
|
"@sveltejs/kit": "^2.20.7",
|
|
@@ -61,6 +62,11 @@
|
|
|
61
62
|
"svelte": "./dist/index.js",
|
|
62
63
|
"types": "./dist/index.d.ts",
|
|
63
64
|
"type": "module",
|
|
65
|
+
"repository": {
|
|
66
|
+
"type": "git",
|
|
67
|
+
"url": "https://github.com/joyautomation/salt"
|
|
68
|
+
},
|
|
69
|
+
"packageManager": "pnpm@10.13.1",
|
|
64
70
|
"dependencies": {
|
|
65
71
|
"@sveltejs/adapter-node": "^5.2.12",
|
|
66
72
|
"nanoid": "^5.1.5",
|