fontdue-js 0.1.0-alpha21 → 0.1.0-alpha22
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.
- package/dist/__generated__/CartOrderApplyCouponMutation.graphql.js +9 -2
- package/dist/__generated__/CartOrderCompleteOrderMutation.graphql.js +9 -2
- package/dist/__generated__/CartOrderRemoveDiscountMutation.graphql.js +9 -2
- package/dist/__generated__/CartOrderUpdateMutation.graphql.js +9 -2
- package/dist/__generated__/CartQuery.graphql.js +9 -2
- package/dist/__generated__/CartStateApplyCouponMutation.graphql.js +9 -2
- package/dist/__generated__/CartStateRemoveDiscountMutation.graphql.js +9 -2
- package/dist/__generated__/CartStateUpdateMutation.graphql.js +9 -2
- package/dist/__generated__/CartTotals_order.graphql.d.ts +1 -0
- package/dist/__generated__/CartTotals_order.graphql.js +7 -1
- package/dist/__generated__/CheckoutUpdateCustomerMutation.graphql.js +9 -2
- package/dist/__generated__/CheckoutUpdateOrderMutation.graphql.js +9 -2
- package/dist/__generated__/PrecartAddToCartMutation.graphql.js +9 -2
- package/dist/__generated__/StoreModalCartQuery.graphql.js +9 -2
- package/dist/__generated__/StoreModalReviewCompleteOrderMutation.graphql.js +9 -2
- package/dist/__generated__/StoreModalReviewQuery.graphql.js +9 -2
- package/dist/__generated__/TestFontsFormUpdateCustomerMutation.graphql.js +9 -2
- package/dist/components/Cart/CartTotals.js +3 -3
- package/dist/components/TypeTester/TypeTesterContent.d.ts +4 -1
- package/dist/components/TypeTester/TypeTesterContent.js +17 -4
- package/dist/components/TypeTester/TypeTesterFeatures.js +3 -1
- package/dist/components/TypeTester/TypeTesterFeaturesButton.js +1 -1
- package/dist/components/TypeTester/TypeTesterStandalone.d.ts +2 -0
- package/dist/components/TypeTester/TypeTesterStandalone.js +6 -2
- package/dist/components/TypeTester/TypeTesterStyleSelect.js +4 -2
- package/dist/components/TypeTester/index.d.ts +3 -0
- package/dist/components/TypeTester/index.js +98 -32
- package/dist/components/TypeTesters/index.d.ts +2 -0
- package/dist/components/TypeTesters/index.js +14 -4
- package/fontdue.css +26 -4
- package/fontdue.css.map +1 -1
- package/package.json +1 -1
|
@@ -50,6 +50,7 @@ fragment CartTotals_order on Order {
|
|
|
50
50
|
...Price_price
|
|
51
51
|
}
|
|
52
52
|
isVatTax
|
|
53
|
+
gstIncluded
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
fragment CouponText_coupon on Coupon {
|
|
@@ -356,6 +357,12 @@ const node = function () {
|
|
|
356
357
|
"kind": "ScalarField",
|
|
357
358
|
"name": "isVatTax",
|
|
358
359
|
"storageKey": null
|
|
360
|
+
}, {
|
|
361
|
+
"alias": null,
|
|
362
|
+
"args": null,
|
|
363
|
+
"kind": "ScalarField",
|
|
364
|
+
"name": "gstIncluded",
|
|
365
|
+
"storageKey": null
|
|
359
366
|
}, v3
|
|
360
367
|
/*: any*/
|
|
361
368
|
, {
|
|
@@ -522,12 +529,12 @@ const node = function () {
|
|
|
522
529
|
}]
|
|
523
530
|
},
|
|
524
531
|
"params": {
|
|
525
|
-
"cacheID": "
|
|
532
|
+
"cacheID": "a3417f9ea3502c999073d28076ed9df7",
|
|
526
533
|
"id": null,
|
|
527
534
|
"metadata": {},
|
|
528
535
|
"name": "StoreModalReviewCompleteOrderMutation",
|
|
529
536
|
"operationKind": "mutation",
|
|
530
|
-
"text": "mutation StoreModalReviewCompleteOrderMutation {\n completeOrder {\n order {\n ...StoreModalReview_order\n stripePaymentIntent {\n clientSecret\n }\n id\n }\n requiresAction\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 isVatTax\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 ...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}\n"
|
|
537
|
+
"text": "mutation StoreModalReviewCompleteOrderMutation {\n completeOrder {\n order {\n ...StoreModalReview_order\n stripePaymentIntent {\n clientSecret\n }\n id\n }\n requiresAction\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 isVatTax\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 ...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}\n"
|
|
531
538
|
}
|
|
532
539
|
};
|
|
533
540
|
}();
|
|
@@ -48,6 +48,7 @@ fragment CartTotals_order on Order {
|
|
|
48
48
|
...Price_price
|
|
49
49
|
}
|
|
50
50
|
isVatTax
|
|
51
|
+
gstIncluded
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
fragment CouponText_coupon on Coupon {
|
|
@@ -352,6 +353,12 @@ const node = function () {
|
|
|
352
353
|
"kind": "ScalarField",
|
|
353
354
|
"name": "isVatTax",
|
|
354
355
|
"storageKey": null
|
|
356
|
+
}, {
|
|
357
|
+
"alias": null,
|
|
358
|
+
"args": null,
|
|
359
|
+
"kind": "ScalarField",
|
|
360
|
+
"name": "gstIncluded",
|
|
361
|
+
"storageKey": null
|
|
355
362
|
}, v1
|
|
356
363
|
/*: any*/
|
|
357
364
|
, {
|
|
@@ -522,12 +529,12 @@ const node = function () {
|
|
|
522
529
|
}]
|
|
523
530
|
},
|
|
524
531
|
"params": {
|
|
525
|
-
"cacheID": "
|
|
532
|
+
"cacheID": "01e8ec43bf6852ce003e9c43cf644521",
|
|
526
533
|
"id": null,
|
|
527
534
|
"metadata": {},
|
|
528
535
|
"name": "StoreModalReviewQuery",
|
|
529
536
|
"operationKind": "query",
|
|
530
|
-
"text": "query StoreModalReviewQuery {\n viewer {\n ...StoreModalReview_viewer\n currentOrder {\n ...StoreModalReview_order\n id\n }\n id\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 isVatTax\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 ...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}\n\nfragment StoreModalReview_viewer on Viewer {\n settings {\n eulaAgreementLabel\n }\n}\n"
|
|
537
|
+
"text": "query StoreModalReviewQuery {\n viewer {\n ...StoreModalReview_viewer\n currentOrder {\n ...StoreModalReview_order\n id\n }\n id\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 isVatTax\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 ...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}\n\nfragment StoreModalReview_viewer on Viewer {\n settings {\n eulaAgreementLabel\n }\n}\n"
|
|
531
538
|
}
|
|
532
539
|
};
|
|
533
540
|
}();
|
|
@@ -167,6 +167,7 @@ fragment CartTotals_order on Order {
|
|
|
167
167
|
...Price_price
|
|
168
168
|
}
|
|
169
169
|
isVatTax
|
|
170
|
+
gstIncluded
|
|
170
171
|
}
|
|
171
172
|
|
|
172
173
|
fragment Checkout_order on Order {
|
|
@@ -696,6 +697,12 @@ const node = function () {
|
|
|
696
697
|
"kind": "ScalarField",
|
|
697
698
|
"name": "isVatTax",
|
|
698
699
|
"storageKey": null
|
|
700
|
+
}, {
|
|
701
|
+
"alias": null,
|
|
702
|
+
"args": null,
|
|
703
|
+
"kind": "ScalarField",
|
|
704
|
+
"name": "gstIncluded",
|
|
705
|
+
"storageKey": null
|
|
699
706
|
}, {
|
|
700
707
|
"alias": null,
|
|
701
708
|
"args": null,
|
|
@@ -994,12 +1001,12 @@ const node = function () {
|
|
|
994
1001
|
}]
|
|
995
1002
|
},
|
|
996
1003
|
"params": {
|
|
997
|
-
"cacheID": "
|
|
1004
|
+
"cacheID": "2194c8f2b37ff41b84439ea6af9b0f3e",
|
|
998
1005
|
"id": null,
|
|
999
1006
|
"metadata": {},
|
|
1000
1007
|
"name": "TestFontsFormUpdateCustomerMutation",
|
|
1001
1008
|
"operationKind": "mutation",
|
|
1002
|
-
"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 }\n ... on Bundle {\n name\n }\n ... on FontCollection {\n name\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 ...CouponCodeInput_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 clientSecret\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 isVatTax\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 families: children(collectionTypes: [FAMILY]) {\n fontStyles {\n ...FontStyle_fontStyle\n id\n }\n id\n }\n }\n ... on Bundle {\n fontStyles {\n ...FontStyle_fontStyle\n id\n }\n }\n}\n\nfragment CouponCodeInput_order on Order {\n id\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"
|
|
1009
|
+
"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 }\n ... on Bundle {\n name\n }\n ... on FontCollection {\n name\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 ...CouponCodeInput_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 clientSecret\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 isVatTax\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 families: children(collectionTypes: [FAMILY]) {\n fontStyles {\n ...FontStyle_fontStyle\n id\n }\n id\n }\n }\n ... on Bundle {\n fontStyles {\n ...FontStyle_fontStyle\n id\n }\n }\n}\n\nfragment CouponCodeInput_order on Order {\n id\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"
|
|
1003
1010
|
}
|
|
1004
1011
|
};
|
|
1005
1012
|
}();
|
|
@@ -51,7 +51,7 @@ const CartTotals = ({
|
|
|
51
51
|
"data-has-discount": Boolean(order.discount),
|
|
52
52
|
"data-hide-total": hideTotal
|
|
53
53
|
}, /*#__PURE__*/_react.default.createElement(PriceBlock, {
|
|
54
|
-
label: "
|
|
54
|
+
label: "Subtotal:",
|
|
55
55
|
price: order.subtotal,
|
|
56
56
|
"data-line": "subtotal"
|
|
57
57
|
}), order.discount && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(PriceBlock, {
|
|
@@ -79,13 +79,13 @@ const CartTotals = ({
|
|
|
79
79
|
price: order.taxes,
|
|
80
80
|
"data-line": "taxes"
|
|
81
81
|
}), /*#__PURE__*/_react.default.createElement(PriceBlock, {
|
|
82
|
-
label: "Total:",
|
|
82
|
+
label: "Total".concat(order.gstIncluded ? ' including GST' : '', ":"),
|
|
83
83
|
price: order.total,
|
|
84
84
|
"data-line": "total"
|
|
85
85
|
}));
|
|
86
86
|
|
|
87
87
|
var _default = (0, _reactRelay.createFragmentContainer)(CartTotals, {
|
|
88
|
-
order: _CartTotals_order !== void 0 ? _CartTotals_order : (_CartTotals_order = require("../../__generated__/CartTotals_order.graphql"), _CartTotals_order.hash && _CartTotals_order.hash !== "
|
|
88
|
+
order: _CartTotals_order !== void 0 ? _CartTotals_order : (_CartTotals_order = require("../../__generated__/CartTotals_order.graphql"), _CartTotals_order.hash && _CartTotals_order.hash !== "b4e8ff4b5b5525af89e9f80a08a657e5" && 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)
|
|
89
89
|
});
|
|
90
90
|
|
|
91
91
|
exports.default = _default;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { UseTypeTesterStylerProps } from './useTypeTesterStyler';
|
|
3
3
|
import { Content } from './types';
|
|
4
|
+
export interface TypeTesterContentRef {
|
|
5
|
+
focus: () => void;
|
|
6
|
+
}
|
|
4
7
|
interface TypeTesterContentProps extends UseTypeTesterStylerProps {
|
|
5
8
|
content: Content;
|
|
6
9
|
setContent: (value: Content) => void;
|
|
@@ -9,5 +12,5 @@ interface TypeTesterContentProps extends UseTypeTesterStylerProps {
|
|
|
9
12
|
direction: string | null;
|
|
10
13
|
autofitOnChange: boolean;
|
|
11
14
|
}
|
|
12
|
-
declare const TypeTesterContent: React.
|
|
15
|
+
declare const TypeTesterContent: React.ForwardRefExoticComponent<TypeTesterContentProps & React.RefAttributes<TypeTesterContentRef>>;
|
|
13
16
|
export default TypeTesterContent;
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
10
10
|
var _useTypeTesterStyler = _interopRequireDefault(require("./useTypeTesterStyler"));
|
|
11
11
|
|
|
@@ -13,21 +13,34 @@ var _draftJs = require("draft-js");
|
|
|
13
13
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
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
|
+
|
|
18
|
+
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; }
|
|
19
|
+
|
|
16
20
|
function _extends() { _extends = Object.assign || 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); }
|
|
17
21
|
|
|
18
|
-
const TypeTesterContent = ({
|
|
22
|
+
const TypeTesterContent = /*#__PURE__*/_react.default.forwardRef(({
|
|
19
23
|
content,
|
|
20
24
|
setContent,
|
|
21
25
|
setFocused,
|
|
22
26
|
direction,
|
|
23
27
|
...props
|
|
24
|
-
}) => {
|
|
28
|
+
}, ref) => {
|
|
29
|
+
const editorRef = (0, _react.useRef)(null);
|
|
30
|
+
(0, _react.useImperativeHandle)(ref, () => ({
|
|
31
|
+
focus: () => {
|
|
32
|
+
var _editorRef$current;
|
|
33
|
+
|
|
34
|
+
(_editorRef$current = editorRef.current) === null || _editorRef$current === void 0 ? void 0 : _editorRef$current.focus();
|
|
35
|
+
}
|
|
36
|
+
}));
|
|
25
37
|
const style = (0, _useTypeTesterStyler.default)({ ...props,
|
|
26
38
|
content
|
|
27
39
|
});
|
|
28
40
|
return /*#__PURE__*/_react.default.createElement("div", _extends({}, style, {
|
|
29
41
|
className: "type-tester__text__container"
|
|
30
42
|
}), /*#__PURE__*/_react.default.createElement(_draftJs.Editor, {
|
|
43
|
+
ref: editorRef,
|
|
31
44
|
editorState: content,
|
|
32
45
|
onChange: value => setContent(value),
|
|
33
46
|
onBlur: () => setFocused(false),
|
|
@@ -36,7 +49,7 @@ const TypeTesterContent = ({
|
|
|
36
49
|
stripPastedStyles: true,
|
|
37
50
|
textDirectionality: direction === 'rtl' ? 'RTL' : 'LTR'
|
|
38
51
|
}));
|
|
39
|
-
};
|
|
52
|
+
});
|
|
40
53
|
|
|
41
54
|
var _default = TypeTesterContent;
|
|
42
55
|
exports.default = _default;
|
|
@@ -61,7 +61,9 @@ const TypeTesterFeatures = ({
|
|
|
61
61
|
}, getFeatureName(feature, fontStyle.fontFeatures.stylisticSetNames)));
|
|
62
62
|
|
|
63
63
|
if ((_config$openTypeFeatu = config.openTypeFeatures) !== null && _config$openTypeFeatu !== void 0 && (_config$openTypeFeatu2 = _config$openTypeFeatu.columns) !== null && _config$openTypeFeatu2 !== void 0 && _config$openTypeFeatu2.length) {
|
|
64
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, config.openTypeFeatures.columns.map(column => /*#__PURE__*/_react.default.createElement("div",
|
|
64
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, config.openTypeFeatures.columns.map((column, i) => /*#__PURE__*/_react.default.createElement("div", {
|
|
65
|
+
key: i
|
|
66
|
+
}, column.filter(feature => shouldIncludeFeature(fontStyle.fontFeatures.supportedFeatures, feature)).map(renderFeature))));
|
|
65
67
|
}
|
|
66
68
|
|
|
67
69
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, showFeatures.filter(feature => shouldIncludeFeature(fontStyle.fontFeatures.supportedFeatures, feature)).map(renderFeature));
|
|
@@ -23,7 +23,7 @@ const TypeTesterFeaturesButton = ({
|
|
|
23
23
|
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
24
24
|
className: "type-tester__features-button__button",
|
|
25
25
|
type: "button",
|
|
26
|
-
onClick: toggleFeaturesOpen
|
|
26
|
+
onClick: () => toggleFeaturesOpen()
|
|
27
27
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
28
28
|
className: "type-tester__features-button__text"
|
|
29
29
|
}, "OT Features"), ' ', featuresOpen ? /*#__PURE__*/_react.default.createElement(_CarrotUp.default, null) : /*#__PURE__*/_react.default.createElement(_CarrotDown.default, null)));
|
|
@@ -29,7 +29,9 @@ const TypeTesterStandalone = ({
|
|
|
29
29
|
features,
|
|
30
30
|
lineHeight,
|
|
31
31
|
fontSize,
|
|
32
|
-
autofit
|
|
32
|
+
autofit,
|
|
33
|
+
onFocus,
|
|
34
|
+
onBlur
|
|
33
35
|
}) => {
|
|
34
36
|
const environment = (0, _reactRelay.useRelayEnvironment)();
|
|
35
37
|
return /*#__PURE__*/_react.default.createElement(_reactRelay.QueryRenderer, {
|
|
@@ -58,7 +60,9 @@ const TypeTesterStandalone = ({
|
|
|
58
60
|
config: {
|
|
59
61
|
groupEdit: false,
|
|
60
62
|
buyButton: false
|
|
61
|
-
}
|
|
63
|
+
},
|
|
64
|
+
onFocus: onFocus,
|
|
65
|
+
onBlur: onBlur
|
|
62
66
|
})));
|
|
63
67
|
}
|
|
64
68
|
});
|
|
@@ -35,7 +35,8 @@ const TypeTesterStyleSelect = ({
|
|
|
35
35
|
}, /*#__PURE__*/_react.default.createElement(_DownArrow.default, null), NBSP, selectedFamily.name), /*#__PURE__*/_react.default.createElement("select", {
|
|
36
36
|
value: selectedFamily.id,
|
|
37
37
|
onChange: e => onSelectFamilyId(e.target.value),
|
|
38
|
-
className: "type-tester-select__select"
|
|
38
|
+
className: "type-tester-select__select",
|
|
39
|
+
onClick: e => e.stopPropagation()
|
|
39
40
|
}, families.map(({
|
|
40
41
|
id,
|
|
41
42
|
name
|
|
@@ -49,7 +50,8 @@ const TypeTesterStyleSelect = ({
|
|
|
49
50
|
}, /*#__PURE__*/_react.default.createElement(_DownArrow.default, null), " ", selectedFontStyle.name), /*#__PURE__*/_react.default.createElement("select", {
|
|
50
51
|
value: selectedFontStyleId,
|
|
51
52
|
onChange: e => onSelectFontStyleId(e.target.value),
|
|
52
|
-
className: "type-tester-select__select"
|
|
53
|
+
className: "type-tester-select__select",
|
|
54
|
+
onClick: e => e.stopPropagation()
|
|
53
55
|
}, selectedFamily.fontStyles.map(({
|
|
54
56
|
id,
|
|
55
57
|
name
|
|
@@ -9,6 +9,7 @@ export interface TypeTesterConfig {
|
|
|
9
9
|
initialMode?: 'group' | 'local';
|
|
10
10
|
groupEdit?: boolean;
|
|
11
11
|
shy?: false | true | 'hover' | 'focus';
|
|
12
|
+
toolsPosition?: 'inline' | 'floating';
|
|
12
13
|
selectButtonStyle?: 'inline' | 'outlined';
|
|
13
14
|
selectButtonLabel?: string;
|
|
14
15
|
truncate?: boolean;
|
|
@@ -29,6 +30,8 @@ export interface TypeTesterBaseProps {
|
|
|
29
30
|
features: ReadonlyArray<string> | null;
|
|
30
31
|
autofit: boolean;
|
|
31
32
|
config?: TypeTesterConfig;
|
|
33
|
+
onFocus?: () => void;
|
|
34
|
+
onBlur?: () => void;
|
|
32
35
|
}
|
|
33
36
|
export interface TypeTesterWrapperProps extends Omit<TypeTesterBaseProps, 'onSelectFontStyleId'> {
|
|
34
37
|
fontStyleId: string | null;
|
|
@@ -51,6 +51,33 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
51
51
|
|
|
52
52
|
function _extends() { _extends = Object.assign || 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); }
|
|
53
53
|
|
|
54
|
+
function useHeightAnimation(isOpen = false, duration = 350) {
|
|
55
|
+
const contentRef = (0, _react.useRef)(null); // Inner wrapper that keeps the height if the outer animated is closed
|
|
56
|
+
|
|
57
|
+
const [height, setHeight] = (0, _react.useState)(isOpen ? 'auto' : 0);
|
|
58
|
+
(0, _react.useEffect)(() => {
|
|
59
|
+
var _contentRef$current;
|
|
60
|
+
|
|
61
|
+
const contentRect = (_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 ? void 0 : _contentRef$current.getBoundingClientRect();
|
|
62
|
+
if (!contentRect) return;
|
|
63
|
+
setHeight("".concat(contentRect.height, "px"));
|
|
64
|
+
const first = setTimeout(() => setHeight(isOpen ? "".concat(contentRect.height, "px") : 0));
|
|
65
|
+
const second = setTimeout(() => {
|
|
66
|
+
if (isOpen) {
|
|
67
|
+
setHeight('auto');
|
|
68
|
+
}
|
|
69
|
+
}, duration);
|
|
70
|
+
return () => {
|
|
71
|
+
clearTimeout(first);
|
|
72
|
+
clearTimeout(second);
|
|
73
|
+
};
|
|
74
|
+
}, [isOpen]);
|
|
75
|
+
return {
|
|
76
|
+
height,
|
|
77
|
+
contentRef
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
54
81
|
// if there's no SKU associated to the font style, it's likely
|
|
55
82
|
// part of a collection which has a SKU. let's find the cheapest
|
|
56
83
|
// collection to use
|
|
@@ -84,10 +111,13 @@ const TypeTesterComponent = ({
|
|
|
84
111
|
onSelectFontStyleId,
|
|
85
112
|
features,
|
|
86
113
|
autofit,
|
|
114
|
+
onFocus,
|
|
115
|
+
onBlur,
|
|
87
116
|
config: propsConfig
|
|
88
117
|
}) => {
|
|
89
|
-
var _config$shy, _config$
|
|
118
|
+
var _config$shy, _config$toolsPosition, _config$min, _config$max, _config$min2, _config$max2, _config$openTypeFeatu, _config$openTypeFeatu2, _config$selectButtonS, _config$priceText;
|
|
90
119
|
|
|
120
|
+
const contentRef = (0, _react.useRef)(null);
|
|
91
121
|
const ref = (0, _react.useRef)(null);
|
|
92
122
|
const [buyButtonIsHovered, setBuyButtonIsHovered] = (0, _react.useState)(false);
|
|
93
123
|
const contextConfig = (0, _react.useContext)(_ConfigContext.default);
|
|
@@ -100,6 +130,10 @@ const TypeTesterComponent = ({
|
|
|
100
130
|
initialSize: size,
|
|
101
131
|
initialLineHeight: lineHeight
|
|
102
132
|
});
|
|
133
|
+
(0, _react.useEffect)(() => {
|
|
134
|
+
if (onFocus && props.focused) onFocus();
|
|
135
|
+
if (onBlur && !props.focused) onBlur();
|
|
136
|
+
}, [props.focused]);
|
|
103
137
|
const selected = (0, _reactRedux.useSelector)(fontStyle && fontStyle.sku ? (0, _utils.isSelected)(fontStyle.sku.id) : () => false);
|
|
104
138
|
const precartOpen = (0, _reactRedux.useSelector)(state => state.precartOpen);
|
|
105
139
|
const sku = getSku(fontStyle);
|
|
@@ -110,6 +144,52 @@ const TypeTesterComponent = ({
|
|
|
110
144
|
shy = 'hover';
|
|
111
145
|
}
|
|
112
146
|
|
|
147
|
+
let toolsPosition = (_config$toolsPosition = config === null || config === void 0 ? void 0 : config.toolsPosition) !== null && _config$toolsPosition !== void 0 ? _config$toolsPosition : 'inline';
|
|
148
|
+
if (shy !== 'focus') toolsPosition = 'inline';
|
|
149
|
+
|
|
150
|
+
const toolsJSX = /*#__PURE__*/_react.default.createElement("div", {
|
|
151
|
+
className: "type-tester__toolbar__tools",
|
|
152
|
+
onMouseDown: e => e.preventDefault()
|
|
153
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
154
|
+
className: "type-tester__slider"
|
|
155
|
+
}, config.textInput && /*#__PURE__*/_react.default.createElement(_TypeTesterInput.default, {
|
|
156
|
+
min: (_config$min = config.min) !== null && _config$min !== void 0 ? _config$min : 10,
|
|
157
|
+
max: (_config$max = config.max) !== null && _config$max !== void 0 ? _config$max : 200,
|
|
158
|
+
value: props.size,
|
|
159
|
+
onChange: props.setSize
|
|
160
|
+
}), /*#__PURE__*/_react.default.createElement(_TypeTesterSlider.default, {
|
|
161
|
+
min: (_config$min2 = config.min) !== null && _config$min2 !== void 0 ? _config$min2 : 10,
|
|
162
|
+
max: (_config$max2 = config.max) !== null && _config$max2 !== void 0 ? _config$max2 : 200,
|
|
163
|
+
value: props.size,
|
|
164
|
+
onChange: props.setSize
|
|
165
|
+
})), Boolean(features === null || features === void 0 ? void 0 : features.length) && /*#__PURE__*/_react.default.createElement(_TypeTesterFeaturesButton.default, props), config.groupEdit && /*#__PURE__*/_react.default.createElement(_TypeTesterEditAll.default, _extends({}, props, {
|
|
166
|
+
config: config
|
|
167
|
+
})));
|
|
168
|
+
|
|
169
|
+
const {
|
|
170
|
+
height: featuresHeight,
|
|
171
|
+
contentRef: featuresContentRef
|
|
172
|
+
} = useHeightAnimation(props.featuresOpen, 300);
|
|
173
|
+
|
|
174
|
+
const featuresJSX = features && Boolean(features === null || features === void 0 ? void 0 : features.length) && /*#__PURE__*/_react.default.createElement("div", {
|
|
175
|
+
className: "type-tester__features-container",
|
|
176
|
+
onMouseDown: e => e.preventDefault(),
|
|
177
|
+
"data-open": props.featuresOpen,
|
|
178
|
+
style: {
|
|
179
|
+
height: featuresHeight,
|
|
180
|
+
overflow: featuresHeight === 'auto' ? 'visible' : 'hidden',
|
|
181
|
+
transition: "height 300ms ease-out"
|
|
182
|
+
}
|
|
183
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
184
|
+
ref: featuresContentRef,
|
|
185
|
+
className: "type-tester__features",
|
|
186
|
+
"data-columns": (_config$openTypeFeatu = config.openTypeFeatures) !== null && _config$openTypeFeatu !== void 0 && (_config$openTypeFeatu2 = _config$openTypeFeatu.columns) !== null && _config$openTypeFeatu2 !== void 0 && _config$openTypeFeatu2.length ? 'set' : 'auto'
|
|
187
|
+
}, /*#__PURE__*/_react.default.createElement(_TypeTesterFeatures.default, _extends({}, props, {
|
|
188
|
+
fontStyle: fontStyle,
|
|
189
|
+
showFeatures: features,
|
|
190
|
+
config: config
|
|
191
|
+
}))));
|
|
192
|
+
|
|
113
193
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, fontStyle.family && fontStyle.family.cssUrl && /*#__PURE__*/_react.default.createElement(_Stylesheet.default, {
|
|
114
194
|
href: fontStyle.family.cssUrl
|
|
115
195
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -124,35 +204,25 @@ const TypeTesterComponent = ({
|
|
|
124
204
|
"data-shy": shy,
|
|
125
205
|
"data-select-button-style": (_config$selectButtonS = config.selectButtonStyle) !== null && _config$selectButtonS !== void 0 ? _config$selectButtonS : 'inline'
|
|
126
206
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
127
|
-
className: "type-tester__toolbar"
|
|
128
|
-
onMouseDown: e => e.preventDefault()
|
|
207
|
+
className: "type-tester__toolbar"
|
|
129
208
|
}, /*#__PURE__*/_react.default.createElement(_TypeTesterStyleSelectData.default, {
|
|
130
209
|
fontStyle: fontStyle,
|
|
131
210
|
viewer: viewer,
|
|
132
|
-
onSelectFontStyleId:
|
|
211
|
+
onSelectFontStyleId: value => {
|
|
212
|
+
var _contentRef$current2;
|
|
213
|
+
|
|
214
|
+
onSelectFontStyleId(value);
|
|
215
|
+
(_contentRef$current2 = contentRef.current) === null || _contentRef$current2 === void 0 ? void 0 : _contentRef$current2.focus();
|
|
216
|
+
},
|
|
133
217
|
config: config
|
|
134
218
|
}), ((_config$priceText = config.priceText) !== null && _config$priceText !== void 0 ? _config$priceText : false) && fontStyle.sku && /*#__PURE__*/_react.default.createElement("div", {
|
|
135
|
-
className: "type-tester__toolbar__price-text"
|
|
219
|
+
className: "type-tester__toolbar__price-text",
|
|
220
|
+
onMouseDown: e => e.preventDefault()
|
|
136
221
|
}, /*#__PURE__*/_react.default.createElement(_SKUPrice.default, {
|
|
137
222
|
sku: fontStyle.sku
|
|
138
|
-
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
139
|
-
className: "type-
|
|
140
|
-
|
|
141
|
-
className: "type-tester__slider"
|
|
142
|
-
}, config.textInput && /*#__PURE__*/_react.default.createElement(_TypeTesterInput.default, {
|
|
143
|
-
min: (_config$min = config.min) !== null && _config$min !== void 0 ? _config$min : 10,
|
|
144
|
-
max: (_config$max = config.max) !== null && _config$max !== void 0 ? _config$max : 200,
|
|
145
|
-
value: props.size,
|
|
146
|
-
onChange: props.setSize
|
|
147
|
-
}), /*#__PURE__*/_react.default.createElement(_TypeTesterSlider.default, {
|
|
148
|
-
min: (_config$min2 = config.min) !== null && _config$min2 !== void 0 ? _config$min2 : 10,
|
|
149
|
-
max: (_config$max2 = config.max) !== null && _config$max2 !== void 0 ? _config$max2 : 200,
|
|
150
|
-
value: props.size,
|
|
151
|
-
onChange: props.setSize
|
|
152
|
-
})), Boolean(features === null || features === void 0 ? void 0 : features.length) && /*#__PURE__*/_react.default.createElement(_TypeTesterFeaturesButton.default, props), config.groupEdit && /*#__PURE__*/_react.default.createElement(_TypeTesterEditAll.default, _extends({}, props, {
|
|
153
|
-
config: config
|
|
154
|
-
}))), config.buyButton && sku && /*#__PURE__*/_react.default.createElement("div", {
|
|
155
|
-
className: "type-tester__select-button-wrapper"
|
|
223
|
+
})), toolsPosition === 'inline' && toolsJSX, config.buyButton && sku && /*#__PURE__*/_react.default.createElement("div", {
|
|
224
|
+
className: "type-tester__select-button-wrapper",
|
|
225
|
+
onMouseDown: e => e.preventDefault()
|
|
156
226
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
157
227
|
className: "type-tester__select-button"
|
|
158
228
|
}, /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_SelectButton.default, {
|
|
@@ -165,15 +235,10 @@ const TypeTesterComponent = ({
|
|
|
165
235
|
className: "type-tester__price"
|
|
166
236
|
}, /*#__PURE__*/_react.default.createElement(_SKUPrice.default, {
|
|
167
237
|
sku: sku
|
|
168
|
-
})))))),
|
|
169
|
-
className: "type-
|
|
170
|
-
onMouseDown: e => e.preventDefault()
|
|
171
|
-
|
|
172
|
-
}, /*#__PURE__*/_react.default.createElement(_TypeTesterFeatures.default, _extends({}, props, {
|
|
173
|
-
fontStyle: fontStyle,
|
|
174
|
-
showFeatures: features,
|
|
175
|
-
config: config
|
|
176
|
-
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
238
|
+
})))))), toolsPosition === 'inline' && featuresJSX, toolsPosition === 'floating' && /*#__PURE__*/_react.default.createElement("div", {
|
|
239
|
+
className: "type-tester__floating-toolbar",
|
|
240
|
+
onMouseDown: e => e.preventDefault()
|
|
241
|
+
}, toolsJSX, featuresJSX), /*#__PURE__*/_react.default.createElement("div", {
|
|
177
242
|
className: "type-tester__text"
|
|
178
243
|
}, /*#__PURE__*/_react.default.createElement(_FontStyle.default, {
|
|
179
244
|
fontStyle: fontStyle,
|
|
@@ -186,6 +251,7 @@ const TypeTesterComponent = ({
|
|
|
186
251
|
var _config$truncate, _config$min3, _config$max3, _config$autofitOnChan;
|
|
187
252
|
|
|
188
253
|
return /*#__PURE__*/_react.default.createElement(_TypeTesterContent.default, _extends({}, props, {
|
|
254
|
+
ref: contentRef,
|
|
189
255
|
fontStyles: style,
|
|
190
256
|
truncate: (_config$truncate = config.truncate) !== null && _config$truncate !== void 0 ? _config$truncate : false,
|
|
191
257
|
direction: direction,
|
|
@@ -7,6 +7,8 @@ interface TypeTestersQueryRendererProps {
|
|
|
7
7
|
precartOpen?: boolean;
|
|
8
8
|
tags?: string[];
|
|
9
9
|
excludeTags?: string[];
|
|
10
|
+
onFocus?: () => void;
|
|
11
|
+
onBlur?: () => void;
|
|
10
12
|
}
|
|
11
13
|
declare const TypeTestersQueryRenderer: React.FC<TypeTestersQueryRendererProps>;
|
|
12
14
|
export default TypeTestersQueryRenderer;
|
|
@@ -67,6 +67,8 @@ const TypeTestersBase = ({
|
|
|
67
67
|
includePriceBar,
|
|
68
68
|
defaultMode,
|
|
69
69
|
autofit,
|
|
70
|
+
onFocus,
|
|
71
|
+
onBlur,
|
|
70
72
|
...rest
|
|
71
73
|
}) => {
|
|
72
74
|
if (!collection) return null;
|
|
@@ -87,7 +89,9 @@ const TypeTestersBase = ({
|
|
|
87
89
|
typeTester: node,
|
|
88
90
|
productId: collection.id,
|
|
89
91
|
features: collection.typeTesterFeatures,
|
|
90
|
-
autofit: autofit
|
|
92
|
+
autofit: autofit,
|
|
93
|
+
onFocus: onFocus,
|
|
94
|
+
onBlur: onBlur
|
|
91
95
|
}))));
|
|
92
96
|
}));
|
|
93
97
|
};
|
|
@@ -108,7 +112,9 @@ const TypeTestersQueryRenderer = ({
|
|
|
108
112
|
defaultMode,
|
|
109
113
|
autofit,
|
|
110
114
|
tags,
|
|
111
|
-
excludeTags
|
|
115
|
+
excludeTags,
|
|
116
|
+
onFocus,
|
|
117
|
+
onBlur
|
|
112
118
|
}) => {
|
|
113
119
|
const environment = (0, _reactRelay.useRelayEnvironment)();
|
|
114
120
|
const precartOpen = (0, _reactRedux.useSelector)(state => state.precartOpen);
|
|
@@ -139,7 +145,9 @@ const TypeTestersQueryRenderer = ({
|
|
|
139
145
|
defaultMode: getDefaultMode(defaultMode, autofit),
|
|
140
146
|
precartOpen: precartOpen,
|
|
141
147
|
includePriceBar: includePriceBar,
|
|
142
|
-
autofit: autofit === 'true'
|
|
148
|
+
autofit: autofit === 'true',
|
|
149
|
+
onFocus: onFocus,
|
|
150
|
+
onBlur: onBlur
|
|
143
151
|
})));
|
|
144
152
|
}
|
|
145
153
|
});
|
|
@@ -170,7 +178,9 @@ const TypeTestersQueryRenderer = ({
|
|
|
170
178
|
defaultMode: getDefaultMode(defaultMode, autofit),
|
|
171
179
|
precartOpen: precartOpen,
|
|
172
180
|
includePriceBar: includePriceBar,
|
|
173
|
-
autofit: autofit === 'true'
|
|
181
|
+
autofit: autofit === 'true',
|
|
182
|
+
onFocus: onFocus,
|
|
183
|
+
onBlur: onBlur
|
|
174
184
|
}));
|
|
175
185
|
}
|
|
176
186
|
});
|
package/fontdue.css
CHANGED
|
@@ -491,7 +491,6 @@ div[data-component=TypeTesters] {
|
|
|
491
491
|
justify-content: space-between;
|
|
492
492
|
flex: 1;
|
|
493
493
|
margin-right: 20px;
|
|
494
|
-
margin-left: 20px;
|
|
495
494
|
}
|
|
496
495
|
.type-tester[data-shy=hover] .type-tester__toolbar__tools, .type-tester[data-shy=focus] .type-tester__toolbar__tools {
|
|
497
496
|
opacity: 0;
|
|
@@ -530,7 +529,6 @@ div[data-component=TypeTesters] {
|
|
|
530
529
|
.type-tester__slider {
|
|
531
530
|
display: flex;
|
|
532
531
|
align-items: center;
|
|
533
|
-
margin-right: 20px;
|
|
534
532
|
flex: 1;
|
|
535
533
|
max-width: 400px;
|
|
536
534
|
}
|
|
@@ -542,7 +540,6 @@ div[data-component=TypeTesters] {
|
|
|
542
540
|
.type-tester__slider__track {
|
|
543
541
|
width: 100%;
|
|
544
542
|
min-width: 100px;
|
|
545
|
-
margin: 0 20px;
|
|
546
543
|
background-color: currentcolor;
|
|
547
544
|
height: 1px;
|
|
548
545
|
position: relative;
|
|
@@ -613,7 +610,7 @@ div[data-component=TypeTesters] {
|
|
|
613
610
|
.type-tester__features {
|
|
614
611
|
position: relative;
|
|
615
612
|
z-index: 1;
|
|
616
|
-
|
|
613
|
+
padding-bottom: 10px;
|
|
617
614
|
}
|
|
618
615
|
.type-tester__features[data-columns=auto] {
|
|
619
616
|
columns: 4;
|
|
@@ -643,6 +640,31 @@ div[data-component=TypeTesters] {
|
|
|
643
640
|
.type-tester__features__button:not(:disabled) {
|
|
644
641
|
cursor: pointer;
|
|
645
642
|
}
|
|
643
|
+
.type-tester__floating-toolbar {
|
|
644
|
+
position: fixed;
|
|
645
|
+
z-index: 1;
|
|
646
|
+
left: 0;
|
|
647
|
+
bottom: 0;
|
|
648
|
+
width: 100%;
|
|
649
|
+
background: var(--primary_background_color);
|
|
650
|
+
color: var(--primary_text_color);
|
|
651
|
+
padding: 30px;
|
|
652
|
+
border-top: 1px solid var(--horizontal_rule_color);
|
|
653
|
+
transform: translateY(100%);
|
|
654
|
+
transition: transform 300ms ease-out;
|
|
655
|
+
}
|
|
656
|
+
@media (max-width: 899px) {
|
|
657
|
+
.type-tester__floating-toolbar {
|
|
658
|
+
display: none;
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
.type-tester[data-focused=true] .type-tester__floating-toolbar {
|
|
662
|
+
transform: translateY(0);
|
|
663
|
+
z-index: 3;
|
|
664
|
+
}
|
|
665
|
+
.type-tester__floating-toolbar .type-tester__features {
|
|
666
|
+
padding-top: 20px;
|
|
667
|
+
}
|
|
646
668
|
.type-tester__text {
|
|
647
669
|
position: relative;
|
|
648
670
|
z-index: 0;
|