0.0.4 ‱ Published 4 months ago

@allomambo/galletita v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

đŸȘ Galletita

Extra simple cookie policy solution.

Required

  • Node 16.14.2
  • VueJS 3.2.37

Note
Complete documentation in progress

Installation

Installation - Plugin version

1. Add script to web page

# At end of body
<script id="galletita-js" type="module" src="https://unpkg.com/@allomambo/galletita@0.0.4/dist/index.js"></script>

2. Custom configs

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

Installation - VueJS library version

1. Install the package

# With Yarn:
yarn add @allomambo/galletita

# With npm:
npm install @allomambo/galletita

2. Use component in your project

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

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

Props

PropertyTypeDescriptionDefault Value
cookie_nameStringThe name of the cookie.privacy_policy_consent
text_contentObjectContains the textual elementsSee table below
privacy_policy_urlStringThe complete URL of the privacy policy. Ex. "https://example.com/privacy-policy"null
text_content
Sub-propertiesTypeDescriptionDefault Value (English EN)Default Value (Français FR)
titleStringThe title of the privacy policy.We value your privacyNous respectons votre vie privée
descriptionStringThe 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_labelStringThe label of the consent button.AcceptAccepter
learn_more_button_labelStringThe button label to learn more about the privacy policy.Learn moreEn savoir plus

Slots

NameDescription
defaultWrap the entirety of .galletita-box
copyThe text content (title and description)
actionsThe buttons to consent and see more
Exposed data on every slots
NameTypeDescription
isGalletitaVisiblebooleanIf modal is visible of not
cookieNamestringThe name of the cookie
textContentobjectThe complete object containing the text content (title, description, button labels)
privacyPolicyUrlstringThe name of the cookie
openGalletitamethodOpen modal
closeGalletitamethodClose modal and trigger consent
consentmethodAdd the cookie. Automatically triggered on closeGalletita

Emits

NameDescription
galletita:openWhen modal is opened
galletita:closeWhen modal is closed
galletita:consentWhen cookie is created
0.0.4

4 months ago

0.0.3

6 months ago

0.0.1

6 months ago