@opentripplanner/core-utils 12.0.0-alpha.8 → 12.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.
Files changed (74) hide show
  1. package/esm/__tests__/__mocks__/bike-rental-itinerary.json +863 -0
  2. package/esm/__tests__/__mocks__/config.json +54 -0
  3. package/esm/__tests__/__mocks__/fare-products-itinerary.json +1299 -0
  4. package/esm/__tests__/__mocks__/routes.json +107 -0
  5. package/esm/__tests__/__mocks__/tnc-itinerary.json +1726 -0
  6. package/esm/bike-rental-itinerary.json +863 -0
  7. package/esm/config.json +54 -0
  8. package/esm/fare-products-itinerary.json +1299 -0
  9. package/esm/index.js +2 -0
  10. package/esm/index.js.map +1 -1
  11. package/esm/itinerary.js +46 -21
  12. package/esm/itinerary.js.map +1 -1
  13. package/esm/otpSchema.json +13373 -0
  14. package/esm/planQuery.graphql +281 -0
  15. package/esm/profile.js +1 -1
  16. package/esm/profile.js.map +1 -1
  17. package/esm/query-gen.js +8 -5
  18. package/esm/query-gen.js.map +1 -1
  19. package/esm/query.js +1 -5
  20. package/esm/query.js.map +1 -1
  21. package/esm/routes.json +107 -0
  22. package/esm/storage.js +2 -6
  23. package/esm/storage.js.map +1 -1
  24. package/esm/suspense.js +13 -0
  25. package/esm/suspense.js.map +1 -0
  26. package/esm/tnc-itinerary.json +1726 -0
  27. package/lib/__tests__/__mocks__/bike-rental-itinerary.json +863 -0
  28. package/lib/__tests__/__mocks__/config.json +54 -0
  29. package/lib/__tests__/__mocks__/fare-products-itinerary.json +1299 -0
  30. package/lib/__tests__/__mocks__/routes.json +107 -0
  31. package/lib/__tests__/__mocks__/tnc-itinerary.json +1726 -0
  32. package/lib/index.d.ts +2 -0
  33. package/lib/index.d.ts.map +1 -1
  34. package/lib/index.js +10 -0
  35. package/lib/index.js.map +1 -1
  36. package/lib/itinerary.d.ts +13 -4
  37. package/lib/itinerary.d.ts.map +1 -1
  38. package/lib/itinerary.js +59 -22
  39. package/lib/itinerary.js.map +1 -1
  40. package/lib/otpSchema.json +13373 -0
  41. package/lib/planQuery.graphql +281 -0
  42. package/lib/profile.js +1 -1
  43. package/lib/profile.js.map +1 -1
  44. package/lib/query-gen.d.ts +3 -1
  45. package/lib/query-gen.d.ts.map +1 -1
  46. package/lib/query-gen.js +8 -5
  47. package/lib/query-gen.js.map +1 -1
  48. package/lib/query.js +1 -5
  49. package/lib/query.js.map +1 -1
  50. package/lib/storage.d.ts.map +1 -1
  51. package/lib/storage.js +2 -6
  52. package/lib/storage.js.map +1 -1
  53. package/lib/suspense.d.ts +8 -0
  54. package/lib/suspense.d.ts.map +1 -0
  55. package/lib/suspense.js +26 -0
  56. package/lib/suspense.js.map +1 -0
  57. package/package.json +3 -3
  58. package/src/__tests__/itinerary.ts +36 -1
  59. package/src/core-utils.story.tsx +1 -1
  60. package/src/index.ts +2 -0
  61. package/src/itinerary.ts +68 -26
  62. package/src/otpSchema.json +0 -12
  63. package/src/planQuery.graphql +27 -0
  64. package/src/profile.js +1 -1
  65. package/src/query-gen.ts +8 -4
  66. package/src/query.js +1 -4
  67. package/src/storage.ts +5 -9
  68. package/src/suspense.tsx +19 -0
  69. package/tsconfig.json +1 -2
  70. package/tsconfig.tsbuildinfo +1 -1
  71. package/lib/core-utils.story.d.ts +0 -22
  72. package/lib/core-utils.story.d.ts.map +0 -1
  73. package/lib/core-utils.story.js +0 -69
  74. package/lib/core-utils.story.js.map +0 -1
@@ -1,69 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.RouteColorTester = void 0;
30
- const react_1 = __importStar(require("react"));
31
- const styled_components_1 = __importDefault(require("styled-components"));
32
- const route_1 = require("./route");
33
- exports.default = {
34
- title: "core-utils"
35
- };
36
- const ColorBlock = styled_components_1.default.div `
37
- background: ${props => props.bg};
38
- color: ${props => props.fg};
39
- padding: 10px;
40
- `;
41
- const ColorBlockWrapper = styled_components_1.default.div `
42
- display: flex;
43
- flex-direction: row;
44
- gap: 10px;
45
- `;
46
- const ColorPair = ({ fg, bg }) => {
47
- return (react_1.default.createElement(ColorBlockWrapper, null,
48
- react_1.default.createElement(ColorBlock, { fg: fg, bg: bg }, "Provided color pair"),
49
- react_1.default.createElement(ColorBlock, { fg: (0, route_1.getMostReadableTextColor)(bg, fg), bg: bg }, "Corrected color pair")));
50
- };
51
- const RouteColorTester = () => {
52
- const [fg, setFg] = (0, react_1.useState)("#333333");
53
- const [bg, setBg] = (0, react_1.useState)("#cbeb55");
54
- return (react_1.default.createElement(react_1.default.Fragment, null,
55
- react_1.default.createElement(ColorPair, { bg: bg, fg: fg }),
56
- react_1.default.createElement("label", null,
57
- "Foreground Color",
58
- react_1.default.createElement("input", { onChange: e => setFg(e.target.value), type: "color", value: fg })),
59
- react_1.default.createElement("label", null,
60
- "Background Color",
61
- react_1.default.createElement("input", { onChange: e => setBg(e.target.value), type: "color", value: bg }))));
62
- };
63
- exports.RouteColorTester = RouteColorTester;
64
- // Disable color contrast checking for the uncorrected color pairs.
65
- exports.RouteColorTester.parameters = {
66
- a11y: { config: { rules: [{ id: "color-contrast", reviewOnFail: true }] } },
67
- storyshots: { disable: true }
68
- };
69
- //# sourceMappingURL=core-utils.story.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"core-utils.story.js","sourceRoot":"","sources":["../src/core-utils.story.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAwC;AACxC,0EAAuC;AACvC,mCAAmD;AAEnD,kBAAe;IACb,KAAK,EAAE,YAAY;CACpB,CAAC;AAEF,MAAM,UAAU,GAAG,2BAAM,CAAC,GAAG,CAA4B;gBACzC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE;WACtB,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE;;CAE3B,CAAC;AAEF,MAAM,iBAAiB,GAAG,2BAAM,CAAC,GAAG,CAAA;;;;CAInC,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,EAA8B,EAAE,EAAE;IAC3D,OAAO,CACL,8BAAC,iBAAiB;QAChB,8BAAC,UAAU,IAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,0BAEb;QACb,8BAAC,UAAU,IAAC,EAAE,EAAE,IAAA,gCAAwB,EAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,2BAE3C,CACK,CACrB,CAAC;AACJ,CAAC,CAAC;AAEK,MAAM,gBAAgB,GAAG,GAAgB,EAAE;IAChD,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,GAAG,IAAA,gBAAQ,EAAC,SAAS,CAAC,CAAC;IACxC,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,GAAG,IAAA,gBAAQ,EAAC,SAAS,CAAC,CAAC;IACxC,OAAO,CACL;QACE,8BAAC,SAA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