@nylas/web-elements 2.0.6 → 2.1.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.
- package/dist/cdn/nylas-scheduler-editor/nylas-scheduler-editor.es.js +212 -212
- package/dist/cdn/nylas-scheduling/nylas-scheduling.es.js +1044 -1044
- package/dist/cjs/{abstract-provider-b37458c4.js → abstract-provider-85a616a9.js} +2 -2
- package/dist/cjs/{abstract-provider-b37458c4.js.map → abstract-provider-85a616a9.js.map} +1 -1
- package/dist/cjs/calendar-agenda-fill-icon_37.cjs.entry.js +55 -55
- package/dist/cjs/calendar-agenda-fill-icon_37.cjs.entry.js.map +1 -1
- package/dist/cjs/checkbox-group_4.cjs.entry.js +3 -3
- package/dist/cjs/checkmark-icon_15.cjs.entry.js +2 -2
- package/dist/cjs/{customParseFormat-61a3a302.js → customParseFormat-dc3b45aa.js} +2 -2
- package/dist/cjs/{customParseFormat-61a3a302.js.map → customParseFormat-dc3b45aa.js.map} +1 -1
- package/dist/cjs/{feedbackSync-2c4d37fe.js → feedbackSync-eaa01d21.js} +2 -2
- package/dist/cjs/feedbackSync-eaa01d21.js.map +1 -0
- package/dist/cjs/google-logo-icon_6.cjs.entry.js +18 -18
- package/dist/cjs/google-logo-icon_6.cjs.entry.js.map +1 -1
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/{index.es-e4fc6d92.js → index.es-a962dedb.js} +2 -2
- package/dist/cjs/{index.es-e4fc6d92.js.map → index.es-a962dedb.js.map} +1 -1
- package/dist/cjs/input-component.cjs.entry.js +1 -1
- package/dist/cjs/input-dropdown_2.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/multi-select-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/{nylas-api-request-5b2f7ec0.js → nylas-api-request-d263af93.js} +2 -2
- package/dist/cjs/{nylas-api-request-5b2f7ec0.js.map → nylas-api-request-d263af93.js.map} +1 -1
- package/dist/cjs/nylas-booked-event-card_11.cjs.entry.js +2 -2
- package/dist/cjs/nylas-date-component_2.cjs.entry.js +2 -2
- package/dist/cjs/nylas-form-card.cjs.entry.js +2 -2
- package/dist/cjs/nylas-notification_2.cjs.entry.js +1 -1
- package/dist/cjs/nylas-scheduler-editor.cjs.entry.js +6 -6
- package/dist/cjs/nylas-scheduling.cjs.entry.js +8 -8
- package/dist/cjs/nylas-scheduling.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-web-elements.cjs.js +1 -1
- package/dist/cjs/{register-component-8a9c40ee.js → register-component-2eefbf66.js} +2 -2
- package/dist/cjs/{register-component-8a9c40ee.js.map → register-component-2eefbf66.js.map} +1 -1
- package/dist/cjs/textarea-component.cjs.entry.js +1 -1
- package/dist/cjs/{utils-c923f1a8.js → utils-e37da320.js} +113 -113
- package/dist/cjs/{utils-c923f1a8.js.map → utils-e37da320.js.map} +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/scheduler/nylas-scheduling/nylas-scheduling.js +1 -1
- package/dist/collection/components/scheduler/nylas-scheduling/nylas-scheduling.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-editor-tabs/nylas-editor-tabs.js +10 -10
- package/dist/collection/components/scheduler-editor/nylas-editor-tabs/nylas-editor-tabs.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-editor-tabs/test/nylas-editor-tabs.spec.js +1 -1
- package/dist/collection/components/scheduler-editor/nylas-editor-tabs/test/nylas-editor-tabs.spec.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-participants-custom-availability/nylas-participants-custom-availability.js +18 -18
- package/dist/collection/components/scheduler-editor/nylas-participants-custom-availability/nylas-participants-custom-availability.js.map +1 -1
- package/dist/collection/components/scheduler-editor/{nylas-specific-date-availability-picker/nylas-specific-date-availability-picker.css → nylas-specific-time-availability-picker/nylas-specific-time-availability-picker.css} +46 -46
- package/dist/collection/components/scheduler-editor/{nylas-specific-date-availability-picker/nylas-specific-date-availability-picker.js → nylas-specific-time-availability-picker/nylas-specific-time-availability-picker.js} +41 -41
- package/dist/collection/components/scheduler-editor/nylas-specific-time-availability-picker/nylas-specific-time-availability-picker.js.map +1 -0
- package/dist/collection/components/scheduler-editor/{nylas-specific-date-availability-picker/test/nylas-specific-date-availability-picker.spec.js → nylas-specific-time-availability-picker/test/nylas-specific-time-availability-picker.spec.js} +48 -48
- package/dist/collection/components/scheduler-editor/nylas-specific-time-availability-picker/test/nylas-specific-time-availability-picker.spec.js.map +1 -0
- package/dist/collection/types/index.js.map +1 -1
- package/dist/components/index3.js.map +1 -1
- package/dist/components/nylas-editor-tabs-group2.js +2 -2
- package/dist/components/nylas-editor-tabs2.js +15 -15
- package/dist/components/nylas-editor-tabs2.js.map +1 -1
- package/dist/components/nylas-participants-custom-availability2.js +21 -21
- package/dist/components/nylas-participants-custom-availability2.js.map +1 -1
- package/dist/components/nylas-scheduler-editor.js +5 -5
- package/dist/components/nylas-scheduling.js +4 -4
- package/dist/components/nylas-scheduling.js.map +1 -1
- package/dist/components/nylas-specific-time-availability-picker.d.ts +11 -0
- package/dist/components/nylas-specific-time-availability-picker.js +8 -0
- package/dist/components/nylas-specific-time-availability-picker.js.map +1 -0
- package/dist/components/{nylas-specific-date-availability-picker2.js → nylas-specific-time-availability-picker2.js} +41 -41
- package/dist/components/nylas-specific-time-availability-picker2.js.map +1 -0
- package/dist/components/utils.js +112 -112
- package/dist/esm/{abstract-provider-45ada3b4.js → abstract-provider-a502b54d.js} +2 -2
- package/dist/esm/{abstract-provider-45ada3b4.js.map → abstract-provider-a502b54d.js.map} +1 -1
- package/dist/esm/calendar-agenda-fill-icon_37.entry.js +55 -55
- package/dist/esm/calendar-agenda-fill-icon_37.entry.js.map +1 -1
- package/dist/esm/checkbox-group_4.entry.js +3 -3
- package/dist/esm/checkmark-icon_15.entry.js +2 -2
- package/dist/esm/{customParseFormat-eeec04f5.js → customParseFormat-b5d95b34.js} +2 -2
- package/dist/esm/{customParseFormat-eeec04f5.js.map → customParseFormat-b5d95b34.js.map} +1 -1
- package/dist/esm/{feedbackSync-0ebd0eda.js → feedbackSync-92220b42.js} +2 -2
- package/dist/esm/feedbackSync-92220b42.js.map +1 -0
- package/dist/esm/google-logo-icon_6.entry.js +18 -18
- package/dist/esm/google-logo-icon_6.entry.js.map +1 -1
- package/dist/esm/{index.es-57d4a08f.js → index.es-488bc919.js} +2 -2
- package/dist/esm/{index.es-57d4a08f.js.map → index.es-488bc919.js.map} +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/input-component.entry.js +1 -1
- package/dist/esm/input-dropdown_2.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/multi-select-dropdown.entry.js +1 -1
- package/dist/esm/{nylas-api-request-ad1909c6.js → nylas-api-request-9f7ac6c5.js} +2 -2
- package/dist/esm/{nylas-api-request-ad1909c6.js.map → nylas-api-request-9f7ac6c5.js.map} +1 -1
- package/dist/esm/nylas-booked-event-card_11.entry.js +2 -2
- package/dist/esm/nylas-date-component_2.entry.js +2 -2
- package/dist/esm/nylas-form-card.entry.js +2 -2
- package/dist/esm/nylas-notification_2.entry.js +1 -1
- package/dist/esm/nylas-scheduler-editor.entry.js +6 -6
- package/dist/esm/nylas-scheduling.entry.js +8 -8
- package/dist/esm/nylas-scheduling.entry.js.map +1 -1
- package/dist/esm/nylas-web-elements.js +1 -1
- package/dist/esm/{register-component-0aad9e3d.js → register-component-3acd57e7.js} +2 -2
- package/dist/esm/{register-component-0aad9e3d.js.map → register-component-3acd57e7.js.map} +1 -1
- package/dist/esm/textarea-component.entry.js +1 -1
- package/dist/esm/{utils-d3c0b941.js → utils-31933f5d.js} +113 -113
- package/dist/esm/{utils-d3c0b941.js.map → utils-31933f5d.js.map} +1 -1
- package/dist/nylas-web-elements/index.esm.js +1 -1
- package/dist/nylas-web-elements/nylas-web-elements.esm.js +1 -1
- package/dist/nylas-web-elements/nylas-web-elements.esm.js.map +1 -1
- package/dist/nylas-web-elements/{p-3216af1e.entry.js → p-20f50696.entry.js} +2 -2
- package/dist/nylas-web-elements/p-341f1a4c.entry.js +2 -0
- package/dist/nylas-web-elements/p-341f1a4c.entry.js.map +1 -0
- package/dist/nylas-web-elements/{p-1591deba.js → p-34c9fc7d.js} +2 -2
- package/dist/nylas-web-elements/{p-38fa873f.js → p-3524dab1.js} +2 -2
- package/dist/nylas-web-elements/p-3524dab1.js.map +1 -0
- package/dist/nylas-web-elements/{p-d45012f2.js → p-438d4542.js} +2 -2
- package/dist/nylas-web-elements/{p-21ab4e47.entry.js → p-536c5ef3.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-a4678661.entry.js → p-5a6c2efd.entry.js} +2 -2
- package/dist/nylas-web-elements/p-66a89e65.js +14 -0
- package/dist/nylas-web-elements/{p-17c5fb16.js.map → p-66a89e65.js.map} +1 -1
- package/dist/nylas-web-elements/{p-88e68e14.entry.js → p-6adb19cf.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-8937a53f.entry.js → p-6bda61cf.entry.js} +3 -3
- package/dist/nylas-web-elements/p-6bda61cf.entry.js.map +1 -0
- package/dist/nylas-web-elements/{p-30d92734.entry.js → p-7c02e476.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-8072aa07.js → p-803a1695.js} +2 -2
- package/dist/nylas-web-elements/{p-186bbd43.entry.js → p-81925b89.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-186bbd43.entry.js.map → p-81925b89.entry.js.map} +1 -1
- package/dist/nylas-web-elements/{p-855fe5b3.entry.js → p-83d2ff21.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-f83aa456.entry.js → p-8673dcf1.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-24c390bd.js → p-86e217f4.js} +2 -2
- package/dist/nylas-web-elements/{p-d0f51520.entry.js → p-8d5efa5e.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-0271cef3.entry.js → p-d7323440.entry.js} +3 -3
- package/dist/nylas-web-elements/{p-59ff0231.entry.js → p-da25d877.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-f0e1688e.js → p-e42db60f.js} +2 -2
- package/dist/nylas-web-elements/{p-c11e1016.entry.js → p-ff122d1e.entry.js} +2 -2
- package/dist/types/components/scheduler-editor/nylas-editor-tabs/nylas-editor-tabs.d.ts +5 -5
- package/dist/types/components/scheduler-editor/nylas-participants-custom-availability/nylas-participants-custom-availability.d.ts +3 -3
- package/dist/types/components/scheduler-editor/{nylas-specific-date-availability-picker/nylas-specific-date-availability-picker.d.ts → nylas-specific-time-availability-picker/nylas-specific-time-availability-picker.d.ts} +7 -7
- package/dist/types/components.d.ts +19 -19
- package/dist/types/types/index.d.ts +2 -2
- package/package.json +2 -2
- package/dist/cjs/feedbackSync-2c4d37fe.js.map +0 -1
- package/dist/collection/components/scheduler-editor/nylas-specific-date-availability-picker/nylas-specific-date-availability-picker.js.map +0 -1
- package/dist/collection/components/scheduler-editor/nylas-specific-date-availability-picker/test/nylas-specific-date-availability-picker.spec.js.map +0 -1
- package/dist/components/nylas-specific-date-availability-picker.d.ts +0 -11
- package/dist/components/nylas-specific-date-availability-picker.js +0 -8
- package/dist/components/nylas-specific-date-availability-picker.js.map +0 -1
- package/dist/components/nylas-specific-date-availability-picker2.js.map +0 -1
- package/dist/esm/feedbackSync-0ebd0eda.js.map +0 -1
- package/dist/nylas-web-elements/p-17c5fb16.js +0 -14
- package/dist/nylas-web-elements/p-38fa873f.js.map +0 -1
- package/dist/nylas-web-elements/p-3ddcb355.entry.js +0 -2
- package/dist/nylas-web-elements/p-3ddcb355.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-8937a53f.entry.js.map +0 -1
- /package/dist/nylas-web-elements/{p-3216af1e.entry.js.map → p-20f50696.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-1591deba.js.map → p-34c9fc7d.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-d45012f2.js.map → p-438d4542.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-21ab4e47.entry.js.map → p-536c5ef3.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-a4678661.entry.js.map → p-5a6c2efd.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-88e68e14.entry.js.map → p-6adb19cf.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-30d92734.entry.js.map → p-7c02e476.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-8072aa07.js.map → p-803a1695.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-855fe5b3.entry.js.map → p-83d2ff21.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-f83aa456.entry.js.map → p-8673dcf1.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-24c390bd.js.map → p-86e217f4.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-d0f51520.entry.js.map → p-8d5efa5e.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-0271cef3.entry.js.map → p-d7323440.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-59ff0231.entry.js.map → p-da25d877.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-f0e1688e.js.map → p-e42db60f.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-c11e1016.entry.js.map → p-ff122d1e.entry.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const utils = require('./utils-
|
|
3
|
+
const utils = require('./utils-e37da320.js');
|
|
4
4
|
|
|
5
5
|
class NylasAbstractProvider {
|
|
6
6
|
constructor(host, stores, automaticComponentRegistration = true, eventOverrides) {
|
|
@@ -281,4 +281,4 @@ class NylasBaseProvider extends NylasAbstractProvider {
|
|
|
281
281
|
|
|
282
282
|
exports.NylasBaseProvider = NylasBaseProvider;
|
|
283
283
|
|
|
284
|
-
//# sourceMappingURL=abstract-provider-
|
|
284
|
+
//# sourceMappingURL=abstract-provider-85a616a9.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"abstract-provider-b37458c4.js","mappings":";;;;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EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;qBAClK,CAAC,CAAC;iBACJ;aACF,CAAC,CAAC;SACJ,CAAC,CAAC;KACJ;IAKD,IAAY,WAAW;QACrB,OAAO,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,gBAAgB,CAAC;KAC9D;CACF;MAEY,iBAAgE,SAAQ,qBAAwB;;;;;","names":["debug","uniqueID","formatEventName"],"sources":["src/common/abstract-provider.ts"],"sourcesContent":["import { RegisteredComponent } from '@/common/register-component';\nimport { BaseNylasConnectorInterface } from '@/connector/connector-interface';\nimport { debug, formatEventName, uniqueID } from '@/utils/utils';\nimport { ObservableMap } from '@stencil/store';\nimport { EventOverride } from './component-types';\nimport { HTMLStencilElement } from '@stencil/core/internal';\n\nexport type PropKey = string | number | symbol;\nexport type StoreKey = string;\nexport type StoreName<T> = keyof T;\nexport type StateKey = string;\nexport type ElementID = string;\nexport type PropStateRegistration = { elementId: ElementID; propKey: PropKey };\nexport type EventListenerRegistration = [HTMLElement, PropKey, (event: CustomEvent<any>) => Promise<void>];\n\nexport interface NylasProviderInterface<Stores extends Record<string, ObservableMap<any>>> {\n nylasConnector?: BaseNylasConnectorInterface;\n stores: Stores;\n host?: HTMLElement;\n automaticComponentRegistration: boolean;\n registeredComponents: Record<ElementID, RegisteredComponent<any, any>>;\n propStateRegistrations: Map<StoreName<this['stores']>, Map<StateKey, PropStateRegistration[]>>;\n eventListenerRegistrations: Map<ElementID, EventListenerRegistration[]>;\n componentWillLoad(nylasConnector: BaseNylasConnectorInterface): Promise<void>;\n componentDidLoad(): Promise<void>;\n componentDisconnected(): Promise<void>;\n getStore<K extends keyof ThisType<this['stores']>>(name: K): ThisType<this['stores']>[K];\n registerComponent(component: RegisteredComponent<any, any>): void;\n unregisterComponent(component: RegisteredComponent<any, any>): void;\n}\n\nexport abstract class NylasAbstractProvider<Stores extends Record<string, ObservableMap<any>>> implements NylasProviderInterface<Stores> {\n /**\n * The NylasConnector instance.\n * This is used to provide access to the NylasConnector instance to all components.\n */\n public nylasConnector?: BaseNylasConnectorInterface;\n\n /**\n * A list of stores that are used by the provider.\n * This is used to provide access to the stores to all components.\n */\n public stores: Stores;\n\n /**\n * The host element.\n * Used to manage the host element of the provider.\n */\n public host!: HTMLElement;\n\n /**\n * Automatically register components that have the `@RegisterComponent` decorator.\n * If this is set to false, you will need to manually register components using the\n * `registerComponent` method.\n * @default true\n */\n public automaticComponentRegistration: boolean = true;\n\n /**\n * A list of registered components that are listening for store changes.\n * Each component is registered with a unique id so that we can easily track the component\n * for various other operations (see `propStateRegistrations` and `eventListenerRegistrations`).\n */\n public registeredComponents: Record<ElementID, RegisteredComponent<any, any>> = {};\n\n /**\n * A list of registered components that are listening for store changes.\n * To make lookups more efficient, we use a Map of our prop registrations that we need to map to differnet\n * state keys. When a component is unregistered, we can use this map to remove the prop registration.\n */\n public propStateRegistrations: Map<StoreName<this['stores']>, Map<StateKey, PropStateRegistration[]>> = new Map();\n\n /**\n * A list of registered event listeners.\n * To make lookups more efficient, we use a Map of our event listeners that we need to map to differnet\n * nylas connector methods. When a component is unregistered, we can use this map to remove the event listener.\n */\n public eventListenerRegistrations: Map<ElementID, EventListenerRegistration[]> = new Map();\n\n /**\n * A list of event overrides that are used by the provider.\n * This is used to provide an easy way to override the default function of the event emitter.\n * An example of this is the `timeslotConfirmed` event. By default, this event will set the scheduler store state for `showBookingForm` to `true` which will\n * show the booking form. However, if you want to override this behavior, you can pass in the prop `eventOverride` like:\n * ```html\n * <nylas-scheduler eventOverride={{\"timeslotConfirmed\": (event, nylasConnector) => { console.log(\"Timeslot confirmed event fired!\"); } }} />\n * ```\n */\n public eventOverrides: EventOverride<Exclude<BaseNylasConnectorInterface, undefined>>;\n\n /**\n * The constructor for the AbstractNylasProvider.\n * @param host The host element (usually the HTMLElement of the provider)\n * @param stores A list of stores that are used by the provider\n * @param automaticComponentRegistration A boolean that determines if components should be automatically registered\n * @param eventOverrides A list of event overrides that are used by the provider\n */\n constructor(host: HTMLElement, stores: Stores, automaticComponentRegistration: boolean = true, eventOverrides: EventOverride<any>) {\n this.host = host;\n this.stores = stores;\n this.automaticComponentRegistration = automaticComponentRegistration;\n this.eventOverrides = eventOverrides;\n\n debug(`[${this.hostTagName}] Initializing (abstract) provider.`, { eventOverrides });\n\n this.registerComponent = this.registerComponent.bind(this);\n this.getStore = this.getStore.bind(this);\n\n // Init propStateRegistrations with store names\n Object.keys(this.stores).forEach(storeName => {\n this.propStateRegistrations.set(storeName, new Map());\n });\n }\n\n /**\n * This method is called before the component is loaded.\n * We're passing the NylasConnector instance to the provider so that we can\n * provide access to the NylasConnector instance to all components.\n *\n * However, because the NylasConnector is often constructed after the component's\n * constructor is called, set the NylasConnector instance here.\n * @param nylasConnector The NylasConnector instance\n */\n async componentWillLoad(nylasConnector: BaseNylasConnectorInterface) {\n debug(`[${this.hostTagName}] Will load`);\n\n // For each of our stores, configure the listeners for changes in the\n // store state.\n this.setupStoreListeners();\n\n // Set the NylasConnector instance\n this.nylasConnector = nylasConnector;\n\n /**\n * This is a very static way of registering components, but it happens fairly\n * early in the component lifecycle, so it can be beneficial to do it here.\n *\n * The big downside to this is that it will not pick up any components that\n * are dynamically added to the DOM after this method is called.\n *\n * So we should evaluate if this is the best way to register components.\n */\n const childComponents = Array.from(this.host.querySelectorAll('*')).filter(child => child.tagName.toLowerCase().startsWith('nylas-'));\n debug(`[${this.hostTagName}] Found ${childComponents.length} child component(s).`, { childComponents });\n\n const registrations = childComponents.map(async child => {\n const component = child as any; // It unfortunately makes life a whole lot easier to just cast this to any\n if (!component) {\n debug(`[~${this.hostTagName}] (componentWillLoad) Component ${component.tagName} does not have a name. Skipping.`);\n return;\n }\n\n // Skip components that don't have the `registerNylasComponent` prop\n if (!component.registerNylasComponent) {\n debug(`[~${this.hostTagName}] (componentWillLoad) Component ${component.tagName} is not a component that can be registered. Skipping.`, { component });\n return;\n }\n\n const registeredComponent: RegisteredComponent<any, any> = {\n element: component as HTMLStencilElement,\n name: component.tagName.toLowerCase(),\n getStoresToProp: component.getStoresToProp,\n storeToProps: component.storeToProps,\n stateToProps: component.stateToProps,\n authToProp: component.authToProp,\n eventToProps: component.eventToProps,\n connectorToProp: component.connectorToProp,\n localPropsToProp: component.localPropsToProp,\n };\n\n await this.registerComponent(registeredComponent);\n });\n\n await Promise.all(registrations);\n }\n\n /**\n * This method is called after the component is loaded.\n * We're using this method to add event listeners to the host element.\n */\n async componentDidLoad() {\n debug(`[~${this.hostTagName}] (componentDidLoad) Did load`);\n }\n\n /**\n * This method is called when the component is disconnected from the DOM.\n * We're using this method to dispose of the stores.\n */\n async componentDisconnected() {\n // Loop through each store and and dispose\n Object.values(this.stores).forEach(store => {\n store.dispose();\n });\n }\n\n /**\n * This is a custom event handler that is used to register a component with the provider.\n * It is used by components that have the `@RegisterComponent` decorator.\n * @param event A custom event that contains the component to register\n * @returns Promise<void>\n */\n async registerComponentHandler(event: CustomEvent<RegisteredComponent<any, any>>): Promise<void> {\n event.stopPropagation();\n\n if (!this.automaticComponentRegistration) {\n debug(`~[${this.hostTagName}] (registerComponentHandler) Automatic component registration disabled. Skipping registration of ${event.detail.name}.`);\n return;\n }\n\n await this.registerComponent(event.detail);\n }\n\n /**\n * This is a custom event handler that is used to unregister a component with the provider.\n * It is used by components that have the `@RegisterComponent` decorator.\n * @param event A custom event that contains the component to unregister\n * @returns Promise<void>\n */\n async unregisterComponentHandler(event: CustomEvent<RegisteredComponent<any, any>>): Promise<void> {\n event.stopPropagation();\n\n if (!this.automaticComponentRegistration) {\n debug(`~[${this.hostTagName}] (unregisterComponentHandler) Automatic component registration disabled. Skipping unregistration of ${event.detail.name}.`);\n return;\n }\n\n this.unregisterComponent(event.detail);\n }\n\n /**\n * This method is used to register a component with the provider\n * @param component component to register\n * @returns void\n */\n public async registerComponent(component: RegisteredComponent<any, any>): Promise<void> {\n debug(`~[${this.hostTagName}] (registerComponent) Registering component ${component.name}.`);\n\n // Get component element id\n const elementId = component.element.dataset.nylasId;\n const isReregistration = elementId && this.registeredComponents[elementId];\n\n // If this is a re-registration, clean up previous registrations first\n if (isReregistration) {\n debug(`[${this.hostTagName}] (registerComponent) Component ${component.name} already registered. Updating registration.`);\n // Clean up event listeners but keep the component ID\n this.cleanupComponentRegistration(elementId, false);\n } else {\n // Set a unique data id on the element for new registrations\n component.element.dataset.nylasId = elementId || uniqueID();\n }\n\n // Register/update the component to ensure the component is tracked even while waiting for definition\n const nylasId = component.element.dataset.nylasId;\n if (nylasId) {\n this.registeredComponents[nylasId] = component;\n }\n\n // Wait for the component to be defined in the custom elements registry before we attempt to\n // complete the component registration. While this means that the component will not be loaded with\n // props immediately, it does ensure that when we do set the props, the component is ready to receive them.\n debug(`[${this.hostTagName}] (registerComponent) Waiting for \"${component.element.localName}\" component to be defined`, { component });\n try {\n await customElements.whenDefined(component.element.tagName.toLowerCase());\n debug(`[${this.hostTagName}] (registerComponent) Component \"${component.element.localName}\" is now defined`);\n } catch (error) {\n debug(`[${this.hostTagName}] (registerComponent) Error waiting for component \"${component.element.localName}\" to be defined:`, error);\n // Continue with registration anyway, as the component might be defined later\n }\n\n const eventOverrides = this.eventOverrides;\n const { stateToProps, getStoresToProp, eventToProps, storeToProps, connectorToProp, localPropsToProp, element } = component;\n\n /**\n * We allow components to map an event to a prop. These events can automatically\n * call a method on the nylasConnector instance.\n */\n eventToProps?.forEach((customEventHandler, propKey) => {\n const nylasConnector = this.nylasConnector;\n const handler = async (event: CustomEvent<any>) => {\n debug(`[${this.hostTagName}] (registerComponent) Handling \"${component.name}\" prop \"${String(propKey)}\" event.`, { event });\n if (propKey in eventOverrides) {\n debug(`[${this.hostTagName}] (registerComponent) Found event override for \"${String(propKey)}\" event. Calling override.`);\n await eventOverrides[propKey](event, nylasConnector);\n }\n\n if (!event.defaultPrevented) {\n await customEventHandler(event, nylasConnector);\n }\n\n return;\n };\n\n const elementId = component.element.dataset.nylasId;\n\n if (elementId && !this.eventListenerRegistrations.has(elementId)) {\n this.eventListenerRegistrations.set(elementId, []);\n }\n\n if (elementId) {\n this.eventListenerRegistrations.get(elementId)?.push([element, propKey, handler]);\n }\n\n debug(`[${this.hostTagName}] (registerComponent) Setting \"${component.name}\" event \"${String(propKey)}\" to automcially call NylasConnector method.`);\n\n // We should immediately call the event handler to make sure the prop is set\n const eventName = formatEventName(propKey.toString());\n debug(`[${this.hostTagName}] (registerComponent) Adding event listener for \"${eventName}\" on \"${element.tagName}\"`);\n element.addEventListener(eventName, handler as unknown as EventListener);\n });\n\n /**\n * This is a rather simple way for us to set the initial props for a component.\n * For each prop, we check if the prop is mapped to a store. If it is, we set\n * the prop to the store value.\n */\n stateToProps?.forEach((propKey, stateKey) => {\n const [storeName, stateName] = stateKey.split('.');\n const store = this.getStore(storeName as keyof typeof this.stores);\n const stateValue = store.state[stateName as keyof typeof store.state];\n\n // Make sure this component was registered and has a nylasId\n if (!element.dataset.nylasId) {\n debug(`[${this.hostTagName}] (registerComponent) Component \"${component.name}\" not registered. Skipping.`, { component });\n return;\n }\n\n // We need to keep track of the store and prop key so that we can update the\n // prop when the store changes\n if (!this.propStateRegistrations.has(storeName as keyof typeof this.stores)) {\n this.propStateRegistrations.set(storeName as keyof typeof this.stores, new Map());\n }\n\n if (!this.propStateRegistrations.get(storeName as keyof typeof this.stores)?.has(stateName)) {\n this.propStateRegistrations.get(storeName as keyof typeof this.stores)?.set(stateName, [\n {\n elementId: element.dataset.nylasId,\n propKey,\n },\n ]);\n } else {\n this.propStateRegistrations\n .get(storeName as keyof typeof this.stores)\n ?.get(stateName)\n ?.push({\n elementId: element.dataset.nylasId,\n propKey,\n });\n }\n\n // Set the prop value on the component\n (element as { [key: string]: any })[propKey.toString()] = stateValue;\n debug(`[${this.hostTagName}] Setting \"${component.name}\" prop \"${propKey.toString()}\" to \"${stateKey}\" value.`, { stateValue });\n });\n\n /**\n * We allow components to also map props from the provider to the component.\n */\n localPropsToProp?.forEach((propKey, value) => {\n const mappedPropValue = this.host[value]; // TODO: Is this safe? We should find a way to only limit it to public properties and no methods.\n (element as { [key: string]: any })[propKey.toString()] = mappedPropValue;\n debug(`[${this.hostTagName}] Setting \"${component.name}\" prop \"${propKey.toString()}\" to the value of \"${value}\" value.`, { value, mappedPropValue });\n });\n\n /**\n * We allow components to access the getStore method directly.\n */\n if (getStoresToProp) {\n (element as { [key: string]: any })[getStoresToProp?.toString()] = this.getStore;\n debug(`[${this.hostTagName}] Setting \"${component.name}\" prop \"${getStoresToProp.toString()}\" to \"getStore\" method.`);\n }\n\n /**\n * We allow components to map a store to a prop for direct access.\n */\n storeToProps?.forEach((propKey, storeKey) => {\n const store = this.getStore(storeKey);\n (element as { [key: string]: any })[propKey.toString()] = store;\n debug(`[${this.hostTagName}] Setting \"${component.name}\" prop \"${propKey.toString()}\" to \"${storeKey}\" store.`, { store });\n });\n\n /**\n * We allow components to map the NylasConnector instance to a prop for direct access.\n */\n if (connectorToProp) {\n (element as { [key: string]: any })[connectorToProp?.toString()] = this.nylasConnector;\n debug(`[${this.hostTagName}] Setting \"${component.name}\" prop \"${connectorToProp.toString()}\" to \"nylasConnector\" value.`, { connectorToProp });\n }\n\n /**\n * We allow components to fire an event when they are registered.\n */\n if (typeof element.registerCallback === 'function') {\n debug(`[${this.hostTagName}] (registerComponent) Calling registerCallback method for \"${component.name}\".`);\n await element.registerCallback();\n }\n\n debug(`[${this.hostTagName}] (registerComponent) Component ${component.name} registered.`);\n }\n\n /**\n * Cleans up registrations for a component without fully unregistering it\n * @param elementId The ID of the element to clean up\n * @param removeFromRegistry Whether to remove the component from the registry\n */\n private cleanupComponentRegistration(elementId: string, removeFromRegistry: boolean = true): void {\n // Remove event listeners\n const eventListenerRegistrations = this.eventListenerRegistrations.get(elementId);\n if (eventListenerRegistrations) {\n eventListenerRegistrations.forEach(([element, propKey, handler]) => {\n const eventName = formatEventName(propKey.toString());\n debug(`[${this.hostTagName}] (cleanupComponentRegistration) Removing event listener for \"${eventName}\" on \"${element.tagName}\"`);\n element.removeEventListener(eventName, handler as unknown as EventListener);\n });\n this.eventListenerRegistrations.delete(elementId);\n }\n\n // Clean up prop state registrations\n this.propStateRegistrations.forEach((stateToProps, storeName) => {\n stateToProps.forEach((props, stateKey) => {\n const filteredProps = props.filter(prop => prop.elementId !== elementId);\n if (filteredProps.length !== props.length) {\n this.propStateRegistrations.get(storeName)?.set(stateKey, filteredProps);\n }\n });\n });\n\n // Remove from registry if requested\n if (removeFromRegistry) {\n delete this.registeredComponents[elementId];\n }\n }\n\n /**\n * This is a method that is used to unregister a component with the provider.\n * @param component HTMLElement to unregister\n * @returns void\n */\n public unregisterComponent(component: RegisteredComponent<any, any>): void {\n debug(`[${this.hostTagName}] Unregistering component ${component.name}.`);\n\n // Get component element id\n const elementId = component.element.dataset.nylasId;\n if (!elementId) {\n debug(`[${this.hostTagName}] (unregisterComponent) Unregistering component ${component.name}.`);\n return;\n }\n\n // Make sure the component is not already registered\n if (this.registeredComponents[elementId]) {\n debug(`[${this.hostTagName}] (unregisterComponent) Component ${component.name} not registered. Skipping.`);\n return;\n }\n\n // Remove the component prop registration from propStateRegistrations\n this.propStateRegistrations.forEach((stateToProps, storeName) => {\n stateToProps.forEach((_, stateKey) => {\n const props = this.propStateRegistrations.get(storeName)?.get(stateKey);\n const filteredProps = props?.filter(prop => prop.elementId !== elementId);\n if (filteredProps) {\n this.propStateRegistrations.get(storeName)?.set(stateKey, filteredProps);\n }\n });\n });\n\n // Before we unregister the component, we need to remove any event listeners\n const eventListenerRegistrations = this.eventListenerRegistrations.get(elementId);\n eventListenerRegistrations?.forEach(([element, propKey, handler]) => {\n const eventName = formatEventName(propKey.toString());\n debug(`[${this.hostTagName}] (unregisterComponent) Removing event listener for \"${eventName}\" on \"${element.tagName}\"`);\n element.removeEventListener(eventName, handler as unknown as EventListener);\n });\n\n // Unregister the component\n delete this.registeredComponents[elementId];\n }\n\n /**\n * This method is used to dynamically retrieve the appropriate store\n * @param name store name\n */\n public getStore<K extends keyof Stores>(name: K): Stores[K] {\n const store = this.stores[name];\n if (!store) {\n throw new Error(`[${this.hostTagName}] Store \"${name.toString()}\" not found.`);\n }\n return store;\n }\n\n /**\n * This method is called when the component is connected to the DOM.\n * We're using this method to listen for changes in the store and update\n * the registered components with the new values.\n */\n private async setupStoreListeners() {\n const self = this; // eslint-disable-line @typescript-eslint/no-this-alias\n\n /**\n * This is a rather simple way for us to listen for changes in the store\n * and make sure our registered components are updated with the new values.\n *\n * For each store change, we loop through each registered component and\n * check if the store change is mapped to a prop on the component. If it is,\n * we set the prop to the new value.\n *\n * We call this super early in the provider lifecycle so that we can make sure\n * that all components have the correct props before they are rendered.\n */\n Object.entries(this.stores).forEach(([storeName, store]) => {\n debug(`[${self.hostTagName}] (setupStoreListeners) Listening for changes in \"${storeName}\" store.`);\n store.use({\n set(stateKey, newValue, oldValue) {\n debug(`[${self.hostTagName}] (setupStoreListeners) Store \"${storeName}\" state \"${stateKey.toString()}\" changed`, { newValue, oldValue });\n if (newValue === oldValue) {\n debug(`[${self.hostTagName}] (setupStoreListeners) Store \"${storeName}\" state \"${stateKey.toString()}\" unchanged. Skipping.`);\n return;\n }\n\n const registeredComponents = self.registeredComponents;\n if (!registeredComponents) {\n debug(`[${self.hostTagName}] (setupStoreListeners) No registered components found. Skipping.`);\n return;\n }\n\n // Get our prop registrations for this store\n const props = self.propStateRegistrations.get(storeName as keyof typeof self.stores as string)?.get(stateKey.toString()) || [];\n debug(`[${self.hostTagName}] (setupStoreListeners) Found ${props.length} prop(s) registered for \"${stateKey.toString()}\" store.`, {\n props,\n propStateRegistrations: self.propStateRegistrations,\n });\n\n // Loop through each registered component and update the prop\n props.forEach(({ elementId, propKey }) => {\n const component = registeredComponents[elementId];\n if (!component) {\n debug(`[${self.hostTagName}] (setupStoreListeners) Component \"${elementId}\" not found. Skipping.`, { component });\n return;\n }\n\n // Get the appropriate store\n const loadedStore = self.getStore(storeName as keyof typeof self.stores as string);\n const stateValue = loadedStore.state[stateKey as unknown as keyof typeof loadedStore.state];\n (component.element as { [key: string]: any })[propKey.toString()] = stateValue;\n debug(`[${self.hostTagName}] (setupStoreListeners) Setting \"${component.name}\" prop \"${propKey.toString()}\" to \"${stateKey.toString()}\" value.`, { stateValue });\n });\n },\n });\n });\n }\n\n /**\n * Simple getter for the host element tag name.\n */\n private get hostTagName(): string {\n return this.host?.tagName?.toLowerCase() ?? 'nylas-provider';\n }\n}\n\nexport class NylasBaseProvider<T extends Record<string, ObservableMap<any>>> extends NylasAbstractProvider<T> {}\n"],"version":3}
|
|
1
|
+
{"file":"abstract-provider-85a616a9.js","mappings":";;;;MA+BsB,qBAAqB;IAkEzC,YAAY,IAAiB,EAAE,MAAc,EAAE,iCAA0C,IAAI,EAAE,cAAkC;QAzC1H,mCAA8B,GAAY,IAAI,CAAC;QAO/C,yBAAoB,GAAqD,EAAE,CAAC;QAO5E,2BAAsB,GAA2E,IAAI,GAAG,EAAE,CAAC;QAO3G,+BAA0B,GAAgD,IAAI,GAAG,EAAE,CAAC;QAqBzF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,8BAA8B,GAAG,8BAA8B,CAAC;QACrE,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QAErCA,WAAK,CAAC,IAAI,IAAI,CAAC,WAAW,qCAAqC,EAAE,EAAE,cAAc,EAAE,CAAC,CAAC;QAErF,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3D,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAGzC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,SAAS;YACxC,IAAI,CAAC,sBAAsB,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;SACvD,CAAC,CAAC;KACJ;IAWD,MAAM,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AG,IAAI,CAAC,QAAQ,CAAC,SAA+C,CAAC,CAAC;wBACnF,MAAM,UAAU,GAAG,WAAW,CAAC,KAAK,CAAC,QAAqD,CAAC,CAAC;wBAC3F,SAAS,CAAC,OAAkC,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,GAAG,UAAU,CAAC;wBAC/EA,WAAK,CAAC,IAAI,IAAI,CAAC,WAAW,oCAAoC,SAAS,CAAC,IAAI,WAAW,OAAO,CAAC,QAAQ,EAAE,SAAS,QAAQ,CAAC,QAAQ,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;qBAClK,CAAC,CAAC;iBACJ;aACF,CAAC,CAAC;SACJ,CAAC,CAAC;KACJ;IAKD,IAAY,WAAW;QACrB,OAAO,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,gBAAgB,CAAC;KAC9D;CACF;MAEY,iBAAgE,SAAQ,qBAAwB;;;;;","names":["debug","uniqueID","formatEventName"],"sources":["src/common/abstract-provider.ts"],"sourcesContent":["import { RegisteredComponent } from '@/common/register-component';\nimport { BaseNylasConnectorInterface } from '@/connector/connector-interface';\nimport { debug, formatEventName, uniqueID } from '@/utils/utils';\nimport { ObservableMap } from '@stencil/store';\nimport { EventOverride } from './component-types';\nimport { HTMLStencilElement } from '@stencil/core/internal';\n\nexport type PropKey = string | number | symbol;\nexport type StoreKey = string;\nexport type StoreName<T> = keyof T;\nexport type StateKey = string;\nexport type ElementID = string;\nexport type PropStateRegistration = { elementId: ElementID; propKey: PropKey };\nexport type EventListenerRegistration = [HTMLElement, PropKey, (event: CustomEvent<any>) => Promise<void>];\n\nexport interface NylasProviderInterface<Stores extends Record<string, ObservableMap<any>>> {\n nylasConnector?: BaseNylasConnectorInterface;\n stores: Stores;\n host?: HTMLElement;\n automaticComponentRegistration: boolean;\n registeredComponents: Record<ElementID, RegisteredComponent<any, any>>;\n propStateRegistrations: Map<StoreName<this['stores']>, Map<StateKey, PropStateRegistration[]>>;\n eventListenerRegistrations: Map<ElementID, EventListenerRegistration[]>;\n componentWillLoad(nylasConnector: BaseNylasConnectorInterface): Promise<void>;\n componentDidLoad(): Promise<void>;\n componentDisconnected(): Promise<void>;\n getStore<K extends keyof ThisType<this['stores']>>(name: K): ThisType<this['stores']>[K];\n registerComponent(component: RegisteredComponent<any, any>): void;\n unregisterComponent(component: RegisteredComponent<any, any>): void;\n}\n\nexport abstract class NylasAbstractProvider<Stores extends Record<string, ObservableMap<any>>> implements NylasProviderInterface<Stores> {\n /**\n * The NylasConnector instance.\n * This is used to provide access to the NylasConnector instance to all components.\n */\n public nylasConnector?: BaseNylasConnectorInterface;\n\n /**\n * A list of stores that are used by the provider.\n * This is used to provide access to the stores to all components.\n */\n public stores: Stores;\n\n /**\n * The host element.\n * Used to manage the host element of the provider.\n */\n public host!: HTMLElement;\n\n /**\n * Automatically register components that have the `@RegisterComponent` decorator.\n * If this is set to false, you will need to manually register components using the\n * `registerComponent` method.\n * @default true\n */\n public automaticComponentRegistration: boolean = true;\n\n /**\n * A list of registered components that are listening for store changes.\n * Each component is registered with a unique id so that we can easily track the component\n * for various other operations (see `propStateRegistrations` and `eventListenerRegistrations`).\n */\n public registeredComponents: Record<ElementID, RegisteredComponent<any, any>> = {};\n\n /**\n * A list of registered components that are listening for store changes.\n * To make lookups more efficient, we use a Map of our prop registrations that we need to map to differnet\n * state keys. When a component is unregistered, we can use this map to remove the prop registration.\n */\n public propStateRegistrations: Map<StoreName<this['stores']>, Map<StateKey, PropStateRegistration[]>> = new Map();\n\n /**\n * A list of registered event listeners.\n * To make lookups more efficient, we use a Map of our event listeners that we need to map to differnet\n * nylas connector methods. When a component is unregistered, we can use this map to remove the event listener.\n */\n public eventListenerRegistrations: Map<ElementID, EventListenerRegistration[]> = new Map();\n\n /**\n * A list of event overrides that are used by the provider.\n * This is used to provide an easy way to override the default function of the event emitter.\n * An example of this is the `timeslotConfirmed` event. By default, this event will set the scheduler store state for `showBookingForm` to `true` which will\n * show the booking form. However, if you want to override this behavior, you can pass in the prop `eventOverride` like:\n * ```html\n * <nylas-scheduler eventOverride={{\"timeslotConfirmed\": (event, nylasConnector) => { console.log(\"Timeslot confirmed event fired!\"); } }} />\n * ```\n */\n public eventOverrides: EventOverride<Exclude<BaseNylasConnectorInterface, undefined>>;\n\n /**\n * The constructor for the AbstractNylasProvider.\n * @param host The host element (usually the HTMLElement of the provider)\n * @param stores A list of stores that are used by the provider\n * @param automaticComponentRegistration A boolean that determines if components should be automatically registered\n * @param eventOverrides A list of event overrides that are used by the provider\n */\n constructor(host: HTMLElement, stores: Stores, automaticComponentRegistration: boolean = true, eventOverrides: EventOverride<any>) {\n this.host = host;\n this.stores = stores;\n this.automaticComponentRegistration = automaticComponentRegistration;\n this.eventOverrides = eventOverrides;\n\n debug(`[${this.hostTagName}] Initializing (abstract) provider.`, { eventOverrides });\n\n this.registerComponent = this.registerComponent.bind(this);\n this.getStore = this.getStore.bind(this);\n\n // Init propStateRegistrations with store names\n Object.keys(this.stores).forEach(storeName => {\n this.propStateRegistrations.set(storeName, new Map());\n });\n }\n\n /**\n * This method is called before the component is loaded.\n * We're passing the NylasConnector instance to the provider so that we can\n * provide access to the NylasConnector instance to all components.\n *\n * However, because the NylasConnector is often constructed after the component's\n * constructor is called, set the NylasConnector instance here.\n * @param nylasConnector The NylasConnector instance\n */\n async componentWillLoad(nylasConnector: BaseNylasConnectorInterface) {\n debug(`[${this.hostTagName}] Will load`);\n\n // For each of our stores, configure the listeners for changes in the\n // store state.\n this.setupStoreListeners();\n\n // Set the NylasConnector instance\n this.nylasConnector = nylasConnector;\n\n /**\n * This is a very static way of registering components, but it happens fairly\n * early in the component lifecycle, so it can be beneficial to do it here.\n *\n * The big downside to this is that it will not pick up any components that\n * are dynamically added to the DOM after this method is called.\n *\n * So we should evaluate if this is the best way to register components.\n */\n const childComponents = Array.from(this.host.querySelectorAll('*')).filter(child => child.tagName.toLowerCase().startsWith('nylas-'));\n debug(`[${this.hostTagName}] Found ${childComponents.length} child component(s).`, { childComponents });\n\n const registrations = childComponents.map(async child => {\n const component = child as any; // It unfortunately makes life a whole lot easier to just cast this to any\n if (!component) {\n debug(`[~${this.hostTagName}] (componentWillLoad) Component ${component.tagName} does not have a name. Skipping.`);\n return;\n }\n\n // Skip components that don't have the `registerNylasComponent` prop\n if (!component.registerNylasComponent) {\n debug(`[~${this.hostTagName}] (componentWillLoad) Component ${component.tagName} is not a component that can be registered. Skipping.`, { component });\n return;\n }\n\n const registeredComponent: RegisteredComponent<any, any> = {\n element: component as HTMLStencilElement,\n name: component.tagName.toLowerCase(),\n getStoresToProp: component.getStoresToProp,\n storeToProps: component.storeToProps,\n stateToProps: component.stateToProps,\n authToProp: component.authToProp,\n eventToProps: component.eventToProps,\n connectorToProp: component.connectorToProp,\n localPropsToProp: component.localPropsToProp,\n };\n\n await this.registerComponent(registeredComponent);\n });\n\n await Promise.all(registrations);\n }\n\n /**\n * This method is called after the component is loaded.\n * We're using this method to add event listeners to the host element.\n */\n async componentDidLoad() {\n debug(`[~${this.hostTagName}] (componentDidLoad) Did load`);\n }\n\n /**\n * This method is called when the component is disconnected from the DOM.\n * We're using this method to dispose of the stores.\n */\n async componentDisconnected() {\n // Loop through each store and and dispose\n Object.values(this.stores).forEach(store => {\n store.dispose();\n });\n }\n\n /**\n * This is a custom event handler that is used to register a component with the provider.\n * It is used by components that have the `@RegisterComponent` decorator.\n * @param event A custom event that contains the component to register\n * @returns Promise<void>\n */\n async registerComponentHandler(event: CustomEvent<RegisteredComponent<any, any>>): Promise<void> {\n event.stopPropagation();\n\n if (!this.automaticComponentRegistration) {\n debug(`~[${this.hostTagName}] (registerComponentHandler) Automatic component registration disabled. Skipping registration of ${event.detail.name}.`);\n return;\n }\n\n await this.registerComponent(event.detail);\n }\n\n /**\n * This is a custom event handler that is used to unregister a component with the provider.\n * It is used by components that have the `@RegisterComponent` decorator.\n * @param event A custom event that contains the component to unregister\n * @returns Promise<void>\n */\n async unregisterComponentHandler(event: CustomEvent<RegisteredComponent<any, any>>): Promise<void> {\n event.stopPropagation();\n\n if (!this.automaticComponentRegistration) {\n debug(`~[${this.hostTagName}] (unregisterComponentHandler) Automatic component registration disabled. Skipping unregistration of ${event.detail.name}.`);\n return;\n }\n\n this.unregisterComponent(event.detail);\n }\n\n /**\n * This method is used to register a component with the provider\n * @param component component to register\n * @returns void\n */\n public async registerComponent(component: RegisteredComponent<any, any>): Promise<void> {\n debug(`~[${this.hostTagName}] (registerComponent) Registering component ${component.name}.`);\n\n // Get component element id\n const elementId = component.element.dataset.nylasId;\n const isReregistration = elementId && this.registeredComponents[elementId];\n\n // If this is a re-registration, clean up previous registrations first\n if (isReregistration) {\n debug(`[${this.hostTagName}] (registerComponent) Component ${component.name} already registered. Updating registration.`);\n // Clean up event listeners but keep the component ID\n this.cleanupComponentRegistration(elementId, false);\n } else {\n // Set a unique data id on the element for new registrations\n component.element.dataset.nylasId = elementId || uniqueID();\n }\n\n // Register/update the component to ensure the component is tracked even while waiting for definition\n const nylasId = component.element.dataset.nylasId;\n if (nylasId) {\n this.registeredComponents[nylasId] = component;\n }\n\n // Wait for the component to be defined in the custom elements registry before we attempt to\n // complete the component registration. While this means that the component will not be loaded with\n // props immediately, it does ensure that when we do set the props, the component is ready to receive them.\n debug(`[${this.hostTagName}] (registerComponent) Waiting for \"${component.element.localName}\" component to be defined`, { component });\n try {\n await customElements.whenDefined(component.element.tagName.toLowerCase());\n debug(`[${this.hostTagName}] (registerComponent) Component \"${component.element.localName}\" is now defined`);\n } catch (error) {\n debug(`[${this.hostTagName}] (registerComponent) Error waiting for component \"${component.element.localName}\" to be defined:`, error);\n // Continue with registration anyway, as the component might be defined later\n }\n\n const eventOverrides = this.eventOverrides;\n const { stateToProps, getStoresToProp, eventToProps, storeToProps, connectorToProp, localPropsToProp, element } = component;\n\n /**\n * We allow components to map an event to a prop. These events can automatically\n * call a method on the nylasConnector instance.\n */\n eventToProps?.forEach((customEventHandler, propKey) => {\n const nylasConnector = this.nylasConnector;\n const handler = async (event: CustomEvent<any>) => {\n debug(`[${this.hostTagName}] (registerComponent) Handling \"${component.name}\" prop \"${String(propKey)}\" event.`, { event });\n if (propKey in eventOverrides) {\n debug(`[${this.hostTagName}] (registerComponent) Found event override for \"${String(propKey)}\" event. Calling override.`);\n await eventOverrides[propKey](event, nylasConnector);\n }\n\n if (!event.defaultPrevented) {\n await customEventHandler(event, nylasConnector);\n }\n\n return;\n };\n\n const elementId = component.element.dataset.nylasId;\n\n if (elementId && !this.eventListenerRegistrations.has(elementId)) {\n this.eventListenerRegistrations.set(elementId, []);\n }\n\n if (elementId) {\n this.eventListenerRegistrations.get(elementId)?.push([element, propKey, handler]);\n }\n\n debug(`[${this.hostTagName}] (registerComponent) Setting \"${component.name}\" event \"${String(propKey)}\" to automcially call NylasConnector method.`);\n\n // We should immediately call the event handler to make sure the prop is set\n const eventName = formatEventName(propKey.toString());\n debug(`[${this.hostTagName}] (registerComponent) Adding event listener for \"${eventName}\" on \"${element.tagName}\"`);\n element.addEventListener(eventName, handler as unknown as EventListener);\n });\n\n /**\n * This is a rather simple way for us to set the initial props for a component.\n * For each prop, we check if the prop is mapped to a store. If it is, we set\n * the prop to the store value.\n */\n stateToProps?.forEach((propKey, stateKey) => {\n const [storeName, stateName] = stateKey.split('.');\n const store = this.getStore(storeName as keyof typeof this.stores);\n const stateValue = store.state[stateName as keyof typeof store.state];\n\n // Make sure this component was registered and has a nylasId\n if (!element.dataset.nylasId) {\n debug(`[${this.hostTagName}] (registerComponent) Component \"${component.name}\" not registered. Skipping.`, { component });\n return;\n }\n\n // We need to keep track of the store and prop key so that we can update the\n // prop when the store changes\n if (!this.propStateRegistrations.has(storeName as keyof typeof this.stores)) {\n this.propStateRegistrations.set(storeName as keyof typeof this.stores, new Map());\n }\n\n if (!this.propStateRegistrations.get(storeName as keyof typeof this.stores)?.has(stateName)) {\n this.propStateRegistrations.get(storeName as keyof typeof this.stores)?.set(stateName, [\n {\n elementId: element.dataset.nylasId,\n propKey,\n },\n ]);\n } else {\n this.propStateRegistrations\n .get(storeName as keyof typeof this.stores)\n ?.get(stateName)\n ?.push({\n elementId: element.dataset.nylasId,\n propKey,\n });\n }\n\n // Set the prop value on the component\n (element as { [key: string]: any })[propKey.toString()] = stateValue;\n debug(`[${this.hostTagName}] Setting \"${component.name}\" prop \"${propKey.toString()}\" to \"${stateKey}\" value.`, { stateValue });\n });\n\n /**\n * We allow components to also map props from the provider to the component.\n */\n localPropsToProp?.forEach((propKey, value) => {\n const mappedPropValue = this.host[value]; // TODO: Is this safe? We should find a way to only limit it to public properties and no methods.\n (element as { [key: string]: any })[propKey.toString()] = mappedPropValue;\n debug(`[${this.hostTagName}] Setting \"${component.name}\" prop \"${propKey.toString()}\" to the value of \"${value}\" value.`, { value, mappedPropValue });\n });\n\n /**\n * We allow components to access the getStore method directly.\n */\n if (getStoresToProp) {\n (element as { [key: string]: any })[getStoresToProp?.toString()] = this.getStore;\n debug(`[${this.hostTagName}] Setting \"${component.name}\" prop \"${getStoresToProp.toString()}\" to \"getStore\" method.`);\n }\n\n /**\n * We allow components to map a store to a prop for direct access.\n */\n storeToProps?.forEach((propKey, storeKey) => {\n const store = this.getStore(storeKey);\n (element as { [key: string]: any })[propKey.toString()] = store;\n debug(`[${this.hostTagName}] Setting \"${component.name}\" prop \"${propKey.toString()}\" to \"${storeKey}\" store.`, { store });\n });\n\n /**\n * We allow components to map the NylasConnector instance to a prop for direct access.\n */\n if (connectorToProp) {\n (element as { [key: string]: any })[connectorToProp?.toString()] = this.nylasConnector;\n debug(`[${this.hostTagName}] Setting \"${component.name}\" prop \"${connectorToProp.toString()}\" to \"nylasConnector\" value.`, { connectorToProp });\n }\n\n /**\n * We allow components to fire an event when they are registered.\n */\n if (typeof element.registerCallback === 'function') {\n debug(`[${this.hostTagName}] (registerComponent) Calling registerCallback method for \"${component.name}\".`);\n await element.registerCallback();\n }\n\n debug(`[${this.hostTagName}] (registerComponent) Component ${component.name} registered.`);\n }\n\n /**\n * Cleans up registrations for a component without fully unregistering it\n * @param elementId The ID of the element to clean up\n * @param removeFromRegistry Whether to remove the component from the registry\n */\n private cleanupComponentRegistration(elementId: string, removeFromRegistry: boolean = true): void {\n // Remove event listeners\n const eventListenerRegistrations = this.eventListenerRegistrations.get(elementId);\n if (eventListenerRegistrations) {\n eventListenerRegistrations.forEach(([element, propKey, handler]) => {\n const eventName = formatEventName(propKey.toString());\n debug(`[${this.hostTagName}] (cleanupComponentRegistration) Removing event listener for \"${eventName}\" on \"${element.tagName}\"`);\n element.removeEventListener(eventName, handler as unknown as EventListener);\n });\n this.eventListenerRegistrations.delete(elementId);\n }\n\n // Clean up prop state registrations\n this.propStateRegistrations.forEach((stateToProps, storeName) => {\n stateToProps.forEach((props, stateKey) => {\n const filteredProps = props.filter(prop => prop.elementId !== elementId);\n if (filteredProps.length !== props.length) {\n this.propStateRegistrations.get(storeName)?.set(stateKey, filteredProps);\n }\n });\n });\n\n // Remove from registry if requested\n if (removeFromRegistry) {\n delete this.registeredComponents[elementId];\n }\n }\n\n /**\n * This is a method that is used to unregister a component with the provider.\n * @param component HTMLElement to unregister\n * @returns void\n */\n public unregisterComponent(component: RegisteredComponent<any, any>): void {\n debug(`[${this.hostTagName}] Unregistering component ${component.name}.`);\n\n // Get component element id\n const elementId = component.element.dataset.nylasId;\n if (!elementId) {\n debug(`[${this.hostTagName}] (unregisterComponent) Unregistering component ${component.name}.`);\n return;\n }\n\n // Make sure the component is not already registered\n if (this.registeredComponents[elementId]) {\n debug(`[${this.hostTagName}] (unregisterComponent) Component ${component.name} not registered. Skipping.`);\n return;\n }\n\n // Remove the component prop registration from propStateRegistrations\n this.propStateRegistrations.forEach((stateToProps, storeName) => {\n stateToProps.forEach((_, stateKey) => {\n const props = this.propStateRegistrations.get(storeName)?.get(stateKey);\n const filteredProps = props?.filter(prop => prop.elementId !== elementId);\n if (filteredProps) {\n this.propStateRegistrations.get(storeName)?.set(stateKey, filteredProps);\n }\n });\n });\n\n // Before we unregister the component, we need to remove any event listeners\n const eventListenerRegistrations = this.eventListenerRegistrations.get(elementId);\n eventListenerRegistrations?.forEach(([element, propKey, handler]) => {\n const eventName = formatEventName(propKey.toString());\n debug(`[${this.hostTagName}] (unregisterComponent) Removing event listener for \"${eventName}\" on \"${element.tagName}\"`);\n element.removeEventListener(eventName, handler as unknown as EventListener);\n });\n\n // Unregister the component\n delete this.registeredComponents[elementId];\n }\n\n /**\n * This method is used to dynamically retrieve the appropriate store\n * @param name store name\n */\n public getStore<K extends keyof Stores>(name: K): Stores[K] {\n const store = this.stores[name];\n if (!store) {\n throw new Error(`[${this.hostTagName}] Store \"${name.toString()}\" not found.`);\n }\n return store;\n }\n\n /**\n * This method is called when the component is connected to the DOM.\n * We're using this method to listen for changes in the store and update\n * the registered components with the new values.\n */\n private async setupStoreListeners() {\n const self = this; // eslint-disable-line @typescript-eslint/no-this-alias\n\n /**\n * This is a rather simple way for us to listen for changes in the store\n * and make sure our registered components are updated with the new values.\n *\n * For each store change, we loop through each registered component and\n * check if the store change is mapped to a prop on the component. If it is,\n * we set the prop to the new value.\n *\n * We call this super early in the provider lifecycle so that we can make sure\n * that all components have the correct props before they are rendered.\n */\n Object.entries(this.stores).forEach(([storeName, store]) => {\n debug(`[${self.hostTagName}] (setupStoreListeners) Listening for changes in \"${storeName}\" store.`);\n store.use({\n set(stateKey, newValue, oldValue) {\n debug(`[${self.hostTagName}] (setupStoreListeners) Store \"${storeName}\" state \"${stateKey.toString()}\" changed`, { newValue, oldValue });\n if (newValue === oldValue) {\n debug(`[${self.hostTagName}] (setupStoreListeners) Store \"${storeName}\" state \"${stateKey.toString()}\" unchanged. Skipping.`);\n return;\n }\n\n const registeredComponents = self.registeredComponents;\n if (!registeredComponents) {\n debug(`[${self.hostTagName}] (setupStoreListeners) No registered components found. Skipping.`);\n return;\n }\n\n // Get our prop registrations for this store\n const props = self.propStateRegistrations.get(storeName as keyof typeof self.stores as string)?.get(stateKey.toString()) || [];\n debug(`[${self.hostTagName}] (setupStoreListeners) Found ${props.length} prop(s) registered for \"${stateKey.toString()}\" store.`, {\n props,\n propStateRegistrations: self.propStateRegistrations,\n });\n\n // Loop through each registered component and update the prop\n props.forEach(({ elementId, propKey }) => {\n const component = registeredComponents[elementId];\n if (!component) {\n debug(`[${self.hostTagName}] (setupStoreListeners) Component \"${elementId}\" not found. Skipping.`, { component });\n return;\n }\n\n // Get the appropriate store\n const loadedStore = self.getStore(storeName as keyof typeof self.stores as string);\n const stateValue = loadedStore.state[stateKey as unknown as keyof typeof loadedStore.state];\n (component.element as { [key: string]: any })[propKey.toString()] = stateValue;\n debug(`[${self.hostTagName}] (setupStoreListeners) Setting \"${component.name}\" prop \"${propKey.toString()}\" to \"${stateKey.toString()}\" value.`, { stateValue });\n });\n },\n });\n });\n }\n\n /**\n * Simple getter for the host element tag name.\n */\n private get hostTagName(): string {\n return this.host?.tagName?.toLowerCase() ?? 'nylas-provider';\n }\n}\n\nexport class NylasBaseProvider<T extends Record<string, ObservableMap<any>>> extends NylasAbstractProvider<T> {}\n"],"version":3}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index$1 = require('./index-e07e3a7e.js');
|
|
6
|
-
const registerComponent = require('./register-component-
|
|
7
|
-
const utils = require('./utils-
|
|
6
|
+
const registerComponent = require('./register-component-2eefbf66.js');
|
|
7
|
+
const utils = require('./utils-e37da320.js');
|
|
8
8
|
const constants = require('./constants-27331d2d.js');
|
|
9
9
|
|
|
10
10
|
const iconCss$9 = ".sc-calendar-agenda-fill-icon-h{display:flex}";
|
|
@@ -7281,21 +7281,21 @@ const NylasParticipantsCustomAvailability = class {
|
|
|
7281
7281
|
: this.selectedConfiguration?.availability?.availability_rules?.default_open_hours?.at(0)?.timezone ||
|
|
7282
7282
|
this.selectedConfiguration?.event_booking?.timezone ||
|
|
7283
7283
|
window.Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
7284
|
-
const
|
|
7285
|
-
const
|
|
7284
|
+
const existingSpecificTimeAvailability = existingParticipant?.specific_time_availability || [];
|
|
7285
|
+
const specificTimesAvailability = existingSpecificTimeAvailability?.length > 0 ? existingSpecificTimeAvailability : [];
|
|
7286
7286
|
this.selectedParticipants[event.detail.name]['isOpen'] = event.detail.checked;
|
|
7287
7287
|
this.selectedParticipants[event.detail.name]['tab'] = 'availability';
|
|
7288
7288
|
this.selectedParticipants[event.detail.name]['setCustom'] = event.detail.checked;
|
|
7289
7289
|
this.selectedParticipants[event.detail.name]['openHours'] = event.detail.checked ? (openHours?.length > 0 ? openHours : constants.DEFAULT_OPEN_HOURS) : [];
|
|
7290
7290
|
this.selectedParticipants[event.detail.name]['timezone'] = event.detail.checked ? timeZone : undefined;
|
|
7291
|
-
this.selectedParticipants[event.detail.name]['
|
|
7291
|
+
this.selectedParticipants[event.detail.name]['specificTimesAvailability'] = event.detail.checked ? specificTimesAvailability : [];
|
|
7292
7292
|
this.selectedParticipants = { ...this.selectedParticipants };
|
|
7293
7293
|
this.updateFormValue();
|
|
7294
7294
|
}
|
|
7295
7295
|
handleValueChanged(event) {
|
|
7296
7296
|
utils.debug('[nylas-editor-tabs]', 'handleValueChanged', event);
|
|
7297
7297
|
const { name, value } = event.detail;
|
|
7298
|
-
if (!name.startsWith('participant-availability-') && !name.startsWith('participant-specific-
|
|
7298
|
+
if (!name.startsWith('participant-availability-') && !name.startsWith('participant-specific-time-availability-')) {
|
|
7299
7299
|
return;
|
|
7300
7300
|
}
|
|
7301
7301
|
let jsonValue;
|
|
@@ -7329,33 +7329,33 @@ const NylasParticipantsCustomAvailability = class {
|
|
|
7329
7329
|
this.selectedParticipants[key]['openHours'] = openHours;
|
|
7330
7330
|
this.selectedParticipants[key]['tab'] = 'availability';
|
|
7331
7331
|
}
|
|
7332
|
-
else if (name.startsWith('participant-specific-
|
|
7332
|
+
else if (name.startsWith('participant-specific-time-availability')) {
|
|
7333
7333
|
const nameParts = name.split('-');
|
|
7334
7334
|
if (nameParts.length < 6) {
|
|
7335
|
-
console.warn(`Malformed participant specific date name format: ${name}. Expected format: "participant-specific-
|
|
7335
|
+
console.warn(`Malformed participant specific date name format: ${name}. Expected format: "participant-specific-time-availability-{index}-{uniqueKey}"`);
|
|
7336
7336
|
return;
|
|
7337
7337
|
}
|
|
7338
7338
|
const key = nameParts[5];
|
|
7339
7339
|
if (!this.selectedParticipants[key])
|
|
7340
7340
|
return;
|
|
7341
|
-
const
|
|
7342
|
-
this.selectedParticipants[key]['
|
|
7343
|
-
this.selectedParticipants[key]['tab'] = 'specific-
|
|
7341
|
+
const existingSpecificTimeAvailability = jsonValue || [];
|
|
7342
|
+
this.selectedParticipants[key]['specificTimesAvailability'] = existingSpecificTimeAvailability;
|
|
7343
|
+
this.selectedParticipants[key]['tab'] = 'specific-time-availability';
|
|
7344
7344
|
}
|
|
7345
7345
|
this.selectedParticipants = { ...this.selectedParticipants };
|
|
7346
7346
|
this.updateFormValue();
|
|
7347
7347
|
}
|
|
7348
7348
|
updateFormValue() {
|
|
7349
7349
|
const participantOpenHours = {};
|
|
7350
|
-
const
|
|
7350
|
+
const participantSpecificTimeAvailability = {};
|
|
7351
7351
|
Object.keys(this.selectedParticipants).forEach(key => {
|
|
7352
7352
|
participantOpenHours[key] = this.selectedParticipants[key].openHours;
|
|
7353
|
-
|
|
7353
|
+
participantSpecificTimeAvailability[key] = this.selectedParticipants[key].specificTimesAvailability || [];
|
|
7354
7354
|
});
|
|
7355
7355
|
this.isInternalsAvailable && this.internals.setFormValue(JSON.stringify(participantOpenHours), this.name);
|
|
7356
7356
|
this.valueChanged.emit({ value: JSON.stringify(participantOpenHours), name: this.name });
|
|
7357
|
-
this.isInternalsAvailable && this.internals.setFormValue(JSON.stringify(
|
|
7358
|
-
this.valueChanged.emit({ value: JSON.stringify(
|
|
7357
|
+
this.isInternalsAvailable && this.internals.setFormValue(JSON.stringify(participantSpecificTimeAvailability), `${this.name}-specific-time`);
|
|
7358
|
+
this.valueChanged.emit({ value: JSON.stringify(participantSpecificTimeAvailability), name: `${this.name}-specific-time` });
|
|
7359
7359
|
}
|
|
7360
7360
|
setParticipants(participants) {
|
|
7361
7361
|
const selectedParticipants = {};
|
|
@@ -7367,7 +7367,7 @@ const NylasParticipantsCustomAvailability = class {
|
|
|
7367
7367
|
name: participant.name || participant.email,
|
|
7368
7368
|
availability: participant.availability,
|
|
7369
7369
|
timezone: participant.timezone,
|
|
7370
|
-
|
|
7370
|
+
specificTimesAvailability: participant.specific_time_availability || [],
|
|
7371
7371
|
};
|
|
7372
7372
|
});
|
|
7373
7373
|
return selectedParticipants;
|
|
@@ -7376,7 +7376,7 @@ const NylasParticipantsCustomAvailability = class {
|
|
|
7376
7376
|
return this.internals !== undefined && typeof this.internals.setFormValue === 'function' && typeof this.internals.setValidity === 'function';
|
|
7377
7377
|
}
|
|
7378
7378
|
render() {
|
|
7379
|
-
return (index$1.h(index$1.Host, { key: '
|
|
7379
|
+
return (index$1.h(index$1.Host, { key: '72278a40aca8e3e3868b2c04abf9ec7ecb5cac10' }, index$1.h("div", { key: '82a8ddedcd2a16598f5a3cf8b8ac50e082a8303b', class: "nylas-participants-custom-availability", part: "npca" }, index$1.h("div", { key: 'e2881fe998d498b865420faf97f0355fd571b702', class: "header", part: "npca__header" }, index$1.h("h3", { key: '3ca8980d00abe8001eb4ff0168c8ce249977c8da' }, utils.instance.t('nylasParticipantCustomAvailability.headerTitle')), index$1.h("p", { key: '5fed5465662b20ce3339f95c1fda1ce6c8b72a32' }, utils.instance.t('nylasParticipantCustomAvailability.headerSubTitle'))), index$1.h("div", { key: '1a3bd4ebcfc8e420674dcbbe39e7c77900bceb8e', class: "content", part: "npca__content" }, index$1.h("form", { key: '7dc0f391a4c56336bea907f2c2e78b6c17d06f0f', ref: el => (this.participantFormRef = el) }, Object.keys(this.selectedParticipants).map((key, index) => {
|
|
7380
7380
|
const participant = this.selectedParticipants[key];
|
|
7381
7381
|
const participantOpenHours = participant.availability?.open_hours || [];
|
|
7382
7382
|
if (!participant || !participant.name || !participant.availability)
|
|
@@ -7390,10 +7390,10 @@ const NylasParticipantsCustomAvailability = class {
|
|
|
7390
7390
|
} }, index$1.h("chevron-icon", { width: "24", height: "24" })))), participant.isOpen && (index$1.h("div", { class: "participant-tabs", part: "npca__participant-tabs" }, index$1.h("div", { class: `participant-tab ${participant.tab === 'availability' ? 'active' : ''}`, part: "npca__participant-tab", onClick: () => {
|
|
7391
7391
|
this.selectedParticipants[key].tab = 'availability';
|
|
7392
7392
|
this.selectedParticipants = { ...this.selectedParticipants };
|
|
7393
|
-
} }, index$1.h("span", null, utils.instance.t('nylasParticipantCustomAvailability.participantAvailabilityTab'))), index$1.h("div", { class: `participant-tab ${participant.tab === 'specific-
|
|
7394
|
-
this.selectedParticipants[key].tab = 'specific-
|
|
7393
|
+
} }, index$1.h("span", null, utils.instance.t('nylasParticipantCustomAvailability.participantAvailabilityTab'))), index$1.h("div", { class: `participant-tab ${participant.tab === 'specific-time-availability' ? 'active' : ''}`, part: "npca__participant-tab", onClick: () => {
|
|
7394
|
+
this.selectedParticipants[key].tab = 'specific-time-availability';
|
|
7395
7395
|
this.selectedParticipants = { ...this.selectedParticipants };
|
|
7396
|
-
} }, index$1.h("span", null, utils.instance.t('nylasParticipantCustomAvailability.
|
|
7396
|
+
} }, index$1.h("span", null, utils.instance.t('nylasParticipantCustomAvailability.participantSpecificTimeAvailabilityTab'))))), participant.tab === 'availability' && participant.isOpen && (index$1.h("nylas-availability-picker", { key: index, name: `participant-availability-${index}-${key}`, openHours: participantOpenHours, defaultTimezone: participant.timezone, hideHeader: true })), participant.tab === 'specific-time-availability' && participant.isOpen && (index$1.h("nylas-specific-time-availability-picker", { key: index, name: `participant-specific-time-availability-${index}-${key}`, specificTimesAvailability: participant.specificTimesAvailability }))));
|
|
7397
7397
|
}))))));
|
|
7398
7398
|
}
|
|
7399
7399
|
static get formAssociated() { return true; }
|
|
@@ -7855,8 +7855,8 @@ __decorate$2([
|
|
|
7855
7855
|
], NylasSchedulingMethod.prototype, "render", null);
|
|
7856
7856
|
NylasSchedulingMethod.style = NylasSchedulingMethodStyle0;
|
|
7857
7857
|
|
|
7858
|
-
const
|
|
7859
|
-
const
|
|
7858
|
+
const nylasSpecificTimeAvailabilityPickerCss = ":host{display:block;width:100%}.nylas-specific-time-availability-picker{display:flex;flex-direction:column;gap:1rem;border-top:1px solid var(--nylas-base-200)}.nylas-specific-time-availability-picker .content{display:flex;flex-direction:column;gap:1.5rem;padding:16px}.nylas-specific-time-availability-picker .header{display:flex;flex-direction:column;gap:0.5rem}.nylas-specific-time-availability-picker .header .header-description{margin:0;font-size:0.875rem;color:var(--nylas-base-600);line-height:1.5}.nylas-specific-time-availability-picker .specific-times{display:flex;flex-direction:column;gap:1rem}.nylas-specific-time-availability-picker .empty-state{display:flex;flex-direction:column;align-items:center;padding:2rem 1rem;text-align:center}.nylas-specific-time-availability-picker .empty-state .empty-icon{margin-bottom:1.5rem;opacity:0.4;color:var(--nylas-base-400)}.nylas-specific-time-availability-picker .empty-state .empty-title{margin:0 0 0.5rem 0;font-size:1.125rem;font-weight:600;color:var(--nylas-base-700);line-height:1.5}.nylas-specific-time-availability-picker .empty-state .empty-subtitle{margin:0;font-size:0.875rem;color:var(--nylas-base-500);line-height:1.5;max-width:300px}.nylas-specific-time-availability-picker .specific-time-entry{display:flex;flex-direction:column;gap:0;padding:12px;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius);background:var(--nylas-base-0)}.nylas-specific-time-availability-picker .specific-time-entry .entry-content{display:grid;grid-template-columns:160px auto 30px 30px;gap:12px}@media (max-width: 768px){.nylas-specific-time-availability-picker .specific-time-entry .entry-content{grid-template-areas:\"date calendar_toggle remove\" \"time_or_unavailable time_or_unavailable time_or_unavailable\";grid-template-columns:1fr auto auto;grid-template-rows:1fr 1fr}}.nylas-specific-time-availability-picker .specific-time-entry .date-input-container{flex:0 0 auto;width:160px}@media (max-width: 768px){.nylas-specific-time-availability-picker .specific-time-entry .date-input-container{grid-area:date}}.nylas-specific-time-availability-picker .specific-time-entry .date-input-container .date-input{width:100%}.nylas-specific-time-availability-picker .specific-time-entry .date-input-container nylas-date-component::part(ic__date){border:1px solid var(--nylas-base-200);height:50px;display:flex;align-items:center}.nylas-specific-time-availability-picker .specific-time-entry .time-pickers{display:grid;grid-template-columns:auto 10px 1fr;width:342px;gap:14px;flex:1;min-width:0}@media (max-width: 768px){.nylas-specific-time-availability-picker .specific-time-entry .time-pickers{flex:1;width:auto;grid-area:time_or_unavailable}}.nylas-specific-time-availability-picker .specific-time-entry .time-pickers .time-separator{font-size:0.875rem;color:var(--nylas-base-600);font-weight:500;flex-shrink:0;line-height:1;padding:0 0px 0px 6px;margin-top:18px}.nylas-specific-time-availability-picker .specific-time-entry .unavailable-text{flex:1;display:flex;align-items:center;padding:0 15px;border-radius:var(--nylas-border-radius);background:var(--nylas-base-50);min-height:50px}@media (max-width: 768px){.nylas-specific-time-availability-picker .specific-time-entry .unavailable-text{grid-area:time_or_unavailable}}.nylas-specific-time-availability-picker .specific-time-entry .unavailable-text .unavailable-label{font-size:0.875rem;color:var(--nylas-base-500);font-style:italic}.nylas-specific-time-availability-picker .specific-time-entry .toggle-button{display:flex;align-items:center;justify-content:center;width:40px;height:48px;padding-left:8px;border:none;border-radius:4px;background:transparent;color:var(--nylas-base-400);cursor:pointer;transition:all 0.2s ease;flex-shrink:0}@media (max-width: 768px){.nylas-specific-time-availability-picker .specific-time-entry .toggle-button{grid-area:calendar_toggle}}.nylas-specific-time-availability-picker .specific-time-entry .toggle-button:hover{color:var(--nylas-primary)}.nylas-specific-time-availability-picker .specific-time-entry .toggle-button:focus{outline:none}.nylas-specific-time-availability-picker .specific-time-entry .toggle-button.unavailable{color:var(--nylas-error)}.nylas-specific-time-availability-picker .specific-time-entry .toggle-button.unavailable:hover{color:var(--nylas-error)}.nylas-specific-time-availability-picker .specific-time-entry .remove-button{display:flex;align-items:center;justify-content:center;width:40px;height:48px;padding:0;border:none;border-radius:4px;background:transparent;color:var(--nylas-base-400);cursor:pointer;transition:all 0.2s ease;flex-shrink:0}@media (max-width: 768px){.nylas-specific-time-availability-picker .specific-time-entry .remove-button{grid-area:remove}}.nylas-specific-time-availability-picker .specific-time-entry .remove-button:hover{color:var(--nylas-error)}.nylas-specific-time-availability-picker .specific-time-entry .remove-button:focus{outline:none;background:var(--nylas-base-100);box-shadow:0 0 0 2px var(--nylas-primary)}.nylas-specific-time-availability-picker .specific-time-entry .remove-button:active{background:var(--nylas-base-200)}.nylas-specific-time-availability-picker .specific-time-entry .error-message{width:-webkit-fill-available;padding:4px 8px;background:var(--nylas-error-50);color:var(--nylas-error);font-size:12px;border-radius:4px;border:1px solid var(--nylas-error-200);margin-top:8px}.nylas-specific-time-availability-picker .add-button-container{display:flex;justify-content:flex-start}.nylas-specific-time-availability-picker .add-button-container button-component{width:100%}::part(nstap__add-button){border:1px dashed var(--nylas-base-200);background:var(--nylas-base-0);color:var(--nylas-base-700)}::part(nstap__add-button):hover{border-color:var(--nylas-primary);background:var(--nylas-base-50);color:var(--nylas-primary)}::part(nstap__time-picker-container){flex:1;min-width:0}::part(nstap__time-picker-input){width:100%;font-size:0.875rem;min-height:50px;display:flex;align-items:center}::part(nstap__date-input){width:100%}::part(nstap__date-field){width:100%;font-size:0.875rem;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius);padding:0.5rem 0.75rem}::part(nstap__date-field):focus{border-color:var(--nylas-primary);box-shadow:0 0 0 3px rgba(59, 130, 246, 0.1)}::part(nstap__date-wrapper){margin:0}::part(nstap__date-label){margin:0;padding:0}::part(nstap__date-label) p{display:none}";
|
|
7859
|
+
const NylasSpecificTimeAvailabilityPickerStyle0 = nylasSpecificTimeAvailabilityPickerCss;
|
|
7860
7860
|
|
|
7861
7861
|
var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
7862
7862
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -7872,7 +7872,7 @@ var __metadata$1 = (undefined && undefined.__metadata) || function (k, v) {
|
|
|
7872
7872
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
7873
7873
|
return Reflect.metadata(k, v);
|
|
7874
7874
|
};
|
|
7875
|
-
const
|
|
7875
|
+
const NylasSpecificTimeAvailabilityPicker = class {
|
|
7876
7876
|
constructor(hostRef) {
|
|
7877
7877
|
index$1.registerInstance(this, hostRef);
|
|
7878
7878
|
this.valueChanged = index$1.createEvent(this, "valueChanged", 7);
|
|
@@ -7883,31 +7883,31 @@ const NylasSpecificDateAvailabilityPicker = class {
|
|
|
7883
7883
|
this.internals = hostRef.$hostElement$.attachInternals();
|
|
7884
7884
|
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
7885
7885
|
}
|
|
7886
|
-
this.name = 'specific-
|
|
7886
|
+
this.name = 'specific-time-availability';
|
|
7887
7887
|
this.selectedConfiguration = undefined;
|
|
7888
7888
|
this.selectedLanguage = undefined;
|
|
7889
|
-
this.
|
|
7889
|
+
this.specificTimesAvailability = undefined;
|
|
7890
7890
|
this.themeConfig = undefined;
|
|
7891
7891
|
this.specificDateEntries = [];
|
|
7892
7892
|
this.validationErrors = {};
|
|
7893
7893
|
}
|
|
7894
7894
|
connectedCallback() {
|
|
7895
|
-
utils.debug('nylas-specific-
|
|
7895
|
+
utils.debug('nylas-specific-time-availability-picker', 'connectedCallback');
|
|
7896
7896
|
}
|
|
7897
7897
|
disconnectedCallback() {
|
|
7898
|
-
utils.debug('nylas-specific-
|
|
7898
|
+
utils.debug('nylas-specific-time-availability-picker', 'disconnectedCallback');
|
|
7899
7899
|
}
|
|
7900
7900
|
componentWillLoad() {
|
|
7901
|
-
utils.debug('nylas-specific-
|
|
7901
|
+
utils.debug('nylas-specific-time-availability-picker', 'componentWillLoad');
|
|
7902
7902
|
this.host.setAttribute('name', this.name);
|
|
7903
7903
|
}
|
|
7904
7904
|
componentDidLoad() {
|
|
7905
|
-
utils.debug('nylas-specific-
|
|
7905
|
+
utils.debug('nylas-specific-time-availability-picker', 'componentDidLoad');
|
|
7906
7906
|
if (this.selectedConfiguration) {
|
|
7907
7907
|
this.configChangedHandler(this.selectedConfiguration);
|
|
7908
7908
|
}
|
|
7909
|
-
else if (this.
|
|
7910
|
-
this.
|
|
7909
|
+
else if (this.specificTimesAvailability && this.specificTimesAvailability.length > 0) {
|
|
7910
|
+
this.loadSpecificTimeAvailability();
|
|
7911
7911
|
}
|
|
7912
7912
|
this.applyThemeConfig(this.themeConfig);
|
|
7913
7913
|
}
|
|
@@ -7915,12 +7915,12 @@ const NylasSpecificDateAvailabilityPicker = class {
|
|
|
7915
7915
|
return typeof this.internals.setFormValue === 'function';
|
|
7916
7916
|
}
|
|
7917
7917
|
elementNameChangedHandler(newValue) {
|
|
7918
|
-
utils.debug('nylas-specific-
|
|
7918
|
+
utils.debug('nylas-specific-time-availability-picker', 'elementNameChangedHandler', newValue);
|
|
7919
7919
|
this.host.setAttribute('name', newValue);
|
|
7920
7920
|
}
|
|
7921
7921
|
configChangedHandler(newConfig) {
|
|
7922
|
-
utils.debug('nylas-specific-
|
|
7923
|
-
this.
|
|
7922
|
+
utils.debug('nylas-specific-time-availability-picker', 'configChangedHandler', newConfig);
|
|
7923
|
+
this.loadSpecificTimeAvailability();
|
|
7924
7924
|
}
|
|
7925
7925
|
selectedLanguageChangedHandler(newVal, oldVal) {
|
|
7926
7926
|
if (newVal === oldVal)
|
|
@@ -7939,14 +7939,14 @@ const NylasSpecificDateAvailabilityPicker = class {
|
|
|
7939
7939
|
}
|
|
7940
7940
|
}
|
|
7941
7941
|
}
|
|
7942
|
-
|
|
7943
|
-
if (!this.
|
|
7942
|
+
loadSpecificTimeAvailability() {
|
|
7943
|
+
if (!this.specificTimesAvailability || this.specificTimesAvailability.length === 0) {
|
|
7944
7944
|
return;
|
|
7945
7945
|
}
|
|
7946
|
-
const entries = this.
|
|
7946
|
+
const entries = this.specificTimesAvailability.map((item, index) => {
|
|
7947
7947
|
const isUnavailable = item.start === '00:00' && item.end === '00:00';
|
|
7948
7948
|
return {
|
|
7949
|
-
id: `specific-
|
|
7949
|
+
id: `specific-time-${index}`,
|
|
7950
7950
|
date: item.date,
|
|
7951
7951
|
startTime: isUnavailable ? '09:00am' : utils.convertTo12HourFormat(item.start),
|
|
7952
7952
|
endTime: isUnavailable ? '05:00pm' : utils.convertTo12HourFormat(item.end),
|
|
@@ -7956,13 +7956,13 @@ const NylasSpecificDateAvailabilityPicker = class {
|
|
|
7956
7956
|
this.specificDateEntries = entries;
|
|
7957
7957
|
this.emitValueChanged();
|
|
7958
7958
|
}
|
|
7959
|
-
|
|
7959
|
+
addSpecificTimeAvailability() {
|
|
7960
7960
|
const today = new Date();
|
|
7961
7961
|
const targetDate = new Date(today);
|
|
7962
7962
|
targetDate.setDate(today.getDate() + this.specificDateEntries.length);
|
|
7963
7963
|
const formattedDate = targetDate.toISOString().split('T')[0];
|
|
7964
7964
|
const newEntry = {
|
|
7965
|
-
id: `specific-
|
|
7965
|
+
id: `specific-time-${Date.now()}`,
|
|
7966
7966
|
date: formattedDate,
|
|
7967
7967
|
startTime: '09:00am',
|
|
7968
7968
|
endTime: '05:00pm',
|
|
@@ -7974,7 +7974,7 @@ const NylasSpecificDateAvailabilityPicker = class {
|
|
|
7974
7974
|
}
|
|
7975
7975
|
this.emitValueChanged();
|
|
7976
7976
|
}
|
|
7977
|
-
|
|
7977
|
+
removeSpecificTimeAvailability(id) {
|
|
7978
7978
|
this.specificDateEntries = this.specificDateEntries.filter(entry => entry.id !== id);
|
|
7979
7979
|
if (this.validationErrors[id]) {
|
|
7980
7980
|
const newErrors = { ...this.validationErrors };
|
|
@@ -7999,22 +7999,22 @@ const NylasSpecificDateAvailabilityPicker = class {
|
|
|
7999
7999
|
}
|
|
8000
8000
|
validateEntry(entry) {
|
|
8001
8001
|
if (!entry.date) {
|
|
8002
|
-
return utils.instance.t('
|
|
8002
|
+
return utils.instance.t('nylasSpecificTimeAvailabilityPicker.errors.dateRequired');
|
|
8003
8003
|
}
|
|
8004
8004
|
const dateObj = new Date(entry.date);
|
|
8005
8005
|
if (isNaN(dateObj.getTime())) {
|
|
8006
|
-
return utils.instance.t('
|
|
8006
|
+
return utils.instance.t('nylasSpecificTimeAvailabilityPicker.errors.invalidDateFormat');
|
|
8007
8007
|
}
|
|
8008
8008
|
if (entry.isUnavailable) {
|
|
8009
8009
|
return null;
|
|
8010
8010
|
}
|
|
8011
8011
|
if (!entry.startTime || !entry.endTime) {
|
|
8012
|
-
return utils.instance.t('
|
|
8012
|
+
return utils.instance.t('nylasSpecificTimeAvailabilityPicker.errors.timesRequired');
|
|
8013
8013
|
}
|
|
8014
8014
|
const startMinutes = utils.timeToMinutes(entry.startTime);
|
|
8015
8015
|
const endMinutes = utils.timeToMinutes(entry.endTime);
|
|
8016
8016
|
if (startMinutes >= endMinutes) {
|
|
8017
|
-
return utils.instance.t('
|
|
8017
|
+
return utils.instance.t('nylasSpecificTimeAvailabilityPicker.errors.startTimeBeforeEndTime');
|
|
8018
8018
|
}
|
|
8019
8019
|
return null;
|
|
8020
8020
|
}
|
|
@@ -8088,7 +8088,7 @@ const NylasSpecificDateAvailabilityPicker = class {
|
|
|
8088
8088
|
}
|
|
8089
8089
|
handleFormInputChange(event) {
|
|
8090
8090
|
const { name, value } = event.detail;
|
|
8091
|
-
if (name.startsWith('date-') && name.includes('specific-
|
|
8091
|
+
if (name.startsWith('date-') && name.includes('specific-time-')) {
|
|
8092
8092
|
const entryId = name.replace('date-', '');
|
|
8093
8093
|
this.specificDateEntries = this.specificDateEntries.map(entry => {
|
|
8094
8094
|
if (entry.id === entryId) {
|
|
@@ -8106,14 +8106,14 @@ const NylasSpecificDateAvailabilityPicker = class {
|
|
|
8106
8106
|
}
|
|
8107
8107
|
emitValueChanged() {
|
|
8108
8108
|
const isValid = this.validateAllEntries();
|
|
8109
|
-
const
|
|
8109
|
+
const specificTimesAvailability = this.specificDateEntries
|
|
8110
8110
|
.filter(entry => entry.date && (entry.isUnavailable || (entry.startTime && entry.endTime)))
|
|
8111
8111
|
.map(entry => ({
|
|
8112
8112
|
date: entry.date,
|
|
8113
8113
|
start: entry.isUnavailable ? '00:00' : utils.convertTo24HourFormat(entry.startTime),
|
|
8114
8114
|
end: entry.isUnavailable ? '00:00' : utils.convertTo24HourFormat(entry.endTime),
|
|
8115
8115
|
}));
|
|
8116
|
-
const value = JSON.stringify(
|
|
8116
|
+
const value = JSON.stringify(specificTimesAvailability);
|
|
8117
8117
|
if (this.isInternalsAvailable && isValid) {
|
|
8118
8118
|
this.internals.setFormValue(value, this.name);
|
|
8119
8119
|
}
|
|
@@ -8123,9 +8123,9 @@ const NylasSpecificDateAvailabilityPicker = class {
|
|
|
8123
8123
|
});
|
|
8124
8124
|
}
|
|
8125
8125
|
render() {
|
|
8126
|
-
return (index$1.h(index$1.Host, { key: '
|
|
8127
|
-
? utils.instance.t('
|
|
8128
|
-
: utils.instance.t('
|
|
8126
|
+
return (index$1.h(index$1.Host, { key: '01f075a3cded0b05cce5098dee0fe221bc13ec24' }, index$1.h("div", { key: 'f008de5cd95468e1cb0b820dabc2d38bca8a6d99', class: "nylas-specific-time-availability-picker", part: "nstap" }, index$1.h("div", { key: 'c2ec42ad544a1c10b3d5cbfa5adcf04a7e716377', class: "content", part: "nstap__content" }, index$1.h("div", { key: 'c58f880616610957181857a84ab053fa9f811f5d', class: "header", part: "nstap__header" }, index$1.h("p", { key: '671a584b2f92d1ee3d8abf50a80c60052e97510a', class: "header-description", part: "nstap__header-description" }, utils.instance.t('nylasSpecificTimeAvailabilityPicker.headerDescription'))), index$1.h("div", { key: '9b341aa468e6fdb749cddf7bf8fdc66c110ce25f', class: "specific-times", part: "nstap__specific-times" }, this.specificDateEntries.length === 0 ? (index$1.h("div", { class: "empty-state", part: "nstap__empty-state" }, index$1.h("div", { class: "empty-icon", part: "nstap__empty-icon" }, index$1.h("calendar-icon", { width: "32", height: "32" })), index$1.h("h3", { class: "empty-title", part: "nstap__empty-title" }, utils.instance.t('nylasSpecificTimeAvailabilityPicker.emptyState.title')), index$1.h("p", { class: "empty-subtitle", part: "nstap__empty-subtitle" }, utils.instance.t('nylasSpecificTimeAvailabilityPicker.emptyState.subtitle')))) : (this.specificDateEntries.map(entry => (index$1.h("div", { class: "specific-time-entry", part: "nstap__specific-time-entry", key: entry.id, "data-entry-id": entry.id }, index$1.h("div", { class: "entry-content", part: "nstap__entry-content" }, index$1.h("div", { class: "date-input-container", part: "nstap__date-input-container" }, index$1.h("nylas-date-component", { name: `date-${entry.id}`, defaultValue: entry.date, placeholder: "yyyy-mm-dd", part: "nstap__date-input", class: "date-input", themeConfig: this.themeConfig, exportparts: "ic__date: nstap__date-field, ic__input_wrapper: nstap__date-wrapper, ic__label: nstap__date-label" })), entry.isUnavailable ? (index$1.h("div", { class: "unavailable-text", part: "nstap__unavailable-text" }, index$1.h("span", { class: "unavailable-label" }, utils.instance.t('nylasSpecificTimeAvailabilityPicker.entireDayUnavailable')))) : (index$1.h("div", { class: "time-pickers", part: "nstap__time-pickers" }, index$1.h("nylas-time-window-picker", { id: `${entry.id}_start`, time: entry.startTime, name: `${entry.id}_start`, key: `${entry.id}_start`, language: this.selectedLanguage, hasError: !!this.validationErrors[entry.id], themeConfig: this.themeConfig, exportparts: "time-picker: nstap__time-picker-container, time-input: nstap__time-picker-input, times: nstap__time-picker-times" }), index$1.h("span", { class: "time-separator" }, "-"), index$1.h("nylas-time-window-picker", { id: `${entry.id}_end`, time: entry.endTime, name: `${entry.id}_end`, key: `${entry.id}_end`, minimumStartTime: entry.startTime, language: this.selectedLanguage, hasError: !!this.validationErrors[entry.id], themeConfig: this.themeConfig, exportparts: "time-picker: nstap__time-picker-container, time-input: nstap__time-picker-input, times: nstap__time-picker-times" }))), index$1.h("button", { type: "button", class: { 'toggle-button': true, 'unavailable': entry.isUnavailable }, part: "nstap__toggle-button", onClick: () => this.toggleAvailability(entry.id), title: entry.isUnavailable
|
|
8127
|
+
? utils.instance.t('nylasSpecificTimeAvailabilityPicker.markAsAvailable')
|
|
8128
|
+
: utils.instance.t('nylasSpecificTimeAvailabilityPicker.markAsUnavailable') }, index$1.h("calendar-icon", { width: "20", height: "20" })), index$1.h("button", { type: "button", class: "remove-button", part: "nstap__remove-button", onClick: () => this.removeSpecificTimeAvailability(entry.id), "aria-label": "Remove specific date" }, index$1.h("close-icon", { width: "16", height: "16" }))), this.validationErrors[entry.id] && (index$1.h("div", { class: "error-message", part: "nstap__error-message" }, this.validationErrors[entry.id]))))))), index$1.h("div", { key: '3a326486bb489af6c036527434c6c6a8a7736cf1', class: "add-button-container", part: "nstap__add-button-container" }, index$1.h("button-component", { key: '156a5fff11a4dedc272327cdf2322118e9fef6fc', id: "add-specific-time-open-hour", onClick: () => this.addSpecificTimeAvailability(), part: "nstap__add-button", variant: "basic" }, index$1.h("add-circle-icon", { key: '0d12a577afac1d24a4c259997d71e0f182f1e5c8', width: "24", height: "24" }), utils.instance.t('nylasSpecificTimeAvailabilityPicker.addSpecificTimeAvailability')))))));
|
|
8129
8129
|
}
|
|
8130
8130
|
static get formAssociated() { return true; }
|
|
8131
8131
|
get host() { return index$1.getElement(this); }
|
|
@@ -8138,7 +8138,7 @@ const NylasSpecificDateAvailabilityPicker = class {
|
|
|
8138
8138
|
};
|
|
8139
8139
|
__decorate$1([
|
|
8140
8140
|
registerComponent.RegisterComponent({
|
|
8141
|
-
name: 'nylas-specific-
|
|
8141
|
+
name: 'nylas-specific-time-availability-picker',
|
|
8142
8142
|
stateToProps: new Map([
|
|
8143
8143
|
['schedulerConfig.selectedConfiguration', 'selectedConfiguration'],
|
|
8144
8144
|
['schedulerConfig.selectedLanguage', 'selectedLanguage'],
|
|
@@ -8149,8 +8149,8 @@ __decorate$1([
|
|
|
8149
8149
|
__metadata$1("design:type", Function),
|
|
8150
8150
|
__metadata$1("design:paramtypes", []),
|
|
8151
8151
|
__metadata$1("design:returntype", void 0)
|
|
8152
|
-
],
|
|
8153
|
-
|
|
8152
|
+
], NylasSpecificTimeAvailabilityPicker.prototype, "render", null);
|
|
8153
|
+
NylasSpecificTimeAvailabilityPicker.style = NylasSpecificTimeAvailabilityPickerStyle0;
|
|
8154
8154
|
|
|
8155
8155
|
const nylasTimeslotIntervalCss = ":host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:\"Inter\", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;width:inherit}.nylas-timeslot-interval{width:inherit;display:flex;flex-direction:column;margin:1rem;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-200)}.nylas-timeslot-interval .header{padding:1rem;border-bottom:1px solid var(--nylas-base-200)}.nylas-timeslot-interval .header h3{margin:0;font-size:16px;font-weight:600;line-height:20px;color:var(--nylas-base-900);text-align:left}.nylas-timeslot-interval .header p{margin:0.25rem 0 0 0;font-size:0.875rem;font-weight:400;line-height:20px;color:var(--nylas-base-600);text-align:left}.nylas-timeslot-interval .nylas-timeslot-interval__dropdown{padding:1rem;display:flex;flex-direction:column;gap:4px;background-color:var(--nylas-base-25)}.nylas-timeslot-interval .nylas-timeslot-interval__dropdown span.label{display:flex;align-items:center;gap:4px;color:var(--nylas-base-800)}.nylas-timeslot-interval .nylas-timeslot-interval__dropdown span.label tooltip-component{display:flex}.nylas-timeslot-interval .nylas-timeslot-interval__dropdown select-dropdown{margin-bottom:1.5rem}.nylas-timeslot-interval .nylas-timeslot-interval__dropdown select-dropdown::part(sd_dropdown){width:100%}.nylas-timeslot-interval .nylas-timeslot-interval__dropdown select-dropdown::part(sd_dropdown-content){width:100%;max-width:unset}.nylas-timeslot-interval .nylas-timeslot-interval__dropdown select-dropdown::part(sd_dropdown-button){width:100%;display:flex;justify-content:space-between;align-items:center;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);padding:1rem}.nylas-timeslot-interval .nylas-timeslot-interval__dropdown select-dropdown::part(sd_dropdown-button-selected-label){max-width:calc(100% - 2rem);font-family:var(--nylas-font-family);font-size:16px;line-height:24px}";
|
|
8156
8156
|
const NylasTimeslotIntervalStyle0 = nylasTimeslotIntervalCss;
|
|
@@ -8426,7 +8426,7 @@ exports.nylas_participant_booking_calendars = NylasParticipantBookingCalendars;
|
|
|
8426
8426
|
exports.nylas_participants_custom_availability = NylasParticipantsCustomAvailability;
|
|
8427
8427
|
exports.nylas_reminder_emails = NylasReminderEmails;
|
|
8428
8428
|
exports.nylas_scheduling_method = NylasSchedulingMethod;
|
|
8429
|
-
exports.
|
|
8429
|
+
exports.nylas_specific_time_availability_picker = NylasSpecificTimeAvailabilityPicker;
|
|
8430
8430
|
exports.nylas_timeslot_interval = NylasTimeslotInterval;
|
|
8431
8431
|
exports.paintbrush_fill_icon = PaintbrushFillIcon;
|
|
8432
8432
|
exports.paintbrush_icon = PaintbrushIcon;
|