@nylas/web-elements 2.5.4-canary-20260414201801 → 2.5.5
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 +967 -959
- package/dist/cdn/nylas-scheduling/nylas-scheduling.es.js +16 -11
- package/dist/cjs/{abstract-provider-CH5yXWmY.js → abstract-provider-NL9mvsRm.js} +3 -3
- package/dist/cjs/abstract-provider-NL9mvsRm.js.map +1 -0
- package/dist/cjs/google-logo-icon_6.cjs.entry.js +1 -1
- package/dist/cjs/nylas-scheduler-editor.cjs.entry.js +9 -2
- package/dist/cjs/nylas-scheduler-editor.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-scheduler-editor.entry.cjs.js.map +1 -1
- package/dist/cjs/nylas-scheduling.cjs.entry.js +3 -3
- package/dist/cjs/nylas-scheduling.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-scheduling.entry.cjs.js.map +1 -1
- package/dist/cjs/radio-button-group.cjs.entry.js +8 -1
- package/dist/cjs/radio-button-group.cjs.entry.js.map +1 -1
- package/dist/cjs/radio-button-group.entry.cjs.js.map +1 -1
- package/dist/cjs/{version-Dfv6nyNu.js → version-y-IXeOX1.js} +3 -3
- package/dist/cjs/{version-Dfv6nyNu.js.map → version-y-IXeOX1.js.map} +1 -1
- package/dist/collection/common/abstract-provider.js +1 -1
- package/dist/collection/common/abstract-provider.js.map +1 -1
- package/dist/collection/components/design-system/radio-button-group/radio-button-group.js +8 -1
- package/dist/collection/components/design-system/radio-button-group/radio-button-group.js.map +1 -1
- package/dist/collection/components/scheduler/nylas-scheduling/nylas-scheduling.js +6 -1
- package/dist/collection/components/scheduler/nylas-scheduling/nylas-scheduling.js.map +1 -1
- package/dist/collection/connector/shared/api/scheduler-config.js +7 -0
- package/dist/collection/connector/shared/api/scheduler-config.js.map +1 -1
- package/dist/collection/version.js +1 -1
- package/dist/collection/version.js.map +1 -1
- package/dist/components/nylas-booking-form.js +1 -1
- package/dist/components/nylas-editor-tabs-group.js +1 -1
- package/dist/components/nylas-editor-tabs.js +1 -1
- package/dist/components/nylas-scheduler-editor.js +13 -6
- package/dist/components/nylas-scheduler-editor.js.map +1 -1
- package/dist/components/nylas-scheduling.js +5 -5
- package/dist/components/nylas-scheduling.js.map +1 -1
- package/dist/components/nylas-timeslot-interval.js +1 -1
- package/dist/components/{p-t9PqKZaR.js → p-677FcYj-.js} +5 -5
- package/dist/components/{p-t9PqKZaR.js.map → p-677FcYj-.js.map} +1 -1
- package/dist/components/{p-CrRo4iAd.js → p-BUEZ6uxG.js} +3 -3
- package/dist/components/{p-CrRo4iAd.js.map → p-BUEZ6uxG.js.map} +1 -1
- package/dist/components/{p-226WzMDo.js → p-BW6mh3NI.js} +3 -3
- package/dist/components/{p-226WzMDo.js.map → p-BW6mh3NI.js.map} +1 -1
- package/dist/components/{p-CMFPcpfe.js → p-C0pHjJtj.js} +3 -3
- package/dist/components/{p-CMFPcpfe.js.map → p-C0pHjJtj.js.map} +1 -1
- package/dist/components/{p-BvQ13Bty.js → p-CigXeIp5.js} +3 -3
- package/dist/components/p-CigXeIp5.js.map +1 -0
- package/dist/components/{p-B_Qi3sM4.js → p-CyWE9dXK.js} +10 -3
- package/dist/components/p-CyWE9dXK.js.map +1 -0
- package/dist/components/{p-CfQZPhVq.js → p-CzVKC2Lf.js} +3 -3
- package/dist/components/{p-CfQZPhVq.js.map → p-CzVKC2Lf.js.map} +1 -1
- package/dist/components/radio-button-group.js +1 -1
- package/dist/esm/{abstract-provider-KowNUOZM.js → abstract-provider-Bxd_4MUD.js} +3 -3
- package/dist/esm/abstract-provider-Bxd_4MUD.js.map +1 -0
- package/dist/esm/google-logo-icon_6.entry.js +1 -1
- package/dist/esm/nylas-scheduler-editor.entry.js +9 -2
- package/dist/esm/nylas-scheduler-editor.entry.js.map +1 -1
- package/dist/esm/nylas-scheduling.entry.js +3 -3
- package/dist/esm/nylas-scheduling.entry.js.map +1 -1
- package/dist/esm/radio-button-group.entry.js +8 -1
- package/dist/esm/radio-button-group.entry.js.map +1 -1
- package/dist/esm/{version-EWXklg7E.js → version-CqK6_Oc7.js} +3 -3
- package/dist/esm/{version-EWXklg7E.js.map → version-CqK6_Oc7.js.map} +1 -1
- package/dist/nylas-web-elements/nylas-scheduler-editor.entry.esm.js.map +1 -1
- package/dist/nylas-web-elements/nylas-scheduling.entry.esm.js.map +1 -1
- package/dist/nylas-web-elements/nylas-web-elements.esm.js +1 -1
- package/dist/nylas-web-elements/{p-124fda53.entry.js → p-196717a0.entry.js} +3 -3
- package/dist/nylas-web-elements/p-196717a0.entry.js.map +1 -0
- package/dist/nylas-web-elements/{p-5a861a93.entry.js → p-7876f3e5.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-5a861a93.entry.js.map → p-7876f3e5.entry.js.map} +1 -1
- package/dist/nylas-web-elements/{p-EWXklg7E.js → p-CqK6_Oc7.js} +2 -2
- package/dist/nylas-web-elements/{p-EWXklg7E.js.map → p-CqK6_Oc7.js.map} +1 -1
- package/dist/nylas-web-elements/{p--bAq8KLi.js → p-DGwaF706.js} +2 -2
- package/dist/nylas-web-elements/p-DGwaF706.js.map +1 -0
- package/dist/nylas-web-elements/{p-b26bb72f.entry.js → p-ca41de7e.entry.js} +2 -2
- package/dist/nylas-web-elements/p-d1dc06a1.entry.js +2 -0
- package/dist/nylas-web-elements/p-d1dc06a1.entry.js.map +1 -0
- package/dist/nylas-web-elements/radio-button-group.entry.esm.js.map +1 -1
- package/dist/types/connector/shared/api/scheduler-config.d.ts +1 -0
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -1
- package/dist/cjs/abstract-provider-CH5yXWmY.js.map +0 -1
- package/dist/components/p-B_Qi3sM4.js.map +0 -1
- package/dist/components/p-BvQ13Bty.js.map +0 -1
- package/dist/esm/abstract-provider-KowNUOZM.js.map +0 -1
- package/dist/nylas-web-elements/p--bAq8KLi.js.map +0 -1
- package/dist/nylas-web-elements/p-124fda53.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-48449f8b.entry.js +0 -2
- package/dist/nylas-web-elements/p-48449f8b.entry.js.map +0 -1
- /package/dist/nylas-web-elements/{p-b26bb72f.entry.js.map → p-ca41de7e.entry.js.map} +0 -0
|
@@ -42,6 +42,13 @@ const RadioButtonGroup = class {
|
|
|
42
42
|
}
|
|
43
43
|
componentDidLoad() {
|
|
44
44
|
this.selectedValue = this.defaultSelectedValue;
|
|
45
|
+
if (this.defaultSelectedValue) {
|
|
46
|
+
this.nylasFormRadioChanged.emit({
|
|
47
|
+
value: this.defaultSelectedValue,
|
|
48
|
+
name: this.name,
|
|
49
|
+
label: this.label,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
45
52
|
}
|
|
46
53
|
handleBookingFormSubmitted(event) {
|
|
47
54
|
if (this.required && !this.selectedValue) {
|
|
@@ -65,7 +72,7 @@ const RadioButtonGroup = class {
|
|
|
65
72
|
});
|
|
66
73
|
}
|
|
67
74
|
render() {
|
|
68
|
-
return (index.h("div", { key: '
|
|
75
|
+
return (index.h("div", { key: '7d4f9dbc6fb35ba0d6ec854c67b04f320888bff0', class: "radio-group" }, index.h("slot", { key: '4e8f1ebf95e25021f49c0973bb16609730303c2d', name: "label" }, this.label && (index.h("p", { key: 'a944e18fac56caeb5582028c38d055b399cd6693', class: { error: !!this.error } }, index.h("span", { key: '2730c691418b2890b52b182d0389eb4a6ea42edb', class: "label" }, this.label), this.required && index.h("span", { key: 'ec2d3213ab090cf75a9499c03f64b1cf8ac860b8', class: "required" }, "*")))), this.options.map(option => (index.h("label", null, index.h("div", { class: "radio-option" }, index.h("input", { type: "radio", disabled: this.readOnly, readOnly: this.readOnly, title: this.readOnly ? 'read-only field' : undefined, name: this.name, value: option.value, checked: this.selectedValue === option.value, onChange: () => this.handleChange(option.value) }), index.h("p", null, index.h("span", { class: "title" }, option.label), index.h("span", { class: "description" }, option.description)))))), this.error && index.h("span", { key: 'bbe79d56c58731dd23fd68f6efea548faffcbc25', class: "error help-text" }, this.error)));
|
|
69
76
|
}
|
|
70
77
|
get el() { return index.getElement(this); }
|
|
71
78
|
static get watchers() { return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"radio-button-group.entry.cjs.js","mappings":";;;;AAAA,MAAM,mBAAmB,GAAG,glHAAglH;;MCa/lH,gBAAgB,GAAA,MAAA;AAL7B,IAAA,WAAA,CAAA,OAAA,EAAA;;;AAOmB,QAAA,IAAa,CAAA,aAAA,GAAW,aAAa;AAK9C,QAAA,IAAI,CAAA,IAAA,GAAW,aAAa;AAK5B,QAAA,IAAO,CAAA,OAAA,GAA6D,EAAE;AAI/B,QAAA,IAAoB,CAAA,oBAAA,GAAW,EAAE;AAUxE,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;AAIzB,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;AAQzB,QAAA,IAAY,CAAA,YAAA,GAAW,EAAE;AAQxB,QAAA,IAAK,CAAA,KAAA,GAAW,EAAE;AA6G5B;AAlGC,IAAA,gCAAgC,CAAC,QAAgB,EAAA;AAC/C,QAAA,IAAI,CAAC,aAAa,GAAG,QAAQ;;IAI/B,yBAAyB,CAAC,MAAmB,EAAE,MAAmB,EAAA;QAChE,IAAI,MAAM,KAAK,MAAM;YAAE;AACvB,QAAA,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC;;AAG/B,IAAA,gBAAgB,CAAC,WAAyB,EAAA;QACxC,IAAI,WAAW,EAAE;AACf,YAAA,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;AACtD,gBAAA,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA,EAAG,GAAG,CAAA,CAAE,EAAE,KAAK,CAAC;;;;IAMhD,iBAAiB,GAAA;QAGf,cAAc,CAAC,MAAK;AAClB,YAAA,IAAI,IAAI,CAAC,WAAW,EAAE;AACpB,gBAAA,IA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;;;;;;;;","names":["h"],"sources":["src/components/design-system/radio-button-group/radio-button-group.scss?tag=radio-button-group&encapsulation=shadow","src/components/design-system/radio-button-group/radio-button-group.tsx"],"sourcesContent":["@use '../../../common/styles/variables' as *;\n@use '../../../common/mixins/inputs' as *;\n\n:host {\n display: block;\n @include default-css-variables;\n width: 100%;\n}\n\n.radio-group {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n\n slot[name='label'] {\n @include input-label;\n font-size: 16px;\n\n p {\n margin: 0;\n\n &.error {\n color: var(--nylas-error);\n }\n }\n\n .error {\n color: var(--nylas-error);\n }\n }\n\n span.error {\n color: var(--nylas-error);\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n font-family: var(--nylas-font-family);\n }\n\n label {\n display: flex;\n\n font-family: var(--nylas-font-family);\n cursor: pointer;\n\n .radio-option {\n display: flex;\n align-items: flex-start;\n gap: 0.5rem;\n\n input[type='radio'] {\n cursor: pointer;\n }\n\n input[type='radio' i] {\n width: 20px;\n height: 20px;\n color: var(--nylas-primary);\n }\n\n p {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n margin: 0;\n\n .title {\n font-size: 16px;\n font-weight: 500;\n line-height: 20px;\n color: var(--nylas-base-800);\n word-break: break-word;\n overflow-wrap: break-word;\n }\n\n .description {\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n color: var(--nylas-base-600);\n }\n }\n }\n }\n}\n","// src/components/radio-group/radio-group.tsx\nimport { ThemeConfig } from '@nylas/core';\nimport { Component, h, Prop, State, Event, EventEmitter, Listen, Element, Watch } from '@stencil/core';\n\n/**\n * The `radio-button-group` component is a UI component that allows users to select a single option from a list of options.\n * This component is used in the scheduling form to input radio button type inputs.\n */\n@Component({\n tag: 'radio-button-group',\n styleUrl: 'radio-button-group.scss',\n shadow: true,\n})\nexport class RadioButtonGroup {\n @Element() el!: HTMLElement;\n private readonly componentType: string = 'radio-group';\n\n /**\n * The name of the radio group. This is used to identify the radio group when submitting a form.\n */\n @Prop() name: string = 'radio-group';\n /**\n * The list of options in the radio group.\n * Each option has a label and a value and an optional description.\n */\n @Prop() options: { label: string; value: string; description?: string }[] = [];\n /**\n * The default selected value of the radio group.\n */\n @Prop({ attribute: 'default-selected-value' }) defaultSelectedValue: string = '';\n /**\n * The label of the radio group. This is displayed above the radio group.\n * Label is optional. You can also use the slot 'label' to add a label.\n */\n @Prop() label?: string;\n /**\n * Whether the radio group is required. If true, the radio group must have a value when submitting a form.\n * Default is false. If the radio group is required and the value is empty, an error message is displayed.\n */\n @Prop() required: boolean = false;\n /**\n * The property to make the radio group read-only. If true, the radio group cannot be edited.\n */\n @Prop() readOnly: boolean = false;\n /**\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: ThemeConfig;\n /**\n * Error message to display when the radio group is required and no value is selected.\n */\n @Prop() errorMessage: string = '';\n /**\n * The selected value of the radio group.\n */\n @State() selectedValue!: string;\n /**\n * The error message state.\n */\n @State() error: string = '';\n /**\n * This event is fired when the selected value changes.\n */\n @Event() nylasFormRadioChanged!: EventEmitter<{\n value: string;\n name: string;\n label?: string;\n }>;\n\n @Watch('defaultSelectedValue')\n handleDefaultSelectedValueChange(newValue: string) {\n this.selectedValue = newValue;\n }\n\n @Watch('themeConfig')\n themeConfigChangedHandler(newVal: ThemeConfig, oldVal: ThemeConfig) {\n if (newVal === oldVal) return;\n this.applyThemeConfig(newVal);\n }\n\n applyThemeConfig(themeConfig?: ThemeConfig) {\n if (themeConfig) {\n for (const [key, value] of Object.entries(themeConfig)) {\n this.el.style.setProperty(`${key}`, value);\n }\n }\n }\n\n // Lifecycle methods\n connectedCallback() {\n // Use queueMicrotask to defer theme application until after React has set props.\n // This fixes the timing issue where connectedCallback fires before React sets themeConfig.\n queueMicrotask(() => {\n if (this.themeConfig) {\n this.applyThemeConfig(this.themeConfig);\n this.el.setAttribute('data-themed', '');\n }\n });\n }\n\n componentDidLoad() {\n this.selectedValue = this.defaultSelectedValue;\n }\n\n // Event listeners\n /**\n * Listen for the bookingFormSubmitted event to validate the input value when the form is submitted.\n */\n @Listen('bookingFormSubmitted', { target: 'document' })\n handleBookingFormSubmitted(event: CustomEvent) {\n if (this.required && !this.selectedValue) {\n this.error = this.errorMessage || `${this.label} is required.`;\n return;\n }\n if (this.error) {\n event.preventDefault();\n }\n }\n\n componentWillLoad() {\n this.el.setAttribute('component-type', this.componentType);\n }\n\n handleChange(value: string) {\n this.error = '';\n this.selectedValue = value;\n this.nylasFormRadioChanged.emit({\n value,\n name: this.name,\n label: this.label,\n });\n }\n\n render() {\n return (\n <div class=\"radio-group\">\n <slot name=\"label\">\n {this.label && (\n <p class={{ error: !!this.error }}>\n <span class=\"label\">{this.label}</span>\n {this.required && <span class=\"required\">*</span>}\n </p>\n )}\n </slot>\n {this.options.map(option => (\n <label>\n <div class=\"radio-option\">\n <input\n type=\"radio\"\n disabled={this.readOnly}\n readOnly={this.readOnly}\n title={this.readOnly ? 'read-only field' : undefined}\n name={this.name}\n value={option.value}\n checked={this.selectedValue === option.value}\n onChange={() => this.handleChange(option.value)}\n />\n <p>\n <span class=\"title\">{option.label}</span>\n <span class=\"description\">{option.description}</span>\n </p>\n </div>\n </label>\n ))}\n {this.error && <span class=\"error help-text\">{this.error}</span>}\n </div>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"radio-button-group.entry.cjs.js","mappings":";;;;AAAA,MAAM,mBAAmB,GAAG,glHAAglH;;MCa/lH,gBAAgB,GAAA,MAAA;AAL7B,IAAA,WAAA,CAAA,OAAA,EAAA;;;AAOmB,QAAA,IAAa,CAAA,aAAA,GAAW,aAAa;AAK9C,QAAA,IAAI,CAAA,IAAA,GAAW,aAAa;AAK5B,QAAA,IAAO,CAAA,OAAA,GAA6D,EAAE;AAI/B,QAAA,IAAoB,CAAA,oBAAA,GAAW,EAAE;AAUxE,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;AAIzB,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;AAQzB,QAAA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AAC,MAAM,KACtBA,OAAA,CAAA,OAAA,EAAA,IAAA,EACEA,OAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAC,cAAc,EAAA,EACvBA,OAAA,CAAA,OAAA,EAAA,EACE,IAAI,EAAC,OAAO,EACZ,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,KAAK,EAAE,IAAI,CAAC,QAAQ,GAAG,iBAAiB,GAAG,SAAS,EACpD,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,OAAO,EAAE,IAAI,CAAC,aAAa,KAAK,MAAM,CAAC,KAAK,EAC5C,QAAQ,EAAE,MAAM,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,EAC/C,CAAA,EACFA,OAAA,CAAA,GAAA,EAAA,IAAA,EACEA,OAAA,CAAA,MAAA,EAAA,EAAM,KAAK,EAAC,OAAO,IAAE,MAAM,CAAC,KAAK,CAAQ,EACzCA,OAAA,CAAA,MAAA,EAAA,EAAM,KAAK,EAAC,aAAa,EAAA,EAAE,MAAM,CAAC,WAAW,CAAQ,CACnD,CACA,CACA,CACT,CAAC,EACD,IAAI,CAAC,KAAK,IAAIA,OAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,KAAK,EAAC,iBAAiB,EAAE,EAAA,IAAI,CAAC,KAAK,CAAQ,CAC5D;;;;;;;;;;;;","names":["h"],"sources":["src/components/design-system/radio-button-group/radio-button-group.scss?tag=radio-button-group&encapsulation=shadow","src/components/design-system/radio-button-group/radio-button-group.tsx"],"sourcesContent":["@use '../../../common/styles/variables' as *;\n@use '../../../common/mixins/inputs' as *;\n\n:host {\n display: block;\n @include default-css-variables;\n width: 100%;\n}\n\n.radio-group {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n\n slot[name='label'] {\n @include input-label;\n font-size: 16px;\n\n p {\n margin: 0;\n\n &.error {\n color: var(--nylas-error);\n }\n }\n\n .error {\n color: var(--nylas-error);\n }\n }\n\n span.error {\n color: var(--nylas-error);\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n font-family: var(--nylas-font-family);\n }\n\n label {\n display: flex;\n\n font-family: var(--nylas-font-family);\n cursor: pointer;\n\n .radio-option {\n display: flex;\n align-items: flex-start;\n gap: 0.5rem;\n\n input[type='radio'] {\n cursor: pointer;\n }\n\n input[type='radio' i] {\n width: 20px;\n height: 20px;\n color: var(--nylas-primary);\n }\n\n p {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n margin: 0;\n\n .title {\n font-size: 16px;\n font-weight: 500;\n line-height: 20px;\n color: var(--nylas-base-800);\n word-break: break-word;\n overflow-wrap: break-word;\n }\n\n .description {\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n color: var(--nylas-base-600);\n }\n }\n }\n }\n}\n","// src/components/radio-group/radio-group.tsx\nimport { ThemeConfig } from '@nylas/core';\nimport { Component, h, Prop, State, Event, EventEmitter, Listen, Element, Watch } from '@stencil/core';\n\n/**\n * The `radio-button-group` component is a UI component that allows users to select a single option from a list of options.\n * This component is used in the scheduling form to input radio button type inputs.\n */\n@Component({\n tag: 'radio-button-group',\n styleUrl: 'radio-button-group.scss',\n shadow: true,\n})\nexport class RadioButtonGroup {\n @Element() el!: HTMLElement;\n private readonly componentType: string = 'radio-group';\n\n /**\n * The name of the radio group. This is used to identify the radio group when submitting a form.\n */\n @Prop() name: string = 'radio-group';\n /**\n * The list of options in the radio group.\n * Each option has a label and a value and an optional description.\n */\n @Prop() options: { label: string; value: string; description?: string }[] = [];\n /**\n * The default selected value of the radio group.\n */\n @Prop({ attribute: 'default-selected-value' }) defaultSelectedValue: string = '';\n /**\n * The label of the radio group. This is displayed above the radio group.\n * Label is optional. You can also use the slot 'label' to add a label.\n */\n @Prop() label?: string;\n /**\n * Whether the radio group is required. If true, the radio group must have a value when submitting a form.\n * Default is false. If the radio group is required and the value is empty, an error message is displayed.\n */\n @Prop() required: boolean = false;\n /**\n * The property to make the radio group read-only. If true, the radio group cannot be edited.\n */\n @Prop() readOnly: boolean = false;\n /**\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: ThemeConfig;\n /**\n * Error message to display when the radio group is required and no value is selected.\n */\n @Prop() errorMessage: string = '';\n /**\n * The selected value of the radio group.\n */\n @State() selectedValue!: string;\n /**\n * The error message state.\n */\n @State() error: string = '';\n /**\n * This event is fired when the selected value changes.\n */\n @Event() nylasFormRadioChanged!: EventEmitter<{\n value: string;\n name: string;\n label?: string;\n }>;\n\n @Watch('defaultSelectedValue')\n handleDefaultSelectedValueChange(newValue: string) {\n this.selectedValue = newValue;\n }\n\n @Watch('themeConfig')\n themeConfigChangedHandler(newVal: ThemeConfig, oldVal: ThemeConfig) {\n if (newVal === oldVal) return;\n this.applyThemeConfig(newVal);\n }\n\n applyThemeConfig(themeConfig?: ThemeConfig) {\n if (themeConfig) {\n for (const [key, value] of Object.entries(themeConfig)) {\n this.el.style.setProperty(`${key}`, value);\n }\n }\n }\n\n // Lifecycle methods\n connectedCallback() {\n // Use queueMicrotask to defer theme application until after React has set props.\n // This fixes the timing issue where connectedCallback fires before React sets themeConfig.\n queueMicrotask(() => {\n if (this.themeConfig) {\n this.applyThemeConfig(this.themeConfig);\n this.el.setAttribute('data-themed', '');\n }\n });\n }\n\n componentDidLoad() {\n this.selectedValue = this.defaultSelectedValue;\n if (this.defaultSelectedValue) {\n this.nylasFormRadioChanged.emit({\n value: this.defaultSelectedValue,\n name: this.name,\n label: this.label,\n });\n }\n }\n\n // Event listeners\n /**\n * Listen for the bookingFormSubmitted event to validate the input value when the form is submitted.\n */\n @Listen('bookingFormSubmitted', { target: 'document' })\n handleBookingFormSubmitted(event: CustomEvent) {\n if (this.required && !this.selectedValue) {\n this.error = this.errorMessage || `${this.label} is required.`;\n return;\n }\n if (this.error) {\n event.preventDefault();\n }\n }\n\n componentWillLoad() {\n this.el.setAttribute('component-type', this.componentType);\n }\n\n handleChange(value: string) {\n this.error = '';\n this.selectedValue = value;\n this.nylasFormRadioChanged.emit({\n value,\n name: this.name,\n label: this.label,\n });\n }\n\n render() {\n return (\n <div class=\"radio-group\">\n <slot name=\"label\">\n {this.label && (\n <p class={{ error: !!this.error }}>\n <span class=\"label\">{this.label}</span>\n {this.required && <span class=\"required\">*</span>}\n </p>\n )}\n </slot>\n {this.options.map(option => (\n <label>\n <div class=\"radio-option\">\n <input\n type=\"radio\"\n disabled={this.readOnly}\n readOnly={this.readOnly}\n title={this.readOnly ? 'read-only field' : undefined}\n name={this.name}\n value={option.value}\n checked={this.selectedValue === option.value}\n onChange={() => this.handleChange(option.value)}\n />\n <p>\n <span class=\"title\">{option.label}</span>\n <span class=\"description\">{option.description}</span>\n </p>\n </div>\n </label>\n ))}\n {this.error && <span class=\"error help-text\">{this.error}</span>}\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-button-group.entry.cjs.js","sources":["src/components/design-system/radio-button-group/radio-button-group.scss?tag=radio-button-group&encapsulation=shadow","src/components/design-system/radio-button-group/radio-button-group.tsx"],"sourcesContent":["@use '../../../common/styles/variables' as *;\n@use '../../../common/mixins/inputs' as *;\n\n:host {\n display: block;\n @include default-css-variables;\n width: 100%;\n}\n\n.radio-group {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n\n slot[name='label'] {\n @include input-label;\n font-size: 16px;\n\n p {\n margin: 0;\n\n &.error {\n color: var(--nylas-error);\n }\n }\n\n .error {\n color: var(--nylas-error);\n }\n }\n\n span.error {\n color: var(--nylas-error);\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n font-family: var(--nylas-font-family);\n }\n\n label {\n display: flex;\n\n font-family: var(--nylas-font-family);\n cursor: pointer;\n\n .radio-option {\n display: flex;\n align-items: flex-start;\n gap: 0.5rem;\n\n input[type='radio'] {\n cursor: pointer;\n }\n\n input[type='radio' i] {\n width: 20px;\n height: 20px;\n color: var(--nylas-primary);\n }\n\n p {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n margin: 0;\n\n .title {\n font-size: 16px;\n font-weight: 500;\n line-height: 20px;\n color: var(--nylas-base-800);\n word-break: break-word;\n overflow-wrap: break-word;\n }\n\n .description {\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n color: var(--nylas-base-600);\n }\n }\n }\n }\n}\n","// src/components/radio-group/radio-group.tsx\nimport { ThemeConfig } from '@nylas/core';\nimport { Component, h, Prop, State, Event, EventEmitter, Listen, Element, Watch } from '@stencil/core';\n\n/**\n * The `radio-button-group` component is a UI component that allows users to select a single option from a list of options.\n * This component is used in the scheduling form to input radio button type inputs.\n */\n@Component({\n tag: 'radio-button-group',\n styleUrl: 'radio-button-group.scss',\n shadow: true,\n})\nexport class RadioButtonGroup {\n @Element() el!: HTMLElement;\n private readonly componentType: string = 'radio-group';\n\n /**\n * The name of the radio group. This is used to identify the radio group when submitting a form.\n */\n @Prop() name: string = 'radio-group';\n /**\n * The list of options in the radio group.\n * Each option has a label and a value and an optional description.\n */\n @Prop() options: { label: string; value: string; description?: string }[] = [];\n /**\n * The default selected value of the radio group.\n */\n @Prop({ attribute: 'default-selected-value' }) defaultSelectedValue: string = '';\n /**\n * The label of the radio group. This is displayed above the radio group.\n * Label is optional. You can also use the slot 'label' to add a label.\n */\n @Prop() label?: string;\n /**\n * Whether the radio group is required. If true, the radio group must have a value when submitting a form.\n * Default is false. If the radio group is required and the value is empty, an error message is displayed.\n */\n @Prop() required: boolean = false;\n /**\n * The property to make the radio group read-only. If true, the radio group cannot be edited.\n */\n @Prop() readOnly: boolean = false;\n /**\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: ThemeConfig;\n /**\n * Error message to display when the radio group is required and no value is selected.\n */\n @Prop() errorMessage: string = '';\n /**\n * The selected value of the radio group.\n */\n @State() selectedValue!: string;\n /**\n * The error message state.\n */\n @State() error: string = '';\n /**\n * This event is fired when the selected value changes.\n */\n @Event() nylasFormRadioChanged!: EventEmitter<{\n value: string;\n name: string;\n label?: string;\n }>;\n\n @Watch('defaultSelectedValue')\n handleDefaultSelectedValueChange(newValue: string) {\n this.selectedValue = newValue;\n }\n\n @Watch('themeConfig')\n themeConfigChangedHandler(newVal: ThemeConfig, oldVal: ThemeConfig) {\n if (newVal === oldVal) return;\n this.applyThemeConfig(newVal);\n }\n\n applyThemeConfig(themeConfig?: ThemeConfig) {\n if (themeConfig) {\n for (const [key, value] of Object.entries(themeConfig)) {\n this.el.style.setProperty(`${key}`, value);\n }\n }\n }\n\n // Lifecycle methods\n connectedCallback() {\n // Use queueMicrotask to defer theme application until after React has set props.\n // This fixes the timing issue where connectedCallback fires before React sets themeConfig.\n queueMicrotask(() => {\n if (this.themeConfig) {\n this.applyThemeConfig(this.themeConfig);\n this.el.setAttribute('data-themed', '');\n }\n });\n }\n\n componentDidLoad() {\n this.selectedValue = this.defaultSelectedValue;\n }\n\n // Event listeners\n /**\n * Listen for the bookingFormSubmitted event to validate the input value when the form is submitted.\n */\n @Listen('bookingFormSubmitted', { target: 'document' })\n handleBookingFormSubmitted(event: CustomEvent) {\n if (this.required && !this.selectedValue) {\n this.error = this.errorMessage || `${this.label} is required.`;\n return;\n }\n if (this.error) {\n event.preventDefault();\n }\n }\n\n componentWillLoad() {\n this.el.setAttribute('component-type', this.componentType);\n }\n\n handleChange(value: string) {\n this.error = '';\n this.selectedValue = value;\n this.nylasFormRadioChanged.emit({\n value,\n name: this.name,\n label: this.label,\n });\n }\n\n render() {\n return (\n <div class=\"radio-group\">\n <slot name=\"label\">\n {this.label && (\n <p class={{ error: !!this.error }}>\n <span class=\"label\">{this.label}</span>\n {this.required && <span class=\"required\">*</span>}\n </p>\n )}\n </slot>\n {this.options.map(option => (\n <label>\n <div class=\"radio-option\">\n <input\n type=\"radio\"\n disabled={this.readOnly}\n readOnly={this.readOnly}\n title={this.readOnly ? 'read-only field' : undefined}\n name={this.name}\n value={option.value}\n checked={this.selectedValue === option.value}\n onChange={() => this.handleChange(option.value)}\n />\n <p>\n <span class=\"title\">{option.label}</span>\n <span class=\"description\">{option.description}</span>\n </p>\n </div>\n </label>\n ))}\n {this.error && <span class=\"error help-text\">{this.error}</span>}\n </div>\n );\n }\n}\n"],"names":["h"],"mappings":";;;;AAAA,MAAM,mBAAmB,GAAG,glHAAglH;;MCa/lH,gBAAgB,GAAA,MAAA;AAL7B,IAAA,WAAA,CAAA,OAAA,EAAA;;;AAOmB,QAAA,IAAa,CAAA,aAAA,GAAW,aAAa;AAK9C,QAAA,IAAI,CAAA,IAAA,GAAW,aAAa;AAK5B,QAAA,IAAO,CAAA,OAAA,GAA6D,EAAE;AAI/B,QAAA,IAAoB,CAAA,oBAAA,GAAW,EAAE;AAUxE,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;AAIzB,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;AAQzB,QAAA,IAAY,CAAA,YAAA,GAAW,EAAE;AAQxB,QAAA,IAAK,CAAA,KAAA,GAAW,EAAE;AA6G5B;AAlGC,IAAA,gCAAgC,CAAC,QAAgB,EAAA;AAC/C,QAAA,IAAI,CAAC,aAAa,GAAG,QAAQ;;IAI/B,yBAAyB,CAAC,MAAmB,EAAE,MAAmB,EAAA;QAChE,IAAI,MAAM,KAAK,MAAM;YAAE;AACvB,QAAA,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC;;AAG/B,IAAA,gBAAgB,CAAC,WAAyB,EAAA;QACxC,IAAI,WAAW,EAAE;AACf,YAAA,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;AACtD,gBAAA,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA,EAAG,GAAG,CAAA,CAAE,EAAE,KAAK,CAAC;;;;IAMhD,iBAAiB,GAAA;QAGf,cAAc,CAAC,MAAK;AAClB,YAAA,IA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,EAAA,IAAI,CAAC,KAAK,CAAQ,CAC5D;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"radio-button-group.entry.cjs.js","sources":["src/components/design-system/radio-button-group/radio-button-group.scss?tag=radio-button-group&encapsulation=shadow","src/components/design-system/radio-button-group/radio-button-group.tsx"],"sourcesContent":["@use '../../../common/styles/variables' as *;\n@use '../../../common/mixins/inputs' as *;\n\n:host {\n display: block;\n @include default-css-variables;\n width: 100%;\n}\n\n.radio-group {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n\n slot[name='label'] {\n @include input-label;\n font-size: 16px;\n\n p {\n margin: 0;\n\n &.error {\n color: var(--nylas-error);\n }\n }\n\n .error {\n color: var(--nylas-error);\n }\n }\n\n span.error {\n color: var(--nylas-error);\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n font-family: var(--nylas-font-family);\n }\n\n label {\n display: flex;\n\n font-family: var(--nylas-font-family);\n cursor: pointer;\n\n .radio-option {\n display: flex;\n align-items: flex-start;\n gap: 0.5rem;\n\n input[type='radio'] {\n cursor: pointer;\n }\n\n input[type='radio' i] {\n width: 20px;\n height: 20px;\n color: var(--nylas-primary);\n }\n\n p {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n margin: 0;\n\n .title {\n font-size: 16px;\n font-weight: 500;\n line-height: 20px;\n color: var(--nylas-base-800);\n word-break: break-word;\n overflow-wrap: break-word;\n }\n\n .description {\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n color: var(--nylas-base-600);\n }\n }\n }\n }\n}\n","// src/components/radio-group/radio-group.tsx\nimport { ThemeConfig } from '@nylas/core';\nimport { Component, h, Prop, State, Event, EventEmitter, Listen, Element, Watch } from '@stencil/core';\n\n/**\n * The `radio-button-group` component is a UI component that allows users to select a single option from a list of options.\n * This component is used in the scheduling form to input radio button type inputs.\n */\n@Component({\n tag: 'radio-button-group',\n styleUrl: 'radio-button-group.scss',\n shadow: true,\n})\nexport class RadioButtonGroup {\n @Element() el!: HTMLElement;\n private readonly componentType: string = 'radio-group';\n\n /**\n * The name of the radio group. This is used to identify the radio group when submitting a form.\n */\n @Prop() name: string = 'radio-group';\n /**\n * The list of options in the radio group.\n * Each option has a label and a value and an optional description.\n */\n @Prop() options: { label: string; value: string; description?: string }[] = [];\n /**\n * The default selected value of the radio group.\n */\n @Prop({ attribute: 'default-selected-value' }) defaultSelectedValue: string = '';\n /**\n * The label of the radio group. This is displayed above the radio group.\n * Label is optional. You can also use the slot 'label' to add a label.\n */\n @Prop() label?: string;\n /**\n * Whether the radio group is required. If true, the radio group must have a value when submitting a form.\n * Default is false. If the radio group is required and the value is empty, an error message is displayed.\n */\n @Prop() required: boolean = false;\n /**\n * The property to make the radio group read-only. If true, the radio group cannot be edited.\n */\n @Prop() readOnly: boolean = false;\n /**\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: ThemeConfig;\n /**\n * Error message to display when the radio group is required and no value is selected.\n */\n @Prop() errorMessage: string = '';\n /**\n * The selected value of the radio group.\n */\n @State() selectedValue!: string;\n /**\n * The error message state.\n */\n @State() error: string = '';\n /**\n * This event is fired when the selected value changes.\n */\n @Event() nylasFormRadioChanged!: EventEmitter<{\n value: string;\n name: string;\n label?: string;\n }>;\n\n @Watch('defaultSelectedValue')\n handleDefaultSelectedValueChange(newValue: string) {\n this.selectedValue = newValue;\n }\n\n @Watch('themeConfig')\n themeConfigChangedHandler(newVal: ThemeConfig, oldVal: ThemeConfig) {\n if (newVal === oldVal) return;\n this.applyThemeConfig(newVal);\n }\n\n applyThemeConfig(themeConfig?: ThemeConfig) {\n if (themeConfig) {\n for (const [key, value] of Object.entries(themeConfig)) {\n this.el.style.setProperty(`${key}`, value);\n }\n }\n }\n\n // Lifecycle methods\n connectedCallback() {\n // Use queueMicrotask to defer theme application until after React has set props.\n // This fixes the timing issue where connectedCallback fires before React sets themeConfig.\n queueMicrotask(() => {\n if (this.themeConfig) {\n this.applyThemeConfig(this.themeConfig);\n this.el.setAttribute('data-themed', '');\n }\n });\n }\n\n componentDidLoad() {\n this.selectedValue = this.defaultSelectedValue;\n if (this.defaultSelectedValue) {\n this.nylasFormRadioChanged.emit({\n value: this.defaultSelectedValue,\n name: this.name,\n label: this.label,\n });\n }\n }\n\n // Event listeners\n /**\n * Listen for the bookingFormSubmitted event to validate the input value when the form is submitted.\n */\n @Listen('bookingFormSubmitted', { target: 'document' })\n handleBookingFormSubmitted(event: CustomEvent) {\n if (this.required && !this.selectedValue) {\n this.error = this.errorMessage || `${this.label} is required.`;\n return;\n }\n if (this.error) {\n event.preventDefault();\n }\n }\n\n componentWillLoad() {\n this.el.setAttribute('component-type', this.componentType);\n }\n\n handleChange(value: string) {\n this.error = '';\n this.selectedValue = value;\n this.nylasFormRadioChanged.emit({\n value,\n name: this.name,\n label: this.label,\n });\n }\n\n render() {\n return (\n <div class=\"radio-group\">\n <slot name=\"label\">\n {this.label && (\n <p class={{ error: !!this.error }}>\n <span class=\"label\">{this.label}</span>\n {this.required && <span class=\"required\">*</span>}\n </p>\n )}\n </slot>\n {this.options.map(option => (\n <label>\n <div class=\"radio-option\">\n <input\n type=\"radio\"\n disabled={this.readOnly}\n readOnly={this.readOnly}\n title={this.readOnly ? 'read-only field' : undefined}\n name={this.name}\n value={option.value}\n checked={this.selectedValue === option.value}\n onChange={() => this.handleChange(option.value)}\n />\n <p>\n <span class=\"title\">{option.label}</span>\n <span class=\"description\">{option.description}</span>\n </p>\n </div>\n </label>\n ))}\n {this.error && <span class=\"error help-text\">{this.error}</span>}\n </div>\n );\n }\n}\n"],"names":["h"],"mappings":";;;;AAAA,MAAM,mBAAmB,GAAG,glHAAglH;;MCa/lH,gBAAgB,GAAA,MAAA;AAL7B,IAAA,WAAA,CAAA,OAAA,EAAA;;;AAOmB,QAAA,IAAa,CAAA,aAAA,GAAW,aAAa;AAK9C,QAAA,IAAI,CAAA,IAAA,GAAW,aAAa;AAK5B,QAAA,IAAO,CAAA,OAAA,GAA6D,EAAE;AAI/B,QAAA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A,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,UAAU,EAAA,EAAA,GAAA,CAAS,CAC/C,CACL,CACI,EACN,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,KACtBA,OAAA,CAAA,OAAA,EAAA,IAAA,EACEA,OAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAC,cAAc,EAAA,EACvBA,OAAA,CAAA,OAAA,EAAA,EACE,IAAI,EAAC,OAAO,EACZ,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,KAAK,EAAE,IAAI,CAAC,QAAQ,GAAG,iBAAiB,GAAG,SAAS,EACpD,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,OAAO,EAAE,IAAI,CAAC,aAAa,KAAK,MAAM,CAAC,KAAK,EAC5C,QAAQ,EAAE,MAAM,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,EAC/C,CAAA,EACFA,OAAA,CAAA,GAAA,EAAA,IAAA,EACEA,OAAA,CAAA,MAAA,EAAA,EAAM,KAAK,EAAC,OAAO,IAAE,MAAM,CAAC,KAAK,CAAQ,EACzCA,OAAA,CAAA,MAAA,EAAA,EAAM,KAAK,EAAC,aAAa,EAAA,EAAE,MAAM,CAAC,WAAW,CAAQ,CACnD,CACA,CACA,CACT,CAAC,EACD,IAAI,CAAC,KAAK,IAAIA,OAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,KAAK,EAAC,iBAAiB,EAAE,EAAA,IAAI,CAAC,KAAK,CAAQ,CAC5D;;;;;;;;;;;;"}
|
|
@@ -30,11 +30,11 @@ var ComponentErrorType;
|
|
|
30
30
|
ComponentErrorType["no_config_id"] = "no_config_id";
|
|
31
31
|
})(ComponentErrorType || (ComponentErrorType = {}));
|
|
32
32
|
|
|
33
|
-
const version = '2.5.
|
|
33
|
+
const version = '2.5.5';
|
|
34
34
|
|
|
35
35
|
exports.o = o;
|
|
36
36
|
exports.u = u;
|
|
37
37
|
exports.version = version;
|
|
38
|
-
//# sourceMappingURL=version-
|
|
38
|
+
//# sourceMappingURL=version-y-IXeOX1.js.map
|
|
39
39
|
|
|
40
|
-
//# sourceMappingURL=version-
|
|
40
|
+
//# sourceMappingURL=version-y-IXeOX1.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version-Dfv6nyNu.js","sources":["../nylas-js-core/dist/index.es.js","src/types/index.ts","src/version.ts"],"sourcesContent":["var t = Object.defineProperty;\nvar c = (r, n, s) => n in r ? t(r, n, { enumerable: !0, configurable: !0, writable: !0, value: s }) : r[n] = s;\nvar a = (r, n, s) => (c(r, typeof n != \"symbol\" ? n + \"\" : n, s), s);\nvar u = /* @__PURE__ */ ((r) => (r.Error = \"error\", r.Warning = \"warning\", r.Info = \"info\", r.Success = \"success\", r))(u || {});\nconst e = (r) => r !== null && typeof r == \"object\" && \"data\" in r, o = (r) => r !== null && typeof r == \"object\" && \"error\" in r;\nclass E extends Error {\n constructor(s) {\n super(s == null ? void 0 : s.message);\n a(this, \"apiError\");\n this.name = \"NylasAPIError\", this.stack = new Error().stack, this.apiError = s;\n }\n}\nexport {\n u as NotificationType,\n E as NylasAPIError,\n o as isNylasErrorResponse,\n e as isNylasSuccessResponse\n};\n","export interface NylasResponse<Data = any> {\n request_id: string;\n data?: Data;\n error?: {\n message: string;\n type: string;\n };\n}\n\n// Avaliability\nexport interface OpenHours {\n days: number[];\n exDates: string[];\n timezone: string;\n start: string;\n end: string;\n}\n\nexport interface SpecificTimeAvailability {\n date: string;\n start: string;\n end: string;\n}\n\nexport interface MeetingBuffer {\n before: number;\n after: number;\n}\n\n// Scheduling\nexport interface UpdateConfiguration extends Omit<Configuration, 'id'> {}\n\nexport interface ParticipantAvailability {\n calendar_ids: string[];\n open_hours?: OpenHours[];\n}\n\nexport type NylasSchedulerBookingParticipant = { name: string; email: string; nameReadOnly?: boolean; emailReadOnly?: boolean };\n\nexport type NylasSchedulerBookingData = {\n primaryParticipant: NylasSchedulerBookingParticipant;\n startTime?: Date;\n endTime?: Date;\n timezone?: string;\n language?: string;\n guests?: NylasSchedulerBookingParticipant[];\n additionalFields?: Record<\n string,\n {\n value: string;\n type?: string;\n readOnly?: boolean;\n }\n >;\n};\n\nexport type OpenHour = {\n days: number[]; // [1, 2, 3, 4, 5]\n start: string; // \"09:00\"\n end: string; // \"17:00\"\n timezone: string; // \"America/Los_Angeles\"\n};\n\nexport type Timeslot = {\n start_time: Date;\n end_time: Date;\n emails?: string[];\n capacity?: number;\n event_id?: string;\n master_id?: string;\n calendar_id?: string;\n};\n\nexport type ThemeConfig = Partial<{\n '--nylas-primary': string;\n '--nylas-info': string;\n '--nylas-success': string;\n '--nylas-warning': string;\n '--nylas-error': string;\n '--nylas-error-pressed': string;\n '--nylas-base-0': string;\n '--nylas-base-25': string;\n '--nylas-base-50': string;\n '--nylas-base-100': string;\n '--nylas-base-200': string;\n '--nylas-base-300': string;\n '--nylas-base-400': string;\n '--nylas-base-500': string;\n '--nylas-base-600': string;\n '--nylas-base-700': string;\n '--nylas-base-800': string;\n '--nylas-base-900': string;\n '--nylas-base-950': string;\n '--nylas-color-blue-50': string;\n '--nylas-color-blue-100': string;\n '--nylas-color-blue-300': string;\n '--nylas-color-blue-500': string;\n '--nylas-color-blue-700': string;\n '--nylas-color-blue-900': string;\n '--nylas-color-red-50': string;\n '--nylas-color-red-100': string;\n '--nylas-color-red-300': string;\n '--nylas-color-red-500': string;\n '--nylas-color-red-700': string;\n '--nylas-color-red-900': string;\n '--nylas-color-green-50': string;\n '--nylas-color-green-100': string;\n '--nylas-color-green-300': string;\n '--nylas-color-green-500': string;\n '--nylas-color-green-700': string;\n '--nylas-color-green-900': string;\n '--nylas-color-yellow-50': string;\n '--nylas-color-yellow-100': string;\n '--nylas-color-yellow-300': string;\n '--nylas-color-yellow-500': string;\n '--nylas-color-yellow-700': string;\n '--nylas-color-yellow-900': string;\n '--nylas-color-purple-50': string;\n '--nylas-color-purple-100': string;\n '--nylas-color-purple-300': string;\n '--nylas-color-purple-500': string;\n '--nylas-color-purple-700': string;\n '--nylas-color-purple-900': string;\n '--nylas-color-sky-50': string;\n '--nylas-color-sky-100': string;\n '--nylas-color-sky-300': string;\n '--nylas-color-sky-500': string;\n '--nylas-color-sky-700': string;\n '--nylas-color-sky-900': string;\n '--nylas-color-black': string;\n '--nylas-color-grey-900': string;\n '--nylas-color-grey-800': string;\n '--nylas-color-grey-700': string;\n '--nylas-color-grey-600': string;\n '--nylas-color-grey-500': string;\n '--nylas-color-grey-400': string;\n '--nylas-color-grey-300': string;\n '--nylas-color-grey-200': string;\n '--nylas-color-grey-100': string;\n '--nylas-color-grey-50': string;\n '--nylas-color-white': string;\n '--nylas-font-family': string;\n '--nylas-font-size': string;\n '--nylas-border-radius': string;\n '--nylas-border-radius-2x': string;\n '--nylas-border-radius-3x': string;\n}>;\n\nexport enum NotificationType {\n Error = 'error',\n Warning = 'warning',\n Info = 'info',\n Success = 'success',\n}\n\nexport type Notification = {\n id: string;\n type: NotificationType;\n title: string;\n code?: number;\n category: string;\n description?: string;\n ttl?: number | 'none';\n};\n\nexport type BookingType = 'booking' | 'organizer-confirmation' | 'custom-confirmation';\n\nexport type AvailabilityMethod = 'max-fairness' | 'max-availability' | 'collective';\n\nexport type ConferenceProvider = 'GoogleMeetConferenceProvider' | 'MicrosoftTeamsConferenceProvider' | 'ZoomConferenceProvider' | 'OnlineMeetingProviderMicrosoftTeams';\n\nexport type ReminderMethod = 'email' | 'webhook';\n\nexport interface Rules {\n availability_method: AvailabilityMethod;\n buffer: MeetingBuffer;\n default_open_hours: OpenHours[];\n round_robin_group_id: string;\n}\n\nexport interface ConferenceDetail {\n meeting_code?: string; // zoom, GTM, microsoft teams\n password?: string; // zoom, webex\n url?: string; // zoom, webex, GTM, meet, microsoft teams\n pin?: string; // webex, meet\n phone?: string[]; // GTM, meet, microsoft teams\n}\n\nexport interface Conference {\n provider?: ConferenceProvider;\n details?: ConferenceDetail;\n autocreate?: { [key: string]: any };\n}\n\nexport interface ParticipantBooking {\n calendar_id: string;\n}\n\nexport interface Participant {\n email: string;\n name?: string;\n is_organizer?: boolean;\n availability?: ParticipantAvailability;\n booking?: ParticipantBooking;\n specific_time_availability?: SpecificTimeAvailability[];\n timezone?: string;\n}\n\nexport interface EventReminder {\n type: ReminderMethod;\n minutes_before_event: number;\n recipient?: string;\n email_subject?: string;\n}\n\nexport interface Availability {\n duration_minutes: number;\n interval_minutes?: number;\n round_to?: number;\n availability_rules?: Rules;\n}\n\nexport interface NotetakerActionItemsSettings {\n custom_instructions?: string;\n}\n\nexport interface NotetakerSummarySettings {\n custom_instructions?: string;\n}\n\nexport interface NotetakerMeetingSettings {\n action_items?: boolean;\n action_items_settings?: NotetakerActionItemsSettings;\n audio_recording?: boolean;\n summary?: boolean;\n summary_settings?: NotetakerSummarySettings;\n transcription?: boolean;\n video_recording?: boolean;\n}\n\nexport interface Notetaker {\n visible?: boolean; // default is false\n enabled?: boolean; // default is false\n name?: string;\n meeting_settings?: NotetakerMeetingSettings;\n}\n\nexport interface EventBooking {\n title: string;\n description?: string;\n location?: string;\n timezone?: string;\n booking_type: BookingType;\n conferencing?: Conference;\n hide_participants?: boolean;\n disable_emails?: boolean;\n reminders?: EventReminder[];\n notetaker?: Notetaker;\n}\n\nexport interface Appearance {\n color?: string;\n submit_button_label?: string;\n thank_you_message?: string;\n company_logo_url?: string;\n}\n\nexport interface Scheduler {\n available_days_in_future?: number;\n min_cancellation_notice: number;\n min_booking_notice?: number;\n rescheduling_url?: string;\n cancellation_url?: string;\n organizer_confirmation_url?: string;\n cancellation_policy?: string;\n hide_additional_guests?: boolean;\n hide_cancellation_options?: boolean;\n hide_rescheduling_options?: boolean;\n additional_fields?: Record<string, AdditionalFields>;\n email_template?: EmailTemplate;\n confirmation_redirect_url?: string;\n}\nexport interface AdditionalFields {\n type: string;\n required: boolean;\n order: number;\n options?: string[];\n label?: string;\n default?: string;\n}\n\nexport interface EmailTemplate {\n logo: string;\n booking_confirmed: BookingConfirmed;\n show_nylas_branding: boolean;\n organizer_locale: string;\n}\n\nexport interface BookingConfirmed {\n title: string;\n body: string;\n}\n\nexport interface Configuration {\n id: string;\n version: string;\n type?: string;\n requires_session_auth?: boolean;\n participants: Participant[];\n availability: Availability;\n event_booking: EventBooking;\n scheduler: Partial<Scheduler>;\n slug: string;\n appearance: Appearance;\n name: string;\n}\n\nexport interface GroupBooking {\n booking_type: BookingType; // Only 'booking' is supported\n disable_emails?: boolean;\n reminders?: EventReminder[];\n conferencing?: Conference;\n calendar_id: string;\n default_capacity: number;\n}\n\nexport interface GroupConfiguration {\n id: string;\n name: string;\n slug: string;\n requires_session_auth?: boolean;\n type: 'group';\n group_booking: GroupBooking;\n scheduler: Scheduler;\n appearance: Appearance;\n}\n\nexport interface Creator {\n name: string;\n email: string;\n}\nexport interface AdditionalParticipant {\n name: string;\n email: string;\n grant_id?: string;\n calendars: {\n id: string;\n name: string;\n object?: 'calendar';\n is_primary?: boolean;\n is_owned_by_user?: boolean;\n read_only?: boolean;\n timezone?: string;\n }[];\n}\n\n/**\n * Parameters for fetching participant info when loading an existing config for edit.\n * Used when the config has participants (emails) but full AdditionalParticipant\n * data (calendars, etc.) needs to be fetched from an external source.\n */\nexport interface ParticipantFetchParams {\n /** Emails of participants to fetch full info for */\n emails: string[];\n /** Optional grant ID to scope the fetch (e.g. for multi-account) */\n grantId?: string;\n}\n\n/**\n * Callback to fetch full participant info by emails.\n * Called when loading an existing config for edit.\n */\nexport type ParticipantFetch = (params: ParticipantFetchParams) => Promise<AdditionalParticipant[]>;\n\n/**\n * Callback to search participants by query (for autocomplete).\n */\nexport type ParticipantSearch = (query: string) => Promise<AdditionalParticipant[]>;\n\nexport interface GroupEvent {\n id?: string;\n title: string;\n busy: boolean;\n participants: NylasSchedulerBookingParticipant[];\n resources: {\n name: string;\n email: string;\n }[];\n description: string;\n when: {\n start_time: number;\n end_time: number;\n start_timezone?: string;\n end_timezone?: string;\n };\n location: string;\n recurrence: string[];\n capacity: number;\n}\n\nexport type RecurrenceUpdateOption = 'this' | 'future' | 'all';\nexport type RecurrenceDeleteOption = 'this' | 'future' | 'all';\n\nexport type Snapshot = {\n busy: boolean;\n calendar_id: string;\n hide_participants: boolean;\n ical_uid: string;\n organizer: {\n name: string;\n email: string;\n };\n participants: {\n email: string;\n status: string;\n }[];\n resources: any[];\n read_only: boolean;\n recurrence: string[];\n reminders: {\n use_default: boolean;\n overrides: any[];\n };\n title: string;\n description?: string;\n location?: string;\n conferencing?: Conference;\n visibility: string;\n creator: {\n name: string;\n email: string;\n };\n html_link: string;\n grant_id: string;\n id: string;\n object: string;\n status: string;\n when: {\n start_timezone: string;\n end_timezone: string;\n object: string;\n start_time: number; // Unix timestamp\n end_time: number; // Unix timestamp\n };\n created_at: number; // Unix timestamp\n updated_at: number; // Unix timestamp\n};\n\nexport interface GroupEventAPIData {\n event: EventDetails;\n group_event_info?: GroupEventInfo;\n}\n\nexport type EventDetails = {\n busy: boolean;\n calendar_id: string;\n conferencing: {\n provider: ConferenceProvider;\n details: {\n meeting_code: string;\n url: string;\n pin: string;\n phone: string[];\n };\n };\n hide_participants: boolean;\n ical_uid: string;\n organizer: {\n name: string;\n email: string;\n };\n participants: Array<{\n email: string;\n status: 'yes' | 'no' | 'noreply';\n comment?: string;\n }>;\n resources: string[];\n read_only: boolean;\n reminders: {\n use_default: boolean;\n overrides: Array<{\n method?: string;\n minutes?: number;\n }>;\n };\n title: string;\n description?: string;\n location?: string;\n visibility: 'default' | 'public' | 'private';\n creator: {\n name: string;\n email: string;\n };\n html_link: string;\n master_event_id: string;\n color_id: string;\n grant_id: string;\n id: string;\n object: 'event';\n status: 'confirmed' | 'tentative' | 'cancelled';\n when: {\n start_timezone: string;\n end_timezone: string;\n object: 'timespan';\n start_time: number;\n end_time: number;\n };\n created_at: number;\n updated_at: number;\n original_start_time: number;\n};\n\nexport type GroupEventInfo = {\n event_id: string;\n calendar_id: string;\n master_id: string;\n config_id: string;\n capacity: number;\n type: 'updated_event' | 'single_event' | 'master_event';\n booked: boolean;\n finished: boolean;\n participants: Array<{\n email: string;\n is_organizer: boolean;\n name: string;\n timezone: string;\n }>;\n snapshot: any | null;\n snapshot_expires_at: number;\n rrule: string[] | null;\n exceptions: {\n event_id: string;\n capacity: number;\n participants: Array<{\n email: string;\n is_organizer: boolean;\n name: string;\n timezone: string;\n }>;\n }[];\n};\n\nexport type ImportGroupEventDetails = {\n event_id: string;\n calendar_id: string;\n capacity: number;\n participants: Participant[];\n organizer: {\n name: string;\n email: string;\n };\n};\n\nexport type ImportGroupEventResponse = {\n imported_events: string[];\n import_failed: {\n event_id: string;\n reason: string;\n }[];\n};\n\nexport enum ErrorCategory {\n Component = 'component',\n Api = 'api',\n Auth = 'auth',\n}\n\nexport interface ErrorDetails {\n title: string;\n message: string;\n category: ErrorCategory;\n}\n\nexport enum ComponentErrorType {\n endtime_not_in_future = 'endtime_not_in_future',\n no_booking_info = 'no_booking_info',\n no_timeslot_selected = 'no_timeslot_selected',\n no_timezone_selected = 'no_timezone_selected',\n no_booking_id = 'no_booking_id',\n no_salt = 'no_salt',\n invalid_start_time = 'invalid_start_time',\n invalid_end_time = 'invalid_end_time',\n invalid_timezone = 'invalid_timezone',\n no_config_id = 'no_config_id',\n}\n\nexport interface KeyPoint {\n time: number;\n text: string;\n active?: boolean;\n}\n","export const version = '2.5.4-canary-20260414201801';\n"],"names":["NotificationType","ErrorCategory"],"mappings":";;AAGG,IAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,GAAG,OAAO,EAAE,CAAC,CAAC,OAAO,GAAG,SAAS,EAAE,CAAC,CAAC,IAAI,GAAG,MAAM,EAAE,CAAC,CAAC,OAAO,GAAG,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE;AACzH,MAA+D,CAAC,GAAG,CAAC,CA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AXW,kBAAkB,KAAlB,kBAAkB,GAW7B,EAAA,CAAA,CAAA;;ACxkBM,MAAM,OAAO,GAAG;;;;;;"}
|
|
1
|
+
{"version":3,"file":"version-y-IXeOX1.js","sources":["../nylas-js-core/dist/index.es.js","src/types/index.ts","src/version.ts"],"sourcesContent":["var t = Object.defineProperty;\nvar c = (r, n, s) => n in r ? t(r, n, { enumerable: !0, configurable: !0, writable: !0, value: s }) : r[n] = s;\nvar a = (r, n, s) => (c(r, typeof n != \"symbol\" ? n + \"\" : n, s), s);\nvar u = /* @__PURE__ */ ((r) => (r.Error = \"error\", r.Warning = \"warning\", r.Info = \"info\", r.Success = \"success\", r))(u || {});\nconst e = (r) => r !== null && typeof r == \"object\" && \"data\" in r, o = (r) => r !== null && typeof r == \"object\" && \"error\" in r;\nclass E extends Error {\n constructor(s) {\n super(s == null ? void 0 : s.message);\n a(this, \"apiError\");\n this.name = \"NylasAPIError\", this.stack = new Error().stack, this.apiError = s;\n }\n}\nexport {\n u as NotificationType,\n E as NylasAPIError,\n o as isNylasErrorResponse,\n e as isNylasSuccessResponse\n};\n","export interface NylasResponse<Data = any> {\n request_id: string;\n data?: Data;\n error?: {\n message: string;\n type: string;\n };\n}\n\n// Avaliability\nexport interface OpenHours {\n days: number[];\n exDates: string[];\n timezone: string;\n start: string;\n end: string;\n}\n\nexport interface SpecificTimeAvailability {\n date: string;\n start: string;\n end: string;\n}\n\nexport interface MeetingBuffer {\n before: number;\n after: number;\n}\n\n// Scheduling\nexport interface UpdateConfiguration extends Omit<Configuration, 'id'> {}\n\nexport interface ParticipantAvailability {\n calendar_ids: string[];\n open_hours?: OpenHours[];\n}\n\nexport type NylasSchedulerBookingParticipant = { name: string; email: string; nameReadOnly?: boolean; emailReadOnly?: boolean };\n\nexport type NylasSchedulerBookingData = {\n primaryParticipant: NylasSchedulerBookingParticipant;\n startTime?: Date;\n endTime?: Date;\n timezone?: string;\n language?: string;\n guests?: NylasSchedulerBookingParticipant[];\n additionalFields?: Record<\n string,\n {\n value: string;\n type?: string;\n readOnly?: boolean;\n }\n >;\n};\n\nexport type OpenHour = {\n days: number[]; // [1, 2, 3, 4, 5]\n start: string; // \"09:00\"\n end: string; // \"17:00\"\n timezone: string; // \"America/Los_Angeles\"\n};\n\nexport type Timeslot = {\n start_time: Date;\n end_time: Date;\n emails?: string[];\n capacity?: number;\n event_id?: string;\n master_id?: string;\n calendar_id?: string;\n};\n\nexport type ThemeConfig = Partial<{\n '--nylas-primary': string;\n '--nylas-info': string;\n '--nylas-success': string;\n '--nylas-warning': string;\n '--nylas-error': string;\n '--nylas-error-pressed': string;\n '--nylas-base-0': string;\n '--nylas-base-25': string;\n '--nylas-base-50': string;\n '--nylas-base-100': string;\n '--nylas-base-200': string;\n '--nylas-base-300': string;\n '--nylas-base-400': string;\n '--nylas-base-500': string;\n '--nylas-base-600': string;\n '--nylas-base-700': string;\n '--nylas-base-800': string;\n '--nylas-base-900': string;\n '--nylas-base-950': string;\n '--nylas-color-blue-50': string;\n '--nylas-color-blue-100': string;\n '--nylas-color-blue-300': string;\n '--nylas-color-blue-500': string;\n '--nylas-color-blue-700': string;\n '--nylas-color-blue-900': string;\n '--nylas-color-red-50': string;\n '--nylas-color-red-100': string;\n '--nylas-color-red-300': string;\n '--nylas-color-red-500': string;\n '--nylas-color-red-700': string;\n '--nylas-color-red-900': string;\n '--nylas-color-green-50': string;\n '--nylas-color-green-100': string;\n '--nylas-color-green-300': string;\n '--nylas-color-green-500': string;\n '--nylas-color-green-700': string;\n '--nylas-color-green-900': string;\n '--nylas-color-yellow-50': string;\n '--nylas-color-yellow-100': string;\n '--nylas-color-yellow-300': string;\n '--nylas-color-yellow-500': string;\n '--nylas-color-yellow-700': string;\n '--nylas-color-yellow-900': string;\n '--nylas-color-purple-50': string;\n '--nylas-color-purple-100': string;\n '--nylas-color-purple-300': string;\n '--nylas-color-purple-500': string;\n '--nylas-color-purple-700': string;\n '--nylas-color-purple-900': string;\n '--nylas-color-sky-50': string;\n '--nylas-color-sky-100': string;\n '--nylas-color-sky-300': string;\n '--nylas-color-sky-500': string;\n '--nylas-color-sky-700': string;\n '--nylas-color-sky-900': string;\n '--nylas-color-black': string;\n '--nylas-color-grey-900': string;\n '--nylas-color-grey-800': string;\n '--nylas-color-grey-700': string;\n '--nylas-color-grey-600': string;\n '--nylas-color-grey-500': string;\n '--nylas-color-grey-400': string;\n '--nylas-color-grey-300': string;\n '--nylas-color-grey-200': string;\n '--nylas-color-grey-100': string;\n '--nylas-color-grey-50': string;\n '--nylas-color-white': string;\n '--nylas-font-family': string;\n '--nylas-font-size': string;\n '--nylas-border-radius': string;\n '--nylas-border-radius-2x': string;\n '--nylas-border-radius-3x': string;\n}>;\n\nexport enum NotificationType {\n Error = 'error',\n Warning = 'warning',\n Info = 'info',\n Success = 'success',\n}\n\nexport type Notification = {\n id: string;\n type: NotificationType;\n title: string;\n code?: number;\n category: string;\n description?: string;\n ttl?: number | 'none';\n};\n\nexport type BookingType = 'booking' | 'organizer-confirmation' | 'custom-confirmation';\n\nexport type AvailabilityMethod = 'max-fairness' | 'max-availability' | 'collective';\n\nexport type ConferenceProvider = 'GoogleMeetConferenceProvider' | 'MicrosoftTeamsConferenceProvider' | 'ZoomConferenceProvider' | 'OnlineMeetingProviderMicrosoftTeams';\n\nexport type ReminderMethod = 'email' | 'webhook';\n\nexport interface Rules {\n availability_method: AvailabilityMethod;\n buffer: MeetingBuffer;\n default_open_hours: OpenHours[];\n round_robin_group_id: string;\n}\n\nexport interface ConferenceDetail {\n meeting_code?: string; // zoom, GTM, microsoft teams\n password?: string; // zoom, webex\n url?: string; // zoom, webex, GTM, meet, microsoft teams\n pin?: string; // webex, meet\n phone?: string[]; // GTM, meet, microsoft teams\n}\n\nexport interface Conference {\n provider?: ConferenceProvider;\n details?: ConferenceDetail;\n autocreate?: { [key: string]: any };\n}\n\nexport interface ParticipantBooking {\n calendar_id: string;\n}\n\nexport interface Participant {\n email: string;\n name?: string;\n is_organizer?: boolean;\n availability?: ParticipantAvailability;\n booking?: ParticipantBooking;\n specific_time_availability?: SpecificTimeAvailability[];\n timezone?: string;\n}\n\nexport interface EventReminder {\n type: ReminderMethod;\n minutes_before_event: number;\n recipient?: string;\n email_subject?: string;\n}\n\nexport interface Availability {\n duration_minutes: number;\n interval_minutes?: number;\n round_to?: number;\n availability_rules?: Rules;\n}\n\nexport interface NotetakerActionItemsSettings {\n custom_instructions?: string;\n}\n\nexport interface NotetakerSummarySettings {\n custom_instructions?: string;\n}\n\nexport interface NotetakerMeetingSettings {\n action_items?: boolean;\n action_items_settings?: NotetakerActionItemsSettings;\n audio_recording?: boolean;\n summary?: boolean;\n summary_settings?: NotetakerSummarySettings;\n transcription?: boolean;\n video_recording?: boolean;\n}\n\nexport interface Notetaker {\n visible?: boolean; // default is false\n enabled?: boolean; // default is false\n name?: string;\n meeting_settings?: NotetakerMeetingSettings;\n}\n\nexport interface EventBooking {\n title: string;\n description?: string;\n location?: string;\n timezone?: string;\n booking_type: BookingType;\n conferencing?: Conference;\n hide_participants?: boolean;\n disable_emails?: boolean;\n reminders?: EventReminder[];\n notetaker?: Notetaker;\n}\n\nexport interface Appearance {\n color?: string;\n submit_button_label?: string;\n thank_you_message?: string;\n company_logo_url?: string;\n}\n\nexport interface Scheduler {\n available_days_in_future?: number;\n min_cancellation_notice: number;\n min_booking_notice?: number;\n rescheduling_url?: string;\n cancellation_url?: string;\n organizer_confirmation_url?: string;\n cancellation_policy?: string;\n hide_additional_guests?: boolean;\n hide_cancellation_options?: boolean;\n hide_rescheduling_options?: boolean;\n additional_fields?: Record<string, AdditionalFields>;\n email_template?: EmailTemplate;\n confirmation_redirect_url?: string;\n}\nexport interface AdditionalFields {\n type: string;\n required: boolean;\n order: number;\n options?: string[];\n label?: string;\n default?: string;\n}\n\nexport interface EmailTemplate {\n logo: string;\n booking_confirmed: BookingConfirmed;\n show_nylas_branding: boolean;\n organizer_locale: string;\n}\n\nexport interface BookingConfirmed {\n title: string;\n body: string;\n}\n\nexport interface Configuration {\n id: string;\n version: string;\n type?: string;\n requires_session_auth?: boolean;\n participants: Participant[];\n availability: Availability;\n event_booking: EventBooking;\n scheduler: Partial<Scheduler>;\n slug: string;\n appearance: Appearance;\n name: string;\n}\n\nexport interface GroupBooking {\n booking_type: BookingType; // Only 'booking' is supported\n disable_emails?: boolean;\n reminders?: EventReminder[];\n conferencing?: Conference;\n calendar_id: string;\n default_capacity: number;\n}\n\nexport interface GroupConfiguration {\n id: string;\n name: string;\n slug: string;\n requires_session_auth?: boolean;\n type: 'group';\n group_booking: GroupBooking;\n scheduler: Scheduler;\n appearance: Appearance;\n}\n\nexport interface Creator {\n name: string;\n email: string;\n}\nexport interface AdditionalParticipant {\n name: string;\n email: string;\n grant_id?: string;\n calendars: {\n id: string;\n name: string;\n object?: 'calendar';\n is_primary?: boolean;\n is_owned_by_user?: boolean;\n read_only?: boolean;\n timezone?: string;\n }[];\n}\n\n/**\n * Parameters for fetching participant info when loading an existing config for edit.\n * Used when the config has participants (emails) but full AdditionalParticipant\n * data (calendars, etc.) needs to be fetched from an external source.\n */\nexport interface ParticipantFetchParams {\n /** Emails of participants to fetch full info for */\n emails: string[];\n /** Optional grant ID to scope the fetch (e.g. for multi-account) */\n grantId?: string;\n}\n\n/**\n * Callback to fetch full participant info by emails.\n * Called when loading an existing config for edit.\n */\nexport type ParticipantFetch = (params: ParticipantFetchParams) => Promise<AdditionalParticipant[]>;\n\n/**\n * Callback to search participants by query (for autocomplete).\n */\nexport type ParticipantSearch = (query: string) => Promise<AdditionalParticipant[]>;\n\nexport interface GroupEvent {\n id?: string;\n title: string;\n busy: boolean;\n participants: NylasSchedulerBookingParticipant[];\n resources: {\n name: string;\n email: string;\n }[];\n description: string;\n when: {\n start_time: number;\n end_time: number;\n start_timezone?: string;\n end_timezone?: string;\n };\n location: string;\n recurrence: string[];\n capacity: number;\n}\n\nexport type RecurrenceUpdateOption = 'this' | 'future' | 'all';\nexport type RecurrenceDeleteOption = 'this' | 'future' | 'all';\n\nexport type Snapshot = {\n busy: boolean;\n calendar_id: string;\n hide_participants: boolean;\n ical_uid: string;\n organizer: {\n name: string;\n email: string;\n };\n participants: {\n email: string;\n status: string;\n }[];\n resources: any[];\n read_only: boolean;\n recurrence: string[];\n reminders: {\n use_default: boolean;\n overrides: any[];\n };\n title: string;\n description?: string;\n location?: string;\n conferencing?: Conference;\n visibility: string;\n creator: {\n name: string;\n email: string;\n };\n html_link: string;\n grant_id: string;\n id: string;\n object: string;\n status: string;\n when: {\n start_timezone: string;\n end_timezone: string;\n object: string;\n start_time: number; // Unix timestamp\n end_time: number; // Unix timestamp\n };\n created_at: number; // Unix timestamp\n updated_at: number; // Unix timestamp\n};\n\nexport interface GroupEventAPIData {\n event: EventDetails;\n group_event_info?: GroupEventInfo;\n}\n\nexport type EventDetails = {\n busy: boolean;\n calendar_id: string;\n conferencing: {\n provider: ConferenceProvider;\n details: {\n meeting_code: string;\n url: string;\n pin: string;\n phone: string[];\n };\n };\n hide_participants: boolean;\n ical_uid: string;\n organizer: {\n name: string;\n email: string;\n };\n participants: Array<{\n email: string;\n status: 'yes' | 'no' | 'noreply';\n comment?: string;\n }>;\n resources: string[];\n read_only: boolean;\n reminders: {\n use_default: boolean;\n overrides: Array<{\n method?: string;\n minutes?: number;\n }>;\n };\n title: string;\n description?: string;\n location?: string;\n visibility: 'default' | 'public' | 'private';\n creator: {\n name: string;\n email: string;\n };\n html_link: string;\n master_event_id: string;\n color_id: string;\n grant_id: string;\n id: string;\n object: 'event';\n status: 'confirmed' | 'tentative' | 'cancelled';\n when: {\n start_timezone: string;\n end_timezone: string;\n object: 'timespan';\n start_time: number;\n end_time: number;\n };\n created_at: number;\n updated_at: number;\n original_start_time: number;\n};\n\nexport type GroupEventInfo = {\n event_id: string;\n calendar_id: string;\n master_id: string;\n config_id: string;\n capacity: number;\n type: 'updated_event' | 'single_event' | 'master_event';\n booked: boolean;\n finished: boolean;\n participants: Array<{\n email: string;\n is_organizer: boolean;\n name: string;\n timezone: string;\n }>;\n snapshot: any | null;\n snapshot_expires_at: number;\n rrule: string[] | null;\n exceptions: {\n event_id: string;\n capacity: number;\n participants: Array<{\n email: string;\n is_organizer: boolean;\n name: string;\n timezone: string;\n }>;\n }[];\n};\n\nexport type ImportGroupEventDetails = {\n event_id: string;\n calendar_id: string;\n capacity: number;\n participants: Participant[];\n organizer: {\n name: string;\n email: string;\n };\n};\n\nexport type ImportGroupEventResponse = {\n imported_events: string[];\n import_failed: {\n event_id: string;\n reason: string;\n }[];\n};\n\nexport enum ErrorCategory {\n Component = 'component',\n Api = 'api',\n Auth = 'auth',\n}\n\nexport interface ErrorDetails {\n title: string;\n message: string;\n category: ErrorCategory;\n}\n\nexport enum ComponentErrorType {\n endtime_not_in_future = 'endtime_not_in_future',\n no_booking_info = 'no_booking_info',\n no_timeslot_selected = 'no_timeslot_selected',\n no_timezone_selected = 'no_timezone_selected',\n no_booking_id = 'no_booking_id',\n no_salt = 'no_salt',\n invalid_start_time = 'invalid_start_time',\n invalid_end_time = 'invalid_end_time',\n invalid_timezone = 'invalid_timezone',\n no_config_id = 'no_config_id',\n}\n\nexport interface KeyPoint {\n time: number;\n text: string;\n active?: boolean;\n}\n","export const version = '2.5.5';\n"],"names":["NotificationType","ErrorCategory"],"mappings":";;AAGG,IAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,GAAG,OAAO,EAAE,CAAC,CAAC,OAAO,GAAG,SAAS,EAAE,CAAC,CAAC,IAAI,GAAG,MAAM,EAAE,CAAC,CAAC,OAAO,GAAG,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE;AACzH,MAA+D,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,IAAI,OAAO,CAAC,IAAI,QAAQ,IAAI,OAAO,IAAI;;ACgJpHA;AAAZ,CAAA,UAAY,gBAAgB,EAAA;AAC1B,IAAA,gBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,gBAAA,CA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oresToProp, eventToProps, storeToProps, connectorToProp, localPropsToProp, element } = component;
|
|
132
132
|
eventToProps?.forEach((customEventHandler, propKey) => {
|
|
133
|
-
const nylasConnector = this.nylasConnector;
|
|
134
133
|
const handler = async (event) => {
|
|
134
|
+
const nylasConnector = this.nylasConnector;
|
|
135
135
|
debug(`[${this.hostTagName}] (registerComponent) Handling "${component.name}" prop "${String(propKey)}" event.`, { event });
|
|
136
136
|
if (propKey in eventOverrides) {
|
|
137
137
|
debug(`[${this.hostTagName}] (registerComponent) Found event override for "${String(propKey)}" event. Calling override.`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstract-provider.js","sourceRoot":"","sources":["../../../src/common/abstract-provider.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACpF,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AA6B/C,MAAM,OAAgB,qBAAqB;IAyEzC,YAAY,IAAiB,EAAE,MAAc,EAAE,iCAA0C,IAAI,EAAE,cAAkC;QAhD1H,mCAA8B,GAAY,IAAI,CAAC;QAO/C,yBAAoB,GAAqD,EAAE,CAAC;QAO5E,2BAAsB,GAA2E,IAAI,GAAG,EAAE,CAAC;QAO3G,+BAA0B,GAAgD,IAAI,GAAG,EAAE,CAAC;QAMnF,oBAAe,GAAqC,IAAI,GAAG,EAAE,CAAC;QAC9D,wBAAmB,GAAY,KAAK,CAAC;QAqB3C,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;QAErC,KAAK,CAAC,IAAI,IAAI,CAAC,WAAW,qCAAqC,EAAE,EAAE,cAAc,EAAE,CAAC,CAAC;QAErF,IAAI,CAAC,iBAAiB,GA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,WAAW,OAAO,qBAAqB,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;YAC/H,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAKD,IAAY,WAAW;QACrB,OAAO,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,gBAAgB,CAAC;IAC/D,CAAC;CACF;AAED,MAAM,OAAO,iBAAgE,SAAQ,qBAAwB;CAAG","sourcesContent":["import { RegisteredComponent } from '@/common/register-component';\nimport { BaseNylasConnectorInterface } from '@/connector/connector-interface';\nimport { debug, formatEventName, uniqueID, isTestEnvironment } from '@/utils/utils';\nimport { deepEqual } from '@/utils/deep-equal';\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 * Queue for batching prop updates to prevent multiple re-renders from rapid state changes.\n * Updates are flushed on the next microtask.\n */\n private propUpdateQueue: Map<ElementID, Map<string, any>> = new Map();\n private propUpdateScheduled: boolean = false;\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 deterministic data id in tests, otherwise a random id\n const deterministicId = isTestEnvironment() ? this.computeDeterministicId(component.element as HTMLElement) : undefined;\n component.element.dataset.nylasId = elementId || deterministicId || 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\n // Wait for component to be fully hydrated, not just defined\n // Check if component has componentOnReady method (Stencil components)\n if (typeof (component.element as any).componentOnReady === 'function') {\n try {\n await (component.element as any).componentOnReady();\n debug(`[${this.hostTagName}] (registerComponent) Component \"${component.element.localName}\" is now ready`);\n } catch (error) {\n debug(`[${this.hostTagName}] (registerComponent) Error waiting for component \"${component.element.localName}\" to be ready:`, error);\n }\n } else {\n // Fallback: wait for hydration class or a short delay\n await new Promise<void>(resolve => {\n const checkHydration = () => {\n if (component.element.classList?.contains('hydrated')) {\n resolve();\n } else {\n // Wait a bit and check again\n setTimeout(() => {\n if (component.element.classList?.contains('hydrated')) {\n resolve();\n } else {\n // Resolve anyway after timeout to avoid blocking\n resolve();\n }\n }, 10);\n }\n };\n checkHydration();\n });\n }\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 * Compute a deterministic nylas id for an element during tests.\n * Preference order:\n * - existing element id attribute\n * - existing element name attribute\n * - <tag>-<indexWithinHostOfSameTag>\n */\n private computeDeterministicId(element: HTMLElement): string {\n const idAttr = element.getAttribute('id');\n if (idAttr && idAttr.trim().length > 0) return idAttr.trim();\n\n const nameAttr = element.getAttribute('name');\n if (nameAttr && nameAttr.trim().length > 0) return nameAttr.trim();\n\n const tag = element.tagName.toLowerCase();\n try {\n const siblingsSameTag = Array.from(this.host?.querySelectorAll(tag) || []) as HTMLElement[];\n const idx = siblingsSameTag.indexOf(element);\n const indexOneBased = idx >= 0 ? idx + 1 : siblingsSameTag.length + 1;\n return `${tag}-${indexOneBased}`;\n } catch (_e) {\n return `${tag}-1`;\n }\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;\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\n // Use deep equality for objects/arrays, === for primitives\n if (deepEqual(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 // 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\n // Queue prop updates for batching instead of updating immediately\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 // Queue the update instead of applying immediately\n self.queuePropUpdate(elementId, propKey.toString(), stateValue);\n debug(`[${self.hostTagName}] (setupStoreListeners) Queued \"${component.name}\" prop \"${propKey.toString()}\" update for \"${stateKey.toString()}\" value.`, { stateValue });\n });\n },\n });\n });\n }\n\n /**\n * Queue a prop update for batching.\n * Updates are flushed on the next microtask to prevent multiple re-renders.\n */\n private queuePropUpdate(elementId: ElementID, propKey: string, value: any): void {\n if (!this.propUpdateQueue.has(elementId)) {\n this.propUpdateQueue.set(elementId, new Map());\n }\n this.propUpdateQueue.get(elementId)!.set(propKey, value);\n\n if (!this.propUpdateScheduled) {\n this.propUpdateScheduled = true;\n Promise.resolve().then(() => {\n this.flushPropUpdates();\n });\n }\n }\n\n /**\n * Flush all queued prop updates.\n */\n private flushPropUpdates(): void {\n this.propUpdateScheduled = false;\n const queue = new Map(this.propUpdateQueue);\n this.propUpdateQueue.clear();\n\n queue.forEach((props, elementId) => {\n const component = this.registeredComponents[elementId];\n if (!component) {\n debug(`[${this.hostTagName}] (flushPropUpdates) Component \"${elementId}\" not found. Skipping.`);\n return;\n }\n\n props.forEach((value, propKey) => {\n (component.element as { [key: string]: any })[propKey] = value;\n debug(`[${this.hostTagName}] (flushPropUpdates) Setting \"${component.name}\" prop \"${propKey}\" to batched value.`, { value });\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"]}
|
|
1
|
+
{"version":3,"file":"abstract-provider.js","sourceRoot":"","sources":["../../../src/common/abstract-provider.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACpF,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AA6B/C,MAAM,OAAgB,qBAAqB;IAyEzC,YAAY,IAAiB,EAAE,MAAc,EAAE,iCAA0C,IAAI,EAAE,c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AC,eAAe,CAAC,CAAC;QAC5C,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC;QAE7B,KAAK,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE;YACjC,MAAM,SAAS,GAAG,IAAI,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC;YACvD,IAAI,CAAC,SAAS,EAAE,CAAC;gBACf,KAAK,CAAC,IAAI,IAAI,CAAC,WAAW,mCAAmC,SAAS,wBAAwB,CAAC,CAAC;gBAChG,OAAO;YACT,CAAC;YAED,KAAK,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;gBAC9B,SAAS,CAAC,OAAkC,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC;gBAC/D,KAAK,CAAC,IAAI,IAAI,CAAC,WAAW,iCAAiC,SAAS,CAAC,IAAI,WAAW,OAAO,qBAAqB,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;YAC/H,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAKD,IAAY,WAAW;QACrB,OAAO,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,gBAAgB,CAAC;IAC/D,CAAC;CACF;AAED,MAAM,OAAO,iBAAgE,SAAQ,qBAAwB;CAAG","sourcesContent":["import { RegisteredComponent } from '@/common/register-component';\nimport { BaseNylasConnectorInterface } from '@/connector/connector-interface';\nimport { debug, formatEventName, uniqueID, isTestEnvironment } from '@/utils/utils';\nimport { deepEqual } from '@/utils/deep-equal';\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 * Queue for batching prop updates to prevent multiple re-renders from rapid state changes.\n * Updates are flushed on the next microtask.\n */\n private propUpdateQueue: Map<ElementID, Map<string, any>> = new Map();\n private propUpdateScheduled: boolean = false;\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 deterministic data id in tests, otherwise a random id\n const deterministicId = isTestEnvironment() ? this.computeDeterministicId(component.element as HTMLElement) : undefined;\n component.element.dataset.nylasId = elementId || deterministicId || 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\n // Wait for component to be fully hydrated, not just defined\n // Check if component has componentOnReady method (Stencil components)\n if (typeof (component.element as any).componentOnReady === 'function') {\n try {\n await (component.element as any).componentOnReady();\n debug(`[${this.hostTagName}] (registerComponent) Component \"${component.element.localName}\" is now ready`);\n } catch (error) {\n debug(`[${this.hostTagName}] (registerComponent) Error waiting for component \"${component.element.localName}\" to be ready:`, error);\n }\n } else {\n // Fallback: wait for hydration class or a short delay\n await new Promise<void>(resolve => {\n const checkHydration = () => {\n if (component.element.classList?.contains('hydrated')) {\n resolve();\n } else {\n // Wait a bit and check again\n setTimeout(() => {\n if (component.element.classList?.contains('hydrated')) {\n resolve();\n } else {\n // Resolve anyway after timeout to avoid blocking\n resolve();\n }\n }, 10);\n }\n };\n checkHydration();\n });\n }\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 handler = async (event: CustomEvent<any>) => {\n // Read nylasConnector at call time rather than at registration time.\n // This is necessary for the deferred-init path (CUST-5295): child components\n // register before the connector is created, so capturing `this.nylasConnector`\n // at registration time would snapshot `undefined`. By the time the user actually\n // clicks (dateSelected, timeslotSelected, etc.), performDeferredInit() has\n // already set this.nylasConnector to the real connector instance.\n const nylasConnector = this.nylasConnector;\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 * Compute a deterministic nylas id for an element during tests.\n * Preference order:\n * - existing element id attribute\n * - existing element name attribute\n * - <tag>-<indexWithinHostOfSameTag>\n */\n private computeDeterministicId(element: HTMLElement): string {\n const idAttr = element.getAttribute('id');\n if (idAttr && idAttr.trim().length > 0) return idAttr.trim();\n\n const nameAttr = element.getAttribute('name');\n if (nameAttr && nameAttr.trim().length > 0) return nameAttr.trim();\n\n const tag = element.tagName.toLowerCase();\n try {\n const siblingsSameTag = Array.from(this.host?.querySelectorAll(tag) || []) as HTMLElement[];\n const idx = siblingsSameTag.indexOf(element);\n const indexOneBased = idx >= 0 ? idx + 1 : siblingsSameTag.length + 1;\n return `${tag}-${indexOneBased}`;\n } catch (_e) {\n return `${tag}-1`;\n }\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;\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\n // Use deep equality for objects/arrays, === for primitives\n if (deepEqual(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 // 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\n // Queue prop updates for batching instead of updating immediately\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 // Queue the update instead of applying immediately\n self.queuePropUpdate(elementId, propKey.toString(), stateValue);\n debug(`[${self.hostTagName}] (setupStoreListeners) Queued \"${component.name}\" prop \"${propKey.toString()}\" update for \"${stateKey.toString()}\" value.`, { stateValue });\n });\n },\n });\n });\n }\n\n /**\n * Queue a prop update for batching.\n * Updates are flushed on the next microtask to prevent multiple re-renders.\n */\n private queuePropUpdate(elementId: ElementID, propKey: string, value: any): void {\n if (!this.propUpdateQueue.has(elementId)) {\n this.propUpdateQueue.set(elementId, new Map());\n }\n this.propUpdateQueue.get(elementId)!.set(propKey, value);\n\n if (!this.propUpdateScheduled) {\n this.propUpdateScheduled = true;\n Promise.resolve().then(() => {\n this.flushPropUpdates();\n });\n }\n }\n\n /**\n * Flush all queued prop updates.\n */\n private flushPropUpdates(): void {\n this.propUpdateScheduled = false;\n const queue = new Map(this.propUpdateQueue);\n this.propUpdateQueue.clear();\n\n queue.forEach((props, elementId) => {\n const component = this.registeredComponents[elementId];\n if (!component) {\n debug(`[${this.hostTagName}] (flushPropUpdates) Component \"${elementId}\" not found. Skipping.`);\n return;\n }\n\n props.forEach((value, propKey) => {\n (component.element as { [key: string]: any })[propKey] = value;\n debug(`[${this.hostTagName}] (flushPropUpdates) Setting \"${component.name}\" prop \"${propKey}\" to batched value.`, { value });\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"]}
|
|
@@ -35,6 +35,13 @@ export class RadioButtonGroup {
|
|
|
35
35
|
}
|
|
36
36
|
componentDidLoad() {
|
|
37
37
|
this.selectedValue = this.defaultSelectedValue;
|
|
38
|
+
if (this.defaultSelectedValue) {
|
|
39
|
+
this.nylasFormRadioChanged.emit({
|
|
40
|
+
value: this.defaultSelectedValue,
|
|
41
|
+
name: this.name,
|
|
42
|
+
label: this.label,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
38
45
|
}
|
|
39
46
|
handleBookingFormSubmitted(event) {
|
|
40
47
|
if (this.required && !this.selectedValue) {
|
|
@@ -58,7 +65,7 @@ export class RadioButtonGroup {
|
|
|
58
65
|
});
|
|
59
66
|
}
|
|
60
67
|
render() {
|
|
61
|
-
return (h("div", { key: '
|
|
68
|
+
return (h("div", { key: '7d4f9dbc6fb35ba0d6ec854c67b04f320888bff0', class: "radio-group" }, h("slot", { key: '4e8f1ebf95e25021f49c0973bb16609730303c2d', name: "label" }, this.label && (h("p", { key: 'a944e18fac56caeb5582028c38d055b399cd6693', class: { error: !!this.error } }, h("span", { key: '2730c691418b2890b52b182d0389eb4a6ea42edb', class: "label" }, this.label), this.required && h("span", { key: 'ec2d3213ab090cf75a9499c03f64b1cf8ac860b8', class: "required" }, "*")))), this.options.map(option => (h("label", null, h("div", { class: "radio-option" }, h("input", { type: "radio", disabled: this.readOnly, readOnly: this.readOnly, title: this.readOnly ? 'read-only field' : undefined, name: this.name, value: option.value, checked: this.selectedValue === option.value, onChange: () => this.handleChange(option.value) }), h("p", null, h("span", { class: "title" }, option.label), h("span", { class: "description" }, option.description)))))), this.error && h("span", { key: 'bbe79d56c58731dd23fd68f6efea548faffcbc25', class: "error help-text" }, this.error)));
|
|
62
69
|
}
|
|
63
70
|
static get is() { return "radio-button-group"; }
|
|
64
71
|
static get encapsulation() { return "shadow"; }
|
package/dist/collection/components/design-system/radio-button-group/radio-button-group.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-button-group.js","sourceRoot":"","sources":["../../../../../src/components/design-system/radio-button-group/radio-button-group.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAgB,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAWvG,MAAM,OAAO,gBAAgB;IAL7B;QAOmB,kBAAa,GAAW,aAAa,CAAC;QAK/C,SAAI,GAAW,aAAa,CAAC;QAK7B,YAAO,GAA6D,EAAE,CAAC;QAIhC,yBAAoB,GAAW,EAAE,CAAC;QAUzE,aAAQ,GAAY,KAAK,CAAC;QAI1B,aAAQ,GAAY,KAAK,CAAC;QAQ1B,iBAAY,GAAW,EAAE,CAAC;QAQzB,UAAK,GAAW,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"radio-button-group.js","sourceRoot":"","sources":["../../../../../src/components/design-system/radio-button-group/radio-button-group.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAgB,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAWvG,MAAM,OAAO,gBAAgB;IAL7B;QAOmB,kBAAa,GAAW,aAAa,CAAC;QAK/C,SAAI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BACvB,aACE,IAAI,EAAC,OAAO,EACZ,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS,EACpD,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,OAAO,EAAE,IAAI,CAAC,aAAa,KAAK,MAAM,CAAC,KAAK,EAC5C,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,GAC/C;oBACF;wBACE,YAAM,KAAK,EAAC,OAAO,IAAE,MAAM,CAAC,KAAK,CAAQ;wBACzC,YAAM,KAAK,EAAC,aAAa,IAAE,MAAM,CAAC,WAAW,CAAQ,CACnD,CACA,CACA,CACT,CAAC;YACD,IAAI,CAAC,KAAK,IAAI,6DAAM,KAAK,EAAC,iBAAiB,IAAE,IAAI,CAAC,KAAK,CAAQ,CAC5D,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["// src/components/radio-group/radio-group.tsx\nimport { ThemeConfig } from '@nylas/core';\nimport { Component, h, Prop, State, Event, EventEmitter, Listen, Element, Watch } from '@stencil/core';\n\n/**\n * The `radio-button-group` component is a UI component that allows users to select a single option from a list of options.\n * This component is used in the scheduling form to input radio button type inputs.\n */\n@Component({\n tag: 'radio-button-group',\n styleUrl: 'radio-button-group.scss',\n shadow: true,\n})\nexport class RadioButtonGroup {\n @Element() el!: HTMLElement;\n private readonly componentType: string = 'radio-group';\n\n /**\n * The name of the radio group. This is used to identify the radio group when submitting a form.\n */\n @Prop() name: string = 'radio-group';\n /**\n * The list of options in the radio group.\n * Each option has a label and a value and an optional description.\n */\n @Prop() options: { label: string; value: string; description?: string }[] = [];\n /**\n * The default selected value of the radio group.\n */\n @Prop({ attribute: 'default-selected-value' }) defaultSelectedValue: string = '';\n /**\n * The label of the radio group. This is displayed above the radio group.\n * Label is optional. You can also use the slot 'label' to add a label.\n */\n @Prop() label?: string;\n /**\n * Whether the radio group is required. If true, the radio group must have a value when submitting a form.\n * Default is false. If the radio group is required and the value is empty, an error message is displayed.\n */\n @Prop() required: boolean = false;\n /**\n * The property to make the radio group read-only. If true, the radio group cannot be edited.\n */\n @Prop() readOnly: boolean = false;\n /**\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: ThemeConfig;\n /**\n * Error message to display when the radio group is required and no value is selected.\n */\n @Prop() errorMessage: string = '';\n /**\n * The selected value of the radio group.\n */\n @State() selectedValue!: string;\n /**\n * The error message state.\n */\n @State() error: string = '';\n /**\n * This event is fired when the selected value changes.\n */\n @Event() nylasFormRadioChanged!: EventEmitter<{\n value: string;\n name: string;\n label?: string;\n }>;\n\n @Watch('defaultSelectedValue')\n handleDefaultSelectedValueChange(newValue: string) {\n this.selectedValue = newValue;\n }\n\n @Watch('themeConfig')\n themeConfigChangedHandler(newVal: ThemeConfig, oldVal: ThemeConfig) {\n if (newVal === oldVal) return;\n this.applyThemeConfig(newVal);\n }\n\n applyThemeConfig(themeConfig?: ThemeConfig) {\n if (themeConfig) {\n for (const [key, value] of Object.entries(themeConfig)) {\n this.el.style.setProperty(`${key}`, value);\n }\n }\n }\n\n // Lifecycle methods\n connectedCallback() {\n // Use queueMicrotask to defer theme application until after React has set props.\n // This fixes the timing issue where connectedCallback fires before React sets themeConfig.\n queueMicrotask(() => {\n if (this.themeConfig) {\n this.applyThemeConfig(this.themeConfig);\n this.el.setAttribute('data-themed', '');\n }\n });\n }\n\n componentDidLoad() {\n this.selectedValue = this.defaultSelectedValue;\n if (this.defaultSelectedValue) {\n this.nylasFormRadioChanged.emit({\n value: this.defaultSelectedValue,\n name: this.name,\n label: this.label,\n });\n }\n }\n\n // Event listeners\n /**\n * Listen for the bookingFormSubmitted event to validate the input value when the form is submitted.\n */\n @Listen('bookingFormSubmitted', { target: 'document' })\n handleBookingFormSubmitted(event: CustomEvent) {\n if (this.required && !this.selectedValue) {\n this.error = this.errorMessage || `${this.label} is required.`;\n return;\n }\n if (this.error) {\n event.preventDefault();\n }\n }\n\n componentWillLoad() {\n this.el.setAttribute('component-type', this.componentType);\n }\n\n handleChange(value: string) {\n this.error = '';\n this.selectedValue = value;\n this.nylasFormRadioChanged.emit({\n value,\n name: this.name,\n label: this.label,\n });\n }\n\n render() {\n return (\n <div class=\"radio-group\">\n <slot name=\"label\">\n {this.label && (\n <p class={{ error: !!this.error }}>\n <span class=\"label\">{this.label}</span>\n {this.required && <span class=\"required\">*</span>}\n </p>\n )}\n </slot>\n {this.options.map(option => (\n <label>\n <div class=\"radio-option\">\n <input\n type=\"radio\"\n disabled={this.readOnly}\n readOnly={this.readOnly}\n title={this.readOnly ? 'read-only field' : undefined}\n name={this.name}\n value={option.value}\n checked={this.selectedValue === option.value}\n onChange={() => this.handleChange(option.value)}\n />\n <p>\n <span class=\"title\">{option.label}</span>\n <span class=\"description\">{option.description}</span>\n </p>\n </div>\n </label>\n ))}\n {this.error && <span class=\"error help-text\">{this.error}</span>}\n </div>\n );\n }\n}\n"]}
|
|
@@ -30,11 +30,16 @@ export class NylasScheduling {
|
|
|
30
30
|
}
|
|
31
31
|
connectedCallback() {
|
|
32
32
|
debug(`[nylas-scheduler] connectedCallback`);
|
|
33
|
+
void this.schedulerApiUrlChanged;
|
|
34
|
+
void this.sessionIdChanged;
|
|
35
|
+
void this.configurationIdChanged;
|
|
36
|
+
void this.slugChanged;
|
|
37
|
+
void this.clientIdChanged;
|
|
33
38
|
}
|
|
34
39
|
async componentWillLoad() {
|
|
35
40
|
debug(`[nylas-scheduler] Component will load`);
|
|
36
41
|
this.version = version;
|
|
37
|
-
await Promise
|
|
42
|
+
await new Promise(resolve => setTimeout(resolve, 0));
|
|
38
43
|
if (this.enableUserFeedback && !Sentry.isInitialized()) {
|
|
39
44
|
Sentry.init({
|
|
40
45
|
dsn: 'https://9d5731f1c77ca84c9ed3fb9b3ccf7ee1@o74852.ingest.us.sentry.io/4507889638178816',
|