PluginProbe ʕ •ᴥ•ʔ
Presto Player / 2.0.3
Presto Player v2.0.3
4.3.2 4.3.1 4.3.0 4.2.4 4.2.3 4.2.2 4.2.0 4.2.1 trunk 1.10.0 1.10.1 1.10.2 1.11.0 1.12.0 1.13.0 1.14.0 1.14.1 1.5.10 1.5.11 1.5.12 1.5.13 1.5.14 1.5.15 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 1.6.10 1.6.11 1.6.12 1.6.13 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.6.9 1.7.0 1.7.1 1.7.2 1.8.0 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.9.0 1.9.1 1.9.10 1.9.11 1.9.12 1.9.13 1.9.14 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 2.0.10 2.0.11 2.0.12 2.0.13 2.0.14 2.0.15 2.0.16 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1.0 2.2.0 2.2.1 2.2.2 2.2.3 2.2.3-beta1 2.3.0 2.3.1 2.3.2 2.3.3 3.0.0 3.0.0-beta1 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.1.0 3.1.1 3.1.2 3.1.3 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.0.5 4.0.6 4.0.7 4.0.8 4.1.0 4.1.1 4.1.2 4.1.3 4.1.4
presto-player / src / admin / blocks / shared / presets / Email.js
presto-player / src / admin / blocks / shared / presets Last commit date
parts 3 years ago ActionBar.js 4 years ago Behavior.js 4 years ago CTA.js 4 years ago Controls.js 5 years ago Edit.js 3 years ago Email.js 4 years ago Preset.js 4 years ago Search.js 3 years ago Style.js 5 years ago Watermark.js 4 years ago index.js 4 years ago
Email.js
231 lines
1 /** @jsx jsx */
2 /**
3 * WordPress dependencies
4 */
5 import { __ } from "@wordpress/i18n";
6 import {
7 ToggleControl,
8 BaseControl,
9 RangeControl,
10 TextControl,
11 Button,
12 Flex,
13 TextareaControl,
14 Notice,
15 } from "@wordpress/components";
16 import { useSelect } from "@wordpress/data";
17
18 import ChooseProvider from "./parts/ChooseProvider";
19 import ColorPopup from "../components/ColorPopup";
20
21 import { css, jsx } from "@emotion/core";
22
23 export default function ({ state, updateState, className }) {
24 const { email_collection, cta } = state;
25
26 const branding = useSelect((select) => {
27 return select("presto-player/player").branding();
28 });
29
30 const updateEmailState = (updated) => {
31 updateState({
32 ...state,
33 email_collection: {
34 ...email_collection,
35 ...updated,
36 },
37 });
38 };
39
40 const disableCTA = () => {
41 updateState({
42 ...state,
43 cta: {
44 ...cta,
45 ...{ enabled: false },
46 },
47 });
48 };
49
50 return (
51 <div className={className}>
52 <BaseControl>
53 <h3>{__("Email Capture", "presto-player")}</h3>
54 </BaseControl>
55 <BaseControl className="presto-player__control--large-play">
56 <ToggleControl
57 label={__("Enable", "presto-player")}
58 help={__(
59 "Show an email collection form and message over your player.",
60 "presto-player"
61 )}
62 onChange={(enabled) => {
63 updateEmailState({
64 enabled,
65 });
66 }}
67 checked={email_collection?.enabled}
68 />
69 </BaseControl>
70 {!!email_collection?.enabled && (
71 <>
72 <BaseControl className="presto-player__control--percentage-watched">
73 <RangeControl
74 label={__("Display At (Percentage)", "presto-player")}
75 labelPosition="top"
76 onChange={(percentage) => {
77 updateEmailState({
78 percentage,
79 });
80 }}
81 marks={[
82 {
83 value: 0,
84 label: __("Start", "presto-player"),
85 },
86 {
87 value: 50,
88 label: __("50% Watched", "presto-player"),
89 },
90 {
91 value: 100,
92 label: __("End", "presto-player"),
93 },
94 ]}
95 shiftStep={5}
96 value={email_collection?.percentage || 0}
97 />
98 </BaseControl>
99
100 {cta?.enabled && email_collection?.percentage === cta?.percentage && (
101 <Notice
102 css={css`
103 margin: 0 0 30px 0 !important;
104 `}
105 status="warning"
106 isDismissible={false}
107 >
108 {__(
109 "You already have a Call To Action set display at the same time.",
110 "presto-player"
111 )}
112 <Button
113 onClick={disableCTA}
114 isLink
115 css={css`
116 margin-top: 10px !important;
117 `}
118 >
119 {__("Disable Call To Action", "presto-player")}
120 </Button>
121 </Notice>
122 )}
123
124 <BaseControl className="presto-player__control--large-play">
125 <ToggleControl
126 label={__("Allow Skipping", "presto-player")}
127 help={__("Let the viewer skip", "presto-player")}
128 onChange={(allow_skip) => {
129 updateEmailState({
130 allow_skip,
131 });
132 }}
133 checked={email_collection?.allow_skip}
134 />
135 </BaseControl>
136
137 <BaseControl className="presto-player__control--large-play">
138 <TextareaControl
139 label={__("Headline", "presto-player")}
140 help={__("The headline for your form.", "presto-player")}
141 value={email_collection?.headline}
142 onChange={(headline) => {
143 updateEmailState({
144 headline,
145 });
146 }}
147 />
148 </BaseControl>
149
150 <BaseControl className="presto-player__control--large-play">
151 <TextareaControl
152 label={__("Bottom Text", "presto-player")}
153 help={__(
154 "Text displayed below the form. HTML allowed.",
155 "presto-player"
156 )}
157 value={email_collection?.bottom_text}
158 onChange={(bottom_text) => {
159 updateEmailState({
160 bottom_text,
161 });
162 }}
163 />
164 </BaseControl>
165
166 <BaseControl className="presto-player__control--large-play">
167 <TextControl
168 label={__("Play Button Text", "presto-player")}
169 help={<p>{__("Submit button text", "presto-player")}</p>}
170 value={email_collection?.button_text}
171 onChange={(button_text) => updateEmailState({ button_text })}
172 />
173 </BaseControl>
174
175 <BaseControl className="presto-player__control--button-color">
176 <Flex>
177 <BaseControl.VisualLabel>
178 {__("Button Color", "presto-player")}
179 </BaseControl.VisualLabel>
180 <ColorPopup
181 color={cta?.button_color || branding?.color}
182 setColor={(value) =>
183 updateEmailState({
184 button_color: value && value.hex,
185 })
186 }
187 />
188 </Flex>
189 </BaseControl>
190 <BaseControl className="presto-player__control--button-text-color">
191 <Flex>
192 <BaseControl.VisualLabel>
193 {__("Button Text Color", "presto-player")}
194 </BaseControl.VisualLabel>
195 <ColorPopup
196 color={cta?.button_text_color || "#ffffff"}
197 setColor={(value) =>
198 updateEmailState({
199 button_text_color: value && value.hex,
200 })
201 }
202 />
203 </Flex>
204 </BaseControl>
205
206 <h3>{__("Integrate", "presto-player")}</h3>
207 <BaseControl>
208 <ChooseProvider
209 updateEmailState={updateEmailState}
210 options={email_collection}
211 />
212 </BaseControl>
213
214 <h3>{__("Style", "presto-player")}</h3>
215
216 <BaseControl>
217 <RangeControl
218 label={__("Round Corners", "presto-player")}
219 help={__("Border radius of form elements.", "presto-player")}
220 value={email_collection?.border_radius || 0}
221 onChange={(border_radius) => updateEmailState({ border_radius })}
222 min={0}
223 max={25}
224 />
225 </BaseControl>
226 </>
227 )}
228 </div>
229 );
230 }
231