fontdue-js 2.3.0 → 2.4.1

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 (59) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/__generated__/CartOrderCompleteOrderMutation.graphql.d.ts +1 -1
  3. package/dist/__generated__/CartOrderCompleteOrderMutation.graphql.js +9 -3
  4. package/dist/__generated__/CartOrderRemoveDiscountMutation.graphql.d.ts +1 -1
  5. package/dist/__generated__/CartOrderRemoveDiscountMutation.graphql.js +9 -3
  6. package/dist/__generated__/CartOrderUpdateMutation.graphql.d.ts +1 -1
  7. package/dist/__generated__/CartOrderUpdateMutation.graphql.js +9 -3
  8. package/dist/__generated__/CartQuery.graphql.d.ts +1 -1
  9. package/dist/__generated__/CartQuery.graphql.js +9 -3
  10. package/dist/__generated__/CartStateRemoveDiscountMutation.graphql.d.ts +1 -1
  11. package/dist/__generated__/CartStateRemoveDiscountMutation.graphql.js +9 -3
  12. package/dist/__generated__/CartStateUpdateMutation.graphql.d.ts +1 -1
  13. package/dist/__generated__/CartStateUpdateMutation.graphql.js +9 -3
  14. package/dist/__generated__/CartTotals_order.graphql.d.ts +2 -1
  15. package/dist/__generated__/CartTotals_order.graphql.js +8 -2
  16. package/dist/__generated__/CheckoutUpdateCustomerMutation.graphql.d.ts +1 -1
  17. package/dist/__generated__/CheckoutUpdateCustomerMutation.graphql.js +9 -3
  18. package/dist/__generated__/CheckoutUpdateOrderMutation.graphql.d.ts +1 -1
  19. package/dist/__generated__/CheckoutUpdateOrderMutation.graphql.js +9 -3
  20. package/dist/__generated__/CouponCodeInputApplyCouponMutation.graphql.d.ts +1 -1
  21. package/dist/__generated__/CouponCodeInputApplyCouponMutation.graphql.js +9 -3
  22. package/dist/__generated__/FamilyList_node.graphql.d.ts +8 -1
  23. package/dist/__generated__/FamilyList_node.graphql.js +32 -2
  24. package/dist/__generated__/Family_node.graphql.d.ts +10 -1
  25. package/dist/__generated__/Family_node.graphql.js +46 -10
  26. package/dist/__generated__/FontFamiliesQuery.graphql.d.ts +1 -1
  27. package/dist/__generated__/FontFamiliesQuery.graphql.js +95 -35
  28. package/dist/__generated__/PrecartAddToCartMutation.graphql.d.ts +1 -1
  29. package/dist/__generated__/PrecartAddToCartMutation.graphql.js +9 -3
  30. package/dist/__generated__/StoreModalCartQuery.graphql.d.ts +1 -1
  31. package/dist/__generated__/StoreModalCartQuery.graphql.js +9 -3
  32. package/dist/__generated__/StoreModalReviewCompleteOrderMutation.graphql.d.ts +1 -1
  33. package/dist/__generated__/StoreModalReviewCompleteOrderMutation.graphql.js +9 -3
  34. package/dist/__generated__/StoreModalReviewQuery.graphql.d.ts +1 -1
  35. package/dist/__generated__/StoreModalReviewQuery.graphql.js +9 -3
  36. package/dist/__generated__/StoreModalReviewUpdateOrderMutation.graphql.d.ts +1 -1
  37. package/dist/__generated__/StoreModalReviewUpdateOrderMutation.graphql.js +9 -3
  38. package/dist/__generated__/TestFontsFormUpdateCustomerMutation.graphql.d.ts +1 -1
  39. package/dist/__generated__/TestFontsFormUpdateCustomerMutation.graphql.js +9 -3
  40. package/dist/components/Cart/CartTotals.js +6 -2
  41. package/dist/components/Family/FamilyList.js +27 -7
  42. package/dist/components/Family/index.js +18 -3
  43. package/dist/components/NewsletterSignup/index.d.ts +2 -4
  44. package/dist/components/NewsletterSignup/index.js +4 -3
  45. package/dist/components/NewsletterSignup/index.server.js +2 -2
  46. package/dist/components/Precart/index.js +2 -2
  47. package/dist/components/SKUPrice/index.js +4 -1
  48. package/dist/components/TypeTester/TypeTesterContext.d.ts +3 -1
  49. package/dist/components/TypeTester/TypeTesterContext.js +2 -1
  50. package/dist/components/TypeTester/TypeTesterStandalone.js +5 -3
  51. package/dist/components/TypeTester/TypeTesterState.d.ts +2 -1
  52. package/dist/components/TypeTester/TypeTesterState.js +4 -2
  53. package/dist/components/TypeTester/TypeTesterStyleSelectData.js +3 -2
  54. package/dist/components/TypeTester/index.d.ts +1 -2
  55. package/dist/components/TypeTester/index.js +2 -3
  56. package/dist/components/TypeTester/useTypeTesterStyler.js +2 -1
  57. package/dist/components/TypeTesters/index.js +5 -2
  58. package/dist/fontdue.css +4 -0
  59. package/package.json +1 -1
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  /**
8
- * @generated SignedSource<<4ae4d20c3de5ad062a28acf932a133e4>>
8
+ * @generated SignedSource<<cb165101d637b23cf10877e459550c0b>>
9
9
  * @lightSyntaxTransform
10
10
  * @nogrep
11
11
  */
@@ -219,6 +219,12 @@ const node = function () {
219
219
  "plural": false,
220
220
  "selections": v3 /*: any*/,
221
221
  "storageKey": null
222
+ }, {
223
+ "alias": null,
224
+ "args": null,
225
+ "kind": "ScalarField",
226
+ "name": "taxRate",
227
+ "storageKey": null
222
228
  }, {
223
229
  "alias": null,
224
230
  "args": null,
@@ -431,12 +437,12 @@ const node = function () {
431
437
  }]
432
438
  },
433
439
  "params": {
434
- "cacheID": "e89388a21bf4c2064b75304b79f69e1d",
440
+ "cacheID": "f210f85b9f85456bab527dafecbdfada",
435
441
  "id": null,
436
442
  "metadata": {},
437
443
  "name": "StoreModalReviewUpdateOrderMutation",
438
444
  "operationKind": "mutation",
439
- "text": "mutation StoreModalReviewUpdateOrderMutation(\n $input: UpdateOrderInput!\n) {\n updateOrder(input: $input) {\n order {\n ...StoreModalReview_order\n total {\n amount\n }\n id\n }\n }\n}\n\nfragment CartTotals_order on Order {\n subtotal {\n ...Price_price\n }\n discount {\n amount {\n amount\n ...Price_price\n }\n coupon {\n ...CouponText_coupon\n id\n }\n id\n }\n discountedSubtotal {\n ...Price_price\n }\n total {\n amount\n ...Price_price\n }\n taxes {\n ...Price_price\n }\n taxName\n gstIncluded\n}\n\nfragment CouponText_coupon on Coupon {\n type\n percentAmount\n creditAmountRemaining {\n amount\n currency\n }\n}\n\nfragment Price_price on Money {\n amount\n currency\n}\n\nfragment SKUPrice_sku on Sku {\n id\n price(licenseOptions: []) {\n amount\n ...Price_price\n }\n}\n\nfragment StoreModalDownload_order on Order {\n id\n archiveUrl\n}\n\nfragment StoreModalReviewIdentity_identity on Identity {\n email\n phoneFormatted\n addressFormatted\n vatNumber\n}\n\nfragment StoreModalReview_order on Order {\n ...CartTotals_order\n ...StoreModalDownload_order\n customer {\n email\n name\n id\n }\n billingIdentity {\n name\n email\n phone\n street\n locality\n administrativeArea\n country\n zip\n ...StoreModalReviewIdentity_identity\n }\n licenseeIdentity {\n ...StoreModalReviewIdentity_identity\n }\n licenseeIsBillingIdentity\n stripePaymentMethod {\n card {\n last4\n brandFormatted\n }\n }\n orderItems {\n id\n description\n sku {\n ...SKUPrice_sku\n id\n }\n }\n canCompleteWithCoupon\n completedWithCoupon\n stripePaymentIntent {\n status\n clientSecret\n }\n completeUrl\n total {\n amount\n }\n}\n"
445
+ "text": "mutation StoreModalReviewUpdateOrderMutation(\n $input: UpdateOrderInput!\n) {\n updateOrder(input: $input) {\n order {\n ...StoreModalReview_order\n total {\n amount\n }\n id\n }\n }\n}\n\nfragment CartTotals_order on Order {\n subtotal {\n ...Price_price\n }\n discount {\n amount {\n amount\n ...Price_price\n }\n coupon {\n ...CouponText_coupon\n id\n }\n id\n }\n discountedSubtotal {\n ...Price_price\n }\n total {\n amount\n ...Price_price\n }\n taxRate\n taxes {\n ...Price_price\n }\n taxName\n gstIncluded\n}\n\nfragment CouponText_coupon on Coupon {\n type\n percentAmount\n creditAmountRemaining {\n amount\n currency\n }\n}\n\nfragment Price_price on Money {\n amount\n currency\n}\n\nfragment SKUPrice_sku on Sku {\n id\n price(licenseOptions: []) {\n amount\n ...Price_price\n }\n}\n\nfragment StoreModalDownload_order on Order {\n id\n archiveUrl\n}\n\nfragment StoreModalReviewIdentity_identity on Identity {\n email\n phoneFormatted\n addressFormatted\n vatNumber\n}\n\nfragment StoreModalReview_order on Order {\n ...CartTotals_order\n ...StoreModalDownload_order\n customer {\n email\n name\n id\n }\n billingIdentity {\n name\n email\n phone\n street\n locality\n administrativeArea\n country\n zip\n ...StoreModalReviewIdentity_identity\n }\n licenseeIdentity {\n ...StoreModalReviewIdentity_identity\n }\n licenseeIsBillingIdentity\n stripePaymentMethod {\n card {\n last4\n brandFormatted\n }\n }\n orderItems {\n id\n description\n sku {\n ...SKUPrice_sku\n id\n }\n }\n canCompleteWithCoupon\n completedWithCoupon\n stripePaymentIntent {\n status\n clientSecret\n }\n completeUrl\n total {\n amount\n }\n}\n"
440
446
  }
441
447
  };
442
448
  }();
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @generated SignedSource<<fdb339989c8a655dcec97c0823aaaccc>>
2
+ * @generated SignedSource<<9c69fd3f51210dc8d7be5bd21ae99a8b>>
3
3
  * @lightSyntaxTransform
4
4
  * @nogrep
5
5
  */
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  /**
8
- * @generated SignedSource<<fdb339989c8a655dcec97c0823aaaccc>>
8
+ * @generated SignedSource<<9c69fd3f51210dc8d7be5bd21ae99a8b>>
9
9
  * @lightSyntaxTransform
10
10
  * @nogrep
11
11
  */
@@ -357,6 +357,12 @@ const node = function () {
357
357
  "plural": false,
358
358
  "selections": v7 /*: any*/,
359
359
  "storageKey": null
360
+ }, {
361
+ "alias": null,
362
+ "args": null,
363
+ "kind": "ScalarField",
364
+ "name": "taxRate",
365
+ "storageKey": null
360
366
  }, {
361
367
  "alias": null,
362
368
  "args": null,
@@ -623,12 +629,12 @@ const node = function () {
623
629
  }]
624
630
  },
625
631
  "params": {
626
- "cacheID": "4ad19928609a699ba340b2b2296704a3",
632
+ "cacheID": "6bf352e7a5d417131c2603a62762d554",
627
633
  "id": null,
628
634
  "metadata": {},
629
635
  "name": "TestFontsFormUpdateCustomerMutation",
630
636
  "operationKind": "mutation",
631
- "text": "mutation TestFontsFormUpdateCustomerMutation(\n $input: UpdateCustomerInput!\n) {\n updateCustomer(input: $input) {\n order {\n ...CartOrder_order\n id\n }\n }\n}\n\nfragment CartItem_node on OrderItem {\n id\n price {\n ...Price_price\n }\n sku {\n price {\n ...Price_price\n }\n product {\n __typename\n __isSkuProduct: __typename\n ...CollectionAa_product\n ...FontStyle_fontStyle\n ... on FontStyle {\n family {\n name\n cssUrl\n id\n }\n name\n variableInstances {\n name\n }\n }\n ... on Bundle {\n name\n }\n ... on FontCollection {\n name\n isVariableFont\n totalStyles\n featureStyle {\n family {\n cssUrl\n id\n }\n id\n }\n }\n ... on Node {\n __isNode: __typename\n id\n }\n }\n id\n }\n licenseSelections {\n id\n license {\n id\n name\n multiplier\n }\n variable: licenseVariable {\n id\n variableType\n ...VariableTableAmounts_variable\n }\n option: licenseOption {\n id\n amount\n multiplier\n name\n ...VariableTableAmounts_option\n }\n variableText\n }\n}\n\nfragment CartOrder_order on Order {\n ...Checkout_order\n ...Download_order\n ...CartTotals_order\n orderItems {\n ...CartItem_node\n id\n licenseSelections {\n license {\n id\n }\n licenseVariable {\n id\n variableType\n }\n licenseOption {\n id\n }\n variableText\n id\n }\n }\n discount {\n id\n }\n customer {\n email\n name\n anonymous\n id\n }\n billingIdentity {\n ...IdentityBox_identity\n }\n licenseeIdentity {\n ...IdentityBox_identity\n }\n licenseeIsBillingIdentity\n stripePaymentMethod {\n card {\n last4\n brand\n }\n }\n stripePaymentIntent {\n status\n }\n canCompleteWithCoupon\n completedWithCoupon\n}\n\nfragment CartTotals_order on Order {\n subtotal {\n ...Price_price\n }\n discount {\n amount {\n amount\n ...Price_price\n }\n coupon {\n ...CouponText_coupon\n id\n }\n id\n }\n discountedSubtotal {\n ...Price_price\n }\n total {\n amount\n ...Price_price\n }\n taxes {\n ...Price_price\n }\n taxName\n gstIncluded\n}\n\nfragment Checkout_order on Order {\n canCompleteWithCoupon\n customer {\n name\n email\n newsletterOptIn\n id\n }\n billingIdentity {\n name\n organization\n email\n phone\n street\n locality\n sublocality\n country\n administrativeArea\n zip\n vatNumber\n }\n licenseeIdentity {\n name\n organization\n email\n phone\n street\n locality\n sublocality\n country\n administrativeArea\n zip\n vatNumber\n }\n licenseeIsBillingIdentity\n}\n\nfragment CollectionAa_product on SkuProduct {\n __isSkuProduct: __typename\n __typename\n ... on FontCollection {\n featureStyle {\n ...FontStyle_fontStyle\n id\n }\n }\n ... on Bundle {\n fontStyles {\n ...FontStyle_fontStyle\n id\n }\n }\n}\n\nfragment CouponText_coupon on Coupon {\n type\n percentAmount\n creditAmountRemaining {\n amount\n currency\n }\n}\n\nfragment Download_order on Order {\n id\n archiveUrl\n customer {\n email\n id\n }\n completedWithCoupon\n}\n\nfragment FontStyle_fontStyle on FontStyle {\n cssFamily\n name\n}\n\nfragment IdentityBox_identity on Identity {\n email\n phoneFormatted\n addressFormatted\n vatNumber\n}\n\nfragment Price_price on Money {\n amount\n currency\n}\n\nfragment VariableTableAmounts_option on LicenseOption {\n amounts\n}\n\nfragment VariableTableAmounts_variable on LicenseVariable {\n units\n}\n"
637
+ "text": "mutation TestFontsFormUpdateCustomerMutation(\n $input: UpdateCustomerInput!\n) {\n updateCustomer(input: $input) {\n order {\n ...CartOrder_order\n id\n }\n }\n}\n\nfragment CartItem_node on OrderItem {\n id\n price {\n ...Price_price\n }\n sku {\n price {\n ...Price_price\n }\n product {\n __typename\n __isSkuProduct: __typename\n ...CollectionAa_product\n ...FontStyle_fontStyle\n ... on FontStyle {\n family {\n name\n cssUrl\n id\n }\n name\n variableInstances {\n name\n }\n }\n ... on Bundle {\n name\n }\n ... on FontCollection {\n name\n isVariableFont\n totalStyles\n featureStyle {\n family {\n cssUrl\n id\n }\n id\n }\n }\n ... on Node {\n __isNode: __typename\n id\n }\n }\n id\n }\n licenseSelections {\n id\n license {\n id\n name\n multiplier\n }\n variable: licenseVariable {\n id\n variableType\n ...VariableTableAmounts_variable\n }\n option: licenseOption {\n id\n amount\n multiplier\n name\n ...VariableTableAmounts_option\n }\n variableText\n }\n}\n\nfragment CartOrder_order on Order {\n ...Checkout_order\n ...Download_order\n ...CartTotals_order\n orderItems {\n ...CartItem_node\n id\n licenseSelections {\n license {\n id\n }\n licenseVariable {\n id\n variableType\n }\n licenseOption {\n id\n }\n variableText\n id\n }\n }\n discount {\n id\n }\n customer {\n email\n name\n anonymous\n id\n }\n billingIdentity {\n ...IdentityBox_identity\n }\n licenseeIdentity {\n ...IdentityBox_identity\n }\n licenseeIsBillingIdentity\n stripePaymentMethod {\n card {\n last4\n brand\n }\n }\n stripePaymentIntent {\n status\n }\n canCompleteWithCoupon\n completedWithCoupon\n}\n\nfragment CartTotals_order on Order {\n subtotal {\n ...Price_price\n }\n discount {\n amount {\n amount\n ...Price_price\n }\n coupon {\n ...CouponText_coupon\n id\n }\n id\n }\n discountedSubtotal {\n ...Price_price\n }\n total {\n amount\n ...Price_price\n }\n taxRate\n taxes {\n ...Price_price\n }\n taxName\n gstIncluded\n}\n\nfragment Checkout_order on Order {\n canCompleteWithCoupon\n customer {\n name\n email\n newsletterOptIn\n id\n }\n billingIdentity {\n name\n organization\n email\n phone\n street\n locality\n sublocality\n country\n administrativeArea\n zip\n vatNumber\n }\n licenseeIdentity {\n name\n organization\n email\n phone\n street\n locality\n sublocality\n country\n administrativeArea\n zip\n vatNumber\n }\n licenseeIsBillingIdentity\n}\n\nfragment CollectionAa_product on SkuProduct {\n __isSkuProduct: __typename\n __typename\n ... on FontCollection {\n featureStyle {\n ...FontStyle_fontStyle\n id\n }\n }\n ... on Bundle {\n fontStyles {\n ...FontStyle_fontStyle\n id\n }\n }\n}\n\nfragment CouponText_coupon on Coupon {\n type\n percentAmount\n creditAmountRemaining {\n amount\n currency\n }\n}\n\nfragment Download_order on Order {\n id\n archiveUrl\n customer {\n email\n id\n }\n completedWithCoupon\n}\n\nfragment FontStyle_fontStyle on FontStyle {\n cssFamily\n name\n}\n\nfragment IdentityBox_identity on Identity {\n email\n phoneFormatted\n addressFormatted\n vatNumber\n}\n\nfragment Price_price on Money {\n amount\n currency\n}\n\nfragment VariableTableAmounts_option on LicenseOption {\n amounts\n}\n\nfragment VariableTableAmounts_variable on LicenseVariable {\n units\n}\n"
632
638
  }
633
639
  };
634
640
  }();
@@ -13,6 +13,10 @@ var _Icons = require("../Icons");
13
13
  var _CartTotals_order;
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
15
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
16
+ function percentage(decimalValue) {
17
+ if (!decimalValue) return null;
18
+ return `${parseFloat(decimalValue) * 100}%`;
19
+ }
16
20
  const PriceBlock = _ref => {
17
21
  let {
18
22
  label,
@@ -40,7 +44,7 @@ function CartTotals(_ref2) {
40
44
  allowDiscountRemoval = true,
41
45
  hideTotal = false
42
46
  } = _ref2;
43
- const order = (0, _reactRelay.useFragment)(_CartTotals_order !== void 0 ? _CartTotals_order : (_CartTotals_order = require("../../__generated__/CartTotals_order.graphql"), _CartTotals_order.hash && _CartTotals_order.hash !== "698ea8bf4dd91473e057e19df6dc51b1" && console.error("The definition of 'CartTotals_order' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _CartTotals_order), orderKey);
47
+ const order = (0, _reactRelay.useFragment)(_CartTotals_order !== void 0 ? _CartTotals_order : (_CartTotals_order = require("../../__generated__/CartTotals_order.graphql"), _CartTotals_order.hash && _CartTotals_order.hash !== "7fe25d7e214b579ce085157b9bd551a8" && console.error("The definition of 'CartTotals_order' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _CartTotals_order), orderKey);
44
48
  return /*#__PURE__*/_react.default.createElement("div", {
45
49
  className: "cart__price-blocks",
46
50
  "data-has-discount": Boolean(order.discount),
@@ -70,7 +74,7 @@ function CartTotals(_ref2) {
70
74
  price: order.discountedSubtotal,
71
75
  "data-line": "discounted-subtotal"
72
76
  })), order.taxes && /*#__PURE__*/_react.default.createElement(PriceBlock, {
73
- label: order.taxName ? `${order.taxName}:` : 'Taxes:',
77
+ label: order.taxName ? `${order.taxName} (${percentage(order.taxRate)}):` : `Taxes ${percentage(order.taxRate)}:`,
74
78
  price: order.taxes,
75
79
  "data-line": "taxes"
76
80
  }), /*#__PURE__*/_react.default.createElement(PriceBlock, {
@@ -19,16 +19,36 @@ function FamilyList(_ref) {
19
19
  node: nodeKey,
20
20
  text
21
21
  } = _ref;
22
- const node = (0, _reactRelay.useFragment)(_FamilyList_node !== void 0 ? _FamilyList_node : (_FamilyList_node = require("../../__generated__/FamilyList_node.graphql"), _FamilyList_node.hash && _FamilyList_node.hash !== "3e59cb2493f7c235fe19c70689ca2fc6" && console.error("The definition of 'FamilyList_node' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _FamilyList_node), nodeKey);
22
+ const node = (0, _reactRelay.useFragment)(_FamilyList_node !== void 0 ? _FamilyList_node : (_FamilyList_node = require("../../__generated__/FamilyList_node.graphql"), _FamilyList_node.hash && _FamilyList_node.hash !== "d52770ab2e7aaa83f392a5d80340f3ad" && console.error("The definition of 'FamilyList_node' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _FamilyList_node), nodeKey);
23
23
  return /*#__PURE__*/_react.default.createElement("ul", {
24
24
  className: "font-family-block__list",
25
25
  style: {
26
26
  fontFamily: node.name
27
27
  }
28
- }, (_node$fontStyles = node.fontStyles) === null || _node$fontStyles === void 0 ? void 0 : _node$fontStyles.map((style, i) => /*#__PURE__*/_react.default.createElement(_FontStyle.default, {
29
- fontStyle: style,
30
- Component: "li",
31
- key: i,
32
- className: "font-family-block__list__item"
33
- }, /*#__PURE__*/_react.default.createElement("span", null, text || styleName(style.name, style.name_localized), " "))));
28
+ }, (_node$fontStyles = node.fontStyles) === null || _node$fontStyles === void 0 ? void 0 : _node$fontStyles.map((style, i) => {
29
+ var _style$variableInstan, _style$variableInstan2;
30
+ return /*#__PURE__*/_react.default.createElement(_FontStyle.default, {
31
+ fontStyle: style,
32
+ Component: "li",
33
+ key: i,
34
+ className: "font-family-block__list__item"
35
+ }, (((_style$variableInstan = style.variableInstances) === null || _style$variableInstan === void 0 ? void 0 : _style$variableInstan.length) ?? 0) > 0 ? (_style$variableInstan2 = style.variableInstances) === null || _style$variableInstan2 === void 0 ? void 0 : _style$variableInstan2.map(_ref2 => {
36
+ let {
37
+ name,
38
+ coordinates
39
+ } = _ref2;
40
+ return /*#__PURE__*/_react.default.createElement("span", {
41
+ key: name,
42
+ style: {
43
+ fontVariationSettings: coordinates.map(_ref3 => {
44
+ let {
45
+ axis,
46
+ value
47
+ } = _ref3;
48
+ return `'${axis}' ${value}`;
49
+ }).join(',')
50
+ }
51
+ }, name, ' ');
52
+ }) : /*#__PURE__*/_react.default.createElement("span", null, text || styleName(style.name, style.name_localized), " "));
53
+ }));
34
54
  }
@@ -13,17 +13,18 @@ var _Price = require("../Price");
13
13
  var _FamilyList = _interopRequireDefault(require("./FamilyList"));
14
14
  var _Stylesheet = _interopRequireDefault(require("../Stylesheet"));
15
15
  var _reducer = require("../../reducer");
16
+ var _utils = require("../../utils");
16
17
  var _Family_node;
17
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
19
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
20
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
20
21
  function Family(_ref) {
21
- var _node$families;
22
+ var _node$fontStyles, _node$fontStyles2, _node$families;
22
23
  let {
23
24
  node: nodeKey,
24
25
  size
25
26
  } = _ref;
26
- const node = (0, _reactRelay.useFragment)(_Family_node !== void 0 ? _Family_node : (_Family_node = require("../../__generated__/Family_node.graphql"), _Family_node.hash && _Family_node.hash !== "b51af1e6bc979d5219f04c848dc3d76d" && console.error("The definition of 'Family_node' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _Family_node), nodeKey);
27
+ const node = (0, _reactRelay.useFragment)(_Family_node !== void 0 ? _Family_node : (_Family_node = require("../../__generated__/Family_node.graphql"), _Family_node.hash && _Family_node.hash !== "2fecc4fd332a593d28387a3a87559fe4" && console.error("The definition of 'Family_node' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _Family_node), nodeKey);
27
28
  const precartOpen = (0, _reactRedux.useSelector)(state => state.precartOpen);
28
29
  const selector = node.sku ? (0, _reducer.isSelected)(node.sku.id) : () => false;
29
30
  const selected = (0, _reactRedux.useSelector)(selector);
@@ -61,7 +62,21 @@ function Family(_ref) {
61
62
  className: "font-family-block__separator"
62
63
  }), /*#__PURE__*/_react.default.createElement("p", {
63
64
  className: "font-family-block__count"
64
- }, node.totalStyles, " styles")), /*#__PURE__*/_react.default.createElement("div", {
65
+ }, (0, _utils.pluralize)(node.totalStyles ?? 0, node.isVariableFont ? 'font' : 'style')), node.isVariableFont ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", {
66
+ className: "font-family-block__separator"
67
+ }), /*#__PURE__*/_react.default.createElement("p", {
68
+ className: "font-family-block__count"
69
+ }, (0, _utils.pluralize)(((_node$fontStyles = node.fontStyles) === null || _node$fontStyles === void 0 ? void 0 : _node$fontStyles.reduce((total, style) => {
70
+ var _style$variableAxes;
71
+ return total + (((_style$variableAxes = style.variableAxes) === null || _style$variableAxes === void 0 ? void 0 : _style$variableAxes.length) ?? 0);
72
+ }, 0)) ?? 0, 'variable axis', 'variable axes')), /*#__PURE__*/_react.default.createElement("span", {
73
+ className: "font-family-block__separator"
74
+ }), /*#__PURE__*/_react.default.createElement("p", {
75
+ className: "font-family-block__count"
76
+ }, (0, _utils.pluralize)(((_node$fontStyles2 = node.fontStyles) === null || _node$fontStyles2 === void 0 ? void 0 : _node$fontStyles2.reduce((total, style) => {
77
+ var _style$variableInstan;
78
+ return total + (((_style$variableInstan = style.variableInstances) === null || _style$variableInstan === void 0 ? void 0 : _style$variableInstan.length) ?? 0);
79
+ }, 0)) ?? 0, 'named instance'))) : null), /*#__PURE__*/_react.default.createElement("div", {
65
80
  className: "font-family-block__lists"
66
81
  }, isSuperFamily ? (_node$families = node.families) === null || _node$families === void 0 ? void 0 : _node$families.map((family, index) => {
67
82
  var _family$featureStyle;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { SerializablePreloadedQuery } from '../../relay/loadSerializableQuery';
3
- import { NewsletterSignupQuery, NewsletterSignupQuery$data } from '__generated__/NewsletterSignupQuery.graphql';
3
+ import { NewsletterSignupQuery } from '__generated__/NewsletterSignupQuery.graphql';
4
4
  type PreloadedQuery = SerializablePreloadedQuery<NewsletterSignupQuery>;
5
5
  export interface NewsletterSignup_props {
6
6
  optInLabel?: string;
@@ -9,11 +9,9 @@ export interface NewsletterSignup_props {
9
9
  optInCheckboxChecked?: boolean;
10
10
  title?: string;
11
11
  intro?: string;
12
- data: NewsletterSignupQuery$data;
13
- preloadedQuery?: PreloadedQuery;
14
12
  }
15
13
  export declare function NewsletterSignupPreloadedQueryRenderer({ preloadedQuery, }: {
16
14
  preloadedQuery: PreloadedQuery;
17
15
  }): React.JSX.Element;
18
- export default function NewsletterSignup(): React.JSX.Element;
16
+ export default function NewsletterSignup(props: NewsletterSignup_props): React.JSX.Element;
19
17
  export {};
@@ -15,6 +15,7 @@ var _NewsletterSignupUpdateCustomerMutation, _NewsletterSignupQuery;
15
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
16
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
17
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
18
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
18
19
  const updateCustomerMutation = _NewsletterSignupUpdateCustomerMutation !== void 0 ? _NewsletterSignupUpdateCustomerMutation : (_NewsletterSignupUpdateCustomerMutation = require("../../__generated__/NewsletterSignupUpdateCustomerMutation.graphql"), _NewsletterSignupUpdateCustomerMutation.hash && _NewsletterSignupUpdateCustomerMutation.hash !== "769087891b6f263122bbb630b3f2ca6c" && console.error("The definition of 'NewsletterSignupUpdateCustomerMutation' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _NewsletterSignupUpdateCustomerMutation);
19
20
  const query = _NewsletterSignupQuery !== void 0 ? _NewsletterSignupQuery : (_NewsletterSignupQuery = require("../../__generated__/NewsletterSignupQuery.graphql"), _NewsletterSignupQuery.hash && _NewsletterSignupQuery.hash !== "16f0b6d7ed420ec5857c972b77805e4c" && console.error("The definition of 'NewsletterSignupQuery' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _NewsletterSignupQuery);
20
21
  function NewsletterSignupComponent(_ref) {
@@ -145,9 +146,9 @@ function NewsletterSignupPreloadedQueryRenderer(_ref3) {
145
146
  data: data
146
147
  });
147
148
  }
148
- function NewsletterSignup() {
149
+ function NewsletterSignup(props) {
149
150
  const data = (0, _reactRelay.useLazyLoadQuery)(query, {});
150
- return /*#__PURE__*/_react.default.createElement(NewsletterSignupComponent, {
151
+ return /*#__PURE__*/_react.default.createElement(NewsletterSignupComponent, _extends({}, props, {
151
152
  data: data
152
- });
153
+ }));
153
154
  }
@@ -12,7 +12,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
12
12
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
13
13
  async function NewsletterSignup(props) {
14
14
  const preloadedQuery = await (0, _loadSerializableQuery.default)(_NewsletterSignupQuery.default, {});
15
- return /*#__PURE__*/_react.default.createElement(_index.NewsletterSignupPreloadedQueryRenderer, _extends({
15
+ return /*#__PURE__*/_react.default.createElement(_index.NewsletterSignupPreloadedQueryRenderer, _extends({}, props, {
16
16
  preloadedQuery: preloadedQuery
17
- }, props));
17
+ }));
18
18
  }
@@ -43,7 +43,7 @@ const countStylesPrice = _ref2 => {
43
43
  var _sku$product4, _sku$product5;
44
44
  if (((_sku$product4 = sku.product) === null || _sku$product4 === void 0 ? void 0 : _sku$product4.__typename) === 'FontCollection' || ((_sku$product5 = sku.product) === null || _sku$product5 === void 0 ? void 0 : _sku$product5.__typename) === 'Bundle') {
45
45
  var _sku$product6, _sku$product6$totalSt;
46
- return acc + (((_sku$product6 = sku.product) === null || _sku$product6 === void 0 ? void 0 : (_sku$product6$totalSt = _sku$product6.totalStylesPrice) === null || _sku$product6$totalSt === void 0 ? void 0 : _sku$product6$totalSt.amount) ?? 0);
46
+ return acc + (((_sku$product6 = sku.product) === null || _sku$product6 === void 0 ? void 0 : (_sku$product6$totalSt = _sku$product6.totalStylesPrice) === null || _sku$product6$totalSt === void 0 ? void 0 : _sku$product6$totalSt.amount) ?? sku.price.amount);
47
47
  }
48
48
  return acc + sku.price.amount;
49
49
  }, 0);
@@ -241,7 +241,7 @@ function Precart(_ref3) {
241
241
  className: "pre-cart__your-selection__items"
242
242
  }, /*#__PURE__*/_react.default.createElement("div", {
243
243
  className: "pre-cart__your-selection__item"
244
- }, /*#__PURE__*/_react.default.createElement("div", null, collection === null || collection === void 0 ? void 0 : collection.name, /*#__PURE__*/_react.default.createElement("br", null), (0, _utils.pluralize)(countStyles(viewer), 'style')), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Price.Price, {
244
+ }, /*#__PURE__*/_react.default.createElement("div", null, collection === null || collection === void 0 ? void 0 : collection.name, /*#__PURE__*/_react.default.createElement("br", null), (0, _utils.pluralize)(countStyles(viewer), 'font')), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Price.Price, {
245
245
  price: {
246
246
  amount: countStylesPrice(viewer),
247
247
  currency: subtotal.currency
@@ -46,7 +46,10 @@ function SKUPrice(_ref) {
46
46
  licenseId: spec.licenseId,
47
47
  licenseOptionIds: Object.values(spec.licenseOptions).filter(Boolean)
48
48
  }));
49
- const prevLicenseOptionsSpecs = (0, _react.useRef)(licenseOptionsSpecs);
49
+
50
+ // this must be null to start because we always want to fetch the price for
51
+ // the current license selection on mount
52
+ const prevLicenseOptionsSpecs = (0, _react.useRef)(null);
50
53
  (0, _react.useEffect)(() => {
51
54
  if (!sku) return;
52
55
  if (!(0, _fastDeepEqual.default)(prevLicenseOptionsSpecs.current, licenseOptionsSpecs)) {
@@ -1,6 +1,6 @@
1
1
  import React, { Dispatch } from 'react';
2
2
  import { VariableSettings } from '../../utils';
3
- import { Content, Features, Size, Alignment, TypeTesterMode } from './types';
3
+ import { Content, Features, Size, Alignment, TypeTesterMode, Direction } from './types';
4
4
  interface TypeTesterState {
5
5
  content: Content;
6
6
  contentEdited: boolean;
@@ -12,6 +12,7 @@ interface TypeTesterState {
12
12
  autofit: boolean;
13
13
  alignment: Alignment;
14
14
  variableSettings: VariableSettings | null;
15
+ direction: Direction;
15
16
  }
16
17
  export interface TypeTestersState {
17
18
  [id: string]: TypeTesterState;
@@ -25,6 +26,7 @@ export interface TypeTestersInitialState {
25
26
  alignment: Alignment;
26
27
  variableSettings: VariableSettings | null;
27
28
  features: Features | null;
29
+ direction: Direction;
28
30
  };
29
31
  }
30
32
  interface TypeTesterContextState {
@@ -141,7 +141,8 @@ const TypeTesterContextComponent = _ref => {
141
141
  featuresOpen: false,
142
142
  focused: false,
143
143
  alignment: initialState.alignment,
144
- variableSettings: initialState.variableSettings
144
+ variableSettings: initialState.variableSettings,
145
+ direction: initialState.direction
145
146
  };
146
147
  return acc;
147
148
  }, {});
@@ -32,6 +32,8 @@ function TypeTesterStandaloneComponent(_ref) {
32
32
  onBlur,
33
33
  data
34
34
  } = _ref;
35
+ let defaultAlignment = 'left';
36
+ if (direction === 'rtl') defaultAlignment = 'right';
35
37
  return /*#__PURE__*/_react.default.createElement(_TypeTesterContext.default, {
36
38
  testers: {
37
39
  standalone: {
@@ -39,7 +41,7 @@ function TypeTesterStandaloneComponent(_ref) {
39
41
  autofit: autofit ?? false,
40
42
  size: fontSize ?? 72,
41
43
  lineHeight: lineHeight ?? 1,
42
- alignment: alignment ?? 'left',
44
+ alignment: alignment ?? defaultAlignment,
43
45
  features: (featureSettings === null || featureSettings === void 0 ? void 0 : featureSettings.filter(setting => setting.value === '1').map(setting => setting.feature)) ?? featuresSelected ?? null,
44
46
  variableSettings: (variableSettings === null || variableSettings === void 0 ? void 0 : variableSettings.reduce((acc, _ref2) => {
45
47
  let {
@@ -48,7 +50,8 @@ function TypeTesterStandaloneComponent(_ref) {
48
50
  } = _ref2;
49
51
  acc[axis] = value;
50
52
  return acc;
51
- }, {})) ?? null
53
+ }, {})) ?? null,
54
+ direction: direction ?? 'ltr'
52
55
  }
53
56
  }
54
57
  }, /*#__PURE__*/_react.default.createElement(_index.default, {
@@ -57,7 +60,6 @@ function TypeTesterStandaloneComponent(_ref) {
57
60
  fontStyle: (_data$viewer = data.viewer) === null || _data$viewer === void 0 ? void 0 : _data$viewer.fontStyle,
58
61
  axes: axes,
59
62
  features: features,
60
- direction: direction,
61
63
  productId: ((_data$viewer2 = data.viewer) === null || _data$viewer2 === void 0 ? void 0 : (_data$viewer2$fontSty = _data$viewer2.fontStyle) === null || _data$viewer2$fontSty === void 0 ? void 0 : (_data$viewer2$fontSty2 = _data$viewer2$fontSty.family) === null || _data$viewer2$fontSty2 === void 0 ? void 0 : (_data$viewer2$fontSty3 = _data$viewer2$fontSty2.parent) === null || _data$viewer2$fontSty3 === void 0 ? void 0 : _data$viewer2$fontSty3.id) ?? ((_data$viewer3 = data.viewer) === null || _data$viewer3 === void 0 ? void 0 : (_data$viewer3$fontSty = _data$viewer3.fontStyle) === null || _data$viewer3$fontSty === void 0 ? void 0 : (_data$viewer3$fontSty2 = _data$viewer3$fontSty.family) === null || _data$viewer3$fontSty2 === void 0 ? void 0 : _data$viewer3$fontSty2.id),
62
64
  groupEdit: false,
63
65
  onFocus: onFocus,
@@ -1,4 +1,4 @@
1
- import { Content, Size, LineHeight, Alignment } from './types';
1
+ import { Content, Size, LineHeight, Alignment, Direction } from './types';
2
2
  import { VariableSettings } from '../../utils';
3
3
  interface TypeTesterStateProps {
4
4
  id: string;
@@ -26,6 +26,7 @@ interface TypeTesterState {
26
26
  setAlignment: (value: Alignment) => void;
27
27
  variableSettings: VariableSettings | null;
28
28
  setVariableSettings: (value: VariableSettings | null) => void;
29
+ direction: Direction;
29
30
  }
30
31
  declare const useTypeTesterState: (props: TypeTesterStateProps) => TypeTesterState;
31
32
  export default useTypeTesterState;
@@ -29,7 +29,8 @@ const useTypeTesterState = _ref => {
29
29
  autofit,
30
30
  lineHeight,
31
31
  alignment,
32
- variableSettings
32
+ variableSettings,
33
+ direction
33
34
  } = testers[id];
34
35
  return {
35
36
  autofit,
@@ -118,7 +119,8 @@ const useTypeTesterState = _ref => {
118
119
  type: 'SET_VARIABLE_SETTINGS',
119
120
  value,
120
121
  id
121
- })
122
+ }),
123
+ direction
122
124
  };
123
125
  };
124
126
  var _default = useTypeTesterState;
@@ -36,7 +36,7 @@ const computeSimilarity = (left, right) => {
36
36
  return weightSimilarity * styleSimilarity * stretchSimilarity;
37
37
  };
38
38
  function TypeTesterStyleSelectData(_ref) {
39
- var _viewer$families, _viewer$families$edge;
39
+ var _viewer$families, _viewer$families$edge, _fontStyle$variableIn;
40
40
  let {
41
41
  fontStyle: fontStyleKey,
42
42
  viewer: viewerKey,
@@ -83,6 +83,7 @@ function TypeTesterStyleSelectData(_ref) {
83
83
  variableSettings
84
84
  });
85
85
  }, [familyData, fontStyle]);
86
+ const instance = variableSettings ? (_fontStyle$variableIn = fontStyle.variableInstances) === null || _fontStyle$variableIn === void 0 ? void 0 : _fontStyle$variableIn.find(instance => (0, _utils.compareVariableSettings)(instance, variableSettings)) : null;
86
87
  return config.selectable && familyData ? /*#__PURE__*/_react.default.createElement(_TypeTesterStyleSelect.default, {
87
88
  families: familyData,
88
89
  selectedFontStyleId: fontStyle.id,
@@ -97,5 +98,5 @@ function TypeTesterStyleSelectData(_ref) {
97
98
  className: "type-tester__name__family"
98
99
  }, fontStyle.family.name), ' ', /*#__PURE__*/_react.default.createElement("span", {
99
100
  className: "type-tester__name__style"
100
- }, fontStyle.name.replace(/ /g, '\xa0')));
101
+ }, variableSettings ? (instance === null || instance === void 0 ? void 0 : instance.name) ?? 'Custom' : fontStyle.name.replace(/ /g, '\xa0')));
101
102
  }
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { TypeTester_viewer$key } from '../../__generated__/TypeTester_viewer.graphql';
3
3
  import { TypeTester_fontStyle$key } from '../../__generated__/TypeTester_fontStyle.graphql';
4
- import { Alignment, Direction, TypeTesterAxesPosition } from './types';
4
+ import { Alignment, TypeTesterAxesPosition } from './types';
5
5
  export interface TypeTesterConfig {
6
6
  min?: number;
7
7
  max?: number;
@@ -48,7 +48,6 @@ export interface TypeTesterConfig {
48
48
  export interface TypeTesterBaseProps {
49
49
  id: string;
50
50
  productId?: string;
51
- direction: Direction | undefined;
52
51
  features?: ReadonlyArray<string> | null;
53
52
  axes?: ReadonlyArray<string> | null;
54
53
  groupEdit?: boolean;
@@ -45,7 +45,6 @@ const TypeTester = _ref => {
45
45
  let {
46
46
  id,
47
47
  productId,
48
- direction = 'ltr',
49
48
  fontStyle: fontStyleKey,
50
49
  viewer: viewerKey,
51
50
  onFocus,
@@ -106,7 +105,7 @@ const TypeTester = _ref => {
106
105
  "data-selected": selected,
107
106
  "data-buy-button-hovered": buyButtonIsHovered,
108
107
  "data-large-font-size": props.size > 72,
109
- "data-direction": direction,
108
+ "data-direction": props.direction,
110
109
  "data-autofit": props.autofit,
111
110
  "data-shy": config.shy,
112
111
  "data-select-button-style": config.selectButtonStyle,
@@ -186,7 +185,7 @@ const TypeTester = _ref => {
186
185
  ref: contentRef,
187
186
  fontStyles: style,
188
187
  truncate: config.truncate,
189
- direction: direction,
188
+ direction: props.direction,
190
189
  min: config.size.min,
191
190
  max: config.size.max,
192
191
  autofitOnChange: config.autofitOnChange
@@ -116,7 +116,8 @@ const useTypeTesterStyler = _ref => {
116
116
  marginRight: alignment !== 'right' ? -sideBuffer : 0,
117
117
  marginLeft: alignment === 'right' ? -sideBuffer : 0,
118
118
  letterSpacing: 0,
119
- fontVariationSettings
119
+ fontVariationSettings,
120
+ textAlign: alignment
120
121
  };
121
122
  return {
122
123
  ref,
@@ -70,12 +70,16 @@ function TypeTestersComponent(_ref) {
70
70
  const testers = (_collection$typeTeste2 = collection.typeTesters) === null || _collection$typeTeste2 === void 0 ? void 0 : (_collection$typeTeste3 = _collection$typeTeste2.edges) === null || _collection$typeTeste3 === void 0 ? void 0 : _collection$typeTeste3.reduce((acc, edge) => {
71
71
  var _node$variableSetting, _node$featureSettings;
72
72
  const node = edge.node;
73
+ const direction = node.direction === 'rtl' ? 'rtl' : 'ltr';
74
+ let alignment = config.initialAlignment;
75
+ if (direction === 'rtl') alignment = 'right';
73
76
  acc[node.id] = {
74
77
  content: node.content,
75
78
  size: node.size ? parseFloat(node.size) : 72,
76
79
  lineHeight: node.lineHeight ? parseFloat(node.lineHeight) : 1,
77
80
  autofit: autofit ?? false,
78
- alignment: config.initialAlignment,
81
+ direction,
82
+ alignment,
79
83
  variableSettings: ((_node$variableSetting = node.variableSettings) === null || _node$variableSetting === void 0 ? void 0 : _node$variableSetting.reduce((acc, _ref2) => {
80
84
  let {
81
85
  axis,
@@ -113,7 +117,6 @@ function TypeTestersComponent(_ref) {
113
117
  }), typeTesterGroup.map((node, j) => /*#__PURE__*/_react.default.createElement(_TypeTester.default, _extends({}, rest, {
114
118
  id: node.id,
115
119
  fontStyle: node.fontStyle,
116
- direction: node.direction === 'rtl' ? 'rtl' : 'ltr',
117
120
  key: j,
118
121
  productId: productId,
119
122
  onFocus: onFocus,
package/dist/fontdue.css CHANGED
@@ -1189,6 +1189,7 @@ body[data-fontdue-store-modal=open] {
1189
1189
  grid-template-columns: 1fr auto 1fr;
1190
1190
  padding: 10px 15px;
1191
1191
  grid-gap: 10px;
1192
+ align-items: center;
1192
1193
  }
1193
1194
  .store-modal__container__nav[data-has-back-text=false] {
1194
1195
  grid-template-columns: auto max-content;
@@ -1447,6 +1448,9 @@ body[data-fontdue-store-modal=open] {
1447
1448
  margin-bottom: 20px;
1448
1449
  }
1449
1450
 
1451
+ .store-modal__family-button__checked {
1452
+ text-align: right;
1453
+ }
1450
1454
  .store-modal__family-button__checked .icon {
1451
1455
  font-size: 20px;
1452
1456
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fontdue-js",
3
- "version": "2.3.0",
3
+ "version": "2.4.1",
4
4
  "scripts": {
5
5
  "build": "npm run relay && run-p build-js build-css build-ts-declarations",
6
6
  "build-js": "babel src --out-dir dist --extensions .ts,.tsx,.js,.jsx",