@webiny/app-website-builder-scheduler 6.1.0 → 6.2.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.
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export declare const PageEditorScheduleConfig: () => React.JSX.Element;
@@ -0,0 +1,18 @@
1
+ import React from "react";
2
+ import { PageEditorConfig } from "@webiny/app-website-builder/exports/admin/website-builder/page/editor.js";
3
+ import { HasPermission } from "@webiny/app-website-builder/exports/admin/website-builder.js";
4
+ import { PageEditorScheduleMenuItem } from "./PageEditorScheduleMenuItem.js";
5
+ const {
6
+ DropdownAction
7
+ } = PageEditorConfig.Ui.TopBar;
8
+ export const PageEditorScheduleConfig = () => {
9
+ return /*#__PURE__*/React.createElement(HasPermission, {
10
+ entity: "page",
11
+ someActions: ["publish", "unpublish"]
12
+ }, /*#__PURE__*/React.createElement(PageEditorConfig, null, /*#__PURE__*/React.createElement(DropdownAction, {
13
+ name: "scheduler",
14
+ element: /*#__PURE__*/React.createElement(PageEditorScheduleMenuItem, null)
15
+ })));
16
+ };
17
+
18
+ //# sourceMappingURL=PageEditorScheduleConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","PageEditorConfig","HasPermission","PageEditorScheduleMenuItem","DropdownAction","Ui","TopBar","PageEditorScheduleConfig","createElement","entity","someActions","name","element"],"sources":["PageEditorScheduleConfig.tsx"],"sourcesContent":["import React from \"react\";\nimport { PageEditorConfig } from \"@webiny/app-website-builder/exports/admin/website-builder/page/editor.js\";\nimport { HasPermission } from \"@webiny/app-website-builder/exports/admin/website-builder.js\";\nimport { PageEditorScheduleMenuItem } from \"./PageEditorScheduleMenuItem.js\";\n\nconst { DropdownAction } = PageEditorConfig.Ui.TopBar;\n\nexport const PageEditorScheduleConfig = () => {\n return (\n <HasPermission entity={\"page\"} someActions={[\"publish\", \"unpublish\"]}>\n <PageEditorConfig>\n <DropdownAction name={\"scheduler\"} element={<PageEditorScheduleMenuItem />} />\n </PageEditorConfig>\n </HasPermission>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,gBAAgB,QAAQ,0EAA0E;AAC3G,SAASC,aAAa,QAAQ,8DAA8D;AAC5F,SAASC,0BAA0B;AAEnC,MAAM;EAAEC;AAAe,CAAC,GAAGH,gBAAgB,CAACI,EAAE,CAACC,MAAM;AAErD,OAAO,MAAMC,wBAAwB,GAAGA,CAAA,KAAM;EAC1C,oBACIP,KAAA,CAAAQ,aAAA,CAACN,aAAa;IAACO,MAAM,EAAE,MAAO;IAACC,WAAW,EAAE,CAAC,SAAS,EAAE,WAAW;EAAE,gBACjEV,KAAA,CAAAQ,aAAA,CAACP,gBAAgB,qBACbD,KAAA,CAAAQ,aAAA,CAACJ,cAAc;IAACO,IAAI,EAAE,WAAY;IAACC,OAAO,eAAEZ,KAAA,CAAAQ,aAAA,CAACL,0BAA0B,MAAE;EAAE,CAAE,CAC/D,CACP,CAAC;AAExB,CAAC","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export declare const PageEditorScheduleMenuItem: () => React.JSX.Element;
@@ -0,0 +1,43 @@
1
+ import React, { useCallback } from "react";
2
+ import { ReactComponent as ScheduleIcon } from "@webiny/icons/cell_tower.svg";
3
+ import { PageEditorConfig, useDocumentEditor } from "@webiny/app-website-builder/exports/admin/website-builder/page/editor.js";
4
+ import { Icon } from "@webiny/admin-ui";
5
+ import { useApolloClient } from "@apollo/react-hooks";
6
+ import { useScheduleDialog } from "@webiny/app-scheduler";
7
+ import { WB_PAGE_NAMESPACE } from "../../utils/namespace.js";
8
+ const {
9
+ DropdownAction
10
+ } = PageEditorConfig.Ui.TopBar;
11
+ export const PageEditorScheduleMenuItem = () => {
12
+ const documentEditor = useDocumentEditor();
13
+ const state = documentEditor.getDocumentState().toJson();
14
+ // @ts-expect-error status is not defined in the document interface, but we know it is there
15
+ const status = state.status || "draft";
16
+ const client = useApolloClient();
17
+ const {
18
+ showDialog: showSchedulerDialog
19
+ } = useScheduleDialog({
20
+ client,
21
+ namespace: WB_PAGE_NAMESPACE,
22
+ target: {
23
+ id: state.id,
24
+ title: state.properties.title || "unknown",
25
+ status
26
+ }
27
+ });
28
+ const showDialog = useCallback(() => {
29
+ showSchedulerDialog();
30
+ }, [showSchedulerDialog]);
31
+ return /*#__PURE__*/React.createElement(DropdownAction.MenuItem, {
32
+ label: "Schedule",
33
+ icon: /*#__PURE__*/React.createElement(Icon, {
34
+ label: "Schedule",
35
+ icon: /*#__PURE__*/React.createElement(ScheduleIcon, null)
36
+ }),
37
+ onAction: showDialog,
38
+ disabled: !status,
39
+ "data-testid": "wb.editor.header.schedule"
40
+ });
41
+ };
42
+
43
+ //# sourceMappingURL=PageEditorScheduleMenuItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useCallback","ReactComponent","ScheduleIcon","PageEditorConfig","useDocumentEditor","Icon","useApolloClient","useScheduleDialog","WB_PAGE_NAMESPACE","DropdownAction","Ui","TopBar","PageEditorScheduleMenuItem","documentEditor","state","getDocumentState","toJson","status","client","showDialog","showSchedulerDialog","namespace","target","id","title","properties","createElement","MenuItem","label","icon","onAction","disabled"],"sources":["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 { useApolloClient } from \"@apollo/react-hooks\";\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 client = useApolloClient();\n const { showDialog: showSchedulerDialog } = useScheduleDialog({\n client,\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"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,QAAQ,OAAO;AAC1C,SAASC,cAAc,IAAIC,YAAY,QAAQ,8BAA8B;AAC7E,SACIC,gBAAgB,EAChBC,iBAAiB,QACd,0EAA0E;AACjF,SAASC,IAAI,QAAQ,kBAAkB;AACvC,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,iBAAiB,QAAQ,uBAAuB;AACzD,SAASC,iBAAiB;AAE1B,MAAM;EAAEC;AAAe,CAAC,GAAGN,gBAAgB,CAACO,EAAE,CAACC,MAAM;AAErD,OAAO,MAAMC,0BAA0B,GAAGA,CAAA,KAAM;EAC5C,MAAMC,cAAc,GAAGT,iBAAiB,CAAC,CAAC;EAC1C,MAAMU,KAAK,GAAGD,cAAc,CAACE,gBAAgB,CAAC,CAAC,CAACC,MAAM,CAAC,CAAC;EACxD;EACA,MAAMC,MAAM,GAAIH,KAAK,CAACG,MAAM,IAAI,OAAkB;EAElD,MAAMC,MAAM,GAAGZ,eAAe,CAAC,CAAC;EAChC,MAAM;IAAEa,UAAU,EAAEC;EAAoB,CAAC,GAAGb,iBAAiB,CAAC;IAC1DW,MAAM;IACNG,SAAS,EAAEb,iBAAiB;IAC5Bc,MAAM,EAAE;MACJC,EAAE,EAAET,KAAK,CAACS,EAAE;MACZC,KAAK,EAAEV,KAAK,CAACW,UAAU,CAACD,KAAK,IAAI,SAAS;MAC1CP;IACJ;EACJ,CAAC,CAAC;EAEF,MAAME,UAAU,GAAGnB,WAAW,CAAC,MAAM;IACjCoB,mBAAmB,CAAC,CAAC;EACzB,CAAC,EAAE,CAACA,mBAAmB,CAAC,CAAC;EAEzB,oBACIrB,KAAA,CAAA2B,aAAA,CAACjB,cAAc,CAACkB,QAAQ;IACpBC,KAAK,EAAE,UAAW;IAClBC,IAAI,eAAE9B,KAAA,CAAA2B,aAAA,CAACrB,IAAI;MAACuB,KAAK,EAAE,UAAW;MAACC,IAAI,eAAE9B,KAAA,CAAA2B,aAAA,CAACxB,YAAY,MAAE;IAAE,CAAE,CAAE;IAC1D4B,QAAQ,EAAEX,UAAW;IACrBY,QAAQ,EAAE,CAACd,MAAO;IAClB,eAAa;EAA4B,CAC5C,CAAC;AAEV,CAAC","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ export { PageEditorScheduleConfig } from "./editor/PageEditorScheduleConfig.js";
1
2
  export { PagesConfig } from "./pages/Config.js";
2
3
  export { PagesSidebarConfig } from "./pages/Sidebar.js";
3
4
  export { RedirectsConfig } from "./redirects/Config.js";
@@ -1,3 +1,4 @@
1
+ export { PageEditorScheduleConfig } from "./editor/PageEditorScheduleConfig.js";
1
2
  export { PagesConfig } from "./pages/Config.js";
2
3
  export { PagesSidebarConfig } from "./pages/Sidebar.js";
3
4
  export { RedirectsConfig } from "./redirects/Config.js";
@@ -1 +1 @@
1
- {"version":3,"names":["PagesConfig","PagesSidebarConfig","RedirectsConfig"],"sources":["index.ts"],"sourcesContent":["export { PagesConfig } from \"./pages/Config.js\";\nexport { PagesSidebarConfig } from \"./pages/Sidebar.js\";\nexport { RedirectsConfig } from \"./redirects/Config.js\";\n"],"mappings":"AAAA,SAASA,WAAW;AACpB,SAASC,kBAAkB;AAC3B,SAASC,eAAe","ignoreList":[]}
1
+ {"version":3,"names":["PageEditorScheduleConfig","PagesConfig","PagesSidebarConfig","RedirectsConfig"],"sources":["index.ts"],"sourcesContent":["export { PageEditorScheduleConfig } from \"./editor/PageEditorScheduleConfig.js\";\nexport { PagesConfig } from \"./pages/Config.js\";\nexport { PagesSidebarConfig } from \"./pages/Sidebar.js\";\nexport { RedirectsConfig } from \"./redirects/Config.js\";\n"],"mappings":"AAAA,SAASA,wBAAwB;AACjC,SAASC,WAAW;AACpB,SAASC,kBAAkB;AAC3B,SAASC,eAAe","ignoreList":[]}
package/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
- import { PagesConfig, PagesSidebarConfig, RedirectsConfig } from "./components/index.js";
2
+ import { PageEditorScheduleConfig, PagesConfig, PagesSidebarConfig, RedirectsConfig } from "./components/index.js";
3
3
  export const WbScheduler = () => {
4
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(PagesConfig, null), /*#__PURE__*/React.createElement(PagesSidebarConfig, null), /*#__PURE__*/React.createElement(RedirectsConfig, null));
4
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(PageEditorScheduleConfig, null), /*#__PURE__*/React.createElement(PagesConfig, null), /*#__PURE__*/React.createElement(PagesSidebarConfig, null), /*#__PURE__*/React.createElement(RedirectsConfig, null));
5
5
  };
6
6
 
7
7
  //# sourceMappingURL=index.js.map
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["React","PagesConfig","PagesSidebarConfig","RedirectsConfig","WbScheduler","createElement","Fragment"],"sources":["index.tsx"],"sourcesContent":["import React from \"react\";\nimport { PagesConfig, PagesSidebarConfig, RedirectsConfig } from \"./components/index.js\";\n\nexport const WbScheduler = () => {\n return (\n <>\n <PagesConfig />\n <PagesSidebarConfig />\n <RedirectsConfig />\n </>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,WAAW,EAAEC,kBAAkB,EAAEC,eAAe;AAEzD,OAAO,MAAMC,WAAW,GAAGA,CAAA,KAAM;EAC7B,oBACIJ,KAAA,CAAAK,aAAA,CAAAL,KAAA,CAAAM,QAAA,qBACIN,KAAA,CAAAK,aAAA,CAACJ,WAAW,MAAE,CAAC,eACfD,KAAA,CAAAK,aAAA,CAACH,kBAAkB,MAAE,CAAC,eACtBF,KAAA,CAAAK,aAAA,CAACF,eAAe,MAAE,CACpB,CAAC;AAEX,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","PageEditorScheduleConfig","PagesConfig","PagesSidebarConfig","RedirectsConfig","WbScheduler","createElement","Fragment"],"sources":["index.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n PageEditorScheduleConfig,\n PagesConfig,\n PagesSidebarConfig,\n RedirectsConfig\n} from \"./components/index.js\";\n\nexport const WbScheduler = () => {\n return (\n <>\n <PageEditorScheduleConfig />\n <PagesConfig />\n <PagesSidebarConfig />\n <RedirectsConfig />\n </>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SACIC,wBAAwB,EACxBC,WAAW,EACXC,kBAAkB,EAClBC,eAAe;AAGnB,OAAO,MAAMC,WAAW,GAAGA,CAAA,KAAM;EAC7B,oBACIL,KAAA,CAAAM,aAAA,CAAAN,KAAA,CAAAO,QAAA,qBACIP,KAAA,CAAAM,aAAA,CAACL,wBAAwB,MAAE,CAAC,eAC5BD,KAAA,CAAAM,aAAA,CAACJ,WAAW,MAAE,CAAC,eACfF,KAAA,CAAAM,aAAA,CAACH,kBAAkB,MAAE,CAAC,eACtBH,KAAA,CAAAM,aAAA,CAACF,eAAe,MAAE,CACpB,CAAC;AAEX,CAAC","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/app-website-builder-scheduler",
3
- "version": "6.1.0",
3
+ "version": "6.2.0",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -11,17 +11,17 @@
11
11
  "license": "MIT",
12
12
  "dependencies": {
13
13
  "@apollo/react-hooks": "3.1.5",
14
- "@webiny/admin-ui": "6.1.0",
15
- "@webiny/app-scheduler": "6.1.0",
16
- "@webiny/app-website-builder": "6.1.0",
17
- "@webiny/icons": "6.1.0",
18
- "react": "18.2.0",
19
- "react-dom": "18.2.0"
14
+ "@webiny/admin-ui": "6.2.0",
15
+ "@webiny/app-scheduler": "6.2.0",
16
+ "@webiny/app-website-builder": "6.2.0",
17
+ "@webiny/icons": "6.2.0",
18
+ "react": "18.3.1",
19
+ "react-dom": "18.3.1"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@emotion/babel-plugin": "11.13.5",
23
- "@types/react": "18.2.79",
24
- "@webiny/build-tools": "6.1.0",
23
+ "@types/react": "18.3.28",
24
+ "@webiny/build-tools": "6.2.0",
25
25
  "rimraf": "6.1.3",
26
26
  "typescript": "5.9.3"
27
27
  },
@@ -34,5 +34,5 @@
34
34
  "removeViewBox": false
35
35
  }
36
36
  },
37
- "gitHead": "65e0ac1889b3392c99b8cac6cde508e1e831c715"
37
+ "gitHead": "3d3148358b6febbc857371930871743bec3b3939"
38
38
  }