@webiny/app-website-builder-scheduler 6.4.5-beta.0 → 6.6.0-alpha.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/components/editor/PageEditorScheduleMenuItem.js +0 -3
- package/components/editor/PageEditorScheduleMenuItem.js.map +1 -1
- package/components/pages/MenuItem.js +0 -3
- package/components/pages/MenuItem.js.map +1 -1
- package/components/pages/Sidebar.js +0 -3
- package/components/pages/Sidebar.js.map +1 -1
- package/components/redirects/MenuItem.js +0 -3
- package/components/redirects/MenuItem.js.map +1 -1
- package/package.json +7 -8
|
@@ -2,7 +2,6 @@ import react, { useCallback } from "react";
|
|
|
2
2
|
import { ReactComponent } from "@webiny/icons/cell_tower.svg";
|
|
3
3
|
import { PageEditorConfig, useDocumentEditor } from "@webiny/app-website-builder/exports/admin/website-builder/page/editor.js";
|
|
4
4
|
import { Icon } from "@webiny/admin-ui";
|
|
5
|
-
import { useApolloClient } from "@apollo/react-hooks";
|
|
6
5
|
import { useScheduleDialog } from "@webiny/app-scheduler";
|
|
7
6
|
import { WB_PAGE_NAMESPACE } from "../../utils/namespace.js";
|
|
8
7
|
const { DropdownAction: DropdownAction } = PageEditorConfig.Ui.TopBar;
|
|
@@ -10,9 +9,7 @@ const PageEditorScheduleMenuItem = ()=>{
|
|
|
10
9
|
const documentEditor = useDocumentEditor();
|
|
11
10
|
const state = documentEditor.getDocumentState().toJson();
|
|
12
11
|
const status = state.status || "draft";
|
|
13
|
-
const client = useApolloClient();
|
|
14
12
|
const { showDialog: showSchedulerDialog } = useScheduleDialog({
|
|
15
|
-
client,
|
|
16
13
|
namespace: WB_PAGE_NAMESPACE,
|
|
17
14
|
target: {
|
|
18
15
|
id: state.id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/editor/PageEditorScheduleMenuItem.js","sources":["../../../src/components/editor/PageEditorScheduleMenuItem.tsx"],"sourcesContent":["import React, { useCallback } from \"react\";\nimport { ReactComponent as ScheduleIcon } from \"@webiny/icons/cell_tower.svg\";\nimport {\n PageEditorConfig,\n useDocumentEditor\n} from \"@webiny/app-website-builder/exports/admin/website-builder/page/editor.js\";\nimport { Icon } from \"@webiny/admin-ui\";\nimport {
|
|
1
|
+
{"version":3,"file":"components/editor/PageEditorScheduleMenuItem.js","sources":["../../../src/components/editor/PageEditorScheduleMenuItem.tsx"],"sourcesContent":["import React, { useCallback } from \"react\";\nimport { ReactComponent as ScheduleIcon } from \"@webiny/icons/cell_tower.svg\";\nimport {\n PageEditorConfig,\n useDocumentEditor\n} from \"@webiny/app-website-builder/exports/admin/website-builder/page/editor.js\";\nimport { Icon } from \"@webiny/admin-ui\";\nimport { useScheduleDialog } from \"@webiny/app-scheduler\";\nimport { WB_PAGE_NAMESPACE } from \"~/utils/namespace.js\";\n\nconst { DropdownAction } = PageEditorConfig.Ui.TopBar;\n\nexport const PageEditorScheduleMenuItem = () => {\n const documentEditor = useDocumentEditor();\n const state = documentEditor.getDocumentState().toJson();\n // @ts-expect-error status is not defined in the document interface, but we know it is there\n const status = (state.status || \"draft\") as string;\n\n const { showDialog: showSchedulerDialog } = useScheduleDialog({\n namespace: WB_PAGE_NAMESPACE,\n target: {\n id: state.id,\n title: state.properties.title || \"unknown\",\n status\n }\n });\n\n const showDialog = useCallback(() => {\n showSchedulerDialog();\n }, [showSchedulerDialog]);\n\n return (\n <DropdownAction.MenuItem\n label={\"Schedule\"}\n icon={<Icon label={\"Schedule\"} icon={<ScheduleIcon />} />}\n onAction={showDialog}\n disabled={!status}\n data-testid={\"wb.editor.header.schedule\"}\n />\n );\n};\n"],"names":["DropdownAction","PageEditorConfig","PageEditorScheduleMenuItem","documentEditor","useDocumentEditor","state","status","showSchedulerDialog","useScheduleDialog","WB_PAGE_NAMESPACE","showDialog","useCallback","Icon","ScheduleIcon"],"mappings":";;;;;;AAUA,MAAM,EAAEA,gBAAAA,cAAc,EAAE,GAAGC,iBAAiB,EAAE,CAAC,MAAM;AAE9C,MAAMC,6BAA6B;IACtC,MAAMC,iBAAiBC;IACvB,MAAMC,QAAQF,eAAe,gBAAgB,GAAG,MAAM;IAEtD,MAAMG,SAAUD,MAAM,MAAM,IAAI;IAEhC,MAAM,EAAE,YAAYE,mBAAmB,EAAE,GAAGC,kBAAkB;QAC1D,WAAWC;QACX,QAAQ;YACJ,IAAIJ,MAAM,EAAE;YACZ,OAAOA,MAAM,UAAU,CAAC,KAAK,IAAI;YACjCC;QACJ;IACJ;IAEA,MAAMI,aAAaC,YAAY;QAC3BJ;IACJ,GAAG;QAACA;KAAoB;IAExB,OAAO,WAAP,GACI,oBAACP,eAAe,QAAQ;QACpB,OAAO;QACP,oBAAM,oBAACY,MAAIA;YAAC,OAAO;YAAY,oBAAM,oBAACC,gBAAYA;;QAClD,UAAUH;QACV,UAAU,CAACJ;QACX,eAAa;;AAGzB"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import react, { useCallback } from "react";
|
|
2
2
|
import { ReactComponent } from "@webiny/icons/cell_tower.svg";
|
|
3
|
-
import { useApolloClient } from "@apollo/react-hooks";
|
|
4
3
|
import { useScheduleDialog } from "@webiny/app-scheduler";
|
|
5
4
|
import { PageListConfig } from "@webiny/app-website-builder/exports/admin/website-builder/page/list.js";
|
|
6
5
|
import { usePermissions } from "../../hooks/usePermissions.js";
|
|
@@ -8,9 +7,7 @@ import { WB_PAGE_NAMESPACE } from "../../utils/namespace.js";
|
|
|
8
7
|
const PageMenuItem = ()=>{
|
|
9
8
|
const { page } = PageListConfig.Browser.Page.Action.usePage();
|
|
10
9
|
const { canPublishPage, canUnpublishPage } = usePermissions();
|
|
11
|
-
const client = useApolloClient();
|
|
12
10
|
const { showDialog: showSchedulerDialog } = useScheduleDialog({
|
|
13
|
-
client,
|
|
14
11
|
namespace: WB_PAGE_NAMESPACE,
|
|
15
12
|
target: {
|
|
16
13
|
id: page.id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/pages/MenuItem.js","sources":["../../../src/components/pages/MenuItem.tsx"],"sourcesContent":["import React, { useCallback } from \"react\";\nimport { ReactComponent as ScheduleIcon } from \"@webiny/icons/cell_tower.svg\";\nimport {
|
|
1
|
+
{"version":3,"file":"components/pages/MenuItem.js","sources":["../../../src/components/pages/MenuItem.tsx"],"sourcesContent":["import React, { useCallback } from \"react\";\nimport { ReactComponent as ScheduleIcon } from \"@webiny/icons/cell_tower.svg\";\nimport { useScheduleDialog } from \"@webiny/app-scheduler\";\nimport { PageListConfig } from \"@webiny/app-website-builder/exports/admin/website-builder/page/list.js\";\nimport { usePermissions } from \"~/hooks/usePermissions.js\";\nimport { WB_PAGE_NAMESPACE } from \"~/utils/namespace.js\";\n\nexport const PageMenuItem = () => {\n const { page } = PageListConfig.Browser.Page.Action.usePage();\n const { canPublishPage, canUnpublishPage } = usePermissions();\n\n const { showDialog: showSchedulerDialog } = useScheduleDialog({\n namespace: WB_PAGE_NAMESPACE,\n target: {\n id: page.id,\n title: page.properties.title,\n status: page.status\n }\n });\n\n const { OptionsMenuItem } = PageListConfig.Browser.Page.Action;\n\n const showDialog = useCallback(() => {\n showSchedulerDialog();\n }, [showSchedulerDialog]);\n\n if (!canPublishPage && !canUnpublishPage) {\n return null;\n }\n\n const action = page.status === \"published\" ? \"unpublish\" : \"publish\";\n\n return (\n <OptionsMenuItem\n icon={<ScheduleIcon />}\n label={`Schedule ${action}`}\n onAction={showDialog}\n data-testid={\"wb.page-list.page-action.schedule\"}\n />\n );\n};\n"],"names":["PageMenuItem","page","PageListConfig","canPublishPage","canUnpublishPage","usePermissions","showSchedulerDialog","useScheduleDialog","WB_PAGE_NAMESPACE","OptionsMenuItem","showDialog","useCallback","action","ScheduleIcon"],"mappings":";;;;;;AAOO,MAAMA,eAAe;IACxB,MAAM,EAAEC,IAAI,EAAE,GAAGC,eAAe,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO;IAC3D,MAAM,EAAEC,cAAc,EAAEC,gBAAgB,EAAE,GAAGC;IAE7C,MAAM,EAAE,YAAYC,mBAAmB,EAAE,GAAGC,kBAAkB;QAC1D,WAAWC;QACX,QAAQ;YACJ,IAAIP,KAAK,EAAE;YACX,OAAOA,KAAK,UAAU,CAAC,KAAK;YAC5B,QAAQA,KAAK,MAAM;QACvB;IACJ;IAEA,MAAM,EAAEQ,eAAe,EAAE,GAAGP,eAAe,OAAO,CAAC,IAAI,CAAC,MAAM;IAE9D,MAAMQ,aAAaC,YAAY;QAC3BL;IACJ,GAAG;QAACA;KAAoB;IAExB,IAAI,CAACH,kBAAkB,CAACC,kBACpB,OAAO;IAGX,MAAMQ,SAASX,AAAgB,gBAAhBA,KAAK,MAAM,GAAmB,cAAc;IAE3D,OAAO,WAAP,GACI,oBAACQ,iBAAAA;QACG,oBAAM,oBAACI,gBAAYA;QACnB,OAAO,CAAC,SAAS,EAAED,QAAQ;QAC3B,UAAUF;QACV,eAAa;;AAGzB"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import react from "react";
|
|
2
|
-
import { useApolloClient } from "@apollo/react-hooks";
|
|
3
2
|
import { Scheduler } from "@webiny/app-scheduler";
|
|
4
3
|
import { PageListConfig } from "@webiny/app-website-builder/exports/admin/website-builder/page/list.js";
|
|
5
4
|
import { usePermissions } from "../../hooks/usePermissions.js";
|
|
@@ -7,12 +6,10 @@ import { SchedulerButton } from "./SchedulerButton.js";
|
|
|
7
6
|
import { WB_PAGE_NAMESPACE } from "../../utils/namespace.js";
|
|
8
7
|
const { Browser: Browser } = PageListConfig;
|
|
9
8
|
const SchedulerFooterElement = ()=>{
|
|
10
|
-
const client = useApolloClient();
|
|
11
9
|
const { canPublishPage, canUnpublishPage } = usePermissions();
|
|
12
10
|
if (!canPublishPage && !canUnpublishPage) return null;
|
|
13
11
|
return /*#__PURE__*/ react.createElement(Scheduler, {
|
|
14
12
|
namespace: WB_PAGE_NAMESPACE,
|
|
15
|
-
client: client,
|
|
16
13
|
canPublish: canPublishPage,
|
|
17
14
|
canUnpublish: canUnpublishPage,
|
|
18
15
|
render: ({ showScheduler })=>/*#__PURE__*/ react.createElement(SchedulerButton, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/pages/Sidebar.js","sources":["../../../src/components/pages/Sidebar.tsx"],"sourcesContent":["import React from \"react\";\nimport {
|
|
1
|
+
{"version":3,"file":"components/pages/Sidebar.js","sources":["../../../src/components/pages/Sidebar.tsx"],"sourcesContent":["import React from \"react\";\nimport { Scheduler as BaseScheduler } from \"@webiny/app-scheduler\";\nimport { PageListConfig } from \"@webiny/app-website-builder/exports/admin/website-builder/page/list.js\";\nimport { usePermissions } from \"~/hooks/usePermissions.js\";\nimport { SchedulerButton } from \"./SchedulerButton.js\";\nimport { WB_PAGE_NAMESPACE } from \"~/utils/namespace.js\";\n\nconst { Browser } = PageListConfig;\n\nconst SchedulerFooterElement = () => {\n const { canPublishPage, canUnpublishPage } = usePermissions();\n\n if (!canPublishPage && !canUnpublishPage) {\n return null;\n }\n\n return (\n <BaseScheduler\n namespace={WB_PAGE_NAMESPACE}\n canPublish={canPublishPage}\n canUnpublish={canUnpublishPage}\n render={({ showScheduler }) => {\n return <SchedulerButton onClick={showScheduler} />;\n }}\n />\n );\n};\n\nexport const PagesSidebarConfig = () => {\n return (\n <PageListConfig>\n <Browser.Sidebar.Footer name={\"page-schedule\"} element={<SchedulerFooterElement />} />\n </PageListConfig>\n );\n};\n"],"names":["Browser","PageListConfig","SchedulerFooterElement","canPublishPage","canUnpublishPage","usePermissions","BaseScheduler","WB_PAGE_NAMESPACE","showScheduler","SchedulerButton","PagesSidebarConfig"],"mappings":";;;;;;AAOA,MAAM,EAAEA,SAAAA,OAAO,EAAE,GAAGC;AAEpB,MAAMC,yBAAyB;IAC3B,MAAM,EAAEC,cAAc,EAAEC,gBAAgB,EAAE,GAAGC;IAE7C,IAAI,CAACF,kBAAkB,CAACC,kBACpB,OAAO;IAGX,OAAO,WAAP,GACI,oBAACE,WAAaA;QACV,WAAWC;QACX,YAAYJ;QACZ,cAAcC;QACd,QAAQ,CAAC,EAAEI,aAAa,EAAE,GACf,WAAP,GAAO,oBAACC,iBAAeA;gBAAC,SAASD;;;AAIjD;AAEO,MAAME,qBAAqB,IACvB,WAAP,GACI,oBAACT,gBAAcA,MAAAA,WAAAA,GACX,oBAACD,QAAQ,OAAO,CAAC,MAAM;QAAC,MAAM;QAAiB,uBAAS,oBAACE,wBAAsBA"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import react, { useCallback } from "react";
|
|
2
2
|
import { ReactComponent } from "@webiny/icons/cell_tower.svg";
|
|
3
|
-
import { useApolloClient } from "@apollo/react-hooks";
|
|
4
3
|
import { useScheduleDialog } from "@webiny/app-scheduler";
|
|
5
4
|
import { RedirectListConfig } from "@webiny/app-website-builder/exports/admin/website-builder/redirect/list.js";
|
|
6
5
|
import { usePermissions } from "../../hooks/usePermissions.js";
|
|
@@ -8,9 +7,7 @@ import { WB_REDIRECT_NAMESPACE } from "../../utils/namespace.js";
|
|
|
8
7
|
const RedirectMenuItem = ()=>{
|
|
9
8
|
const { redirect } = RedirectListConfig.Browser.Redirect.Action.useRedirect();
|
|
10
9
|
const { canWriteRedirect } = usePermissions();
|
|
11
|
-
const client = useApolloClient();
|
|
12
10
|
const { showDialog: showSchedulerDialog } = useScheduleDialog({
|
|
13
|
-
client,
|
|
14
11
|
namespace: WB_REDIRECT_NAMESPACE,
|
|
15
12
|
target: {
|
|
16
13
|
id: redirect.id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/redirects/MenuItem.js","sources":["../../../src/components/redirects/MenuItem.tsx"],"sourcesContent":["import React, { useCallback } from \"react\";\nimport { ReactComponent as ScheduleIcon } from \"@webiny/icons/cell_tower.svg\";\nimport {
|
|
1
|
+
{"version":3,"file":"components/redirects/MenuItem.js","sources":["../../../src/components/redirects/MenuItem.tsx"],"sourcesContent":["import React, { useCallback } from \"react\";\nimport { ReactComponent as ScheduleIcon } from \"@webiny/icons/cell_tower.svg\";\nimport { useScheduleDialog } from \"@webiny/app-scheduler\";\nimport { RedirectListConfig } from \"@webiny/app-website-builder/exports/admin/website-builder/redirect/list.js\";\nimport { usePermissions } from \"~/hooks/usePermissions.js\";\nimport { WB_REDIRECT_NAMESPACE } from \"~/utils/namespace.js\";\n\nexport const RedirectMenuItem = () => {\n const { redirect } = RedirectListConfig.Browser.Redirect.Action.useRedirect();\n const { canWriteRedirect } = usePermissions();\n\n const { showDialog: showSchedulerDialog } = useScheduleDialog({\n namespace: WB_REDIRECT_NAMESPACE,\n target: {\n id: redirect.id,\n title: redirect.title,\n status: redirect.isEnabled ? \"published\" : \"unpublished\"\n }\n });\n\n const { OptionsMenuItem } = RedirectListConfig.Browser.Redirect.Action;\n\n const showDialog = useCallback(() => {\n showSchedulerDialog();\n }, [showSchedulerDialog]);\n\n if (!canWriteRedirect) {\n return null;\n }\n\n const action = redirect.isEnabled ? \"disable\" : \"enable\";\n\n return (\n <OptionsMenuItem\n icon={<ScheduleIcon />}\n label={`Schedule ${action}`}\n onAction={showDialog}\n data-testid={\"wb.redirect-list.redirect-action.schedule\"}\n />\n );\n};\n"],"names":["RedirectMenuItem","redirect","RedirectListConfig","canWriteRedirect","usePermissions","showSchedulerDialog","useScheduleDialog","WB_REDIRECT_NAMESPACE","OptionsMenuItem","showDialog","useCallback","action","ScheduleIcon"],"mappings":";;;;;;AAOO,MAAMA,mBAAmB;IAC5B,MAAM,EAAEC,QAAQ,EAAE,GAAGC,mBAAmB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,WAAW;IAC3E,MAAM,EAAEC,gBAAgB,EAAE,GAAGC;IAE7B,MAAM,EAAE,YAAYC,mBAAmB,EAAE,GAAGC,kBAAkB;QAC1D,WAAWC;QACX,QAAQ;YACJ,IAAIN,SAAS,EAAE;YACf,OAAOA,SAAS,KAAK;YACrB,QAAQA,SAAS,SAAS,GAAG,cAAc;QAC/C;IACJ;IAEA,MAAM,EAAEO,eAAe,EAAE,GAAGN,mBAAmB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAEtE,MAAMO,aAAaC,YAAY;QAC3BL;IACJ,GAAG;QAACA;KAAoB;IAExB,IAAI,CAACF,kBACD,OAAO;IAGX,MAAMQ,SAASV,SAAS,SAAS,GAAG,YAAY;IAEhD,OAAO,WAAP,GACI,oBAACO,iBAAAA;QACG,oBAAM,oBAACI,gBAAYA;QACnB,OAAO,CAAC,SAAS,EAAED,QAAQ;QAC3B,UAAUF;QACV,eAAa;;AAGzB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/app-website-builder-scheduler",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.6.0-alpha.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./index.js",
|
|
@@ -13,19 +13,18 @@
|
|
|
13
13
|
"author": "Webiny Ltd",
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@
|
|
17
|
-
"@webiny/
|
|
18
|
-
"@webiny/app-
|
|
19
|
-
"@webiny/
|
|
20
|
-
"@webiny/icons": "6.4.5-beta.0",
|
|
16
|
+
"@webiny/admin-ui": "6.6.0-alpha.0",
|
|
17
|
+
"@webiny/app-scheduler": "6.6.0-alpha.0",
|
|
18
|
+
"@webiny/app-website-builder": "6.6.0-alpha.0",
|
|
19
|
+
"@webiny/icons": "6.6.0-alpha.0",
|
|
21
20
|
"react": "18.3.1",
|
|
22
21
|
"react-dom": "18.3.1"
|
|
23
22
|
},
|
|
24
23
|
"devDependencies": {
|
|
25
24
|
"@types/react": "18.3.31",
|
|
26
|
-
"@webiny/build-tools": "6.
|
|
25
|
+
"@webiny/build-tools": "6.6.0-alpha.0",
|
|
27
26
|
"rimraf": "6.1.3",
|
|
28
|
-
"typescript": "
|
|
27
|
+
"typescript": "7.0.2"
|
|
29
28
|
},
|
|
30
29
|
"publishConfig": {
|
|
31
30
|
"access": "public"
|