fontdue-js 2.12.1 → 2.13.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/dist/__generated__/CartOrder_viewer.graphql.d.ts +2 -2
- package/dist/__generated__/CartOrder_viewer.graphql.js +2 -6
- package/dist/__generated__/CartQuery.graphql.d.ts +1 -1
- package/dist/__generated__/CartQuery.graphql.js +94 -70
- package/dist/__generated__/CartStateRemoveDiscountMutation.graphql.d.ts +1 -1
- package/dist/__generated__/CartStateRemoveDiscountMutation.graphql.js +12 -3
- package/dist/__generated__/CartStateUpdateMutation.graphql.d.ts +1 -1
- package/dist/__generated__/CartStateUpdateMutation.graphql.js +12 -3
- package/dist/__generated__/CouponCodeInputApplyCouponMutation.graphql.d.ts +1 -1
- package/dist/__generated__/CouponCodeInputApplyCouponMutation.graphql.js +12 -3
- package/dist/__generated__/StoreModalCartQuery.graphql.d.ts +2 -2
- package/dist/__generated__/StoreModalCartQuery.graphql.js +94 -73
- package/dist/__generated__/StoreModalCheckoutQuery.graphql.d.ts +1 -1
- package/dist/__generated__/StoreModalCheckoutQuery.graphql.js +42 -12
- package/dist/__generated__/StoreModalUnifiedCheckoutCompleteOrderMutation.graphql.d.ts +1 -1
- package/dist/__generated__/StoreModalUnifiedCheckoutCompleteOrderMutation.graphql.js +35 -19
- package/dist/__generated__/StoreModalUnifiedCheckoutUpdateCustomerMutation.graphql.d.ts +1 -1
- package/dist/__generated__/StoreModalUnifiedCheckoutUpdateCustomerMutation.graphql.js +35 -19
- package/dist/__generated__/StoreModalUnifiedCheckoutUpdateOrderMutation.graphql.d.ts +1 -1
- package/dist/__generated__/StoreModalUnifiedCheckoutUpdateOrderMutation.graphql.js +34 -18
- package/dist/__generated__/StoreModalUnifiedCheckout_order.graphql.d.ts +5 -1
- package/dist/__generated__/StoreModalUnifiedCheckout_order.graphql.js +32 -16
- package/dist/__generated__/StripeProvider_viewer.graphql.d.ts +9 -3
- package/dist/__generated__/StripeProvider_viewer.graphql.js +41 -11
- package/dist/__generated__/TypeTestersIDQuery.graphql.d.ts +1 -1
- package/dist/__generated__/TypeTestersIDQuery.graphql.js +15 -3
- package/dist/__generated__/TypeTestersRefetchQuery.graphql.d.ts +1 -1
- package/dist/__generated__/TypeTestersRefetchQuery.graphql.js +16 -4
- package/dist/__generated__/TypeTestersSlugQuery.graphql.d.ts +1 -1
- package/dist/__generated__/TypeTestersSlugQuery.graphql.js +15 -3
- package/dist/__generated__/TypeTesters_collection.graphql.d.ts +3 -1
- package/dist/__generated__/TypeTesters_collection.graphql.js +14 -2
- package/dist/components/Cart/CartOrder.js +2 -4
- package/dist/components/Cart/CouponCodeInput.d.ts +1 -5
- package/dist/components/Cart/CouponCodeInput.js +15 -67
- package/dist/components/ConfigContext.d.ts +10 -0
- package/dist/components/ConfigContext.js +6 -1
- package/dist/components/StoreModal/StoreModalCart.js +2 -4
- package/dist/components/StripeProvider/index.js +20 -15
- package/dist/components/TypeTester/TypeTesterContext.d.ts +6 -0
- package/dist/components/TypeTester/TypeTesterContext.js +5 -0
- package/dist/components/TypeTester/TypeTesterStandalone.d.ts +1 -0
- package/dist/components/TypeTester/TypeTesterStandalone.js +2 -0
- package/dist/components/TypeTester/TypeTesterStandaloneElement.d.ts +1 -0
- package/dist/components/TypeTester/TypeTesterStandaloneElement.js +2 -0
- package/dist/components/TypeTester/TypeTesterState.d.ts +2 -0
- package/dist/components/TypeTester/TypeTesterState.js +7 -0
- package/dist/components/TypeTester/TypeTesterToolbar.js +13 -2
- package/dist/components/TypeTester/index.d.ts +5 -0
- package/dist/components/TypeTester/useTypeTesterStyler.d.ts +2 -1
- package/dist/components/TypeTester/useTypeTesterStyler.js +8 -1
- package/dist/components/TypeTesters/TypeTestersElement.js +1 -1
- package/dist/components/TypeTesters/index.js +3 -2
- package/dist/components/elements/StoreModalUnifiedCheckout.js +9 -3
- package/dist/fontdue.css +12 -9
- package/package.json +1 -1
|
@@ -15,34 +15,41 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
15
15
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
17
|
const StripeProvider = _ref => {
|
|
18
|
-
var _data$settings, _data$
|
|
18
|
+
var _data$settings, _data$settings$uiFont, _data$settings$uiFont2, _data$settings$uiFont3, _data$settings2, _data$currentOrder, _data$currentOrder$st, _data$themeConfig;
|
|
19
19
|
let {
|
|
20
20
|
viewer,
|
|
21
21
|
providerType,
|
|
22
22
|
children,
|
|
23
23
|
requireClientSecret
|
|
24
24
|
} = _ref;
|
|
25
|
-
const data = (0, _reactRelay.useFragment)((_StripeProvider_viewer2.default.hash && _StripeProvider_viewer2.default.hash !== "
|
|
25
|
+
const data = (0, _reactRelay.useFragment)((_StripeProvider_viewer2.default.hash && _StripeProvider_viewer2.default.hash !== "dd5fd4cdd75d727050b8d1d6f4269fa8" && console.error("The definition of 'StripeProvider_viewer' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _StripeProvider_viewer2.default), viewer);
|
|
26
26
|
const stripeKey = data.stripePublishableKey;
|
|
27
27
|
const stripeAccount = data.stripeAccountId;
|
|
28
28
|
const stripePromiseRef = (0, _react.useRef)(stripeKey && stripeAccount ? (0, _stripeJs.loadStripe)(stripeKey, {
|
|
29
29
|
stripeAccount
|
|
30
30
|
}) : null);
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
// useStripe down in the children
|
|
35
|
-
const clientSecret = ((_data$currentOrder = data.currentOrder) === null || _data$currentOrder === void 0 ? void 0 : (_data$currentOrder$st = _data$currentOrder.stripePaymentIntent) === null || _data$currentOrder$st === void 0 ? void 0 : _data$currentOrder$st.clientSecret) ?? undefined;
|
|
36
|
-
if (requireClientSecret && !clientSecret) return children;
|
|
37
|
-
|
|
31
|
+
let customFontSource;
|
|
32
|
+
const woffSrc = (_data$settings = data.settings) === null || _data$settings === void 0 ? void 0 : (_data$settings$uiFont = _data$settings.uiFontStyle) === null || _data$settings$uiFont === void 0 ? void 0 : (_data$settings$uiFont2 = _data$settings$uiFont.webfontSources) === null || _data$settings$uiFont2 === void 0 ? void 0 : (_data$settings$uiFont3 = _data$settings$uiFont2.find(source => (source === null || source === void 0 ? void 0 : source.format) === 'woff2')) === null || _data$settings$uiFont3 === void 0 ? void 0 : _data$settings$uiFont3.url;
|
|
33
|
+
let fontFamily = (_data$settings2 = data.settings) !== null && _data$settings2 !== void 0 && _data$settings2.uiFontStyle ? `${data.settings.uiFontStyle.cssFamily} ${data.settings.uiFontStyle.name}` : undefined;
|
|
38
34
|
// stripe validates that the strings match this pattern and throws an error
|
|
39
35
|
// if they don't, and refuses to render the element. for example if a font
|
|
40
36
|
// family has a special character in the name (which is actually valid).
|
|
41
37
|
// so we just don't try to the fontFamily if it's not gonna be valid.
|
|
42
38
|
// this regex is copied from the stripe js
|
|
43
39
|
const stripeRegex = /^[#a-zA-Z0-9-_\s,"'().]*$/;
|
|
44
|
-
|
|
45
|
-
if (
|
|
40
|
+
if (fontFamily && !stripeRegex.test(fontFamily)) fontFamily = undefined;
|
|
41
|
+
if (woffSrc && fontFamily) {
|
|
42
|
+
customFontSource = {
|
|
43
|
+
src: `url(${woffSrc})`,
|
|
44
|
+
family: fontFamily,
|
|
45
|
+
weight: '400'
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// the stripe provider may not be rendered, so we have to conditonally call
|
|
50
|
+
// useStripe down in the children
|
|
51
|
+
const clientSecret = ((_data$currentOrder = data.currentOrder) === null || _data$currentOrder === void 0 ? void 0 : (_data$currentOrder$st = _data$currentOrder.stripePaymentIntent) === null || _data$currentOrder$st === void 0 ? void 0 : _data$currentOrder$st.clientSecret) ?? undefined;
|
|
52
|
+
if (requireClientSecret && !clientSecret) return children;
|
|
46
53
|
const customProperties = (0, _utils.parseCustomProperties)((_data$themeConfig = data.themeConfig) === null || _data$themeConfig === void 0 ? void 0 : _data$themeConfig.customProperties);
|
|
47
54
|
const environment = (0, _reactRelay.useRelayEnvironment)();
|
|
48
55
|
const fetchClientSecret = (0, _react.useCallback)(() => {
|
|
@@ -83,7 +90,7 @@ const StripeProvider = _ref => {
|
|
|
83
90
|
colorTextPlaceholder: customProperties['--secondary_text_color'],
|
|
84
91
|
focusBoxShadow: `0 0 0 1px ${customProperties['--primary_text_color']}`,
|
|
85
92
|
fontSizeBase: '16px',
|
|
86
|
-
fontSmooth: '
|
|
93
|
+
fontSmooth: 'always',
|
|
87
94
|
gridRowSpacing: '30px',
|
|
88
95
|
spacingUnit: '5px',
|
|
89
96
|
accordionItemSpacing: '20px'
|
|
@@ -141,9 +148,7 @@ const StripeProvider = _ref => {
|
|
|
141
148
|
}
|
|
142
149
|
}
|
|
143
150
|
},
|
|
144
|
-
fonts:
|
|
145
|
-
cssSrc
|
|
146
|
-
}] : undefined,
|
|
151
|
+
fonts: customFontSource ? [customFontSource] : undefined,
|
|
147
152
|
clientSecret
|
|
148
153
|
};
|
|
149
154
|
if (providerType === 'checkout') {
|
|
@@ -6,6 +6,7 @@ interface TypeTesterState {
|
|
|
6
6
|
contentEdited: boolean;
|
|
7
7
|
features: Features;
|
|
8
8
|
size: Size;
|
|
9
|
+
letterSpacing: number;
|
|
9
10
|
lineHeight: number;
|
|
10
11
|
focused: boolean;
|
|
11
12
|
featuresOpen: boolean;
|
|
@@ -22,6 +23,7 @@ export interface TypeTestersInitialState {
|
|
|
22
23
|
content: string | null;
|
|
23
24
|
size: number | null;
|
|
24
25
|
lineHeight: number | null;
|
|
26
|
+
letterSpacing: number | null;
|
|
25
27
|
autofit: boolean;
|
|
26
28
|
alignment: Alignment;
|
|
27
29
|
variableSettings: VariableSettings | null;
|
|
@@ -63,6 +65,10 @@ type TypeTesterContextAction = {
|
|
|
63
65
|
type: 'SET_LINE_HEIGHT';
|
|
64
66
|
id: string;
|
|
65
67
|
value: number;
|
|
68
|
+
} | {
|
|
69
|
+
type: 'SET_LETTER_SPACING';
|
|
70
|
+
id: string;
|
|
71
|
+
value: number;
|
|
66
72
|
} | {
|
|
67
73
|
type: 'SET_ALIGNMENT';
|
|
68
74
|
id: string;
|
|
@@ -82,6 +82,10 @@ const groupReducer = (state, action) => {
|
|
|
82
82
|
return updateTester(state, action.id, {
|
|
83
83
|
size: action.value
|
|
84
84
|
}, action.propagate);
|
|
85
|
+
case 'SET_LETTER_SPACING':
|
|
86
|
+
return updateTester(state, action.id, {
|
|
87
|
+
letterSpacing: action.value
|
|
88
|
+
});
|
|
85
89
|
case 'SET_FEATURES':
|
|
86
90
|
return updateTester(state, action.id, {
|
|
87
91
|
features: action.value
|
|
@@ -135,6 +139,7 @@ const TypeTesterContextComponent = _ref => {
|
|
|
135
139
|
content,
|
|
136
140
|
contentEdited: false,
|
|
137
141
|
size: initialState.size ?? 72,
|
|
142
|
+
letterSpacing: initialState.letterSpacing ?? 0,
|
|
138
143
|
lineHeight: initialState.lineHeight ?? 1,
|
|
139
144
|
autofit: initialState.autofit,
|
|
140
145
|
features: initialState.features ?? [],
|
|
@@ -4,6 +4,7 @@ import { SerializablePreloadedQuery } from '../../relay/loadSerializableQuery';
|
|
|
4
4
|
import { TypeTesterStandaloneQuery } from '__generated__/TypeTesterStandaloneQuery.graphql';
|
|
5
5
|
interface TypeTesterStandaloneComponent_props {
|
|
6
6
|
lineHeight?: number | null;
|
|
7
|
+
letterSpacing?: number | null;
|
|
7
8
|
fontSize?: number | null;
|
|
8
9
|
axes?: string[] | null;
|
|
9
10
|
features?: string[] | null;
|
|
@@ -31,6 +31,7 @@ function TypeTesterStandaloneComponent(_ref) {
|
|
|
31
31
|
featureSettings = null,
|
|
32
32
|
variableSettings = null,
|
|
33
33
|
lineHeight,
|
|
34
|
+
letterSpacing,
|
|
34
35
|
alignment,
|
|
35
36
|
fontSize,
|
|
36
37
|
autofit,
|
|
@@ -77,6 +78,7 @@ function TypeTesterStandaloneComponent(_ref) {
|
|
|
77
78
|
autofit: autofit ?? false,
|
|
78
79
|
size: fontSize ?? 72,
|
|
79
80
|
lineHeight: lineHeight ?? 1,
|
|
81
|
+
letterSpacing: letterSpacing ?? 0,
|
|
80
82
|
alignment: alignment ?? defaultAlignment,
|
|
81
83
|
features: (featureSettings === null || featureSettings === void 0 ? void 0 : featureSettings.filter(setting => setting.value === '1').map(setting => setting.feature)) ?? featuresSelected ?? null,
|
|
82
84
|
variableSettings: (variableSettings === null || variableSettings === void 0 ? void 0 : variableSettings.reduce((acc, _ref2) => {
|
|
@@ -36,6 +36,7 @@ function parseVariableSettings(input) {
|
|
|
36
36
|
const TypeTesterStandaloneElement = _ref => {
|
|
37
37
|
let {
|
|
38
38
|
lineHeight,
|
|
39
|
+
letterSpacing,
|
|
39
40
|
fontSize,
|
|
40
41
|
axes,
|
|
41
42
|
features,
|
|
@@ -49,6 +50,7 @@ const TypeTesterStandaloneElement = _ref => {
|
|
|
49
50
|
return /*#__PURE__*/_react.default.createElement(_TypeTesterStandalone.default, _extends({
|
|
50
51
|
autofit: parseBool(autofit),
|
|
51
52
|
lineHeight: lineHeight ? parseFloat(lineHeight) : undefined,
|
|
53
|
+
letterSpacing: letterSpacing ? parseFloat(letterSpacing) : undefined,
|
|
52
54
|
fontSize: fontSize ? parseFloat(fontSize) : undefined,
|
|
53
55
|
axes: (axes === null || axes === void 0 ? void 0 : axes.split(',')) ?? [],
|
|
54
56
|
features: (features === null || features === void 0 ? void 0 : features.split(',')) ?? [],
|
|
@@ -14,6 +14,8 @@ interface TypeTesterState {
|
|
|
14
14
|
} | undefined) => void;
|
|
15
15
|
lineHeight: LineHeight;
|
|
16
16
|
setLineHeight: (value: LineHeight) => void;
|
|
17
|
+
letterSpacing: number;
|
|
18
|
+
setLetterSpacing: (value: number) => void;
|
|
17
19
|
focused: boolean;
|
|
18
20
|
setFocused: (value: boolean) => void;
|
|
19
21
|
features: string[];
|
|
@@ -28,6 +28,7 @@ const useTypeTesterState = _ref => {
|
|
|
28
28
|
featuresOpen,
|
|
29
29
|
autofit,
|
|
30
30
|
lineHeight,
|
|
31
|
+
letterSpacing,
|
|
31
32
|
alignment,
|
|
32
33
|
variableSettings,
|
|
33
34
|
direction
|
|
@@ -58,6 +59,12 @@ const useTypeTesterState = _ref => {
|
|
|
58
59
|
value,
|
|
59
60
|
id
|
|
60
61
|
}),
|
|
62
|
+
letterSpacing,
|
|
63
|
+
setLetterSpacing: value => dispatch({
|
|
64
|
+
type: 'SET_LETTER_SPACING',
|
|
65
|
+
value,
|
|
66
|
+
id
|
|
67
|
+
}),
|
|
61
68
|
alignment,
|
|
62
69
|
setAlignment: value => dispatch({
|
|
63
70
|
type: 'SET_ALIGNMENT',
|
|
@@ -58,7 +58,18 @@ const TypeTesterToolbar = _ref => {
|
|
|
58
58
|
onChange: props.setSize,
|
|
59
59
|
stepSize: 1,
|
|
60
60
|
interpolator: "log10"
|
|
61
|
-
}), config.
|
|
61
|
+
})), config.letterSpacing && /*#__PURE__*/_react.default.createElement("div", {
|
|
62
|
+
className: "type-tester__slider__letter-spacing"
|
|
63
|
+
}, config.letterSpacing.label && /*#__PURE__*/_react.default.createElement("span", {
|
|
64
|
+
className: "type-tester__slider__line-height-label"
|
|
65
|
+
}, config.letterSpacing.label), /*#__PURE__*/_react.default.createElement(_TypeTesterSlider.default, {
|
|
66
|
+
min: config.letterSpacing.min,
|
|
67
|
+
max: config.letterSpacing.max,
|
|
68
|
+
value: props.letterSpacing,
|
|
69
|
+
onChange: props.setLetterSpacing,
|
|
70
|
+
stepSize: 0.01,
|
|
71
|
+
interpolator: "linear"
|
|
72
|
+
})), config.lineHeight && /*#__PURE__*/_react.default.createElement("div", {
|
|
62
73
|
className: "type-tester__slider__line-height"
|
|
63
74
|
}, config.lineHeight.label && /*#__PURE__*/_react.default.createElement("span", {
|
|
64
75
|
className: "type-tester__slider__line-height-label"
|
|
@@ -69,7 +80,7 @@ const TypeTesterToolbar = _ref => {
|
|
|
69
80
|
onChange: props.setLineHeight,
|
|
70
81
|
stepSize: 0.01,
|
|
71
82
|
interpolator: "log10"
|
|
72
|
-
}))
|
|
83
|
+
})), axesPosition === 'inline' && /*#__PURE__*/_react.default.createElement(_TypeTesterVariableAxes.default, {
|
|
73
84
|
id: id,
|
|
74
85
|
fontStyle: fontStyle,
|
|
75
86
|
axes: axes
|
|
@@ -12,6 +12,7 @@ export interface UseTypeTesterStylerProps {
|
|
|
12
12
|
}) => void;
|
|
13
13
|
size: number;
|
|
14
14
|
lineHeight: number;
|
|
15
|
+
letterSpacing: number;
|
|
15
16
|
features: string[];
|
|
16
17
|
focused: boolean;
|
|
17
18
|
truncate: boolean;
|
|
@@ -21,7 +22,7 @@ export interface UseTypeTesterStylerProps {
|
|
|
21
22
|
alignment: Alignment;
|
|
22
23
|
variableSettings: VariableSettings | null;
|
|
23
24
|
}
|
|
24
|
-
declare const useTypeTesterStyler: ({ size, autofit, autofitOnChange, features, setSize, min, max, truncate, focused, lineHeight, fontStyles, content, contentEdited, alignment, variableSettings, }: UseTypeTesterStylerProps) => {
|
|
25
|
+
declare const useTypeTesterStyler: ({ size, autofit, autofitOnChange, features, setSize, min, max, truncate, focused, lineHeight, letterSpacing, fontStyles, content, contentEdited, alignment, variableSettings, }: UseTypeTesterStylerProps) => {
|
|
25
26
|
ref: import("react").RefObject<HTMLDivElement>;
|
|
26
27
|
style: import("react").CSSProperties;
|
|
27
28
|
};
|
|
@@ -20,6 +20,7 @@ const createClone = styles => {
|
|
|
20
20
|
clone.style.fontWeight = `${styles.fontWeight}`;
|
|
21
21
|
clone.style.fontStyle = `${styles.fontStyle}`;
|
|
22
22
|
clone.style.wordWrap = 'normal';
|
|
23
|
+
clone.style.letterSpacing = `${styles.letterSpacing}`;
|
|
23
24
|
clone.style.fontVariationSettings = styles.fontVariationSettings;
|
|
24
25
|
clone.style.fontFeatureSettings = styles.fontFeatureSettings;
|
|
25
26
|
return clone;
|
|
@@ -36,6 +37,7 @@ const useTypeTesterStyler = _ref => {
|
|
|
36
37
|
truncate,
|
|
37
38
|
focused,
|
|
38
39
|
lineHeight,
|
|
40
|
+
letterSpacing,
|
|
39
41
|
fontStyles,
|
|
40
42
|
content,
|
|
41
43
|
contentEdited,
|
|
@@ -47,6 +49,7 @@ const useTypeTesterStyler = _ref => {
|
|
|
47
49
|
const fontFeatureSettings = features.map(feature => `"${feature}"`).join(', ');
|
|
48
50
|
const clone = (0, _react.useRef)(createClone({
|
|
49
51
|
...fontStyles,
|
|
52
|
+
letterSpacing: `${letterSpacing}em`,
|
|
50
53
|
fontVariationSettings,
|
|
51
54
|
fontFeatureSettings
|
|
52
55
|
}));
|
|
@@ -100,6 +103,10 @@ const useTypeTesterStyler = _ref => {
|
|
|
100
103
|
fps: 60
|
|
101
104
|
});
|
|
102
105
|
(0, _react.useLayoutEffect)(computeSize, [windowWidth, autofit]);
|
|
106
|
+
(0, _react.useLayoutEffect)(() => {
|
|
107
|
+
clone.current.style.letterSpacing = `${letterSpacing}em`;
|
|
108
|
+
computeSize();
|
|
109
|
+
}, [letterSpacing]);
|
|
103
110
|
(0, _react.useLayoutEffect)(() => {
|
|
104
111
|
var _ref$current2;
|
|
105
112
|
if (!autofitOnChange) return;
|
|
@@ -116,7 +123,7 @@ const useTypeTesterStyler = _ref => {
|
|
|
116
123
|
fontFeatureSettings,
|
|
117
124
|
marginRight: alignment !== 'right' ? -sideBuffer : 0,
|
|
118
125
|
marginLeft: alignment === 'right' ? -sideBuffer : 0,
|
|
119
|
-
letterSpacing:
|
|
126
|
+
letterSpacing: `${letterSpacing}em`,
|
|
120
127
|
fontVariationSettings,
|
|
121
128
|
textAlign: alignment
|
|
122
129
|
};
|
|
@@ -24,7 +24,7 @@ function TypeTestersElement(_ref) {
|
|
|
24
24
|
return /*#__PURE__*/_react.default.createElement(_index.default, _extends({
|
|
25
25
|
tags: tags === null || tags === void 0 ? void 0 : tags.split(','),
|
|
26
26
|
excludeTags: excludeTags === null || excludeTags === void 0 ? void 0 : excludeTags.split(','),
|
|
27
|
-
autofit: autofit === 'true',
|
|
27
|
+
autofit: autofit ? autofit === 'true' : undefined,
|
|
28
28
|
defaultMode: getDefaultMode(defaultMode, autofit === 'true')
|
|
29
29
|
}, rest));
|
|
30
30
|
}
|
|
@@ -80,7 +80,7 @@ function TypeTestersComponent(_ref) {
|
|
|
80
80
|
licenseOptionsSpecs,
|
|
81
81
|
orderVariableSelections
|
|
82
82
|
} = (0, _useLicenseAndOrderVariables.useLicenseAndOrderVariables)();
|
|
83
|
-
const [collection, refetch] = (0, _reactRelay.useRefetchableFragment)((_TypeTesters_collection2.default.hash && _TypeTesters_collection2.default.hash !== "
|
|
83
|
+
const [collection, refetch] = (0, _reactRelay.useRefetchableFragment)((_TypeTesters_collection2.default.hash && _TypeTesters_collection2.default.hash !== "6f88c9b86f2c60ecc35f1be282b3ee50" && 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_collection2.default), collectionKey);
|
|
84
84
|
const handleStyleSelect = (0, _react.useCallback)((testerId, fontStyleId) => {
|
|
85
85
|
const newChangedStyles = {
|
|
86
86
|
...changedStyles,
|
|
@@ -129,7 +129,8 @@ function TypeTestersComponent(_ref) {
|
|
|
129
129
|
content: node.content,
|
|
130
130
|
size: node.size ? parseFloat(node.size) : 72,
|
|
131
131
|
lineHeight: node.lineHeight ? parseFloat(node.lineHeight) : 1,
|
|
132
|
-
autofit: autofit ?? false,
|
|
132
|
+
autofit: autofit ?? node.autofit ?? false,
|
|
133
|
+
letterSpacing: node.letterSpacing ? parseFloat(node.letterSpacing) : 0,
|
|
133
134
|
direction,
|
|
134
135
|
alignment,
|
|
135
136
|
variableSettings: ((_node$variableSetting = node.variableSettings) === null || _node$variableSetting === void 0 ? void 0 : _node$variableSetting.reduce((acc, _ref2) => {
|
|
@@ -21,6 +21,7 @@ var _reactErrorBoundary = require("react-error-boundary");
|
|
|
21
21
|
var _StripeLogo = _interopRequireDefault(require("../StripeLogo"));
|
|
22
22
|
var _Icons = require("../Icons");
|
|
23
23
|
var _ConfigContext = _interopRequireDefault(require("../ConfigContext"));
|
|
24
|
+
var _Price = require("../Price");
|
|
24
25
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
25
26
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
26
27
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -107,14 +108,14 @@ function EditableSection(_ref) {
|
|
|
107
108
|
}, "Change")));
|
|
108
109
|
}
|
|
109
110
|
function StoreModalUnifiedCheckout(_ref2) {
|
|
110
|
-
var _viewer$settings, _viewer$settings2, _viewer$settings3;
|
|
111
|
+
var _viewer$settings, _viewer$settings2, _viewer$settings3, _order$stripePaymentI, _order$stripePaymentI2;
|
|
111
112
|
let {
|
|
112
113
|
order: orderKey,
|
|
113
114
|
viewer: viewerKey,
|
|
114
115
|
onScrollToTop
|
|
115
116
|
} = _ref2;
|
|
116
117
|
const viewer = (0, _reactRelay.useFragment)((_StoreModalUnifiedCheckout_viewer2.default.hash && _StoreModalUnifiedCheckout_viewer2.default.hash !== "82e9144073b645e6b124db4f559c1ab3" && console.error("The definition of 'StoreModalUnifiedCheckout_viewer' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _StoreModalUnifiedCheckout_viewer2.default), viewerKey);
|
|
117
|
-
const order = (0, _reactRelay.useFragment)((_StoreModalUnifiedCheckout_order2.default.hash && _StoreModalUnifiedCheckout_order2.default.hash !== "
|
|
118
|
+
const order = (0, _reactRelay.useFragment)((_StoreModalUnifiedCheckout_order2.default.hash && _StoreModalUnifiedCheckout_order2.default.hash !== "94683a80ba2c7104fd80f9e508cd6d70" && console.error("The definition of 'StoreModalUnifiedCheckout_order' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _StoreModalUnifiedCheckout_order2.default), orderKey);
|
|
118
119
|
const initialIdentity = {
|
|
119
120
|
...defaultIdentity,
|
|
120
121
|
country: viewer.country
|
|
@@ -490,5 +491,10 @@ function StoreModalUnifiedCheckout(_ref2) {
|
|
|
490
491
|
type: "submit",
|
|
491
492
|
className: "store-modal__cart__button",
|
|
492
493
|
disabled: completing || !acceptedEULA
|
|
493
|
-
}, completing ? 'Submitting...' : zeroOrder ? 'Complete order' :
|
|
494
|
+
}, completing ? 'Submitting...' : zeroOrder ? 'Complete order' : /*#__PURE__*/_react.default.createElement("span", null, "Pay", ' ', (_order$stripePaymentI = order.stripePaymentIntent) !== null && _order$stripePaymentI !== void 0 && _order$stripePaymentI.amount && (_order$stripePaymentI2 = order.stripePaymentIntent) !== null && _order$stripePaymentI2 !== void 0 && _order$stripePaymentI2.currency ? /*#__PURE__*/_react.default.createElement(_Price.Price, {
|
|
495
|
+
price: {
|
|
496
|
+
amount: order.stripePaymentIntent.amount,
|
|
497
|
+
currency: order.stripePaymentIntent.currency
|
|
498
|
+
}
|
|
499
|
+
}) : null)))) : null);
|
|
494
500
|
}
|
package/dist/fontdue.css
CHANGED
|
@@ -442,12 +442,16 @@ div[data-component=TypeTesters] {
|
|
|
442
442
|
margin-right: 1em;
|
|
443
443
|
}
|
|
444
444
|
.type-tester__toolbar .type-tester__variable-axes {
|
|
445
|
+
display: contents;
|
|
446
|
+
}
|
|
447
|
+
.type-tester__toolbar .type-tester__variable-axes__axis {
|
|
448
|
+
flex: 0 1 250px;
|
|
445
449
|
margin-right: 20px;
|
|
446
450
|
}
|
|
447
451
|
.type-tester__toolbar {
|
|
448
452
|
display: flex;
|
|
449
453
|
align-items: center;
|
|
450
|
-
justify-content:
|
|
454
|
+
justify-content: flex-start;
|
|
451
455
|
margin-bottom: 10px;
|
|
452
456
|
position: relative;
|
|
453
457
|
z-index: 2;
|
|
@@ -460,7 +464,7 @@ div[data-component=TypeTesters] {
|
|
|
460
464
|
.type-tester__toolbar__tools {
|
|
461
465
|
display: flex;
|
|
462
466
|
align-items: center;
|
|
463
|
-
justify-content:
|
|
467
|
+
justify-content: flex-start;
|
|
464
468
|
flex: 1;
|
|
465
469
|
}
|
|
466
470
|
.type-tester__toolbar__tools:not(:last-child) {
|
|
@@ -508,14 +512,14 @@ div[data-component=TypeTesters] {
|
|
|
508
512
|
.type-tester__slider {
|
|
509
513
|
display: flex;
|
|
510
514
|
align-items: center;
|
|
511
|
-
flex: 1;
|
|
515
|
+
flex: 0 1 250px;
|
|
512
516
|
margin-right: 20px;
|
|
513
517
|
}
|
|
514
|
-
.type-tester__slider__line-height {
|
|
518
|
+
.type-tester__slider__line-height, .type-tester__slider__letter-spacing {
|
|
515
519
|
display: flex;
|
|
516
520
|
align-items: center;
|
|
517
|
-
flex: 1;
|
|
518
|
-
margin-
|
|
521
|
+
flex: 0 1 250px;
|
|
522
|
+
margin-right: 20px;
|
|
519
523
|
}
|
|
520
524
|
.type-tester__slider__size-label, .type-tester__slider__line-height-label {
|
|
521
525
|
margin-right: 1em;
|
|
@@ -528,8 +532,7 @@ div[data-component=TypeTesters] {
|
|
|
528
532
|
}
|
|
529
533
|
.type-tester__slider__track {
|
|
530
534
|
width: 100%;
|
|
531
|
-
min-width:
|
|
532
|
-
max-width: 250px;
|
|
535
|
+
min-width: 50px;
|
|
533
536
|
background-color: currentcolor;
|
|
534
537
|
height: 1px;
|
|
535
538
|
position: relative;
|
|
@@ -575,6 +578,7 @@ div[data-component=TypeTesters] {
|
|
|
575
578
|
}
|
|
576
579
|
.type-tester__features-button {
|
|
577
580
|
white-space: nowrap;
|
|
581
|
+
margin-left: auto;
|
|
578
582
|
}
|
|
579
583
|
.type-tester__features-button:not(:last-child) {
|
|
580
584
|
margin-right: 20px;
|
|
@@ -682,7 +686,6 @@ div[data-component=TypeTesters] {
|
|
|
682
686
|
display: flex;
|
|
683
687
|
}
|
|
684
688
|
.type-tester__variable-axes .type-tester__slider__track {
|
|
685
|
-
max-width: none;
|
|
686
689
|
min-width: 50px;
|
|
687
690
|
flex: 1;
|
|
688
691
|
}
|