@commversion/libs 0.18.2 → 0.18.3
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/.cspell.json +149 -0
- package/.editorconfig +10 -0
- package/.husky/pre-commit +27 -0
- package/.husky/prepare-commit-msg +13 -0
- package/.markdownlint.json +4 -0
- package/.oxfmtrc.json +6 -0
- package/.oxlintrc.json +34 -0
- package/.release-it.json +9 -3
- package/.vscode/extensions.json +18 -0
- package/.vscode/settings.json +12 -0
- package/README.md +20 -10
- package/dist/lc-attribution.js +1 -0
- package/dist/lc-channel-widgets.js +7 -7
- package/dist/lc-cookie-banner-update-position.js +3 -3
- package/dist/lc-device.js +1 -1
- package/dist/lc-exit-intent-debounced.js +1 -1
- package/dist/lc-exit-intent.js +1 -1
- package/dist/lc-experiment.js +1 -1
- package/dist/lc-form-abandonment.js +1 -1
- package/dist/lc-form-submission.js +1 -1
- package/dist/lc-ga-initialize-event.js +1 -1
- package/dist/lc-ga-tags.js +1 -1
- package/dist/lc-gclid.js +1 -1
- package/dist/lc-geoblocking.js +1 -1
- package/dist/lc-gtm.js +1 -1
- package/dist/lc-input-error.js +1 -1
- package/dist/lc-kill-chat-persist.js +1 -1
- package/dist/lc-kill-chat.js +1 -1
- package/dist/lc-open-on-button-click.js +1 -1
- package/dist/lc-pause-on-url.js +1 -1
- package/dist/lc-powered-by.js +1 -1
- package/dist/lc-show-by-selector.js +1 -1
- package/dist/lc-show-hide.js +1 -1
- package/dist/lc-utm-params.js +1 -1
- package/dist/lc-whatsapp-widget-combo.js +4 -4
- package/dist/lc-whatsapp-widget-only.js +8 -8
- package/dist/schedule-event.js +1 -1
- package/global.d.ts +320 -0
- package/package.json +112 -87
- package/pnpm-workspace.yaml +33 -0
- package/templates/scaffold.ts +86 -0
- package/templates/script/README.md +11 -0
- package/templates/script/package.json +4 -0
- package/templates/script/src/NAME.ts +6 -0
- package/templates/script/src/index.html +57 -0
- package/templates/script/src/main.ts +5 -0
- package/templates/script/tests/NAME.test.ts +9 -0
- package/templates/script/vite.config.ts +19 -0
- package/tsconfig.json +32 -0
- package/vitest.config.ts +18 -0
- package/.prettierignore +0 -4
- package/.prettierrc +0 -3
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# NAME
|
|
2
|
+
|
|
3
|
+
## Installation
|
|
4
|
+
|
|
5
|
+
Document how this script is supposed to be installed.
|
|
6
|
+
Make sure any configuration requirements are explained here.
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
|
|
10
|
+
Document how this script is supposed to be used.
|
|
11
|
+
Provide examples for different use cases.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<title>NAME</title>
|
|
5
|
+
</head>
|
|
6
|
+
<body>
|
|
7
|
+
<!-- Start of LiveChat (www.livechatinc.com) code -->
|
|
8
|
+
<script>
|
|
9
|
+
window.__lc = window.__lc || {};
|
|
10
|
+
window.__lc.license = 10793607;
|
|
11
|
+
(function (n, t, c) {
|
|
12
|
+
function i(n) {
|
|
13
|
+
return e._h ? e._h.apply(null, n) : e._q.push(n);
|
|
14
|
+
}
|
|
15
|
+
var e = {
|
|
16
|
+
_q: [],
|
|
17
|
+
_h: null,
|
|
18
|
+
_v: "2.0",
|
|
19
|
+
on: function () {
|
|
20
|
+
i(["on", c.call(arguments)]);
|
|
21
|
+
},
|
|
22
|
+
once: function () {
|
|
23
|
+
i(["once", c.call(arguments)]);
|
|
24
|
+
},
|
|
25
|
+
off: function () {
|
|
26
|
+
i(["off", c.call(arguments)]);
|
|
27
|
+
},
|
|
28
|
+
get: function () {
|
|
29
|
+
if (!e._h) throw new Error("[LiveChatWidget] You can't use getters before load.");
|
|
30
|
+
return i(["get", c.call(arguments)]);
|
|
31
|
+
},
|
|
32
|
+
call: function () {
|
|
33
|
+
i(["call", c.call(arguments)]);
|
|
34
|
+
},
|
|
35
|
+
init: function () {
|
|
36
|
+
var n = t.createElement("script");
|
|
37
|
+
((n.async = !0),
|
|
38
|
+
(n.type = "text/javascript"),
|
|
39
|
+
(n.src = "https://cdn.livechatinc.com/tracking.js"),
|
|
40
|
+
t.head.appendChild(n));
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
(!n.__lc.asyncInit && e.init(), (n.LiveChatWidget = n.LiveChatWidget || e));
|
|
44
|
+
})(window, document, [].slice);
|
|
45
|
+
</script>
|
|
46
|
+
<!-- End of LiveChat code -->
|
|
47
|
+
|
|
48
|
+
<script async src="./main.ts" type="module"></script>
|
|
49
|
+
<script>
|
|
50
|
+
window.commversion = {
|
|
51
|
+
key: "value",
|
|
52
|
+
};
|
|
53
|
+
</script>
|
|
54
|
+
|
|
55
|
+
<h1>NAME</h1>
|
|
56
|
+
</body>
|
|
57
|
+
</html>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
|
|
3
|
+
import type { UserConfig } from "vite";
|
|
4
|
+
|
|
5
|
+
const config: UserConfig = {
|
|
6
|
+
build: {
|
|
7
|
+
outDir: path.resolve("dist"),
|
|
8
|
+
emptyOutDir: false,
|
|
9
|
+
target: "es2015",
|
|
10
|
+
lib: {
|
|
11
|
+
entry: path.resolve(__dirname, "src/main.ts"),
|
|
12
|
+
name: "CAMEL_NAME",
|
|
13
|
+
fileName: () => "NAME.js",
|
|
14
|
+
formats: ["iife"],
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default config;
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"include": ["scripts/**/*.ts", "templates/**/*.ts", "global.d.ts"],
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"target": "ESNext",
|
|
5
|
+
"lib": ["ESNext", "DOM"],
|
|
6
|
+
"types": ["node", "@vitest/browser-playwright"],
|
|
7
|
+
"module": "NodeNext",
|
|
8
|
+
"moduleResolution": "NodeNext",
|
|
9
|
+
"experimentalDecorators": true,
|
|
10
|
+
"isolatedDeclarations": true,
|
|
11
|
+
"verbatimModuleSyntax": true,
|
|
12
|
+
"resolveJsonModule": false, // ESM doesn't support JSON modules yet.
|
|
13
|
+
"esModuleInterop": true,
|
|
14
|
+
"isolatedModules": true,
|
|
15
|
+
"stripInternal": true,
|
|
16
|
+
"skipLibCheck": true,
|
|
17
|
+
"declaration": true,
|
|
18
|
+
"noEmit": true,
|
|
19
|
+
// Type Checking
|
|
20
|
+
"allowUnreachableCode": false,
|
|
21
|
+
"allowUnusedLabels": false,
|
|
22
|
+
"exactOptionalPropertyTypes": true,
|
|
23
|
+
"noFallthroughCasesInSwitch": true,
|
|
24
|
+
"noImplicitOverride": true,
|
|
25
|
+
"noImplicitReturns": true,
|
|
26
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
27
|
+
"noUncheckedIndexedAccess": true,
|
|
28
|
+
"noUnusedLocals": true,
|
|
29
|
+
"noUnusedParameters": true,
|
|
30
|
+
"strict": true
|
|
31
|
+
}
|
|
32
|
+
}
|
package/vitest.config.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { playwright } from "@vitest/browser-playwright";
|
|
2
|
+
import { defineConfig } from "vitest/config";
|
|
3
|
+
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
test: {
|
|
6
|
+
include: ["scripts/*/tests/**/*.test.{js,ts}"],
|
|
7
|
+
isolate: true,
|
|
8
|
+
restoreMocks: true,
|
|
9
|
+
unstubGlobals: true,
|
|
10
|
+
unstubEnvs: true,
|
|
11
|
+
browser: {
|
|
12
|
+
enabled: true,
|
|
13
|
+
provider: playwright(),
|
|
14
|
+
headless: true,
|
|
15
|
+
instances: [{ browser: "chromium" }],
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
});
|
package/.prettierignore
DELETED
package/.prettierrc
DELETED