@sesamy/sesamy-js 1.3.1 → 1.3.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.
Files changed (56) hide show
  1. package/dist/index.d.ts +108 -0
  2. package/dist/sesamy-js.cjs +6 -0
  3. package/dist/sesamy-js.iife.js +6 -0
  4. package/dist/sesamy-js.mjs +3082 -0
  5. package/package.json +4 -2
  6. package/.env +0 -2
  7. package/.env.production +0 -2
  8. package/.eslintignore +0 -4
  9. package/.eslintrc +0 -18
  10. package/.github/workflows/release.yml +0 -23
  11. package/.nvmrc +0 -1
  12. package/.prettierignore +0 -4
  13. package/.prettierrc +0 -5
  14. package/CHANGELOG.md +0 -132
  15. package/README.md +0 -69
  16. package/article.html +0 -65
  17. package/contracts.html +0 -23
  18. package/dts-bundle-generator.config.ts +0 -11
  19. package/entitlements.html +0 -23
  20. package/index.html +0 -24
  21. package/renovate.json +0 -4
  22. package/src/SesamyContracts.ts +0 -86
  23. package/src/SesamyEntitlements.ts +0 -85
  24. package/src/app.ts +0 -101
  25. package/src/constants.ts +0 -2
  26. package/src/controllers/index.ts +0 -1
  27. package/src/controllers/paywall.ts +0 -14
  28. package/src/entitlementsStyle.css +0 -147
  29. package/src/events/ready.ts +0 -12
  30. package/src/index.ts +0 -36
  31. package/src/javascript-api.ts +0 -84
  32. package/src/services/analytics/element-tracker.ts +0 -117
  33. package/src/services/analytics/index.ts +0 -234
  34. package/src/services/analytics/listeners/index.ts +0 -2
  35. package/src/services/analytics/listeners/route.ts +0 -9
  36. package/src/services/analytics/listeners/scroll.ts +0 -62
  37. package/src/services/analytics/session-id.ts +0 -11
  38. package/src/services/analytics/types/analytics-activity-utils.d.ts +0 -54
  39. package/src/services/analytics/types/analytics-router-utils.d.ts +0 -7
  40. package/src/services/analytics/types/analytics-scroll-utils.d.ts +0 -4
  41. package/src/services/analytics/types/track-event.ts +0 -70
  42. package/src/services/auth/index.ts +0 -74
  43. package/src/services/sesamy/index.ts +0 -160
  44. package/src/state.ts +0 -3
  45. package/src/style.css +0 -99
  46. package/src/types/Bills.ts +0 -12
  47. package/src/types/Config.ts +0 -11
  48. package/src/types/Contracts.ts +0 -12
  49. package/src/types/Entitlement.ts +0 -9
  50. package/src/types/Events.ts +0 -6
  51. package/src/types/Tag.ts +0 -16
  52. package/src/vite-env.d.ts +0 -1
  53. package/tsconfig.json +0 -23
  54. package/vite.config.ts +0 -43
  55. package/vite.dev.config.ts +0 -14
  56. /package/{public → dist}/sesamy.png +0 -0
package/src/style.css DELETED
@@ -1,99 +0,0 @@
1
- :root {
2
- font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
3
- line-height: 1.5;
4
- font-weight: 400;
5
-
6
- color-scheme: light dark;
7
- color: rgba(255, 255, 255, 0.87);
8
- background-color: #242424;
9
-
10
- font-synthesis: none;
11
- text-rendering: optimizeLegibility;
12
- -webkit-font-smoothing: antialiased;
13
- -moz-osx-font-smoothing: grayscale;
14
- }
15
-
16
- a {
17
- font-weight: 500;
18
- color: #646cff;
19
- text-decoration: inherit;
20
- }
21
- a:hover {
22
- color: #535bf2;
23
- }
24
-
25
- body {
26
- margin: 0;
27
- display: flex;
28
- place-items: center;
29
- min-width: 320px;
30
- min-height: 100vh;
31
- }
32
-
33
- h1 {
34
- font-size: 3.2em;
35
- line-height: 1.1;
36
- }
37
-
38
- sesamy-app {
39
- max-width: 1280px;
40
- margin: 0 auto;
41
- padding: 2rem;
42
- text-align: center;
43
- }
44
-
45
- .logo {
46
- height: 6em;
47
- padding: 1.5em;
48
- will-change: filter;
49
- transition: filter 300ms;
50
- }
51
- .logo:hover {
52
- filter: drop-shadow(0 0 2em #646cffaa);
53
- }
54
- .logo.vanilla:hover {
55
- filter: drop-shadow(0 0 2em #3178c6aa);
56
- }
57
-
58
- .card {
59
- padding: 2em;
60
- }
61
-
62
- .read-the-docs {
63
- color: #888;
64
- }
65
-
66
- button {
67
- border-radius: 8px;
68
- border: 1px solid transparent;
69
- padding: 0.6em 1.2em;
70
- font-size: 1em;
71
- font-weight: 500;
72
- font-family: inherit;
73
- background-color: #1a1a1a;
74
- cursor: pointer;
75
- transition: border-color 0.25s;
76
- }
77
- button:hover {
78
- border-color: #646cff;
79
- }
80
- button:focus,
81
- button:focus-visible {
82
- outline: 4px auto -webkit-focus-ring-color;
83
- }
84
- .hidden {
85
- display: none;
86
- }
87
-
88
- @media (prefers-color-scheme: light) {
89
- :root {
90
- color: #213547;
91
- background-color: #ffffff;
92
- }
93
- a:hover {
94
- color: #747bff;
95
- }
96
- button {
97
- background-color: #f9f9f9;
98
- }
99
- }
@@ -1,12 +0,0 @@
1
- export type Bill = {
2
- id: string;
3
- items: [
4
- {
5
- sku: string;
6
- title: string;
7
- purchaseOption: string;
8
- },
9
- ];
10
- status: string;
11
- createdAt: string;
12
- };
@@ -1,11 +0,0 @@
1
- export interface Config {
2
- clientId: string;
3
- namespace?: string;
4
- analytics?: Partial<AnalyticsConfig>;
5
- }
6
-
7
- export interface AnalyticsConfig {
8
- clientId: string;
9
- enabled?: boolean;
10
- endpoint?: string;
11
- }
@@ -1,12 +0,0 @@
1
- export type Contract = {
2
- id: string;
3
- items: [
4
- {
5
- sku: string;
6
- title: string;
7
- purchaseOption: string;
8
- },
9
- ];
10
- status: string;
11
- createdAt: string;
12
- };
@@ -1,9 +0,0 @@
1
- export type Entitlement = {
2
- id: string;
3
- sku: string;
4
- cover: string;
5
- title: string;
6
- description: string;
7
- createdAt: string;
8
- updatedAt: string;
9
- };
@@ -1,6 +0,0 @@
1
- export enum Events {
2
- READY = 'sesamyReady',
3
- AUTHENTICATED = 'sesamyAuthenticated',
4
- LOGOUT = 'sesamyLogout',
5
- SOFT_PAYWALL = 'sesamySoftPaywall',
6
- }
package/src/types/Tag.ts DELETED
@@ -1,16 +0,0 @@
1
- export type TagValue = string | number | (string | number)[];
2
-
3
- export type Tag = {
4
- id: string;
5
- value: TagValue;
6
- policies?: {
7
- // ttl in seconds
8
- ttl?: number;
9
- maxItems?: number;
10
- unique?: boolean;
11
- overflow?: "block" | "fifo";
12
- ipSessionSharing?: boolean;
13
- };
14
- updatedAt: string;
15
- createdAt: string;
16
- };
package/src/vite-env.d.ts DELETED
@@ -1 +0,0 @@
1
- /// <reference types="vite/client" />
package/tsconfig.json DELETED
@@ -1,23 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2020",
4
- "useDefineForClassFields": true,
5
- "module": "ESNext",
6
- "lib": ["ES2020", "DOM", "DOM.Iterable"],
7
-
8
- /* Bundler mode */
9
- "moduleResolution": "bundler",
10
- "allowImportingTsExtensions": true,
11
- "resolveJsonModule": true,
12
- "isolatedModules": true,
13
- "noEmit": true,
14
-
15
- /* Linting */
16
- "strict": true,
17
- "noUnusedLocals": true,
18
- "noUnusedParameters": true,
19
- "noFallthroughCasesInSwitch": true,
20
- "types": ["vite/client"]
21
- },
22
- "include": ["src"]
23
- }
package/vite.config.ts DELETED
@@ -1,43 +0,0 @@
1
- /// <reference types="vitest" />
2
- import path from 'path';
3
- import { defineConfig } from 'vite';
4
-
5
- const getPackageName = () => {
6
- return 'sesamy-js';
7
- };
8
-
9
- const getPackageNameCamelCase = () => {
10
- try {
11
- return getPackageName().replace(/-./g, char => char[1].toUpperCase());
12
- } catch (err) {
13
- throw new Error('Name property in package.json is missing.');
14
- }
15
- };
16
-
17
- const fileName = {
18
- es: `${getPackageName()}.mjs`,
19
- cjs: `${getPackageName()}.cjs`,
20
- iife: `${getPackageName()}.iife.js`,
21
- };
22
-
23
- const formats = Object.keys(fileName) as Array<keyof typeof fileName>;
24
-
25
- module.exports = defineConfig({
26
- base: './',
27
- build: {
28
- outDir: './build/dist',
29
- lib: {
30
- entry: path.resolve(__dirname, 'src/index.ts'),
31
- name: getPackageNameCamelCase(),
32
- formats,
33
- fileName: format => fileName[format],
34
- },
35
- },
36
- test: {},
37
- resolve: {
38
- alias: [
39
- { find: '@', replacement: path.resolve(__dirname, 'src') },
40
- { find: '@@', replacement: path.resolve(__dirname) },
41
- ],
42
- },
43
- });
@@ -1,14 +0,0 @@
1
- import { defineConfig } from 'vite';
2
-
3
- export default defineConfig({
4
- build: {
5
- rollupOptions: {
6
- input: {
7
- main: 'index.html',
8
- article: 'article.html',
9
- entitlements: 'entitlements.html',
10
- contracts: 'contracts.html',
11
- },
12
- },
13
- },
14
- });
File without changes