@social-mail/social-mail-client 1.2.698 → 1.2.699

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@social-mail/social-mail-client",
3
- "version": "1.2.698",
3
+ "version": "1.2.699",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -15,6 +15,12 @@ import AtomRepeater from "@web-atoms/web-controls/dist/basic/AtomRepeater";
15
15
  import { UrlService } from "./UrlService";
16
16
  import { Mailto } from "../../common/Mailto";
17
17
  import { WebComponents } from "../../site-editor/editor/webComponentsPath";
18
+ import Action from "@web-atoms/core/dist/view-model/Action";
19
+ import PopupService from "@web-atoms/core/dist/web/services/PopupService";
20
+ import TimeEditor from "@web-atoms/web-controls/dist/basic/TimeEditor";
21
+ import Form from "@web-atoms/web-controls/dist/basic/Form";
22
+ import FormField from "@web-atoms/web-controls/dist/basic/FormField";
23
+ import TimeSpan from "@web-atoms/date-time/dist/TimeSpan";
18
24
 
19
25
  declare global {
20
26
  namespace JSX {
@@ -195,6 +201,8 @@ export default class ChannelCalendarView extends AtomControl {
195
201
 
196
202
  calendarEvents: Map<number,IMailboxContactEvent[]> = new Map();
197
203
 
204
+ time = TimeSpan.parse("11:00 AM");
205
+
198
206
  constructor(app, e) {
199
207
  super(app, e);
200
208
  this.element.setAttribute("calendar-view", "simple");
@@ -226,20 +234,36 @@ export default class ChannelCalendarView extends AtomControl {
226
234
  <calendar-events
227
235
  { ... renderChildren(Bind.source( { self: this }, (s) => this.renderEventItem(s.source.self.calendarEvents, s.source.self.selectedDate) )) }
228
236
  />
229
- <share-button
230
- href={Bind.oneWay(() => Mailto.create({
231
- to: this.channel.emailAddress.emailAddress,
232
- body: `\r\nEvent on 📅:${toVisibleDate(this.selectedDate)}\r\nEvent at 📍:`
233
- }))}>
234
- <button data-layout="accent-icon-button">
235
- <i class="fas fa-plus"/>
236
- <span text={Bind.oneWay(() => `Create Event on ${this.selectedDate?.day} `)}/>
237
- </button>
238
- </share-button>
237
+ <details>
238
+ <summary>Create New</summary>
239
+ <div data-layout="row">
240
+ Create Event at
241
+ <TimeEditor time={Bind.twoWaysImmediate(() => this.time)} />
242
+ <share-button
243
+ href={Bind.oneWay(() => this.createEvent(this.selectedDate, this.time) )}>
244
+ Create Event
245
+ </share-button>
246
+ </div>
247
+ </details>
239
248
  </vflex-div>
240
249
  </div>;
241
250
 
242
251
  }
252
+
253
+ createEvent(date: DateTime, time) {
254
+ let l = "";
255
+ // let l = dateObject.location;
256
+ // if (l) {
257
+ // l = `📍: ${l}`;
258
+ // }
259
+ const d = date.date.add(time);
260
+ const body = `\r\nEvent on: 📅: ${d.toJSON()}\r\n${l}`;
261
+ return Mailto.create({
262
+ to: this.channel.emailAddress.emailAddress,
263
+ body
264
+ });
265
+ }
266
+
243
267
  renderEvent(calendarEvents: Map<number, IMailboxContactEvent[]>, date: DateTime) {
244
268
  const items = calendarEvents.get(date.date.msSinceEpoch);
245
269
  if (!items) {