@rebilly/framepay-react 2.0.1 → 2.1.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 (79) hide show
  1. package/.env.example +2 -0
  2. package/CHANGELOG.md +7 -0
  3. package/env.js +7 -0
  4. package/package.json +10 -2
  5. package/src/index.spec.ts +19 -0
  6. package/src/index.ts +42 -0
  7. package/src/lib/components/elements/applepay-element.tsx +36 -0
  8. package/src/lib/components/elements/bank-element.spec.tsx +119 -0
  9. package/src/lib/components/elements/bank-element.tsx +74 -0
  10. package/src/lib/components/elements/base-element.tsx +100 -0
  11. package/src/lib/components/elements/card-element.spec.tsx +113 -0
  12. package/src/lib/components/elements/card-element.tsx +73 -0
  13. package/src/lib/components/elements/googlepay-element.tsx +36 -0
  14. package/src/lib/components/elements/iban-element.spec.tsx +104 -0
  15. package/src/lib/components/elements/iban-element.tsx +75 -0
  16. package/src/lib/components/elements/paypal-element.tsx +36 -0
  17. package/src/lib/components/injector.spec.tsx +162 -0
  18. package/src/lib/components/injector.tsx +495 -0
  19. package/src/lib/components/provider.spec.tsx +98 -0
  20. package/src/lib/components/provider.tsx +111 -0
  21. package/src/lib/constants.ts +43 -0
  22. package/src/lib/context.ts +24 -0
  23. package/src/lib/dom-util.ts +35 -0
  24. package/src/lib/framepay-error.ts +59 -0
  25. package/src/lib/get-rebilly-api.ts +11 -0
  26. package/test/e2e/assets/prop-types.js +849 -0
  27. package/test/e2e/assets/react-0.14.0.js +18759 -0
  28. package/test/e2e/assets/react-15.0.0.js +19309 -0
  29. package/test/e2e/assets/react-16.js +3318 -0
  30. package/test/e2e/assets/react-17.js +3357 -0
  31. package/test/e2e/assets/react-18.js +3342 -0
  32. package/test/e2e/assets/react-dom-0.14.0.js +42 -0
  33. package/test/e2e/assets/react-dom-15.0.0.js +42 -0
  34. package/test/e2e/assets/react-dom-16.js +25147 -0
  35. package/test/e2e/assets/react-dom-17.js +26292 -0
  36. package/test/e2e/assets/react-dom-18.js +29869 -0
  37. package/test/e2e/cypress-support.js +2 -0
  38. package/test/e2e/cypress.d.ts +1 -0
  39. package/test/e2e/fixtures/apple-pay.html +15 -0
  40. package/test/e2e/fixtures/apple-pay.js +63 -0
  41. package/test/e2e/fixtures/bank-separate.html +12 -0
  42. package/test/e2e/fixtures/bank-separate.js +323 -0
  43. package/test/e2e/fixtures/card-separate-brands.html +12 -0
  44. package/test/e2e/fixtures/card-separate-brands.js +260 -0
  45. package/test/e2e/fixtures/card-separate-rebilly-fields.html +12 -0
  46. package/test/e2e/fixtures/card-separate-rebilly-fields.js +281 -0
  47. package/test/e2e/fixtures/card-separate.html +12 -0
  48. package/test/e2e/fixtures/card-separate.js +227 -0
  49. package/test/e2e/fixtures/checkout-combined.html +12 -0
  50. package/test/e2e/fixtures/checkout-combined.js +199 -0
  51. package/test/e2e/fixtures/google-pay.html +15 -0
  52. package/test/e2e/fixtures/google-pay.js +63 -0
  53. package/test/e2e/fixtures/iban.html +12 -0
  54. package/test/e2e/fixtures/iban.js +239 -0
  55. package/test/e2e/fixtures/multiple-methods.html +12 -0
  56. package/test/e2e/fixtures/multiple-methods.js +470 -0
  57. package/test/e2e/fixtures/nav.js +20 -0
  58. package/test/e2e/fixtures/paypal.html +15 -0
  59. package/test/e2e/fixtures/paypal.js +62 -0
  60. package/test/e2e/fixtures/style.css +55 -0
  61. package/test/e2e/fixtures/util.js +71 -0
  62. package/test/e2e/local-server.mjs +12 -0
  63. package/test/e2e/server.mjs +43 -0
  64. package/test/e2e/specs/bank-separate.cy.ts +27 -0
  65. package/test/e2e/specs/card-separate-brands.cy.ts +70 -0
  66. package/test/e2e/specs/card-separate.cy.ts +27 -0
  67. package/test/e2e/specs/checkout-combined.cy.ts +24 -0
  68. package/test/e2e/specs/google-pay.cy.ts +13 -0
  69. package/test/e2e/specs/iban.cy.ts +17 -0
  70. package/test/e2e/specs/multiple-methods.cy.ts +130 -0
  71. package/test/e2e/specs/paypal.cy.ts +13 -0
  72. package/test/e2e/specs/react-version.cy.ts +12 -0
  73. package/test/e2e/switch-react-version.js +42 -0
  74. package/test/e2e/tsconfig.json +8 -0
  75. package/test/unit/jest.config.js +29 -0
  76. package/test/unit/specs/declaration-mock.spec.tsx +143 -0
  77. package/tsconfig.json +31 -0
  78. package/tsconfig.spec.json +13 -0
  79. package/tslint.json +36 -0
package/tslint.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "extends": ["tslint:latest", "tslint-config-prettier", "tslint-immutable"],
3
+ "rules": {
4
+ "no-submodule-imports": [false],
5
+ "interface-name": [true, "never-prefix"],
6
+ // TODO: allow devDependencies only in **/*.spec.ts files:
7
+ // waiting on https://github.com/palantir/tslint/pull/3708
8
+ "no-implicit-dependencies": [false, "dev"],
9
+ "member-access": [true, "no-public"],
10
+ /* tslint-immutable rules */
11
+ // Recommended built-in rules
12
+ "no-var-keyword": true,
13
+ "no-parameter-reassignment": true,
14
+ "typedef": [true],
15
+ // Immutability rules
16
+ "readonly-keyword": true,
17
+ "readonly-array": true,
18
+ "no-let": true,
19
+ "no-object-mutation": false,
20
+ "no-delete": true,
21
+ "no-method-signature": true,
22
+ "no-object-literal-type-assertion": false,
23
+ // Functional style rules
24
+ "no-this": false,
25
+ "no-class": false,
26
+ "no-mixed-interface": false,
27
+ "no-expression-statement": [
28
+ false,
29
+ {
30
+ "ignore-prefix": ["console.", "process.exit"]
31
+ }
32
+ ],
33
+ "no-if-statement": false
34
+ /* end tslint-immutable rules */
35
+ }
36
+ }