Package detail

@almacareer/cookie-consent-manager

alma-oss134MIT3.0.1

Cookie Consent Manager mainly for Alma Career products

alma-career, almacareer, lmc-eu, cookie

readme

npm version CI

Alma Career Cookie Consent Manager

Provide configurable cookie consent plugin for Alma Career (formerly LMC) products. The package contains predefined Alma Career settings, translations and UI based on Spirit Design System.

The package is a wrapper around Cookie Consent by Orest Bida.

Table of contents

  1. Upgrade to version 3.x
  2. Basic usage
  3. Loading the plugin
  4. Manage features depending on the given consent
  5. Configuration
  6. Configuration options
  7. Theming
  8. Development and contributing

Upgrade to version 3.0

See upgrade guide for upgrade guidance from version 2.x to version 3.0. For complete list of changes see changelog.

Basic usage

Make assets load faster by placing pre-connect headers right after <meta charset> in your <head>:

<link rel="preconnect" href="https://cdn.jsdelivr.net">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>

Load default CSS along with your styles in <head>:

<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@almacareer/cookie-consent-manager@3/CookieConsentManager.min.css">

If you use an older version of Alma Career's Spirit Design System (version 2 or lower) or if you don't use the Spirit Design System at all, you need to load the themes CSS file:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@almacareer/cookie-consent-manager@3/CookieConsentManagerThemes.min.css">

Load the script and initialize the plugin right before ending </body> tag:

<script defer src="https://cdn.jsdelivr.net/npm/@almacareer/cookie-consent-manager@3/init.js"></script>
<script>
window.addEventListener('DOMContentLoaded', function () {
  initCookieConsentManager('demo.example'); // use the name of your service, like jobs.cz, seduo.pl etc.
});
</script>

This will load the plugin from CDN and initialize the plugin with default settings.

As a next step, add a link to open cookie preferences after the consent was previously given. This link should be placed somewhere in the page footer, usually near "Terms of use" and "Privacy policy" links. Please note it is legally required to provide the user such link to change cookie preferences even after the first consent is given.

<a href="" data-cc="show-preferencesModal">Open cookie preferences</a>

👀 See demo page with example.

Loading the plugin

Via CDN or static file

You can load the plugin from a CDN, as in the basic example above.

<!-- Note we use version "cookie-consent-manager@3", which points to the latest version of this series (including feature and bugfix releases) -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@almacareer/cookie-consent-manager@3/CookieConsentManager.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@almacareer/cookie-consent-manager@3/CookieConsentManagerThemes.min.css"><!-- Only if you do NOT use Spirit Design System (or you use Spirit Design System version 2 or lower) -->
<script defer src="https://cdn.jsdelivr.net/npm/@almacareer/cookie-consent-manager@3/init.js"></script>

Alternatively, you can also download the latest version from the Releases page.

Loading the plugin from CDN or static file is recommended mostly for static sites without their own build process.

Once the plugin is loaded, you need to initialize it using initCookieConsentManager() method, optionally providing configuration parameters.

Via npm

For projects with their own build process for JavaScript, it is recommended to use the plugin via npm package @almacareer/cookie-consent-manager.

  1. Add the plugin to your dependencies:

     yarn add @almacareer/cookie-consent-manager

    or

     npm install --save @almacareer/cookie-consent-manager
  2. Import the module in your javascript:

     import CookieConsentManager from '@almacareer/cookie-consent-manager';
    
     window.addEventListener('DOMContentLoaded', function () {
       CookieConsentManager('demo.example'/* , optional plugin configuration */);
     });

    See below for configuration options.

    You can also look at the example with EcmaScript module syntax.

  3. Include default CSS in your HTML:

    <link rel="stylesheet" href="node_modules/@almacareer/cookie-consent-manager/CookieConsentManager.min.css">
    <link rel="stylesheet" href="node_modules/@almacareer/cookie-consent-manager/CookieConsentManagerThemes.min.css"><!-- Only if you do NOT use Spirit Design System (or you use Spirit Design System version 2 or lower) -->

    or in your Sass stylesheet:

    @use "node_modules/@almacareer/cookie-consent-manager/CookieConsentManager.css";
    @use "node_modules/@almacareer/cookie-consent-manager/CookieConsentManagerThemes.css"; // Only if you do NOT use Spirit Design System (or you use Spirit Design System version 2 or lower)

    Please mind the .css extension used in the Sass example. Using the provided .scss stylesheet is recommended only for projects that are built with Alma Career's Spirit Design System.

    Also, the themes CSS is optional and should be included only if you do NOT use Alma Career's Spirit Design System (or you use Spirit Design System version 2 or lower). For projects built with Spirit Design System version 3 and newer, the themes are already included in the CSS.

    See below for theme customization options.

  4. For projects that are NOT built with Alma Career's Spirit Design System or use Spirit Design System version 2 or lower:

    1. Include default font in your HTML:

      <link rel="preconnect" href="https://fonts.googleapis.com">
      <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
      <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap">

      or in your Sass stylesheet:

      @import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap");
    2. Or switch to custom font that matches the design of your project.

Manage features depending on the given consent

For cookies within "necessary" category it is not needed to check whether a user has given any consent.

However, for all other purposes, it must be explicitly checked whether user has given the appropriate consent category. This must be done before the respective cookie is set.

In case user rejects some (or all) optional consent categories, you must implement logic to remove current cookies (as well as localStorage) in your product yourself, this library does not manipulate with the cookies by default. (However you can use autoClearCookies config option.)

Consent categories

Category Description
necessary Strictly necessary cookies are essential for user to browse the website and use its features, such as accessing secure areas of the site. These cookies are first-party cookies.
Some examples of strictly necessary cookies: Session cookies, Cookie consent cookies, Load balancing cookies, CSFR tokens, Language selection cookies, Region/country cookies, Performance cookies, Application firewall cookies and JavaScript check cookies.
For these cookies you don't need to check whether user actually has this category.
ad For cookies related to advertising
analytics For analysis and statistics
functionality For extended functionality (not covered by necessary category)
personalization For personalization based on user profiling (recommendation, etc.)

GTM (Google Tag Manager) scripts

If you manage GTM script outside of Alma Career Central, you must set proper GTM consent mode properties to dataLayer. See this example (or you can use onFirstConsent() and onChange() callbacks).

If GTM of the product is managed by Alma Career Central, after implementing this library, you don't need to worry about conditions when to run them. However, keep in mind you still need to take care (i.e. delete) of already existing cookies, even of those created by GTM scripts.

Custom methods

To execute custom code which depends on cookie consent use callbacks:

// ...
initCookieConsentManager(
  'demo.example',
  {
    onConsent: ({ cookieConsent, cookie }) => {
      if (cookieConsent.acceptedCategory('functionality')) {
        startOptionalFeature();
      }
    },
  }
);
// ...

Third party scripts loaded via <script>

To automatically load external scripts after a specific consent category is given by the user, modify the <script> tag: set type to type="text/plain" and add data-category attribute with required consent category.

<script src="personalization.js" type="text/plain" data-category="personalization" defer></script>

<script type="text/plain" data-category="functionality">
   console.log('functionality consent given');
</script>

👀 This feature is also shown in examples. See also full documentation for this feature.

This feature is enabled by default. If you'd like to disable it, you can do so by overriding manageScriptTags value in config option:

initCookieConsentManager(
  'demo.example',
  {
    config: {
      manageScriptTags: false
    }
  }
);

Configuration

Optional config parameters could be provided on plugin initialization as the second parameter, encapsulated in the configuration object.

initCookieConsentManager( // when loaded as a module, these options are passed to `CookieConsentManager()` instead
  'demo.example', // provide the name of your service, like jobs.cz, seduo.pl etc.
  {
    defaultLang: 'cs',
    autodetectLang: false,
    onConsent: ({ cookieConsent, cookie }) => {
      // custom code
    },
    translationOverrides: { // overrides of the default translation for specified languages
      cs: { consentTitle: 'Vlastní nadpis', descriptionIntro: 'Vlastní úvodní text popisu souhlasu' },
      en: { consentTitle: 'Custom title' },
    },
    cookieTable: { // cookie table for specified languages, shown in preferences modal
      cs: {
        necessary: [
          { name: 'almacareer_ccm', description: 'Cookie je nezbytná k uložení vašich preference týkající se povolených kategorií cookies', expiration: '1 rok' },
          { name: 'PHPSESSID', description: 'Cookie nezbytná ke správnému fungování webu', expiration: 'do konce relace' },
        ],
        // ad: [ ... ],
        analytics: [
          { name: '_ga', description: 'Nástrojem Google Analytics zjišťujeme, kolik lidí náš web navštěvuje a jak ho používá', expiration: '2 roky' },
          { name: '_utm', description: 'Nástrojem Google Analytics zjišťujeme, kolik lidí náš web navštěvuje a jak ho používá', expiration: '2 roky' },
        ],
        // functionality: [ ... ],
        // personalization: [ ... ]
      },
      en: {
        analytics: [
          { name: '_ga', description: 'With Google Analytics we determine how many people visit our website and how they use it', expiration: '2 years' },
          // ...
        ],
      }
    },
    config: {
      // overrides of the internal config of the underlying library, see https://cookieconsent.orestbida.com/reference/configuration-reference.html
    },
  }
);

👀 See extended configuration example

Configuration options

Option Type Default value Description
autodetectLang boolean true Autodetect language based on the value of <html lang="...">. If autodetect fails or if unsupported language is detected, fallback to defaultLang.
When disabled, force language to defaultLang.
defaultLang string 'cs' Default language. One of cs, de, en, hu, pl, ru, sk, uk. This language will be used when autodetect is disabled or when it fails.
companyNames array ['Alma Career'] Array of strings with company names. Adjust only when the consent needs to be given to multiple companies. Value "Alma Career" is replaced with translated legal name. See example.
consentCollectorApiUrl ?string 'https://consents.almacareer.tech/acl-lda/(...)' URL of the API where user consent information is sent. Null to disable sending data to the API.
config Object {} Override internal config of the underlying library. For all parameters see config reference of the original library.
displayMode DisplayMode (string) DisplayMode.FORCE (force) force (default) to show consent in a centered modal box and to block page until user action. soft to show consent banner on the bottom of the page and do not block the page before user action.
on* callbacks function (cookieConsent) => {} See below for configurable callbacks.
translationOverrides Record<string, TranslationOverride> {} Override default translation for specified languages. consentTitle, descriptionIntro and preferencesModalMoreInfo could be overridden.
See example
cookieTable CookieTable {} Define a cookie table (shown in the preferences modal) for specified languages and specified categories.
See above for example configuration

Supported languages

Translation of the user interface is provided in the following languages:

  • Bosnian (bs)
  • Croatian (hr)
  • Czech (cs)
  • English (en)
  • Estonian (et)
  • French (fr)
  • German (de)
  • Hungarian (hu)
  • Latvian (lv)
  • Lithuanian (lt)
  • Macedonian (mk)
  • Polish (pl)
  • Portuguese (pt)
  • Romanian (ro)
  • Russian (ru)
  • Serbian (latin) (sr)
  • Slovak (sk)
  • Slovenian (sl)
  • Spanish (es)
  • Ukrainian (uk)

👀 See example of each language version

Callbacks

The library can trigger configured callbacks in various events. They can be used to execute custom functionality, for example, to enable some feature after user has given consent.

Each configured callback receives cookieConsent as part of the options object. This is instance of the underlying cookie consent library, that can be used to call its methods or retrieve data from the cookie. cookie parameter contains value of the consent cookie. onChange() callback also receiver categories object, containing array of accepted, rejected, and changed consent categories.

Callback Trigger event
onFirstConsent({ cookieConsent, cookie }) This function will be executed only once, when the user takes the first action (accept all/only selected/only necessary categories).
onConsent({ cookieConsent, cookie }) Any consent is detected (either given now or after page load if it was already saved previously)
onChange({ cookieConsent, cookie, categories }) Right after the user changes cookie preferences. The callback receives also categories object containing arrays of accepted, rejected, and changed categories.

👀 See callbacks example

Theming

With Spirit Design System

If your project uses Spirit Design System version 3 and newer, you are almost done!

All you need to do is to add this plugin's SCSS to your Sass pipeline and use it instead of the default CSS:

// my-project.scss

// Add this line anywhere you import other third-party CSS, possibly somewhere close
// to the end of your stylesheet as it contains CSS selectors with high specificity.
@use '@almacareer/cookie-consent-manager/CookieConsentManager';

That's it!

<summary>Make sure you have node_modules and path to your design tokens in your Sass load paths.</summary> Set up Sass load path so the Sass compiler can find stylesheets located in the node_modules directory (you will already have a path to your design tokens there, as required by Spirit Web): sh # CLI command (possibly used in your npm scripts) sass --load-path=node_modules --load-path=path/to/my/design-tokens my-project.scss my-project.css Or with webpack: js // webpack.config.js { loader: 'sass-loader', options: { sassOptions: { loadPaths: [ path.resolve( __dirname, 'node_modules', 'path/to/my/design-tokens', ), ], }, }, },

Note: sass v1.23 or higher is required to be able to compile the new Sass modules syntax. You may need to migrate to sass since all other Sass compilers (and the old @import rule) are now deprecated.

With Spirit Design System version 2 or lower

Please follow the steps below for users who do not use Spirit Design System.

Without Spirit Design System

A handful of CSS custom properties are available for you to customize the UI to make it match the design of your site. For example, to change the text color of cookie consent UI, load the default CSS and add the following code anywhere in your stylesheet (the order of which is not important):

:root {
  --cc-primary-color: #333;
}

👀 See theming example

<summary>Full list of available CSS custom properties:</summary> | Category | CSS custom property | Description | |-------------------|------------------------------------------------|----------------------------------------------------------| | Common | --cc-font-family | Base font family | | | --cc-bg | Common background color | | | --cc-primary-color | Common primary text color | | | --cc-secondary-color | Common secondary text color | | Links | --cc-link-color | Link text color | | Buttons | --cc-btn-border-radius | Button border radius | | | --cc-btn-primary-bg | Primary button background color | | | --cc-btn-primary-color | Primary button text color | | | --cc-btn-primary-border-color | Primary button border color | | | --cc-btn-primary-hover-bg | Primary button background color on hover | | | --cc-btn-primary-hover-color | Primary button text color on hover | | | --cc-btn-primary-hover-border-color | Primary button border color on hover | | | --cc-btn-secondary-bg | Secondary button background color | | | --cc-btn-secondary-color | Secondary button text color | | | --cc-btn-secondary-border-color | Secondary button border color | | | --cc-btn-secondary-hover-bg | Secondary button background color on hover | | | --cc-btn-secondary-hover-color | Secondary button text color on hover | | | --cc-btn-secondary-hover-border-color | Secondary button border color on hover | | Toggles | --cc-pm-toggle-border-radius | Toggle border radius | | | --cc-toggle-on-bg | Toggle background color in selected state | | | --cc-toggle-off-bg | Toggle background color in unselected state | | | --cc-toggle-on-knob-bg | Toggle knob color in selected state | | | --cc-toggle-off-knob-bg | Toggle knob color in unselected state | | | --cc-toggle-readonly-bg | Toggle background color in readonly state | | | --cc-toggle-readonly-knob-bg | Toggle knob color in readonly state | | | --cc-toggle-readonly-knob-icon-color | Toggle knob icon color in readonly state | | Cookie categories | --cc-cookie-category-block-bg | Cookie category block background color | | | --cc-cookie-category-block-border | Cookie category block border color | | | --cc-cookie-category-block-hover-bg | Cookie category block background color on hover | | | --cc-cookie-category-block-hover-border | Cookie category block border color on hover | | | --cc-cookie-category-expanded-block-bg | Expanded cookie category block background color | | | --cc-cookie-category-expanded-block-hover-bg | Expanded cookie category block background color on hover | | Separators | --cc-separator-border-color | Separator border color | | Backdrop | --cc-overlay-bg | Backdrop background color | | Modal | --cc-modal-margin | Modal margin | | | --cc-modal-border-radius | Modal border radius | | | --cc-modal-transition-duration | Modal transition duration | | Footer | --cc-footer-bg | Footer background color | | | --cc-footer-color | Footer text color | | | --cc-footer-border-color | Footer border color |

Color themes

Starting from version 3, the Cookie Consent Manager supports color themes.

Spirit color themes

The themes are based on the Spirit Design Tokens, version 3.

For Spirit Design System users, the themes are already included in the CSS.

For projects that are NOT built with Spirit Design System (or use Spirit Design System version 2 or lower), you need to load the themes CSS file first.

Having the themes loaded, you can switch between the modes by applying the CSS classes like .theme-light-default or .theme-light-on-brand to any element of your application.

Dark mode

While the Spirit Design System does not yet provide a dark mode, you can easily create one by overriding the CSS custom properties:

@media (prefers-color-scheme: dark) {
  :root {
    --cc-bg: #333;
    --cc-primary-color: #fff;
    --cc-secondary-color: #ccc;
    /* … */
  }
}

Custom font

Default cookie consent design uses Inter font loaded via Google Fonts as shown in the basic example. If you are not using cookie consent with the default design, additional steps may be necessary for you:

  • If your project is built with Spirit Design System, you already have the correct font linked in your HTML or CSS.
  • If your project is not built with Spirit Design System, you can switch to any font of your choice:
    :root {
      --cc-font-family: "Open Sans", arial, sans-serif;
    }

If you use a custom font like this, make sure you don't load the default Inter font and that you use <link rel="preconnect" ...> only to actually needed domains.

Development and contributing

Local development

Install package dependencies:

yarn install

Start local development server:

yarn start

This will make the development server accessible http://localhost:5173/ .

Contributing

For commit messages follow Conventional Commits specification with Alma Career rules. The commit message will also be automatically checked as pre-commit hook.

To ensure the code passes linting and code style test run:

yarn test

To fix code style according to Prettier rules run:

yarn format:fix

Publishing package

Prepare release using yarn release on a local machine. Check the generated changelog and the bumped package.json. Then push to origin. GitHub publish action is then taking care of publishing package to npmjs.com.

License

Distributed under the MIT License. See LICENSE for more information.

changelog

3.0.1 (2025-04-10)

Bug Fixes

  • Remove IIFE export from library build configuration (197fc3d)

Chores

  • Remove myself from codeowners 👋 (3414fb1)
  • Replace internal project owner 💨 (cc2a034)
  • Use alma's sharable preset for renovate (69aa74f)

Documentation

  • Add language to cookie contents example (52424a2)
  • Add link to upgrade guide to changelog (f7a90b9)

3.0.0 (2025-03-03)

[!NOTE] For detailed upgrade instructions to version 3.0, please refer to the upgrade guide.

BREAKING CHANGES

  • Change default cookie name from lmc_ccm to almacareer_ccm (bd12817)
  • Change library npm organization to almacareer (fixes #391) (7698504)
  • Remove CommonJS suppport (65b015e)
  • Remove secondary button mode (78e3e69)
  • Rename callbacks to match names from the vanilla-cookieconsent (77160a2)
  • Rename LmcCookieConsentManager to CookieConsentManager (part of #392) (bfc1ddf)
  • Rename settingsModalMoreInfo to preferencesModalMoreInfo (8f88088)
  • Update Spirit design tokens to v3 (18e4f8b)
  • Use named exports only (23b9a1d)

Code Refactoring

  • Build package using Vite (d3e6fc9)
  • Clean up ESBuild after migration to Vite (766e444)
  • Decouple and test consentCollector (22cf710)
  • Extract pushToDataLayer to standalone and tested module (4b6ef02)
  • Rebuild distribuition (bfe60da)
  • Rename settings-modal scss file to preferences-modal be consistent with the source code (3ed682d)
  • Serve app using Vite (18d4d89)
  • Switch package to be ESM only (f770495)
  • Update CookieConsentManager to use API of vanilla-cookieconsent v3 (f9d98e8)
  • Update pushToDataLayer to new internal cookie value structure (3c7ad75)
  • Update translations to use new config structure (e3cc92e)

Dependencies

  • Update dependency vanilla-cookieconsent to v3.1.0 (abebff4)
  • Update dependency nanoid to v5.0.9 [SECURITY] (1026781)
  • Downgrade and lock conventional-changelog-cli on v3 (66c82d7)
  • Migrate config renovate.json (c6a4f66)
  • Replace unmaintained npm-run-all (13a9899)
  • Update all (sub)dependencies and all dev dependencies

Documentation

  • Add catalog info for Backstage (69f9bdd)
  • Add link to consumed API into catalog-info (2c3d5f1)
  • Add UPGRADE guide for version 3 (c45b2fa)
  • Add upgrade guide placeholder (8056d04)
  • Clarify GTM management by Alma Career Central (c863589)
  • Fix link rendering in UPGRADE guide (e39dc3c)
  • Redesign docs using Spirit Design System (07cee6e)
  • Sort languages in docs by their name, not code (ddd86e5)
  • Update contacts in package.json (dca097a)
  • Update example builds to match vanilla-cookieconsent v3 (cf95e7e)
  • Update examples to new API (99e6af4)
  • Update README header to clearly states affiliation of the library (6eb71e4)
  • Update README to version 3 changes (1951362)
  • Update version reference in readme (8666483)

Features

  • Add French (fr) translation (97073c0)
  • Add Portuguese (pt) translation (7deb4bf)
  • Add Romanian (ro) translation (cc16614)
  • Add Serbian (sr) translation (3cd805c)
  • Add Spanish (es) translation (84e5205)
  • Submit consent language to consent collector (fixes #387) (d5a0eb0)
  • Use deep merge for config overwrites (fixes #385) (c0b8bba)
  • Use new default consentCollectorApiUrl with a new resource type (99a9b2e)

Chores

  • Do not publish npm to beta tag (54aa329)
  • Fix disabling commit hooks on CI (a3ea991)
  • Change base branch for Renovate updates back to main (c5f5455)
  • Lock eslint ^8 for renovate bot (5b94ff6)
  • Move repository from lmc-eu to alma-oss (0beb8e0)
  • Replace auto-assign github action (a43aa6d)
  • Replace node 16 with node 18 in gh actions builds (6daf9ba)
  • Setup github-actions packages updates using renovate bot (718ada8)
  • Switch from sass to sass-embedded (09d9f8b)
  • Update codeowners (6d3a1c2)
  • Update version replace script to ESM (970d6ac)

2.6.0 (2024-04-10)

Dependencies

  • Update bugfix versions of dependencies (6e58251)

Documentation

  • Extend README to contain cookieTable example configuration (a416a4a)
  • Minor readme clarifications (0ebb3ec)
  • Update another link to orestbida library documentation to point to its branch v2.9 (452d7ae)
  • Update links to orestbida library documentation to point to its branch v2.9 (17084ae)

Features

  • Add ability to set cookie table (b7b2b4d)
  • Add Bosnian (bs) language (096b6bd)
  • Add Estonian (et) translation (06eba57)
  • Add Latvian (lv) translation (e389ed6)
  • Add Lithuanian (lt) translation (112b232)
  • Add Macedonian (mk) translation (b3c8990)
  • Export all types of vanilla cookie consent (7bb36d2)

Chores

  • DRY when importing language configs (a49d8f9)
  • Extract language loading to separate function (6e6e21c)
  • Optimize imports (25a636e)
  • Refactor block assembly (6bd7ac4)

Styles

  • Always define types before use and do not warn for unused vars in exported types (05d7ce6)
  • Fix enum definition which breaks eslint (8842da9), closes #issuecomment-1599432772
  • Fix errors detected by @lmc-eu/eslint-config-typescript rules (cb4da09)
  • Fix various eslint warnings and errors (0082e41)
  • Optimize imports and minor codestyle improvements (b467d03)
  • Replace concatenation with string templates (27a87ed)
  • Use object property shorthand (c3de7fd)

2.5.0 (2024-01-11)

Documentation

  • Rebrand to Alma Career also in documentation and meta information (a9f9a1c)

Features

  • Add Croatian (hr) translation (2ee50f3)
  • Add Slovenian (sl) translation (aee08f7)
  • Extend types to allow cookie tables settings (33313ac)
  • Update translations and unify Cookie policy document naming (0ef63d0)

Chores

  • deps: Update dependency @lmc-eu/spirit-design-tokens to v1 (8ab4715)
  • Fix ts-jest config deprecations (135288d)

2.4.1 (2023-12-27)

Documentation

  • Add notice about necessity to implement cookie deletion by each product itself (45feb44)

Features

  • Replace LMC company name with Alma Career (9c2788a)
  • Update hu translation (2ede16e)
  • Update links to privacy policy (88b634e)

Chores

  • Upgrade @lmc-eu/eslint-config-base to 3.0.1 (0d6de3b)
  • deps-dev: Bump postcss from 8.4.19 to 8.4.31 (1fdc8c9)
  • deps: Bump @babel/traverse from 7.16.0 to 7.23.2 (059ee92)
  • deps: Bump semver from 5.7.1 to 5.7.2 (0189bab)
  • deps: Bump word-wrap from 1.2.3 to 1.2.5 (5a94e5f)
  • deps: Update to Jest 29 (5acdade)
  • Try to build this package also on Node.js v20 (706ab9a)

2.4.0 (2023-06-13)

Bug Fixes

  • Fix imports not being properly recognized by IDEs (18bfb83)

Features

  • Make part of settings modal text overridable (7eccc48)

Chores

  • Remove @adamkudrna and @crispeen from codeowners (7f8b9bc)

2.3.3 (2023-05-22)

Bug Fixes

  • Cannot use 'in' operator to search for 'uid' in undefined (1deb32e)

Chores

  • deps: Bump json5 from 1.0.1 to 1.0.2 (2548df7)
  • Disable update of stylelint-config (eeaa415)

2.3.2 (2022-12-22)

Bug Fixes

  • Update button design tokens according to the latest design (e23431a)

Chores

  • Improve file name of the CSS theme map (ed30742)

2.3.1 (2022-12-15)

Bug Fixes

  • Change design token linked to button typography (ca8a2ab)

Dependencies

  • Update Can-I-Use DB used by Browserslist (ad07300)

2.3.0 (2022-12-08)

Bug Fixes

  • Fix typo in Slovak translation (6d52c18)

Dependencies

Documentation

  • Fix typo in changelog message (eca903b)
  • Remove integrity attributes because of integrity fails (19fce10)

Features

  • Replace LMC company name with new and translated legal name #CCM-65 (ca8f15c)

Chores

  • Add missing peer dependencies (b4ddc72)
  • Fix typo in semver range (refs #260) (4aacfd9)
  • Freeze vanilla-cookieconsent to 2.8.0 or allow major release (2388b8a)
  • Set target branch for additional updates (258723f)
  • Test build on multiple node versions (80782a2)
  • Update nanoid package to v3 branch only (d13a836)

Styles

  • Simplify constants imports (0c8f45e)

Tests

  • Fix haste module collision on local machine by ignoring (70d42c8)

2.2.1 (2022-06-29)

Bug Fixes

  • Add missing SecondaryButtonMode export (e2d5f6b)

Dependencies

Tests

  • Add SecondaryButtonMode to typescript example (5c517f2)

2.2.0 (2022-04-28)

Bug Fixes

  • Prevent content from being unreachable on short viewports (3a843e7)

Dependencies

Documentation

  • Improve text flow in table (3728df7)

Features

  • Add secondaryButtonMode to choose secondary button behavior #CCM-64 (e480b2d)

Styles

  • Conform to updated stylelint rules (15e3fef)
  • Decapitalize '{object}' as per eslint recommendation (bf49a10)
  • Remap tokens (f350cf6)

2.1.2 (2022-03-23)

Bug Fixes

  • Do not export const enums when using isolatedModules (6992c94)

Chores

  • Introduce action for test builds (b5bd866)

Dependencies

  • Update all dev dependencies (c85c75f)
  • Update all dev dependencies (fea704e)

Documentation

  • Using this library as typescript module (02cdd2c)

Styles

  • Switch from currentcolor to currentColor (72dd624)

2.1.1 (2022-03-08)

Bug Fixes

  • Make all properties of TranslationOverride type optional (2bb8bdd)

Dependencies

  • Update all dev dependencies (14c942f)

2.1.0 (2022-03-07)

Bug Fixes

  • Disconnect settings modal close button from button styles (71d2463)
  • Export enums as const for correct transpile into usable object (24d394a)
  • Export missing types in main module (7c27935)
  • Incompatible type definition of languages (8fabfb3)
  • Provide type for vanilla cookie consent options (67d78ba)

Code Refactoring

  • Unify access to language variables (4f28840)

Dependencies

Documentation

  • upgrade: Fix typo (7b645c2)
  • Use consent configuration in examples (52ae52b)

Features

  • Allow overriding consent description intro #CCM-63 (1f6c31a)
  • Allow overriding default translation for consent modal title #CCM-62 (32cd2ec)
  • Force content to spread over the whole row (90161f0)
  • Link background color of disabled Toggle to corresponding design token (841b320)
  • Split consent description in two paragraphs #CCM-63 (ae2575f)

2.0.0 (2022-02-11)

See upgrade guide for upgrade guidance to version 2.0.

BREAKING CHANGES

Dependencies

Documentation

  • Add button to open cookie settings modal #CCM-57 (8acb0cd)
  • Add new onFirstAction and onChange callbacks #CCM-48 (fb6590e)
  • Update examples with new callbacks #CCM-48 (b38c59e)
  • Adjust changelog lists formatting to new LMC preset (5c69666)
  • Avoid inconsistent states in language selection example (532fcd8)
  • Clearly state the plugin is mainly for LMC products (885c04e)
  • Extend configuration example page to showcase onChange event (e2ba3c1)
  • Extend readme to reflect changes in version 2.0 (ec6329b)
  • List allowed categories on callbacks example page (a417b8d)
  • Organise CSS custom properties table (98eed8e)
  • Prefer DOMContentLoaded over load event to render cookie consent modal earlier (edbd9bc)
  • Remove yarn.lock from examples (f5cf132)
  • Rework callback examples #CCM-57 (e2a1347)
  • Simplify changing of component language by using updateLanguage() method (0acb434)
  • upgrade:
  • Use version aliases for external resources to keep them up-to-date (75d1194)

Features

  • Add Czech translations for settings modal #CCM-54 (3560405)
  • Add displayMode (default force) to choose between blocking pop-up and banner #CCM-61 (6fdca25)
  • Add settings modal translations for all remaining languages #CCM-55 (3e67294)
  • Add temporary placeholder for other translations of settings modal (bf99467)
  • Make contents of <strong> actually appear strong (e9a6759)
  • Simplify translations and make settings link strong #CCM-60 (78cd4c7)
  • Submit consent to API also on settings change #CCM-59 (ffe4963)
  • Submit consent to API and dataLayer also on settings change #CCM-59 (1daca26)
  • Tweak box mode of consent modal according to graphic design #CCM-47 (18adcf3)
  • Update czech translation #CCM-54 (8e7e2b3)

Chores

  • Configure package url for bug tracker (5c03f7d)
  • Do not exclude stylelint from automated updates anymore (dd53241)
  • stylelint:
    • Conform to updated stylelint rules (df8be8d)
    • Use the latest shared Stylelint config to resolve compatibility with Stylelint 14 (ab0080a)
  • Watch and build SCSS during development (340fd91)

1.3.0 (2022-01-05)

Bug Fixes

  • Fix spacing too big after core library upgrade (7f7fd5d)

Dependencies

  • Update all dev dependencies (612ddd9)
  • Update dependency vanilla-cookieconsent to 2.7.2 (10920c4)

Documentation

  • Add cookie_necessary_only_expiration to configuration example (68230d6)

Features

  • Set shorter cookie expiration when only necessary category accepted #CCM-53 (929d8f3)

Chores

  • commitlint: Remove ignore sections cause it is not used (b421b19)
  • Define codeowners using company e-mail rather than nickname (9f5c973)
  • changelog: Add missing dependency on @lmc-eu/conventional-changelog-lmc-github (90cadbb)
  • changelog: Switch from bitbucket preset to Github preset (6bf904a)
  • Rename commitlint config to be dot notated (c9aadcb)

1.2.1 (2021-12-21)

Bug Fixes

  • Add missing cookie_name type in vanilla-cookieconsent declaration (81396b3)

Documentation

  • Fix links to previous version in changelog (783a997)

1.2.0 (2021-12-21)

Code Refactoring

  • Enable new swap_buttons feature to proper button order by default #CCM-51 (cf2d3c4)
  • Use new getUserPreferences to retrieve actual user preferences #CCM-51 (d873a22)
  • Use new onFirstAction and simplify conditions #CCM-51 (96958d5)

Dependencies

Documentation

  • Add example to show all supported languages (d142f3b)
  • Fix stylelint violation in examples (b547900)

Features

1.1.2 (2021-12-19)

Bug Fixes

  • types: Make options to be optional (73af5a3)

    Chores

  • Improve jest tests performance (a994b3c)

1.1.1 (2021-12-16)

Bug Fixes

  • Apply link text decoration also for secondary button (de5d7f8)

1.1.0 (2021-12-16)

Chores

  • Add script for code coverage by tests (86220c8)
  • typescript: Remove unused babel because we use tyescript #CCM-40 (45b9e6c)
  • typescript: Run type check on ci pipeline #CCM-40 (652d367)

Code Refactoring

  • languages: Introduce types for language configuration (4b20feb)
  • typescript: Introduce support for Typescript language #CCM-40 (3b34deb)
  • typescript: Migrate all source files to Typescript (c74e5a8)
  • typescript: Separate types for cookie consent manager (cf0e933)
  • Use category instead of level in type names (d348f59)

Dependencies

  • Pin dependencies (5bd9f67)
  • Update dependency @lmc-eu/spirit-design-tokens to ^0.5.0 (1778c57)
  • Upgrade @lmc-eu/esling-config-base to 1.1.0 (9e3a217)

Features

  • Add more theming options for links and buttons (--lmcccm-link-text-decoration, --lmcccm-link-hover-text-decoration, --lmcccm-btn-text-transform) (8ee958b)
  • Attempt to overlap UI of other third-party plugins (693fe02)

Styles

  • Use additional insights of eslint's base config as recommended (2bd3398)

Tests

  • Fix module naming collision by ignoring ./dist directory (a933611)

1.0.2 (2021-12-14)

Chores

  • Annotate the CommonJS export names for ESM import in Node (09aa8e6)
  • Do not lint build.js in examples (e5e171b)
  • Label bugfix pull requests with "bug" label (6f10f31)
  • renovate: Schedule dependency updates on weekly basis (b08c018)

Dependencies

  • Update all dev dependencies (ba55e29)
  • Update all dev dependencies (4a23611)
  • Update dependency stylelint-order to v5 (65db9eb)

Documentation

  • Change text color of success state to improve its contrast with background (b444af2)
  • Fix links and formatting in readme (41209fa)
  • lighthouse: Fix errors reported by Google Lighthouse in examples (90905fb)
  • Make it clear one need to take care of already existing cookies (82f2f9a)

1.0.1 (2021-12-06)

Chores

  • Note: Version bump for npm publish. No code change. (422614d)

1.0.0 (2021-12-06)

Bug Fixes

  • Tell bundlers not to bundle crypto dependency (22ee445)

Chores

  • Add label for Renovate bot (f59f11f)
  • Add renovate.json to configure automated deps updates (adf893f)
  • Disable dependabot because of doing lot of noise (71ddd3d)
  • Prepare for stable release (a215c45)
  • renovate: Set separateMajorMinor to false for devDependencies (6020fe2)

Code Refactoring

  • Move browser example into browser directory (f6893ee)

Dependencies

Documentation

  • Add readmes with basic instructions for examples (03a8e3c)
  • Extend examples for inline <script> usage (287c69d)
  • Introduce example for CommonJS require (8a30904)
  • Introduce module example using webpack (9e3876d)
  • Link CJS and ESM examples to readme (0c2f377)
  • Rename example directories for better orientation (51913bc)
  • Spiritify Bootstrap in examples (e6aeae2)

0.8.2 (2021-12-02)

Bug Fixes

  • Actually push to dataLayer only of first accept #CCM-46 (507ae60)
  • Use proper level name stored to dataLayer (b133746)

0.8.1 (2021-12-02)

Bug Fixes

  • Add missing 'ads' level to dataLayer (ec6ed5b)

Dependencies

  • Bump babel-jest from 27.4.1 to 27.4.2 (e3c499d)
  • Bump jest from 27.4.1 to 27.4.2 (832f4ce)
  • Bump jest from 27.4.2 to 27.4.3 (5320995)
  • Bump postcss from 8.4.1 to 8.4.4 (3211c80)
  • Bump sass from 1.43.5 to 1.44.0 (078daa9)

0.8.0 (2021-12-01)

BREAKING CHANGES

  • Remove unwanted theming options for secondary buttons (f36d299)
    • Remove: --lmcccm-base-font-size, --lmcccm-btn-secondary-bg, --lmcccm-btn-secondary-hover-bg, --lmcccm-btn-secondary-active-bg
  • Update buttons theming API according to the latest design (ba39ed9)
    • Remove: --lmcccm-btn-secondary-text, --lmcccm-btn-secondary-hover-text, --lmcccm-btn-secondary-active-text
    • Add: --lmcccm-btn-font-weight
    • Change Inter font URL to include width 600

Bug Fixes

  • Revert font family inheritance as it blocked font customization (efe992e)

Chores

  • Add ignored internal URL to link check config (32c3755)
  • Merge linting into test workflow (c99e621)

Dependencies

  • Bump babel-jest from 27.3.1 to 27.4.1 (ce100ad)
  • Bump esbuild from 0.13.15 to 0.14.1 (3d9fa63)
  • Bump eslint from 8.2.0 to 8.3.0 (b2d83ae)
  • Bump jest from 27.3.1 to 27.4.1 (c4791d8)
  • Update Spirit Design Tokens (7687df7)

Documentation

  • Add custom theme demo to examples #CCM-21 (f0855ed)
  • Add description of extended configuration example (fd7e8ba)
  • Add table of contents to readme (e6cdca6)
  • Fix link to vanilla cookieconsent readme (2df83d3)
  • Grammar fixes (b6ecb31)
  • Improve docs design (92abca3)
  • Improve formatting (4d8962d)
  • Make clear that Inter font link is mandatory unless font family is customized (ea7837b)
  • Use switches instead of buttons to demonstrate theming (a008edc)

Features

  • Add theming options to adjust button borders (d1f38cc)
    • Add --lmcccm-btn-border-width, --lmcccm-btn-border-style, --lmcccm-btn-border-radius, --lmcccm-btn-primary-border, --lmcccm-btn-primary-hover-border, --lmcccm-btn-primary-active-border
  • Let base font size be inherited from surrounding text (c12341d)
  • Push to dataLayer only of first accept #CCM-46 (0b198a0)

0.7.0 (2021-11-26)

Bug Fixes

  • Make font-family fallback actually work as documented (52e2656)

Chores

  • Cache yarn dependencies to increase GH Actions jobs speed (57becf7)
  • Fix condition to generate minor on both cases (4e2e180)
  • Test if package is still buildable (e7ce285)

Code Refactoring

  • Extract assemble config into variable (66f5e93)

Dependencies

  • Bump @babel/preset-env from 7.16.0 to 7.16.4 (6912d80)
  • Bump @lmc-eu/commitlint-config from 1.0.4 to 1.0.5 (d8c69f0)
  • Bump @lmc-eu/prettier-config from 1.1.1 to 1.2.0 (d51f2da)
  • Bump @lmc-eu/stylelint-config from 2.0.0 to 2.0.1 (a0bdba8)
  • Bump esbuild from 0.13.14 to 0.13.15 (b9c3993)
  • Bump postcss from 8.3.11 to 8.4.1 (7ccc52c)
  • Bump prettier from 2.4.1 to 2.5.0 (9de88e9)
  • Bump sass from 1.43.4 to 1.43.5 (5679690)

Documentation

  • Add example of localStorage clear (c19a414)

Features

Styles

  • Introduce codestyle linting usingESLint refs #CCM-6 (5b4756d)
  • Lint entire codebase not few directories (158eaa7)
  • Reformat code by prettier (b13af7b)
  • Reformat code using ESLint ruleset refs #CCM-6 (d9d96b9)

0.6.0 (2021-11-19)

BREAKING CHANGES

  • Require service name to be passed as the first parameter #CCM-35 (680165)

Chores

  • Add jest testing framework and unit testing workflow (39468d1)
  • Check for broken links in markdown (58a5a79)
  • Fix building when using crypto in nanoid (82f5943)

Dependencies

  • Bump @commitlint/cli from 14.1.0 to 15.0.0 (85474f8)
  • Bump @lmc-eu/commitlint-config from 1.0.3 to 1.0.4 (10cf00e)
  • Bump @lmc-eu/conventional-changelog-lmc-bitbucket (d894fb2)
  • Bump @lmc-eu/prettier-config from 1.1.0 to 1.1.1 (a3cd839)
  • Bump @lmc-eu/stylelint-config from 1.0.4 to 2.0.0 (a7fa50d)
  • Bump esbuild from 0.13.13 to 0.13.14 (a82527b)
  • Bump vanilla-cookieconsent from 2.6.1 to 2.6.2 (1729ddd)

Documentation

  • Add example of specifying custom company names #CCM-25 (131eb34)
  • Do not use patch part in URL to allow using bugfix versions automatically #CCM-29 (b484c4e)
  • Fix broken links in readme (cadeb72)
  • Fix wrong autodetectLang type in readme (278a3b1)
  • Introduce companyNames option in readme #CCM-25 (06637bc)
  • Update list of supported languages (84e99fd)

Features

Styles

  • Fix pseudo-element notation according to stylelint-config (f4a607f)

Tests

0.5.0 (2021-11-11)

Chores

  • Skip breaking changes until package is stable (7d8174d)

Documentation

  • Legacy import using CommonJS and problem with webpack (e1fa6a7)
  • Minor readme improvements (3743330)
  • Unify codestyle in examples (c6ebfa0)

Features

  • Introduce build for CommonJS and use more common extensions (8c2c553)
  • Introduce ES module entry point (fad5730)

0.4.1 (2021-11-09)

Chores

  • Fix path change in spirit-design-token@0.4.1 (46f3b47)
  • Upgrade node.js version to v16 in pipelines (e51afc9)
  • Use npm set script instead of node script (7f788f1)

Dependencies

  • Bump @commitlint/cli from 13.2.1 to 14.1.0 (2e91e31)
  • Bump @lmc-eu/browserslist-config from 1.0.0 to 1.0.1 (f9cd8b4)
  • Bump @lmc-eu/commitlint-config from 1.0.2 to 1.0.3 (67febaa)
  • Bump @lmc-eu/prettier-config from 1.0.3 to 1.1.0 (eb174bc)
  • Bump @lmc-eu/spirit-design-tokens from 0.2.0 to 0.4.2 (18a78ec)
  • Bump @lmc-eu/stylelint-config from 1.0.3 to 1.0.4 (bb04c6e)
  • Bump esbuild from 0.13.12 to 0.13.13 (0c23f7c)
  • Bump postcss-cli from 8.3.1 to 9.0.2 (4120c18)

Documentation

Styles

  • Adjust html indenting in .editorconfig (4dad63c)
  • Fix formatting according to updated prettier-config (a70979a)

0.4.0 (2021-11-05)

Chores

  • Introduce dependabot configuration for automated deps updates (0cf893d)
  • Remove prepare script before publishing package (ac4b6a9)
  • Rename pr-labeler config file to use yaml extension everywhere (796bf2c)
  • Use .yarnrc instead of .npmrc because we are using yarn (66b2d5e)

Dependencies

  • Bump @lmc-eu/conventional-changelog-lmc-bitbucket (2e17ebd)

Features

  • Introduce new design connected to Spirit design tokens #CCM-7 (658c99f)

0.3.1 (2021-11-04)

Chores

  • Automatically replace package version in readme file to current (97454e1)
  • Disable commit message hook with CI env (3b0e0b9)
  • Disable prepare script with commitlint on CI publish (4886281)
  • Introduce contributors array to display package authors (e2c3c4f)
  • Introduce keywords to display on package page (d8a3568)
  • Introduce PR labelling (4f8e67d)
  • Introduce release action which is triggered manually (97c00f0)
  • Omit version prefix from replacing jsdelivr urls in readme (704332b)
  • Run publish only on tagged refs without any prefix (534caf3)
  • Set git tag version to plain semver string without prefix (6f7c069)

0.3.0 (2021-11-02)

Chores

Code Refactoring

  • Rearrange and document internal defaults (5b6c8e6)

Dependencies

Documentation

Features

0.2.0 (2021-11-01)

Bug Fixes

  • Incomplete options passed by user overrides all defaults (68f8dcb)

Chores

  • Add repository URL to make it shown also on npmjs.com (66947d6)
  • Block fixup commit message using github action (1a43014)
  • Generate changelog using conventional changelog (dddacfc)
  • Introduce commit linting (d8238c3)
  • Introduce simple dev server for local development #CCM-5 (84c3245)
  • Make package publishlable (effcd7a)
  • Rename dev script to more common start (bb6bd54)
  • Run all check with single npm script (fee171a)
  • Use usernames instead of names for codeowners (5cd5eba)

Code Refactoring

  • Unify variable casing to camelCase (3f1367e)

Documentation

Features

  • Add callbacks for all onAccept scenarios #CCM-24 (23314b5)
  • Add custom onAccept callback to extend the default one #CCM-19 (8ed95ba)
  • Add translations for cs, en, sk and pl language #CCM-10 (1743866)
  • Configure consent levels #CCM-12 (703cf98)
  • Configure plugin defaults (bd6309f)
  • Make language autodetection easily configurable #CCM-26 (4404a9a)
  • Provide cookieConsent instance to callbacks #CCM-24 (9232b09)
  • Push info to dataLayer on accept (4203092)
  • Rename default language settings to defaultLang to make it more understandable #CCM-26 (6635813)
  • Return CookieConsent instance from the init function (b217059)
  • Save distribution files for instant usage and examples (d9964f3)

0.1.0 (2021-10-19)

Chores

  • Build package using ESbuild (19ff586)
  • Introduce prettier and reformat files using default lmc config (8c433a2)
  • Lint css using github action (2b7f4dd)

Code Refactoring

  • Build and rename distribution files (bdb0f89)

Dependencies

Documentation

  • Documentation of usage and configuration (6db08fa)

Features

  • Initial configuration for cookie consent (38a4221)
  • Introduce support for czech language (ca547eb)