@cuemath/leap 3.0.23-guru.0 → 3.0.23
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.
@@ -1,21 +1,28 @@
|
|
1
1
|
import { createGetAPI as o } from "@cuemath/rest-api";
|
2
2
|
import { BASE_URL_V1 as r } from "../../../../constants/api.js";
|
3
3
|
import { stringify as s } from "../../../../helpers/query-string.js";
|
4
|
-
const
|
5
|
-
|
6
|
-
|
4
|
+
const n = () => {
|
5
|
+
const t = window.location.hostname;
|
6
|
+
return t.startsWith("local") || t === "storybook.cuemath.com" ? t : null;
|
7
|
+
}, a = () => {
|
8
|
+
const t = n();
|
9
|
+
return t ? {
|
10
|
+
headers: {
|
11
|
+
"Learnosity-Host": t
|
12
|
+
// Set the Learnosity host header if applicable
|
13
|
+
}
|
14
|
+
} : void 0;
|
15
|
+
}, { useGet: u } = o({
|
16
|
+
getURL: (t, e) => `${r}/worksheets/fb575b36-7861-11e8-b8d4-acbc3277df8f/?${s({
|
17
|
+
activityReference: t,
|
7
18
|
sign: !0,
|
8
19
|
meta: !0,
|
9
20
|
test: !0,
|
10
|
-
...
|
21
|
+
...e
|
11
22
|
})}`,
|
12
|
-
params:
|
13
|
-
headers: {
|
14
|
-
"Learnosity-Host": window.location.hostname
|
15
|
-
}
|
16
|
-
} : void 0
|
23
|
+
params: a()
|
17
24
|
});
|
18
25
|
export {
|
19
|
-
|
26
|
+
u as usePreviewWorksheetGet
|
20
27
|
};
|
21
28
|
//# sourceMappingURL=get-preview-worksheet.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"get-preview-worksheet.js","sources":["../../../../../src/features/worksheet/worksheet-preview/api/get-preview-worksheet.ts"],"sourcesContent":["import type { IPreviewWorksheetModel } from '../../../../types/models/worksheet';\n\nimport { createGetAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V1 } from '../../../../constants/api';\nimport { stringify } from '../../../../helpers/query-string';\n\ntype TPreviewWorksheetQuery = {\n action: string;\n node_type: string;\n items?: string[];\n};\n\nconst { useGet: usePreviewWorksheetGet } = createGetAPI<\n IPreviewWorksheetModel,\n TPreviewWorksheetQuery\n>({\n getURL: (activityRef, query) =>\n `${BASE_URL_V1}/worksheets/fb575b36-7861-11e8-b8d4-acbc3277df8f/?${stringify({\n activityReference: activityRef,\n sign: true,\n meta: true,\n test: true,\n ...query,\n })}`,\n params:
|
1
|
+
{"version":3,"file":"get-preview-worksheet.js","sources":["../../../../../src/features/worksheet/worksheet-preview/api/get-preview-worksheet.ts"],"sourcesContent":["import type { IPreviewWorksheetModel } from '../../../../types/models/worksheet';\n\nimport { createGetAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V1 } from '../../../../constants/api';\nimport { stringify } from '../../../../helpers/query-string';\n\n/**\n * Determines the Learnosity host based on the current window location.\n * Returns the hostname if it starts with 'local' or matches 'storybook.cuemath.com',\n * otherwise returns null.\n */\nconst getLearnosityHost = () => {\n const hostname = window.location.hostname;\n\n if (hostname.startsWith('local') || hostname === 'storybook.cuemath.com') {\n return hostname;\n }\n\n return null;\n};\n\nconst getParams = () => {\n const learnosityHost = getLearnosityHost();\n\n return learnosityHost\n ? {\n headers: {\n 'Learnosity-Host': learnosityHost, // Set the Learnosity host header if applicable\n },\n }\n : undefined;\n};\n\ntype TPreviewWorksheetQuery = {\n action: string;\n node_type: string;\n items?: string[];\n};\n\nconst { useGet: usePreviewWorksheetGet } = createGetAPI<\n IPreviewWorksheetModel,\n TPreviewWorksheetQuery\n>({\n getURL: (activityRef, query) =>\n `${BASE_URL_V1}/worksheets/fb575b36-7861-11e8-b8d4-acbc3277df8f/?${stringify({\n activityReference: activityRef,\n sign: true,\n meta: true,\n test: true,\n ...query,\n })}`,\n params: getParams(),\n});\n\nexport { usePreviewWorksheetGet };\n"],"names":["getLearnosityHost","hostname","getParams","learnosityHost","usePreviewWorksheetGet","createGetAPI","activityRef","query","BASE_URL_V1","stringify"],"mappings":";;;AAYA,MAAMA,IAAoB,MAAM;AACxB,QAAAC,IAAW,OAAO,SAAS;AAEjC,SAAIA,EAAS,WAAW,OAAO,KAAKA,MAAa,0BACxCA,IAGF;AACT,GAEMC,IAAY,MAAM;AACtB,QAAMC,IAAiBH;AAEvB,SAAOG,IACH;AAAA,IACE,SAAS;AAAA,MACP,mBAAmBA;AAAA;AAAA,IACrB;AAAA,EAEF,IAAA;AACN,GAQM,EAAE,QAAQC,EAAuB,IAAIC,EAGzC;AAAA,EACA,QAAQ,CAACC,GAAaC,MACpB,GAAGC,CAAW,qDAAqDC,EAAU;AAAA,IAC3E,mBAAmBH;AAAA,IACnB,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,IACN,GAAGC;AAAA,EACJ,CAAA,CAAC;AAAA,EACJ,QAAQL,EAAU;AACpB,CAAC;"}
|