@bigbinary/neeto-molecules 3.16.28 → 3.16.29

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.
@@ -1,31 +1,29 @@
1
1
  import React from 'react';
2
2
  import { AlertProps, ButtonProps } from '@bigbinary/neetoui';
3
3
 
4
- interface PublishPaneProps {
4
+ interface SchedulePaneProps {
5
+ isOpen: boolean;
5
6
  isSubmitting: boolean;
6
7
  onPublish: (params: {
7
- isPublishLaterChecked: boolean;
8
8
  datetimeValue: Date | null;
9
- onClose: () => void;
10
9
  }) => void;
11
- onCancel: (params: {
10
+ onClose: (params: {
12
11
  onClose: () => void;
13
12
  }) => void;
14
13
  datetime: Date | null;
15
14
  }
16
- interface PublishButtonProps extends ButtonProps {
17
- showTooltipWhenDisabled?: boolean;
18
- publishPaneProps?: PublishPaneProps;
19
- }
20
15
  interface PublishBlockProps {
21
16
  renderDraftButtons: (props: {
22
17
  ViewDraftButton: React.FC<ButtonProps>;
23
18
  ResetDraftButton: React.FC<ButtonProps>;
24
19
  }) => React.ReactNode;
25
20
  renderPublishButtons: (props: {
26
- PublishButton: React.FC<PublishButtonProps>;
21
+ PublishButton: React.FC<ButtonProps & {
22
+ showTooltipWhenDisabled?: boolean;
23
+ }>;
27
24
  PublishPreviewButton: React.FC<ButtonProps>;
28
25
  }) => React.ReactNode;
26
+ datetime: Date | null;
29
27
  }
30
28
  /**
31
29
  *
@@ -67,51 +65,6 @@ interface PublishBlockProps {
67
65
  * );
68
66
  * };
69
67
  * @endexample
70
- * To use scheduling of publication:
71
- *
72
- * @example
73
- *
74
- * import PublishBlock from "@bigbinary/neeto-molecules/PublishBlock";
75
- *
76
- * const PublishActionBlock = (
77
- * {
78
- * //all variables used in the below example can be passed as props or can be defined in the component itself
79
- * }
80
- * ) => {
81
- * const renderDraftButtons = ({ ViewDraftButton, ResetDraftButton }) =>
82
- * !isDraftBlockHidden && (
83
- * <>
84
- * <ViewDraftButton to={previewDraftUrl} />
85
- * {hasDraftVersion && <ResetDraftButton onClick={handleResetDraft} />}
86
- * </>
87
- * );
88
- *
89
- * const renderPublishButtons = ({ PublishButton, PublishPreviewButton }) => (
90
- * <>
91
- * <PublishButton
92
- * disabled={isPublishDisabled}
93
- * onClick={handlePublish}
94
- * publishPaneProps={{
95
- * isSubmitting: false,
96
- * onPublish: ({ onClose }) => onClose(),
97
- * onCancel: ({ onClose }) => onClose(),
98
- * datetime: null,
99
- * }}
100
- * />
101
- * <PublishPreviewButton
102
- * disabled={isPublishPreviewDisabled}
103
- * to={previewPublishedUrl}
104
- * />
105
- * </>
106
- * );
107
- * return (
108
- * <PublishBlock
109
- * renderDraftButtons={renderDraftButtons}
110
- * renderPublishButtons={renderPublishButtons}
111
- * />
112
- * );
113
- * };
114
- * @endexample
115
68
  * This optional component can be used to render the reset alert modal for
116
69
  *
117
70
  * discarding draft.
@@ -140,9 +93,37 @@ interface PublishBlockProps {
140
93
  * );
141
94
  * };
142
95
  * @endexample
96
+ * This optional component can be used to render the publish later pane.
97
+ *
98
+ * @example
99
+ *
100
+ * import PublishBlock from "@bigbinary/neeto-molecules/PublishBlock";
101
+ *
102
+ * const PublishLaterPane = (
103
+ * {
104
+ * //all variables used in the below example can be passed as props or can be defined in the component itself
105
+ * }
106
+ * ) => {
107
+ * const [isOpen, setIsOpen] = useState(false);
108
+ *
109
+ * return (
110
+ * <>
111
+ * <PublishBlock.SchedulePane
112
+ * {...{ isOpen }}
113
+ * datetime={new Date()}
114
+ * isSubmitting={false}
115
+ * onClose={() => setIsOpen(false)}
116
+ * onPublish={handlePublish}
117
+ * />
118
+ * <Button label="Open SchedulePane" onClick={() => setIsOpen(true)} />
119
+ * </>
120
+ * );
121
+ * };
122
+ * @endexample
143
123
  */
144
124
  declare const PublishBlock: React.FC<PublishBlockProps> & {
145
125
  Alert: React.FC<AlertProps>;
126
+ SchedulePane: React.FC<SchedulePaneProps>;
146
127
  };
147
128
 
148
129
  export { PublishBlock as default };