@commversion/libs 0.5.0 → 0.6.0-alpha-0

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/README.md CHANGED
@@ -32,6 +32,7 @@ All scripts are available under the `scripts/` directory.
32
32
  - lc-input-errors
33
33
  - lc-show-hide
34
34
  - schedule-event
35
+ - lc-gtm
35
36
  - lc-device
36
37
  - lc-geoblocking
37
38
  - lc-utm-params
package/dist/lc-gtm.js ADDED
@@ -0,0 +1 @@
1
+ (function(){"use strict";const t=(a,o)=>{const{dataLayer:d}=window;d.push({event:`lc_${a}`,data:o})},c=["ready","availability_changed","visibility_changed","customer_status_changed","new_event","form_submitted","rating_submitted","greeting_displayed","greeting_hidden","rich_message_button_clicked"],r=a=>({state:o,configuration:d})=>{const i=!1,{LiveChatWidget:n,dataLayer:s}=window;!n||typeof window.gaGlobal=="undefined"||!s||(c.forEach(e=>{n.on(e,_=>t(e,_))}),n.on("customer_status_changed",({status:e})=>{e==="chatting"?(t("chat_started",{status:e}),i=!0):e==="browsing"&&i&&(t("chat_ended",{status:e}),i=!1)}))};window.commversion=window.commversion||{},window.LiveChatWidget.on("ready",r())})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commversion/libs",
3
- "version": "0.5.0",
3
+ "version": "0.6.0-alpha-0",
4
4
  "author": "Marios Antonoudiou <mariosant@sent.com>",
5
5
  "license": "UNLICENSED",
6
6
  "scripts": {
@@ -8,6 +8,8 @@
8
8
  "test": "wtr ./scripts/**/*.test.js --node-resolve",
9
9
  "prepack": "concurrently npm:build:*",
10
10
  "release": "release-it",
11
+ "dev:lc-gtm": "vite serve scripts/lc-gtm/src/",
12
+ "build:lc-gtm": "vite build -c scripts/lc-gtm/vite.config.js",
11
13
  "dev:lc-device": "vite serve scripts/lc-device/src/",
12
14
  "build:lc-device": "vite build -c scripts/lc-device/vite.config.js",
13
15
  "dev:lc-geoblocking": "vite serve scripts/lc-geoblocking/src/",