@gen3/frontend 0.11.11 → 0.11.12
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/cjs/index.js +979 -722
- package/dist/cjs/index.js.map +1 -1
- package/dist/dts/components/MessageCards/ErrorMessage.js +1 -1
- package/dist/dts/components/MessageCards/ErrorMessage.js.map +1 -1
- package/dist/dts/components/facets/FacetSelectionModal.d.ts +1 -2
- package/dist/dts/components/facets/FacetSelectionModal.d.ts.map +1 -1
- package/dist/dts/components/facets/FacetSelectionModal.js.map +1 -1
- package/dist/dts/components/facets/FacetSelector.d.ts +1 -2
- package/dist/dts/components/facets/FacetSelector.d.ts.map +1 -1
- package/dist/dts/components/facets/FacetSelector.js +1 -1
- package/dist/dts/components/facets/FacetSelector.js.map +1 -1
- package/dist/dts/components/facets/FacetTabs.d.ts +1 -2
- package/dist/dts/components/facets/FacetTabs.d.ts.map +1 -1
- package/dist/dts/components/facets/FacetTabs.js.map +1 -1
- package/dist/dts/components/facets/FiltersPanel.d.ts +9 -0
- package/dist/dts/components/facets/FiltersPanel.d.ts.map +1 -0
- package/dist/dts/{features/CohortBuilder → components/facets}/FiltersPanel.js +3 -2
- package/dist/dts/components/facets/FiltersPanel.js.map +1 -0
- package/dist/dts/components/facets/Panels/AccordianPanel.d.ts.map +1 -0
- package/dist/dts/{features/CohortBuilder → components/facets}/Panels/AccordianPanel.js +1 -1
- package/dist/dts/components/facets/Panels/AccordianPanel.js.map +1 -0
- package/dist/dts/components/facets/Panels/DropdownPanel.d.ts.map +1 -0
- package/dist/dts/{features/CohortBuilder → components/facets}/Panels/DropdownPanel.js +3 -3
- package/dist/dts/components/facets/Panels/DropdownPanel.js.map +1 -0
- package/dist/dts/components/facets/Panels/TabbedPanel.d.ts +4 -0
- package/dist/dts/components/facets/Panels/TabbedPanel.d.ts.map +1 -0
- package/dist/dts/{features/CohortBuilder → components/facets}/Panels/TabbedPanel.js +3 -2
- package/dist/dts/components/facets/Panels/TabbedPanel.js.map +1 -0
- package/dist/dts/components/facets/Panels/index.d.ts +5 -0
- package/dist/dts/components/facets/Panels/index.d.ts.map +1 -0
- package/dist/dts/components/facets/Panels/index.js +5 -0
- package/dist/dts/components/facets/Panels/index.js.map +1 -0
- package/dist/dts/{features/CohortBuilder → components/facets}/Panels/types.d.ts +4 -3
- package/dist/dts/components/facets/Panels/types.d.ts.map +1 -0
- package/dist/dts/components/facets/Panels/types.js.map +1 -0
- package/dist/dts/components/facets/createFacetCard.d.ts +1 -2
- package/dist/dts/components/facets/createFacetCard.d.ts.map +1 -1
- package/dist/dts/components/facets/createFacetCard.js.map +1 -1
- package/dist/dts/components/facets/createFacetCards.d.ts +1 -2
- package/dist/dts/components/facets/createFacetCards.d.ts.map +1 -1
- package/dist/dts/components/facets/createFacetCards.js.map +1 -1
- package/dist/dts/components/facets/index.d.ts +6 -1
- package/dist/dts/components/facets/index.d.ts.map +1 -1
- package/dist/dts/components/facets/index.js +6 -1
- package/dist/dts/components/facets/index.js.map +1 -1
- package/dist/dts/components/facets/types.d.ts +13 -2
- package/dist/dts/components/facets/types.d.ts.map +1 -1
- package/dist/dts/components/facets/utils.d.ts +2 -2
- package/dist/dts/components/facets/utils.d.ts.map +1 -1
- package/dist/dts/components/facets/utils.js +1 -1
- package/dist/dts/components/facets/utils.js.map +1 -1
- package/dist/dts/features/Analysis/AnalysisCard.js +1 -1
- package/dist/dts/features/Analysis/AnalysisCard.js.map +1 -1
- package/dist/dts/features/Analysis/AnalysisCardCompact.stories.d.ts +4 -4
- package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveOrCreateEntityModal.js +1 -1
- package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveOrCreateEntityModal.js.map +1 -1
- package/dist/dts/features/CohortBuilder/CohortPanel.d.ts.map +1 -1
- package/dist/dts/features/CohortBuilder/CohortPanel.js +1 -1
- package/dist/dts/features/CohortBuilder/CohortPanel.js.map +1 -1
- package/dist/dts/features/CohortBuilder/ExplorerTable/ArrayCellRenderer.d.ts +1 -1
- package/dist/dts/features/CohortBuilder/TabbedCohortBuilder.d.ts.map +1 -1
- package/dist/dts/features/CohortBuilder/TabbedCohortBuilder.js +16 -32
- package/dist/dts/features/CohortBuilder/TabbedCohortBuilder.js.map +1 -1
- package/dist/dts/features/CohortBuilder/types.d.ts +2 -2
- package/dist/dts/features/CohortBuilder/types.d.ts.map +1 -1
- package/dist/dts/features/CohortBuilder/types.js.map +1 -1
- package/dist/dts/features/CohortDiscovery/ChartsAndFacetsPanel.d.ts +2 -1
- package/dist/dts/features/CohortDiscovery/ChartsAndFacetsPanel.d.ts.map +1 -1
- package/dist/dts/features/CohortDiscovery/ChartsAndFacetsPanel.js.map +1 -1
- package/dist/dts/features/CohortDiscovery/CohortManagment/CohortManagerSelectors.d.ts +16 -16
- package/dist/dts/features/CohortDiscovery/FacetDefinitionsSlice.d.ts +1 -1
- package/dist/dts/features/CohortDiscovery/FacetDefinitionsSlice.d.ts.map +1 -1
- package/dist/dts/features/CohortDiscovery/FilterPanels/EnumFacetPanel.d.ts +1 -2
- package/dist/dts/features/CohortDiscovery/FilterPanels/EnumFacetPanel.d.ts.map +1 -1
- package/dist/dts/features/CohortDiscovery/FilterPanels/EnumFacetPanel.js.map +1 -1
- package/dist/dts/features/CohortDiscovery/FilterPanels/createFacetPanel.d.ts +2 -2
- package/dist/dts/features/CohortDiscovery/FilterPanels/createFacetPanel.d.ts.map +1 -1
- package/dist/dts/features/CohortDiscovery/FilterPanels/createFacetPanel.js.map +1 -1
- package/dist/dts/features/CohortDiscovery/RequestManagerSlice.d.ts +7 -7
- package/dist/dts/features/CohortDiscovery/appApi.d.ts +2 -2
- package/dist/dts/index.d.ts +3 -1
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/index.js +3 -1
- package/dist/dts/index.js.map +1 -1
- package/dist/esm/index.js +980 -729
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +134 -5
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/dist/dts/api/staticNotebook/index.d.ts +0 -4
- package/dist/dts/api/staticNotebook/index.d.ts.map +0 -1
- package/dist/dts/api/staticNotebook/index.js +0 -118
- package/dist/dts/api/staticNotebook/index.js.map +0 -1
- package/dist/dts/api/staticNotebooks/index.d.ts +0 -4
- package/dist/dts/api/staticNotebooks/index.d.ts.map +0 -1
- package/dist/dts/api/staticNotebooks/index.js +0 -118
- package/dist/dts/api/staticNotebooks/index.js.map +0 -1
- package/dist/dts/features/CohortBuilder/FiltersPanel.d.ts +0 -10
- package/dist/dts/features/CohortBuilder/FiltersPanel.d.ts.map +0 -1
- package/dist/dts/features/CohortBuilder/FiltersPanel.js.map +0 -1
- package/dist/dts/features/CohortBuilder/Panels/AccordianPanel.d.ts.map +0 -1
- package/dist/dts/features/CohortBuilder/Panels/AccordianPanel.js.map +0 -1
- package/dist/dts/features/CohortBuilder/Panels/DropdownPanel.d.ts.map +0 -1
- package/dist/dts/features/CohortBuilder/Panels/DropdownPanel.js.map +0 -1
- package/dist/dts/features/CohortBuilder/Panels/TabbedPanel.d.ts +0 -3
- package/dist/dts/features/CohortBuilder/Panels/TabbedPanel.d.ts.map +0 -1
- package/dist/dts/features/CohortBuilder/Panels/TabbedPanel.js.map +0 -1
- package/dist/dts/features/CohortBuilder/Panels/types.d.ts.map +0 -1
- package/dist/dts/features/CohortBuilder/Panels/types.js.map +0 -1
- package/dist/dts/features/CohortDiscovery/CohortManager.d.ts +0 -6
- package/dist/dts/features/CohortDiscovery/CohortManager.d.ts.map +0 -1
- package/dist/dts/features/CohortDiscovery/CohortManager.js +0 -55
- package/dist/dts/features/CohortDiscovery/CohortManager.js.map +0 -1
- package/dist/dts/features/CohortDiscovery/CohortManagerSlice.d.ts +0 -135
- package/dist/dts/features/CohortDiscovery/CohortManagerSlice.d.ts.map +0 -1
- package/dist/dts/features/CohortDiscovery/CohortManagerSlice.js +0 -40
- package/dist/dts/features/CohortDiscovery/CohortManagerSlice.js.map +0 -1
- package/dist/dts/features/CohortDiscovery/SaveCohorts/SavedCohortsPanel.d.ts +0 -3
- package/dist/dts/features/CohortDiscovery/SaveCohorts/SavedCohortsPanel.d.ts.map +0 -1
- package/dist/dts/features/CohortDiscovery/SaveCohorts/SavedCohortsPanel.js +0 -9
- package/dist/dts/features/CohortDiscovery/SaveCohorts/SavedCohortsPanel.js.map +0 -1
- package/dist/dts/features/CohortDiscovery/SaveCohorts/SavedCohortsTable.d.ts +0 -7
- package/dist/dts/features/CohortDiscovery/SaveCohorts/SavedCohortsTable.d.ts.map +0 -1
- package/dist/dts/features/CohortDiscovery/SaveCohorts/SavedCohortsTable.js +0 -101
- package/dist/dts/features/CohortDiscovery/SaveCohorts/SavedCohortsTable.js.map +0 -1
- package/dist/dts/features/CohortDiscovery/appApiRTKQ.d.ts +0 -1
- package/dist/dts/features/CohortDiscovery/appApiRTKQ.d.ts.map +0 -1
- package/dist/dts/features/CohortDiscovery/appApiRTKQ.js +0 -101
- package/dist/dts/features/CohortDiscovery/appApiRTKQ.js.map +0 -1
- package/dist/dts/features/Discovery/Charts/ChartsPanel.d.ts +0 -9
- package/dist/dts/features/Discovery/Charts/ChartsPanel.d.ts.map +0 -1
- package/dist/dts/features/Discovery/Charts/ChartsPanel.js +0 -24
- package/dist/dts/features/Discovery/Charts/ChartsPanel.js.map +0 -1
- package/dist/dts/features/Discovery/Charts/CollapsableChartsPanel.d.ts +0 -9
- package/dist/dts/features/Discovery/Charts/CollapsableChartsPanel.d.ts.map +0 -1
- package/dist/dts/features/Discovery/Charts/CollapsableChartsPanel.js +0 -24
- package/dist/dts/features/Discovery/Charts/CollapsableChartsPanel.js.map +0 -1
- package/dist/dts/features/Discovery/StudyDetails/DetailsAuthorizationIcon.d.ts +0 -9
- package/dist/dts/features/Discovery/StudyDetails/DetailsAuthorizationIcon.d.ts.map +0 -1
- package/dist/dts/features/Discovery/StudyDetails/DetailsAuthorizationIcon.js +0 -12
- package/dist/dts/features/Discovery/StudyDetails/DetailsAuthorizationIcon.js.map +0 -1
- package/dist/dts/features/Discovery/StudyDetails/RendererFactory.d.ts +0 -19
- package/dist/dts/features/Discovery/StudyDetails/RendererFactory.d.ts.map +0 -1
- package/dist/dts/features/Discovery/StudyDetails/RendererFactory.js +0 -56
- package/dist/dts/features/Discovery/StudyDetails/RendererFactory.js.map +0 -1
- package/dist/dts/features/Discovery/StudyDetails/SinglePageStudyDetailsPanel.d.ts +0 -14
- package/dist/dts/features/Discovery/StudyDetails/SinglePageStudyDetailsPanel.d.ts.map +0 -1
- package/dist/dts/features/Discovery/StudyDetails/SinglePageStudyDetailsPanel.js +0 -44
- package/dist/dts/features/Discovery/StudyDetails/SinglePageStudyDetailsPanel.js.map +0 -1
- package/dist/dts/features/Discovery/StudyDetails/StudyDetails.d.ts +0 -3
- package/dist/dts/features/Discovery/StudyDetails/StudyDetails.d.ts.map +0 -1
- package/dist/dts/features/Discovery/StudyDetails/StudyDetails.js +0 -37
- package/dist/dts/features/Discovery/StudyDetails/StudyDetails.js.map +0 -1
- package/dist/dts/features/Discovery/StudyDetails/StudyDetailsPanel.d.ts +0 -10
- package/dist/dts/features/Discovery/StudyDetails/StudyDetailsPanel.d.ts.map +0 -1
- package/dist/dts/features/Discovery/StudyDetails/StudyDetailsPanel.js +0 -19
- package/dist/dts/features/Discovery/StudyDetails/StudyDetailsPanel.js.map +0 -1
- package/dist/dts/features/Discovery/StudyDetails/StudyGroup.d.ts +0 -8
- package/dist/dts/features/Discovery/StudyDetails/StudyGroup.d.ts.map +0 -1
- package/dist/dts/features/Discovery/StudyDetails/StudyGroup.js +0 -31
- package/dist/dts/features/Discovery/StudyDetails/StudyGroup.js.map +0 -1
- package/dist/dts/features/Discovery/StudyDetails/StudyGroupPanel.d.ts +0 -9
- package/dist/dts/features/Discovery/StudyDetails/StudyGroupPanel.d.ts.map +0 -1
- package/dist/dts/features/Discovery/StudyDetails/StudyGroupPanel.js +0 -11
- package/dist/dts/features/Discovery/StudyDetails/StudyGroupPanel.js.map +0 -1
- package/dist/dts/features/Discovery/StudyDetails/StudyItems.d.ts +0 -5
- package/dist/dts/features/Discovery/StudyDetails/StudyItems.d.ts.map +0 -1
- package/dist/dts/features/Discovery/StudyDetails/StudyItems.js +0 -283
- package/dist/dts/features/Discovery/StudyDetails/StudyItems.js.map +0 -1
- package/dist/dts/features/Discovery/StudyPage/DownloadLinksPanel.d.ts +0 -10
- package/dist/dts/features/Discovery/StudyPage/DownloadLinksPanel.d.ts.map +0 -1
- package/dist/dts/features/Discovery/StudyPage/DownloadLinksPanel.js +0 -45
- package/dist/dts/features/Discovery/StudyPage/DownloadLinksPanel.js.map +0 -1
- package/dist/dts/features/Discovery/StudyPage/StudyPage.d.ts +0 -10
- package/dist/dts/features/Discovery/StudyPage/StudyPage.d.ts.map +0 -1
- package/dist/dts/features/Discovery/StudyPage/StudyPage.js +0 -11
- package/dist/dts/features/Discovery/StudyPage/StudyPage.js.map +0 -1
- package/dist/dts/features/Discovery/StudyPage/StudyPageGroup.d.ts +0 -9
- package/dist/dts/features/Discovery/StudyPage/StudyPageGroup.d.ts.map +0 -1
- package/dist/dts/features/Discovery/StudyPage/StudyPageGroup.js +0 -8
- package/dist/dts/features/Discovery/StudyPage/StudyPageGroup.js.map +0 -1
- package/dist/dts/features/StaticNotebook/StaticNotebook.d.ts +0 -4
- package/dist/dts/features/StaticNotebook/StaticNotebook.d.ts.map +0 -1
- package/dist/dts/features/StaticNotebook/StaticNotebook.js +0 -79
- package/dist/dts/features/StaticNotebook/StaticNotebook.js.map +0 -1
- package/dist/dts/lib/notebooks/index.d.ts +0 -3
- package/dist/dts/lib/notebooks/index.d.ts.map +0 -1
- package/dist/dts/lib/notebooks/index.js +0 -96
- package/dist/dts/lib/notebooks/index.js.map +0 -1
- /package/dist/dts/{features/CohortBuilder → components/facets}/Panels/AccordianPanel.d.ts +0 -0
- /package/dist/dts/{features/CohortBuilder → components/facets}/Panels/DropdownPanel.d.ts +0 -0
- /package/dist/dts/{features/CohortBuilder → components/facets}/Panels/types.js +0 -0
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
12
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
-
function step(op) {
|
|
15
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
-
switch (op[0]) {
|
|
20
|
-
case 0: case 1: t = op; break;
|
|
21
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
-
default:
|
|
25
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
-
if (t[2]) _.ops.pop();
|
|
30
|
-
_.trys.pop(); continue;
|
|
31
|
-
}
|
|
32
|
-
op = body.call(thisArg, _);
|
|
33
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
38
|
-
import { useState, useEffect } from 'react';
|
|
39
|
-
var HTMLNotebookViewer = function (_a) {
|
|
40
|
-
var url = _a.url;
|
|
41
|
-
var _b = useState(''), htmlContent = _b[0], setHtmlContent = _b[1];
|
|
42
|
-
var _c = useState(false), isError = _c[0], setIsError = _c[1];
|
|
43
|
-
var _d = useState(false), isLoading = _d[0], setIsLoading = _d[1];
|
|
44
|
-
useEffect(function () {
|
|
45
|
-
function fetchHtml() {
|
|
46
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
47
|
-
var response, text, _a;
|
|
48
|
-
return __generator(this, function (_b) {
|
|
49
|
-
switch (_b.label) {
|
|
50
|
-
case 0:
|
|
51
|
-
setIsLoading(true);
|
|
52
|
-
_b.label = 1;
|
|
53
|
-
case 1:
|
|
54
|
-
_b.trys.push([1, 4, 5, 6]);
|
|
55
|
-
return [4 /*yield*/, fetch(url)];
|
|
56
|
-
case 2:
|
|
57
|
-
response = _b.sent();
|
|
58
|
-
return [4 /*yield*/, response.text()];
|
|
59
|
-
case 3:
|
|
60
|
-
text = _b.sent();
|
|
61
|
-
setHtmlContent(text);
|
|
62
|
-
return [3 /*break*/, 6];
|
|
63
|
-
case 4:
|
|
64
|
-
_a = _b.sent();
|
|
65
|
-
setIsError(true);
|
|
66
|
-
return [3 /*break*/, 6];
|
|
67
|
-
case 5:
|
|
68
|
-
setIsLoading(false);
|
|
69
|
-
return [7 /*endfinally*/];
|
|
70
|
-
case 6: return [2 /*return*/];
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
fetchHtml();
|
|
76
|
-
}, [url]);
|
|
77
|
-
return (_jsx("div", { dangerouslySetInnerHTML: { __html: htmlContent } }));
|
|
78
|
-
};
|
|
79
|
-
//# sourceMappingURL=StaticNotebook.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StaticNotebook.js","sourceRoot":"","sources":["../../../../src/features/StaticNotebook/StaticNotebook.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOnD,IAAM,kBAAkB,GAAG,UAAC,EAA0B;QAAzB,GAAG,SAAA;IACxB,IAAA,KAAgC,QAAQ,CAAC,EAAE,CAAC,EAA3C,WAAW,QAAA,EAAE,cAAc,QAAgB,CAAC;IAC7C,IAAA,KAAwB,QAAQ,CAAC,KAAK,CAAC,EAAtC,OAAO,QAAA,EAAE,UAAU,QAAmB,CAAC;IACxC,IAAA,KAA4B,QAAQ,CAAC,KAAK,CAAC,EAA1C,SAAS,QAAA,EAAE,YAAY,QAAmB,CAAC;IAElD,SAAS,CAAC;QACR,SAAe,SAAS;;;;;;4BACtB,YAAY,CAAC,IAAI,CAAC,CAAC;;;;4BAEA,qBAAM,KAAK,CAAC,GAAG,CAAC,EAAA;;4BAA3B,QAAQ,GAAG,SAAgB;4BACpB,qBAAM,QAAQ,CAAC,IAAI,EAAE,EAAA;;4BAA5B,IAAI,GAAG,SAAqB;4BAClC,cAAc,CAAC,IAAI,CAAC,CAAC;;;;4BAErB,UAAU,CAAC,IAAI,CAAC,CAAC;;;4BAGjB,YAAY,CAAC,KAAK,CAAC,CAAC;;;;;;SAEvB;QACD,SAAS,EAAE,CAAC;IACd,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAEV,OAAO,CACN,cAAK,uBAAuB,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,GAAI,CAC3D,CAAC;AACF,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/notebooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAK1C,eAAO,MAAO,GAAG,GAAU,SAAU,WAAW,sBA+D/C,CAAA"}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
12
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
-
function step(op) {
|
|
15
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
-
switch (op[0]) {
|
|
20
|
-
case 0: case 1: t = op; break;
|
|
21
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
-
default:
|
|
25
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
-
if (t[2]) _.ops.pop();
|
|
30
|
-
_.trys.pop(); continue;
|
|
31
|
-
}
|
|
32
|
-
op = body.call(thisArg, _);
|
|
33
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
import path from 'path';
|
|
38
|
-
import fs from 'fs';
|
|
39
|
-
import DOMPurify from 'isomorphic-dompurify';
|
|
40
|
-
export var GET = function (request) { return __awaiter(void 0, void 0, void 0, function () {
|
|
41
|
-
var searchParams, filePath, sanitizedPath, fullPath, dataDir, rawContent, sanitizedContent;
|
|
42
|
-
return __generator(this, function (_a) {
|
|
43
|
-
try {
|
|
44
|
-
searchParams = new URL(request.url).searchParams;
|
|
45
|
-
filePath = searchParams.get('path');
|
|
46
|
-
// Validate that a path was provided
|
|
47
|
-
if (!filePath) {
|
|
48
|
-
return [2 /*return*/, Response.json({
|
|
49
|
-
error: 'File path is required. Use ?path=filename.html',
|
|
50
|
-
success: false
|
|
51
|
-
}, { status: 400 })];
|
|
52
|
-
}
|
|
53
|
-
sanitizedPath = path.normalize(filePath).replace(/^(\.\.[\/\\])+/, '');
|
|
54
|
-
// Ensure the file is within the allowed directory and has .html extension
|
|
55
|
-
if (!sanitizedPath.endsWith('.html')) {
|
|
56
|
-
return [2 /*return*/, Response.json({
|
|
57
|
-
error: 'Only HTML files are allowed',
|
|
58
|
-
success: false
|
|
59
|
-
}, { status: 400 })];
|
|
60
|
-
}
|
|
61
|
-
fullPath = path.join(process.cwd(), 'data', sanitizedPath);
|
|
62
|
-
dataDir = path.join(process.cwd(), 'data');
|
|
63
|
-
if (!fullPath.startsWith(dataDir)) {
|
|
64
|
-
return [2 /*return*/, Response.json({
|
|
65
|
-
error: 'File access denied',
|
|
66
|
-
success: false
|
|
67
|
-
}, { status: 403 })];
|
|
68
|
-
}
|
|
69
|
-
rawContent = fs.readFileSync(fullPath, 'utf8');
|
|
70
|
-
sanitizedContent = DOMPurify.sanitize(rawContent, {
|
|
71
|
-
ALLOWED_TAGS: ['p', 'br', 'strong', 'em', 'h1', 'h2', 'h3', 'ul', 'ol', 'li', 'a', 'img'],
|
|
72
|
-
ALLOWED_ATTR: ['href', 'title', 'src', 'alt', 'target']
|
|
73
|
-
});
|
|
74
|
-
return [2 /*return*/, Response.json({
|
|
75
|
-
content: sanitizedContent,
|
|
76
|
-
success: true,
|
|
77
|
-
filePath: sanitizedPath
|
|
78
|
-
})];
|
|
79
|
-
}
|
|
80
|
-
catch (error) {
|
|
81
|
-
if (error.code === "ENOENT") {
|
|
82
|
-
return [2 /*return*/, Response.json({
|
|
83
|
-
error: 'File not found',
|
|
84
|
-
success: false
|
|
85
|
-
}, { status: 404 })];
|
|
86
|
-
}
|
|
87
|
-
console.error('Error reading or sanitizing HTML file:', error);
|
|
88
|
-
return [2 /*return*/, Response.json({
|
|
89
|
-
error: 'Failed to load content',
|
|
90
|
-
success: false
|
|
91
|
-
}, { status: 500 })];
|
|
92
|
-
}
|
|
93
|
-
return [2 /*return*/];
|
|
94
|
-
});
|
|
95
|
-
}); };
|
|
96
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/notebooks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,SAAS,MAAM,sBAAsB,CAAA;AAE5C,MAAM,CAAC,IAAO,GAAG,GAAG,UAAO,OAAqB;;;QAC9C,IAAI,CAAC;YACK,YAAY,GAAK,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,aAAzB,CAA0B;YACxC,QAAQ,GAAG,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YAE1C,oCAAoC;YACpC,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACd,sBAAO,QAAQ,CAAC,IAAI,CAAC;wBACnB,KAAK,EAAE,gDAAgD;wBACvD,OAAO,EAAE,KAAK;qBACf,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAC;YACtB,CAAC;YAGK,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;YAE7E,0EAA0E;YAC1E,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;gBACrC,sBAAO,QAAQ,CAAC,IAAI,CAAC;wBACnB,KAAK,EAAE,6BAA6B;wBACpC,OAAO,EAAE,KAAK;qBACf,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAC;YACtB,CAAC;YAGK,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC;YAG3D,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,CAAC;YACjD,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;gBAClC,sBAAO,QAAQ,CAAC,IAAI,CAAC;wBACnB,KAAK,EAAE,oBAAoB;wBAC3B,OAAO,EAAE,KAAK;qBACf,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAC;YACtB,CAAC;YAEK,UAAU,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;YAE/C,gBAAgB,GAAG,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE;gBACtD,YAAY,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC;gBACzF,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC;aACxD,CAAC,CAAC;YAEH,sBAAO,QAAQ,CAAC,IAAI,CAAC;oBACnB,OAAO,EAAE,gBAAgB;oBACzB,OAAO,EAAE,IAAI;oBACb,QAAQ,EAAE,aAAa;iBACxB,CAAC,EAAC;QAEL,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,IAAK,KAA+B,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;gBACrD,sBAAO,QAAQ,CAAC,IAAI,CAAC;wBACnB,KAAK,EAAE,gBAAgB;wBACvB,OAAO,EAAE,KAAK;qBACf,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAC;YACtB,CAAC;YAEH,OAAO,CAAC,KAAK,CAAC,wCAAwC,EAAE,KAAK,CAAC,CAAC;YAC/D,sBAAO,QAAQ,CAAC,IAAI,CAAC;oBACnB,KAAK,EAAE,wBAAwB;oBAC/B,OAAO,EAAE,KAAK;iBACf,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAC;QACtB,CAAC;;;KACF,CAAA"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|