@webiny/app-aco 5.42.2 → 5.42.3-beta.0
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/app.d.ts +2 -0
- package/app.js +14 -0
- package/app.js.map +1 -0
- package/components/Extensions/Extensions.d.ts +2 -0
- package/components/Extensions/Extensions.js +56 -0
- package/components/Extensions/Extensions.js.map +1 -0
- package/components/Extensions/index.d.ts +1 -0
- package/components/Extensions/index.js +18 -0
- package/components/Extensions/index.js.map +1 -0
- package/components/index.d.ts +1 -0
- package/components/index.js +11 -0
- package/components/index.js.map +1 -1
- package/config/folder/createFolderFieldDecoratorFactory.d.ts +13 -0
- package/config/folder/createFolderFieldDecoratorFactory.js +30 -0
- package/config/folder/createFolderFieldDecoratorFactory.js.map +1 -0
- package/config/index.d.ts +1 -0
- package/config/index.js +11 -0
- package/config/index.js.map +1 -1
- package/dialogs/useCreateDialog.js +2 -2
- package/dialogs/useCreateDialog.js.map +1 -1
- package/dialogs/useEditDialog.js +3 -2
- package/dialogs/useEditDialog.js.map +1 -1
- package/features/folders/Folder.d.ts +2 -0
- package/features/folders/Folder.js +1 -0
- package/features/folders/Folder.js.map +1 -1
- package/features/folders/createFolder/CreateFolderGqlGateway.d.ts +3 -2
- package/features/folders/createFolder/CreateFolderGqlGateway.js +6 -3
- package/features/folders/createFolder/CreateFolderGqlGateway.js.map +1 -1
- package/features/folders/createFolder/CreateFolderRepository.js +2 -1
- package/features/folders/createFolder/CreateFolderRepository.js.map +1 -1
- package/features/folders/createFolder/CreateFolderUseCase.js +2 -1
- package/features/folders/createFolder/CreateFolderUseCase.js.map +1 -1
- package/features/folders/createFolder/FolderDto.d.ts +1 -0
- package/features/folders/createFolder/FolderDto.js.map +1 -1
- package/features/folders/createFolder/FolderGqlDto.d.ts +1 -0
- package/features/folders/createFolder/FolderGqlDto.js.map +1 -1
- package/features/folders/createFolder/ICreateFolderUseCase.d.ts +1 -0
- package/features/folders/createFolder/ICreateFolderUseCase.js.map +1 -1
- package/features/folders/createFolder/useCreateFolder.js +2 -1
- package/features/folders/createFolder/useCreateFolder.js.map +1 -1
- package/features/folders/getFolder/GetFolderGqlGateway.d.ts +3 -2
- package/features/folders/getFolder/GetFolderGqlGateway.js +6 -3
- package/features/folders/getFolder/GetFolderGqlGateway.js.map +1 -1
- package/features/folders/getFolder/useGetFolder.js +2 -1
- package/features/folders/getFolder/useGetFolder.js.map +1 -1
- package/features/folders/getFolderExtensionsFields/GetFolderExtensionsFields.d.ts +5 -0
- package/features/folders/getFolderExtensionsFields/GetFolderExtensionsFields.js +37 -0
- package/features/folders/getFolderExtensionsFields/GetFolderExtensionsFields.js.map +1 -0
- package/features/folders/getFolderExtensionsFields/GetFolderExtensionsFields.test.d.ts +1 -0
- package/features/folders/getFolderExtensionsFields/GetFolderExtensionsFields.test.js +159 -0
- package/features/folders/getFolderExtensionsFields/GetFolderExtensionsFields.test.js.map +1 -0
- package/features/folders/getFolderExtensionsFields/GetFolderExtensionsFieldsRepository.d.ts +26 -0
- package/features/folders/getFolderExtensionsFields/GetFolderExtensionsFieldsRepository.js +25 -0
- package/features/folders/getFolderExtensionsFields/GetFolderExtensionsFieldsRepository.js.map +1 -0
- package/features/folders/getFolderExtensionsFields/GetFolderExtensionsFieldsUseCase.d.ts +28 -0
- package/features/folders/getFolderExtensionsFields/GetFolderExtensionsFieldsUseCase.js +29 -0
- package/features/folders/getFolderExtensionsFields/GetFolderExtensionsFieldsUseCase.js.map +1 -0
- package/features/folders/getFolderExtensionsFields/GetFolderExtensionsFieldsUseCaseWithNamespace.d.ts +28 -0
- package/features/folders/getFolderExtensionsFields/GetFolderExtensionsFieldsUseCaseWithNamespace.js +35 -0
- package/features/folders/getFolderExtensionsFields/GetFolderExtensionsFieldsUseCaseWithNamespace.js.map +1 -0
- package/features/folders/getFolderExtensionsFields/GetFolderExtensionsFieldsUseCaseWithNamespaceAndModelId.d.ts +29 -0
- package/features/folders/getFolderExtensionsFields/GetFolderExtensionsFieldsUseCaseWithNamespaceAndModelId.js +39 -0
- package/features/folders/getFolderExtensionsFields/GetFolderExtensionsFieldsUseCaseWithNamespaceAndModelId.js.map +1 -0
- package/features/folders/getFolderExtensionsFields/IGetFolderExtensionsFieldsRepository.d.ts +4 -0
- package/features/folders/getFolderExtensionsFields/IGetFolderExtensionsFieldsRepository.js +7 -0
- package/features/folders/getFolderExtensionsFields/IGetFolderExtensionsFieldsRepository.js.map +1 -0
- package/features/folders/getFolderExtensionsFields/IGetFolderExtensionsFieldsUseCase.d.ts +6 -0
- package/features/folders/getFolderExtensionsFields/IGetFolderExtensionsFieldsUseCase.js +7 -0
- package/features/folders/getFolderExtensionsFields/IGetFolderExtensionsFieldsUseCase.js.map +1 -0
- package/features/folders/getFolderExtensionsFields/index.d.ts +1 -0
- package/features/folders/getFolderExtensionsFields/index.js +18 -0
- package/features/folders/getFolderExtensionsFields/index.js.map +1 -0
- package/features/folders/getFolderExtensionsFields/useGetFolderExtensionsFields.d.ts +24 -0
- package/features/folders/getFolderExtensionsFields/useGetFolderExtensionsFields.js +28 -0
- package/features/folders/getFolderExtensionsFields/useGetFolderExtensionsFields.js.map +1 -0
- package/features/folders/getFolderModel/FolderModelContext.d.ts +3 -0
- package/features/folders/getFolderModel/FolderModelContext.js +69 -0
- package/features/folders/getFolderModel/FolderModelContext.js.map +1 -0
- package/features/folders/getFolderModel/FolderModelDto.d.ts +2 -0
- package/features/folders/getFolderModel/FolderModelDto.js +7 -0
- package/features/folders/getFolderModel/FolderModelDto.js.map +1 -0
- package/features/folders/getFolderModel/GetFolderModel.d.ts +11 -0
- package/features/folders/getFolderModel/GetFolderModel.js +29 -0
- package/features/folders/getFolderModel/GetFolderModel.js.map +1 -0
- package/features/folders/getFolderModel/GetFolderModel.test.d.ts +1 -0
- package/features/folders/getFolderModel/GetFolderModel.test.js +73 -0
- package/features/folders/getFolderModel/GetFolderModel.test.js.map +1 -0
- package/features/folders/getFolderModel/GetFolderModelGqlGateway.d.ts +18 -0
- package/features/folders/getFolderModel/GetFolderModelGqlGateway.js +41 -0
- package/features/folders/getFolderModel/GetFolderModelGqlGateway.js.map +1 -0
- package/features/folders/getFolderModel/GetFolderModelRepository.d.ts +10 -0
- package/features/folders/getFolderModel/GetFolderModelRepository.js +42 -0
- package/features/folders/getFolderModel/GetFolderModelRepository.js.map +1 -0
- package/features/folders/getFolderModel/GetFolderModelUseCase.d.ts +7 -0
- package/features/folders/getFolderModel/GetFolderModelUseCase.js +23 -0
- package/features/folders/getFolderModel/GetFolderModelUseCase.js.map +1 -0
- package/features/folders/getFolderModel/IGetFolderModelGateway.d.ts +4 -0
- package/features/folders/getFolderModel/IGetFolderModelGateway.js +7 -0
- package/features/folders/getFolderModel/IGetFolderModelGateway.js.map +1 -0
- package/features/folders/getFolderModel/IGetFolderModelRepository.d.ts +6 -0
- package/features/folders/getFolderModel/IGetFolderModelRepository.js +7 -0
- package/features/folders/getFolderModel/IGetFolderModelRepository.js.map +1 -0
- package/features/folders/getFolderModel/IGetFolderModelUseCase.d.ts +3 -0
- package/features/folders/getFolderModel/IGetFolderModelUseCase.js +7 -0
- package/features/folders/getFolderModel/IGetFolderModelUseCase.js.map +1 -0
- package/features/folders/getFolderModel/index.d.ts +3 -0
- package/features/folders/getFolderModel/index.js +40 -0
- package/features/folders/getFolderModel/index.js.map +1 -0
- package/features/folders/getFolderModel/useFolderModel.d.ts +1 -0
- package/features/folders/getFolderModel/useFolderModel.js +18 -0
- package/features/folders/getFolderModel/useFolderModel.js.map +1 -0
- package/features/folders/index.d.ts +2 -0
- package/features/folders/index.js +22 -0
- package/features/folders/index.js.map +1 -1
- package/features/folders/listFolders/FolderDto.d.ts +1 -0
- package/features/folders/listFolders/FolderDto.js +2 -1
- package/features/folders/listFolders/FolderDto.js.map +1 -1
- package/features/folders/listFolders/FolderGqlDto.d.ts +1 -0
- package/features/folders/listFolders/FolderGqlDto.js.map +1 -1
- package/features/folders/listFolders/ListFoldersCompressedGqlGateway.js +2 -1
- package/features/folders/listFolders/ListFoldersCompressedGqlGateway.js.map +1 -1
- package/features/folders/listFolders/ListFoldersGqlGateway.d.ts +3 -2
- package/features/folders/listFolders/ListFoldersGqlGateway.js +8 -4
- package/features/folders/listFolders/ListFoldersGqlGateway.js.map +1 -1
- package/features/folders/updateFolder/FolderDto.d.ts +1 -0
- package/features/folders/updateFolder/FolderDto.js.map +1 -1
- package/features/folders/updateFolder/FolderGqlDto.d.ts +1 -0
- package/features/folders/updateFolder/FolderGqlDto.js.map +1 -1
- package/features/folders/updateFolder/IUpdateFolderUseCase.d.ts +1 -0
- package/features/folders/updateFolder/IUpdateFolderUseCase.js.map +1 -1
- package/features/folders/updateFolder/UpdateFolderGqlGateway.d.ts +3 -2
- package/features/folders/updateFolder/UpdateFolderGqlGateway.js +9 -4
- package/features/folders/updateFolder/UpdateFolderGqlGateway.js.map +1 -1
- package/features/folders/updateFolder/UpdateFolderRepository.js +2 -1
- package/features/folders/updateFolder/UpdateFolderRepository.js.map +1 -1
- package/features/folders/updateFolder/UpdateFolderUseCase.js +2 -1
- package/features/folders/updateFolder/UpdateFolderUseCase.js.map +1 -1
- package/features/folders/updateFolder/useUpdateFolder.js +2 -1
- package/features/folders/updateFolder/useUpdateFolder.js.map +1 -1
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +11 -0
- package/hooks/index.js.map +1 -1
- package/hooks/useGetFolderGraphQLSelection.d.ts +1 -0
- package/hooks/useGetFolderGraphQLSelection.js +21 -0
- package/hooks/useGetFolderGraphQLSelection.js.map +1 -0
- package/index.d.ts +1 -0
- package/index.js +11 -0
- package/index.js.map +1 -1
- package/package.json +16 -16
- package/types.d.ts +1 -0
- package/types.js.map +1 -1
package/app.d.ts
ADDED
package/app.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.AdvancedContentOrganisation = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _features = require("./features");
|
|
10
|
+
var AdvancedContentOrganisation = exports.AdvancedContentOrganisation = function AdvancedContentOrganisation() {
|
|
11
|
+
return /*#__PURE__*/_react.default.createElement(_features.FolderModelProviderModule, null);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=app.js.map
|
package/app.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_features","AdvancedContentOrganisation","exports","default","createElement","FolderModelProviderModule"],"sources":["app.tsx"],"sourcesContent":["import React from \"react\";\nimport { FolderModelProviderModule } from \"~/features\";\n\nexport const AdvancedContentOrganisation = () => {\n return <FolderModelProviderModule />;\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAEO,IAAME,2BAA2B,GAAAC,OAAA,CAAAD,2BAAA,GAAG,SAA9BA,2BAA2BA,CAAA,EAAS;EAC7C,oBAAOJ,MAAA,CAAAM,OAAA,CAAAC,aAAA,CAACJ,SAAA,CAAAK,yBAAyB,MAAE,CAAC;AACxC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.Extensions = void 0;
|
|
8
|
+
var _base = _interopRequireDefault(require("@emotion/styled/base"));
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _appAdmin = require("@webiny/app-admin");
|
|
11
|
+
var _appHeadlessCmsCommon = require("@webiny/app-headless-cms-common");
|
|
12
|
+
var _form = require("@webiny/form");
|
|
13
|
+
var _features = require("../../features");
|
|
14
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
15
|
+
var HideEmptyCells = /*#__PURE__*/(0, _base.default)("div", process.env.NODE_ENV === "production" ? {
|
|
16
|
+
target: "e1n8q4kd0"
|
|
17
|
+
} : {
|
|
18
|
+
target: "e1n8q4kd0",
|
|
19
|
+
label: "HideEmptyCells"
|
|
20
|
+
})(process.env.NODE_ENV === "production" ? {
|
|
21
|
+
name: "jiqe85",
|
|
22
|
+
styles: ".mdc-layout-grid{margin:-24px;padding:0 24px 24px;}.mdc-layout-grid__inner{row-gap:normal;}.mdc-layout-grid__cell{padding-top:24px;}.mdc-layout-grid__cell:empty{display:none;padding:0;}"
|
|
23
|
+
} : {
|
|
24
|
+
name: "jiqe85",
|
|
25
|
+
styles: ".mdc-layout-grid{margin:-24px;padding:0 24px 24px;}.mdc-layout-grid__inner{row-gap:normal;}.mdc-layout-grid__cell{padding-top:24px;}.mdc-layout-grid__cell:empty{display:none;padding:0;}",
|
|
26
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkV4dGVuc2lvbnMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQU9pQyIsImZpbGUiOiJFeHRlbnNpb25zLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCBmcm9tIFwicmVhY3RcIjtcbmltcG9ydCB7IENvbXBvc2l0aW9uU2NvcGUgfSBmcm9tIFwiQHdlYmlueS9hcHAtYWRtaW5cIjtcbmltcG9ydCB7IE1vZGVsUHJvdmlkZXIsIEZpZWxkcyB9IGZyb20gXCJAd2ViaW55L2FwcC1oZWFkbGVzcy1jbXMtY29tbW9uXCI7XG5pbXBvcnQg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IDxDb21wb3NpdGlvblNjb3BlIG5hbWU9e1wiYWNvLmZvbGRlckRldGFpbHMuZXh0ZW5zaW9uRmllbGRzXCJ9PlxuICAgICAgICAgICAgPE1vZGVsUHJvdmlkZXIgbW9kZWw9e2ZvbGRlck1vZGVsfT5cbiAgICAgICAgICAgICAgICA8QmluZFByZWZpeCBuYW1lPXtcImV4dGVuc2lvbnNcIn0+XG4gICAgICAgICAgICAgICAgICAgIDxIaWRlRW1wdHlDZWxscz5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxGaWVsZHNcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50TW9kZWw9e2ZvbGRlck1vZGVsfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEB0cy1leHBlY3QtZXJyb3JcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBCaW5kPXtCaW5kfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpZWxkcz17ZmllbGRzfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxheW91dD17ZmllbGRzLm1hcChmaWVsZCA9PiBbZmllbGQuZmllbGRJZF0pfVxuICAgICAgICAgICAgICAgICAgICAgICAgLz5cbiAgICAgICAgICAgICAgICAgICAgPC9IaWRlRW1wdHlDZWxscz5cbiAgICAgICAgICAgICAgICA8L0JpbmRQcmVmaXg+XG4gICAgICAgICAgICA8L01vZGVsUHJvdmlkZXI+XG4gICAgICAgIDwvQ29tcG9zaXRpb25TY29wZT5cbiAgICApO1xufTtcbiJdfQ== */",
|
|
27
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
28
|
+
});
|
|
29
|
+
var Extensions = exports.Extensions = function Extensions() {
|
|
30
|
+
var _useGetFolderExtensio = (0, _features.useGetFolderExtensionsFields)(),
|
|
31
|
+
getFolderExtensionsFields = _useGetFolderExtensio.getFolderExtensionsFields;
|
|
32
|
+
var _getFolderExtensionsF = getFolderExtensionsFields(),
|
|
33
|
+
fields = _getFolderExtensionsF.fields;
|
|
34
|
+
var folderModel = (0, _features.useFolderModel)();
|
|
35
|
+
if (!fields.length) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
return /*#__PURE__*/_react.default.createElement(_appAdmin.CompositionScope, {
|
|
39
|
+
name: "aco.folderDetails.extensionFields"
|
|
40
|
+
}, /*#__PURE__*/_react.default.createElement(_appHeadlessCmsCommon.ModelProvider, {
|
|
41
|
+
model: folderModel
|
|
42
|
+
}, /*#__PURE__*/_react.default.createElement(_form.BindPrefix, {
|
|
43
|
+
name: "extensions"
|
|
44
|
+
}, /*#__PURE__*/_react.default.createElement(HideEmptyCells, null, /*#__PURE__*/_react.default.createElement(_appHeadlessCmsCommon.Fields, {
|
|
45
|
+
contentModel: folderModel
|
|
46
|
+
// @ts-expect-error
|
|
47
|
+
,
|
|
48
|
+
Bind: _form.Bind,
|
|
49
|
+
fields: fields,
|
|
50
|
+
layout: fields.map(function (field) {
|
|
51
|
+
return [field.fieldId];
|
|
52
|
+
})
|
|
53
|
+
})))));
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=Extensions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_appAdmin","_appHeadlessCmsCommon","_form","_features","_EMOTION_STRINGIFIED_CSS_ERROR__","HideEmptyCells","_base","default","process","env","NODE_ENV","target","label","name","styles","map","toString","Extensions","exports","_useGetFolderExtensio","useGetFolderExtensionsFields","getFolderExtensionsFields","_getFolderExtensionsF","fields","folderModel","useFolderModel","length","createElement","CompositionScope","ModelProvider","model","BindPrefix","Fields","contentModel","Bind","layout","field","fieldId"],"sources":["Extensions.tsx"],"sourcesContent":["import React from \"react\";\nimport { CompositionScope } from \"@webiny/app-admin\";\nimport { ModelProvider, Fields } from \"@webiny/app-headless-cms-common\";\nimport { Bind, BindPrefix } from \"@webiny/form\";\nimport styled from \"@emotion/styled\";\nimport { useFolderModel, useGetFolderExtensionsFields } from \"~/features\";\n\nconst HideEmptyCells = styled.div`\n .mdc-layout-grid {\n margin: -24px;\n padding: 0 24px 24px;\n }\n\n .mdc-layout-grid__inner {\n row-gap: normal;\n }\n\n .mdc-layout-grid__cell {\n padding-top: 24px;\n }\n\n .mdc-layout-grid__cell:empty {\n display: none;\n padding: 0;\n }\n`;\n\nexport const Extensions = () => {\n const { getFolderExtensionsFields } = useGetFolderExtensionsFields();\n const { fields } = getFolderExtensionsFields();\n const folderModel = useFolderModel();\n\n if (!fields.length) {\n return null;\n }\n\n return (\n <CompositionScope name={\"aco.folderDetails.extensionFields\"}>\n <ModelProvider model={folderModel}>\n <BindPrefix name={\"extensions\"}>\n <HideEmptyCells>\n <Fields\n contentModel={folderModel}\n // @ts-expect-error\n Bind={Bind}\n fields={fields}\n layout={fields.map(field => [field.fieldId])}\n />\n </HideEmptyCells>\n </BindPrefix>\n </ModelProvider>\n </CompositionScope>\n );\n};\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,qBAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAEA,IAAAI,SAAA,GAAAJ,OAAA;AAA0E,SAAAK,iCAAA;AAE1E,IAAMC,cAAc,oBAAAC,KAAA,CAAAC,OAAA,SAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,GAAAJ,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAG,IAAA;EAAAC,MAAA;AAAA;EAAAD,IAAA;EAAAC,MAAA;EAAAC,GAAA;EAAAC,QAAA,EAAAZ;AAAA,EAkBnB;AAEM,IAAMa,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG,SAAbA,UAAUA,CAAA,EAAS;EAC5B,IAAAE,qBAAA,GAAsC,IAAAC,sCAA4B,EAAC,CAAC;IAA5DC,yBAAyB,GAAAF,qBAAA,CAAzBE,yBAAyB;EACjC,IAAAC,qBAAA,GAAmBD,yBAAyB,CAAC,CAAC;IAAtCE,MAAM,GAAAD,qBAAA,CAANC,MAAM;EACd,IAAMC,WAAW,GAAG,IAAAC,wBAAc,EAAC,CAAC;EAEpC,IAAI,CAACF,MAAM,CAACG,MAAM,EAAE;IAChB,OAAO,IAAI;EACf;EAEA,oBACI7B,MAAA,CAAAU,OAAA,CAAAoB,aAAA,CAAC3B,SAAA,CAAA4B,gBAAgB;IAACf,IAAI,EAAE;EAAoC,gBACxDhB,MAAA,CAAAU,OAAA,CAAAoB,aAAA,CAAC1B,qBAAA,CAAA4B,aAAa;IAACC,KAAK,EAAEN;EAAY,gBAC9B3B,MAAA,CAAAU,OAAA,CAAAoB,aAAA,CAACzB,KAAA,CAAA6B,UAAU;IAAClB,IAAI,EAAE;EAAa,gBAC3BhB,MAAA,CAAAU,OAAA,CAAAoB,aAAA,CAACtB,cAAc,qBACXR,MAAA,CAAAU,OAAA,CAAAoB,aAAA,CAAC1B,qBAAA,CAAA+B,MAAM;IACHC,YAAY,EAAET;IACd;IAAA;IACAU,IAAI,EAAEA,UAAK;IACXX,MAAM,EAAEA,MAAO;IACfY,MAAM,EAAEZ,MAAM,CAACR,GAAG,CAAC,UAAAqB,KAAK;MAAA,OAAI,CAACA,KAAK,CAACC,OAAO,CAAC;IAAA;EAAE,CAChD,CACW,CACR,CACD,CACD,CAAC;AAE3B,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Extensions";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _Extensions = require("./Extensions");
|
|
7
|
+
Object.keys(_Extensions).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _Extensions[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function get() {
|
|
13
|
+
return _Extensions[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_Extensions","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sources":["index.ts"],"sourcesContent":["export * from \"./Extensions\";\n"],"mappings":";;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,WAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,WAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAT,WAAA,CAAAK,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
package/components/index.d.ts
CHANGED
package/components/index.js
CHANGED
|
@@ -25,6 +25,17 @@ Object.keys(_AdvancedSearch).forEach(function (key) {
|
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
});
|
|
28
|
+
var _Extensions = require("./Extensions");
|
|
29
|
+
Object.keys(_Extensions).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _Extensions[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function get() {
|
|
35
|
+
return _Extensions[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
28
39
|
var _FolderGrid = require("./FolderGrid");
|
|
29
40
|
Object.keys(_FolderGrid).forEach(function (key) {
|
|
30
41
|
if (key === "default" || key === "__esModule") return;
|
package/components/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_Actions","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_AdvancedSearch","_FolderGrid","_FolderTree","_Search","_Table"],"sources":["index.tsx"],"sourcesContent":["export * from \"./Actions\";\nexport * from \"./AdvancedSearch\";\nexport * from \"./FolderGrid\";\nexport * from \"./FolderTree\";\nexport * from \"./Search\";\nexport * from \"./Table\";\n"],"mappings":";;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,QAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,QAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAT,QAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,eAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,eAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,eAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAC,eAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,WAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,WAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,WAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAE,WAAA,CAAAN,GAAA;IAAA;EAAA;AAAA;AACA,IAAAO,WAAA,GAAAX,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAS,WAAA,EAAAR,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAO,WAAA,CAAAP,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAG,WAAA,CAAAP,GAAA;IAAA;EAAA;AAAA;AACA,IAAAQ,
|
|
1
|
+
{"version":3,"names":["_Actions","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_AdvancedSearch","_Extensions","_FolderGrid","_FolderTree","_Search","_Table"],"sources":["index.tsx"],"sourcesContent":["export * from \"./Actions\";\nexport * from \"./AdvancedSearch\";\nexport * from \"./Extensions\";\nexport * from \"./FolderGrid\";\nexport * from \"./FolderTree\";\nexport * from \"./Search\";\nexport * from \"./Table\";\n"],"mappings":";;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,QAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,QAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAT,QAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,eAAA,GAAAT,OAAA;AAAAC,MAAA,CA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,WAAA,CAAAR,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAI,WAAA,CAAAR,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,OAAA,GAAAb,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAW,OAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAS,OAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAK,OAAA,CAAAT,GAAA;IAAA;EAAA;AAAA;AACA,IAAAU,MAAA,GAAAd,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAY,MAAA,EAAAX,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAU,MAAA,CAAAV,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAM,MAAA,CAAAV,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { GenericComponent, Decorator } from "@webiny/app-admin";
|
|
3
|
+
import { FieldElement } from "@webiny/app-headless-cms-common";
|
|
4
|
+
export type FieldProps = React.ComponentProps<typeof FieldElement>;
|
|
5
|
+
export interface FieldDecoratorProps {
|
|
6
|
+
id?: string;
|
|
7
|
+
modelIds?: string[];
|
|
8
|
+
}
|
|
9
|
+
export interface FolderFieldDecoratorParams {
|
|
10
|
+
scope?: string;
|
|
11
|
+
shouldDecorate: (decoratorProps: FieldDecoratorProps, componentProps: FieldProps) => boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const createFolderFieldDecoratorFactory: ({ scope, shouldDecorate }: FolderFieldDecoratorParams) => (decorator: Decorator<GenericComponent<FieldProps>>) => (props: FieldDecoratorProps) => React.JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.createFolderFieldDecoratorFactory = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _appAdmin = require("@webiny/app-admin");
|
|
10
|
+
var _appHeadlessCmsCommon = require("@webiny/app-headless-cms-common");
|
|
11
|
+
var createFolderFieldDecoratorFactory = exports.createFolderFieldDecoratorFactory = function createFolderFieldDecoratorFactory(_ref) {
|
|
12
|
+
var _ref$scope = _ref.scope,
|
|
13
|
+
scope = _ref$scope === void 0 ? "*" : _ref$scope,
|
|
14
|
+
shouldDecorate = _ref.shouldDecorate;
|
|
15
|
+
return function (decorator) {
|
|
16
|
+
return function FieldDecorator(props) {
|
|
17
|
+
var conditionalDecorator = (0, _appAdmin.createConditionalDecorator)(shouldDecorate, decorator, props);
|
|
18
|
+
return /*#__PURE__*/_react.default.createElement(_appAdmin.CompositionScope, {
|
|
19
|
+
name: scope
|
|
20
|
+
}, /*#__PURE__*/_react.default.createElement(_appAdmin.CompositionScope, {
|
|
21
|
+
name: "aco.folderDetails.extensionFields"
|
|
22
|
+
}, /*#__PURE__*/_react.default.createElement(_appAdmin.Compose, {
|
|
23
|
+
component: _appHeadlessCmsCommon.FieldElement,
|
|
24
|
+
with: conditionalDecorator
|
|
25
|
+
})));
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=createFolderFieldDecoratorFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_appAdmin","_appHeadlessCmsCommon","createFolderFieldDecoratorFactory","exports","_ref","_ref$scope","scope","shouldDecorate","decorator","FieldDecorator","props","conditionalDecorator","createConditionalDecorator","default","createElement","CompositionScope","name","Compose","component","FieldElement","with"],"sources":["createFolderFieldDecoratorFactory.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n Compose,\n createConditionalDecorator,\n CompositionScope,\n GenericComponent,\n Decorator\n} from \"@webiny/app-admin\";\nimport { FieldElement } from \"@webiny/app-headless-cms-common\";\n\nexport type FieldProps = React.ComponentProps<typeof FieldElement>;\n\nexport interface FieldDecoratorProps {\n id?: string;\n modelIds?: string[];\n}\n\nexport interface FolderFieldDecoratorParams {\n scope?: string;\n shouldDecorate: (decoratorProps: FieldDecoratorProps, componentProps: FieldProps) => boolean;\n}\n\nexport const createFolderFieldDecoratorFactory =\n ({ scope = \"*\", shouldDecorate }: FolderFieldDecoratorParams) =>\n (decorator: Decorator<GenericComponent<FieldProps>>) => {\n return function FieldDecorator(props: FieldDecoratorProps) {\n const conditionalDecorator = createConditionalDecorator(\n shouldDecorate,\n decorator,\n props\n );\n\n return (\n <CompositionScope name={scope}>\n <CompositionScope name={\"aco.folderDetails.extensionFields\"}>\n <Compose component={FieldElement} with={conditionalDecorator} />\n </CompositionScope>\n </CompositionScope>\n );\n };\n };\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAOA,IAAAE,qBAAA,GAAAF,OAAA;AAcO,IAAMG,iCAAiC,GAAAC,OAAA,CAAAD,iCAAA,GAC1C,SADSA,iCAAiCA,CAAAE,IAAA;EAAA,IAAAC,UAAA,GAAAD,IAAA,CACvCE,KAAK;IAALA,KAAK,GAAAD,UAAA,cAAG,GAAG,GAAAA,UAAA;IAAEE,cAAc,GAAAH,IAAA,CAAdG,cAAc;EAAA,OAC9B,UAACC,SAAkD,EAAK;IACpD,OAAO,SAASC,cAAcA,CAACC,KAA0B,EAAE;MACvD,IAAMC,oBAAoB,GAAG,IAAAC,oCAA0B,EACnDL,cAAc,EACdC,SAAS,EACTE,KACJ,CAAC;MAED,oBACIb,MAAA,CAAAgB,OAAA,CAAAC,aAAA,CAACd,SAAA,CAAAe,gBAAgB;QAACC,IAAI,EAAEV;MAAM,gBAC1BT,MAAA,CAAAgB,OAAA,CAAAC,aAAA,CAACd,SAAA,CAAAe,gBAAgB;QAACC,IAAI,EAAE;MAAoC,gBACxDnB,MAAA,CAAAgB,OAAA,CAAAC,aAAA,CAACd,SAAA,CAAAiB,OAAO;QAACC,SAAS,EAAEC,kCAAa;QAACC,IAAI,EAAET;MAAqB,CAAE,CACjD,CACJ,CAAC;IAE3B,CAAC;EACL,CAAC;AAAA","ignoreList":[]}
|
package/config/index.d.ts
CHANGED
package/config/index.js
CHANGED
|
@@ -14,5 +14,16 @@ Object.keys(_AcoConfig).forEach(function (key) {
|
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
});
|
|
17
|
+
var _createFolderFieldDecoratorFactory = require("./folder/createFolderFieldDecoratorFactory");
|
|
18
|
+
Object.keys(_createFolderFieldDecoratorFactory).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _createFolderFieldDecoratorFactory[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function get() {
|
|
24
|
+
return _createFolderFieldDecoratorFactory[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
17
28
|
|
|
18
29
|
//# sourceMappingURL=index.js.map
|
package/config/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_AcoConfig","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sources":["index.ts"],"sourcesContent":["export * from \"./AcoConfig\";\n"],"mappings":";;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,UAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,UAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAT,UAAA,CAAAK,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_AcoConfig","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_createFolderFieldDecoratorFactory"],"sources":["index.ts"],"sourcesContent":["export * from \"./AcoConfig\";\nexport * from \"./folder/createFolderFieldDecoratorFactory\";\n"],"mappings":";;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,UAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,UAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAT,UAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,kCAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,kCAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,kCAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAC,kCAAA,CAAAL,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -41,7 +41,7 @@ var FormComponent = function FormComponent(_ref) {
|
|
|
41
41
|
trim: false
|
|
42
42
|
}));
|
|
43
43
|
};
|
|
44
|
-
return /*#__PURE__*/_react.default.createElement(_Grid.Grid, null, /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
|
|
44
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Grid.Grid, null, /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
|
|
45
45
|
span: 12
|
|
46
46
|
}, /*#__PURE__*/_react.default.createElement(_form.Bind, {
|
|
47
47
|
name: "title",
|
|
@@ -74,7 +74,7 @@ var FormComponent = function FormComponent(_ref) {
|
|
|
74
74
|
onChange(folder.id === _constants.ROOT_FOLDER ? null : folder.id);
|
|
75
75
|
}
|
|
76
76
|
});
|
|
77
|
-
}))));
|
|
77
|
+
})))), /*#__PURE__*/_react.default.createElement(_components.Extensions, null));
|
|
78
78
|
};
|
|
79
79
|
var useCreateDialog = exports.useCreateDialog = function useCreateDialog() {
|
|
80
80
|
var dialogs = (0, _appAdmin.useDialogs)();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_slugify","_interopRequireDefault","_appAdmin","_form","_Grid","_Input","_Typography","_validation","_components","_styled","_features","_constants","FormComponent","_ref","_ref$currentParentId","currentParentId","_useState","useState","_useState2","_slicedToArray2","default","parentId","setParentId","form","useForm","generateSlug","data","slug","title","setValue","slugify","replacement","lower","remove","trim","createElement","Grid","Cell","span","Bind","name","validators","validation","create","bind","Input","Object","assign","label","onBlur","Typography","use","DialogFoldersContainer","defaultValue","_ref2","onChange","FolderTree","focusedFolderId","ROOT_FOLDER","onFolderClick","folder","id","useCreateDialog","exports","dialogs","useDialogs","_useCreateFolder","useCreateFolder","createFolder","_useSnackbar","useSnackbar","showSnackbar","onAccept","useCallback","_objectSpread2","error","message","showDialog","params","_ref3","_ref3$currentParentId","content","acceptLabel","cancelLabel","loadingLabel"],"sources":["useCreateDialog.tsx"],"sourcesContent":["import React, { useCallback, useState } from \"react\";\nimport slugify from \"slugify\";\nimport { useSnackbar } from \"@webiny/app-admin\";\nimport { Bind, GenericFormData, useForm } from \"@webiny/form\";\nimport { Cell, Grid } from \"@webiny/ui/Grid\";\nimport { Input } from \"@webiny/ui/Input\";\nimport { Typography } from \"@webiny/ui/Typography\";\nimport { validation } from \"@webiny/validation\";\n\nimport { FolderTree } from \"~/components\";\nimport { useDialogs } from \"@webiny/app-admin\";\nimport { DialogFoldersContainer } from \"~/dialogs/styled\";\nimport { useCreateFolder } from \"~/features\";\nimport { ROOT_FOLDER } from \"~/constants\";\nimport { FolderItem } from \"~/types\";\n\ninterface ShowDialogParams {\n currentParentId?: string | null;\n}\n\ninterface UseCreateDialogResponse {\n showDialog: (params?: ShowDialogParams) => void;\n}\n\ninterface FormComponentProps {\n currentParentId?: string | null;\n}\n\nconst FormComponent = ({ currentParentId = null }: FormComponentProps) => {\n const [parentId, setParentId] = useState<string | null>(currentParentId);\n const form = useForm();\n\n const generateSlug = () => {\n if (form.data.slug || !form.data.title) {\n return;\n }\n\n // We want to update slug only when the folder is first being created.\n form.setValue(\n \"slug\",\n slugify(form.data.title, {\n replacement: \"-\",\n lower: true,\n remove: /[*#\\?<>_\\{\\}\\[\\]+~.()'\"!:;@]/g,\n trim: false\n })\n );\n };\n\n return (\n <Grid>\n
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_slugify","_interopRequireDefault","_appAdmin","_form","_Grid","_Input","_Typography","_validation","_components","_styled","_features","_constants","FormComponent","_ref","_ref$currentParentId","currentParentId","_useState","useState","_useState2","_slicedToArray2","default","parentId","setParentId","form","useForm","generateSlug","data","slug","title","setValue","slugify","replacement","lower","remove","trim","createElement","Fragment","Grid","Cell","span","Bind","name","validators","validation","create","bind","Input","Object","assign","label","onBlur","Typography","use","DialogFoldersContainer","defaultValue","_ref2","onChange","FolderTree","focusedFolderId","ROOT_FOLDER","onFolderClick","folder","id","Extensions","useCreateDialog","exports","dialogs","useDialogs","_useCreateFolder","useCreateFolder","createFolder","_useSnackbar","useSnackbar","showSnackbar","onAccept","useCallback","_objectSpread2","error","message","showDialog","params","_ref3","_ref3$currentParentId","content","acceptLabel","cancelLabel","loadingLabel"],"sources":["useCreateDialog.tsx"],"sourcesContent":["import React, { useCallback, useState } from \"react\";\nimport slugify from \"slugify\";\nimport { useSnackbar } from \"@webiny/app-admin\";\nimport { Bind, GenericFormData, useForm } from \"@webiny/form\";\nimport { Cell, Grid } from \"@webiny/ui/Grid\";\nimport { Input } from \"@webiny/ui/Input\";\nimport { Typography } from \"@webiny/ui/Typography\";\nimport { validation } from \"@webiny/validation\";\n\nimport { Extensions, FolderTree } from \"~/components\";\nimport { useDialogs } from \"@webiny/app-admin\";\nimport { DialogFoldersContainer } from \"~/dialogs/styled\";\nimport { useCreateFolder } from \"~/features\";\nimport { ROOT_FOLDER } from \"~/constants\";\nimport { FolderItem } from \"~/types\";\n\ninterface ShowDialogParams {\n currentParentId?: string | null;\n}\n\ninterface UseCreateDialogResponse {\n showDialog: (params?: ShowDialogParams) => void;\n}\n\ninterface FormComponentProps {\n currentParentId?: string | null;\n}\n\nconst FormComponent = ({ currentParentId = null }: FormComponentProps) => {\n const [parentId, setParentId] = useState<string | null>(currentParentId);\n const form = useForm();\n\n const generateSlug = () => {\n if (form.data.slug || !form.data.title) {\n return;\n }\n\n // We want to update slug only when the folder is first being created.\n form.setValue(\n \"slug\",\n slugify(form.data.title, {\n replacement: \"-\",\n lower: true,\n remove: /[*#\\?<>_\\{\\}\\[\\]+~.()'\"!:;@]/g,\n trim: false\n })\n );\n };\n\n return (\n <>\n <Grid>\n <Cell span={12}>\n <Bind name={\"title\"} validators={validation.create(\"required\")}>\n {bind => <Input {...bind} label={\"Title\"} onBlur={generateSlug} />}\n </Bind>\n </Cell>\n <Cell span={12}>\n <Bind name={\"slug\"} validators={validation.create(\"required,slug\")}>\n <Input label={\"Slug\"} />\n </Bind>\n </Cell>\n <Cell span={12}>\n <Typography use=\"body1\">{\"Parent folder\"}</Typography>\n <DialogFoldersContainer>\n <Bind name={\"parentId\"} defaultValue={parentId}>\n {({ onChange }) => (\n <FolderTree\n focusedFolderId={parentId || ROOT_FOLDER}\n onFolderClick={folder => {\n setParentId(folder.id);\n onChange(folder.id === ROOT_FOLDER ? null : folder.id);\n }}\n />\n )}\n </Bind>\n </DialogFoldersContainer>\n </Cell>\n </Grid>\n <Extensions />\n </>\n );\n};\n\nexport const useCreateDialog = (): UseCreateDialogResponse => {\n const dialogs = useDialogs();\n const { createFolder } = useCreateFolder();\n const { showSnackbar } = useSnackbar();\n\n const onAccept = useCallback(async (data: FolderItem) => {\n try {\n await createFolder({\n ...data,\n parentId: data.parentId === ROOT_FOLDER ? null : data.parentId\n });\n showSnackbar(\"Folder created successfully!\");\n } catch (error) {\n showSnackbar(error.message);\n }\n }, []);\n\n const showDialog = (params?: ShowDialogParams) => {\n const { currentParentId = null } = params ?? {};\n\n dialogs.showDialog({\n title: \"Create a new folder\",\n content: <FormComponent currentParentId={currentParentId} />,\n acceptLabel: \"Create folder\",\n cancelLabel: \"Cancel\",\n loadingLabel: \"Creating folder...\",\n /**\n * We need to cast as there are no generics to pass for the onAccept function.\n */\n onAccept: onAccept as (data: GenericFormData) => Promise<void>\n });\n };\n\n return {\n showDialog\n };\n};\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,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A,CAAIC,MAAyB,EAAK;IAC9C,IAAAC,KAAA,GAAmCD,MAAM,IAAI,CAAC,CAAC;MAAAE,qBAAA,GAAAD,KAAA,CAAvClE,eAAe;MAAfA,eAAe,GAAAmE,qBAAA,cAAG,IAAI,GAAAA,qBAAA;IAE9BhB,OAAO,CAACa,UAAU,CAAC;MACfnD,KAAK,EAAE,qBAAqB;MAC5BuD,OAAO,eAAEtF,MAAA,CAAAuB,OAAA,CAAAe,aAAA,CAACvB,aAAa;QAACG,eAAe,EAAEA;MAAgB,CAAE,CAAC;MAC5DqE,WAAW,EAAE,eAAe;MAC5BC,WAAW,EAAE,QAAQ;MACrBC,YAAY,EAAE,oBAAoB;MAClC;AACZ;AACA;MACYZ,QAAQ,EAAEA;IACd,CAAC,CAAC;EACN,CAAC;EAED,OAAO;IACHK,UAAU,EAAVA;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
|
package/dialogs/useEditDialog.js
CHANGED
|
@@ -25,7 +25,7 @@ var FormComponent = function FormComponent(_ref) {
|
|
|
25
25
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
26
26
|
parentId = _useState2[0],
|
|
27
27
|
setParentId = _useState2[1];
|
|
28
|
-
return /*#__PURE__*/_react.default.createElement(_Grid.Grid, null, /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
|
|
28
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Grid.Grid, null, /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
|
|
29
29
|
span: 12
|
|
30
30
|
}, /*#__PURE__*/_react.default.createElement(_form.Bind, {
|
|
31
31
|
name: "title",
|
|
@@ -59,7 +59,7 @@ var FormComponent = function FormComponent(_ref) {
|
|
|
59
59
|
},
|
|
60
60
|
enableCreate: true
|
|
61
61
|
});
|
|
62
|
-
}))));
|
|
62
|
+
})))), /*#__PURE__*/_react.default.createElement(_components.Extensions, null));
|
|
63
63
|
};
|
|
64
64
|
var useEditDialog = exports.useEditDialog = function useEditDialog() {
|
|
65
65
|
var dialog = (0, _appAdmin.useDialogs)();
|
|
@@ -82,6 +82,7 @@ var useEditDialog = exports.useEditDialog = function useEditDialog() {
|
|
|
82
82
|
content: /*#__PURE__*/_react.default.createElement(FormComponent, {
|
|
83
83
|
folder: folder
|
|
84
84
|
}),
|
|
85
|
+
formData: folder,
|
|
85
86
|
acceptLabel: "Edit folder",
|
|
86
87
|
cancelLabel: "Cancel",
|
|
87
88
|
loadingLabel: "Editing folder...",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_appAdmin","_form","_validation","_Grid","_Input","_Typography","_components","_constants","_styled","_features","FormComponent","_ref","folder","_useState","useState","parentId","_useState2","_slicedToArray2","default","setParentId","createElement","Grid","Cell","span","Bind","name","defaultValue","title","validators","validation","create","Input","label","slug","Typography","use","DialogFoldersContainer","_ref2","onChange","FolderTree","focusedFolderId","ROOT_FOLDER","hiddenFolderIds","id","onFolderClick","enableCreate","useEditDialog","exports","dialog","useDialogs","_useUpdateFolder","useUpdateFolder","updateFolder","_useSnackbar","useSnackbar","showSnackbar","onAccept","useCallback","data","_objectSpread2","concat","error","message","showDialog","_ref3","content","acceptLabel","cancelLabel","loadingLabel"],"sources":["useEditDialog.tsx"],"sourcesContent":["import React, { useCallback, useState } from \"react\";\nimport { useSnackbar } from \"@webiny/app-admin\";\nimport { Bind, GenericFormData } from \"@webiny/form\";\nimport { validation } from \"@webiny/validation\";\nimport { Cell, Grid } from \"@webiny/ui/Grid\";\nimport { Input } from \"@webiny/ui/Input\";\nimport { Typography } from \"@webiny/ui/Typography\";\n\nimport { FolderTree } from \"~/components\";\nimport { ROOT_FOLDER } from \"~/constants\";\nimport { useDialogs } from \"@webiny/app-admin\";\nimport { DialogFoldersContainer } from \"~/dialogs/styled\";\nimport { useUpdateFolder } from \"~/features\";\nimport { FolderItem } from \"~/types\";\n\ninterface ShowDialogParams {\n folder: FolderItem;\n}\n\ninterface UseEditDialogResponse {\n showDialog: (params: ShowDialogParams) => void;\n}\n\ninterface FormComponentProps {\n folder: FolderItem;\n}\n\nconst FormComponent = ({ folder }: FormComponentProps) => {\n const [parentId, setParentId] = useState<string | null>(folder.parentId);\n\n return (\n <Grid>\n
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_appAdmin","_form","_validation","_Grid","_Input","_Typography","_components","_constants","_styled","_features","FormComponent","_ref","folder","_useState","useState","parentId","_useState2","_slicedToArray2","default","setParentId","createElement","Fragment","Grid","Cell","span","Bind","name","defaultValue","title","validators","validation","create","Input","label","slug","Typography","use","DialogFoldersContainer","_ref2","onChange","FolderTree","focusedFolderId","ROOT_FOLDER","hiddenFolderIds","id","onFolderClick","enableCreate","Extensions","useEditDialog","exports","dialog","useDialogs","_useUpdateFolder","useUpdateFolder","updateFolder","_useSnackbar","useSnackbar","showSnackbar","onAccept","useCallback","data","_objectSpread2","concat","error","message","showDialog","_ref3","content","formData","acceptLabel","cancelLabel","loadingLabel"],"sources":["useEditDialog.tsx"],"sourcesContent":["import React, { useCallback, useState } from \"react\";\nimport { useSnackbar } from \"@webiny/app-admin\";\nimport { Bind, GenericFormData } from \"@webiny/form\";\nimport { validation } from \"@webiny/validation\";\nimport { Cell, Grid } from \"@webiny/ui/Grid\";\nimport { Input } from \"@webiny/ui/Input\";\nimport { Typography } from \"@webiny/ui/Typography\";\n\nimport { Extensions, FolderTree } from \"~/components\";\nimport { ROOT_FOLDER } from \"~/constants\";\nimport { useDialogs } from \"@webiny/app-admin\";\nimport { DialogFoldersContainer } from \"~/dialogs/styled\";\nimport { useUpdateFolder } from \"~/features\";\nimport { FolderItem } from \"~/types\";\n\ninterface ShowDialogParams {\n folder: FolderItem;\n}\n\ninterface UseEditDialogResponse {\n showDialog: (params: ShowDialogParams) => void;\n}\n\ninterface FormComponentProps {\n folder: FolderItem;\n}\n\nconst FormComponent = ({ folder }: FormComponentProps) => {\n const [parentId, setParentId] = useState<string | null>(folder.parentId);\n\n return (\n <>\n <Grid>\n <Cell span={12}>\n <Bind\n name={\"title\"}\n defaultValue={folder.title}\n validators={[validation.create(\"required\")]}\n >\n <Input label={\"Title\"} />\n </Bind>\n </Cell>\n <Cell span={12}>\n <Bind\n name={\"slug\"}\n defaultValue={folder.slug}\n validators={[validation.create(\"required,slug\")]}\n >\n <Input label={\"Slug\"} />\n </Bind>\n </Cell>\n <Cell span={12}>\n <Typography use=\"body1\">{\"Parent folder\"}</Typography>\n <DialogFoldersContainer>\n <Bind name={\"parentId\"} defaultValue={parentId}>\n {({ onChange }) => (\n <FolderTree\n focusedFolderId={parentId || ROOT_FOLDER}\n hiddenFolderIds={[folder.id]}\n onFolderClick={folder => {\n setParentId(folder.id);\n onChange(folder.id === ROOT_FOLDER ? null : folder.id);\n }}\n enableCreate={true}\n />\n )}\n </Bind>\n </DialogFoldersContainer>\n </Cell>\n </Grid>\n <Extensions />\n </>\n );\n};\n\nexport const useEditDialog = (): UseEditDialogResponse => {\n const dialog = useDialogs();\n const { updateFolder } = useUpdateFolder();\n const { showSnackbar } = useSnackbar();\n\n const onAccept = useCallback(async (folder: FolderItem, data: GenericFormData) => {\n try {\n await updateFolder({\n ...folder,\n ...data\n });\n showSnackbar(`The folder \"${data.title}\" was updated successfully!`);\n } catch (error) {\n showSnackbar(error.message);\n }\n }, []);\n\n const showDialog = ({ folder }: ShowDialogParams) => {\n dialog.showDialog({\n title: \"Edit folder\",\n content: <FormComponent folder={folder} />,\n formData: folder,\n acceptLabel: \"Edit folder\",\n cancelLabel: \"Cancel\",\n loadingLabel: \"Editing folder...\",\n onAccept: (data: GenericFormData) => onAccept(folder, data)\n });\n };\n\n return {\n showDialog\n };\n};\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,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AM,EAAEgD,IAAI,CAAC;MAAA;IAC/D,CAAC,CAAC;EACN,CAAC;EAED,OAAO;IACHK,UAAU,EAAVA;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
|
|
@@ -16,6 +16,7 @@ export interface FolderData {
|
|
|
16
16
|
savedOn?: string;
|
|
17
17
|
modifiedBy?: CmsIdentity | null;
|
|
18
18
|
modifiedOn?: string | null;
|
|
19
|
+
extensions?: Record<string, any>;
|
|
19
20
|
}
|
|
20
21
|
export declare class Folder {
|
|
21
22
|
id: string;
|
|
@@ -34,6 +35,7 @@ export declare class Folder {
|
|
|
34
35
|
savedOn?: string;
|
|
35
36
|
modifiedBy?: CmsIdentity | null;
|
|
36
37
|
modifiedOn?: string | null;
|
|
38
|
+
extensions: Record<string, any>;
|
|
37
39
|
protected constructor(folder: FolderData);
|
|
38
40
|
static create(folder: FolderData): Folder;
|
|
39
41
|
}
|
|
@@ -26,6 +26,7 @@ var Folder = exports.Folder = /*#__PURE__*/function () {
|
|
|
26
26
|
this.savedOn = folder.savedOn;
|
|
27
27
|
this.modifiedBy = folder.modifiedBy;
|
|
28
28
|
this.modifiedOn = folder.modifiedOn;
|
|
29
|
+
this.extensions = folder.extensions ?? {};
|
|
29
30
|
}
|
|
30
31
|
return (0, _createClass2.default)(Folder, null, [{
|
|
31
32
|
key: "create",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Folder","exports","folder","_classCallCheck2","default","id","title","slug","type","parentId","permissions","hasNonInheritedPermissions","canManagePermissions","canManageStructure","canManageContent","createdBy","createdOn","savedBy","savedOn","modifiedBy","modifiedOn","_createClass2","key","value","create"],"sources":["Folder.ts"],"sourcesContent":["import { CmsIdentity, FolderPermission } from \"~/types\";\n\nexport interface FolderData {\n id?: string;\n title: string;\n slug: string;\n type: string;\n parentId: string | null;\n permissions: FolderPermission[];\n hasNonInheritedPermissions?: boolean;\n canManagePermissions?: boolean;\n canManageStructure?: boolean;\n canManageContent?: boolean;\n createdBy?: CmsIdentity;\n createdOn?: string;\n savedBy?: CmsIdentity;\n savedOn?: string;\n modifiedBy?: CmsIdentity | null;\n modifiedOn?: string | null;\n}\n\nexport class Folder {\n public id: string;\n public title: string;\n public slug: string;\n public type: string;\n public parentId: string | null;\n public permissions: FolderPermission[];\n public hasNonInheritedPermissions?: boolean;\n public canManagePermissions?: boolean;\n public canManageStructure?: boolean;\n public canManageContent?: boolean;\n public createdBy?: CmsIdentity;\n public createdOn?: string;\n public savedBy?: CmsIdentity;\n public savedOn?: string;\n public modifiedBy?: CmsIdentity | null;\n public modifiedOn?: string | null;\n\n protected constructor(folder: FolderData) {\n this.id = folder.id ?? \"\";\n this.title = folder.title;\n this.slug = folder.slug;\n this.type = folder.type;\n this.parentId = folder.parentId;\n this.permissions = folder.permissions;\n this.hasNonInheritedPermissions = folder.hasNonInheritedPermissions;\n this.canManagePermissions = folder.canManagePermissions;\n this.canManageStructure = folder.canManageStructure;\n this.canManageContent = folder.canManageContent;\n this.createdBy = folder.createdBy;\n this.createdOn = folder.createdOn;\n this.savedBy = folder.savedBy;\n this.savedOn = folder.savedOn;\n this.modifiedBy = folder.modifiedBy;\n this.modifiedOn = folder.modifiedOn;\n }\n\n static create(folder: FolderData) {\n return new Folder(folder);\n }\n}\n"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"names":["Folder","exports","folder","_classCallCheck2","default","id","title","slug","type","parentId","permissions","hasNonInheritedPermissions","canManagePermissions","canManageStructure","canManageContent","createdBy","createdOn","savedBy","savedOn","modifiedBy","modifiedOn","extensions","_createClass2","key","value","create"],"sources":["Folder.ts"],"sourcesContent":["import { CmsIdentity, FolderPermission } from \"~/types\";\n\nexport interface FolderData {\n id?: string;\n title: string;\n slug: string;\n type: string;\n parentId: string | null;\n permissions: FolderPermission[];\n hasNonInheritedPermissions?: boolean;\n canManagePermissions?: boolean;\n canManageStructure?: boolean;\n canManageContent?: boolean;\n createdBy?: CmsIdentity;\n createdOn?: string;\n savedBy?: CmsIdentity;\n savedOn?: string;\n modifiedBy?: CmsIdentity | null;\n modifiedOn?: string | null;\n extensions?: Record<string, any>;\n}\n\nexport class Folder {\n public id: string;\n public title: string;\n public slug: string;\n public type: string;\n public parentId: string | null;\n public permissions: FolderPermission[];\n public hasNonInheritedPermissions?: boolean;\n public canManagePermissions?: boolean;\n public canManageStructure?: boolean;\n public canManageContent?: boolean;\n public createdBy?: CmsIdentity;\n public createdOn?: string;\n public savedBy?: CmsIdentity;\n public savedOn?: string;\n public modifiedBy?: CmsIdentity | null;\n public modifiedOn?: string | null;\n public extensions: Record<string, any>;\n\n protected constructor(folder: FolderData) {\n this.id = folder.id ?? \"\";\n this.title = folder.title;\n this.slug = folder.slug;\n this.type = folder.type;\n this.parentId = folder.parentId;\n this.permissions = folder.permissions;\n this.hasNonInheritedPermissions = folder.hasNonInheritedPermissions;\n this.canManagePermissions = folder.canManagePermissions;\n this.canManageStructure = folder.canManageStructure;\n this.canManageContent = folder.canManageContent;\n this.createdBy = folder.createdBy;\n this.createdOn = folder.createdOn;\n this.savedBy = folder.savedBy;\n this.savedOn = folder.savedOn;\n this.modifiedBy = folder.modifiedBy;\n this.modifiedOn = folder.modifiedOn;\n this.extensions = folder.extensions ?? {};\n }\n\n static create(folder: FolderData) {\n return new Folder(folder);\n }\n}\n"],"mappings":";;;;;;;;;IAsBaA,MAAM,GAAAC,OAAA,CAAAD,MAAA;EAmBf,SAAAA,OAAsBE,MAAkB,EAAE;IAAA,IAAAC,gBAAA,CAAAC,OAAA,QAAAJ,MAAA;IACtC,IAAI,CAACK,EAAE,GAAGH,MAAM,CAACG,EAAE,IAAI,EAAE;IACzB,IAAI,CAACC,KAAK,GAAGJ,MAAM,CAACI,KAAK;IACzB,IAAI,CAACC,IAAI,GAAGL,MAAM,CAACK,IAAI;IACvB,IAAI,CAACC,IAAI,GAAGN,MAAM,CAACM,IAAI;IACvB,IAAI,CAACC,QAAQ,GAAGP,MAAM,CAACO,QAAQ;IAC/B,IAAI,CAACC,WAAW,GAAGR,MAAM,CAACQ,WAAW;IACrC,IAAI,CAACC,0BAA0B,GAAGT,MAAM,CAACS,0BAA0B;IACnE,IAAI,CAACC,oBAAoB,GAAGV,MAAM,CAACU,oBAAoB;IACvD,IAAI,CAACC,kBAAkB,GAAGX,MAAM,CAACW,kBAAkB;IACnD,IAAI,CAACC,gBAAgB,GAAGZ,MAAM,CAACY,gBAAgB;IAC/C,IAAI,CAACC,SAAS,GAAGb,MAAM,CAACa,SAAS;IACjC,IAAI,CAACC,SAAS,GAAGd,MAAM,CAACc,SAAS;IACjC,IAAI,CAACC,OAAO,GAAGf,MAAM,CAACe,OAAO;IAC7B,IAAI,CAACC,OAAO,GAAGhB,MAAM,CAACgB,OAAO;IAC7B,IAAI,CAACC,UAAU,GAAGjB,MAAM,CAACiB,UAAU;IACnC,IAAI,CAACC,UAAU,GAAGlB,MAAM,CAACkB,UAAU;IACnC,IAAI,CAACC,UAAU,GAAGnB,MAAM,CAACmB,UAAU,IAAI,CAAC,CAAC;EAC7C;EAAC,WAAAC,aAAA,CAAAlB,OAAA,EAAAJ,MAAA;IAAAuB,GAAA;IAAAC,KAAA,EAED,SAAOC,MAAMA,CAACvB,MAAkB,EAAE;MAC9B,OAAO,IAAIF,MAAM,CAACE,MAAM,CAAC;IAC7B;EAAC;AAAA","ignoreList":[]}
|
|
@@ -13,9 +13,10 @@ export interface CreateFolderResponse {
|
|
|
13
13
|
export interface CreateFolderVariables {
|
|
14
14
|
data: Omit<FolderItem, "id" | "createdOn" | "createdBy" | "savedOn" | "savedBy" | "modifiedOn" | "modifiedBy" | "hasNonInheritedPermissions" | "canManageContent" | "canManagePermissions" | "canManageStructure">;
|
|
15
15
|
}
|
|
16
|
-
export declare const CREATE_FOLDER: import("graphql").DocumentNode;
|
|
16
|
+
export declare const CREATE_FOLDER: (FOLDER_FIELDS: string) => import("graphql").DocumentNode;
|
|
17
17
|
export declare class CreateFolderGqlGateway implements ICreateFolderGateway {
|
|
18
18
|
private client;
|
|
19
|
-
|
|
19
|
+
private modelFields;
|
|
20
|
+
constructor(client: ApolloClient<any>, modelFields: string);
|
|
20
21
|
execute(folder: FolderDto): Promise<FolderItem>;
|
|
21
22
|
}
|
|
@@ -11,17 +11,20 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
|
|
|
11
11
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
12
12
|
var _graphqlTag = _interopRequireDefault(require("graphql-tag"));
|
|
13
13
|
var _templateObject;
|
|
14
|
-
var CREATE_FOLDER = exports.CREATE_FOLDER =
|
|
14
|
+
var CREATE_FOLDER = exports.CREATE_FOLDER = function CREATE_FOLDER(FOLDER_FIELDS) {
|
|
15
|
+
return (0, _graphqlTag.default)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n mutation CreateFolder($data: FolderCreateInput!) {\n aco {\n createFolder(data: $data) {\n data ", "\n error {\n code\n data\n message\n }\n }\n }\n }\n "])), FOLDER_FIELDS);
|
|
16
|
+
};
|
|
15
17
|
var CreateFolderGqlGateway = exports.CreateFolderGqlGateway = /*#__PURE__*/function () {
|
|
16
|
-
function CreateFolderGqlGateway(client) {
|
|
18
|
+
function CreateFolderGqlGateway(client, modelFields) {
|
|
17
19
|
(0, _classCallCheck2.default)(this, CreateFolderGqlGateway);
|
|
18
20
|
this.client = client;
|
|
21
|
+
this.modelFields = modelFields;
|
|
19
22
|
}
|
|
20
23
|
return (0, _createClass2.default)(CreateFolderGqlGateway, [{
|
|
21
24
|
key: "execute",
|
|
22
25
|
value: async function execute(folder) {
|
|
23
26
|
var _await$this$client$mu = await this.client.mutate({
|
|
24
|
-
mutation: CREATE_FOLDER,
|
|
27
|
+
mutation: CREATE_FOLDER(this.modelFields),
|
|
25
28
|
variables: {
|
|
26
29
|
data: (0, _objectSpread2.default)({}, folder)
|
|
27
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_graphqlTag","_interopRequireDefault","require","_templateObject","CREATE_FOLDER","exports","gql","_taggedTemplateLiteral2","default","CreateFolderGqlGateway","client","_classCallCheck2","_createClass2","key","value","execute","folder","_await$this$client$mu","mutate","mutation","variables","data","_objectSpread2","response","Error","_response$aco$createF","aco","createFolder","error","message"],"sources":["CreateFolderGqlGateway.ts"],"sourcesContent":["import ApolloClient from \"apollo-client\";\nimport gql from \"graphql-tag\";\nimport { ICreateFolderGateway } from \"./ICreateFolderGateway\";\nimport { FolderDto } from \"./FolderDto\";\nimport { AcoError, FolderItem } from \"~/types\";\n\nexport interface CreateFolderResponse {\n aco: {\n createFolder: {\n data: FolderItem;\n error: AcoError | null;\n };\n };\n}\n\nexport interface CreateFolderVariables {\n data: Omit<\n FolderItem,\n | \"id\"\n | \"createdOn\"\n | \"createdBy\"\n | \"savedOn\"\n | \"savedBy\"\n | \"modifiedOn\"\n | \"modifiedBy\"\n | \"hasNonInheritedPermissions\"\n | \"canManageContent\"\n | \"canManagePermissions\"\n | \"canManageStructure\"\n >;\n}\n\nexport const CREATE_FOLDER = gql`\n
|
|
1
|
+
{"version":3,"names":["_graphqlTag","_interopRequireDefault","require","_templateObject","CREATE_FOLDER","exports","FOLDER_FIELDS","gql","_taggedTemplateLiteral2","default","CreateFolderGqlGateway","client","modelFields","_classCallCheck2","_createClass2","key","value","execute","folder","_await$this$client$mu","mutate","mutation","variables","data","_objectSpread2","response","Error","_response$aco$createF","aco","createFolder","error","message"],"sources":["CreateFolderGqlGateway.ts"],"sourcesContent":["import ApolloClient from \"apollo-client\";\nimport gql from \"graphql-tag\";\nimport { ICreateFolderGateway } from \"./ICreateFolderGateway\";\nimport { FolderDto } from \"./FolderDto\";\nimport { AcoError, FolderItem } from \"~/types\";\n\nexport interface CreateFolderResponse {\n aco: {\n createFolder: {\n data: FolderItem;\n error: AcoError | null;\n };\n };\n}\n\nexport interface CreateFolderVariables {\n data: Omit<\n FolderItem,\n | \"id\"\n | \"createdOn\"\n | \"createdBy\"\n | \"savedOn\"\n | \"savedBy\"\n | \"modifiedOn\"\n | \"modifiedBy\"\n | \"hasNonInheritedPermissions\"\n | \"canManageContent\"\n | \"canManagePermissions\"\n | \"canManageStructure\"\n >;\n}\n\nexport const CREATE_FOLDER = (FOLDER_FIELDS: string) => gql`\n mutation CreateFolder($data: FolderCreateInput!) {\n aco {\n createFolder(data: $data) {\n data ${FOLDER_FIELDS}\n error {\n code\n data\n message\n }\n }\n }\n }\n `;\n\nexport class CreateFolderGqlGateway implements ICreateFolderGateway {\n private client: ApolloClient<any>;\n private modelFields: string;\n\n constructor(client: ApolloClient<any>, modelFields: string) {\n this.client = client;\n this.modelFields = modelFields;\n }\n\n async execute(folder: FolderDto) {\n const { data: response } = await this.client.mutate<\n CreateFolderResponse,\n CreateFolderVariables\n >({\n mutation: CREATE_FOLDER(this.modelFields),\n variables: {\n data: {\n ...folder\n }\n }\n });\n\n if (!response) {\n throw new Error(\"Network error while creating folder.\");\n }\n\n const { data, error } = response.aco.createFolder;\n\n if (!data) {\n throw new Error(error?.message || \"Could not create folder\");\n }\n\n return data;\n }\n}\n"],"mappings":";;;;;;;;;;;AACA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA8B,IAAAC,eAAA;AA+BvB,IAAMC,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG,SAAhBA,aAAaA,CAAIE,aAAqB;EAAA,WAAKC,mBAAG,EAAAJ,eAAA,KAAAA,eAAA,OAAAK,uBAAA,CAAAC,OAAA,yWAIhCH,aAAa;AAAA,CASnC;AAAC,IAEOI,sBAAsB,GAAAL,OAAA,CAAAK,sBAAA;EAI/B,SAAAA,uBAAYC,MAAyB,EAAEC,WAAmB,EAAE;IAAA,IAAAC,gBAAA,CAAAJ,OAAA,QAAAC,sBAAA;IACxD,IAAI,CAACC,MAAM,GAAGA,MAAM;IACpB,IAAI,CAACC,WAAW,GAAGA,WAAW;EAClC;EAAC,WAAAE,aAAA,CAAAL,OAAA,EAAAC,sBAAA;IAAAK,GAAA;IAAAC,KAAA,EAED,eAAMC,OAAOA,CAACC,MAAiB,EAAE;MAC7B,IAAAC,qBAAA,GAA2B,MAAM,IAAI,CAACR,MAAM,CAACS,MAAM,CAGjD;UACEC,QAAQ,EAAEjB,aAAa,CAAC,IAAI,CAACQ,WAAW,CAAC;UACzCU,SAAS,EAAE;YACPC,IAAI,MAAAC,cAAA,CAAAf,OAAA,MACGS,MAAM;UAEjB;QACJ,CAAC,CAAC;QAVYO,QAAQ,GAAAN,qBAAA,CAAdI,IAAI;MAYZ,IAAI,CAACE,QAAQ,EAAE;QACX,MAAM,IAAIC,KAAK,CAAC,sCAAsC,CAAC;MAC3D;MAEA,IAAAC,qBAAA,GAAwBF,QAAQ,CAACG,GAAG,CAACC,YAAY;QAAzCN,IAAI,GAAAI,qBAAA,CAAJJ,IAAI;QAAEO,KAAK,GAAAH,qBAAA,CAALG,KAAK;MAEnB,IAAI,CAACP,IAAI,EAAE;QACP,MAAM,IAAIG,KAAK,CAACI,KAAK,EAAEC,OAAO,IAAI,yBAAyB,CAAC;MAChE;MAEA,OAAOR,IAAI;IACf;EAAC;AAAA","ignoreList":[]}
|
|
@@ -23,7 +23,8 @@ var CreateFolderRepository = exports.CreateFolderRepository = /*#__PURE__*/funct
|
|
|
23
23
|
slug: folder.slug,
|
|
24
24
|
permissions: folder.permissions,
|
|
25
25
|
type: this.type,
|
|
26
|
-
parentId: folder.parentId
|
|
26
|
+
parentId: folder.parentId,
|
|
27
|
+
extensions: folder.extensions
|
|
27
28
|
};
|
|
28
29
|
var result = await this.gateway.execute(dto);
|
|
29
30
|
this.cache.addItems([_Folder.Folder.create(result)]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_Folder","require","CreateFolderRepository","exports","cache","gateway","type","_classCallCheck2","default","_createClass2","key","value","execute","folder","dto","title","slug","permissions","parentId","result","addItems","Folder","create"],"sources":["CreateFolderRepository.ts"],"sourcesContent":["import { ICreateFolderRepository } from \"./ICreateFolderRepository\";\nimport { ListCache } from \"../cache\";\nimport { Folder } from \"../Folder\";\nimport { ICreateFolderGateway } from \"./ICreateFolderGateway\";\nimport { FolderDto } from \"./FolderDto\";\n\nexport class CreateFolderRepository implements ICreateFolderRepository {\n private cache: ListCache<Folder>;\n private gateway: ICreateFolderGateway;\n private readonly type: string;\n\n constructor(cache: ListCache<Folder>, gateway: ICreateFolderGateway, type: string) {\n this.cache = cache;\n this.gateway = gateway;\n this.type = type;\n }\n\n async execute(folder: Folder) {\n const dto: FolderDto = {\n title: folder.title,\n slug: folder.slug,\n permissions: folder.permissions,\n type: this.type,\n parentId: folder.parentId\n };\n\n const result = await this.gateway.execute(dto);\n this.cache.addItems([Folder.create(result)]);\n }\n}\n"],"mappings":";;;;;;;;;AAEA,IAAAA,OAAA,GAAAC,OAAA;AAAmC,IAItBC,sBAAsB,GAAAC,OAAA,CAAAD,sBAAA;EAK/B,SAAAA,uBAAYE,KAAwB,EAAEC,OAA6B,EAAEC,IAAY,EAAE;IAAA,IAAAC,gBAAA,CAAAC,OAAA,QAAAN,sBAAA;IAC/E,IAAI,CAACE,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACC,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACC,IAAI,GAAGA,IAAI;EACpB;EAAC,WAAAG,aAAA,CAAAD,OAAA,EAAAN,sBAAA;IAAAQ,GAAA;IAAAC,KAAA,EAED,eAAMC,OAAOA,CAACC,MAAc,EAAE;MAC1B,IAAMC,GAAc,GAAG;QACnBC,KAAK,EAAEF,MAAM,CAACE,KAAK;QACnBC,IAAI,EAAEH,MAAM,CAACG,IAAI;QACjBC,WAAW,EAAEJ,MAAM,CAACI,WAAW;QAC/BX,IAAI,EAAE,IAAI,CAACA,IAAI;QACfY,QAAQ,EAAEL,MAAM,CAACK;
|
|
1
|
+
{"version":3,"names":["_Folder","require","CreateFolderRepository","exports","cache","gateway","type","_classCallCheck2","default","_createClass2","key","value","execute","folder","dto","title","slug","permissions","parentId","extensions","result","addItems","Folder","create"],"sources":["CreateFolderRepository.ts"],"sourcesContent":["import { ICreateFolderRepository } from \"./ICreateFolderRepository\";\nimport { ListCache } from \"../cache\";\nimport { Folder } from \"../Folder\";\nimport { ICreateFolderGateway } from \"./ICreateFolderGateway\";\nimport { FolderDto } from \"./FolderDto\";\n\nexport class CreateFolderRepository implements ICreateFolderRepository {\n private cache: ListCache<Folder>;\n private gateway: ICreateFolderGateway;\n private readonly type: string;\n\n constructor(cache: ListCache<Folder>, gateway: ICreateFolderGateway, type: string) {\n this.cache = cache;\n this.gateway = gateway;\n this.type = type;\n }\n\n async execute(folder: Folder) {\n const dto: FolderDto = {\n title: folder.title,\n slug: folder.slug,\n permissions: folder.permissions,\n type: this.type,\n parentId: folder.parentId,\n extensions: folder.extensions\n };\n\n const result = await this.gateway.execute(dto);\n this.cache.addItems([Folder.create(result)]);\n }\n}\n"],"mappings":";;;;;;;;;AAEA,IAAAA,OAAA,GAAAC,OAAA;AAAmC,IAItBC,sBAAsB,GAAAC,OAAA,CAAAD,sBAAA;EAK/B,SAAAA,uBAAYE,KAAwB,EAAEC,OAA6B,EAAEC,IAAY,EAAE;IAAA,IAAAC,gBAAA,CAAAC,OAAA,QAAAN,sBAAA;IAC/E,IAAI,CAACE,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACC,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACC,IAAI,GAAGA,IAAI;EACpB;EAAC,WAAAG,aAAA,CAAAD,OAAA,EAAAN,sBAAA;IAAAQ,GAAA;IAAAC,KAAA,EAED,eAAMC,OAAOA,CAACC,MAAc,EAAE;MAC1B,IAAMC,GAAc,GAAG;QACnBC,KAAK,EAAEF,MAAM,CAACE,KAAK;QACnBC,IAAI,EAAEH,MAAM,CAACG,IAAI;QACjBC,WAAW,EAAEJ,MAAM,CAACI,WAAW;QAC/BX,IAAI,EAAE,IAAI,CAACA,IAAI;QACfY,QAAQ,EAAEL,MAAM,CAACK,QAAQ;QACzBC,UAAU,EAAEN,MAAM,CAACM;MACvB,CAAC;MAED,IAAMC,MAAM,GAAG,MAAM,IAAI,CAACf,OAAO,CAACO,OAAO,CAACE,GAAG,CAAC;MAC9C,IAAI,CAACV,KAAK,CAACiB,QAAQ,CAAC,CAACC,cAAM,CAACC,MAAM,CAACH,MAAM,CAAC,CAAC,CAAC;IAChD;EAAC;AAAA","ignoreList":[]}
|
|
@@ -21,7 +21,8 @@ var CreateFolderUseCase = exports.CreateFolderUseCase = /*#__PURE__*/function ()
|
|
|
21
21
|
slug: params.slug,
|
|
22
22
|
type: params.type,
|
|
23
23
|
parentId: params.parentId,
|
|
24
|
-
permissions: params.permissions
|
|
24
|
+
permissions: params.permissions,
|
|
25
|
+
extensions: params.extensions
|
|
25
26
|
}));
|
|
26
27
|
}
|
|
27
28
|
}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_Folder","require","CreateFolderUseCase","exports","repository","_classCallCheck2","default","_createClass2","key","value","execute","params","Folder","create","title","slug","type","parentId","permissions"],"sources":["CreateFolderUseCase.ts"],"sourcesContent":["import { CreateFolderParams, ICreateFolderUseCase } from \"./ICreateFolderUseCase\";\nimport { ICreateFolderRepository } from \"./ICreateFolderRepository\";\nimport { Folder } from \"../Folder\";\n\nexport class CreateFolderUseCase implements ICreateFolderUseCase {\n private repository: ICreateFolderRepository;\n\n constructor(repository: ICreateFolderRepository) {\n this.repository = repository;\n }\n\n async execute(params: CreateFolderParams) {\n await this.repository.execute(\n Folder.create({\n title: params.title,\n slug: params.slug,\n type: params.type,\n parentId: params.parentId,\n permissions: params.permissions\n })\n );\n }\n}\n"],"mappings":";;;;;;;;;AAEA,IAAAA,OAAA,GAAAC,OAAA;AAAmC,IAEtBC,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA;EAG5B,SAAAA,oBAAYE,UAAmC,EAAE;IAAA,IAAAC,gBAAA,CAAAC,OAAA,QAAAJ,mBAAA;IAC7C,IAAI,CAACE,UAAU,GAAGA,UAAU;EAChC;EAAC,WAAAG,aAAA,CAAAD,OAAA,EAAAJ,mBAAA;IAAAM,GAAA;IAAAC,KAAA,EAED,eAAMC,OAAOA,CAACC,MAA0B,EAAE;MACtC,MAAM,IAAI,CAACP,UAAU,CAACM,OAAO,CACzBE,cAAM,CAACC,MAAM,CAAC;QACVC,KAAK,EAAEH,MAAM,CAACG,KAAK;QACnBC,IAAI,EAAEJ,MAAM,CAACI,IAAI;QACjBC,IAAI,EAAEL,MAAM,CAACK,IAAI;QACjBC,QAAQ,EAAEN,MAAM,CAACM,QAAQ;QACzBC,WAAW,EAAEP,MAAM,CAACO;
|
|
1
|
+
{"version":3,"names":["_Folder","require","CreateFolderUseCase","exports","repository","_classCallCheck2","default","_createClass2","key","value","execute","params","Folder","create","title","slug","type","parentId","permissions","extensions"],"sources":["CreateFolderUseCase.ts"],"sourcesContent":["import { CreateFolderParams, ICreateFolderUseCase } from \"./ICreateFolderUseCase\";\nimport { ICreateFolderRepository } from \"./ICreateFolderRepository\";\nimport { Folder } from \"../Folder\";\n\nexport class CreateFolderUseCase implements ICreateFolderUseCase {\n private repository: ICreateFolderRepository;\n\n constructor(repository: ICreateFolderRepository) {\n this.repository = repository;\n }\n\n async execute(params: CreateFolderParams) {\n await this.repository.execute(\n Folder.create({\n title: params.title,\n slug: params.slug,\n type: params.type,\n parentId: params.parentId,\n permissions: params.permissions,\n extensions: params.extensions\n })\n );\n }\n}\n"],"mappings":";;;;;;;;;AAEA,IAAAA,OAAA,GAAAC,OAAA;AAAmC,IAEtBC,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA;EAG5B,SAAAA,oBAAYE,UAAmC,EAAE;IAAA,IAAAC,gBAAA,CAAAC,OAAA,QAAAJ,mBAAA;IAC7C,IAAI,CAACE,UAAU,GAAGA,UAAU;EAChC;EAAC,WAAAG,aAAA,CAAAD,OAAA,EAAAJ,mBAAA;IAAAM,GAAA;IAAAC,KAAA,EAED,eAAMC,OAAOA,CAACC,MAA0B,EAAE;MACtC,MAAM,IAAI,CAACP,UAAU,CAACM,OAAO,CACzBE,cAAM,CAACC,MAAM,CAAC;QACVC,KAAK,EAAEH,MAAM,CAACG,KAAK;QACnBC,IAAI,EAAEJ,MAAM,CAACI,IAAI;QACjBC,IAAI,EAAEL,MAAM,CAACK,IAAI;QACjBC,QAAQ,EAAEN,MAAM,CAACM,QAAQ;QACzBC,WAAW,EAAEP,MAAM,CAACO,WAAW;QAC/BC,UAAU,EAAER,MAAM,CAACQ;MACvB,CAAC,CACL,CAAC;IACL;EAAC;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["FolderDto.ts"],"sourcesContent":["import { FolderPermission } from \"~/types\";\n\nexport interface FolderDto {\n title: string;\n slug: string;\n permissions: FolderPermission[];\n type: string;\n parentId: string | null;\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["FolderDto.ts"],"sourcesContent":["import { FolderPermission } from \"~/types\";\n\nexport interface FolderDto {\n title: string;\n slug: string;\n permissions: FolderPermission[];\n type: string;\n parentId: string | null;\n extensions: Record<string, any>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["FolderGqlDto.ts"],"sourcesContent":["import { CmsIdentity, FolderPermission } from \"~/types\";\n\nexport interface FolderGqlDto {\n id: string;\n title: string;\n slug: string;\n permissions: FolderPermission[];\n hasNonInheritedPermissions: boolean;\n canManagePermissions: boolean;\n canManageStructure: boolean;\n canManageContent: boolean;\n type: string;\n parentId: string | null;\n createdBy: CmsIdentity;\n createdOn: string;\n savedBy: CmsIdentity;\n savedOn: string;\n modifiedBy: CmsIdentity | null;\n modifiedOn: string | null;\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["FolderGqlDto.ts"],"sourcesContent":["import { CmsIdentity, FolderPermission } from \"~/types\";\n\nexport interface FolderGqlDto {\n id: string;\n title: string;\n slug: string;\n permissions: FolderPermission[];\n hasNonInheritedPermissions: boolean;\n canManagePermissions: boolean;\n canManageStructure: boolean;\n canManageContent: boolean;\n type: string;\n parentId: string | null;\n createdBy: CmsIdentity;\n createdOn: string;\n savedBy: CmsIdentity;\n savedOn: string;\n modifiedBy: CmsIdentity | null;\n modifiedOn: string | null;\n extensions: Record<string, any>;\n}\n"],"mappings":"","ignoreList":[]}
|