@solidxai/core-ui 0.1.9-beta.18 → 0.1.9-beta.19
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/adapters/auth/handleLogout.d.ts +1 -1
- package/dist/adapters/auth/handleLogout.d.ts.map +1 -1
- package/dist/adapters/auth/handleLogout.js +20 -32
- package/dist/adapters/auth/handleLogout.js.map +1 -1
- package/dist/adapters/auth/handleLogout.ts +7 -14
- package/dist/components/core/common/SolidAccountSettings/SolidChangePassword.d.ts.map +1 -1
- package/dist/components/core/common/SolidAccountSettings/SolidChangePassword.js +1 -10
- package/dist/components/core/common/SolidAccountSettings/SolidChangePassword.js.map +1 -1
- package/dist/components/core/common/SolidAccountSettings/SolidChangePassword.tsx +1 -8
- package/dist/components/core/common/SolidAccountSettings/SolidNotifications.d.ts.map +1 -1
- package/dist/components/core/common/SolidAccountSettings/SolidNotifications.js +6 -11
- package/dist/components/core/common/SolidAccountSettings/SolidNotifications.js.map +1 -1
- package/dist/components/core/common/SolidAccountSettings/SolidNotifications.tsx +5 -31
- package/dist/components/core/common/SolidGlobalSearchElement.d.ts.map +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.js +47 -13
- package/dist/components/core/common/SolidGlobalSearchElement.js.map +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.tsx +38 -4
- package/dist/components/core/extension/solid-core/metadata/MetadataExplorerFormWidget.d.ts +16 -0
- package/dist/components/core/extension/solid-core/metadata/MetadataExplorerFormWidget.d.ts.map +1 -0
- package/dist/components/core/extension/solid-core/metadata/MetadataExplorerFormWidget.js +31 -0
- package/dist/components/core/extension/solid-core/metadata/MetadataExplorerFormWidget.js.map +1 -0
- package/dist/components/core/extension/solid-core/metadata/MetadataExplorerFormWidget.tsx +43 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ClearModulePackageRuntimeHeaderAction.d.ts +3 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ClearModulePackageRuntimeHeaderAction.d.ts.map +1 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ClearModulePackageRuntimeHeaderAction.js +141 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ClearModulePackageRuntimeHeaderAction.js.map +1 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ClearModulePackageRuntimeHeaderAction.tsx +205 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ExportModulePackageRowAction.d.ts +4 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ExportModulePackageRowAction.d.ts.map +1 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ExportModulePackageRowAction.js +112 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ExportModulePackageRowAction.js.map +1 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ExportModulePackageRowAction.tsx +146 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ModuleImportListHeaderAction.d.ts +11 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ModuleImportListHeaderAction.d.ts.map +1 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ModuleImportListHeaderAction.js +22 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ModuleImportListHeaderAction.js.map +1 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ModuleImportListHeaderAction.tsx +36 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/moduleMetadataListOnLoad.d.ts +3 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/moduleMetadataListOnLoad.d.ts.map +1 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/moduleMetadataListOnLoad.js +133 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/moduleMetadataListOnLoad.js.map +1 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/moduleMetadataListOnLoad.ts +76 -0
- package/dist/components/core/form/fields/relations/RolesGroupedByModuleWidget.d.ts +12 -0
- package/dist/components/core/form/fields/relations/RolesGroupedByModuleWidget.d.ts.map +1 -0
- package/dist/components/core/form/fields/relations/RolesGroupedByModuleWidget.js +168 -0
- package/dist/components/core/form/fields/relations/RolesGroupedByModuleWidget.js.map +1 -0
- package/dist/components/core/form/fields/relations/RolesGroupedByModuleWidget.tsx +241 -0
- package/dist/components/core/list/SolidEmptyListViewPlaceholder.d.ts.map +1 -1
- package/dist/components/core/list/SolidEmptyListViewPlaceholder.js +3 -0
- package/dist/components/core/list/SolidEmptyListViewPlaceholder.js.map +1 -1
- package/dist/components/core/list/SolidEmptyListViewPlaceholder.tsx +2 -0
- package/dist/components/core/list/SolidListView.d.ts.map +1 -1
- package/dist/components/core/list/SolidListView.js +74 -68
- package/dist/components/core/list/SolidListView.js.map +1 -1
- package/dist/components/core/list/SolidListView.tsx +13 -4
- package/dist/components/core/list/SolidListViewColumn.d.ts.map +1 -1
- package/dist/components/core/list/SolidListViewColumn.js +0 -2
- package/dist/components/core/list/SolidListViewColumn.js.map +1 -1
- package/dist/components/core/list/SolidListViewColumn.tsx +0 -1
- package/dist/components/core/list/SolidListViewConfigure.d.ts.map +1 -1
- package/dist/components/core/list/SolidListViewConfigure.js +10 -9
- package/dist/components/core/list/SolidListViewConfigure.js.map +1 -1
- package/dist/components/core/list/SolidListViewConfigure.tsx +3 -1
- package/dist/components/core/list/SolidListViewHeaderButton.d.ts.map +1 -1
- package/dist/components/core/list/SolidListViewHeaderButton.js +3 -0
- package/dist/components/core/list/SolidListViewHeaderButton.js.map +1 -1
- package/dist/components/core/list/SolidListViewHeaderButton.tsx +2 -0
- package/dist/components/core/list/SolidListViewHeaderContextMenuButton.d.ts.map +1 -1
- package/dist/components/core/list/SolidListViewHeaderContextMenuButton.js +3 -0
- package/dist/components/core/list/SolidListViewHeaderContextMenuButton.js.map +1 -1
- package/dist/components/core/list/SolidListViewHeaderContextMenuButton.tsx +2 -0
- package/dist/components/core/list/SolidListViewRowActionsMenu.d.ts.map +1 -1
- package/dist/components/core/list/SolidListViewRowActionsMenu.js +7 -1
- package/dist/components/core/list/SolidListViewRowActionsMenu.js.map +1 -1
- package/dist/components/core/list/SolidListViewRowActionsMenu.tsx +5 -1
- package/dist/components/core/list/columns/SolidBooleanColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidBooleanColumn.js +4 -6
- package/dist/components/core/list/columns/SolidBooleanColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidBooleanColumn.tsx +1 -3
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.js +3 -2
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.tsx +3 -2
- package/dist/components/core/list/columns/SolidMediaSingleColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidMediaSingleColumn.js +3 -2
- package/dist/components/core/list/columns/SolidMediaSingleColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidMediaSingleColumn.tsx +3 -2
- package/dist/components/core/model/CreateModel.css +48 -0
- package/dist/components/core/model/CreateModel.d.ts +1 -0
- package/dist/components/core/model/CreateModel.d.ts.map +1 -1
- package/dist/components/core/model/CreateModel.js +69 -104
- package/dist/components/core/model/CreateModel.js.map +1 -1
- package/dist/components/core/model/CreateModel.tsx +92 -204
- package/dist/components/core/model/FieldMetaData.d.ts +1 -1
- package/dist/components/core/model/FieldMetaData.d.ts.map +1 -1
- package/dist/components/core/model/FieldMetaData.js +6 -22
- package/dist/components/core/model/FieldMetaData.js.map +1 -1
- package/dist/components/core/model/FieldMetaData.tsx +6 -45
- package/dist/components/core/model/FieldMetaDataForm.d.ts.map +1 -1
- package/dist/components/core/model/FieldMetaDataForm.js +196 -222
- package/dist/components/core/model/FieldMetaDataForm.js.map +1 -1
- package/dist/components/core/model/FieldMetaDataForm.tsx +0 -72
- package/dist/components/core/model/ModelMetaData.d.ts.map +1 -1
- package/dist/components/core/model/ModelMetaData.js +7 -7
- package/dist/components/core/model/ModelMetaData.js.map +1 -1
- package/dist/components/core/model/ModelMetaData.tsx +7 -0
- package/dist/components/core/module/CreateModule.css +44 -0
- package/dist/components/core/module/CreateModule.d.ts +1 -0
- package/dist/components/core/module/CreateModule.d.ts.map +1 -1
- package/dist/components/core/module/CreateModule.js +40 -43
- package/dist/components/core/module/CreateModule.js.map +1 -1
- package/dist/components/core/module/CreateModule.tsx +243 -247
- package/dist/components/core/module/ModuleListViewData.d.ts.map +1 -1
- package/dist/components/core/module/ModuleListViewData.js +47 -7
- package/dist/components/core/module/ModuleListViewData.js.map +1 -1
- package/dist/components/core/module/ModuleListViewData.tsx +58 -0
- package/dist/components/core/module/ModuleMetadataExplorer.css +638 -0
- package/dist/components/core/module/ModuleMetadataExplorer.d.ts +15 -0
- package/dist/components/core/module/ModuleMetadataExplorer.d.ts.map +1 -0
- package/dist/components/core/module/ModuleMetadataExplorer.js +666 -0
- package/dist/components/core/module/ModuleMetadataExplorer.js.map +1 -0
- package/dist/components/core/module/ModuleMetadataExplorer.tsx +1000 -0
- package/dist/components/core/module/ModulePackageDialog.css +540 -0
- package/dist/components/core/module/ModulePackageDialog.d.ts +16 -0
- package/dist/components/core/module/ModulePackageDialog.d.ts.map +1 -0
- package/dist/components/core/module/ModulePackageDialog.js +625 -0
- package/dist/components/core/module/ModulePackageDialog.js.map +1 -0
- package/dist/components/core/module/ModulePackageDialog.tsx +906 -0
- package/dist/components/layout/user-profile-menu.d.ts.map +1 -1
- package/dist/components/layout/user-profile-menu.js +57 -33
- package/dist/components/layout/user-profile-menu.js.map +1 -1
- package/dist/components/layout/user-profile-menu.tsx +11 -59
- package/dist/helpers/buttonEnvironment.d.ts +5 -0
- package/dist/helpers/buttonEnvironment.d.ts.map +1 -0
- package/dist/helpers/buttonEnvironment.js +30 -0
- package/dist/helpers/buttonEnvironment.js.map +1 -0
- package/dist/helpers/buttonEnvironment.ts +35 -0
- package/dist/helpers/fileTypeIcon.d.ts +12 -0
- package/dist/helpers/fileTypeIcon.d.ts.map +1 -0
- package/dist/helpers/fileTypeIcon.js +37 -0
- package/dist/helpers/fileTypeIcon.js.map +1 -0
- package/dist/helpers/fileTypeIcon.tsx +65 -0
- package/dist/helpers/registry.d.ts.map +1 -1
- package/dist/helpers/registry.js +10 -0
- package/dist/helpers/registry.js.map +1 -1
- package/dist/helpers/registry.ts +10 -0
- package/dist/helpers/waitForBackendAvailability.d.ts +7 -0
- package/dist/helpers/waitForBackendAvailability.d.ts.map +1 -0
- package/dist/helpers/waitForBackendAvailability.js +86 -0
- package/dist/helpers/waitForBackendAvailability.js.map +1 -0
- package/dist/helpers/waitForBackendAvailability.ts +37 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/index.ts +18 -0
- package/dist/redux/api/moduleApi.d.ts +26 -1
- package/dist/redux/api/moduleApi.d.ts.map +1 -1
- package/dist/redux/api/moduleApi.js +237 -1
- package/dist/redux/api/moduleApi.js.map +1 -1
- package/dist/redux/api/moduleApi.ts +181 -1
- package/dist/redux/store/defaultStoreConfig.d.ts +22 -0
- package/dist/redux/store/defaultStoreConfig.d.ts.map +1 -1
- package/dist/redux/store/solidEntityApiPool.d.ts +1 -0
- package/dist/redux/store/solidEntityApiPool.d.ts.map +1 -1
- package/dist/redux/store/solidEntityApiPool.js +4 -0
- package/dist/redux/store/solidEntityApiPool.js.map +1 -1
- package/dist/redux/store/solidEntityApiPool.ts +4 -0
- package/dist/resources/globals.css +56 -0
- package/dist/resources/shadcn-base.css +5 -0
- package/dist/routes/AppEventListener.d.ts.map +1 -1
- package/dist/routes/AppEventListener.js +58 -8
- package/dist/routes/AppEventListener.js.map +1 -1
- package/dist/routes/AppEventListener.tsx +69 -8
- package/dist/types/index.d.ts +1 -0
- package/dist/types/jsoneditor.d.ts +4 -0
- package/package.json +2 -1
|
@@ -0,0 +1,112 @@
|
|
|
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;
|
|
12
|
+
return g = { next: verb(0), "throw": verb(1), "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, jsxs as _jsxs } from "react/jsx-runtime";
|
|
38
|
+
import { useMemo, useState } from "react";
|
|
39
|
+
import { useDispatch } from "react-redux";
|
|
40
|
+
import { Download, FileArchive, Files, ShieldCheck } from "lucide-react";
|
|
41
|
+
import { SolidCircularLoader } from "../../../../../../components/core/common/SolidLoaders/SolidCircularLoader";
|
|
42
|
+
import { useExportModulePackageMutation } from "../../../../../../redux/api/moduleApi";
|
|
43
|
+
import { closePopup } from "../../../../../../redux/features/popupSlice";
|
|
44
|
+
import { showToast } from "../../../../../../redux/features/toastSlice";
|
|
45
|
+
import { SolidButton } from "../../../../../shad-cn-ui";
|
|
46
|
+
var ExportModulePackageRowAction = function (event) {
|
|
47
|
+
var _a, _b, _c;
|
|
48
|
+
var dispatch = useDispatch();
|
|
49
|
+
var _d = useState(false), isExporting = _d[0], setIsExporting = _d[1];
|
|
50
|
+
var _e = useState(null), errorState = _e[0], setErrorState = _e[1];
|
|
51
|
+
var exportModulePackage = useExportModulePackageMutation()[0];
|
|
52
|
+
var moduleName = String(((_a = event === null || event === void 0 ? void 0 : event.rowData) === null || _a === void 0 ? void 0 : _a.name) || ((_b = event === null || event === void 0 ? void 0 : event.rowData) === null || _b === void 0 ? void 0 : _b.id) || "").trim();
|
|
53
|
+
var moduleDisplayName = String(((_c = event === null || event === void 0 ? void 0 : event.rowData) === null || _c === void 0 ? void 0 : _c.displayName) || moduleName || "this module").trim();
|
|
54
|
+
var exportArtifacts = useMemo(function () { return [
|
|
55
|
+
"solid-api module folder",
|
|
56
|
+
"solid-ui module folder",
|
|
57
|
+
"manifest.json with archive checksums",
|
|
58
|
+
"Packaged .sldx download",
|
|
59
|
+
]; }, []);
|
|
60
|
+
var handleExport = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
61
|
+
var response, fileUrl, link, error_1, detail;
|
|
62
|
+
var _a;
|
|
63
|
+
return __generator(this, function (_b) {
|
|
64
|
+
switch (_b.label) {
|
|
65
|
+
case 0:
|
|
66
|
+
if (!moduleName) {
|
|
67
|
+
setErrorState("The selected module does not have a valid name for export.");
|
|
68
|
+
return [2 /*return*/];
|
|
69
|
+
}
|
|
70
|
+
_b.label = 1;
|
|
71
|
+
case 1:
|
|
72
|
+
_b.trys.push([1, 3, 4, 5]);
|
|
73
|
+
setIsExporting(true);
|
|
74
|
+
setErrorState(null);
|
|
75
|
+
return [4 /*yield*/, exportModulePackage({ moduleName: moduleName }).unwrap()];
|
|
76
|
+
case 2:
|
|
77
|
+
response = _b.sent();
|
|
78
|
+
fileUrl = window.URL.createObjectURL(response.blob);
|
|
79
|
+
link = document.createElement("a");
|
|
80
|
+
link.href = fileUrl;
|
|
81
|
+
link.download = response.fileName || "".concat(moduleName, ".sldx");
|
|
82
|
+
document.body.appendChild(link);
|
|
83
|
+
link.click();
|
|
84
|
+
link.remove();
|
|
85
|
+
window.URL.revokeObjectURL(fileUrl);
|
|
86
|
+
dispatch(showToast({
|
|
87
|
+
severity: "success",
|
|
88
|
+
summary: "Module exported",
|
|
89
|
+
detail: "".concat(moduleDisplayName, " was packaged and downloaded as a .sldx archive."),
|
|
90
|
+
}));
|
|
91
|
+
dispatch(closePopup());
|
|
92
|
+
return [3 /*break*/, 5];
|
|
93
|
+
case 3:
|
|
94
|
+
error_1 = _b.sent();
|
|
95
|
+
detail = ((_a = error_1 === null || error_1 === void 0 ? void 0 : error_1.data) === null || _a === void 0 ? void 0 : _a.message) || (error_1 === null || error_1 === void 0 ? void 0 : error_1.message) || "Unable to export the selected module.";
|
|
96
|
+
setErrorState(String(detail));
|
|
97
|
+
dispatch(showToast({ severity: "error", summary: "Export failed", detail: String(detail) }));
|
|
98
|
+
return [3 /*break*/, 5];
|
|
99
|
+
case 4:
|
|
100
|
+
setIsExporting(false);
|
|
101
|
+
return [7 /*endfinally*/];
|
|
102
|
+
case 5: return [2 /*return*/];
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}); };
|
|
106
|
+
if (isExporting) {
|
|
107
|
+
return (_jsxs("div", { className: "solid-generate-code-popup", children: [_jsx("div", { className: "solid-filter-dialog-head solid-generate-code-popup__head", children: _jsxs("div", { children: [_jsx("h3", { className: "solid-filter-dialog-title", children: "Export Module" }), _jsx("p", { className: "solid-filter-dialog-subtitle m-0", children: "Building a SolidX module package with a manifest and checksums." })] }) }), _jsx("div", { className: "solid-filter-dialog-sep" }), _jsxs("div", { className: "solid-filter-dialog-body solid-generate-code-popup__body solid-generate-code-popup__body--loading", children: [_jsx(SolidCircularLoader, {}), _jsx("p", { className: "solid-generate-code-popup__loading-title", children: "Packaging module..." }), _jsx("p", { className: "solid-generate-code-popup__loading-copy", children: "Preparing the archive and starting the `.sldx` download." })] })] }));
|
|
108
|
+
}
|
|
109
|
+
return (_jsxs("div", { className: "solid-generate-code-popup", children: [_jsx("div", { className: "solid-filter-dialog-head solid-generate-code-popup__head", children: _jsxs("div", { children: [_jsx("h3", { className: "solid-filter-dialog-title", children: "Export Module" }), _jsx("p", { className: "solid-filter-dialog-subtitle m-0", children: "Package the selected module into a reusable `.sldx` archive for distribution across SolidX projects." })] }) }), _jsx("div", { className: "solid-filter-dialog-sep" }), _jsxs("div", { className: "solid-filter-dialog-body solid-generate-code-popup__body", children: [_jsxs("p", { className: "solid-generate-code-popup__intro", children: ["Export ", _jsx("strong", { children: moduleDisplayName }), " with its `solid-api`, `solid-ui`, and manifest assets."] }), _jsxs("div", { className: "solid-generate-code-popup__panel", children: [_jsxs("div", { className: "solid-generate-code-popup__panel-title", children: [_jsx(FileArchive, { size: 15 }), _jsx("span", { children: "Archive contents" })] }), _jsx("ul", { className: "solid-generate-code-popup__list", children: exportArtifacts.map(function (item) { return (_jsx("li", { children: item }, item)); }) })] }), _jsxs("div", { className: "solid-generate-code-popup__panel", children: [_jsxs("div", { className: "solid-generate-code-popup__panel-title", children: [_jsx(ShieldCheck, { size: 15 }), _jsx("span", { children: "Export guarantees" })] }), _jsxs("ul", { className: "solid-generate-code-popup__list", children: [_jsx("li", { children: "Archive is generated from the current local module folders." }), _jsx("li", { children: "Manifest includes SHA-256 checksums for packaged module files." }), _jsx("li", { children: "Download is delivered as a `.sldx` file ready for import testing." })] })] }), errorState ? (_jsxs("div", { className: "solid-generate-code-popup__notice is-warning", children: [_jsx(Files, { size: 16 }), _jsx("span", { children: errorState })] })) : null, _jsxs("div", { className: "solid-generate-code-popup__actions", children: [_jsx(SolidButton, { size: "small", autoFocus: true, leftIcon: _jsx(Download, { size: 14 }), onClick: handleExport, children: "Export Module" }), _jsx(SolidButton, { size: "small", variant: "outline", onClick: function () { return dispatch(closePopup()); }, children: "Cancel" })] })] })] }));
|
|
110
|
+
};
|
|
111
|
+
export default ExportModulePackageRowAction;
|
|
112
|
+
//# sourceMappingURL=ExportModulePackageRowAction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExportModulePackageRowAction.js","sourceRoot":"","sources":["../../../../../../../src/components/core/extension/solid-core/moduleMetadata/list/ExportModulePackageRowAction.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM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ACN,cAAI,SAAS,EAAC,iCAAiC,aAC7C,uFAAoE,EACpE,0FAAuE,EACvE,6FAA0E,IACvE,IACD,EAEL,UAAU,CAAC,CAAC,CAAC,CACZ,eAAK,SAAS,EAAC,8CAA8C,aAC3D,KAAC,KAAK,IAAC,IAAI,EAAE,EAAE,GAAI,EACnB,yBAAO,UAAU,GAAQ,IACrB,CACP,CAAC,CAAC,CAAC,IAAI,EAER,eAAK,SAAS,EAAC,oCAAoC,aACjD,KAAC,WAAW,IAAC,IAAI,EAAC,OAAO,EAAC,SAAS,QAAC,QAAQ,EAAE,KAAC,QAAQ,IAAC,IAAI,EAAE,EAAE,GAAI,EAAE,OAAO,EAAE,YAAY,8BAE7E,EACd,KAAC,WAAW,IAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAC,SAAS,EAAC,OAAO,EAAE,cAAM,OAAA,QAAQ,CAAC,UAAU,EAAE,CAAC,EAAtB,CAAsB,uBAEnE,IACV,IACF,IACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,4BAA4B,CAAC","sourcesContent":["import { useMemo, useState } from \"react\";\nimport { useDispatch } from \"react-redux\";\nimport { Download, FileArchive, Files, ShieldCheck } from \"lucide-react\";\nimport { SolidCircularLoader } from \"../../../../../../components/core/common/SolidLoaders/SolidCircularLoader\";\nimport { useExportModulePackageMutation } from \"../../../../../../redux/api/moduleApi\";\nimport { closePopup } from \"../../../../../../redux/features/popupSlice\";\nimport { showToast } from \"../../../../../../redux/features/toastSlice\";\nimport { SolidListRowdataDynamicFunctionProps } from \"../../../../../../types/solid-core\";\nimport { SolidButton } from \"../../../../../shad-cn-ui\";\n\nconst ExportModulePackageRowAction = (event: SolidListRowdataDynamicFunctionProps) => {\n const dispatch = useDispatch();\n const [isExporting, setIsExporting] = useState(false);\n const [errorState, setErrorState] = useState<string | null>(null);\n const [exportModulePackage] = useExportModulePackageMutation();\n\n const moduleName = String(event?.rowData?.name || event?.rowData?.id || \"\").trim();\n const moduleDisplayName = String(event?.rowData?.displayName || moduleName || \"this module\").trim();\n\n const exportArtifacts = useMemo(\n () => [\n \"solid-api module folder\",\n \"solid-ui module folder\",\n \"manifest.json with archive checksums\",\n \"Packaged .sldx download\",\n ],\n []\n );\n\n const handleExport = async () => {\n if (!moduleName) {\n setErrorState(\"The selected module does not have a valid name for export.\");\n return;\n }\n\n try {\n setIsExporting(true);\n setErrorState(null);\n\n const response = await exportModulePackage({ moduleName }).unwrap();\n const fileUrl = window.URL.createObjectURL(response.blob);\n const link = document.createElement(\"a\");\n link.href = fileUrl;\n link.download = response.fileName || `${moduleName}.sldx`;\n document.body.appendChild(link);\n link.click();\n link.remove();\n window.URL.revokeObjectURL(fileUrl);\n\n dispatch(\n showToast({\n severity: \"success\",\n summary: \"Module exported\",\n detail: `${moduleDisplayName} was packaged and downloaded as a .sldx archive.`,\n })\n );\n dispatch(closePopup());\n } catch (error: any) {\n const detail = error?.data?.message || error?.message || \"Unable to export the selected module.\";\n setErrorState(String(detail));\n dispatch(showToast({ severity: \"error\", summary: \"Export failed\", detail: String(detail) }));\n } finally {\n setIsExporting(false);\n }\n };\n\n if (isExporting) {\n return (\n <div className=\"solid-generate-code-popup\">\n <div className=\"solid-filter-dialog-head solid-generate-code-popup__head\">\n <div>\n <h3 className=\"solid-filter-dialog-title\">Export Module</h3>\n <p className=\"solid-filter-dialog-subtitle m-0\">Building a SolidX module package with a manifest and checksums.</p>\n </div>\n </div>\n <div className=\"solid-filter-dialog-sep\" />\n <div className=\"solid-filter-dialog-body solid-generate-code-popup__body solid-generate-code-popup__body--loading\">\n <SolidCircularLoader />\n <p className=\"solid-generate-code-popup__loading-title\">Packaging module...</p>\n <p className=\"solid-generate-code-popup__loading-copy\">Preparing the archive and starting the `.sldx` download.</p>\n </div>\n </div>\n );\n }\n\n return (\n <div className=\"solid-generate-code-popup\">\n <div className=\"solid-filter-dialog-head solid-generate-code-popup__head\">\n <div>\n <h3 className=\"solid-filter-dialog-title\">Export Module</h3>\n <p className=\"solid-filter-dialog-subtitle m-0\">\n Package the selected module into a reusable `.sldx` archive for distribution across SolidX projects.\n </p>\n </div>\n </div>\n <div className=\"solid-filter-dialog-sep\" />\n <div className=\"solid-filter-dialog-body solid-generate-code-popup__body\">\n <p className=\"solid-generate-code-popup__intro\">\n Export <strong>{moduleDisplayName}</strong> with its `solid-api`, `solid-ui`, and manifest assets.\n </p>\n\n <div className=\"solid-generate-code-popup__panel\">\n <div className=\"solid-generate-code-popup__panel-title\">\n <FileArchive size={15} />\n <span>Archive contents</span>\n </div>\n <ul className=\"solid-generate-code-popup__list\">\n {exportArtifacts.map((item) => (\n <li key={item}>{item}</li>\n ))}\n </ul>\n </div>\n\n <div className=\"solid-generate-code-popup__panel\">\n <div className=\"solid-generate-code-popup__panel-title\">\n <ShieldCheck size={15} />\n <span>Export guarantees</span>\n </div>\n <ul className=\"solid-generate-code-popup__list\">\n <li>Archive is generated from the current local module folders.</li>\n <li>Manifest includes SHA-256 checksums for packaged module files.</li>\n <li>Download is delivered as a `.sldx` file ready for import testing.</li>\n </ul>\n </div>\n\n {errorState ? (\n <div className=\"solid-generate-code-popup__notice is-warning\">\n <Files size={16} />\n <span>{errorState}</span>\n </div>\n ) : null}\n\n <div className=\"solid-generate-code-popup__actions\">\n <SolidButton size=\"small\" autoFocus leftIcon={<Download size={14} />} onClick={handleExport}>\n Export Module\n </SolidButton>\n <SolidButton size=\"small\" variant=\"outline\" onClick={() => dispatch(closePopup())}>\n Cancel\n </SolidButton>\n </div>\n </div>\n </div>\n );\n};\n\nexport default ExportModulePackageRowAction;\n"]}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { useMemo, useState } from "react";
|
|
2
|
+
import { useDispatch } from "react-redux";
|
|
3
|
+
import { Download, FileArchive, Files, ShieldCheck } from "lucide-react";
|
|
4
|
+
import { SolidCircularLoader } from "../../../../../../components/core/common/SolidLoaders/SolidCircularLoader";
|
|
5
|
+
import { useExportModulePackageMutation } from "../../../../../../redux/api/moduleApi";
|
|
6
|
+
import { closePopup } from "../../../../../../redux/features/popupSlice";
|
|
7
|
+
import { showToast } from "../../../../../../redux/features/toastSlice";
|
|
8
|
+
import { SolidListRowdataDynamicFunctionProps } from "../../../../../../types/solid-core";
|
|
9
|
+
import { SolidButton } from "../../../../../shad-cn-ui";
|
|
10
|
+
|
|
11
|
+
const ExportModulePackageRowAction = (event: SolidListRowdataDynamicFunctionProps) => {
|
|
12
|
+
const dispatch = useDispatch();
|
|
13
|
+
const [isExporting, setIsExporting] = useState(false);
|
|
14
|
+
const [errorState, setErrorState] = useState<string | null>(null);
|
|
15
|
+
const [exportModulePackage] = useExportModulePackageMutation();
|
|
16
|
+
|
|
17
|
+
const moduleName = String(event?.rowData?.name || event?.rowData?.id || "").trim();
|
|
18
|
+
const moduleDisplayName = String(event?.rowData?.displayName || moduleName || "this module").trim();
|
|
19
|
+
|
|
20
|
+
const exportArtifacts = useMemo(
|
|
21
|
+
() => [
|
|
22
|
+
"solid-api module folder",
|
|
23
|
+
"solid-ui module folder",
|
|
24
|
+
"manifest.json with archive checksums",
|
|
25
|
+
"Packaged .sldx download",
|
|
26
|
+
],
|
|
27
|
+
[]
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
const handleExport = async () => {
|
|
31
|
+
if (!moduleName) {
|
|
32
|
+
setErrorState("The selected module does not have a valid name for export.");
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
try {
|
|
37
|
+
setIsExporting(true);
|
|
38
|
+
setErrorState(null);
|
|
39
|
+
|
|
40
|
+
const response = await exportModulePackage({ moduleName }).unwrap();
|
|
41
|
+
const fileUrl = window.URL.createObjectURL(response.blob);
|
|
42
|
+
const link = document.createElement("a");
|
|
43
|
+
link.href = fileUrl;
|
|
44
|
+
link.download = response.fileName || `${moduleName}.sldx`;
|
|
45
|
+
document.body.appendChild(link);
|
|
46
|
+
link.click();
|
|
47
|
+
link.remove();
|
|
48
|
+
window.URL.revokeObjectURL(fileUrl);
|
|
49
|
+
|
|
50
|
+
dispatch(
|
|
51
|
+
showToast({
|
|
52
|
+
severity: "success",
|
|
53
|
+
summary: "Module exported",
|
|
54
|
+
detail: `${moduleDisplayName} was packaged and downloaded as a .sldx archive.`,
|
|
55
|
+
})
|
|
56
|
+
);
|
|
57
|
+
dispatch(closePopup());
|
|
58
|
+
} catch (error: any) {
|
|
59
|
+
const detail = error?.data?.message || error?.message || "Unable to export the selected module.";
|
|
60
|
+
setErrorState(String(detail));
|
|
61
|
+
dispatch(showToast({ severity: "error", summary: "Export failed", detail: String(detail) }));
|
|
62
|
+
} finally {
|
|
63
|
+
setIsExporting(false);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
if (isExporting) {
|
|
68
|
+
return (
|
|
69
|
+
<div className="solid-generate-code-popup">
|
|
70
|
+
<div className="solid-filter-dialog-head solid-generate-code-popup__head">
|
|
71
|
+
<div>
|
|
72
|
+
<h3 className="solid-filter-dialog-title">Export Module</h3>
|
|
73
|
+
<p className="solid-filter-dialog-subtitle m-0">Building a SolidX module package with a manifest and checksums.</p>
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
<div className="solid-filter-dialog-sep" />
|
|
77
|
+
<div className="solid-filter-dialog-body solid-generate-code-popup__body solid-generate-code-popup__body--loading">
|
|
78
|
+
<SolidCircularLoader />
|
|
79
|
+
<p className="solid-generate-code-popup__loading-title">Packaging module...</p>
|
|
80
|
+
<p className="solid-generate-code-popup__loading-copy">Preparing the archive and starting the `.sldx` download.</p>
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return (
|
|
87
|
+
<div className="solid-generate-code-popup">
|
|
88
|
+
<div className="solid-filter-dialog-head solid-generate-code-popup__head">
|
|
89
|
+
<div>
|
|
90
|
+
<h3 className="solid-filter-dialog-title">Export Module</h3>
|
|
91
|
+
<p className="solid-filter-dialog-subtitle m-0">
|
|
92
|
+
Package the selected module into a reusable `.sldx` archive for distribution across SolidX projects.
|
|
93
|
+
</p>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
<div className="solid-filter-dialog-sep" />
|
|
97
|
+
<div className="solid-filter-dialog-body solid-generate-code-popup__body">
|
|
98
|
+
<p className="solid-generate-code-popup__intro">
|
|
99
|
+
Export <strong>{moduleDisplayName}</strong> with its `solid-api`, `solid-ui`, and manifest assets.
|
|
100
|
+
</p>
|
|
101
|
+
|
|
102
|
+
<div className="solid-generate-code-popup__panel">
|
|
103
|
+
<div className="solid-generate-code-popup__panel-title">
|
|
104
|
+
<FileArchive size={15} />
|
|
105
|
+
<span>Archive contents</span>
|
|
106
|
+
</div>
|
|
107
|
+
<ul className="solid-generate-code-popup__list">
|
|
108
|
+
{exportArtifacts.map((item) => (
|
|
109
|
+
<li key={item}>{item}</li>
|
|
110
|
+
))}
|
|
111
|
+
</ul>
|
|
112
|
+
</div>
|
|
113
|
+
|
|
114
|
+
<div className="solid-generate-code-popup__panel">
|
|
115
|
+
<div className="solid-generate-code-popup__panel-title">
|
|
116
|
+
<ShieldCheck size={15} />
|
|
117
|
+
<span>Export guarantees</span>
|
|
118
|
+
</div>
|
|
119
|
+
<ul className="solid-generate-code-popup__list">
|
|
120
|
+
<li>Archive is generated from the current local module folders.</li>
|
|
121
|
+
<li>Manifest includes SHA-256 checksums for packaged module files.</li>
|
|
122
|
+
<li>Download is delivered as a `.sldx` file ready for import testing.</li>
|
|
123
|
+
</ul>
|
|
124
|
+
</div>
|
|
125
|
+
|
|
126
|
+
{errorState ? (
|
|
127
|
+
<div className="solid-generate-code-popup__notice is-warning">
|
|
128
|
+
<Files size={16} />
|
|
129
|
+
<span>{errorState}</span>
|
|
130
|
+
</div>
|
|
131
|
+
) : null}
|
|
132
|
+
|
|
133
|
+
<div className="solid-generate-code-popup__actions">
|
|
134
|
+
<SolidButton size="small" autoFocus leftIcon={<Download size={14} />} onClick={handleExport}>
|
|
135
|
+
Export Module
|
|
136
|
+
</SolidButton>
|
|
137
|
+
<SolidButton size="small" variant="outline" onClick={() => dispatch(closePopup())}>
|
|
138
|
+
Cancel
|
|
139
|
+
</SolidButton>
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
|
+
);
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
export default ExportModulePackageRowAction;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type ModuleImportListHeaderActionProps = {
|
|
2
|
+
params?: {
|
|
3
|
+
moduleName?: string;
|
|
4
|
+
modelName?: string;
|
|
5
|
+
};
|
|
6
|
+
resumeTransactionKey?: string | null;
|
|
7
|
+
autoResume?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare function ModuleImportListHeaderAction({ params, resumeTransactionKey, autoResume }: ModuleImportListHeaderActionProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=ModuleImportListHeaderAction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModuleImportListHeaderAction.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/core/extension/solid-core/moduleMetadata/list/ModuleImportListHeaderAction.tsx"],"names":[],"mappings":"AAKA,KAAK,iCAAiC,GAAG;IACvC,MAAM,CAAC,EAAE;QACP,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAYF,wBAAgB,4BAA4B,CAAC,EAAE,MAAM,EAAE,oBAAoB,EAAE,UAAU,EAAE,EAAE,iCAAiC,2CAW3H"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useDispatch } from "react-redux";
|
|
3
|
+
import { closePopup } from "../../../../../../redux/features/popupSlice";
|
|
4
|
+
import { getListView, getRegisteredListViewIds } from "../../../../list/listViewRegistry";
|
|
5
|
+
import { ModulePackageImportContent } from "../../../../module/ModulePackageDialog";
|
|
6
|
+
function refreshMatchingListViews(moduleName, modelName) {
|
|
7
|
+
if (moduleName === void 0) { moduleName = "solid-core"; }
|
|
8
|
+
if (modelName === void 0) { modelName = "moduleMetadata"; }
|
|
9
|
+
var prefix = "page:".concat(moduleName, ":").concat(modelName, ":");
|
|
10
|
+
getRegisteredListViewIds()
|
|
11
|
+
.filter(function (listId) { return listId.startsWith(prefix); })
|
|
12
|
+
.forEach(function (listId) {
|
|
13
|
+
var _a;
|
|
14
|
+
(_a = getListView(listId)) === null || _a === void 0 ? void 0 : _a.refresh();
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
export function ModuleImportListHeaderAction(_a) {
|
|
18
|
+
var params = _a.params, resumeTransactionKey = _a.resumeTransactionKey, autoResume = _a.autoResume;
|
|
19
|
+
var dispatch = useDispatch();
|
|
20
|
+
return (_jsx(ModulePackageImportContent, { initialTransactionKey: resumeTransactionKey, autoResume: autoResume, onClose: function () { return dispatch(closePopup()); }, onImported: function () { return refreshMatchingListViews(params === null || params === void 0 ? void 0 : params.moduleName, params === null || params === void 0 ? void 0 : params.modelName); } }));
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=ModuleImportListHeaderAction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModuleImportListHeaderAction.js","sourceRoot":"","sources":["../../../../../../../src/components/core/extension/solid-core/moduleMetadata/list/ModuleImportListHeaderAction.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,6CAA6C,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC1F,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AAWpF,SAAS,wBAAwB,CAAC,UAAyB,EAAE,SAA4B;IAAvD,2BAAA,EAAA,yBAAyB;IAAE,0BAAA,EAAA,4BAA4B;IACvF,IAAM,MAAM,GAAG,eAAQ,UAAU,cAAI,SAAS,MAAG,CAAC;IAElD,wBAAwB,EAAE;SACvB,MAAM,CAAC,UAAC,MAAM,IAAK,OAAA,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,EAAzB,CAAyB,CAAC;SAC7C,OAAO,CAAC,UAAC,MAAM;;QACd,MAAA,WAAW,CAAC,MAAM,CAAC,0CAAE,OAAO,EAAE,CAAC;IACjC,CAAC,CAAC,CAAC;AACP,CAAC;AAED,MAAM,UAAU,4BAA4B,CAAC,EAA+E;QAA7E,MAAM,YAAA,EAAE,oBAAoB,0BAAA,EAAE,UAAU,gBAAA;IACrF,IAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAE/B,OAAO,CACL,KAAC,0BAA0B,IACzB,qBAAqB,EAAE,oBAAoB,EAC3C,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,cAAM,OAAA,QAAQ,CAAC,UAAU,EAAE,CAAC,EAAtB,CAAsB,EACrC,UAAU,EAAE,cAAM,OAAA,wBAAwB,CAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,UAAU,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,SAAS,CAAC,EAA/D,CAA+D,GACjF,CACH,CAAC;AACJ,CAAC","sourcesContent":["import { useDispatch } from \"react-redux\";\nimport { closePopup } from \"../../../../../../redux/features/popupSlice\";\nimport { getListView, getRegisteredListViewIds } from \"../../../../list/listViewRegistry\";\nimport { ModulePackageImportContent } from \"../../../../module/ModulePackageDialog\";\n\ntype ModuleImportListHeaderActionProps = {\n params?: {\n moduleName?: string;\n modelName?: string;\n };\n resumeTransactionKey?: string | null;\n autoResume?: boolean;\n};\n\nfunction refreshMatchingListViews(moduleName = \"solid-core\", modelName = \"moduleMetadata\") {\n const prefix = `page:${moduleName}:${modelName}:`;\n\n getRegisteredListViewIds()\n .filter((listId) => listId.startsWith(prefix))\n .forEach((listId) => {\n getListView(listId)?.refresh();\n });\n}\n\nexport function ModuleImportListHeaderAction({ params, resumeTransactionKey, autoResume }: ModuleImportListHeaderActionProps) {\n const dispatch = useDispatch();\n\n return (\n <ModulePackageImportContent\n initialTransactionKey={resumeTransactionKey}\n autoResume={autoResume}\n onClose={() => dispatch(closePopup())}\n onImported={() => refreshMatchingListViews(params?.moduleName, params?.modelName)}\n />\n );\n}\n"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { useDispatch } from "react-redux";
|
|
2
|
+
import { closePopup } from "../../../../../../redux/features/popupSlice";
|
|
3
|
+
import { getListView, getRegisteredListViewIds } from "../../../../list/listViewRegistry";
|
|
4
|
+
import { ModulePackageImportContent } from "../../../../module/ModulePackageDialog";
|
|
5
|
+
|
|
6
|
+
type ModuleImportListHeaderActionProps = {
|
|
7
|
+
params?: {
|
|
8
|
+
moduleName?: string;
|
|
9
|
+
modelName?: string;
|
|
10
|
+
};
|
|
11
|
+
resumeTransactionKey?: string | null;
|
|
12
|
+
autoResume?: boolean;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
function refreshMatchingListViews(moduleName = "solid-core", modelName = "moduleMetadata") {
|
|
16
|
+
const prefix = `page:${moduleName}:${modelName}:`;
|
|
17
|
+
|
|
18
|
+
getRegisteredListViewIds()
|
|
19
|
+
.filter((listId) => listId.startsWith(prefix))
|
|
20
|
+
.forEach((listId) => {
|
|
21
|
+
getListView(listId)?.refresh();
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function ModuleImportListHeaderAction({ params, resumeTransactionKey, autoResume }: ModuleImportListHeaderActionProps) {
|
|
26
|
+
const dispatch = useDispatch();
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<ModulePackageImportContent
|
|
30
|
+
initialTransactionKey={resumeTransactionKey}
|
|
31
|
+
autoResume={autoResume}
|
|
32
|
+
onClose={() => dispatch(closePopup())}
|
|
33
|
+
onImported={() => refreshMatchingListViews(params?.moduleName, params?.modelName)}
|
|
34
|
+
/>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"moduleMetadataListOnLoad.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/core/extension/solid-core/moduleMetadata/list/moduleMetadataListOnLoad.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAMlG,wBAA8B,wBAAwB,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,wBAAwB,GAAG,IAAI,CAAC,CAgErH"}
|
package/dist/components/core/extension/solid-core/moduleMetadata/list/moduleMetadataListOnLoad.js
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
+
function step(op) {
|
|
26
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
|
+
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;
|
|
29
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
+
switch (op[0]) {
|
|
31
|
+
case 0: case 1: t = op; break;
|
|
32
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
+
default:
|
|
36
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
+
if (t[2]) _.ops.pop();
|
|
41
|
+
_.trys.pop(); continue;
|
|
42
|
+
}
|
|
43
|
+
op = body.call(thisArg, _);
|
|
44
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
import { waitForBackendAvailability } from "../../../../../../helpers/waitForBackendAvailability";
|
|
49
|
+
import { isButtonVisibleInCurrentEnv } from "../../../../../../helpers/buttonEnvironment";
|
|
50
|
+
import { solidGet } from "../../../../../../http/solidHttp";
|
|
51
|
+
import { openPopup } from "../../../../../../redux/features/popupSlice";
|
|
52
|
+
import { getSolidStoreDispatch } from "../../../../../../redux/store/solidEntityApiPool";
|
|
53
|
+
var hasAttemptedResumeLookup = false;
|
|
54
|
+
var lastOpenedTransactionKey = null;
|
|
55
|
+
var pendingResumeLookup = null;
|
|
56
|
+
export default function moduleMetadataListOnLoad(event) {
|
|
57
|
+
var _a, _b, _c;
|
|
58
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
59
|
+
var dispatch, listViewAttrs, headerButtons, importButton;
|
|
60
|
+
var _this = this;
|
|
61
|
+
return __generator(this, function (_d) {
|
|
62
|
+
switch (_d.label) {
|
|
63
|
+
case 0:
|
|
64
|
+
if (hasAttemptedResumeLookup) {
|
|
65
|
+
return [2 /*return*/];
|
|
66
|
+
}
|
|
67
|
+
if (!pendingResumeLookup) return [3 /*break*/, 2];
|
|
68
|
+
return [4 /*yield*/, pendingResumeLookup];
|
|
69
|
+
case 1:
|
|
70
|
+
_d.sent();
|
|
71
|
+
return [2 /*return*/];
|
|
72
|
+
case 2:
|
|
73
|
+
dispatch = getSolidStoreDispatch();
|
|
74
|
+
if (!dispatch) {
|
|
75
|
+
return [2 /*return*/];
|
|
76
|
+
}
|
|
77
|
+
listViewAttrs = ((_b = (_a = event === null || event === void 0 ? void 0 : event.listViewLayout) === null || _a === void 0 ? void 0 : _a.attrs) !== null && _b !== void 0 ? _b : {});
|
|
78
|
+
headerButtons = (_c = listViewAttrs.headerButtons) !== null && _c !== void 0 ? _c : [];
|
|
79
|
+
importButton = headerButtons.find(function (button) { var _a; return ((_a = button === null || button === void 0 ? void 0 : button.attrs) === null || _a === void 0 ? void 0 : _a.action) === "ModuleImportListHeaderAction"; });
|
|
80
|
+
if (!(importButton === null || importButton === void 0 ? void 0 : importButton.attrs) || !isButtonVisibleInCurrentEnv(importButton === null || importButton === void 0 ? void 0 : importButton.attrs)) {
|
|
81
|
+
return [2 /*return*/];
|
|
82
|
+
}
|
|
83
|
+
pendingResumeLookup = (function () { return __awaiter(_this, void 0, void 0, function () {
|
|
84
|
+
var backendReady, response, transaction, error_1;
|
|
85
|
+
var _a, _b;
|
|
86
|
+
return __generator(this, function (_c) {
|
|
87
|
+
switch (_c.label) {
|
|
88
|
+
case 0:
|
|
89
|
+
_c.trys.push([0, 3, 4, 5]);
|
|
90
|
+
return [4 /*yield*/, waitForBackendAvailability({
|
|
91
|
+
retries: 80,
|
|
92
|
+
delayMs: 1500,
|
|
93
|
+
})];
|
|
94
|
+
case 1:
|
|
95
|
+
backendReady = _c.sent();
|
|
96
|
+
if (!backendReady) {
|
|
97
|
+
hasAttemptedResumeLookup = false;
|
|
98
|
+
return [2 /*return*/];
|
|
99
|
+
}
|
|
100
|
+
return [4 /*yield*/, solidGet("/module-packages/import/resumable/latest")];
|
|
101
|
+
case 2:
|
|
102
|
+
response = _c.sent();
|
|
103
|
+
transaction = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.data) !== null && _b !== void 0 ? _b : response === null || response === void 0 ? void 0 : response.data;
|
|
104
|
+
hasAttemptedResumeLookup = true;
|
|
105
|
+
if (!(transaction === null || transaction === void 0 ? void 0 : transaction.transactionKey) || transaction.transactionKey === lastOpenedTransactionKey) {
|
|
106
|
+
return [2 /*return*/];
|
|
107
|
+
}
|
|
108
|
+
lastOpenedTransactionKey = transaction.transactionKey;
|
|
109
|
+
dispatch(openPopup(__assign(__assign({}, importButton.attrs), { params: event.params, solidListViewMetaData: {
|
|
110
|
+
solidView: event.viewMetadata,
|
|
111
|
+
solidFieldsMetadata: event.fieldsMetadata,
|
|
112
|
+
}, resumeTransactionKey: transaction.transactionKey, autoResume: true })));
|
|
113
|
+
return [3 /*break*/, 5];
|
|
114
|
+
case 3:
|
|
115
|
+
error_1 = _c.sent();
|
|
116
|
+
hasAttemptedResumeLookup = false;
|
|
117
|
+
return [3 /*break*/, 5];
|
|
118
|
+
case 4:
|
|
119
|
+
pendingResumeLookup = null;
|
|
120
|
+
return [7 /*endfinally*/];
|
|
121
|
+
case 5: return [2 /*return*/];
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
}); })();
|
|
125
|
+
return [4 /*yield*/, pendingResumeLookup];
|
|
126
|
+
case 3:
|
|
127
|
+
_d.sent();
|
|
128
|
+
return [2 /*return*/];
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=moduleMetadataListOnLoad.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"moduleMetadataListOnLoad.js","sourceRoot":"","sources":["../../../../../../../src/components/core/extension/solid-core/moduleMetadata/list/moduleMetadataListOnLoad.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sDAAsD,CAAC;AAClG,OAAO,EAAE,2BAA2B,EAAE,MAAM,6CAA6C,CAAC;AAC1F,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kDAAkD,CAAC;AAGzF,IAAI,wBAAwB,GAAG,KAAK,CAAC;AACrC,IAAI,wBAAwB,GAAkB,IAAI,CAAC;AACnD,IAAI,mBAAmB,GAAyB,IAAI,CAAC;AAErD,MAAM,CAAC,OAAO,UAAgB,wBAAwB,CAAC,KAAoB;;;;;;;;oBACzE,IAAI,wBAAwB,EAAE;wBAC5B,sBAAO;qBACR;yBAEG,mB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CAEhC,IAAI,CAAC,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,cAAc,CAAA,IAAI,WAAW,CAAC,cAAc,KAAK,wBAAwB,EAAE;wCAC3F,sBAAO;qCACR;oCAED,wBAAwB,GAAG,WAAW,CAAC,cAAc,CAAC;oCACtD,QAAQ,CACN,SAAS,uBACJ,YAAY,CAAC,KAAK,KACrB,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,qBAAqB,EAAE;4CACrB,SAAS,EAAE,KAAK,CAAC,YAAY;4CAC7B,mBAAmB,EAAE,KAAK,CAAC,cAAc;yCAC1C,EACD,oBAAoB,EAAE,WAAW,CAAC,cAAc,EAChD,UAAU,EAAE,IAAI,IAChB,CACH,CAAC;;;;oCAEF,wBAAwB,GAAG,KAAK,CAAC;;;oCAGjC,mBAAmB,GAAG,IAAI,CAAC;;;;;yBAE9B,CAAC,EAAE,CAAC;oBAEL,qBAAM,mBAAmB,EAAA;;oBAAzB,SAAyB,CAAC;;;;;CAC3B","sourcesContent":["import { waitForBackendAvailability } from \"../../../../../../helpers/waitForBackendAvailability\";\nimport { isButtonVisibleInCurrentEnv } from \"../../../../../../helpers/buttonEnvironment\";\nimport { solidGet } from \"../../../../../../http/solidHttp\";\nimport { openPopup } from \"../../../../../../redux/features/popupSlice\";\nimport { getSolidStoreDispatch } from \"../../../../../../redux/store/solidEntityApiPool\";\nimport type { SolidLoadList, SolidListUiEventResponse } from \"../../../../../../types/solid-core\";\n\nlet hasAttemptedResumeLookup = false;\nlet lastOpenedTransactionKey: string | null = null;\nlet pendingResumeLookup: Promise<void> | null = null;\n\nexport default async function moduleMetadataListOnLoad(event: SolidLoadList): Promise<SolidListUiEventResponse | void> {\n if (hasAttemptedResumeLookup) {\n return;\n }\n\n if (pendingResumeLookup) {\n await pendingResumeLookup;\n return;\n }\n\n const dispatch = getSolidStoreDispatch();\n if (!dispatch) {\n return;\n }\n\n const listViewAttrs = (event?.listViewLayout?.attrs ?? {}) as { headerButtons?: any[] };\n const headerButtons = listViewAttrs.headerButtons ?? [];\n const importButton = headerButtons.find((button: any) => button?.attrs?.action === \"ModuleImportListHeaderAction\");\n if (!importButton?.attrs || !isButtonVisibleInCurrentEnv(importButton?.attrs)) {\n return;\n }\n\n pendingResumeLookup = (async () => {\n try {\n const backendReady = await waitForBackendAvailability({\n retries: 80,\n delayMs: 1500,\n });\n\n if (!backendReady) {\n hasAttemptedResumeLookup = false;\n return;\n }\n\n const response = await solidGet(\"/module-packages/import/resumable/latest\");\n const transaction = response?.data?.data ?? response?.data;\n hasAttemptedResumeLookup = true;\n\n if (!transaction?.transactionKey || transaction.transactionKey === lastOpenedTransactionKey) {\n return;\n }\n\n lastOpenedTransactionKey = transaction.transactionKey;\n dispatch(\n openPopup({\n ...importButton.attrs,\n params: event.params,\n solidListViewMetaData: {\n solidView: event.viewMetadata,\n solidFieldsMetadata: event.fieldsMetadata,\n },\n resumeTransactionKey: transaction.transactionKey,\n autoResume: true,\n }),\n );\n } catch (error) {\n hasAttemptedResumeLookup = false;\n // Ignore resume lookup failures and allow the list to render normally.\n } finally {\n pendingResumeLookup = null;\n }\n })();\n\n await pendingResumeLookup;\n}\n"]}
|
package/dist/components/core/extension/solid-core/moduleMetadata/list/moduleMetadataListOnLoad.ts
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { waitForBackendAvailability } from "../../../../../../helpers/waitForBackendAvailability";
|
|
2
|
+
import { isButtonVisibleInCurrentEnv } from "../../../../../../helpers/buttonEnvironment";
|
|
3
|
+
import { solidGet } from "../../../../../../http/solidHttp";
|
|
4
|
+
import { openPopup } from "../../../../../../redux/features/popupSlice";
|
|
5
|
+
import { getSolidStoreDispatch } from "../../../../../../redux/store/solidEntityApiPool";
|
|
6
|
+
import type { SolidLoadList, SolidListUiEventResponse } from "../../../../../../types/solid-core";
|
|
7
|
+
|
|
8
|
+
let hasAttemptedResumeLookup = false;
|
|
9
|
+
let lastOpenedTransactionKey: string | null = null;
|
|
10
|
+
let pendingResumeLookup: Promise<void> | null = null;
|
|
11
|
+
|
|
12
|
+
export default async function moduleMetadataListOnLoad(event: SolidLoadList): Promise<SolidListUiEventResponse | void> {
|
|
13
|
+
if (hasAttemptedResumeLookup) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
if (pendingResumeLookup) {
|
|
18
|
+
await pendingResumeLookup;
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const dispatch = getSolidStoreDispatch();
|
|
23
|
+
if (!dispatch) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const listViewAttrs = (event?.listViewLayout?.attrs ?? {}) as { headerButtons?: any[] };
|
|
28
|
+
const headerButtons = listViewAttrs.headerButtons ?? [];
|
|
29
|
+
const importButton = headerButtons.find((button: any) => button?.attrs?.action === "ModuleImportListHeaderAction");
|
|
30
|
+
if (!importButton?.attrs || !isButtonVisibleInCurrentEnv(importButton?.attrs)) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
pendingResumeLookup = (async () => {
|
|
35
|
+
try {
|
|
36
|
+
const backendReady = await waitForBackendAvailability({
|
|
37
|
+
retries: 80,
|
|
38
|
+
delayMs: 1500,
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
if (!backendReady) {
|
|
42
|
+
hasAttemptedResumeLookup = false;
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const response = await solidGet("/module-packages/import/resumable/latest");
|
|
47
|
+
const transaction = response?.data?.data ?? response?.data;
|
|
48
|
+
hasAttemptedResumeLookup = true;
|
|
49
|
+
|
|
50
|
+
if (!transaction?.transactionKey || transaction.transactionKey === lastOpenedTransactionKey) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
lastOpenedTransactionKey = transaction.transactionKey;
|
|
55
|
+
dispatch(
|
|
56
|
+
openPopup({
|
|
57
|
+
...importButton.attrs,
|
|
58
|
+
params: event.params,
|
|
59
|
+
solidListViewMetaData: {
|
|
60
|
+
solidView: event.viewMetadata,
|
|
61
|
+
solidFieldsMetadata: event.fieldsMetadata,
|
|
62
|
+
},
|
|
63
|
+
resumeTransactionKey: transaction.transactionKey,
|
|
64
|
+
autoResume: true,
|
|
65
|
+
}),
|
|
66
|
+
);
|
|
67
|
+
} catch (error) {
|
|
68
|
+
hasAttemptedResumeLookup = false;
|
|
69
|
+
// Ignore resume lookup failures and allow the list to render normally.
|
|
70
|
+
} finally {
|
|
71
|
+
pendingResumeLookup = null;
|
|
72
|
+
}
|
|
73
|
+
})();
|
|
74
|
+
|
|
75
|
+
await pendingResumeLookup;
|
|
76
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SolidFormFieldWidgetProps } from '../../../../../types/solid-core';
|
|
2
|
+
/**
|
|
3
|
+
* RolesGroupedByModuleWidget
|
|
4
|
+
*
|
|
5
|
+
* Groups roles by their associated module on the User form:
|
|
6
|
+
* - Roles with no module → "Default Roles" accordion (first)
|
|
7
|
+
* - Roles linked to a module → "<Module Display Name> Roles" accordion
|
|
8
|
+
*
|
|
9
|
+
* Each checkbox immediately fires a link/unlink API call.
|
|
10
|
+
*/
|
|
11
|
+
export declare const RolesGroupedByModuleWidget: ({ formik, fieldContext }: SolidFormFieldWidgetProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=RolesGroupedByModuleWidget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RolesGroupedByModuleWidget.d.ts","sourceRoot":"","sources":["../../../../../../src/components/core/form/fields/relations/RolesGroupedByModuleWidget.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAmB5E;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B,6BAA8B,yBAAyB,4CAkN7F,CAAC"}
|