@nylas/web-elements 0.0.0-canary-20241017103834 → 0.0.0-canary-20241017202051

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.
Files changed (31) hide show
  1. package/dist/cdn/nylas-additional-participants/nylas-additional-participants.es.js +7 -7
  2. package/dist/cdn/nylas-editor-tabs/nylas-editor-tabs.es.js +4552 -4544
  3. package/dist/cdn/nylas-reminder-emails/nylas-reminder-emails.es.js +2289 -2281
  4. package/dist/cdn/nylas-reminder-time/nylas-reminder-time.es.js +2253 -2245
  5. package/dist/cdn/nylas-scheduler-editor/nylas-scheduler-editor.es.js +97 -89
  6. package/dist/cjs/calendar-agenda-fill-icon_54.cjs.entry.js +32 -37
  7. package/dist/cjs/calendar-agenda-fill-icon_54.cjs.entry.js.map +1 -1
  8. package/dist/cjs/loader.cjs.js +1 -1
  9. package/dist/cjs/nylas-web-elements.cjs.js +1 -1
  10. package/dist/collection/components/scheduler-editor/nylas-additional-participants/nylas-additional-participants.js +9 -9
  11. package/dist/collection/components/scheduler-editor/nylas-additional-participants/nylas-additional-participants.js.map +1 -1
  12. package/dist/collection/components/scheduler-editor/nylas-reminder-time/nylas-reminder-time.js +23 -30
  13. package/dist/collection/components/scheduler-editor/nylas-reminder-time/nylas-reminder-time.js.map +1 -1
  14. package/dist/collection/components/scheduler-editor/nylas-reminder-time/test/nylas-reminder-time.spec.js +37 -0
  15. package/dist/collection/components/scheduler-editor/nylas-reminder-time/test/nylas-reminder-time.spec.js.map +1 -0
  16. package/dist/components/nylas-additional-participants2.js +9 -9
  17. package/dist/components/nylas-additional-participants2.js.map +1 -1
  18. package/dist/components/nylas-reminder-time2.js +23 -29
  19. package/dist/components/nylas-reminder-time2.js.map +1 -1
  20. package/dist/esm/calendar-agenda-fill-icon_54.entry.js +32 -37
  21. package/dist/esm/calendar-agenda-fill-icon_54.entry.js.map +1 -1
  22. package/dist/esm/loader.js +1 -1
  23. package/dist/esm/nylas-web-elements.js +1 -1
  24. package/dist/nylas-web-elements/nylas-web-elements.esm.js +1 -1
  25. package/dist/nylas-web-elements/nylas-web-elements.esm.js.map +1 -1
  26. package/dist/nylas-web-elements/{p-df131a08.entry.js → p-1ce8b1c3.entry.js} +3 -3
  27. package/dist/nylas-web-elements/p-1ce8b1c3.entry.js.map +1 -0
  28. package/dist/types/components/scheduler-editor/nylas-additional-participants/nylas-additional-participants.d.ts +1 -1
  29. package/dist/types/components/scheduler-editor/nylas-reminder-time/nylas-reminder-time.d.ts +1 -1
  30. package/package.json +1 -1
  31. package/dist/nylas-web-elements/p-df131a08.entry.js.map +0 -1
@@ -425,7 +425,7 @@ const NylasAdditionalParticipants = class {
425
425
  disconnectedCallback() {
426
426
  utils.debug('nylas-additional-participants', 'disconnectedCallback');
427
427
  }
428
- isInternalsAvailable() {
428
+ get isInternalsAvailable() {
429
429
  return this.internals !== undefined && typeof this.internals.setFormValue === 'function' && typeof this.internals.setValidity === 'function';
430
430
  }
431
431
  onInputOptionChanged(event) {
@@ -434,14 +434,14 @@ const NylasAdditionalParticipants = class {
434
434
  const index = event.detail.name;
435
435
  const participant = this.participantOptions?.find(participant => participant.email === event.detail.value);
436
436
  if (!participant && this.isRoundRobinConfig) {
437
- this.isInternalsAvailable() && this.internals.setValidity({ customError: true }, 'For round robin configuration, participant should be selected from the dropdown.');
437
+ this.isInternalsAvailable && this.internals.setValidity({ customError: true }, 'For round robin configuration, participant should be selected from the dropdown.');
438
438
  this.participantErrors[index] = 'For round robin page, participant should be selected from the dropdown.';
439
439
  this.participants[index].is_valid = false;
440
440
  this.participants = [...this.participants];
441
441
  return;
442
442
  }
443
443
  else if (!participant && !EMAIL_REGEX.test(event.detail.value)) {
444
- this.isInternalsAvailable() && this.internals.setValidity({ customError: true }, 'Please enter a valid email address');
444
+ this.isInternalsAvailable && this.internals.setValidity({ customError: true }, 'Please enter a valid email address');
445
445
  this.participantErrors[index] = 'Please enter a valid email address';
446
446
  this.participants[index].is_valid = false;
447
447
  this.participants = [...this.participants];
@@ -450,7 +450,7 @@ const NylasAdditionalParticipants = class {
450
450
  else {
451
451
  this.participantErrors[index] = '';
452
452
  this.participants[index].is_valid = true;
453
- this.isInternalsAvailable() && this.internals.setValidity({});
453
+ this.isInternalsAvailable && this.internals.setValidity({});
454
454
  }
455
455
  this.participants[index].email = event.detail.value;
456
456
  this.participants[index].availability = participant ? { calendar_ids: ['primary'] } : undefined;
@@ -493,13 +493,13 @@ const NylasAdditionalParticipants = class {
493
493
  utils.debug('nylas-additional-participants', 'updateFormValue');
494
494
  const participants = this.isRoundRobinConfig ? (this.includeOrganizerAsParticipant ? this.participants : this.participants.filter(p => !p.is_organizer)) : this.participants;
495
495
  if (participants.length === 0) {
496
- this.isInternalsAvailable() && this.internals.setValidity({ customError: true }, 'Please add at least one participant');
496
+ this.isInternalsAvailable && this.internals.setValidity({ customError: true }, 'Please add at least one participant');
497
497
  this.error = 'Please add at least one participant';
498
498
  }
499
499
  else {
500
- this.isInternalsAvailable() && this.internals.setValidity({});
500
+ this.isInternalsAvailable && this.internals.setValidity({});
501
501
  this.error = '';
502
- this.isInternalsAvailable() && this.internals.setFormValue(JSON.stringify(participants), this.name);
502
+ this.isInternalsAvailable && this.internals.setFormValue(JSON.stringify(participants), this.name);
503
503
  this.valueChanged.emit({ value: JSON.stringify(participants), name: this.name });
504
504
  }
505
505
  }
@@ -510,7 +510,7 @@ const NylasAdditionalParticipants = class {
510
510
  });
511
511
  }
512
512
  render() {
513
- return (index$1.h(index$1.Host, { key: 'b17facebc66435c9e405b442500163b47836914e', part: "nap" }, index$1.h("nylas-form-card", { key: 'bce92f93c9f0ec0c04c000582505ea1adb1a3e22' }, index$1.h("h3", { key: '07cd5fd66a38dadfd67f67607fe81fb235cbb1f3', slot: "header-title", class: "nylas-additional-participants__title", part: "nap__title" }, "Participants"), index$1.h("p", { key: '3e9f5348444a81731228d4ce5f355b3cd6ead03f', slot: "header-subtitle", class: "nylas-additional-participants__subtitle", part: "nap__subtitle" }, "Add people in your team or organization to join the event."), index$1.h("div", { key: 'b6921a32886aaedbf9ecaa942912c2991881b380', slot: "content", class: "nylas-additional-participants__content" }, index$1.h("div", { key: '780531379643ee4764122906f144d302e0bc32e5' }, this.participants.map((participant, index) => {
513
+ return (index$1.h(index$1.Host, { key: '16a28d7d8ee91b685a22472d8a90721a5074d798', part: "nap" }, index$1.h("nylas-form-card", { key: '9fde59eadfcdf05c3b4add30a5c35f9b21d00c30' }, index$1.h("h3", { key: '82e3c3ad537ef4c60d19695f11e481bac2ed31ae', slot: "header-title", class: "nylas-additional-participants__title", part: "nap__title" }, "Participants"), index$1.h("p", { key: '4df3d661d2c6801ba8e88d82853ae562ed3be8e8', slot: "header-subtitle", class: "nylas-additional-participants__subtitle", part: "nap__subtitle" }, "Add people in your team or organization to join the event."), index$1.h("div", { key: '3ccb34354c025b52760433683812acf37b480e77', slot: "content", class: "nylas-additional-participants__content" }, index$1.h("div", { key: '007cf8396921637cf230cc26d73de147169cd250' }, this.participants.map((participant, index) => {
514
514
  return (index$1.h("div", { class: 'nylas-additional-participants__input_group', part: "nap__input_group" }, !participant.is_organizer && index$1.h("label", null, `Participant ${index}`), index$1.h("div", { part: "nap__input_wrapper", class: {
515
515
  'nylas-additional-participants__input_wrapper': true,
516
516
  'nylas-additional-participants__input_wrapper_organizer': participant?.is_organizer === true,
@@ -520,7 +520,7 @@ const NylasAdditionalParticipants = class {
520
520
  this.includeOrganizerAsParticipant = !this.includeOrganizerAsParticipant;
521
521
  this.updateFormValue();
522
522
  }, checked: this.includeOrganizerAsParticipant }), index$1.h("label", { htmlFor: `organizer_participant`, "aria-label": "Include as participant" }, "Participant", index$1.h("tooltip-component", { id: "organizer_participant_tooltip" }, index$1.h("info-icon", { slot: "tooltip-icon" }), index$1.h("span", { slot: "tooltip-content" }, index$1.h("strong", null, "Include Organizer:"), " The organizer (you) will be included in the round-robin rotation. ", index$1.h("br", null), index$1.h("strong", null, "Exclude Organizer:"), " The organizer (you) will not be included in the round-robin rotation."))))))) : (index$1.h("input-dropdown", { id: `${index}`, name: `${index}`, filterable: true, inputValue: participant.email, options: this.getArrayDifference(this.participantOptions || [], this.participants) })), !participant.is_organizer && (index$1.h("button", { onClick: () => this.removeParticipant(index), part: "nap__remove-participant" }, index$1.h("close-icon", null))))), !participant.is_valid && (index$1.h("p", { class: "nylas-additional-participants__error", part: "nap__error" }, this.participantErrors[index]))));
523
- }), index$1.h("p", { key: '9921cf9eb77303da37e64bb4b2555fe662bcb299', class: "nylas-additional-participants__error", part: "nap__error" }, this.error)), index$1.h("button", { key: '0fdc9f4d4ee5b221aaaa01de39e0fe5ad29675f1', class: "nylas-additional-participants__add", part: "nap__add-participant", onClick: () => this.addParticipant() }, index$1.h("add-circle-icon", { key: 'c1c405144661b246731d48907246b3bc9e252410' }), " ", index$1.h("span", { key: '2ccd09a3a9c148dd4e895f7c3b2ac52cce86b76b' }, "Add ", this.participants.length > 1 ? 'another' : 'a', " participant"))))));
523
+ }), index$1.h("p", { key: 'f1dd954c137093fa9e474f3886e4b5320aeb5e2e', class: "nylas-additional-participants__error", part: "nap__error" }, this.error)), index$1.h("button", { key: '859585010fc9fce314b856f5e7e07ac8b8c47b88', class: "nylas-additional-participants__add", part: "nap__add-participant", onClick: () => this.addParticipant() }, index$1.h("add-circle-icon", { key: 'aec7eb5de30e66bca29b73962f356109471c2e9e' }), " ", index$1.h("span", { key: 'f07ecfaa4db46f7954d734314c46f2d773158730' }, "Add ", this.participants.length > 1 ? 'another' : 'a', " participant"))))));
524
524
  }
525
525
  static get formAssociated() { return true; }
526
526
  get host() { return index$1.getElement(this); }
@@ -8454,22 +8454,29 @@ var __metadata$2 = (undefined && undefined.__metadata) || function (k, v) {
8454
8454
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
8455
8455
  return Reflect.metadata(k, v);
8456
8456
  };
8457
+ const reminderTimeOptions = [
8458
+ { value: 60 * 24, label: 'day' },
8459
+ { value: 60, label: 'hour' },
8460
+ { value: 1, label: 'minute' },
8461
+ ];
8457
8462
  function getInitialTimeValue(timeInMinutes) {
8458
8463
  if (!timeInMinutes)
8459
8464
  return 30;
8460
- if (timeInMinutes >= 60 * 24)
8461
- return timeInMinutes / (60 * 24);
8462
- if (timeInMinutes >= 90 || timeInMinutes === 60)
8463
- return timeInMinutes / 60;
8465
+ for (const option of reminderTimeOptions) {
8466
+ if (timeInMinutes % option.value === 0) {
8467
+ return timeInMinutes / option.value;
8468
+ }
8469
+ }
8464
8470
  return timeInMinutes;
8465
8471
  }
8466
8472
  function getInitialTimeIncrement(timeInMinutes) {
8467
8473
  if (!timeInMinutes)
8468
- return 30;
8469
- if (timeInMinutes >= 60 * 24)
8470
- return 60 * 24;
8471
- if (timeInMinutes >= 90 || timeInMinutes === 60)
8472
- return 60;
8474
+ return 1;
8475
+ for (const option of reminderTimeOptions) {
8476
+ if (timeInMinutes % option.value === 0) {
8477
+ return option.value;
8478
+ }
8479
+ }
8473
8480
  return 1;
8474
8481
  }
8475
8482
  const NylasReminderTime = class {
@@ -8494,15 +8501,6 @@ const NylasReminderTime = class {
8494
8501
  utils.debug('nylas-reminder-time', 'elementNameChangedHandler', newValue);
8495
8502
  this.host.setAttribute('name', newValue);
8496
8503
  }
8497
- eventReminderTimeMinutesChangedHandler(newValue, oldValue) {
8498
- utils.debug('nylas-reminder-time', 'eventReminderTimeMinutesChangedHandler', newValue);
8499
- if (newValue === oldValue) {
8500
- return;
8501
- }
8502
- this.reminderTime = getInitialTimeValue(newValue);
8503
- this.reminderTimeincrement = getInitialTimeIncrement(newValue);
8504
- this.reminderTimeMinutes = newValue;
8505
- }
8506
8504
  reminderTimeMinutesChangedHandler(newValue, oldValue) {
8507
8505
  utils.debug('nylas-reminder-time', 'reminderTimeMinutesChangedHandler', newValue);
8508
8506
  if (newValue === oldValue) {
@@ -8516,14 +8514,17 @@ const NylasReminderTime = class {
8516
8514
  componentWillLoad() {
8517
8515
  utils.debug('nylas-reminder-time', 'componentWillLoad');
8518
8516
  this.host.setAttribute('name', this.name);
8519
- this.setReminderTimeMinuteOptions();
8520
8517
  }
8521
8518
  componentDidLoad() {
8522
8519
  utils.debug('nylas-reminder-time', 'componentDidLoad');
8520
+ this.setReminderTimeMinuteOptions();
8523
8521
  }
8524
8522
  disconnectedCallback() {
8525
8523
  utils.debug('nylas-reminder-time', 'disconnectedCallback');
8526
8524
  }
8525
+ get isInternalsAvailable() {
8526
+ return this.internals !== undefined && typeof this.internals.setFormValue === 'function';
8527
+ }
8527
8528
  setReminderTimeMinuteOptions() {
8528
8529
  if (this.reminderTimeincrement === 1) {
8529
8530
  this.reminderTimeMinutesOptions = constants.REMINDER_MINUTE_OPTIONS;
@@ -8547,28 +8548,22 @@ const NylasReminderTime = class {
8547
8548
  }
8548
8549
  this.setReminderTimeMinuteOptions();
8549
8550
  this.reminderTimeMinutes = this.reminderTime * this.reminderTimeincrement;
8550
- this.internals.setFormValue(this.reminderTimeMinutes.toString(), this.name);
8551
+ this.isInternalsAvailable && this.internals.setFormValue(this.reminderTimeMinutes.toString(), this.name);
8551
8552
  }
8552
8553
  inputOptionChangedHandler(event) {
8553
8554
  utils.debug('nylas-calendar-picker', 'inputOptionChangedHandler', event.detail);
8554
8555
  const { value } = event.detail;
8555
8556
  this.reminderTime = value;
8556
8557
  this.reminderTimeMinutes = this.reminderTime * this.reminderTimeincrement;
8557
- this.internals.setFormValue(this.reminderTimeMinutes.toString(), this.name);
8558
+ this.isInternalsAvailable && this.internals.setFormValue(this.reminderTimeMinutes.toString(), this.name);
8558
8559
  }
8559
8560
  render() {
8560
- const reminderTimeOptions = [
8561
- { value: 1, label: 'minute' },
8562
- { value: 60, label: 'hour' },
8563
- { value: 60 * 24, label: 'day' },
8564
- ];
8565
- return (index$1.h(index$1.Host, { key: 'd5f118391bdd7e4779f6eca15335285047fdb350' }, index$1.h("div", { key: '2dd8d3ba52d4f95480c9cf1fdaf5d0f1f7c1e523', class: "nylas-reminder-time", part: "nrt" }, index$1.h("div", { key: '3799c4b266f4078e22ad78b86225ef9abdc5fa49', class: "nylas-reminder-time__wrapper" }, index$1.h("input-dropdown", { key: '004b6336c041660e1424ac44f16e82c8a5a2ca53', name: 'reminder-time', options: this.reminderTimeMinutesOptions, inputValue: this.reminderTime.toString(), exportparts: "id_dropdown: nrt__input_dropdown, id_dropdown-input: nrt__input_dropdown-input, id_dropdown-content: nrt__input_dropdown-content", defaultInputOption: this.reminderTimeMinutesOptions.find(i => i.value == this.reminderTime) ?? reminderTimeOptions[0] }), index$1.h("select-dropdown", { key: '6a42c7f4633d89dd9a94d3c2f119e151613667ec', name: 'reminder-time-unit', options: reminderTimeOptions, pluralizedLabel: this.reminderTime > 1 ? 's' : '', exportparts: "sd_dropdown: nrt__dropdown, sd_dropdown-button: nrt__dropdown-button, sd_dropdown-content: nrt__dropdown-content", defaultSelectedOption: reminderTimeOptions.find(i => i.value == this.reminderTimeincrement) ?? reminderTimeOptions[0], withSearch: false })))));
8561
+ return (index$1.h(index$1.Host, { key: 'b089eb10d76d001112d867a61889a685b8908355' }, index$1.h("div", { key: '13b8479fb822135c00ff8f97974c8269731b2a84', class: "nylas-reminder-time", part: "nrt" }, index$1.h("div", { key: '728e90c61077b1037aa285329f11a09a296b33b4', class: "nylas-reminder-time__wrapper" }, index$1.h("input-dropdown", { key: '40a22b75424d4b3b552a2dc1b60e79a8cb595032', name: 'reminder-time', options: this.reminderTimeMinutesOptions, inputValue: this.reminderTime.toString(), exportparts: "id_dropdown: nrt__input_dropdown, id_dropdown-input: nrt__input_dropdown-input, id_dropdown-content: nrt__input_dropdown-content", defaultInputOption: this.reminderTimeMinutesOptions.find(i => i.value == this.reminderTime) ?? reminderTimeOptions[0] }), index$1.h("select-dropdown", { key: '6128bb953b883be5341ba005438ab353b0016c48', name: 'reminder-time-unit', options: [...reminderTimeOptions].sort((a, b) => a.value - b.value), pluralizedLabel: this.reminderTime > 1 ? 's' : '', exportparts: "sd_dropdown: nrt__dropdown, sd_dropdown-button: nrt__dropdown-button, sd_dropdown-content: nrt__dropdown-content", defaultSelectedOption: reminderTimeOptions.find(i => i.value == this.reminderTimeincrement) ?? reminderTimeOptions[0], withSearch: false })))));
8566
8562
  }
8567
8563
  static get formAssociated() { return true; }
8568
8564
  get host() { return index$1.getElement(this); }
8569
8565
  static get watchers() { return {
8570
8566
  "name": ["elementNameChangedHandler"],
8571
- "eventReminderTimeMinutes": ["eventReminderTimeMinutesChangedHandler"],
8572
8567
  "reminderTimeMinutes": ["reminderTimeMinutesChangedHandler"]
8573
8568
  }; }
8574
8569
  };