@gem-sdk/pages 1.9.36 → 1.9.44
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.
|
@@ -54,18 +54,20 @@ const Toolbox = ()=>{
|
|
|
54
54
|
return value;
|
|
55
55
|
});
|
|
56
56
|
const fontUrl = googleFonts.createFontUrl(font);
|
|
57
|
-
if (!fontUrl) return;
|
|
58
57
|
const globalStyle = document.getElementById(globalStyleId);
|
|
59
58
|
const googleFont = document.getElementById(globalFontId);
|
|
60
|
-
if (
|
|
61
|
-
googleFont
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
59
|
+
if (fontUrl) {
|
|
60
|
+
if (googleFont) {
|
|
61
|
+
if (googleFont.getAttribute('href') !== fontUrl) {
|
|
62
|
+
googleFont.setAttribute('href', fontUrl);
|
|
63
|
+
}
|
|
64
|
+
} else {
|
|
65
|
+
const link = document.createElement('link');
|
|
66
|
+
link.id = globalFontId;
|
|
67
|
+
link.href = fontUrl;
|
|
68
|
+
link.rel = 'stylesheet';
|
|
69
|
+
document.head.appendChild(link);
|
|
70
|
+
}
|
|
69
71
|
}
|
|
70
72
|
if (globalStyle) {
|
|
71
73
|
globalStyle.innerHTML = themeStyle;
|
|
@@ -19,7 +19,7 @@ const CollectionGlobalProvider = ({ children })=>{
|
|
|
19
19
|
isSample: false
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
|
-
const { data: collections ,
|
|
22
|
+
const { data: collections , isLoading , error } = core.useCollectionsQuery(variables);
|
|
23
23
|
const collection = collections?.collections?.edges?.[0]?.node;
|
|
24
24
|
const onChangeCollectionInfo = react.useCallback((e)=>{
|
|
25
25
|
const detail = e.detail;
|
|
@@ -42,7 +42,7 @@ const CollectionGlobalProvider = ({ children })=>{
|
|
|
42
42
|
onChangeCollectionInfo
|
|
43
43
|
]);
|
|
44
44
|
return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
45
|
-
children:
|
|
45
|
+
children: isLoading ? /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
46
46
|
children: "Loading..."
|
|
47
47
|
}) : error ? /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
48
48
|
children: [
|
|
@@ -50,18 +50,20 @@ const Toolbox = ()=>{
|
|
|
50
50
|
return value;
|
|
51
51
|
});
|
|
52
52
|
const fontUrl = createFontUrl(font);
|
|
53
|
-
if (!fontUrl) return;
|
|
54
53
|
const globalStyle = document.getElementById(globalStyleId);
|
|
55
54
|
const googleFont = document.getElementById(globalFontId);
|
|
56
|
-
if (
|
|
57
|
-
googleFont
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
55
|
+
if (fontUrl) {
|
|
56
|
+
if (googleFont) {
|
|
57
|
+
if (googleFont.getAttribute('href') !== fontUrl) {
|
|
58
|
+
googleFont.setAttribute('href', fontUrl);
|
|
59
|
+
}
|
|
60
|
+
} else {
|
|
61
|
+
const link = document.createElement('link');
|
|
62
|
+
link.id = globalFontId;
|
|
63
|
+
link.href = fontUrl;
|
|
64
|
+
link.rel = 'stylesheet';
|
|
65
|
+
document.head.appendChild(link);
|
|
66
|
+
}
|
|
65
67
|
}
|
|
66
68
|
if (globalStyle) {
|
|
67
69
|
globalStyle.innerHTML = themeStyle;
|
|
@@ -15,7 +15,7 @@ const CollectionGlobalProvider = ({ children })=>{
|
|
|
15
15
|
isSample: false
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
const { data: collections ,
|
|
18
|
+
const { data: collections , isLoading , error } = useCollectionsQuery(variables);
|
|
19
19
|
const collection = collections?.collections?.edges?.[0]?.node;
|
|
20
20
|
const onChangeCollectionInfo = useCallback((e)=>{
|
|
21
21
|
const detail = e.detail;
|
|
@@ -38,7 +38,7 @@ const CollectionGlobalProvider = ({ children })=>{
|
|
|
38
38
|
onChangeCollectionInfo
|
|
39
39
|
]);
|
|
40
40
|
return /*#__PURE__*/ jsx(Fragment, {
|
|
41
|
-
children:
|
|
41
|
+
children: isLoading ? /*#__PURE__*/ jsx("div", {
|
|
42
42
|
children: "Loading..."
|
|
43
43
|
}) : error ? /*#__PURE__*/ jsxs("div", {
|
|
44
44
|
children: [
|