@webiny/app-website-builder-workflows 0.0.0-unstable.e622468070 → 0.0.0-unstable.eb81deee7e
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/Components/OptionItem/OpenInNewWindow.js +26 -33
- package/Components/OptionItem/OpenInNewWindow.js.map +1 -1
- package/Components/OptionItem/index.js +0 -2
- package/Components/PageEditor/PageEditorAutoSave.js +16 -27
- package/Components/PageEditor/PageEditorAutoSave.js.map +1 -1
- package/Components/PageEditor/PageEditorConfig.js +6 -9
- package/Components/PageEditor/PageEditorConfig.js.map +1 -1
- package/Components/PageEditor/PageEditorLayout.js +22 -35
- package/Components/PageEditor/PageEditorLayout.js.map +1 -1
- package/Components/PageEditor/PageEditorTopBar.d.ts +2 -0
- package/Components/PageEditor/PageEditorTopBar.js +28 -0
- package/Components/PageEditor/PageEditorTopBar.js.map +1 -0
- package/Components/PageEditor/PageFormWorkflowState.d.ts +3 -1
- package/Components/PageEditor/PageFormWorkflowState.js +17 -34
- package/Components/PageEditor/PageFormWorkflowState.js.map +1 -1
- package/Components/PageEditor/PageFormWorkflowStatePublishButton.js +17 -28
- package/Components/PageEditor/PageFormWorkflowStatePublishButton.js.map +1 -1
- package/Components/PageEditor/PageFormWorkflowStateTooltip.js +10 -19
- package/Components/PageEditor/PageFormWorkflowStateTooltip.js.map +1 -1
- package/Components/PageEditor/ToggleEditorMode.d.ts +3 -0
- package/Components/PageEditor/ToggleEditorMode.js +21 -0
- package/Components/PageEditor/ToggleEditorMode.js.map +1 -0
- package/Components/PageWorkflows/PageWorkflowsEditorView.js +44 -50
- package/Components/PageWorkflows/PageWorkflowsEditorView.js.map +1 -1
- package/Components/PageWorkflows/index.js +0 -2
- package/Components/PagesList/PageListChangeStatus.js +17 -25
- package/Components/PagesList/PageListChangeStatus.js.map +1 -1
- package/Components/PagesList/PagesList.js +3 -4
- package/Components/PagesList/PagesList.js.map +1 -1
- package/Components/PagesList/PagesListContentReviews.js +19 -35
- package/Components/PagesList/PagesListContentReviews.js.map +1 -1
- package/Components/PagesList/index.js +0 -2
- package/Components/index.d.ts +0 -1
- package/Components/index.js +0 -3
- package/Routes/WebsiteBuilderWorkflowsMenu.js +23 -26
- package/Routes/WebsiteBuilderWorkflowsMenu.js.map +1 -1
- package/Routes/index.js +0 -2
- package/constants.js +2 -1
- package/constants.js.map +1 -1
- package/hooks/usePage.js +12 -17
- package/hooks/usePage.js.map +1 -1
- package/index.d.ts +1 -1
- package/index.js +11 -8
- package/index.js.map +1 -1
- package/package.json +24 -21
- package/presentation/page/PageGet/WorkflowStatesGetPageGraphQLFieldSelection.js +11 -8
- package/presentation/page/PageGet/WorkflowStatesGetPageGraphQLFieldSelection.js.map +1 -1
- package/presentation/page/PageGet/feature.js +6 -5
- package/presentation/page/PageGet/feature.js.map +1 -1
- package/presentation/page/PageList/TableRowMapperDecorator.d.ts +12 -0
- package/presentation/page/PageList/TableRowMapperDecorator.js +24 -0
- package/presentation/page/PageList/TableRowMapperDecorator.js.map +1 -0
- package/presentation/page/PageList/WorkflowStateListPagesFieldSelection.d.ts +2 -2
- package/presentation/page/PageList/WorkflowStateListPagesFieldSelection.js +12 -9
- package/presentation/page/PageList/WorkflowStateListPagesFieldSelection.js.map +1 -1
- package/presentation/page/PageList/feature.js +8 -7
- package/presentation/page/PageList/feature.js.map +1 -1
- package/routes.js +15 -16
- package/routes.js.map +1 -1
- package/types.d.ts +8 -12
- package/types.js +0 -3
- package/Components/OptionItem/index.js.map +0 -1
- package/Components/PageEditor/PageEditorSettings.d.ts +0 -2
- package/Components/PageEditor/PageEditorSettings.js +0 -30
- package/Components/PageEditor/PageEditorSettings.js.map +0 -1
- package/Components/PageEditor/PageEditorSidebar.d.ts +0 -2
- package/Components/PageEditor/PageEditorSidebar.js +0 -17
- package/Components/PageEditor/PageEditorSidebar.js.map +0 -1
- package/Components/PageEditor/PageEditorToolbar.d.ts +0 -2
- package/Components/PageEditor/PageEditorToolbar.js +0 -17
- package/Components/PageEditor/PageEditorToolbar.js.map +0 -1
- package/Components/PageWorkflows/index.js.map +0 -1
- package/Components/PagesList/index.js.map +0 -1
- package/Components/index.js.map +0 -1
- package/Routes/index.js.map +0 -1
- package/presentation/page/PageList/PageListPresenterDecorator.d.ts +0 -13
- package/presentation/page/PageList/PageListPresenterDecorator.js +0 -42
- package/presentation/page/PageList/PageListPresenterDecorator.js.map +0 -1
- package/types.js.map +0 -1
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import { GetPageGraphQLFieldSelection } from "@webiny/app-website-builder/features/pages/getPage/abstractions.js";
|
|
2
2
|
class WorkflowStatesGetPageGraphQLFieldSelection {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
getSelection() {
|
|
4
|
+
return [
|
|
5
|
+
`system {
|
|
6
|
+
workflow {
|
|
6
7
|
workflowId
|
|
7
8
|
stepId
|
|
8
9
|
stepName
|
|
9
10
|
state
|
|
10
11
|
}
|
|
11
|
-
}`
|
|
12
|
-
|
|
12
|
+
}`
|
|
13
|
+
];
|
|
14
|
+
}
|
|
13
15
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
const WorkflowStateGetPageFieldSelection = GetPageGraphQLFieldSelection.createImplementation({
|
|
17
|
+
dependencies: [],
|
|
18
|
+
implementation: WorkflowStatesGetPageGraphQLFieldSelection
|
|
17
19
|
});
|
|
20
|
+
export { WorkflowStateGetPageFieldSelection };
|
|
18
21
|
|
|
19
22
|
//# sourceMappingURL=WorkflowStatesGetPageGraphQLFieldSelection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"presentation/page/PageGet/WorkflowStatesGetPageGraphQLFieldSelection.js","sources":["../../../../src/presentation/page/PageGet/WorkflowStatesGetPageGraphQLFieldSelection.ts"],"sourcesContent":["import { GetPageGraphQLFieldSelection } from \"@webiny/app-website-builder/features/pages/getPage/abstractions.js\";\n\nclass WorkflowStatesGetPageGraphQLFieldSelection implements GetPageGraphQLFieldSelection.Interface {\n getSelection(): string[] {\n return [\n `system {\n workflow {\n workflowId\n stepId\n stepName\n state\n }\n }`\n ];\n }\n}\n\nexport const WorkflowStateGetPageFieldSelection = GetPageGraphQLFieldSelection.createImplementation(\n {\n dependencies: [],\n implementation: WorkflowStatesGetPageGraphQLFieldSelection\n }\n);\n"],"names":["WorkflowStatesGetPageGraphQLFieldSelection","WorkflowStateGetPageFieldSelection","GetPageGraphQLFieldSelection"],"mappings":";AAEA,MAAMA;IACF,eAAyB;QACrB,OAAO;YACH,CAAC;;;;;;;aAOA,CAAC;SACL;IACL;AACJ;AAEO,MAAMC,qCAAqCC,6BAA6B,oBAAoB,CAC/F;IACI,cAAc,EAAE;IAChB,gBAAgBF;AACpB"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { createFeature } from "@webiny/feature/admin";
|
|
2
2
|
import { WorkflowStateGetPageFieldSelection } from "./WorkflowStatesGetPageGraphQLFieldSelection.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
const PageGetWorkflowsFeature = createFeature({
|
|
4
|
+
name: "PageGetWorkflows",
|
|
5
|
+
register (container) {
|
|
6
|
+
container.register(WorkflowStateGetPageFieldSelection);
|
|
7
|
+
}
|
|
8
8
|
});
|
|
9
|
+
export { PageGetWorkflowsFeature };
|
|
9
10
|
|
|
10
11
|
//# sourceMappingURL=feature.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"presentation/page/PageGet/feature.js","sources":["../../../../src/presentation/page/PageGet/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/admin\";\nimport { WorkflowStateGetPageFieldSelection } from \"./WorkflowStatesGetPageGraphQLFieldSelection.js\";\n\nexport const PageGetWorkflowsFeature = createFeature({\n name: \"PageGetWorkflows\",\n register(container) {\n container.register(WorkflowStateGetPageFieldSelection);\n }\n});\n"],"names":["PageGetWorkflowsFeature","createFeature","container","WorkflowStateGetPageFieldSelection"],"mappings":";;AAGO,MAAMA,0BAA0BC,cAAc;IACjD,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;IACvB;AACJ"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TableRowMapper } from "@webiny/app-website-builder/presentation/pages/PageList/index.js";
|
|
2
|
+
import type { Page } from "@webiny/app-website-builder/domain/Page/Page.js";
|
|
3
|
+
import "~/types.js";
|
|
4
|
+
declare class TableRowMapperWithWorkflows implements TableRowMapper.Interface {
|
|
5
|
+
private decoratee;
|
|
6
|
+
constructor(decoratee: TableRowMapper.Interface);
|
|
7
|
+
fromPage(page: Page): TableRowMapper.TableRow;
|
|
8
|
+
}
|
|
9
|
+
export declare const TableRowMapperWorkflowDecorator: typeof TableRowMapperWithWorkflows & {
|
|
10
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/app-website-builder/presentation/pages/PageList/components/Table/abstractions").ITableRowMapper>;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { TableRowMapper } from "@webiny/app-website-builder/presentation/pages/PageList/index.js";
|
|
2
|
+
import { WorkflowStateValue } from "@webiny/app-workflows/types.js";
|
|
3
|
+
import "../../../types.js";
|
|
4
|
+
class TableRowMapperWithWorkflows {
|
|
5
|
+
constructor(decoratee){
|
|
6
|
+
this.decoratee = decoratee;
|
|
7
|
+
}
|
|
8
|
+
fromPage(page) {
|
|
9
|
+
const row = this.decoratee.fromPage(page);
|
|
10
|
+
const workflowState = page.system?.workflow?.state;
|
|
11
|
+
if (workflowState && workflowState !== WorkflowStateValue.approved) return {
|
|
12
|
+
...row,
|
|
13
|
+
$selectable: false
|
|
14
|
+
};
|
|
15
|
+
return row;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
const TableRowMapperWorkflowDecorator = TableRowMapper.createDecorator({
|
|
19
|
+
decorator: TableRowMapperWithWorkflows,
|
|
20
|
+
dependencies: []
|
|
21
|
+
});
|
|
22
|
+
export { TableRowMapperWorkflowDecorator };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=TableRowMapperDecorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presentation/page/PageList/TableRowMapperDecorator.js","sources":["../../../../src/presentation/page/PageList/TableRowMapperDecorator.ts"],"sourcesContent":["import { TableRowMapper } from \"@webiny/app-website-builder/presentation/pages/PageList/index.js\";\nimport type { Page } from \"@webiny/app-website-builder/domain/Page/Page.js\";\nimport { WorkflowStateValue } from \"@webiny/app-workflows/types.js\";\nimport \"~/types.js\";\n\nclass TableRowMapperWithWorkflows implements TableRowMapper.Interface {\n constructor(private decoratee: TableRowMapper.Interface) {}\n\n fromPage(page: Page): TableRowMapper.TableRow {\n const row = this.decoratee.fromPage(page);\n\n const workflowState = page.system?.workflow?.state;\n if (workflowState && workflowState !== WorkflowStateValue.approved) {\n return { ...row, $selectable: false };\n }\n\n return row;\n }\n}\n\nexport const TableRowMapperWorkflowDecorator = TableRowMapper.createDecorator({\n decorator: TableRowMapperWithWorkflows,\n dependencies: []\n});\n"],"names":["TableRowMapperWithWorkflows","decoratee","page","row","workflowState","WorkflowStateValue","TableRowMapperWorkflowDecorator","TableRowMapper"],"mappings":";;;AAKA,MAAMA;IACF,YAAoBC,SAAmC,CAAE;aAArCA,SAAS,GAATA;IAAsC;IAE1D,SAASC,IAAU,EAA2B;QAC1C,MAAMC,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,CAACD;QAEpC,MAAME,gBAAgBF,KAAK,MAAM,EAAE,UAAU;QAC7C,IAAIE,iBAAiBA,kBAAkBC,mBAAmB,QAAQ,EAC9D,OAAO;YAAE,GAAGF,GAAG;YAAE,aAAa;QAAM;QAGxC,OAAOA;IACX;AACJ;AAEO,MAAMG,kCAAkCC,eAAe,eAAe,CAAC;IAC1E,WAAWP;IACX,cAAc,EAAE;AACpB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ListPagesGraphQLFieldSelection } from "@webiny/app-website-builder/features/pages/
|
|
1
|
+
import { ListPagesGraphQLFieldSelection } from "@webiny/app-website-builder/features/pages/listPages/abstractions.js";
|
|
2
2
|
declare class WorkflowStatesListPagesGraphQLFieldSelection implements ListPagesGraphQLFieldSelection.Interface {
|
|
3
3
|
getSelection(): string[];
|
|
4
4
|
}
|
|
5
5
|
export declare const WorkflowStateListPagesFieldSelection: typeof WorkflowStatesListPagesGraphQLFieldSelection & {
|
|
6
|
-
__abstraction: import("@webiny/di").Abstraction<import("@webiny/app-website-builder/features/pages/
|
|
6
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/app-website-builder/features/pages/listPages/abstractions.js").IListPagesGraphQLFieldSelection>;
|
|
7
7
|
};
|
|
8
8
|
export {};
|
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
import { ListPagesGraphQLFieldSelection } from "@webiny/app-website-builder/features/pages/
|
|
1
|
+
import { ListPagesGraphQLFieldSelection } from "@webiny/app-website-builder/features/pages/listPages/abstractions.js";
|
|
2
2
|
class WorkflowStatesListPagesGraphQLFieldSelection {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
getSelection() {
|
|
4
|
+
return [
|
|
5
|
+
`system {
|
|
6
|
+
workflow {
|
|
6
7
|
workflowId
|
|
7
8
|
stepId
|
|
8
9
|
stepName
|
|
9
10
|
state
|
|
10
11
|
}
|
|
11
|
-
}`
|
|
12
|
-
|
|
12
|
+
}`
|
|
13
|
+
];
|
|
14
|
+
}
|
|
13
15
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
const WorkflowStateListPagesFieldSelection = ListPagesGraphQLFieldSelection.createImplementation({
|
|
17
|
+
dependencies: [],
|
|
18
|
+
implementation: WorkflowStatesListPagesGraphQLFieldSelection
|
|
17
19
|
});
|
|
20
|
+
export { WorkflowStateListPagesFieldSelection };
|
|
18
21
|
|
|
19
22
|
//# sourceMappingURL=WorkflowStateListPagesFieldSelection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"presentation/page/PageList/WorkflowStateListPagesFieldSelection.js","sources":["../../../../src/presentation/page/PageList/WorkflowStateListPagesFieldSelection.ts"],"sourcesContent":["import { ListPagesGraphQLFieldSelection } from \"@webiny/app-website-builder/features/pages/listPages/abstractions.js\";\n\nclass WorkflowStatesListPagesGraphQLFieldSelection\n implements ListPagesGraphQLFieldSelection.Interface\n{\n getSelection(): string[] {\n return [\n `system {\n workflow {\n workflowId\n stepId\n stepName\n state\n }\n }`\n ];\n }\n}\n\nexport const WorkflowStateListPagesFieldSelection =\n ListPagesGraphQLFieldSelection.createImplementation({\n dependencies: [],\n implementation: WorkflowStatesListPagesGraphQLFieldSelection\n });\n"],"names":["WorkflowStatesListPagesGraphQLFieldSelection","WorkflowStateListPagesFieldSelection","ListPagesGraphQLFieldSelection"],"mappings":";AAEA,MAAMA;IAGF,eAAyB;QACrB,OAAO;YACH,CAAC;;;;;;;aAOA,CAAC;SACL;IACL;AACJ;AAEO,MAAMC,uCACTC,+BAA+B,oBAAoB,CAAC;IAChD,cAAc,EAAE;IAChB,gBAAgBF;AACpB"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { createFeature } from "@webiny/feature/admin";
|
|
2
|
-
import { PageListPresenterDecorator } from "./PageListPresenterDecorator.js";
|
|
3
2
|
import { WorkflowStateListPagesFieldSelection } from "./WorkflowStateListPagesFieldSelection.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
container
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
import { TableRowMapperWorkflowDecorator } from "./TableRowMapperDecorator.js";
|
|
4
|
+
const PageListWorkflowsFeature = createFeature({
|
|
5
|
+
name: "PageListWorkflows",
|
|
6
|
+
register (container) {
|
|
7
|
+
container.register(WorkflowStateListPagesFieldSelection);
|
|
8
|
+
container.registerDecorator(TableRowMapperWorkflowDecorator);
|
|
9
|
+
}
|
|
10
10
|
});
|
|
11
|
+
export { PageListWorkflowsFeature };
|
|
11
12
|
|
|
12
13
|
//# sourceMappingURL=feature.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"presentation/page/PageList/feature.js","sources":["../../../../src/presentation/page/PageList/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/admin\";\nimport { WorkflowStateListPagesFieldSelection } from \"./WorkflowStateListPagesFieldSelection.js\";\nimport { TableRowMapperWorkflowDecorator } from \"./TableRowMapperDecorator.js\";\n\nexport const PageListWorkflowsFeature = createFeature({\n name: \"PageListWorkflows\",\n register(container) {\n container.register(WorkflowStateListPagesFieldSelection);\n container.registerDecorator(TableRowMapperWorkflowDecorator);\n }\n});\n"],"names":["PageListWorkflowsFeature","createFeature","container","WorkflowStateListPagesFieldSelection","TableRowMapperWorkflowDecorator"],"mappings":";;;AAIO,MAAMA,2BAA2BC,cAAc;IAClD,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;QACnBD,UAAU,iBAAiB,CAACE;IAChC;AACJ"}
|
package/routes.js
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import { Route } from "@webiny/app-admin";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
})
|
|
17
|
-
}
|
|
2
|
+
const Routes = {
|
|
3
|
+
Pages: {
|
|
4
|
+
Workflows: new Route({
|
|
5
|
+
name: "WebsiteBuilder/PageWorkflow",
|
|
6
|
+
path: "/website-builder/workflows",
|
|
7
|
+
params: (zod)=>({
|
|
8
|
+
app: zod.string().optional()
|
|
9
|
+
})
|
|
10
|
+
}),
|
|
11
|
+
WorkflowStateList: new Route({
|
|
12
|
+
name: "WebsiteBuilder/Pages/WorkflowStateList",
|
|
13
|
+
path: "/website-builder/pages/content-reviews"
|
|
14
|
+
})
|
|
15
|
+
}
|
|
18
16
|
};
|
|
17
|
+
export { Routes };
|
|
19
18
|
|
|
20
19
|
//# sourceMappingURL=routes.js.map
|
package/routes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"routes.js","sources":["../src/routes.ts"],"sourcesContent":["import { Route } from \"@webiny/app-admin\";\n\nexport const Routes = {\n Pages: {\n Workflows: new Route({\n name: \"WebsiteBuilder/PageWorkflow\",\n path: \"/website-builder/workflows\",\n params: zod => {\n return {\n app: zod.string().optional()\n };\n }\n }),\n WorkflowStateList: new Route({\n name: \"WebsiteBuilder/Pages/WorkflowStateList\",\n path: \"/website-builder/pages/content-reviews\"\n })\n }\n};\n"],"names":["Routes","Route","zod"],"mappings":";AAEO,MAAMA,SAAS;IAClB,OAAO;QACH,WAAW,IAAIC,MAAM;YACjB,MAAM;YACN,MAAM;YACN,QAAQC,CAAAA,MACG;oBACH,KAAKA,IAAI,MAAM,GAAG,QAAQ;gBAC9B;QAER;QACA,mBAAmB,IAAID,MAAM;YACzB,MAAM;YACN,MAAM;QACV;IACJ;AACJ"}
|
package/types.d.ts
CHANGED
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
import type { WorkflowStateValue } from "@webiny/app-workflows/types.js";
|
|
2
|
-
export interface
|
|
3
|
-
id: string;
|
|
4
|
-
displayName: string;
|
|
5
|
-
type: string;
|
|
6
|
-
}
|
|
7
|
-
export interface IRecordWorkflowState {
|
|
2
|
+
export interface IPageWorkflowState {
|
|
8
3
|
workflowId: string;
|
|
9
4
|
stepId: string;
|
|
5
|
+
stepName: string;
|
|
10
6
|
state: WorkflowStateValue;
|
|
11
|
-
savedBy?: IRecordWorkflowStateIdentity | null;
|
|
12
|
-
}
|
|
13
|
-
export interface IRecordWorkflow {
|
|
14
|
-
state?: IRecordWorkflowState | null;
|
|
15
7
|
}
|
|
16
8
|
export type WithWorkflows<T> = T & {
|
|
17
|
-
|
|
18
|
-
$selectable: boolean;
|
|
9
|
+
workflow: IPageWorkflowState | null;
|
|
19
10
|
};
|
|
11
|
+
declare module "@webiny/app-website-builder/types.js" {
|
|
12
|
+
interface WbPageSystem {
|
|
13
|
+
workflow: IPageWorkflowState | null;
|
|
14
|
+
}
|
|
15
|
+
}
|
package/types.js
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["ListOpenInNewWindow"],"sources":["index.ts"],"sourcesContent":["export { ListOpenInNewWindow } from \"./OpenInNewWindow.js\";\n"],"mappings":"AAAA,SAASA,mBAAmB","ignoreList":[]}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { PageEditorConfig } from "@webiny/app-website-builder";
|
|
3
|
-
import { useWorkflowState } from "@webiny/app-workflows";
|
|
4
|
-
import { observer } from "mobx-react-lite";
|
|
5
|
-
const {
|
|
6
|
-
Ui
|
|
7
|
-
} = PageEditorConfig;
|
|
8
|
-
const WrappedSettings = observer(props => {
|
|
9
|
-
const {
|
|
10
|
-
presenter
|
|
11
|
-
} = useWorkflowState();
|
|
12
|
-
if (!presenter.vm.state?.state) {
|
|
13
|
-
return props.element;
|
|
14
|
-
}
|
|
15
|
-
return null;
|
|
16
|
-
});
|
|
17
|
-
export const PageEditorSettings = Ui.TopBar.Action.createDecorator(Original => {
|
|
18
|
-
return function PageEditorSettingsDecorated(props) {
|
|
19
|
-
if (props.name === "buttonSettings") {
|
|
20
|
-
return /*#__PURE__*/React.createElement(Original, Object.assign({}, props, {
|
|
21
|
-
element: /*#__PURE__*/React.createElement(WrappedSettings, {
|
|
22
|
-
element: props.element
|
|
23
|
-
})
|
|
24
|
-
}));
|
|
25
|
-
}
|
|
26
|
-
return /*#__PURE__*/React.createElement(Original, props);
|
|
27
|
-
};
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
//# sourceMappingURL=PageEditorSettings.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","PageEditorConfig","useWorkflowState","observer","Ui","WrappedSettings","props","presenter","vm","state","element","PageEditorSettings","TopBar","Action","createDecorator","Original","PageEditorSettingsDecorated","name","createElement","Object","assign"],"sources":["PageEditorSettings.tsx"],"sourcesContent":["import React from \"react\";\nimport { PageEditorConfig } from \"@webiny/app-website-builder\";\nimport { useWorkflowState } from \"@webiny/app-workflows\";\nimport { observer } from \"mobx-react-lite\";\n\nconst { Ui } = PageEditorConfig;\n\ninterface IWrappedSettings {\n element?: React.ReactElement | null;\n}\n\nconst WrappedSettings = observer((props: IWrappedSettings) => {\n const { presenter } = useWorkflowState();\n if (!presenter.vm.state?.state) {\n return props.element;\n }\n\n return null;\n});\n\nexport const PageEditorSettings = Ui.TopBar.Action.createDecorator(Original => {\n return function PageEditorSettingsDecorated(props) {\n if (props.name === \"buttonSettings\") {\n return <Original {...props} element={<WrappedSettings element={props.element} />} />;\n }\n return <Original {...props} />;\n };\n});\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,gBAAgB,QAAQ,6BAA6B;AAC9D,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,SAASC,QAAQ,QAAQ,iBAAiB;AAE1C,MAAM;EAAEC;AAAG,CAAC,GAAGH,gBAAgB;AAM/B,MAAMI,eAAe,GAAGF,QAAQ,CAAEG,KAAuB,IAAK;EAC1D,MAAM;IAAEC;EAAU,CAAC,GAAGL,gBAAgB,CAAC,CAAC;EACxC,IAAI,CAACK,SAAS,CAACC,EAAE,CAACC,KAAK,EAAEA,KAAK,EAAE;IAC5B,OAAOH,KAAK,CAACI,OAAO;EACxB;EAEA,OAAO,IAAI;AACf,CAAC,CAAC;AAEF,OAAO,MAAMC,kBAAkB,GAAGP,EAAE,CAACQ,MAAM,CAACC,MAAM,CAACC,eAAe,CAACC,QAAQ,IAAI;EAC3E,OAAO,SAASC,2BAA2BA,CAACV,KAAK,EAAE;IAC/C,IAAIA,KAAK,CAACW,IAAI,KAAK,gBAAgB,EAAE;MACjC,oBAAOjB,KAAA,CAAAkB,aAAA,CAACH,QAAQ,EAAAI,MAAA,CAAAC,MAAA,KAAKd,KAAK;QAAEI,OAAO,eAAEV,KAAA,CAAAkB,aAAA,CAACb,eAAe;UAACK,OAAO,EAAEJ,KAAK,CAACI;QAAQ,CAAE;MAAE,EAAE,CAAC;IACxF;IACA,oBAAOV,KAAA,CAAAkB,aAAA,CAACH,QAAQ,EAAKT,KAAQ,CAAC;EAClC,CAAC;AACL,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { EditorConfig } from "@webiny/app-website-builder/BaseEditor/index.js";
|
|
3
|
-
import { useSelectFromDocument } from "@webiny/app-website-builder/BaseEditor/hooks/useSelectFromDocument.js";
|
|
4
|
-
export const PageEditorSidebar = EditorConfig.Ui.Sidebar.createDecorator(Original => {
|
|
5
|
-
return function PageEditorSidebarDecorated() {
|
|
6
|
-
const stepId = useSelectFromDocument(document => {
|
|
7
|
-
// @ts-expect-error
|
|
8
|
-
return document.workflows?.state?.stepId;
|
|
9
|
-
});
|
|
10
|
-
if (stepId) {
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
return /*#__PURE__*/React.createElement(Original, null);
|
|
14
|
-
};
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
//# sourceMappingURL=PageEditorSidebar.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","EditorConfig","useSelectFromDocument","PageEditorSidebar","Ui","Sidebar","createDecorator","Original","PageEditorSidebarDecorated","stepId","document","workflows","state","createElement"],"sources":["PageEditorSidebar.tsx"],"sourcesContent":["import React from \"react\";\nimport { EditorConfig } from \"@webiny/app-website-builder/BaseEditor/index.js\";\nimport { useSelectFromDocument } from \"@webiny/app-website-builder/BaseEditor/hooks/useSelectFromDocument.js\";\n\nexport const PageEditorSidebar = EditorConfig.Ui.Sidebar.createDecorator(Original => {\n return function PageEditorSidebarDecorated() {\n const stepId = useSelectFromDocument((document): string | undefined => {\n // @ts-expect-error\n return document.workflows?.state?.stepId;\n });\n if (stepId) {\n return null;\n }\n return <Original />;\n };\n});\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,YAAY,QAAQ,iDAAiD;AAC9E,SAASC,qBAAqB,QAAQ,uEAAuE;AAE7G,OAAO,MAAMC,iBAAiB,GAAGF,YAAY,CAACG,EAAE,CAACC,OAAO,CAACC,eAAe,CAACC,QAAQ,IAAI;EACjF,OAAO,SAASC,0BAA0BA,CAAA,EAAG;IACzC,MAAMC,MAAM,GAAGP,qBAAqB,CAAEQ,QAAQ,IAAyB;MACnE;MACA,OAAOA,QAAQ,CAACC,SAAS,EAAEC,KAAK,EAAEH,MAAM;IAC5C,CAAC,CAAC;IACF,IAAIA,MAAM,EAAE;MACR,OAAO,IAAI;IACf;IACA,oBAAOT,KAAA,CAAAa,aAAA,CAACN,QAAQ,MAAE,CAAC;EACvB,CAAC;AACL,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { EditorConfig } from "@webiny/app-website-builder/BaseEditor/index.js";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { useSelectFromDocument } from "@webiny/app-website-builder/BaseEditor/hooks/useSelectFromDocument.js";
|
|
4
|
-
export const PageEditorToolbar = EditorConfig.Ui.Toolbar.createDecorator(Original => {
|
|
5
|
-
return function PageEditorToolbarDecorated() {
|
|
6
|
-
const stepId = useSelectFromDocument(document => {
|
|
7
|
-
// @ts-expect-error
|
|
8
|
-
return document.workflows?.state?.stepId;
|
|
9
|
-
});
|
|
10
|
-
if (stepId) {
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
return /*#__PURE__*/React.createElement(Original, null);
|
|
14
|
-
};
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
//# sourceMappingURL=PageEditorToolbar.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["EditorConfig","React","useSelectFromDocument","PageEditorToolbar","Ui","Toolbar","createDecorator","Original","PageEditorToolbarDecorated","stepId","document","workflows","state","createElement"],"sources":["PageEditorToolbar.tsx"],"sourcesContent":["import { EditorConfig } from \"@webiny/app-website-builder/BaseEditor/index.js\";\nimport React from \"react\";\nimport { useSelectFromDocument } from \"@webiny/app-website-builder/BaseEditor/hooks/useSelectFromDocument.js\";\n\nexport const PageEditorToolbar = EditorConfig.Ui.Toolbar.createDecorator(Original => {\n return function PageEditorToolbarDecorated() {\n const stepId = useSelectFromDocument((document): string | undefined => {\n // @ts-expect-error\n return document.workflows?.state?.stepId;\n });\n if (stepId) {\n return null;\n }\n return <Original />;\n };\n});\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,iDAAiD;AAC9E,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,qBAAqB,QAAQ,uEAAuE;AAE7G,OAAO,MAAMC,iBAAiB,GAAGH,YAAY,CAACI,EAAE,CAACC,OAAO,CAACC,eAAe,CAACC,QAAQ,IAAI;EACjF,OAAO,SAASC,0BAA0BA,CAAA,EAAG;IACzC,MAAMC,MAAM,GAAGP,qBAAqB,CAAEQ,QAAQ,IAAyB;MACnE;MACA,OAAOA,QAAQ,CAACC,SAAS,EAAEC,KAAK,EAAEH,MAAM;IAC5C,CAAC,CAAC;IACF,IAAIA,MAAM,EAAE;MACR,OAAO,IAAI;IACf;IACA,oBAAOR,KAAA,CAAAY,aAAA,CAACN,QAAQ,MAAE,CAAC;EACvB,CAAC;AACL,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./PageWorkflowsEditorView.js\";\n"],"mappings":"AAAA","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["PagesList"],"sources":["index.ts"],"sourcesContent":["export { PagesList } from \"./PagesList.js\";\n"],"mappings":"AAAA,SAASA,SAAS","ignoreList":[]}
|
package/Components/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./OptionItem/index.js\";\nexport * from \"./PageEditor/PageEditorConfig.js\";\nexport * from \"./PagesList/index.js\";\nexport * from \"./PageWorkflows/index.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA","ignoreList":[]}
|
package/Routes/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["WebsiteBuilderWorkflowsMenu"],"sources":["index.ts"],"sourcesContent":["export { WebsiteBuilderWorkflowsMenu } from \"./WebsiteBuilderWorkflowsMenu.js\";\n"],"mappings":"AAAA,SAASA,2BAA2B","ignoreList":[]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { IDocumentListPresenterInit, IDocumentListVm, PageListPresenter } from "@webiny/app-website-builder/presentation/pages/PageList/index.js";
|
|
2
|
-
declare class PageListPresenterWithWorkflows implements PageListPresenter.Interface {
|
|
3
|
-
private readonly decoratee;
|
|
4
|
-
constructor(decoratee: PageListPresenter.Interface);
|
|
5
|
-
get vm(): IDocumentListVm;
|
|
6
|
-
init(params: IDocumentListPresenterInit): void;
|
|
7
|
-
showFilters(show: boolean): void;
|
|
8
|
-
private decoratePage;
|
|
9
|
-
}
|
|
10
|
-
export declare const PageListPresenterDecorator: typeof PageListPresenterWithWorkflows & {
|
|
11
|
-
__abstraction: import("@webiny/di").Abstraction<import("@webiny/app-website-builder/presentation/pages/PageList/abstractions").IDocumentListPresenter>;
|
|
12
|
-
};
|
|
13
|
-
export {};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { makeAutoObservable } from "mobx";
|
|
2
|
-
import { PageListPresenter } from "@webiny/app-website-builder/presentation/pages/PageList/index.js";
|
|
3
|
-
class PageListPresenterWithWorkflows {
|
|
4
|
-
constructor(decoratee) {
|
|
5
|
-
this.decoratee = decoratee;
|
|
6
|
-
makeAutoObservable(this);
|
|
7
|
-
}
|
|
8
|
-
get vm() {
|
|
9
|
-
const vm = this.decoratee.vm;
|
|
10
|
-
return {
|
|
11
|
-
...vm,
|
|
12
|
-
data: vm.data.map(page => {
|
|
13
|
-
return this.decoratePage(page);
|
|
14
|
-
})
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
init(params) {
|
|
18
|
-
this.decoratee.init(params);
|
|
19
|
-
}
|
|
20
|
-
showFilters(show) {
|
|
21
|
-
this.decoratee.showFilters(show);
|
|
22
|
-
}
|
|
23
|
-
decoratePage(page) {
|
|
24
|
-
return {
|
|
25
|
-
...page,
|
|
26
|
-
workflows: {
|
|
27
|
-
// @ts-expect-error
|
|
28
|
-
...page.workflows,
|
|
29
|
-
// @ts-expect-error
|
|
30
|
-
state: page.workflows?.state || null
|
|
31
|
-
},
|
|
32
|
-
// @ts-expect-error
|
|
33
|
-
$selectable: !page.workflows?.state
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
export const PageListPresenterDecorator = PageListPresenter.createDecorator({
|
|
38
|
-
decorator: PageListPresenterWithWorkflows,
|
|
39
|
-
dependencies: []
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
//# sourceMappingURL=PageListPresenterDecorator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["makeAutoObservable","PageListPresenter","PageListPresenterWithWorkflows","constructor","decoratee","vm","data","map","page","decoratePage","init","params","showFilters","show","workflows","state","$selectable","PageListPresenterDecorator","createDecorator","decorator","dependencies"],"sources":["PageListPresenterDecorator.ts"],"sourcesContent":["import { makeAutoObservable } from \"mobx\";\nimport {\n IDocumentListPresenterInit,\n IDocumentListVm,\n PageListPresenter\n} from \"@webiny/app-website-builder/presentation/pages/PageList/index.js\";\nimport type { WithWorkflows } from \"~/types.js\";\nimport type { PageDto } from \"@webiny/app-website-builder/domain/Page/index.js\";\n\nclass PageListPresenterWithWorkflows implements PageListPresenter.Interface {\n private readonly decoratee;\n\n public constructor(decoratee: PageListPresenter.Interface) {\n this.decoratee = decoratee;\n makeAutoObservable(this);\n }\n\n public get vm(): IDocumentListVm {\n const vm = this.decoratee.vm;\n return {\n ...vm,\n data: vm.data.map(page => {\n return this.decoratePage(page);\n })\n };\n }\n\n public init(params: IDocumentListPresenterInit): void {\n this.decoratee.init(params);\n }\n\n public showFilters(show: boolean): void {\n this.decoratee.showFilters(show);\n }\n\n private decoratePage(page: PageDto): WithWorkflows<PageDto> {\n return {\n ...page,\n workflows: {\n // @ts-expect-error\n ...page.workflows,\n // @ts-expect-error\n state: page.workflows?.state || null\n },\n // @ts-expect-error\n $selectable: !page.workflows?.state\n };\n }\n}\n\nexport const PageListPresenterDecorator = PageListPresenter.createDecorator({\n decorator: PageListPresenterWithWorkflows,\n dependencies: []\n});\n"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,MAAM;AACzC,SAGIC,iBAAiB,QACd,kEAAkE;AAIzE,MAAMC,8BAA8B,CAAwC;EAGjEC,WAAWA,CAACC,SAAsC,EAAE;IACvD,IAAI,CAACA,SAAS,GAAGA,SAAS;IAC1BJ,kBAAkB,CAAC,IAAI,CAAC;EAC5B;EAEA,IAAWK,EAAEA,CAAA,EAAoB;IAC7B,MAAMA,EAAE,GAAG,IAAI,CAACD,SAAS,CAACC,EAAE;IAC5B,OAAO;MACH,GAAGA,EAAE;MACLC,IAAI,EAAED,EAAE,CAACC,IAAI,CAACC,GAAG,CAACC,IAAI,IAAI;QACtB,OAAO,IAAI,CAACC,YAAY,CAACD,IAAI,CAAC;MAClC,CAAC;IACL,CAAC;EACL;EAEOE,IAAIA,CAACC,MAAkC,EAAQ;IAClD,IAAI,CAACP,SAAS,CAACM,IAAI,CAACC,MAAM,CAAC;EAC/B;EAEOC,WAAWA,CAACC,IAAa,EAAQ;IACpC,IAAI,CAACT,SAAS,CAACQ,WAAW,CAACC,IAAI,CAAC;EACpC;EAEQJ,YAAYA,CAACD,IAAa,EAA0B;IACxD,OAAO;MACH,GAAGA,IAAI;MACPM,SAAS,EAAE;QACP;QACA,GAAGN,IAAI,CAACM,SAAS;QACjB;QACAC,KAAK,EAAEP,IAAI,CAACM,SAAS,EAAEC,KAAK,IAAI;MACpC,CAAC;MACD;MACAC,WAAW,EAAE,CAACR,IAAI,CAACM,SAAS,EAAEC;IAClC,CAAC;EACL;AACJ;AAEA,OAAO,MAAME,0BAA0B,GAAGhB,iBAAiB,CAACiB,eAAe,CAAC;EACxEC,SAAS,EAAEjB,8BAA8B;EACzCkB,YAAY,EAAE;AAClB,CAAC,CAAC","ignoreList":[]}
|
package/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { WorkflowStateValue } from \"@webiny/app-workflows/types.js\";\n\nexport interface IRecordWorkflowStateIdentity {\n id: string;\n displayName: string;\n type: string;\n}\n\nexport interface IRecordWorkflowState {\n workflowId: string;\n stepId: string;\n state: WorkflowStateValue;\n savedBy?: IRecordWorkflowStateIdentity | null;\n}\n\nexport interface IRecordWorkflow {\n state?: IRecordWorkflowState | null;\n}\n\nexport type WithWorkflows<T> = T & {\n workflows: IRecordWorkflow | null;\n $selectable: boolean;\n};\n"],"mappings":"","ignoreList":[]}
|