New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@friendofsvelte/django-kit

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@friendofsvelte/django-kit - npm Package Compare versions

Comparing version 0.0.1-dev.105 to 0.0.1-dev.106

6

dist/flash_message.js
import { redirect } from "@sveltejs/kit";
/*
Set a flash message in the cookies;
*/
export const put_flash = (cookies, messages) => {

@@ -10,2 +13,5 @@ // set max age 1 second

};
/*
Set a flash message in the cookies and redirect to a new location
*/
export const flash_redirect = (cookies, message, status, location) => {

@@ -12,0 +18,0 @@ put_flash(cookies, { ...message, path: location.toString() });

2

dist/index.d.ts
import Flash from "./components/Flash.svelte";
export { via_route_name, via_route } from './actions.js';
export { django_fetch_handle } from './fetch_hook.js';
export { add_toast } from './notifier.svelte.js';
export { add_toast, notifier } from './notifier.svelte.js';
export { put_flash, flash_redirect } from './flash_message.js';
export { Flash };
import Flash from "./components/Flash.svelte";
export { via_route_name, via_route } from './actions.js';
export { django_fetch_handle } from './fetch_hook.js';
export { add_toast } from './notifier.svelte.js';
export { add_toast, notifier } from './notifier.svelte.js';
export { put_flash, flash_redirect } from './flash_message.js';
export { Flash };
import type { MessageOut, ToastNotification } from "./types.js";
export declare let error_triggered: boolean;
export declare const toasts: ToastNotification[];
export declare let notifier: {
toasts: ToastNotification[];
error_: boolean;
};
export declare function add_toast(message: MessageOut, auto_dismiss_duration?: number): void;
export declare function dismiss_toast(toastId: string): void;
export declare function dismiss_all_toasts(): void;
export declare function trigger_error(): void;

@@ -1,17 +0,30 @@

const AUTO_DISMISS_DURATION = 7200;
export let error_triggered = $state(false);
export const toasts = $state([]);
const AUTO_DISMISS_DURATION = 7777;
/*
Notifier is a global store that manages toast notifications
- toasts: a list of toast notifications
- error_: a flag to indicate if any error has occurred; implementation is up to the developer
*/
export let notifier = $state({
toasts: [],
error_: false,
});
/*
Add a toast to the notifier
*/
export function add_toast(message, auto_dismiss_duration = AUTO_DISMISS_DURATION) {
const toast = { ...message, auto_dismiss_duration, id: crypto.randomUUID(), };
toasts.push(toast);
notifier.toasts.push(toast);
}
/*
Dismiss a toast, given its id
*/
export function dismiss_toast(toastId) {
const index = toasts.findIndex((toast) => toast && toast.id === toastId);
toasts.splice(index, 1);
const index = notifier.toasts.findIndex((toast) => toast && toast.id === toastId);
notifier.toasts.splice(index, 1);
}
/*
Dismiss all toasts
*/
export function dismiss_all_toasts() {
toasts.splice(0, toasts.length);
notifier.toasts.splice(0, notifier.toasts.length);
}
export function trigger_error() {
// error_triggered = true;
}
{
"name": "@friendofsvelte/django-kit",
"version": "0.0.1-dev.105",
"version": "0.0.1-dev.106",
"scripts": {

@@ -5,0 +5,0 @@ "dev": "vite dev",

@@ -18,2 +18,7 @@ # Django Kit - For integrating SvelteKit with Django

### Features
- Use Django's forms and validation with SvelteKit.
- Flash messages are automatically shown in SvelteKit.
## Installation

@@ -20,0 +25,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc