fontdue-js 1.12.0 → 1.12.1
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__/StoreModalIndexQuery.graphql.d.ts +1 -0
- package/dist/__generated__/StoreModalIndexQuery.graphql.js +14 -14
- package/dist/components/BuyButton/index.js +1 -0
- package/dist/components/StoreModal/StoreModalIndex.js +5 -6
- package/dist/components/StoreModal/StoreModalRouter.d.ts +0 -3
- package/dist/components/StoreModal/StoreModalRouter.js +13 -16
- package/dist/components/StoreModal/index.js +2 -11
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@ export declare type StoreModalIndexQueryResponse = {
|
|
|
8
8
|
readonly rootCollections: {
|
|
9
9
|
readonly edges: ReadonlyArray<{
|
|
10
10
|
readonly node: {
|
|
11
|
+
readonly id: string;
|
|
11
12
|
readonly " $fragmentRefs": FragmentRefs<"StoreModalIndexItem_fontCollection">;
|
|
12
13
|
} | null;
|
|
13
14
|
} | null> | null;
|
|
@@ -16,8 +16,8 @@ query StoreModalIndexQuery(
|
|
|
16
16
|
rootCollections: fontCollections(onlyRoots: true, first: 99, excludeTags: $excludeTags) {
|
|
17
17
|
edges {
|
|
18
18
|
node {
|
|
19
|
-
...StoreModalIndexItem_fontCollection
|
|
20
19
|
id
|
|
20
|
+
...StoreModalIndexItem_fontCollection
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -85,21 +85,21 @@ const node = function () {
|
|
|
85
85
|
"alias": null,
|
|
86
86
|
"args": null,
|
|
87
87
|
"kind": "ScalarField",
|
|
88
|
-
"name": "
|
|
88
|
+
"name": "id",
|
|
89
89
|
"storageKey": null
|
|
90
90
|
},
|
|
91
91
|
v3 = {
|
|
92
92
|
"alias": null,
|
|
93
93
|
"args": null,
|
|
94
94
|
"kind": "ScalarField",
|
|
95
|
-
"name": "
|
|
95
|
+
"name": "totalStyles",
|
|
96
96
|
"storageKey": null
|
|
97
97
|
},
|
|
98
98
|
v4 = {
|
|
99
99
|
"alias": null,
|
|
100
100
|
"args": null,
|
|
101
101
|
"kind": "ScalarField",
|
|
102
|
-
"name": "
|
|
102
|
+
"name": "isVariableFont",
|
|
103
103
|
"storageKey": null
|
|
104
104
|
},
|
|
105
105
|
v5 = {
|
|
@@ -143,7 +143,7 @@ const node = function () {
|
|
|
143
143
|
"kind": "LinkedField",
|
|
144
144
|
"name": "node",
|
|
145
145
|
"plural": false,
|
|
146
|
-
"selections": [{
|
|
146
|
+
"selections": [v2 /*: any*/, {
|
|
147
147
|
"args": null,
|
|
148
148
|
"kind": "FragmentSpread",
|
|
149
149
|
"name": "StoreModalIndexItem_fontCollection"
|
|
@@ -192,7 +192,7 @@ const node = function () {
|
|
|
192
192
|
"kind": "LinkedField",
|
|
193
193
|
"name": "node",
|
|
194
194
|
"plural": false,
|
|
195
|
-
"selections": [v2 /*: any*/, {
|
|
195
|
+
"selections": [v2 /*: any*/, v3 /*: any*/, {
|
|
196
196
|
"alias": null,
|
|
197
197
|
"args": [{
|
|
198
198
|
"kind": "Literal",
|
|
@@ -203,10 +203,10 @@ const node = function () {
|
|
|
203
203
|
"kind": "LinkedField",
|
|
204
204
|
"name": "children",
|
|
205
205
|
"plural": true,
|
|
206
|
-
"selections": [
|
|
206
|
+
"selections": [v4 /*: any*/, v3 /*: any*/, v2 /*: any*/],
|
|
207
207
|
|
|
208
208
|
"storageKey": "children(collectionTypes:[\"FAMILY\"])"
|
|
209
|
-
},
|
|
209
|
+
}, v5 /*: any*/, v4 /*: any*/, {
|
|
210
210
|
"alias": null,
|
|
211
211
|
"args": null,
|
|
212
212
|
"kind": "ScalarField",
|
|
@@ -238,10 +238,10 @@ const node = function () {
|
|
|
238
238
|
"kind": "ScalarField",
|
|
239
239
|
"name": "cssUrl",
|
|
240
240
|
"storageKey": null
|
|
241
|
-
},
|
|
241
|
+
}, v2 /*: any*/],
|
|
242
242
|
|
|
243
243
|
"storageKey": null
|
|
244
|
-
},
|
|
244
|
+
}, v2 /*: any*/],
|
|
245
245
|
|
|
246
246
|
"storageKey": null
|
|
247
247
|
}],
|
|
@@ -250,21 +250,21 @@ const node = function () {
|
|
|
250
250
|
"storageKey": null
|
|
251
251
|
}],
|
|
252
252
|
"storageKey": null
|
|
253
|
-
},
|
|
253
|
+
}, v2 /*: any*/],
|
|
254
254
|
|
|
255
255
|
"storageKey": null
|
|
256
256
|
}]
|
|
257
257
|
},
|
|
258
258
|
"params": {
|
|
259
|
-
"cacheID": "
|
|
259
|
+
"cacheID": "0f5be213b1111b517d42ebde0348dcc4",
|
|
260
260
|
"id": null,
|
|
261
261
|
"metadata": {},
|
|
262
262
|
"name": "StoreModalIndexQuery",
|
|
263
263
|
"operationKind": "query",
|
|
264
|
-
"text": "query StoreModalIndexQuery(\n $excludeTags: [String!]\n) {\n viewer {\n rootCollections: fontCollections(onlyRoots: true, first: 99, excludeTags: $excludeTags) {\n edges {\n node {\n
|
|
264
|
+
"text": "query StoreModalIndexQuery(\n $excludeTags: [String!]\n) {\n viewer {\n rootCollections: fontCollections(onlyRoots: true, first: 99, excludeTags: $excludeTags) {\n edges {\n node {\n id\n ...StoreModalIndexItem_fontCollection\n }\n }\n }\n id\n }\n}\n\nfragment FontStyle_fontStyle on FontStyle {\n cssFamily\n name\n}\n\nfragment StoreModalIndexItem_fontCollection on FontCollection {\n ...useTotalStyles_fontCollection\n id\n name\n totalStyles\n isVariableFont\n children(collectionTypes: [FAMILY]) {\n isVariableFont\n totalStyles\n id\n }\n collectionType\n featureStyle {\n ...FontStyle_fontStyle\n family {\n cssUrl\n id\n }\n id\n }\n}\n\nfragment useTotalStyles_fontCollection on FontCollection {\n totalStyles\n children(collectionTypes: [FAMILY]) {\n isVariableFont\n totalStyles\n id\n }\n}\n"
|
|
265
265
|
}
|
|
266
266
|
};
|
|
267
267
|
}();
|
|
268
|
-
node.hash = '
|
|
268
|
+
node.hash = '5eaa31564579fe1265790984a85d1a12';
|
|
269
269
|
var _default = node;
|
|
270
270
|
exports.default = _default;
|
|
@@ -39,6 +39,7 @@ const BuyButtonBase = _ref => {
|
|
|
39
39
|
}, [dispatch, collection]);
|
|
40
40
|
(0, _react.useEffect)(() => {
|
|
41
41
|
if (!collection) return;
|
|
42
|
+
console.log(`Populating ${collection.id}`);
|
|
42
43
|
// populate as soon as BuyButton mounts. this prepares the StoreModal
|
|
43
44
|
// to be able to apply discounts as soon as the user clicks "BUY" on
|
|
44
45
|
// a style. (this is necessary if the bundle price is <= single style price)
|
|
@@ -15,16 +15,15 @@ const StoreModalIndex = _ref => {
|
|
|
15
15
|
let {
|
|
16
16
|
prepared
|
|
17
17
|
} = _ref;
|
|
18
|
-
const data = (0, _reactRelay.usePreloadedQuery)(_StoreModalIndexQuery !== void 0 ? _StoreModalIndexQuery : (_StoreModalIndexQuery = require("../../__generated__/StoreModalIndexQuery.graphql"), _StoreModalIndexQuery.hash && _StoreModalIndexQuery.hash !== "
|
|
18
|
+
const data = (0, _reactRelay.usePreloadedQuery)(_StoreModalIndexQuery !== void 0 ? _StoreModalIndexQuery : (_StoreModalIndexQuery = require("../../__generated__/StoreModalIndexQuery.graphql"), _StoreModalIndexQuery.hash && _StoreModalIndexQuery.hash !== "5eaa31564579fe1265790984a85d1a12" && console.error("The definition of 'StoreModalIndexQuery' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _StoreModalIndexQuery), prepared.indexQuery);
|
|
19
19
|
const viewer = data.viewer;
|
|
20
20
|
const edges = (viewer === null || viewer === void 0 ? void 0 : (_viewer$rootCollectio = viewer.rootCollections) === null || _viewer$rootCollectio === void 0 ? void 0 : _viewer$rootCollectio.edges) ?? [];
|
|
21
21
|
return /*#__PURE__*/_react.default.createElement(_StoreModalPageContainer.default, null, {
|
|
22
22
|
title: 'All collections',
|
|
23
|
-
body: edges.map(edge => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
})
|
|
23
|
+
body: edges.map(edge => /*#__PURE__*/_react.default.createElement(_StoreModalIndexItem.default, {
|
|
24
|
+
collection: edge.node,
|
|
25
|
+
key: edge.node.id
|
|
26
|
+
}))
|
|
28
27
|
});
|
|
29
28
|
};
|
|
30
29
|
var _default = StoreModalIndex;
|
|
@@ -5,26 +5,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var
|
|
8
|
+
var _reactRedux = require("react-redux");
|
|
9
|
+
var _reactRelay = require("react-relay");
|
|
10
|
+
var _routes = _interopRequireDefault(require("./routes"));
|
|
9
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
12
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
13
|
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; }
|
|
12
14
|
const StoreModalRouter = () => {
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
});
|
|
24
|
-
return () => dispose();
|
|
25
|
-
}, [router]);
|
|
26
|
-
return /*#__PURE__*/_react.default.createElement(routeEntry.Component, {
|
|
27
|
-
prepared: routeEntry.prepared
|
|
15
|
+
const environment = (0, _reactRelay.useRelayEnvironment)();
|
|
16
|
+
const currentRoute = (0, _reactRedux.useSelector)(state => state.storeModalRoute);
|
|
17
|
+
const route = _routes.default[currentRoute.name];
|
|
18
|
+
(0, _react.useEffect)(() => {}, [currentRoute]);
|
|
19
|
+
const prepared = (0, _react.useMemo)(() => {
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
return _routes.default[currentRoute.name].prepare(currentRoute.variables, environment);
|
|
22
|
+
}, [currentRoute, environment]);
|
|
23
|
+
return /*#__PURE__*/_react.default.createElement(route.Component, {
|
|
24
|
+
prepared: prepared
|
|
28
25
|
});
|
|
29
26
|
};
|
|
30
27
|
var _default = StoreModalRouter;
|
|
@@ -5,25 +5,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _reactRedux = require("react-redux");
|
|
9
|
-
var _reactRelay = require("react-relay");
|
|
10
8
|
var _StoreModalLoader = _interopRequireDefault(require("./StoreModalLoader"));
|
|
11
9
|
var _StoreModalContainer = _interopRequireDefault(require("./StoreModalContainer"));
|
|
12
10
|
var _StoreModalRouter = _interopRequireDefault(require("./StoreModalRouter"));
|
|
13
|
-
var _createRouter = _interopRequireDefault(require("./createRouter"));
|
|
14
|
-
var _StoreModalRouterContext = _interopRequireDefault(require("./StoreModalRouterContext"));
|
|
15
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
12
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
13
|
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; }
|
|
18
14
|
const StoreModal = () => {
|
|
19
|
-
|
|
20
|
-
const environment = (0, _reactRelay.useRelayEnvironment)();
|
|
21
|
-
const router = (0, _react.useRef)((0, _createRouter.default)(store, environment));
|
|
22
|
-
return /*#__PURE__*/_react.default.createElement(_StoreModalLoader.default, null, /*#__PURE__*/_react.default.createElement(_StoreModalRouterContext.default.Provider, {
|
|
23
|
-
value: router.current
|
|
24
|
-
}, /*#__PURE__*/_react.default.createElement(_react.Suspense, {
|
|
15
|
+
return /*#__PURE__*/_react.default.createElement(_StoreModalLoader.default, null, /*#__PURE__*/_react.default.createElement(_react.Suspense, {
|
|
25
16
|
fallback: null
|
|
26
|
-
}, /*#__PURE__*/_react.default.createElement(_StoreModalContainer.default, null, /*#__PURE__*/_react.default.createElement(_StoreModalRouter.default, null))))
|
|
17
|
+
}, /*#__PURE__*/_react.default.createElement(_StoreModalContainer.default, null, /*#__PURE__*/_react.default.createElement(_StoreModalRouter.default, null))));
|
|
27
18
|
};
|
|
28
19
|
var _default = StoreModal;
|
|
29
20
|
exports.default = _default;
|