fontdue-js 2.4.0 → 2.5.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.
- package/CHANGELOG.md +19 -0
- package/dist/__generated__/FamilyList_node.graphql.d.ts +8 -1
- package/dist/__generated__/FamilyList_node.graphql.js +32 -2
- package/dist/__generated__/Family_node.graphql.d.ts +10 -1
- package/dist/__generated__/Family_node.graphql.js +46 -10
- package/dist/__generated__/FontFamiliesQuery.graphql.d.ts +1 -1
- package/dist/__generated__/FontFamiliesQuery.graphql.js +95 -35
- package/dist/__generated__/License_node.graphql.d.ts +2 -1
- package/dist/__generated__/License_node.graphql.js +13 -3
- package/dist/__generated__/PrecartQuery.graphql.d.ts +1 -1
- package/dist/__generated__/PrecartQuery.graphql.js +14 -4
- package/dist/__generated__/StoreModalContainerQuery.graphql.d.ts +15 -3
- package/dist/__generated__/StoreModalContainerQuery.graphql.js +98 -23
- package/dist/__generated__/StoreModalProductLicense_license.graphql.d.ts +2 -1
- package/dist/__generated__/StoreModalProductLicense_license.graphql.js +12 -2
- package/dist/__generated__/StoreModalProductQuery.graphql.d.ts +1 -1
- package/dist/__generated__/StoreModalProductQuery.graphql.js +13 -3
- package/dist/components/Family/FamilyList.js +27 -7
- package/dist/components/Family/index.js +18 -3
- package/dist/components/NewsletterSignup/index.d.ts +2 -4
- package/dist/components/NewsletterSignup/index.js +4 -3
- package/dist/components/NewsletterSignup/index.server.js +2 -2
- package/dist/components/Precart/License.js +9 -2
- package/dist/components/Precart/index.js +2 -2
- package/dist/components/SKUPrice/index.js +4 -1
- package/dist/components/StoreModal/StoreModalContainer.js +17 -3
- package/dist/components/StoreModal/StoreModalFamily.d.ts +2 -1
- package/dist/components/StoreModal/StoreModalFamily.js +3 -1
- package/dist/components/StoreModal/StoreModalProduct.js +1 -0
- package/dist/components/StoreModalProductLicenseSelection/LicenseElement.d.ts +1 -0
- package/dist/components/StoreModalProductLicenseSelection/LicenseElement.js +10 -2
- package/dist/components/StoreModalProductLicenseSelection/StoreModalProductLicense.js +2 -1
- package/dist/components/StoreModalProductSummary/index.js +1 -1
- package/dist/components/TypeTester/TypeTesterStyleSelectData.js +3 -2
- package/dist/components/elements/StoreModalContainer/index.d.ts +8 -2
- package/dist/components/elements/StoreModalContainer/index.js +9 -6
- package/dist/components/elements/StoreModalFamily/index.d.ts +1 -0
- package/dist/components/elements/StoreModalFamily/index.js +5 -2
- package/dist/fontdue.css +20 -3
- package/package.json +1 -1
|
@@ -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,4 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
interface FontData {
|
|
3
|
+
name: string;
|
|
4
|
+
cssUrl: string | null;
|
|
5
|
+
}
|
|
2
6
|
interface StoreModalContainerProps {
|
|
3
7
|
onClickBackground?: () => void;
|
|
4
8
|
onClickClose?: () => void;
|
|
@@ -6,8 +10,10 @@ interface StoreModalContainerProps {
|
|
|
6
10
|
onClickCart?: () => void;
|
|
7
11
|
showCartButton?: boolean;
|
|
8
12
|
orderItemCount: number;
|
|
9
|
-
|
|
10
|
-
|
|
13
|
+
fonts: {
|
|
14
|
+
regular: FontData | null;
|
|
15
|
+
bold: FontData | null;
|
|
16
|
+
};
|
|
11
17
|
children: {
|
|
12
18
|
backText?: React.ReactNode;
|
|
13
19
|
pageTitle: React.ReactNode;
|
|
@@ -8,6 +8,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
8
8
|
var _Icons = require("../../Icons");
|
|
9
9
|
var _StoreModalContainerContext = _interopRequireDefault(require("./StoreModalContainerContext"));
|
|
10
10
|
var _Stylesheet = _interopRequireDefault(require("../../Stylesheet"));
|
|
11
|
+
var _utils = require("../../../utils");
|
|
11
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
13
|
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); }
|
|
13
14
|
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,8 +20,7 @@ const StoreModalContainer = _ref => {
|
|
|
19
20
|
onClickCart,
|
|
20
21
|
showCartButton,
|
|
21
22
|
orderItemCount,
|
|
22
|
-
|
|
23
|
-
uiFontName,
|
|
23
|
+
fonts,
|
|
24
24
|
children: {
|
|
25
25
|
backText,
|
|
26
26
|
pageTitle,
|
|
@@ -41,16 +41,19 @@ const StoreModalContainer = _ref => {
|
|
|
41
41
|
}
|
|
42
42
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
43
43
|
className: "store-modal__container__overlay"
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
}, [fonts.regular, fonts.bold].filter(_utils.notEmpty).map(font => /*#__PURE__*/_react.default.createElement(_Stylesheet.default, {
|
|
45
|
+
key: font.name,
|
|
46
|
+
href: font.cssUrl
|
|
47
|
+
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
47
48
|
className: "store-modal__container__background",
|
|
48
49
|
onClick: onClickBackground
|
|
49
50
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
50
51
|
className: "store-modal__container__container",
|
|
51
52
|
ref: container,
|
|
52
53
|
style: {
|
|
53
|
-
|
|
54
|
+
'--font-family': fonts.regular ? `"${fonts.regular.name}"` : undefined,
|
|
55
|
+
'--font-family__bold': fonts.bold ? `"${fonts.bold.name}"` : undefined,
|
|
56
|
+
fontFamily: 'var(--font-family, inherit)'
|
|
54
57
|
}
|
|
55
58
|
}, /*#__PURE__*/_react.default.createElement("nav", {
|
|
56
59
|
className: "store-modal__container__nav",
|
|
@@ -12,12 +12,15 @@ const StoreModalFamily = _ref => {
|
|
|
12
12
|
stylesheet,
|
|
13
13
|
bundles,
|
|
14
14
|
familyButton,
|
|
15
|
-
styleGroups
|
|
15
|
+
styleGroups,
|
|
16
|
+
title
|
|
16
17
|
}
|
|
17
18
|
} = _ref;
|
|
18
19
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
19
20
|
className: "store-modal__family__container"
|
|
20
|
-
}, stylesheet, /*#__PURE__*/_react.default.
|
|
21
|
+
}, stylesheet, title && /*#__PURE__*/_react.default.createElement("h3", {
|
|
22
|
+
className: "store-modal__family__title"
|
|
23
|
+
}, title), /*#__PURE__*/_react.default.cloneElement(familyButton, {
|
|
21
24
|
className: 'store-modal__family__family-button'
|
|
22
25
|
}), bundles === null || bundles === void 0 ? void 0 : bundles.map(bundle => /*#__PURE__*/_react.default.cloneElement(bundle, {
|
|
23
26
|
className: 'store-modal__family__bundle-button'
|
package/dist/fontdue.css
CHANGED
|
@@ -1205,6 +1205,10 @@ body[data-fontdue-store-modal=open] {
|
|
|
1205
1205
|
text-align: center;
|
|
1206
1206
|
}
|
|
1207
1207
|
|
|
1208
|
+
.store-modal__container__title {
|
|
1209
|
+
font-family: var(--font-family__bold, inherit);
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1208
1212
|
.store-modal__container__buttons {
|
|
1209
1213
|
text-align: right;
|
|
1210
1214
|
}
|
|
@@ -1330,6 +1334,11 @@ body[data-fontdue-store-modal=open] {
|
|
|
1330
1334
|
margin-bottom: 40px;
|
|
1331
1335
|
}
|
|
1332
1336
|
|
|
1337
|
+
.store-modal__family__title {
|
|
1338
|
+
font-family: var(--font-family__bold, inherit);
|
|
1339
|
+
margin-bottom: 20px;
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1333
1342
|
.store-modal__family__group {
|
|
1334
1343
|
display: grid;
|
|
1335
1344
|
grid-template-columns: 1fr;
|
|
@@ -1510,6 +1519,11 @@ body[data-fontdue-store-modal=open] {
|
|
|
1510
1519
|
}
|
|
1511
1520
|
|
|
1512
1521
|
.store-modal__license-selection__title {
|
|
1522
|
+
font-family: var(--font-family__bold, inherit);
|
|
1523
|
+
margin-bottom: 20px;
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1526
|
+
.store-modal__license-selection__license {
|
|
1513
1527
|
margin-bottom: 20px;
|
|
1514
1528
|
}
|
|
1515
1529
|
|
|
@@ -1532,7 +1546,6 @@ body[data-fontdue-store-modal=open] {
|
|
|
1532
1546
|
box-sizing: border-box;
|
|
1533
1547
|
display: block;
|
|
1534
1548
|
width: 100%;
|
|
1535
|
-
margin-bottom: 20px;
|
|
1536
1549
|
display: flex;
|
|
1537
1550
|
align-items: stretch;
|
|
1538
1551
|
}
|
|
@@ -1566,6 +1579,10 @@ body[data-fontdue-store-modal=open] {
|
|
|
1566
1579
|
margin-right: 8px;
|
|
1567
1580
|
}
|
|
1568
1581
|
|
|
1582
|
+
.store-modal__license-selection__license-button + .store-modal__license-selection__description {
|
|
1583
|
+
margin-top: 10px;
|
|
1584
|
+
}
|
|
1585
|
+
|
|
1569
1586
|
.store-modal__license-selection__license-button-label {
|
|
1570
1587
|
flex: 2 0 40%;
|
|
1571
1588
|
align-items: flex-start;
|
|
@@ -2387,8 +2404,8 @@ body[data-fontdue-store-modal=open] {
|
|
|
2387
2404
|
padding-bottom: 50px;
|
|
2388
2405
|
}
|
|
2389
2406
|
.checkout-modal__customer-info-message {
|
|
2390
|
-
font-
|
|
2391
|
-
margin-bottom:
|
|
2407
|
+
font-family: var(--font-family__bold, inherit);
|
|
2408
|
+
margin-bottom: 20px;
|
|
2392
2409
|
}
|
|
2393
2410
|
.checkout-modal__customer-info-message .icon {
|
|
2394
2411
|
display: none;
|