fontdue-js 3.0.0-alpha4 → 3.0.0-alpha5
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/README.md +463 -94
- package/dist/__generated__/ServerConfigProviderQuery.graphql.js +8 -1
- package/dist/__generated__/TestModeBannerQuery.graphql.js +8 -1
- package/dist/__generated__/ThemeConfigQuery.graphql.js +8 -1
- package/dist/__tests__/licenseExclusions.test.js +161 -0
- package/dist/components/BuyButton/index.d.ts +2 -2
- package/dist/components/BuyButton/index.js +3 -3
- package/dist/components/CartButton/index.d.ts +1 -11
- package/dist/components/CartButton/index.js +9 -29
- package/dist/components/CartButton/index.server.d.ts +1 -3
- package/dist/components/CartButton/index.server.js +14 -20
- package/dist/components/CharacterViewer/index.d.ts +2 -2
- package/dist/components/CharacterViewer/index.js +3 -3
- package/dist/components/FontdueProvider/FontdueProviderClientComponent.d.ts +4 -6
- package/dist/components/FontdueProvider/FontdueProviderClientComponent.js +39 -48
- package/dist/components/FontdueProvider/index.server.js +1 -3
- package/dist/components/NewsletterSignup/index.d.ts +2 -2
- package/dist/components/NewsletterSignup/index.js +2 -2
- package/dist/components/TestFontsForm/index.d.ts +2 -2
- package/dist/components/TestFontsForm/index.js +2 -2
- package/dist/components/ThemeConfig/index.server.js +14 -7
- package/dist/components/TypeTester/TypeTesterStandalone.d.ts +2 -2
- package/dist/components/TypeTester/TypeTesterStandalone.js +2 -2
- package/dist/components/TypeTesters/index.d.ts +2 -2
- package/dist/components/TypeTesters/index.js +3 -3
- package/dist/fontdue.css +12 -12
- package/dist/loadFontdueProviderQuery.d.ts +1 -2
- package/dist/loadFontdueProviderQuery.js +2 -2
- package/dist/relay/environment.js +1 -1
- package/dist/relay/loadSerializableQuery.d.ts +1 -5
- package/dist/relay/loadSerializableQuery.js +2 -2
- package/dist/vite.js +42 -2
- package/package.json +3 -6
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
1
7
|
/**
|
|
2
8
|
* @generated SignedSource<<e36d7651684826ea0cac76a464f23dcd>>
|
|
3
9
|
* @lightSyntaxTransform
|
|
@@ -98,4 +104,5 @@ const node = function () {
|
|
|
98
104
|
};
|
|
99
105
|
}();
|
|
100
106
|
node.hash = "b20ad9bdada6a425ee660a8662a78840";
|
|
101
|
-
|
|
107
|
+
var _default = node;
|
|
108
|
+
exports.default = _default;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
1
7
|
/**
|
|
2
8
|
* @generated SignedSource<<e395904ea5bda751df1ca67f9c74ac55>>
|
|
3
9
|
* @lightSyntaxTransform
|
|
@@ -77,4 +83,5 @@ const node = function () {
|
|
|
77
83
|
};
|
|
78
84
|
}();
|
|
79
85
|
node.hash = "60ad67ee88ec6b74dd04bdf5572e7faf";
|
|
80
|
-
|
|
86
|
+
var _default = node;
|
|
87
|
+
exports.default = _default;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
1
7
|
/**
|
|
2
8
|
* @generated SignedSource<<b292c0ac6583f7d2d7cd8979e5696b21>>
|
|
3
9
|
* @lightSyntaxTransform
|
|
@@ -77,4 +83,5 @@ const node = function () {
|
|
|
77
83
|
};
|
|
78
84
|
}();
|
|
79
85
|
node.hash = "c259bee038c4d2ea14c758fba3381f57";
|
|
80
|
-
|
|
86
|
+
var _default = node;
|
|
87
|
+
exports.default = _default;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _vitest = require("vitest");
|
|
4
|
+
var _reducer = _interopRequireDefault(require("../reducer"));
|
|
5
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
6
|
+
_vitest.vi.mock('react-relay', () => ({
|
|
7
|
+
graphql: () => null,
|
|
8
|
+
fetchQuery: _vitest.vi.fn()
|
|
9
|
+
}));
|
|
10
|
+
function makeState() {
|
|
11
|
+
let overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
12
|
+
return {
|
|
13
|
+
cartOpen: false,
|
|
14
|
+
precartOpen: false,
|
|
15
|
+
selectedSkuIds: {},
|
|
16
|
+
licenseOptions: [],
|
|
17
|
+
collectionStyleSkus: {},
|
|
18
|
+
collectionSkus: {},
|
|
19
|
+
skuPrices: {},
|
|
20
|
+
fetchedCollectionIds: [],
|
|
21
|
+
storeModalRoute: {
|
|
22
|
+
name: 'index'
|
|
23
|
+
},
|
|
24
|
+
storeModalHistory: [],
|
|
25
|
+
orderVariableSelections: [],
|
|
26
|
+
licenseeIsBillingIdentity: null,
|
|
27
|
+
...overrides
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
(0, _vitest.describe)('PRECART_SELECT_LICENSE auto-deselect', () => {
|
|
31
|
+
(0, _vitest.it)('drops a currently-selected license when its excluder is selected', () => {
|
|
32
|
+
const state = makeState({
|
|
33
|
+
licenseOptions: [{
|
|
34
|
+
licenseId: 'A',
|
|
35
|
+
licenseOptions: {}
|
|
36
|
+
}]
|
|
37
|
+
});
|
|
38
|
+
const newState = (0, _reducer.default)(state, {
|
|
39
|
+
type: 'PRECART_SELECT_LICENSE',
|
|
40
|
+
licenseOptionSpec: {
|
|
41
|
+
licenseId: 'B',
|
|
42
|
+
licenseOptions: {}
|
|
43
|
+
},
|
|
44
|
+
excludedLicenseIds: ['A']
|
|
45
|
+
});
|
|
46
|
+
(0, _vitest.expect)(newState.licenseOptions.map(o => o.licenseId)).toEqual(['B']);
|
|
47
|
+
});
|
|
48
|
+
(0, _vitest.it)('leaves non-conflicting selections in place', () => {
|
|
49
|
+
const state = makeState({
|
|
50
|
+
licenseOptions: [{
|
|
51
|
+
licenseId: 'A',
|
|
52
|
+
licenseOptions: {}
|
|
53
|
+
}, {
|
|
54
|
+
licenseId: 'C',
|
|
55
|
+
licenseOptions: {}
|
|
56
|
+
}]
|
|
57
|
+
});
|
|
58
|
+
const newState = (0, _reducer.default)(state, {
|
|
59
|
+
type: 'PRECART_SELECT_LICENSE',
|
|
60
|
+
licenseOptionSpec: {
|
|
61
|
+
licenseId: 'B',
|
|
62
|
+
licenseOptions: {}
|
|
63
|
+
},
|
|
64
|
+
excludedLicenseIds: ['A']
|
|
65
|
+
});
|
|
66
|
+
(0, _vitest.expect)(newState.licenseOptions.map(o => o.licenseId).sort()).toEqual(['B', 'C']);
|
|
67
|
+
});
|
|
68
|
+
(0, _vitest.it)('is a no-op when the license is already selected', () => {
|
|
69
|
+
const state = makeState({
|
|
70
|
+
licenseOptions: [{
|
|
71
|
+
licenseId: 'B',
|
|
72
|
+
licenseOptions: {}
|
|
73
|
+
}]
|
|
74
|
+
});
|
|
75
|
+
const newState = (0, _reducer.default)(state, {
|
|
76
|
+
type: 'PRECART_SELECT_LICENSE',
|
|
77
|
+
licenseOptionSpec: {
|
|
78
|
+
licenseId: 'B',
|
|
79
|
+
licenseOptions: {}
|
|
80
|
+
},
|
|
81
|
+
excludedLicenseIds: ['A']
|
|
82
|
+
});
|
|
83
|
+
(0, _vitest.expect)(newState).toBe(state);
|
|
84
|
+
});
|
|
85
|
+
(0, _vitest.it)('handles empty excludedLicenseIds', () => {
|
|
86
|
+
const state = makeState({
|
|
87
|
+
licenseOptions: [{
|
|
88
|
+
licenseId: 'A',
|
|
89
|
+
licenseOptions: {}
|
|
90
|
+
}]
|
|
91
|
+
});
|
|
92
|
+
const newState = (0, _reducer.default)(state, {
|
|
93
|
+
type: 'PRECART_SELECT_LICENSE',
|
|
94
|
+
licenseOptionSpec: {
|
|
95
|
+
licenseId: 'B',
|
|
96
|
+
licenseOptions: {}
|
|
97
|
+
},
|
|
98
|
+
excludedLicenseIds: []
|
|
99
|
+
});
|
|
100
|
+
(0, _vitest.expect)(newState.licenseOptions.map(o => o.licenseId).sort()).toEqual(['A', 'B']);
|
|
101
|
+
});
|
|
102
|
+
(0, _vitest.it)('handles missing excludedLicenseIds (backwards compatibility)', () => {
|
|
103
|
+
const state = makeState({
|
|
104
|
+
licenseOptions: [{
|
|
105
|
+
licenseId: 'A',
|
|
106
|
+
licenseOptions: {}
|
|
107
|
+
}]
|
|
108
|
+
});
|
|
109
|
+
const newState = (0, _reducer.default)(state, {
|
|
110
|
+
type: 'PRECART_SELECT_LICENSE',
|
|
111
|
+
licenseOptionSpec: {
|
|
112
|
+
licenseId: 'B',
|
|
113
|
+
licenseOptions: {}
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
(0, _vitest.expect)(newState.licenseOptions.map(o => o.licenseId).sort()).toEqual(['A', 'B']);
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
(0, _vitest.describe)('PRECART_TOGGLE_LICENSE auto-deselect', () => {
|
|
120
|
+
(0, _vitest.it)('toggling on a conflicting license drops the conflict', () => {
|
|
121
|
+
const state = makeState({
|
|
122
|
+
licenseOptions: [{
|
|
123
|
+
licenseId: 'A',
|
|
124
|
+
licenseOptions: {}
|
|
125
|
+
}]
|
|
126
|
+
});
|
|
127
|
+
const newState = (0, _reducer.default)(state, {
|
|
128
|
+
type: 'PRECART_TOGGLE_LICENSE',
|
|
129
|
+
licenseId: 'B',
|
|
130
|
+
checked: true,
|
|
131
|
+
licenseOptionSpec: {
|
|
132
|
+
licenseId: 'B',
|
|
133
|
+
licenseOptions: {}
|
|
134
|
+
},
|
|
135
|
+
excludedLicenseIds: ['A']
|
|
136
|
+
});
|
|
137
|
+
(0, _vitest.expect)(newState.licenseOptions.map(o => o.licenseId)).toEqual(['B']);
|
|
138
|
+
});
|
|
139
|
+
(0, _vitest.it)('toggling off does not run auto-deselect', () => {
|
|
140
|
+
const state = makeState({
|
|
141
|
+
licenseOptions: [{
|
|
142
|
+
licenseId: 'A',
|
|
143
|
+
licenseOptions: {}
|
|
144
|
+
}, {
|
|
145
|
+
licenseId: 'B',
|
|
146
|
+
licenseOptions: {}
|
|
147
|
+
}]
|
|
148
|
+
});
|
|
149
|
+
const newState = (0, _reducer.default)(state, {
|
|
150
|
+
type: 'PRECART_TOGGLE_LICENSE',
|
|
151
|
+
licenseId: 'B',
|
|
152
|
+
checked: false,
|
|
153
|
+
licenseOptionSpec: {
|
|
154
|
+
licenseId: 'B',
|
|
155
|
+
licenseOptions: {}
|
|
156
|
+
},
|
|
157
|
+
excludedLicenseIds: ['A']
|
|
158
|
+
});
|
|
159
|
+
(0, _vitest.expect)(newState.licenseOptions.map(o => o.licenseId)).toEqual(['A']);
|
|
160
|
+
});
|
|
161
|
+
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BuyButtonIDQuery } from '../../__generated__/BuyButtonIDQuery.graphql.js';
|
|
3
3
|
import { BuyButtonSlugQuery } from '../../__generated__/BuyButtonSlugQuery.graphql.js';
|
|
4
|
-
import {
|
|
4
|
+
import { SerializablePreloadedQuery } from '../../relay/loadSerializableQuery.js';
|
|
5
5
|
export interface BuyButton_props {
|
|
6
6
|
collectionName?: string;
|
|
7
7
|
label?: string;
|
|
@@ -14,7 +14,7 @@ export type LoadBuyButtonQueryVariables = {
|
|
|
14
14
|
collectionId?: never;
|
|
15
15
|
collectionSlug: string;
|
|
16
16
|
};
|
|
17
|
-
export declare function loadBuyButtonQuery(variables: LoadBuyButtonQueryVariables
|
|
17
|
+
export declare function loadBuyButtonQuery(variables: LoadBuyButtonQueryVariables): Promise<BuyButtonPreloadedQuery>;
|
|
18
18
|
export declare function BuyButtonPreloadedIDQueryRenderer({ preloadedQuery, ...rest }: BuyButton_props & {
|
|
19
19
|
preloadedQuery: SerializablePreloadedQuery<BuyButtonIDQuery>;
|
|
20
20
|
}): React.JSX.Element;
|
|
@@ -57,16 +57,16 @@ function BuyButtonComponent(_ref) {
|
|
|
57
57
|
}
|
|
58
58
|
const idQuery = (_BuyButtonIDQuery.hash && _BuyButtonIDQuery.hash !== "4fbf1dbf9e6c530a5d38c697b174d8b0" && console.error("The definition of 'BuyButtonIDQuery' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _BuyButtonIDQuery);
|
|
59
59
|
const slugQuery = (_BuyButtonSlugQuery.hash && _BuyButtonSlugQuery.hash !== "6e750adea09698f7cb61f435cd88fd26" && console.error("The definition of 'BuyButtonSlugQuery' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _BuyButtonSlugQuery);
|
|
60
|
-
export async function loadBuyButtonQuery(variables
|
|
60
|
+
export async function loadBuyButtonQuery(variables) {
|
|
61
61
|
if (variables.collectionId) {
|
|
62
62
|
return loadSerializableQuery(BuyButtonIDQueryNode, {
|
|
63
63
|
collectionId: variables.collectionId
|
|
64
|
-
}
|
|
64
|
+
});
|
|
65
65
|
}
|
|
66
66
|
if (variables.collectionSlug) {
|
|
67
67
|
return loadSerializableQuery(BuyButtonSlugQueryNode, {
|
|
68
68
|
collectionSlug: variables.collectionSlug
|
|
69
|
-
}
|
|
69
|
+
});
|
|
70
70
|
}
|
|
71
71
|
throw new Error('loadBuyButtonQuery expected either a collectionId or collectionSlug');
|
|
72
72
|
}
|
|
@@ -1,18 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { CartButtonQuery } from '../../__generated__/CartButtonQuery.graphql.js';
|
|
3
|
-
import { LoadSerializableQueryOptions, SerializablePreloadedQuery } from '../../relay/loadSerializableQuery.js';
|
|
4
2
|
export interface CartButton_props {
|
|
5
3
|
label?: string;
|
|
6
4
|
buttonStyle?: string;
|
|
7
5
|
children?: React.ReactNode;
|
|
8
6
|
suffix?: string;
|
|
9
7
|
}
|
|
10
|
-
export
|
|
11
|
-
export declare function loadCartButtonQuery(options?: LoadSerializableQueryOptions): Promise<CartButtonPreloadedQuery>;
|
|
12
|
-
export declare function CartButtonPreloadedQueryRenderer({ preloadedQuery, ...rest }: CartButton_props & {
|
|
13
|
-
preloadedQuery: CartButtonPreloadedQuery;
|
|
14
|
-
}): React.JSX.Element;
|
|
15
|
-
export type CartButton_unifiedProps = CartButton_props & {
|
|
16
|
-
preloadedQuery?: CartButtonPreloadedQuery;
|
|
17
|
-
};
|
|
18
|
-
export default function CartButton(props: CartButton_unifiedProps): React.JSX.Element;
|
|
8
|
+
export default function CartButton(props: CartButton_props): React.JSX.Element;
|
|
@@ -5,12 +5,9 @@ import _CartButtonQuery from "../../__generated__/CartButtonQuery.graphql.js";
|
|
|
5
5
|
import _CartButton_order from "../../__generated__/CartButton_order.graphql.js";
|
|
6
6
|
import React, { useEffect, useCallback, useState } from 'react';
|
|
7
7
|
import { useDispatch } from 'react-redux';
|
|
8
|
-
import { graphql, useFragment, useLazyLoadQuery
|
|
9
|
-
import CartButtonQueryNode from '../../__generated__/CartButtonQuery.graphql.js';
|
|
8
|
+
import { graphql, useFragment, useLazyLoadQuery } from 'react-relay';
|
|
10
9
|
import ComponentsContext from '../ComponentsContext.js';
|
|
11
10
|
import { CartNew } from '../Icons/index.js';
|
|
12
|
-
import loadSerializableQuery from '../../relay/loadSerializableQuery.js';
|
|
13
|
-
import useSerializablePreloadedQuery from '../../relay/useSerializablePreloadedQuery.js';
|
|
14
11
|
import Price, { PriceFormat } from '../Price/index.js';
|
|
15
12
|
import { EnsureFontdueContext } from '../FontdueContextProvider/index.js';
|
|
16
13
|
function getOrderCount(order) {
|
|
@@ -91,35 +88,18 @@ function CartButtonComponent(_ref) {
|
|
|
91
88
|
}, suffixNodes))));
|
|
92
89
|
}
|
|
93
90
|
const query = (_CartButtonQuery.hash && _CartButtonQuery.hash !== "5c0da5849bf1215a9d1f264831830f71" && console.error("The definition of 'CartButtonQuery' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _CartButtonQuery);
|
|
94
|
-
export async function loadCartButtonQuery(options) {
|
|
95
|
-
return loadSerializableQuery(CartButtonQueryNode, {}, options);
|
|
96
|
-
}
|
|
97
|
-
export function CartButtonPreloadedQueryRenderer(_ref2) {
|
|
98
|
-
var _data$viewer;
|
|
99
|
-
let {
|
|
100
|
-
preloadedQuery,
|
|
101
|
-
...rest
|
|
102
|
-
} = _ref2;
|
|
103
|
-
const queryRef = useSerializablePreloadedQuery(preloadedQuery);
|
|
104
|
-
const data = usePreloadedQuery(query, queryRef);
|
|
105
|
-
return /*#__PURE__*/React.createElement(CartButtonComponent, _extends({}, rest, {
|
|
106
|
-
order: ((_data$viewer = data.viewer) === null || _data$viewer === void 0 ? void 0 : _data$viewer.currentOrder) ?? null
|
|
107
|
-
}));
|
|
108
|
-
}
|
|
109
91
|
function CartButtonLazyQueryRenderer(props) {
|
|
110
|
-
var _data$
|
|
92
|
+
var _data$viewer;
|
|
111
93
|
const data = useLazyLoadQuery(query, {});
|
|
112
94
|
return /*#__PURE__*/React.createElement(CartButtonComponent, _extends({}, props, {
|
|
113
|
-
order: ((_data$
|
|
95
|
+
order: ((_data$viewer = data.viewer) === null || _data$viewer === void 0 ? void 0 : _data$viewer.currentOrder) ?? null
|
|
114
96
|
}));
|
|
115
97
|
}
|
|
116
|
-
|
|
117
|
-
//
|
|
118
|
-
//
|
|
119
|
-
//
|
|
120
|
-
//
|
|
98
|
+
|
|
99
|
+
// Cart contents are per-customer-session, so a server-side preload from a
|
|
100
|
+
// CDN-cached SSG/prerender environment (no session cookies) just caches an
|
|
101
|
+
// empty cart and delays the real one. CartButton always lazy-fetches on
|
|
102
|
+
// hydration — same pattern as StoreModal.
|
|
121
103
|
export default function CartButton(props) {
|
|
122
|
-
return /*#__PURE__*/React.createElement(EnsureFontdueContext, null,
|
|
123
|
-
preloadedQuery: props.preloadedQuery
|
|
124
|
-
})) : /*#__PURE__*/React.createElement(CartButtonLazyQueryRenderer, props));
|
|
104
|
+
return /*#__PURE__*/React.createElement(EnsureFontdueContext, null, /*#__PURE__*/React.createElement(CartButtonLazyQueryRenderer, props));
|
|
125
105
|
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { CartButton_props } from './index
|
|
3
|
-
export type { CartButtonPreloadedQuery } from './index.js';
|
|
4
|
-
export declare function loadCartButtonQuery(): never;
|
|
2
|
+
import { CartButton_props } from './index';
|
|
5
3
|
export default function CartButton(props: CartButton_props): Promise<React.JSX.Element>;
|
|
@@ -1,24 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import loadSerializableQuery from '../../relay/loadSerializableQuery.js';
|
|
4
|
-
import { CartButtonPreloadedQueryRenderer } from './index.js';
|
|
5
|
-
import CartButtonQueryNode from '../../__generated__/CartButtonQuery.graphql.js';
|
|
6
|
-
// Stub for the RSC export condition. `<CartButton>`'s server entrypoint awaits
|
|
7
|
-
// its query for consumers, so RSC users should never call `loadCartButtonQuery`
|
|
8
|
-
// manually. Re-exporting a throwing stub makes the mistake obvious — without
|
|
9
|
-
// it, importing the loader from `'fontdue-js/CartButton'` in a server
|
|
10
|
-
// component would fail at build time with `Named export not found`.
|
|
11
|
-
export function loadCartButtonQuery() {
|
|
12
|
-
throw new Error("loadCartButtonQuery isn't needed in React Server Components — " + 'the <CartButton> server entrypoint awaits its query automatically. ' + 'Drop the manual call.');
|
|
13
|
-
}
|
|
1
|
+
"use strict";
|
|
14
2
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = CartButton;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _loadSerializableQuery = _interopRequireDefault(require("../../relay/loadSerializableQuery"));
|
|
9
|
+
var _index = require("./index");
|
|
10
|
+
var _CartButtonQuery = _interopRequireDefault(require("../../__generated__/CartButtonQuery.graphql"));
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
13
|
+
async function CartButton(props) {
|
|
14
|
+
const preloadedQuery = await (0, _loadSerializableQuery.default)(_CartButtonQuery.default, {});
|
|
15
|
+
return /*#__PURE__*/_react.default.createElement(_index.CartButtonPreloadedQueryRenderer, _extends({
|
|
22
16
|
preloadedQuery: preloadedQuery
|
|
23
17
|
}, props));
|
|
24
18
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { SerializablePreloadedQuery } from '../../relay/loadSerializableQuery.js';
|
|
3
3
|
import { CharacterViewerIDQuery } from '../../__generated__/CharacterViewerIDQuery.graphql.js';
|
|
4
4
|
import { CharacterViewerSlugQuery } from '../../__generated__/CharacterViewerSlugQuery.graphql.js';
|
|
5
5
|
export interface CharacterViewer_props {
|
|
@@ -12,7 +12,7 @@ export type LoadCharacterViewerQueryVariables = {
|
|
|
12
12
|
collectionId?: never;
|
|
13
13
|
collectionSlug: string;
|
|
14
14
|
};
|
|
15
|
-
export declare function loadCharacterViewerQuery(variables: LoadCharacterViewerQueryVariables
|
|
15
|
+
export declare function loadCharacterViewerQuery(variables: LoadCharacterViewerQueryVariables): Promise<CharacterViewerPreloadedQuery>;
|
|
16
16
|
export declare function CharacterViewerPreloadedIDQueryRenderer({ preloadedQuery, ...rest }: CharacterViewer_props & {
|
|
17
17
|
preloadedQuery: SerializablePreloadedQuery<CharacterViewerIDQuery>;
|
|
18
18
|
}): React.JSX.Element | null;
|
|
@@ -399,16 +399,16 @@ function CharacterViewerComponent(_ref3) {
|
|
|
399
399
|
}
|
|
400
400
|
const idQuery = (_CharacterViewerIDQuery.hash && _CharacterViewerIDQuery.hash !== "f90b09a4df6d95307b0a5d5fda487cdc" && console.error("The definition of 'CharacterViewerIDQuery' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _CharacterViewerIDQuery);
|
|
401
401
|
const slugQuery = (_CharacterViewerSlugQuery.hash && _CharacterViewerSlugQuery.hash !== "afa08a8f050e0434308892fea6e3c267" && console.error("The definition of 'CharacterViewerSlugQuery' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _CharacterViewerSlugQuery);
|
|
402
|
-
export async function loadCharacterViewerQuery(variables
|
|
402
|
+
export async function loadCharacterViewerQuery(variables) {
|
|
403
403
|
if (variables.collectionId) {
|
|
404
404
|
return loadSerializableQuery(CharacterViewerIDQueryNode, {
|
|
405
405
|
collectionId: variables.collectionId
|
|
406
|
-
}
|
|
406
|
+
});
|
|
407
407
|
}
|
|
408
408
|
if (variables.collectionSlug) {
|
|
409
409
|
return loadSerializableQuery(CharacterViewerSlugQueryNode, {
|
|
410
410
|
collectionSlug: variables.collectionSlug
|
|
411
|
-
}
|
|
411
|
+
});
|
|
412
412
|
}
|
|
413
413
|
throw new Error('loadCharacterViewerQuery expected either collectionId or collectionSlug');
|
|
414
414
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Store } from 'redux';
|
|
3
|
-
import { Config } from '../ConfigContext
|
|
4
|
-
import { FontdueAction, FontdueState } from '../../reducer
|
|
5
|
-
import { Components } from '../ComponentsContext
|
|
3
|
+
import { Config } from '../ConfigContext';
|
|
4
|
+
import { FontdueAction, FontdueState } from '../../reducer';
|
|
5
|
+
import { Components } from '../ComponentsContext';
|
|
6
6
|
export interface FontdueProvider_props {
|
|
7
7
|
children?: React.ReactNode;
|
|
8
8
|
url?: string;
|
|
@@ -11,6 +11,4 @@ export interface FontdueProvider_props {
|
|
|
11
11
|
components?: Components;
|
|
12
12
|
store?: Store<FontdueState, FontdueAction>;
|
|
13
13
|
}
|
|
14
|
-
export default function FontdueProviderClientComponent({ children, url, stripeIntegration, config, components, store,
|
|
15
|
-
renderAuxUI?: boolean;
|
|
16
|
-
}): React.JSX.Element;
|
|
14
|
+
export default function FontdueProviderClientComponent({ children, url, stripeIntegration, config, components, store, }: FontdueProvider_props): React.JSX.Element;
|
|
@@ -1,69 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
'use client';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return ref.current;
|
|
26
|
-
}
|
|
27
|
-
if (clientStore == null) clientStore = createDefaultStore(config);
|
|
28
|
-
return clientStore;
|
|
29
|
-
}
|
|
30
|
-
const ConsentBanner = /*#__PURE__*/lazy(() => retryImport(() => import('../ConsentBanner/index.js')));
|
|
31
|
-
const Tracking = /*#__PURE__*/lazy(() => retryImport(() => import('../Tracking/index.js')));
|
|
32
|
-
const ServerConfigProvider = /*#__PURE__*/lazy(() => retryImport(() => import('../ServerConfigProvider/index.js')));
|
|
33
|
-
export default function FontdueProviderClientComponent(_ref) {
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = FontdueProviderClientComponent;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _reactErrorBoundary = require("react-error-boundary");
|
|
10
|
+
var _reactRedux = require("react-redux");
|
|
11
|
+
var _reactRelay = require("react-relay");
|
|
12
|
+
var _environment = require("../../relay/environment");
|
|
13
|
+
var _ConfigContext = _interopRequireWildcard(require("../ConfigContext"));
|
|
14
|
+
var _reducer = require("../../reducer");
|
|
15
|
+
var _ComponentsContext = _interopRequireDefault(require("../ComponentsContext"));
|
|
16
|
+
var _UrlContext = _interopRequireDefault(require("../UrlContext"));
|
|
17
|
+
var _retryImport = _interopRequireDefault(require("../../retryImport"));
|
|
18
|
+
var _corsError = require("../../corsError");
|
|
19
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
20
|
+
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); }
|
|
21
|
+
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; }
|
|
22
|
+
const ConsentBanner = /*#__PURE__*/(0, _react.lazy)(() => (0, _retryImport.default)(() => Promise.resolve().then(() => _interopRequireWildcard(require('../ConsentBanner')))));
|
|
23
|
+
const Tracking = /*#__PURE__*/(0, _react.lazy)(() => (0, _retryImport.default)(() => Promise.resolve().then(() => _interopRequireWildcard(require('../Tracking')))));
|
|
24
|
+
const ServerConfigProvider = /*#__PURE__*/(0, _react.lazy)(() => (0, _retryImport.default)(() => Promise.resolve().then(() => _interopRequireWildcard(require('../ServerConfigProvider')))));
|
|
25
|
+
function FontdueProviderClientComponent(_ref) {
|
|
34
26
|
let {
|
|
35
27
|
children,
|
|
36
28
|
url,
|
|
37
29
|
stripeIntegration,
|
|
38
30
|
config,
|
|
39
31
|
components,
|
|
40
|
-
store
|
|
41
|
-
renderAuxUI
|
|
32
|
+
store
|
|
42
33
|
} = _ref;
|
|
43
|
-
const environment = useCurrentEnvironment({
|
|
34
|
+
const environment = (0, _environment.useCurrentEnvironment)({
|
|
44
35
|
url,
|
|
45
36
|
stripeIntegration
|
|
46
37
|
});
|
|
47
|
-
const configValue = makeConfig(config);
|
|
48
|
-
setCorsModalEnabled(configValue.corsErrorModal);
|
|
49
|
-
const
|
|
50
|
-
return /*#__PURE__*/
|
|
38
|
+
const configValue = (0, _ConfigContext.makeConfig)(config);
|
|
39
|
+
(0, _corsError.setCorsModalEnabled)(configValue.corsErrorModal);
|
|
40
|
+
const storeRef = (0, _react.useRef)(store ?? (0, _reducer.createDefaultStore)(config));
|
|
41
|
+
return /*#__PURE__*/_react.default.createElement(_reactRelay.RelayEnvironmentProvider, {
|
|
51
42
|
environment: environment
|
|
52
|
-
}, /*#__PURE__*/
|
|
53
|
-
store:
|
|
54
|
-
}, /*#__PURE__*/
|
|
43
|
+
}, /*#__PURE__*/_react.default.createElement(_reactRedux.Provider, {
|
|
44
|
+
store: storeRef.current
|
|
45
|
+
}, /*#__PURE__*/_react.default.createElement(_react.Suspense, {
|
|
55
46
|
fallback: null
|
|
56
|
-
}, /*#__PURE__*/
|
|
47
|
+
}, /*#__PURE__*/_react.default.createElement(_ConfigContext.default.Provider, {
|
|
57
48
|
value: configValue
|
|
58
|
-
}, /*#__PURE__*/
|
|
49
|
+
}, /*#__PURE__*/_react.default.createElement(_UrlContext.default.Provider, {
|
|
59
50
|
value: url ?? (typeof process !== 'undefined' ? process.env.NEXT_PUBLIC_FONTDUE_URL : undefined) ?? ''
|
|
60
|
-
}, /*#__PURE__*/
|
|
51
|
+
}, /*#__PURE__*/_react.default.createElement(_ComponentsContext.default.Provider, {
|
|
61
52
|
value: components ?? {}
|
|
62
|
-
}, children,
|
|
53
|
+
}, children, /*#__PURE__*/_react.default.createElement(_reactErrorBoundary.ErrorBoundary, {
|
|
63
54
|
fallback: null
|
|
64
|
-
}, /*#__PURE__*/
|
|
55
|
+
}, /*#__PURE__*/_react.default.createElement(_react.Suspense, {
|
|
65
56
|
fallback: null
|
|
66
|
-
}, /*#__PURE__*/
|
|
57
|
+
}, /*#__PURE__*/_react.default.createElement(ServerConfigProvider, {
|
|
67
58
|
codeConfig: config
|
|
68
|
-
}, /*#__PURE__*/
|
|
59
|
+
}, /*#__PURE__*/_react.default.createElement(ConsentBanner, null), /*#__PURE__*/_react.default.createElement(Tracking, null))))))))));
|
|
69
60
|
}
|
|
@@ -19,9 +19,7 @@ export default async function FontdueProviderServer(_ref) {
|
|
|
19
19
|
preloadedQuery,
|
|
20
20
|
...rest
|
|
21
21
|
} = _ref;
|
|
22
|
-
const resolved = preloadedQuery ?? (await loadFontdueProviderQueryImpl(
|
|
23
|
-
url: rest.url
|
|
24
|
-
}));
|
|
22
|
+
const resolved = preloadedQuery ?? (await loadFontdueProviderQueryImpl());
|
|
25
23
|
return /*#__PURE__*/React.createElement(FontdueProvider, _extends({}, rest, {
|
|
26
24
|
preloadedQuery: resolved
|
|
27
25
|
}));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { SerializablePreloadedQuery } from '../../relay/loadSerializableQuery.js';
|
|
3
3
|
import { NewsletterSignupQuery } from '../../__generated__/NewsletterSignupQuery.graphql.js';
|
|
4
4
|
export type NewsletterSignupPreloadedQuery = SerializablePreloadedQuery<NewsletterSignupQuery>;
|
|
5
|
-
export declare function loadNewsletterSignupQuery(
|
|
5
|
+
export declare function loadNewsletterSignupQuery(): Promise<NewsletterSignupPreloadedQuery>;
|
|
6
6
|
export interface NewsletterSignup_props {
|
|
7
7
|
optInLabel?: string;
|
|
8
8
|
successLabel?: string;
|
|
@@ -13,8 +13,8 @@ import useSerializablePreloadedQuery from '../../relay/useSerializablePreloadedQ
|
|
|
13
13
|
import NewsletterSignupQueryNode from '../../__generated__/NewsletterSignupQuery.graphql.js';
|
|
14
14
|
import { EnsureFontdueContext } from '../FontdueContextProvider/index.js';
|
|
15
15
|
const updateCustomerMutation = (_NewsletterSignupUpdateCustomerMutation.hash && _NewsletterSignupUpdateCustomerMutation.hash !== "769087891b6f263122bbb630b3f2ca6c" && console.error("The definition of 'NewsletterSignupUpdateCustomerMutation' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _NewsletterSignupUpdateCustomerMutation);
|
|
16
|
-
export async function loadNewsletterSignupQuery(
|
|
17
|
-
return loadSerializableQuery(NewsletterSignupQueryNode, {}
|
|
16
|
+
export async function loadNewsletterSignupQuery() {
|
|
17
|
+
return loadSerializableQuery(NewsletterSignupQueryNode, {});
|
|
18
18
|
}
|
|
19
19
|
const query = (_NewsletterSignupQuery.hash && _NewsletterSignupQuery.hash !== "24b303198a6038318723fc0124548862" && console.error("The definition of 'NewsletterSignupQuery' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _NewsletterSignupQuery);
|
|
20
20
|
function NewsletterSignupComponent(_ref) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TestFontsForm_Query } from '../../__generated__/TestFontsForm_Query.graphql.js';
|
|
3
|
-
import {
|
|
3
|
+
import { SerializablePreloadedQuery } from '../../relay/loadSerializableQuery.js';
|
|
4
4
|
export interface TestFontsForm_props {
|
|
5
5
|
agreementLabel?: string;
|
|
6
6
|
downloadLabel?: string;
|
|
7
7
|
newsletterCheckboxChecked?: boolean;
|
|
8
8
|
}
|
|
9
9
|
export type TestFontsFormPreloadedQuery = SerializablePreloadedQuery<TestFontsForm_Query>;
|
|
10
|
-
export declare function loadTestFontsFormQuery(
|
|
10
|
+
export declare function loadTestFontsFormQuery(): Promise<TestFontsFormPreloadedQuery>;
|
|
11
11
|
export declare function TestFontsFormPreloadedQueryRenderer({ preloadedQuery, ...rest }: TestFontsForm_props & {
|
|
12
12
|
preloadedQuery: TestFontsFormPreloadedQuery;
|
|
13
13
|
}): React.JSX.Element;
|
|
@@ -194,8 +194,8 @@ const TestFontsFormComponent = _ref2 => {
|
|
|
194
194
|
}));
|
|
195
195
|
};
|
|
196
196
|
const query = (_TestFontsForm_Query.hash && _TestFontsForm_Query.hash !== "cd43f0cacc4dcf01cf94fb1ff97197ca" && console.error("The definition of 'TestFontsForm_Query' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _TestFontsForm_Query);
|
|
197
|
-
export async function loadTestFontsFormQuery(
|
|
198
|
-
return loadSerializableQuery(TestFontsFormQueryNode, {}
|
|
197
|
+
export async function loadTestFontsFormQuery() {
|
|
198
|
+
return loadSerializableQuery(TestFontsFormQueryNode, {});
|
|
199
199
|
}
|
|
200
200
|
export function TestFontsFormPreloadedQueryRenderer(_ref4) {
|
|
201
201
|
let {
|