npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@allomambo/galletita

v1.0.1

Published

Extra simple privacy policy solution

Downloads

1,163

Readme

🍪 Galletita

Extra simple privacy policy solution.
Can be used as either a plugin or a vueJS library.

Installation

Plugin version

1. Add script to web page

<script id="galletita-js" type="module" src="https://unpkg.com/@allomambo/[email protected]/dist/index.js"></script>

2. Define your configuration

<script>
const galletita = {
    cookie_name: "privacy_policy_consent",
    text_content: {
        title: "...",
        description: "...",
        consent_button_label: "...",
        reject_button_label: "...",
        learn_more_button_label: "...",
    },
    privacy_policy_url: "https://...",
};
</script>
<script>
# Multilingual
const galletita = {
    cookie_name: "privacy_policy_consent",
    fr: {
        text_content: {
            title: "...",
            description: "...",
            consent_button_label: "...",
            reject_button_label: "...",
            learn_more_button_label: "...",
        },
        privacy_policy_url: "https://...",
    },
    en: {
        text_content: {
            title: "...",
            description: "...",
            consent_button_label: "...",
            reject_button_label: "...",
            learn_more_button_label: "...",
        },
        privacy_policy_url: "https://...",
    },
};
</script>

VueJS library version

Requirements

  • Node ^20.8.10
  • VueJS ^3.3.4

Installation

1. Install the package

# With Yarn:
yarn add @allomambo/galletita

# With npm:
npm install @allomambo/galletita

2. Use the component in your project

<template>
    <galletita :cookie-name="..." :text-content="{...}" :privacy-policy-url="..." />
</template>

<script setup>
import { Galletita } from "@allomambo/galletita";
</script>

Props

| Property | Type | Description | Default Value | | -------------------- | ----------------------- | -------------------------------------------------------------------------------- | ---------------------------------- | | cookie_name | string | The name of the cookie. | galletita_privacy_policy_consent | | text_content | GalletitaTranslations | Contains the textual elements | See table below | | privacy_policy_url | string | The complete URL of the privacy policy. Ex. "https://example.com/privacy-policy" | null |

text_content

| Sub-properties | Type | Description | Default Value (English EN) | Default Value (Français FR) | | ----------------------- | -------- | -------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | title | string | The title of the privacy policy. | We value your privacy | Nous respectons votre vie privée | | description | string | The description of the privacy policy. | <p>We use cookies to enhance your browsing experience, serve personalized ads or content, and analyze our traffic.</p><p>By clicking "Accept", you consent to our use of cookies.</p> | <p>Nous utilisons des cookies pour améliorer votre expérience de navigation, diffuser des publicités ou des contenus personnalisés et analyser notre trafic.</p><p>En cliquant sur « Accepter », vous consentez à notre utilisation des cookies.</p> | | consent_button_label | string | The label of the consent button. | Accept | Accepter | | reject_button_label | string | The label of the reject button. | Reject | Refuser | | learn_more_button_label | string | The button label to learn more about the privacy policy. | Learn more | En savoir plus |

Slots

| Name | Description | | ----------------- | --------------------------------------------- | | default | Wrap the entirety of .galletita-box | | copy | The text content (title and description) | | copyTitle | The title | | copyDescription | The description | | actions | The buttons to consent, reject and learn more | | actionConsent | The consent button | | actionReject | The reject button | | actionLearnMore | The "learn more" button |

Exposed data on every slots

| Name | Type | Description | | -------------------- | ----------------------- | -------------------------------------------------------------------------------------- | | isGalletitaVisible | boolean | If modal is visible of not | | cookieName | string | The name of the cookie | | textContent | GalletitaTranslations | The complete object containing the text content (title, description and button labels) | | privacyPolicyUrl | string | The privacy policy url | | openGalletita | function | Open modal | | closeGalletita | function | Close modal | | consent | function | Add cookie with positive consent and trigger closeGalletita | | reject | function | Add cookie with negative consent and trigger closeGalletita |

Emits

| Name | Description | | ------------------- | ------------------------------ | | galletita:open | When modal is opened | | galletita:close | When modal is closed | | galletita:consent | When consent button is clicked | | galletita:reject | When reject button is clicked |