@servicetitan/web-components 22.21.1 → 23.0.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.
@@ -14,14 +14,9 @@ export function getMFESupportsRerendering(bundledWith, dependencies) {
14
14
  return !!((_b = (_a = isSupportedVersion(bundledWith === null || bundledWith === void 0 ? void 0 : bundledWith['@servicetitan/web-components'])) !== null && _a !== void 0 ? _a : isSupportedVersion(dependencies === null || dependencies === void 0 ? void 0 : dependencies['@servicetitan/web-components'])) !== null && _b !== void 0 ? _b : isSupportedVersion(bundledWith === null || bundledWith === void 0 ? void 0 : bundledWith['@servicetitan/startup']));
15
15
  }
16
16
  function isSupportedVersion(version) {
17
- try {
18
- const minVersion = version && semver.minVersion(version);
19
- if (minVersion) {
20
- return semver.gte(minVersion, '22.12.0');
21
- }
22
- }
23
- catch (e) {
24
- return undefined;
17
+ const minVersion = version && semver.minVersion(version);
18
+ if (minVersion) {
19
+ return semver.gte(minVersion, '22.12.0');
25
20
  }
26
21
  }
27
22
  //# sourceMappingURL=get-mfe-supports-rerendering.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-mfe-supports-rerendering.js","sourceRoot":"","sources":["../src/get-mfe-supports-rerendering.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAG5B;;;;;;;;;GASG;AACH,MAAM,UAAU,yBAAyB,CACrC,WAAoC,EACpC,YAAsC;;IAEtC,OAAO,CAAC,CAAC,CACL,MAAA,MAAA,kBAAkB,CAAC,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAG,8BAA8B,CAAC,CAAC,mCACjE,kBAAkB,CAAC,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAG,8BAA8B,CAAC,CAAC,mCAClE,kBAAkB,CAAC,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAG,uBAAuB,CAAC,CAAC,CAC7D,CAAC;AACN,CAAC;AAED,SAAS,kBAAkB,CAAC,OAAgB;IACxC,IAAI;QACA,MAAM,UAAU,GAAG,OAAO,IAAI,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACzD,IAAI,UAAU,EAAE;YACZ,OAAO,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;SAC5C;KACJ;IAAC,OAAO,CAAC,EAAE;QACR,OAAO,SAAS,CAAC;KACpB;AACL,CAAC"}
1
+ {"version":3,"file":"get-mfe-supports-rerendering.js","sourceRoot":"","sources":["../src/get-mfe-supports-rerendering.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAG5B;;;;;;;;;GASG;AACH,MAAM,UAAU,yBAAyB,CACrC,WAAoC,EACpC,YAAsC;;IAEtC,OAAO,CAAC,CAAC,CACL,MAAA,MAAA,kBAAkB,CAAC,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAG,8BAA8B,CAAC,CAAC,mCACjE,kBAAkB,CAAC,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAG,8BAA8B,CAAC,CAAC,mCAClE,kBAAkB,CAAC,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAG,uBAAuB,CAAC,CAAC,CAC7D,CAAC;AACN,CAAC;AAED,SAAS,kBAAkB,CAAC,OAAgB;IACxC,MAAM,UAAU,GAAG,OAAO,IAAI,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACzD,IAAI,UAAU,EAAE;QACZ,OAAO,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;KAC5C;AACL,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicetitan/web-components",
3
- "version": "22.21.1",
3
+ "version": "23.0.0",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
@@ -15,17 +15,17 @@
15
15
  "src"
16
16
  ],
17
17
  "dependencies": {
18
- "@servicetitan/error-boundary": "22.21.0",
18
+ "@servicetitan/error-boundary": "23.0.0",
19
19
  "lodash.get": "~4.4.2",
20
20
  "mitt": "~3.0.1",
21
21
  "semver": "~7.5.4"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@servicetitan/design-system": "~12.6.2",
25
- "@servicetitan/log-service": "22.21.0",
26
- "@servicetitan/react-ioc": "22.21.0",
25
+ "@servicetitan/log-service": "23.0.0",
26
+ "@servicetitan/react-ioc": "23.0.0",
27
27
  "@testing-library/dom": "^8.20.1",
28
- "@testing-library/jest-dom": "^6.3.0",
28
+ "@testing-library/jest-dom": "^6.4.2",
29
29
  "@testing-library/react": "^12.1.5",
30
30
  "@testing-library/react-hooks": "^8.0.1",
31
31
  "@types/history": "~4.7.10",
@@ -40,8 +40,8 @@
40
40
  },
41
41
  "peerDependencies": {
42
42
  "@servicetitan/design-system": "~12.6.2",
43
- "@servicetitan/log-service": "22.21.0",
44
- "@servicetitan/react-ioc": "22.21.0",
43
+ "@servicetitan/log-service": "23.0.0",
44
+ "@servicetitan/react-ioc": "23.0.0",
45
45
  "history": "~4.10.1",
46
46
  "react": "~17.0.2",
47
47
  "react-dom": "~17.0.2"
@@ -51,5 +51,6 @@
51
51
  },
52
52
  "cli": {
53
53
  "webpack": false
54
- }
54
+ },
55
+ "gitHead": "45876ed36415ad78d3ec4ef3783d6df1430504d3"
55
56
  }
@@ -265,7 +265,7 @@ describe('[web-components] common', () => {
265
265
  await flushMicrotasks();
266
266
  abortController.abort();
267
267
 
268
- await expect(result).rejects.toBeUndefined();
268
+ await expect(result).rejects.toThrowError(/The operation was aborted/);
269
269
 
270
270
  await flushMicrotasksAndRunAllTimersTimes(getJsonOptions.retries!);
271
271
 
@@ -276,7 +276,7 @@ describe('[web-components] common', () => {
276
276
  const result = subject();
277
277
  await flushMicrotasksAndRunAllTimersTimes(1);
278
278
  abortController.abort();
279
- await expect(result).rejects.toBeUndefined();
279
+ await expect(result).rejects.toThrowError(/The operation was aborted/);
280
280
  await flushMicrotasksAndRunAllTimersTimes(getJsonOptions.retries!);
281
281
  expect(spyFetch).toHaveBeenCalledTimes(2);
282
282
  });
@@ -1,6 +1,8 @@
1
1
  import { FC, useContext } from 'react';
2
2
  import { TablePopupPropsContext } from '@servicetitan/design-system';
3
3
  import { render } from '@testing-library/react';
4
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
5
+ // @ts-ignore because Jest mistakenly complains that "'shadow-dom-testing-library' cannot be imported using this construct".
4
6
  import { screen } from 'shadow-dom-testing-library';
5
7
  import '@testing-library/jest-dom';
6
8
 
@@ -1,2 +0,0 @@
1
- export declare const handlers: never[];
2
- //# sourceMappingURL=handlers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../src/__mocks__/handlers.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,SAAK,CAAC"}
@@ -1,2 +0,0 @@
1
- export const handlers = [];
2
- //# sourceMappingURL=handlers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"handlers.js","sourceRoot":"","sources":["../../src/__mocks__/handlers.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG,EAAE,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const server: import("msw/lib/glossary-de6278a9").K;
2
- //# sourceMappingURL=server.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/__mocks__/server.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM,uCAA2B,CAAC"}
@@ -1,4 +0,0 @@
1
- import { setupServer } from 'msw/node';
2
- import { handlers } from './handlers';
3
- export const server = setupServer(...handlers);
4
- //# sourceMappingURL=server.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/__mocks__/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,CAAC,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,QAAQ,CAAC,CAAC"}
@@ -1,22 +0,0 @@
1
- /**
2
- * Context used to pass data from the host to the MFEs
3
- */
4
- /// <reference types="react" />
5
- declare type JSONPrimitive = string | number | boolean | null | undefined;
6
- declare type JSON = {
7
- [key: string]: JSONPrimitive | JSON[] | JSON;
8
- };
9
- export declare type MFEContextData<T> = {
10
- [P in keyof T]: T[P] extends JSONPrimitive ? T[P] : T[P] extends (infer U)[] ? MFEContextData<U>[] : T[P] extends JSON ? MFEContextData<T[P]> : never;
11
- };
12
- export interface MFEMetadata {
13
- shadowRoot: ShadowRoot;
14
- portalShadowRoot: ShadowRoot;
15
- }
16
- export declare type MFEProps<T = {}> = {
17
- metadata: MFEMetadata;
18
- } & T;
19
- export declare const MFEDataContext: import("react").Context<JSON>;
20
- export declare function useMFEDataContext<T extends MFEContextData<T>>(): MFEProps<T>;
21
- export {};
22
- //# sourceMappingURL=mfe-data-context.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mfe-data-context.d.ts","sourceRoot":"","sources":["../src/mfe-data-context.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAIH,aAAK,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;AAGlE,aAAK,IAAI,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,EAAE,GAAG,IAAI,CAAA;CAAE,CAAC;AAG7D,oBAAY,cAAc,CAAC,CAAC,IAAI;KAC3B,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,aAAa,GACpC,CAAC,CAAC,CAAC,CAAC,GACJ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GACxB,cAAc,CAAC,CAAC,CAAC,EAAE,GACnB,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,GACjB,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GACpB,KAAK;CACd,CAAC;AAEF,MAAM,WAAW,WAAW;IACxB,UAAU,EAAE,UAAU,CAAC;IACvB,gBAAgB,EAAE,UAAU,CAAC;CAChC;AAED,oBAAY,QAAQ,CAAC,CAAC,GAAG,EAAE,IAAI;IAC3B,QAAQ,EAAE,WAAW,CAAC;CACzB,GAAG,CAAC,CAAC;AAEN,eAAO,MAAM,cAAc,+BAA0B,CAAC;AAEtD,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,cAAc,CAAC,CAAC,CAAC,iBAI5D"}
@@ -1,10 +0,0 @@
1
- /**
2
- * Context used to pass data from the host to the MFEs
3
- */
4
- import { createContext, useContext } from 'react';
5
- export const MFEDataContext = createContext({});
6
- export function useMFEDataContext() {
7
- const context = useContext(MFEDataContext);
8
- return context;
9
- }
10
- //# sourceMappingURL=mfe-data-context.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mfe-data-context.js","sourceRoot":"","sources":["../src/mfe-data-context.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AA2BlD,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAO,EAAE,CAAC,CAAC;AAEtD,MAAM,UAAU,iBAAiB;IAC7B,MAAM,OAAO,GAAG,UAAU,CAAC,cAAc,CAAgB,CAAC;IAE1D,OAAO,OAAO,CAAC;AACnB,CAAC"}