fontdue-js 0.1.0 → 0.1.3
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__/TypeTesterStandalone_StyleQuery.graphql.d.ts +6 -0
- package/dist/__generated__/TypeTesterStandalone_StyleQuery.graphql.js +32 -4
- package/dist/__generated__/TypeTestersIDQuery.graphql.js +103 -57
- package/dist/__generated__/TypeTestersSlugQuery.graphql.js +103 -57
- package/dist/__generated__/TypeTesters_collection.graphql.d.ts +3 -0
- package/dist/__generated__/TypeTesters_collection.graphql.js +20 -6
- package/dist/components/AddToCartBanner/index.js +6 -4
- package/dist/components/BuyButton/index.js +21 -17
- package/dist/components/BuyingOptions/index.js +10 -7
- package/dist/components/Cart/AddressFields.js +10 -7
- package/dist/components/Cart/CartItem/index.js +71 -53
- package/dist/components/Cart/CartOrder.js +18 -14
- package/dist/components/Cart/CartState.js +16 -13
- package/dist/components/Cart/CartTotals.js +65 -59
- package/dist/components/Cart/Checkout.js +30 -23
- package/dist/components/Cart/CustomerFields.d.ts +14 -0
- package/dist/components/Cart/CustomerFields.js +11 -11
- package/dist/components/Cart/Download.js +11 -9
- package/dist/components/Cart/EmptyCart.js +5 -4
- package/dist/components/Cart/IdentityBox.js +27 -24
- package/dist/components/Cart/index.js +23 -17
- package/dist/components/CartButton/index.js +12 -9
- package/dist/components/CharacterViewer/index.js +65 -54
- package/dist/components/Checkbox/index.js +4 -5
- package/dist/components/CollectionAa/index.js +15 -11
- package/dist/components/ConfigContext.d.ts +78 -1
- package/dist/components/ConfigContext.js +52 -2
- package/dist/components/CookieNotification/index.js +46 -38
- package/dist/components/CouponText/index.js +6 -4
- package/dist/components/Family/FamilyList.js +23 -20
- package/dist/components/Family/index.js +11 -8
- package/dist/components/FontFamilies/index.js +15 -12
- package/dist/components/FontStyle/index.js +10 -9
- package/dist/components/FontdueProvider/index.js +9 -8
- package/dist/components/NewsletterSignup/index.js +12 -10
- package/dist/components/Precart/License.js +8 -7
- package/dist/components/Precart/index.js +16 -11
- package/dist/components/Price/index.js +34 -27
- package/dist/components/PriceBar/PriceBarSection.js +14 -11
- package/dist/components/PriceBar/index.js +2 -2
- package/dist/components/Root/index.js +4 -1
- package/dist/components/Root/productState.js +3 -2
- package/dist/components/SKUPrice/index.js +7 -6
- package/dist/components/Select/index.js +22 -15
- package/dist/components/SelectButton/index.js +16 -16
- package/dist/components/SelectField/index.js +27 -24
- package/dist/components/SpecimenLink/index.js +14 -11
- package/dist/components/StickyNav/index.js +16 -13
- package/dist/components/StoreModal/StoreModalBundleButton.js +7 -6
- package/dist/components/StoreModal/StoreModalCart.js +10 -8
- package/dist/components/StoreModal/StoreModalCheckout.js +5 -4
- package/dist/components/StoreModal/StoreModalContainer.js +4 -3
- package/dist/components/StoreModal/StoreModalDownload.js +5 -4
- package/dist/components/StoreModal/StoreModalFamily.js +5 -4
- package/dist/components/StoreModal/StoreModalFamilyButton.js +7 -6
- package/dist/components/StoreModal/StoreModalIndex.js +11 -9
- package/dist/components/StoreModal/StoreModalLoader.js +4 -3
- package/dist/components/StoreModal/StoreModalProduct.js +4 -3
- package/dist/components/StoreModal/StoreModalReview.js +11 -9
- package/dist/components/StoreModal/StoreModalReviewIdentity.js +6 -3
- package/dist/components/StoreModal/StoreModalStyleButton.js +7 -6
- package/dist/components/StoreModalProductLicenseSelection/ContainerElement.js +15 -12
- package/dist/components/StoreModalProductLicenseSelection/LicenseElement.js +13 -13
- package/dist/components/StoreModalProductLicenseSelection/LicenseVariableElement.js +31 -25
- package/dist/components/StoreModalProductLicenseSelection/LicenseVariableRadioElement.js +13 -10
- package/dist/components/StoreModalProductLicenseSelection/StoreModalProductLicense.js +22 -13
- package/dist/components/StoreModalProductLicenseSelection/index.js +12 -9
- package/dist/components/StoreModalProductSummary/index.js +10 -8
- package/dist/components/StripeProvider/index.js +5 -4
- package/dist/components/Stylesheet/index.js +4 -3
- package/dist/components/TestFontsForm/index.js +32 -25
- package/dist/components/TestModeBanner/index.js +9 -7
- package/dist/components/TextField/index.js +32 -29
- package/dist/components/ThemeConfig/index.js +9 -7
- package/dist/components/TypeTester/TypeTesterAlignButtons.js +5 -4
- package/dist/components/TypeTester/TypeTesterBullet.js +5 -4
- package/dist/components/TypeTester/TypeTesterContent.js +9 -8
- package/dist/components/TypeTester/TypeTesterContext.js +6 -5
- package/dist/components/TypeTester/TypeTesterEditAll.d.ts +0 -2
- package/dist/components/TypeTester/TypeTesterEditAll.js +6 -3
- package/dist/components/TypeTester/TypeTesterFeatures.d.ts +0 -2
- package/dist/components/TypeTester/TypeTesterFeatures.js +25 -14
- package/dist/components/TypeTester/TypeTesterFeaturesButton.js +18 -15
- package/dist/components/TypeTester/TypeTesterFitter.js +5 -4
- package/dist/components/TypeTester/TypeTesterFloatingToolbar.js +10 -11
- package/dist/components/TypeTester/TypeTesterInput.js +7 -6
- package/dist/components/TypeTester/TypeTesterSlider.js +15 -11
- package/dist/components/TypeTester/TypeTesterStandalone.js +21 -19
- package/dist/components/TypeTester/TypeTesterState.js +5 -6
- package/dist/components/TypeTester/TypeTesterStyleSelect.js +39 -28
- package/dist/components/TypeTester/TypeTesterStyleSelectData.js +7 -6
- package/dist/components/TypeTester/TypeTesterToolbar.d.ts +0 -2
- package/dist/components/TypeTester/TypeTesterToolbar.js +18 -15
- package/dist/components/TypeTester/index.d.ts +2 -1
- package/dist/components/TypeTester/index.js +48 -55
- package/dist/components/TypeTester/useTypeTesterStyler.js +21 -19
- package/dist/components/TypeTesters/index.js +48 -45
- package/dist/components/VariableTableAmounts/index.js +5 -4
- package/dist/components/elements/Button/index.js +11 -8
- package/dist/components/elements/StoreModalCartLayout/index.js +29 -26
- package/dist/components/elements/StoreModalContainer/index.js +14 -13
- package/dist/components/elements/StoreModalDownloadLayout/index.js +17 -14
- package/dist/components/elements/StoreModalFamily/index.js +22 -19
- package/dist/components/elements/StoreModalFamilyButton/index.js +12 -11
- package/dist/components/elements/StoreModalIndexItem/index.js +9 -8
- package/dist/components/elements/StoreModalPageContainer/index.js +18 -15
- package/dist/components/elements/StoreModalReviewConfirm/index.js +13 -13
- package/dist/components/elements/StoreModalReviewItem/index.js +11 -8
- package/dist/components/elements/StoreModalReviewLayout/index.js +50 -47
- package/dist/components/elements/StoreModalStyleButton/index.js +10 -9
- package/dist/components/useFontStyle.js +6 -5
- package/dist/utils.js +3 -2
- package/dist/vanilla/FontStyle.js +10 -8
- package/fontdue.css +10 -0
- package/fontdue.css.map +1 -1
- package/package.json +1 -1
|
@@ -67,20 +67,19 @@ const getSku = fontStyle => {
|
|
|
67
67
|
}, null);
|
|
68
68
|
};
|
|
69
69
|
|
|
70
|
-
const TypeTesterComponent =
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
70
|
+
const TypeTesterComponent = _ref => {
|
|
71
|
+
let {
|
|
72
|
+
id,
|
|
73
|
+
productId,
|
|
74
|
+
direction,
|
|
75
|
+
fontStyle,
|
|
76
|
+
viewer,
|
|
77
|
+
onSelectFontStyleId,
|
|
78
|
+
onFocus,
|
|
79
|
+
onBlur,
|
|
80
|
+
features,
|
|
81
|
+
config: propsConfig
|
|
82
|
+
} = _ref;
|
|
84
83
|
const contentRef = (0, _react.useRef)(null);
|
|
85
84
|
const ref = (0, _react.useRef)(null);
|
|
86
85
|
const [buyButtonIsHovered, setBuyButtonIsHovered] = (0, _react.useState)(false);
|
|
@@ -99,14 +98,6 @@ const TypeTesterComponent = ({
|
|
|
99
98
|
const precartOpen = (0, _reactRedux.useSelector)(state => state.precartOpen);
|
|
100
99
|
const sku = getSku(fontStyle);
|
|
101
100
|
if (!fontStyle) return null;
|
|
102
|
-
let shy = (_config$shy = config.shy) !== null && _config$shy !== void 0 ? _config$shy : false;
|
|
103
|
-
|
|
104
|
-
if (config.shy === true) {
|
|
105
|
-
shy = 'hover';
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
let toolsPosition = (_config$toolsPosition = config === null || config === void 0 ? void 0 : config.toolsPosition) !== null && _config$toolsPosition !== void 0 ? _config$toolsPosition : 'inline';
|
|
109
|
-
if (shy !== 'focus') toolsPosition = 'inline';
|
|
110
101
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, fontStyle.family && fontStyle.family.cssUrl && /*#__PURE__*/_react.default.createElement(_Stylesheet.default, {
|
|
111
102
|
href: fontStyle.family.cssUrl
|
|
112
103
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -119,8 +110,8 @@ const TypeTesterComponent = ({
|
|
|
119
110
|
"data-large-font-size": props.size > 72,
|
|
120
111
|
"data-direction": direction,
|
|
121
112
|
"data-autofit": props.autofit,
|
|
122
|
-
"data-shy": shy,
|
|
123
|
-
"data-select-button-style":
|
|
113
|
+
"data-shy": config.shy,
|
|
114
|
+
"data-select-button-style": config.selectButtonStyle,
|
|
124
115
|
"data-alignment": props.alignment
|
|
125
116
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
126
117
|
className: "type-tester__toolbar"
|
|
@@ -134,16 +125,15 @@ const TypeTesterComponent = ({
|
|
|
134
125
|
(_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 ? void 0 : _contentRef$current.focus();
|
|
135
126
|
},
|
|
136
127
|
config: config
|
|
137
|
-
}),
|
|
128
|
+
}), config.priceText && fontStyle.sku && /*#__PURE__*/_react.default.createElement("div", {
|
|
138
129
|
className: "type-tester__toolbar__price-text",
|
|
139
130
|
onMouseDown: e => e.preventDefault()
|
|
140
131
|
}, /*#__PURE__*/_react.default.createElement(_SKUPrice.default, {
|
|
141
132
|
sku: fontStyle.sku
|
|
142
|
-
})), toolsPosition === 'inline' && /*#__PURE__*/_react.default.createElement(_TypeTesterToolbar.default, {
|
|
133
|
+
})), config.toolsPosition === 'inline' && /*#__PURE__*/_react.default.createElement(_TypeTesterToolbar.default, {
|
|
143
134
|
id: id,
|
|
144
|
-
features: features
|
|
145
|
-
|
|
146
|
-
}), config.buyButton && sku && /*#__PURE__*/_react.default.createElement("div", {
|
|
135
|
+
features: features
|
|
136
|
+
}), config.selectButton && sku && productId && /*#__PURE__*/_react.default.createElement("div", {
|
|
147
137
|
className: "type-tester__select-button-wrapper",
|
|
148
138
|
onMouseDown: e => e.preventDefault()
|
|
149
139
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -158,31 +148,30 @@ const TypeTesterComponent = ({
|
|
|
158
148
|
className: "type-tester__price"
|
|
159
149
|
}, /*#__PURE__*/_react.default.createElement(_SKUPrice.default, {
|
|
160
150
|
sku: sku
|
|
161
|
-
})))))), toolsPosition === 'inline' && features && /*#__PURE__*/_react.default.createElement(_TypeTesterFeatures.default, {
|
|
151
|
+
})))))), config.toolsPosition === 'inline' && features && /*#__PURE__*/_react.default.createElement(_TypeTesterFeatures.default, {
|
|
162
152
|
id: id,
|
|
163
153
|
fontStyle: fontStyle,
|
|
164
|
-
features: features
|
|
165
|
-
config: config
|
|
154
|
+
features: features
|
|
166
155
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
167
156
|
className: "type-tester__text"
|
|
168
157
|
}, /*#__PURE__*/_react.default.createElement(_FontStyle.default, {
|
|
169
158
|
fontStyle: fontStyle,
|
|
170
159
|
className: "type-tester__text__font-style"
|
|
171
|
-
},
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
var _config$truncate, _config$min, _config$max, _config$autofitOnChan;
|
|
160
|
+
}, _ref2 => {
|
|
161
|
+
let {
|
|
162
|
+
loaded,
|
|
163
|
+
style
|
|
164
|
+
} = _ref2;
|
|
177
165
|
|
|
166
|
+
if (loaded) {
|
|
178
167
|
return /*#__PURE__*/_react.default.createElement(_TypeTesterContent.default, _extends({}, props, {
|
|
179
168
|
ref: contentRef,
|
|
180
169
|
fontStyles: style,
|
|
181
|
-
truncate:
|
|
170
|
+
truncate: config.truncate,
|
|
182
171
|
direction: direction,
|
|
183
|
-
min:
|
|
184
|
-
max:
|
|
185
|
-
autofitOnChange:
|
|
172
|
+
min: config.min,
|
|
173
|
+
max: config.max,
|
|
174
|
+
autofitOnChange: config.autofitOnChange
|
|
186
175
|
}));
|
|
187
176
|
}
|
|
188
177
|
|
|
@@ -202,10 +191,11 @@ const TypeTester = (0, _reactRelay.createFragmentContainer)(TypeTesterComponent,
|
|
|
202
191
|
viewer: _TypeTester_viewer !== void 0 ? _TypeTester_viewer : (_TypeTester_viewer = require("../../__generated__/TypeTester_viewer.graphql"), _TypeTester_viewer.hash && _TypeTester_viewer.hash !== "a12af7126d512a50ab0b7e5e14a7d8eb" && console.error("The definition of 'TypeTester_viewer' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _TypeTester_viewer)
|
|
203
192
|
});
|
|
204
193
|
|
|
205
|
-
const TypeTesterWrapper =
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
194
|
+
const TypeTesterWrapper = _ref3 => {
|
|
195
|
+
let {
|
|
196
|
+
fontStyleId,
|
|
197
|
+
...rest
|
|
198
|
+
} = _ref3;
|
|
209
199
|
const [selectedFontStyleId, setSelectedFontStyleId] = (0, _react.useState)(fontStyleId);
|
|
210
200
|
const environment = (0, _reactRelay.useRelayEnvironment)();
|
|
211
201
|
if (!selectedFontStyleId) return null; // TODO: do we need an extra QueryRenderer here?
|
|
@@ -223,15 +213,18 @@ const TypeTesterWrapper = ({
|
|
|
223
213
|
variables: {
|
|
224
214
|
id: selectedFontStyleId
|
|
225
215
|
},
|
|
226
|
-
render:
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
216
|
+
render: _ref4 => {
|
|
217
|
+
let {
|
|
218
|
+
props
|
|
219
|
+
} = _ref4;
|
|
220
|
+
return /*#__PURE__*/_react.default.createElement(_reactStaticContainer.default, {
|
|
221
|
+
shouldUpdate: props
|
|
222
|
+
}, props && /*#__PURE__*/_react.default.createElement(TypeTester, _extends({
|
|
223
|
+
fontStyle: props.fontStyle,
|
|
224
|
+
viewer: props.viewer,
|
|
225
|
+
onSelectFontStyleId: setSelectedFontStyleId
|
|
226
|
+
}, rest)));
|
|
227
|
+
}
|
|
235
228
|
});
|
|
236
229
|
};
|
|
237
230
|
|
|
@@ -11,9 +11,10 @@ var _throttled = require("@react-hook/window-size/throttled");
|
|
|
11
11
|
|
|
12
12
|
var _reactDeviceDetect = require("react-device-detect");
|
|
13
13
|
|
|
14
|
-
const createClone =
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
const createClone = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
fontStyles
|
|
17
|
+
} = _ref;
|
|
17
18
|
const clone = document.createElement('div');
|
|
18
19
|
clone.style.display = 'inline-block';
|
|
19
20
|
clone.style.whiteSpace = 'pre';
|
|
@@ -29,22 +30,23 @@ const createClone = ({
|
|
|
29
30
|
return clone;
|
|
30
31
|
};
|
|
31
32
|
|
|
32
|
-
const useTypeTesterStyler =
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
33
|
+
const useTypeTesterStyler = _ref2 => {
|
|
34
|
+
let {
|
|
35
|
+
size,
|
|
36
|
+
autofit,
|
|
37
|
+
autofitOnChange,
|
|
38
|
+
features,
|
|
39
|
+
setSize,
|
|
40
|
+
min,
|
|
41
|
+
max,
|
|
42
|
+
truncate,
|
|
43
|
+
focused,
|
|
44
|
+
lineHeight,
|
|
45
|
+
fontStyles,
|
|
46
|
+
content,
|
|
47
|
+
contentEdited,
|
|
48
|
+
alignment
|
|
49
|
+
} = _ref2;
|
|
48
50
|
const ref = (0, _react.useRef)(null);
|
|
49
51
|
const clone = (0, _react.useRef)(createClone({
|
|
50
52
|
fontStyles
|
|
@@ -67,32 +67,32 @@ const getTypeTesterGroups = collection => {
|
|
|
67
67
|
}, []);
|
|
68
68
|
};
|
|
69
69
|
|
|
70
|
-
const TypeTestersBase =
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
70
|
+
const TypeTestersBase = _ref => {
|
|
71
|
+
var _collection$typeTeste3, _collection$typeTeste4, _collection$typeTeste5, _collection$typeTeste6, _collection$typeTeste7;
|
|
72
|
+
|
|
73
|
+
let {
|
|
74
|
+
collection,
|
|
75
|
+
precartOpen,
|
|
76
|
+
includePriceBar,
|
|
77
|
+
defaultMode,
|
|
78
|
+
autofit,
|
|
79
|
+
onFocus,
|
|
80
|
+
onBlur,
|
|
81
|
+
onToolbarOpenClose,
|
|
82
|
+
...rest
|
|
83
|
+
} = _ref;
|
|
84
|
+
const {
|
|
85
|
+
typeTester: config
|
|
86
|
+
} = (0, _react.useContext)(_ConfigContext.default);
|
|
85
87
|
if (!collection) return null;
|
|
86
88
|
const testers = (_collection$typeTeste3 = collection.typeTesters) === null || _collection$typeTeste3 === void 0 ? void 0 : (_collection$typeTeste4 = _collection$typeTeste3.edges) === null || _collection$typeTeste4 === void 0 ? void 0 : _collection$typeTeste4.reduce((acc, edge) => {
|
|
87
|
-
var _config$typeTester$in, _config$typeTester2;
|
|
88
|
-
|
|
89
89
|
const node = edge.node;
|
|
90
90
|
acc[node.id] = {
|
|
91
91
|
content: node.content,
|
|
92
92
|
size: node.size ? parseFloat(node.size) : 72,
|
|
93
93
|
lineHeight: node.lineHeight ? parseFloat(node.lineHeight) : 1,
|
|
94
94
|
autofit,
|
|
95
|
-
alignment:
|
|
95
|
+
alignment: config.initialAlignment
|
|
96
96
|
};
|
|
97
97
|
return acc;
|
|
98
98
|
}, {});
|
|
@@ -100,16 +100,18 @@ const TypeTestersBase = ({
|
|
|
100
100
|
return /*#__PURE__*/_react.default.createElement(_TypeTesterContext.default, {
|
|
101
101
|
defaultMode: defaultMode,
|
|
102
102
|
testers: testers
|
|
103
|
-
}, toolsPosition === 'floating' && /*#__PURE__*/_react.default.createElement(_TypeTesterFloatingToolbar.default, {
|
|
103
|
+
}, config.toolsPosition === 'floating' && /*#__PURE__*/_react.default.createElement(_TypeTesterFloatingToolbar.default, {
|
|
104
104
|
testers: (_collection$typeTeste5 = (_collection$typeTeste6 = collection.typeTesters) === null || _collection$typeTeste6 === void 0 ? void 0 : (_collection$typeTeste7 = _collection$typeTeste6.edges) === null || _collection$typeTeste7 === void 0 ? void 0 : _collection$typeTeste7.map(edge => edge.node)) !== null && _collection$typeTeste5 !== void 0 ? _collection$typeTeste5 : [],
|
|
105
105
|
features: collection.typeTesterFeatures,
|
|
106
106
|
onToolbarOpenClose: onToolbarOpenClose
|
|
107
107
|
}), getTypeTesterGroups(collection).map((typeTesterGroup, i) => {
|
|
108
|
-
var _anyTypeTester$fontSt, _anyTypeTester$fontSt2;
|
|
108
|
+
var _anyTypeTester$fontSt, _anyTypeTester$fontSt2, _collection$parent$id, _collection$parent;
|
|
109
109
|
|
|
110
110
|
if (typeTesterGroup.length === 0) return null;
|
|
111
111
|
const anyTypeTester = typeTesterGroup[0];
|
|
112
|
-
const currentFamilyId = (_anyTypeTester$fontSt = anyTypeTester.fontStyle) === null || _anyTypeTester$fontSt === void 0 ? void 0 : (_anyTypeTester$fontSt2 = _anyTypeTester$fontSt.family) === null || _anyTypeTester$fontSt2 === void 0 ? void 0 : _anyTypeTester$fontSt2.id;
|
|
112
|
+
const currentFamilyId = (_anyTypeTester$fontSt = anyTypeTester.fontStyle) === null || _anyTypeTester$fontSt === void 0 ? void 0 : (_anyTypeTester$fontSt2 = _anyTypeTester$fontSt.family) === null || _anyTypeTester$fontSt2 === void 0 ? void 0 : _anyTypeTester$fontSt2.id; // when clicking Select/Buy, open modal in relevant superfamily/family
|
|
113
|
+
|
|
114
|
+
const productId = (_collection$parent$id = (_collection$parent = collection.parent) === null || _collection$parent === void 0 ? void 0 : _collection$parent.id) !== null && _collection$parent$id !== void 0 ? _collection$parent$id : collection.id;
|
|
113
115
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
114
116
|
key: i
|
|
115
117
|
}, includePriceBar && precartOpen && currentFamilyId && /*#__PURE__*/_react.default.createElement(_PriceBar.default, {
|
|
@@ -122,7 +124,7 @@ const TypeTestersBase = ({
|
|
|
122
124
|
fontStyleId: (_node$fontStyle$id = (_node$fontStyle = node.fontStyle) === null || _node$fontStyle === void 0 ? void 0 : _node$fontStyle.id) !== null && _node$fontStyle$id !== void 0 ? _node$fontStyle$id : null,
|
|
123
125
|
direction: node.direction === 'rtl' ? 'rtl' : 'ltr',
|
|
124
126
|
key: j,
|
|
125
|
-
productId:
|
|
127
|
+
productId: productId,
|
|
126
128
|
onFocus: onFocus,
|
|
127
129
|
onBlur: onBlur,
|
|
128
130
|
features: collection.typeTesterFeatures
|
|
@@ -132,7 +134,7 @@ const TypeTestersBase = ({
|
|
|
132
134
|
};
|
|
133
135
|
|
|
134
136
|
const TypeTesters = (0, _reactRelay.createFragmentContainer)(TypeTestersBase, {
|
|
135
|
-
collection: _TypeTesters_collection !== void 0 ? _TypeTesters_collection : (_TypeTesters_collection = require("../../__generated__/TypeTesters_collection.graphql"), _TypeTesters_collection.hash && _TypeTesters_collection.hash !== "
|
|
137
|
+
collection: _TypeTesters_collection !== void 0 ? _TypeTesters_collection : (_TypeTesters_collection = require("../../__generated__/TypeTesters_collection.graphql"), _TypeTesters_collection.hash && _TypeTesters_collection.hash !== "4ff9e6c40559c9747603613a550fc10b" && console.error("The definition of 'TypeTesters_collection' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _TypeTesters_collection)
|
|
136
138
|
});
|
|
137
139
|
|
|
138
140
|
const getDefaultMode = (stringValue, autofit) => {
|
|
@@ -141,23 +143,22 @@ const getDefaultMode = (stringValue, autofit) => {
|
|
|
141
143
|
return 'local';
|
|
142
144
|
};
|
|
143
145
|
|
|
144
|
-
const TypeTestersQueryRenderer =
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
146
|
+
const TypeTestersQueryRenderer = _ref2 => {
|
|
147
|
+
let {
|
|
148
|
+
collectionId,
|
|
149
|
+
collectionSlug,
|
|
150
|
+
defaultMode,
|
|
151
|
+
autofit,
|
|
152
|
+
tags,
|
|
153
|
+
excludeTags,
|
|
154
|
+
onFocus,
|
|
155
|
+
onBlur,
|
|
156
|
+
onToolbarOpenClose
|
|
157
|
+
} = _ref2;
|
|
155
158
|
const environment = (0, _reactRelay.useRelayEnvironment)();
|
|
156
159
|
const precartOpen = (0, _reactRedux.useSelector)(state => state.precartOpen);
|
|
157
160
|
return /*#__PURE__*/_react.default.createElement(_ConfigContext.default.Consumer, null, config => {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
const includePriceBar = (_config$typeTester$pr = config === null || config === void 0 ? void 0 : (_config$typeTester3 = config.typeTester) === null || _config$typeTester3 === void 0 ? void 0 : _config$typeTester3.priceBar) !== null && _config$typeTester$pr !== void 0 ? _config$typeTester$pr : false;
|
|
161
|
+
const includePriceBar = config.typeTester.priceBar;
|
|
161
162
|
|
|
162
163
|
if (collectionId) {
|
|
163
164
|
return /*#__PURE__*/_react.default.createElement(_reactRelay.QueryRenderer, {
|
|
@@ -170,10 +171,11 @@ const TypeTestersQueryRenderer = ({
|
|
|
170
171
|
tags,
|
|
171
172
|
excludeTags
|
|
172
173
|
},
|
|
173
|
-
render:
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
174
|
+
render: _ref3 => {
|
|
175
|
+
let {
|
|
176
|
+
error,
|
|
177
|
+
props
|
|
178
|
+
} = _ref3;
|
|
177
179
|
if (error) return null;
|
|
178
180
|
return /*#__PURE__*/_react.default.createElement(_reactStaticContainer.default, {
|
|
179
181
|
shouldUpdate: props
|
|
@@ -201,12 +203,13 @@ const TypeTestersQueryRenderer = ({
|
|
|
201
203
|
tags,
|
|
202
204
|
excludeTags
|
|
203
205
|
},
|
|
204
|
-
render:
|
|
205
|
-
error,
|
|
206
|
-
props
|
|
207
|
-
}) => {
|
|
206
|
+
render: _ref4 => {
|
|
208
207
|
var _props$viewer$slug$co, _props$viewer, _props$viewer$slug;
|
|
209
208
|
|
|
209
|
+
let {
|
|
210
|
+
error,
|
|
211
|
+
props
|
|
212
|
+
} = _ref4;
|
|
210
213
|
if (error) return null;
|
|
211
214
|
return /*#__PURE__*/_react.default.createElement(_reactStaticContainer.default, {
|
|
212
215
|
shouldUpdate: props
|
|
@@ -13,12 +13,13 @@ var _VariableTableAmounts_variable, _VariableTableAmounts_option;
|
|
|
13
13
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
|
-
const VariableTableAmounts =
|
|
17
|
-
variable,
|
|
18
|
-
option
|
|
19
|
-
}) => {
|
|
16
|
+
const VariableTableAmounts = _ref => {
|
|
20
17
|
var _variable$units;
|
|
21
18
|
|
|
19
|
+
let {
|
|
20
|
+
variable,
|
|
21
|
+
option
|
|
22
|
+
} = _ref;
|
|
22
23
|
return /*#__PURE__*/_react.default.createElement("span", {
|
|
23
24
|
className: "variable-table-amounts"
|
|
24
25
|
}, variable === null || variable === void 0 ? void 0 : (_variable$units = variable.units) === null || _variable$units === void 0 ? void 0 : _variable$units.map((unit, i) => {
|
|
@@ -11,14 +11,17 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
11
11
|
|
|
12
12
|
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); }
|
|
13
13
|
|
|
14
|
-
const Button =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
const Button = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
type,
|
|
17
|
+
className,
|
|
18
|
+
...rest
|
|
19
|
+
} = _ref;
|
|
20
|
+
return /*#__PURE__*/_react.default.createElement("button", _extends({
|
|
21
|
+
className: className || 'button',
|
|
22
|
+
type: type || 'button'
|
|
23
|
+
}, rest));
|
|
24
|
+
};
|
|
22
25
|
|
|
23
26
|
var _default = Button;
|
|
24
27
|
exports.default = _default;
|
|
@@ -11,32 +11,35 @@ var _Button = _interopRequireDefault(require("../Button"));
|
|
|
11
11
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
|
|
14
|
-
const StoreModalCartLayout =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}, "
|
|
14
|
+
const StoreModalCartLayout = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
onClickCheckoutButton,
|
|
17
|
+
checkoutDisabled,
|
|
18
|
+
children: {
|
|
19
|
+
items,
|
|
20
|
+
couponCodeInput,
|
|
21
|
+
totals,
|
|
22
|
+
checkoutText
|
|
23
|
+
}
|
|
24
|
+
} = _ref;
|
|
25
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
26
|
+
className: "store-modal__cart__container"
|
|
27
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
28
|
+
className: "store-modal__cart__items"
|
|
29
|
+
}, items), /*#__PURE__*/_react.default.createElement("div", {
|
|
30
|
+
className: "store-modal__cart__coupon-code-input"
|
|
31
|
+
}, couponCodeInput), /*#__PURE__*/_react.default.createElement("div", {
|
|
32
|
+
className: "store-modal__cart__totals"
|
|
33
|
+
}, totals), /*#__PURE__*/_react.default.createElement("div", {
|
|
34
|
+
className: "store-modal__cart__checkout"
|
|
35
|
+
}, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
36
|
+
className: "store-modal__cart__checkout-button",
|
|
37
|
+
onClick: onClickCheckoutButton,
|
|
38
|
+
disabled: checkoutDisabled
|
|
39
|
+
}, checkoutText, /*#__PURE__*/_react.default.createElement("span", {
|
|
40
|
+
className: "store-modal__cart__arrow"
|
|
41
|
+
}, " \u2192"))));
|
|
42
|
+
};
|
|
40
43
|
|
|
41
44
|
var _default = StoreModalCartLayout;
|
|
42
45
|
exports.default = _default;
|
|
@@ -19,19 +19,20 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
19
19
|
|
|
20
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; }
|
|
21
21
|
|
|
22
|
-
const StoreModalContainer =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
22
|
+
const StoreModalContainer = _ref => {
|
|
23
|
+
let {
|
|
24
|
+
onClickBackground,
|
|
25
|
+
onClickClose,
|
|
26
|
+
onClickBack,
|
|
27
|
+
onClickCart,
|
|
28
|
+
showCartButton,
|
|
29
|
+
uiFontUrl,
|
|
30
|
+
uiFontName,
|
|
31
|
+
children: {
|
|
32
|
+
backText,
|
|
33
|
+
body
|
|
34
|
+
}
|
|
35
|
+
} = _ref;
|
|
35
36
|
const container = (0, _react.useRef)(null);
|
|
36
37
|
const handleScrollToTop = (0, _react.useCallback)(() => {
|
|
37
38
|
var _container$current, _container$current$sc;
|
|
@@ -11,20 +11,23 @@ var _Icons = require("../../Icons");
|
|
|
11
11
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
|
|
14
|
-
const StoreModalDownloadLayout =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}, /*#__PURE__*/_react.default.createElement("
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
14
|
+
const StoreModalDownloadLayout = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
archiveUrl,
|
|
17
|
+
children: {
|
|
18
|
+
message
|
|
19
|
+
}
|
|
20
|
+
} = _ref;
|
|
21
|
+
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
22
|
+
className: "store-modal__download__section"
|
|
23
|
+
}, message), archiveUrl && /*#__PURE__*/_react.default.createElement("div", {
|
|
24
|
+
className: "store-modal__download__section"
|
|
25
|
+
}, /*#__PURE__*/_react.default.createElement("a", {
|
|
26
|
+
target: "_blank",
|
|
27
|
+
href: archiveUrl,
|
|
28
|
+
className: "store-modal__download__button"
|
|
29
|
+
}, /*#__PURE__*/_react.default.createElement(_Icons.DownloadFonts, null), " Download your order")));
|
|
30
|
+
};
|
|
28
31
|
|
|
29
32
|
var _default = StoreModalDownloadLayout;
|
|
30
33
|
exports.default = _default;
|
|
@@ -9,25 +9,28 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
|
|
12
|
-
const StoreModalFamily =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
12
|
+
const StoreModalFamily = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
children: {
|
|
15
|
+
stylesheet,
|
|
16
|
+
bundles,
|
|
17
|
+
familyButton,
|
|
18
|
+
styleGroups
|
|
19
|
+
}
|
|
20
|
+
} = _ref;
|
|
21
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
22
|
+
className: "store-modal__family__container"
|
|
23
|
+
}, stylesheet, /*#__PURE__*/_react.default.cloneElement(familyButton, {
|
|
24
|
+
className: 'store-modal__family__family-button'
|
|
25
|
+
}), bundles === null || bundles === void 0 ? void 0 : bundles.map(bundle => /*#__PURE__*/_react.default.cloneElement(bundle, {
|
|
26
|
+
className: 'store-modal__family__bundle-button'
|
|
27
|
+
})), styleGroups === null || styleGroups === void 0 ? void 0 : styleGroups.map((group, i) => /*#__PURE__*/_react.default.createElement("div", {
|
|
28
|
+
className: "store-modal__family__group",
|
|
29
|
+
key: i
|
|
30
|
+
}, group.map(styleButton => /*#__PURE__*/_react.default.cloneElement(styleButton, {
|
|
31
|
+
className: 'store-modal__family__style-button'
|
|
32
|
+
})))));
|
|
33
|
+
};
|
|
31
34
|
|
|
32
35
|
var _default = StoreModalFamily;
|
|
33
36
|
exports.default = _default;
|
|
@@ -15,17 +15,18 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
15
15
|
|
|
16
16
|
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
17
|
|
|
18
|
-
const StoreModalFamilyButton =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
const StoreModalFamilyButton = _ref => {
|
|
19
|
+
let {
|
|
20
|
+
selected,
|
|
21
|
+
onClick,
|
|
22
|
+
className,
|
|
23
|
+
children: {
|
|
24
|
+
name,
|
|
25
|
+
label,
|
|
26
|
+
price
|
|
27
|
+
},
|
|
28
|
+
...rest
|
|
29
|
+
} = _ref;
|
|
29
30
|
if (!price) return /*#__PURE__*/_react.default.createElement("div", {
|
|
30
31
|
className: "store-modal__family-button__no-price"
|
|
31
32
|
});
|