@saasquatch/squatch-js 2.6.0-8 → 2.6.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.
Files changed (61) hide show
  1. package/.github/workflows/size-limit.yml +14 -14
  2. package/.github/workflows/static.yml +89 -89
  3. package/CHANGELOG.md +388 -326
  4. package/LICENSE +20 -20
  5. package/README.md +259 -208
  6. package/babel.config.js +7 -7
  7. package/cucumber.js +45 -45
  8. package/demo/sandbox.ts +124 -124
  9. package/demo/toolbar.tsx +526 -526
  10. package/dist/api/WidgetApi.d.ts +1 -0
  11. package/dist/async.d.ts +2 -0
  12. package/dist/globals.d.ts +4 -0
  13. package/dist/squatch.esm.js +80 -49
  14. package/dist/squatch.esm.js.map +1 -1
  15. package/dist/squatch.js +80 -49
  16. package/dist/squatch.js.map +1 -1
  17. package/dist/squatch.min.js +1 -1
  18. package/dist/squatch.min.js.br +0 -0
  19. package/dist/squatch.min.js.map +1 -1
  20. package/dist/squatch.modern.js +1 -1
  21. package/dist/squatch.modern.js.map +1 -1
  22. package/dist/stats.html +1 -1
  23. package/dist/utils/decodeJwt.d.ts +1 -0
  24. package/dist/utils/validate.d.ts +0 -2
  25. package/dist/widgets/PopupWidget.d.ts +2 -2
  26. package/dist/widgets/declarative/DeclarativeWidget.d.ts +5 -0
  27. package/jest.config.ts +200 -200
  28. package/package.json +123 -123
  29. package/tsconfig.json +23 -23
  30. package/coverage/clover.xml +0 -865
  31. package/coverage/coverage-final.json +0 -20
  32. package/coverage/lcov-report/DeclarativeWidget.ts.html +0 -790
  33. package/coverage/lcov-report/WidgetApi.ts.html +0 -631
  34. package/coverage/lcov-report/Widgets.ts.html +0 -1105
  35. package/coverage/lcov-report/api/AnalyticsApi.ts.html +0 -304
  36. package/coverage/lcov-report/api/EventsApi.ts.html +0 -352
  37. package/coverage/lcov-report/api/WidgetApi.ts.html +0 -658
  38. package/coverage/lcov-report/api/graphql.ts.html +0 -130
  39. package/coverage/lcov-report/base.css +0 -224
  40. package/coverage/lcov-report/block-navigation.js +0 -87
  41. package/coverage/lcov-report/favicon.png +0 -0
  42. package/coverage/lcov-report/prettify.css +0 -1
  43. package/coverage/lcov-report/prettify.js +0 -2
  44. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  45. package/coverage/lcov-report/sorter.js +0 -196
  46. package/coverage/lcov-report/squatch.ts.html +0 -721
  47. package/coverage/lcov-report/utils/cookieUtils.ts.html +0 -415
  48. package/coverage/lcov-report/utils/decodeUserJwt.ts.html +0 -133
  49. package/coverage/lcov-report/utils/domready.ts.html +0 -160
  50. package/coverage/lcov-report/utils/io.ts.html +0 -400
  51. package/coverage/lcov-report/utils/utmUtils.ts.html +0 -277
  52. package/coverage/lcov-report/utils/validate.ts.html +0 -268
  53. package/coverage/lcov-report/validate.ts.html +0 -268
  54. package/coverage/lcov-report/widgets/EmbedWidget.ts.html +0 -481
  55. package/coverage/lcov-report/widgets/PopupWidget.ts.html +0 -685
  56. package/coverage/lcov-report/widgets/Widget.ts.html +0 -1159
  57. package/coverage/lcov-report/widgets/Widgets.ts.html +0 -1102
  58. package/coverage/lcov-report/widgets/declarative/DeclarativeWidget.ts.html +0 -790
  59. package/coverage/lcov-report/widgets/declarative/DeclarativeWidgets.ts.html +0 -388
  60. package/coverage/lcov.info +0 -1593
  61. package/stats.json +0 -1
@@ -0,0 +1 @@
1
+ export declare function decodeUserJwt(tokenStr: string): any;
@@ -1,6 +1,4 @@
1
1
  import { ConfigOptions, WidgetConfig } from "../types";
2
- export declare const DEFAULT_DOMAIN = "https://app.referralsaasquatch.com";
3
- export declare const DEFAULT_NPM_CDN = "https://fast.ssqt.io/npm";
4
2
  type Required<T> = T extends object ? {
5
3
  [P in keyof T]-?: NonNullable<T[P]>;
6
4
  } : T;
@@ -17,8 +17,8 @@ export default class PopupWidget extends Widget {
17
17
  constructor(params: Params, trigger?: string | null);
18
18
  _initialiseCTA(): void;
19
19
  _createPopupDialog(): HTMLDialogElement;
20
- load(): void;
21
- protected _setupResizeHandler(frame: HTMLIFrameElement): void;
20
+ load(): Promise<void>;
21
+ protected _setupResizeHandler(frame: HTMLIFrameElement): Promise<void>;
22
22
  open(): void;
23
23
  close(): void;
24
24
  protected _clickedOutside({ target }: {
@@ -59,6 +59,11 @@ export default abstract class DeclarativeWidget extends HTMLElement {
59
59
  */
60
60
  container: string | HTMLElement | undefined | null;
61
61
  element: HTMLElement | undefined;
62
+ /**
63
+ * Flag for if the component has been loaded or not
64
+ * @hidden
65
+ */
66
+ loaded: boolean;
62
67
  constructor();
63
68
  private _setupApis;
64
69
  private renderPasswordlessVariant;
package/jest.config.ts CHANGED
@@ -1,200 +1,200 @@
1
- /*
2
- * For a detailed explanation regarding each configuration property and type check, visit:
3
- * https://jestjs.io/docs/configuration
4
- */
5
-
6
- export default {
7
- // All imported modules in your tests should be mocked automatically
8
- // automock: false,
9
-
10
- // Stop running tests after `n` failures
11
- // bail: 0,
12
-
13
- // The directory where Jest should store its cached dependency information
14
- // cacheDirectory: "/private/var/folders/zv/t83jrkg12jx3bqgq3vx_v29h0000gp/T/jest_dy",
15
-
16
- // Automatically clear mock calls, instances, contexts and results before every test
17
- // clearMocks: false,
18
-
19
- // Indicates whether the coverage information should be collected while executing the test
20
- // collectCoverage: false,
21
-
22
- // An array of glob patterns indicating a set of files for which coverage information should be collected
23
- // collectCoverageFrom: undefined,
24
-
25
- // The directory where Jest should output its coverage files
26
- // coverageDirectory: "coverage",
27
-
28
- // An array of regexp pattern strings used to skip coverage collection
29
- coveragePathIgnorePatterns: ["/node_modules/", "/test/"],
30
-
31
- // Indicates which provider should be used to instrument code for coverage
32
- // coverageProvider: "babel",
33
-
34
- // A list of reporter names that Jest uses when writing coverage reports
35
- // coverageReporters: [
36
- // "json",
37
- // "text",
38
- // "lcov",
39
- // "clover"
40
- // ],
41
-
42
- // An object that configures minimum threshold enforcement for coverage results
43
- // coverageThreshold: undefined,
44
-
45
- // A path to a custom dependency extractor
46
- // dependencyExtractor: undefined,
47
-
48
- // Make calling deprecated APIs throw helpful error messages
49
- // errorOnDeprecated: false,
50
-
51
- // The default configuration for fake timers
52
- // fakeTimers: {
53
- // "enableGlobally": false
54
- // },
55
-
56
- // Force coverage collection from ignored files using an array of glob patterns
57
- // forceCoverageMatch: [],
58
-
59
- // A path to a module which exports an async function that is triggered once before all test suites
60
- // globalSetup: undefined,
61
-
62
- // A path to a module which exports an async function that is triggered once after all test suites
63
- // globalTeardown: undefined,
64
-
65
- // A set of global variables that need to be available in all test environments
66
- // globals: {},
67
-
68
- // The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
69
- // maxWorkers: "50%",
70
-
71
- // An array of directory names to be searched recursively up from the requiring module's location
72
- moduleDirectories: ["node_modules"],
73
-
74
- // An array of file extensions your modules use
75
- // moduleFileExtensions: [
76
- // "js",
77
- // "mjs",
78
- // "cjs",
79
- // "jsx",
80
- // "ts",
81
- // "tsx",
82
- // "json",
83
- // "node"
84
- // ],
85
-
86
- // A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
87
- moduleNameMapper: {
88
- "source-map-support/register": "identity-obj-proxy",
89
- "^uuid$": "uuid",
90
- },
91
-
92
- // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
93
- // modulePathIgnorePatterns: [],
94
-
95
- // Activates notifications for test results
96
- // notify: false,
97
-
98
- // An enum that specifies notification mode. Requires { notify: true }
99
- // notifyMode: "failure-change",
100
-
101
- // A preset that is used as a base for Jest's configuration
102
- preset: "ts-jest",
103
-
104
- // Run tests from one or more projects
105
- // projects: undefined,
106
-
107
- // Use this configuration option to add custom reporters to Jest
108
- // reporters: undefined,
109
-
110
- // Automatically reset mock state before every test
111
- resetMocks: true,
112
-
113
- // Reset the module registry before running each individual test
114
- resetModules: true,
115
-
116
- // A path to a custom resolver
117
- // resolver: undefined,
118
-
119
- // Automatically restore mock state and implementation before every test
120
- // restoreMocks: false,
121
-
122
- // The root directory that Jest should scan for tests and modules within
123
- // rootDir: undefined,
124
-
125
- // A list of paths to directories that Jest should use to search for files in
126
- // roots: [
127
- // "<rootDir>"
128
- // ],
129
-
130
- // Allows you to use a custom runner instead of Jest's default test runner
131
- // runner: "jest-runner",
132
-
133
- // The paths to modules that run some code to configure or set up the testing environment before each test
134
- // setupFiles: [],
135
-
136
- // A list of paths to modules that run some code to configure or set up the testing framework before each test
137
- // setupFilesAfterEnv: [],
138
-
139
- // The number of seconds after which a test is considered as slow and reported as such in the results.
140
- // slowTestThreshold: 5,
141
-
142
- // A list of paths to snapshot serializer modules Jest should use for snapshot testing
143
- // snapshotSerializers: [],
144
-
145
- // The test environment that will be used for testing
146
- testEnvironment: "@happy-dom/jest-environment",
147
-
148
- // Options that will be passed to the testEnvironment
149
- testEnvironmentOptions: {
150
- resources: "usable",
151
- },
152
-
153
- // Adds a location field to test results
154
- // testLocationInResults: false,
155
-
156
- // The glob patterns Jest uses to detect test files
157
- testMatch: [
158
- "**/*.steps.[tj]s",
159
- "**/__tests__/**/*.[jt]s?(x)",
160
- "**/?(*.)+(spec|test).[tj]s?(x)",
161
- ],
162
-
163
- // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
164
- // testPathIgnorePatterns: [
165
- // "/node_modules/"
166
- // ],
167
-
168
- // The regexp pattern or array of patterns that Jest uses to detect test files
169
- // testRegex: [],
170
-
171
- // This option allows the use of a custom results processor
172
- // testResultsProcessor: undefined,
173
-
174
- // This option allows use of a custom test runner
175
- // testRunner: "jest-circus/runner",
176
-
177
- // A map from regular expressions to paths to transformers
178
- transform: {
179
- "^.+\\.(ts|tsx)?$": "ts-jest",
180
- "^.+\\.(js|jsx)$": "babel-jest",
181
- },
182
-
183
- // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
184
- transformIgnorePatterns: [
185
- "node_modules/(?!(@open-wc|lit|jest-cucumber|lit-html|@lit|lit-element)/)",
186
- "\\.pnp\\.[^\\/]+$",
187
- ],
188
-
189
- // An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
190
- // unmockedModulePathPatterns: undefined,
191
-
192
- // Indicates whether each individual test should be reported during the run
193
- // verbose: undefined,
194
-
195
- // An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
196
- // watchPathIgnorePatterns: [],
197
-
198
- // Whether to use watchman for file crawling
199
- // watchman: true,
200
- };
1
+ /*
2
+ * For a detailed explanation regarding each configuration property and type check, visit:
3
+ * https://jestjs.io/docs/configuration
4
+ */
5
+
6
+ export default {
7
+ // All imported modules in your tests should be mocked automatically
8
+ // automock: false,
9
+
10
+ // Stop running tests after `n` failures
11
+ // bail: 0,
12
+
13
+ // The directory where Jest should store its cached dependency information
14
+ // cacheDirectory: "/private/var/folders/zv/t83jrkg12jx3bqgq3vx_v29h0000gp/T/jest_dy",
15
+
16
+ // Automatically clear mock calls, instances, contexts and results before every test
17
+ // clearMocks: false,
18
+
19
+ // Indicates whether the coverage information should be collected while executing the test
20
+ // collectCoverage: false,
21
+
22
+ // An array of glob patterns indicating a set of files for which coverage information should be collected
23
+ // collectCoverageFrom: undefined,
24
+
25
+ // The directory where Jest should output its coverage files
26
+ // coverageDirectory: "coverage",
27
+
28
+ // An array of regexp pattern strings used to skip coverage collection
29
+ coveragePathIgnorePatterns: ["/node_modules/", "/test/"],
30
+
31
+ // Indicates which provider should be used to instrument code for coverage
32
+ // coverageProvider: "babel",
33
+
34
+ // A list of reporter names that Jest uses when writing coverage reports
35
+ // coverageReporters: [
36
+ // "json",
37
+ // "text",
38
+ // "lcov",
39
+ // "clover"
40
+ // ],
41
+
42
+ // An object that configures minimum threshold enforcement for coverage results
43
+ // coverageThreshold: undefined,
44
+
45
+ // A path to a custom dependency extractor
46
+ // dependencyExtractor: undefined,
47
+
48
+ // Make calling deprecated APIs throw helpful error messages
49
+ // errorOnDeprecated: false,
50
+
51
+ // The default configuration for fake timers
52
+ // fakeTimers: {
53
+ // "enableGlobally": false
54
+ // },
55
+
56
+ // Force coverage collection from ignored files using an array of glob patterns
57
+ // forceCoverageMatch: [],
58
+
59
+ // A path to a module which exports an async function that is triggered once before all test suites
60
+ // globalSetup: undefined,
61
+
62
+ // A path to a module which exports an async function that is triggered once after all test suites
63
+ // globalTeardown: undefined,
64
+
65
+ // A set of global variables that need to be available in all test environments
66
+ // globals: {},
67
+
68
+ // The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
69
+ // maxWorkers: "50%",
70
+
71
+ // An array of directory names to be searched recursively up from the requiring module's location
72
+ moduleDirectories: ["node_modules"],
73
+
74
+ // An array of file extensions your modules use
75
+ // moduleFileExtensions: [
76
+ // "js",
77
+ // "mjs",
78
+ // "cjs",
79
+ // "jsx",
80
+ // "ts",
81
+ // "tsx",
82
+ // "json",
83
+ // "node"
84
+ // ],
85
+
86
+ // A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
87
+ moduleNameMapper: {
88
+ "source-map-support/register": "identity-obj-proxy",
89
+ "^uuid$": "uuid",
90
+ },
91
+
92
+ // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
93
+ // modulePathIgnorePatterns: [],
94
+
95
+ // Activates notifications for test results
96
+ // notify: false,
97
+
98
+ // An enum that specifies notification mode. Requires { notify: true }
99
+ // notifyMode: "failure-change",
100
+
101
+ // A preset that is used as a base for Jest's configuration
102
+ preset: "ts-jest",
103
+
104
+ // Run tests from one or more projects
105
+ // projects: undefined,
106
+
107
+ // Use this configuration option to add custom reporters to Jest
108
+ // reporters: undefined,
109
+
110
+ // Automatically reset mock state before every test
111
+ resetMocks: true,
112
+
113
+ // Reset the module registry before running each individual test
114
+ resetModules: true,
115
+
116
+ // A path to a custom resolver
117
+ // resolver: undefined,
118
+
119
+ // Automatically restore mock state and implementation before every test
120
+ // restoreMocks: false,
121
+
122
+ // The root directory that Jest should scan for tests and modules within
123
+ // rootDir: undefined,
124
+
125
+ // A list of paths to directories that Jest should use to search for files in
126
+ // roots: [
127
+ // "<rootDir>"
128
+ // ],
129
+
130
+ // Allows you to use a custom runner instead of Jest's default test runner
131
+ // runner: "jest-runner",
132
+
133
+ // The paths to modules that run some code to configure or set up the testing environment before each test
134
+ // setupFiles: [],
135
+
136
+ // A list of paths to modules that run some code to configure or set up the testing framework before each test
137
+ // setupFilesAfterEnv: [],
138
+
139
+ // The number of seconds after which a test is considered as slow and reported as such in the results.
140
+ // slowTestThreshold: 5,
141
+
142
+ // A list of paths to snapshot serializer modules Jest should use for snapshot testing
143
+ // snapshotSerializers: [],
144
+
145
+ // The test environment that will be used for testing
146
+ testEnvironment: "@happy-dom/jest-environment",
147
+
148
+ // Options that will be passed to the testEnvironment
149
+ testEnvironmentOptions: {
150
+ resources: "usable",
151
+ },
152
+
153
+ // Adds a location field to test results
154
+ // testLocationInResults: false,
155
+
156
+ // The glob patterns Jest uses to detect test files
157
+ testMatch: [
158
+ "**/*.steps.[tj]s",
159
+ "**/__tests__/**/*.[jt]s?(x)",
160
+ "**/?(*.)+(spec|test).[tj]s?(x)",
161
+ ],
162
+
163
+ // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
164
+ // testPathIgnorePatterns: [
165
+ // "/node_modules/"
166
+ // ],
167
+
168
+ // The regexp pattern or array of patterns that Jest uses to detect test files
169
+ // testRegex: [],
170
+
171
+ // This option allows the use of a custom results processor
172
+ // testResultsProcessor: undefined,
173
+
174
+ // This option allows use of a custom test runner
175
+ // testRunner: "jest-circus/runner",
176
+
177
+ // A map from regular expressions to paths to transformers
178
+ transform: {
179
+ "^.+\\.(ts|tsx)?$": "ts-jest",
180
+ "^.+\\.(js|jsx)$": "babel-jest",
181
+ },
182
+
183
+ // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
184
+ transformIgnorePatterns: [
185
+ "node_modules/(?!(@open-wc|lit|jest-cucumber|lit-html|@lit|lit-element)/)",
186
+ "\\.pnp\\.[^\\/]+$",
187
+ ],
188
+
189
+ // An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
190
+ // unmockedModulePathPatterns: undefined,
191
+
192
+ // Indicates whether each individual test should be reported during the run
193
+ // verbose: undefined,
194
+
195
+ // An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
196
+ // watchPathIgnorePatterns: [],
197
+
198
+ // Whether to use watchman for file crawling
199
+ // watchman: true,
200
+ };