@nylas/web-elements 0.0.0-canary-20251007200552 → 0.0.0-canary-20251008142712
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 +1571 -1480
- package/dist/cdn/nylas-scheduling/nylas-scheduling.es.js +100 -9
- package/dist/cjs/calendar-agenda-fill-icon_38.cjs.entry.js +1 -1
- package/dist/cjs/calendar-agenda-fill-icon_38.cjs.entry.js.map +1 -1
- package/dist/cjs/info-icon.tooltip-component.entry.cjs.js.map +1 -1
- package/dist/cjs/info-icon_2.cjs.entry.js +151 -6
- package/dist/cjs/info-icon_2.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/nylas-web-elements.cjs.js +1 -1
- package/dist/collection/components/design-system/tooltip-component/toolitp-component.js +181 -8
- package/dist/collection/components/design-system/tooltip-component/toolitp-component.js.map +1 -1
- package/dist/collection/components/design-system/tooltip-component/tooltip-component.css +64 -52
- package/dist/collection/components/scheduler-editor/nylas-specific-time-availability-picker/nylas-specific-time-availability-picker.css +4 -1
- package/dist/components/nylas-additional-participants.js +1 -1
- package/dist/components/nylas-availability-picker.js +1 -1
- package/dist/components/nylas-booking-calendar-picker.js +1 -1
- package/dist/components/nylas-booking-confirmation-redirect.js +1 -1
- package/dist/components/nylas-booking-confirmation-type.js +1 -1
- package/dist/components/nylas-booking-form.js +1 -1
- package/dist/components/nylas-buffer-time.js +1 -1
- package/dist/components/nylas-cancel-booking-form.js +1 -1
- package/dist/components/nylas-cancellation-policy.js +1 -1
- package/dist/components/nylas-confirmation-email.js +1 -1
- package/dist/components/nylas-connected-calendars.js +1 -1
- package/dist/components/nylas-custom-event-slug.js +1 -1
- package/dist/components/nylas-customize-booking-settings.js +1 -1
- package/dist/components/nylas-disable-emails.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-event-calendar.js +1 -1
- package/dist/components/nylas-event-capacity.js +1 -1
- package/dist/components/nylas-event-description.js +1 -1
- package/dist/components/nylas-event-location.js +1 -1
- package/dist/components/nylas-event-title.js +1 -1
- package/dist/components/nylas-feedback-form.js +1 -1
- package/dist/components/nylas-limit-future-bookings.js +1 -1
- package/dist/components/nylas-min-booking-notice.js +1 -1
- package/dist/components/nylas-min-cancellation-notice.js +1 -1
- package/dist/components/nylas-only-specific-time-availability.js +1 -1
- package/dist/components/nylas-page-name.js +1 -1
- package/dist/components/nylas-participant-booking-calendars.js +1 -1
- package/dist/components/nylas-participants-custom-availability.js +1 -1
- package/dist/components/nylas-reminder-emails.js +1 -1
- package/dist/components/nylas-scheduler-editor.js +33 -33
- package/dist/components/nylas-scheduling-method.js +1 -1
- package/dist/components/nylas-scheduling.js +5 -5
- package/dist/components/nylas-specific-time-availability-picker.js +1 -1
- package/dist/components/nylas-timeslot-interval.js +1 -1
- package/dist/components/{p-BqGEzlcQ.js → p-0q9sgr4i.js} +3 -3
- package/dist/components/{p-BqGEzlcQ.js.map → p-0q9sgr4i.js.map} +1 -1
- package/dist/components/{p-CwwJpDaO.js → p-B1psbbaJ.js} +3 -3
- package/dist/components/{p-CwwJpDaO.js.map → p-B1psbbaJ.js.map} +1 -1
- package/dist/components/{p-CbLs5Pk5.js → p-BFJmQasy.js} +4 -4
- package/dist/components/{p-CbLs5Pk5.js.map → p-BFJmQasy.js.map} +1 -1
- package/dist/components/{p-wzGjOUhU.js → p-BNmwL6-W.js} +4 -4
- package/dist/components/{p-wzGjOUhU.js.map → p-BNmwL6-W.js.map} +1 -1
- package/dist/components/{p-B-b3QZAX.js → p-Bfh24JOX.js} +3 -3
- package/dist/components/{p-B-b3QZAX.js.map → p-Bfh24JOX.js.map} +1 -1
- package/dist/components/{p-pjEuYJeR.js → p-Bk42j8OF.js} +3 -3
- package/dist/components/{p-pjEuYJeR.js.map → p-Bk42j8OF.js.map} +1 -1
- package/dist/components/{p-CXG_Ufsz.js → p-BpnsgdmY.js} +3 -3
- package/dist/components/{p-CXG_Ufsz.js.map → p-BpnsgdmY.js.map} +1 -1
- package/dist/components/{p-BbV-LHPC.js → p-BvCN7qQY.js} +3 -3
- package/dist/components/{p-BbV-LHPC.js.map → p-BvCN7qQY.js.map} +1 -1
- package/dist/components/{p-BT4xqZtB.js → p-BzvnGJrN.js} +4 -4
- package/dist/components/p-BzvnGJrN.js.map +1 -0
- package/dist/components/{p-BD1JIBI-.js → p-C20VhZn-.js} +3 -3
- package/dist/components/{p-BD1JIBI-.js.map → p-C20VhZn-.js.map} +1 -1
- package/dist/components/{p-2bXE-Vfv.js → p-C2lhNwAw.js} +3 -3
- package/dist/components/{p-2bXE-Vfv.js.map → p-C2lhNwAw.js.map} +1 -1
- package/dist/components/{p-C_lK5fHn.js → p-CD62_7I9.js} +23 -23
- package/dist/components/{p-C_lK5fHn.js.map → p-CD62_7I9.js.map} +1 -1
- package/dist/components/{p-B6C_M9Jr.js → p-CE9apE9h.js} +31 -31
- package/dist/components/{p-B6C_M9Jr.js.map → p-CE9apE9h.js.map} +1 -1
- package/dist/components/{p-DyYv3p94.js → p-CHxdUdXp.js} +3 -3
- package/dist/components/{p-DyYv3p94.js.map → p-CHxdUdXp.js.map} +1 -1
- package/dist/components/{p-Dj99qyJ3.js → p-CXsByTmW.js} +5 -5
- package/dist/components/{p-Dj99qyJ3.js.map → p-CXsByTmW.js.map} +1 -1
- package/dist/components/p-CelgQqJU.js +192 -0
- package/dist/components/p-CelgQqJU.js.map +1 -0
- package/dist/components/{p-COiHEYHM.js → p-CfSWSyFi.js} +4 -4
- package/dist/components/{p-COiHEYHM.js.map → p-CfSWSyFi.js.map} +1 -1
- package/dist/components/{p-BRLg6H-E.js → p-CfVpiH3G.js} +3 -3
- package/dist/components/{p-BRLg6H-E.js.map → p-CfVpiH3G.js.map} +1 -1
- package/dist/components/{p-Dzb4S0Ql.js → p-CnNHkU1E.js} +8 -8
- package/dist/components/{p-Dzb4S0Ql.js.map → p-CnNHkU1E.js.map} +1 -1
- package/dist/components/{p-Bt1Mbyo5.js → p-Coh5sPoS.js} +3 -3
- package/dist/components/{p-Bt1Mbyo5.js.map → p-Coh5sPoS.js.map} +1 -1
- package/dist/components/{p-DCescN3V.js → p-D3Qd1n_P.js} +3 -3
- package/dist/components/{p-DCescN3V.js.map → p-D3Qd1n_P.js.map} +1 -1
- package/dist/components/{p-BCPPCoYO.js → p-D4UyMIEq.js} +3 -3
- package/dist/components/{p-BCPPCoYO.js.map → p-D4UyMIEq.js.map} +1 -1
- package/dist/components/{p-nPHjU3jr.js → p-D5qrC2lA.js} +3 -3
- package/dist/components/{p-nPHjU3jr.js.map → p-D5qrC2lA.js.map} +1 -1
- package/dist/components/{p-Cffi7D48.js → p-DJajrAgg.js} +3 -3
- package/dist/components/{p-Cffi7D48.js.map → p-DJajrAgg.js.map} +1 -1
- package/dist/components/{p-B6clCy4A.js → p-DQZVOwPH.js} +3 -3
- package/dist/components/{p-B6clCy4A.js.map → p-DQZVOwPH.js.map} +1 -1
- package/dist/components/{p-B0o5xunX.js → p-DhtHRxq1.js} +3 -3
- package/dist/components/{p-B0o5xunX.js.map → p-DhtHRxq1.js.map} +1 -1
- package/dist/components/{p-CSWehFEc.js → p-DlQNeDle.js} +3 -3
- package/dist/components/{p-CSWehFEc.js.map → p-DlQNeDle.js.map} +1 -1
- package/dist/components/{p-CJcp_GoJ.js → p-DosSBspi.js} +3 -3
- package/dist/components/{p-CJcp_GoJ.js.map → p-DosSBspi.js.map} +1 -1
- package/dist/components/{p-jTVu8Py-.js → p-ENcpb5di.js} +4 -4
- package/dist/components/{p-jTVu8Py-.js.map → p-ENcpb5di.js.map} +1 -1
- package/dist/components/{p-BW7q0oI_.js → p-G063shWV.js} +3 -3
- package/dist/components/{p-BW7q0oI_.js.map → p-G063shWV.js.map} +1 -1
- package/dist/components/{p-6cQLqvfv.js → p-_Y7InDst.js} +3 -3
- package/dist/components/{p-6cQLqvfv.js.map → p-_Y7InDst.js.map} +1 -1
- package/dist/components/{p-BELvPT6B.js → p-gi3_0xjc.js} +3 -3
- package/dist/components/{p-BELvPT6B.js.map → p-gi3_0xjc.js.map} +1 -1
- package/dist/components/{p-BFr5rgUi.js → p-kop9MA9K.js} +3 -3
- package/dist/components/{p-BFr5rgUi.js.map → p-kop9MA9K.js.map} +1 -1
- package/dist/components/{p-CLUzc1bh.js → p-lfia5tlH.js} +3 -3
- package/dist/components/{p-CLUzc1bh.js.map → p-lfia5tlH.js.map} +1 -1
- package/dist/components/{p-Dqb4SZcE.js → p-vzH8CS8d.js} +4 -4
- package/dist/components/{p-Dqb4SZcE.js.map → p-vzH8CS8d.js.map} +1 -1
- package/dist/components/textarea-component.js +1 -1
- package/dist/components/tooltip-component.js +1 -1
- package/dist/esm/calendar-agenda-fill-icon_38.entry.js +1 -1
- package/dist/esm/calendar-agenda-fill-icon_38.entry.js.map +1 -1
- package/dist/esm/info-icon.tooltip-component.entry.js.map +1 -1
- package/dist/esm/info-icon_2.entry.js +151 -6
- package/dist/esm/info-icon_2.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/nylas-web-elements.js +1 -1
- package/dist/nylas-web-elements/info-icon.tooltip-component.entry.esm.js.map +1 -1
- package/dist/nylas-web-elements/nylas-web-elements.esm.js +1 -1
- package/dist/nylas-web-elements/p-2890bb11.entry.js +2 -0
- package/dist/nylas-web-elements/p-2890bb11.entry.js.map +1 -0
- package/dist/nylas-web-elements/{p-2fcae310.entry.js → p-545e93e8.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-2fcae310.entry.js.map → p-545e93e8.entry.js.map} +1 -1
- package/dist/types/components/design-system/tooltip-component/toolitp-component.d.ts +25 -3
- package/dist/types/components.d.ts +8 -4
- package/package.json +4 -3
- package/dist/components/p-BT4xqZtB.js.map +0 -1
- package/dist/components/p-C6fgjGAL.js +0 -43
- package/dist/components/p-C6fgjGAL.js.map +0 -1
- package/dist/nylas-web-elements/p-4eb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EAAA,YAAY,CAAQ,CAC5F,CACW,CACf,CACF,CACR,CACG,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAtEX,UAAA,CAAA;AAVC,IAAA,iBAAiB,CAA2G;AAC3H,QAAA,IAAI,EAAE,yBAAyB;QAC/B,YAAY,EAAE,IAAI,GAAG,CAAC;YACpB,CAAC,uCAAuC,EAAE,uBAAuB,CAAC;YAClE,CAAC,kCAAkC,EAAE,kBAAkB,CAAC;YACxD,CAAC,6BAA6B,EAAE,aAAa,CAAC;SAC/C,CAAC;AACF,QAAA,YAAY,EAAE,EAAE;AAChB,QAAA,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;CAyED,EAAA,qBAAA,CAAA,SAAA,EAAA,QAAA,EAAA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement","eventDescriptionTokens","i18next"],"sources":["src/components/scheduler-editor/nylas-event-description/nylas-event-description.scss?tag=nylas-event-description&encapsulation=shadow","src/components/scheduler-editor/nylas-event-description/nylas-event-description.tsx"],"sourcesContent":["@use '../../../common/styles/variables' as *;\n\n:host {\n @include default-css-variables;\n}\n\n.nylas-event-description {\n display: flex;\n flex-direction: column;\n gap: 4px;\n position: relative;\n\n label {\n display: flex;\n align-items: center;\n color: var(--nylas-base-800);\n font-size: 16px;\n font-style: normal;\n font-weight: 400;\n line-height: 150%;\n\n /* 21px */\n span.label-icon {\n margin-left: 4px;\n\n tooltip-component {\n display: flex;\n }\n }\n }\n\n textarea {\n padding: 12px 16px;\n border-width: 1;\n resize: vertical;\n border-radius: 8px;\n font-family: var(--nylas-font-family);\n font-size: 16px;\n line-height: 24px;\n border: 1px solid var(--nylas-base-200);\n\n &::-webkit-resizer {\n display: none;\n }\n }\n\n div.event-description {\n padding: 12px 16px;\n border: 1px solid var(--nylas-base-200);\n border-radius: var(--nylas-border-radius-2x);\n white-space: nowrap;\n scrollbar-width: thin;\n min-height: 50px;\n overflow-y: auto;\n white-space: pre-wrap;\n line-height: 1.5;\n background-color: var(--nylas-base-0);\n /* Preserves line breaks */\n &::-webkit-scrollbar {\n width: 6px;\n height: 6px;\n }\n\n &.error {\n border-color: var(--nylas-error);\n border-width: 2px;\n outline: none;\n }\n }\n\n span.add-additional-fields {\n display: flex;\n align-items: center;\n gap: 8px;\n\n button-component {\n button {\n height: 35px;\n background-color: var(--nylas-base-0);\n }\n }\n }\n\n span.help-text {\n display: inline-block;\n gap: 4px;\n align-items: center;\n color: var(--nylas-base-500);\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 21px;\n position: relative;\n\n span.label-icon {\n display: inline-block;\n\n tooltip-component {\n &::part(tc__container) {\n position: unset;\n }\n\n &::part(tc__content) {\n position: absolute;\n top: 4px;\n left: 50%;\n transform: translateX(-50%);\n }\n }\n }\n }\n\n .highlighted-tag {\n background-color: var(--nylas-base-200);\n border-radius: var(--nylas-border-radius);\n padding: 2px 5px;\n margin-left: 4px;\n margin-bottom: 4px;\n display: inline-block;\n vertical-align: baseline;\n }\n\n .token-options {\n display: block;\n background-color: var(--nylas-base-0);\n width: 100%;\n max-height: 336px;\n margin-top: 28px;\n overflow: auto;\n z-index: 1;\n border-radius: 4px;\n position: absolute;\n bottom: 108px;\n\n box-shadow: 0px 4px 6px -2px #0000000d;\n box-shadow: 0px 10px 15px -3px #0000001a;\n\n @media #{$mobile} {\n right: 0;\n width: 325px;\n max-width: unset;\n }\n\n ul {\n padding: 0;\n list-style-type: none;\n color: var(--nylas-base-900);\n max-height: 336px;\n margin: 0;\n\n li {\n padding: 16px, 12px, 16px, 12px;\n color: var(--nylas-base-900);\n padding: 12px 16px;\n text-decoration: none;\n display: block;\n font-family: inherit;\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n letter-spacing: 0px;\n text-align: left;\n cursor: pointer;\n\n .token-label {\n display: flex;\n flex-direction: column;\n font-weight: 400;\n\n .token {\n color: var(--nylas-abse-900);\n font-size: 16px;\n line-height: 24px;\n }\n\n .description {\n color: var(--nylas-base-600);\n font-size: 14px;\n line-height: 21px;\n }\n }\n\n &:hover,\n &:focus,\n &:active,\n &.active {\n background-color: var(--nylas-base-100);\n\n .token-label {\n .token {\n color: var(--nylas-primary);\n }\n }\n }\n }\n }\n\n .selected {\n background-color: var(--nylas-base-100);\n }\n }\n}\n","import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug, getBrowser, isNonPrintableKey, sanitize } from '@/utils/utils';\nimport { AttachInternals, Component, Host, State, h, Element, Prop, Watch, Event, EventEmitter, Listen } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { Configuration } from '@nylas/core';\nimport i18next from '@/utils/i18n';\nimport { LANGUAGE_CODE } from '@/common/constants';\nimport { EVENT_TITLE_TOKENS as eventDescriptionTokens } from '@/common/constants';\nimport { ThemeConfig } from '@nylas/core';\ninterface CustomShadowRoot extends ShadowRoot {\n getSelection: () => Selection | null;\n}\n\ntype Token = {\n token: string;\n value: string;\n description: string;\n};\n\n/**\n * The `nylas-event-description` component is a form input for the description of an event.\n * @part nedesc - The event description container\n * @part nedesc__textarea - The event description textarea\n */\n@Component({\n tag: 'nylas-event-description',\n styleUrl: 'nylas-event-description.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasEventDescription {\n /**\n * The host element <nylas-event-description>\n */\n @Element() host!: HTMLElement;\n /**\n * @standalone\n * The selected config\n */\n @Prop() selectedConfiguration?: Configuration;\n\n /**\n * @standalone\n * The event description stored in the configuration\n */\n @Prop() eventDescription?: string = this.selectedConfiguration?.event_booking?.description;\n\n /**\n * @standalone\n * The name of the event description input.\n */\n @Prop() name: string = 'description';\n\n /**\n * The selected language.\n */\n @Prop() selectedLanguage?: LANGUAGE_CODE;\n\n /**\n * Hide the auto popolate button\n */\n @Prop() hideAutoPopulateButton: boolean = false;\n\n /**\n * Whether to show the tokens dropdown.\n */\n @Prop() noTemplates: boolean = false;\n /**\n * @standalone\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: ThemeConfig;\n\n /**\n * The selected event description state. This defaults to the event description from the configuration or an empty string.\n */\n @State() description: string = this.eventDescription || this.selectedConfiguration?.event_booking?.description || '';\n @State() showTokens: boolean = false;\n /**\n * The available token options for the dropdown.\n */\n @State() availableTokens: { label: string; value: string; labelHTML: Token }[] = eventDescriptionTokens.map(token => ({\n label: token.token,\n value: token.value,\n labelHTML: token,\n }));\n /**\n * The filtered token options for the dropdown based on the current query.\n */\n @State() filteredTokens: { label: string; value: string; labelHTML: Token }[] = this.availableTokens;\n /**\n * The aria-activedescendant attribute value. This is used to indicate the\n * currently active descendant in the tokens dropdown.\n */\n @State() ariaActivedescendant: string = '';\n /**\n * Stores the reference to the current word being typed.\n * This is used to update the event description with the selected token tag when\n * an option is selected from the dropdown by clicking on it.\n */\n @State() currentWord: {\n $value: string;\n fullText: string;\n index: number;\n focusOffset: number;\n } = { $value: '', fullText: '', index: -1, focusOffset: -1 };\n\n @State() validationError: string = '';\n\n @State() additionalFieldTokens: Token[] = [];\n // Reference to the description textarea element\n private descriptionRef!: HTMLDivElement;\n\n /**\n * The element internals.\n */\n @AttachInternals() internals!: ElementInternals;\n\n /**\n * When a name prop is passed, stencil does not automatically set the name attribute on the host element.\n * Since this component is form-associated, the name attribute is required for form submission.\n * This is a workaround to ensure that the name attribute is set on the host element.\n */\n @Watch('name')\n elementNameChangedHandler(newValue: string) {\n debug('nylas-event-description', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('selectedConfiguration')\n selectedConfigurationChangedHandler(newValue: Configuration) {\n debug('nylas-custom-booking-flow', 'selectedConfigurationChangedHandler', newValue);\n const description = newValue?.event_booking?.description || this.eventDescription || '';\n const additionalFields = newValue?.scheduler?.additional_fields || {};\n const newKeys = Object.keys(additionalFields) || [];\n const newTokens = newKeys.map(key => {\n return {\n token: `$${key}`,\n value: `\\${${key}}`,\n description: additionalFields[key].label || '',\n };\n });\n this.additionalFieldTokens = [...newTokens];\n this.availableTokens = [...eventDescriptionTokens, ...newTokens].map(token => ({\n label: token.token,\n value: token.value,\n labelHTML: token,\n }));\n this.filteredTokens = [...this.availableTokens];\n this.description = description;\n if (description) {\n this.updateEventDescriptionFromProp(description);\n }\n }\n\n @Watch('selectedLanguage')\n selectedLanguageChangedHandler(newVal: LANGUAGE_CODE, oldVal: LANGUAGE_CODE) {\n if (newVal === oldVal) return;\n i18next.changeLanguage(newVal);\n const titleTokens = {\n $invitee: 'invitee',\n $invitee_email: 'inviteeEmail',\n $duration: 'duration',\n };\n this.availableTokens = this.availableTokens.map(token => {\n if (titleTokens[token.label]) {\n token.labelHTML.description = i18next.t(`nylasEventTitle.eventTitleTokenDescription.${titleTokens[token.label]}`);\n }\n return token;\n });\n this.filteredTokens = [...this.availableTokens];\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.host.style.setProperty(`${key}`, value);\n }\n }\n }\n\n /**\n * Event emitted when the event description changes.\n */\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n }>;\n\n connectedCallback() {\n debug('nylas-event-description', 'connectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-event-description', 'componentWillLoad');\n this.host.setAttribute('name', this.name);\n this.applyThemeConfig(this.themeConfig);\n }\n\n componentDidLoad() {\n debug('nylas-event-description', 'componentDidLoad');\n if (this.selectedConfiguration) {\n this.selectedConfigurationChangedHandler(this.selectedConfiguration);\n } else {\n this.description = this.eventDescription || '';\n this.updateEventDescriptionFromProp(this.description);\n }\n }\n\n disconnectedCallback() {\n debug('nylas-event-description', 'disconnectedCallback');\n }\n\n @Listen('valueChanged', { target: 'document' })\n valueChangedHandler(event: CustomEvent<{ value: string; name: string }>) {\n const { name, value } = event.detail;\n if (name === 'additional-fields') {\n const additionalFields = JSON.parse(value.toString());\n const newKeys = Object.keys(additionalFields) || [];\n const newTokens = newKeys.map(key => {\n return {\n token: `$${key}`,\n value: `\\${${key}}`,\n description: additionalFields[key].label || '',\n };\n });\n this.additionalFieldTokens = [...newTokens];\n this.availableTokens = [...eventDescriptionTokens, ...newTokens].map(token => ({\n label: token.token,\n value: token.value,\n labelHTML: token,\n }));\n this.filteredTokens = [...this.availableTokens];\n }\n }\n\n updateEventDescriptionFromProp(newValue: string) {\n debug('nylas-event-description', 'updateEventDescriptionFromProp', newValue);\n const description = newValue || this.description;\n if (this.descriptionRef) {\n this.descriptionRef.innerHTML = this.highlightTokens(description);\n }\n }\n\n highlightTokens(description: string) {\n let outputHtml = description;\n [...eventDescriptionTokens, ...this.additionalFieldTokens].forEach(tokenObj => {\n const token = tokenObj.value;\n // Create a regular expression that matches the token as a whole word\n const regex = new RegExp(`(\\\\${token})(?!\\\\w)`, 'g');\n // Replace the token with a span element\n outputHtml = outputHtml?.replace(regex, '<span class=\"highlighted-tag\">$1</span>') || '';\n });\n return outputHtml;\n }\n\n getCurrentSelectionForBrowser() {\n const getSelectionTextData = (nodeValue, offset, node, allSelected) => {\n // Remove zero-width space characters from the text, because they are not visible and cause issues with the selection\n const text = nodeValue.replace(/[\\u200B-\\u200D\\uFEFF]/g, '');\n const dollarIndex = text.lastIndexOf('$');\n const lastWord = text.substring(dollarIndex).split(' ')[0];\n return {\n focusOffset: offset,\n dollarIndex,\n lastWord,\n currentText: text,\n node,\n allSelected,\n };\n };\n\n // Check if the selection has selected all the text in the node, we need this to handle the case where the user selects all the text and then types or deletes\n const isAllSelected = (selection: Selection) => selection.anchorOffset === 0 && selection.focusOffset === selection.focusNode?.nodeValue?.length;\n\n const currentBrowser = getBrowser();\n switch (currentBrowser) {\n case 'Chrome': {\n const shadowRootSelection = (this.host.shadowRoot as CustomShadowRoot)?.getSelection();\n const focusNode = shadowRootSelection?.focusNode;\n const focusNodeValue = focusNode?.nodeValue || '';\n const allSelected = shadowRootSelection && isAllSelected(shadowRootSelection);\n return getSelectionTextData(focusNodeValue, shadowRootSelection?.focusOffset || -1, focusNode, allSelected);\n }\n case 'Firefox': {\n const selection = document.getSelection();\n const anchorNodeValue = selection?.anchorNode?.nodeValue || '';\n const allSelectedFirefox = selection && isAllSelected(selection);\n return getSelectionTextData(anchorNodeValue, selection?.focusOffset || -1, selection?.anchorNode, allSelectedFirefox);\n }\n case 'Safari': {\n const windowSelection = window.getSelection();\n const anchorNode = (windowSelection as any)?.getComposedRanges(this.host.shadowRoot as CustomShadowRoot)[0];\n const currentText = anchorNode?.startContainer?.nodeValue || '';\n const allSelectedSafari = windowSelection && isAllSelected(windowSelection);\n return getSelectionTextData(currentText, anchorNode?.endOffset || -1, anchorNode?.startContainer, allSelectedSafari);\n }\n default: {\n console.warn('Browser not supported');\n return null;\n }\n }\n }\n\n handleChange(event: Event) {\n let textContent = (event.target as HTMLDivElement).textContent || '';\n textContent = sanitize(textContent);\n // All browsers handle Selection within Shadow DOM differently, so get the current selection based on the browser\n const currentSelection = this.getCurrentSelectionForBrowser();\n if (!currentSelection) {\n this.updateEventDescription(textContent);\n this.resetDropdown();\n return;\n }\n const { focusOffset, dollarIndex, lastWord, currentText } = currentSelection;\n\n if (dollarIndex === -1 || focusOffset < dollarIndex) {\n this.updateEventDescription(textContent);\n this.resetDropdown();\n return;\n }\n if (lastWord.startsWith('$')) {\n this.showTokens = true;\n // Update the current word being typed, we need this reference to update the event description with the selected token\n // because the user can select an option from the dropdown by clicking on it, which will not trigger the input event.\n this.currentWord = {\n $value: lastWord,\n fullText: currentText,\n index: dollarIndex,\n focusOffset,\n };\n this.populateSuggestionsDropdown(lastWord);\n } else {\n this.resetDropdown();\n }\n this.updateEventDescription(textContent);\n }\n\n handleInputKeyDown(event) {\n const selection = this.getCurrentSelectionForBrowser();\n\n // If no text is remaining in the description, reset the description to an empty string\n if (selection?.allSelected && !isNonPrintableKey(event)) {\n this.descriptionRef.innerHTML = '';\n }\n\n if (event.key === 'Enter') {\n event.preventDefault();\n const activeOption = this.host.shadowRoot?.getElementById(this.ariaActivedescendant);\n if (activeOption) {\n activeOption.click();\n this.ariaActivedescendant = '';\n } else {\n const textNode = selection?.node;\n const offset = selection?.focusOffset || 0;\n\n if (!textNode || offset === -1 || this.descriptionRef.childNodes.length === 0) {\n // If no text node exists or invalid selection, create new line at start\n const newTextNode = document.createTextNode('\\n');\n this.descriptionRef.insertBefore(newTextNode, this.descriptionRef.firstChild);\n\n // Set cursor after newline\n const range = document.createRange();\n range.setStart(newTextNode, 1);\n range.collapse(true);\n const sel = window.getSelection();\n sel?.removeAllRanges();\n sel?.addRange(range);\n } else if (textNode.nodeType === Node.TEXT_NODE) {\n const text = textNode.nodeValue || '';\n // Insert newline at cursor position\n const newText = text.slice(0, offset) + '\\n' + text.slice(offset);\n textNode.nodeValue = newText;\n\n // Move cursor after the newline\n const range = document.createRange();\n range.setStart(textNode, offset + 1);\n range.collapse(true);\n const sel = window.getSelection();\n sel?.removeAllRanges();\n sel?.addRange(range);\n }\n this.descriptionRef.focus();\n }\n } else if (event.key === 'ArrowDown') {\n if (this.showTokens) {\n event.preventDefault();\n }\n const activeOption = this.host.shadowRoot?.getElementById(this.ariaActivedescendant);\n if (activeOption) {\n const nextOption = activeOption.nextElementSibling;\n if (nextOption) {\n this.ariaActivedescendant = nextOption.id;\n } else {\n this.ariaActivedescendant = this.filteredTokens[0].label;\n }\n } else {\n this.ariaActivedescendant = this.filteredTokens[0].label;\n }\n } else if (event.key === 'ArrowUp') {\n if (this.showTokens) {\n event.preventDefault();\n }\n const activeOption = this.host.shadowRoot?.getElementById(this.ariaActivedescendant);\n if (activeOption) {\n const prevOption = activeOption.previousElementSibling;\n if (prevOption) {\n this.ariaActivedescendant = prevOption.id;\n } else {\n this.ariaActivedescendant = this.filteredTokens[this.filteredTokens.length - 1].label;\n }\n } else {\n this.ariaActivedescendant = this.filteredTokens[this.filteredTokens.length - 1].label;\n }\n } else if (event.key === 'Escape') {\n event.preventDefault();\n this.resetDropdown();\n } else if (event.key === 'Backspace' || event.key === 'Delete') {\n const parentNode = selection?.node?.parentNode;\n if (selection?.currentText.startsWith('${') && parentNode && parentNode.nodeName === 'SPAN') {\n event.preventDefault();\n parentNode.removeChild(selection.node);\n parentNode.remove();\n this.resetDropdown();\n }\n if (this.descriptionRef.textContent === '' || selection?.allSelected) {\n this.descriptionRef.innerHTML = '';\n this.updateEventDescription('');\n }\n }\n }\n\n selectOption(e: Event, option: { label: string; value: string; labelHTML: Token }) {\n e.preventDefault();\n const word = this.currentWord.fullText;\n const dollarWord = this.currentWord.$value;\n\n // Traverse the DOM to find the text node that contains the current word fullText\n let currentNode = this.descriptionRef.firstChild;\n let textNode: ChildNode | null = null;\n\n while (currentNode) {\n if (currentNode.nodeType === 3) {\n const currentNodeText = currentNode.textContent?.replace(/[\\u200B-\\u200D\\uFEFF]/g, '') || '';\n const wordText = word.replace(/[\\u200B-\\u200D\\uFEFF]/g, '');\n if (currentNodeText.includes(wordText)) {\n textNode = currentNode;\n break;\n }\n }\n currentNode = currentNode.nextSibling;\n }\n\n if (!textNode) {\n return;\n }\n // Split the text node into three parts: text before the token, the token, and text after the token\n const text = textNode.textContent || '';\n const index = text.indexOf(dollarWord);\n const textBefore = text.substring(0, index);\n const textAfter = text.substring(index + dollarWord.length);\n const newTextNode = document.createTextNode(textBefore);\n const newRange = document.createRange();\n\n // Create a new span element to replace the text node\n const tagSpan = document.createElement('span');\n tagSpan.classList.add('highlighted-tag');\n tagSpan.textContent = `${option.value}`;\n const newTextNodeAfter = document.createTextNode(textAfter);\n\n if (textAfter !== '') {\n // If there is text after the token, add it to the new span element\n textNode.replaceWith(newTextNode, tagSpan, newTextNodeAfter);\n newRange.setStart(newTextNodeAfter, 1);\n } else {\n // If there is no text after the token, add a zero-width space character (Without this, the cursor will not move outside the highlighted span element)\n const afterNode = document.createTextNode('\\u200B');\n textNode.replaceWith(newTextNode, tagSpan, afterNode);\n newRange.setStart(afterNode, 1);\n }\n\n // Hide the dropdown\n this.resetDropdown();\n this.descriptionRef.focus();\n\n // Set the focus to the new span element\n const sel = window.getSelection();\n newRange.collapse(true);\n sel?.removeAllRanges();\n sel?.addRange(newRange);\n\n // Update the event description with the selected token\n this.updateEventDescription(this.descriptionRef.textContent || '');\n }\n\n populateSuggestionsDropdown(query: string = '') {\n this.filteredTokens = this.availableTokens.filter(obj => {\n return obj.label.startsWith(query.toString()) || obj.value.startsWith(query.toString());\n });\n\n // Set the first option as the active descendant\n if (this.filteredTokens.length > 0) {\n this.ariaActivedescendant = this.filteredTokens[0].label;\n }\n }\n\n get isInternalsAvailable() {\n return typeof this.internals !== 'undefined' && typeof this.internals.setValidity === 'function' && typeof this.internals.setFormValue === 'function';\n }\n\n updateEventDescription(text: string) {\n const value = text.replace(/ +/g, ' ');\n this.isInternalsAvailable && this.internals?.setFormValue(value, this.name);\n this.valueChanged.emit({ value: value, name: this.name });\n }\n\n resetDropdown() {\n this.showTokens = false;\n this.ariaActivedescendant = '';\n }\n\n getLabelHTML(token: { token: string; description: string }) {\n return (\n <div class=\"token-label\">\n <span class=\"token\">{token.token}</span>\n <span class=\"description\">{token.description}</span>\n </div>\n );\n }\n\n handleAddAdditionalFields() {\n if (this.additionalFieldTokens.length === 0) {\n return;\n }\n\n // Remove any existing additional fields section while preserving content before and after\n const baseDescription = this.descriptionRef.innerHTML;\n const startMarker = '--- Additional Fields ---';\n const endMarker = '--- End Additional Fields ---';\n\n const startIndex = baseDescription.indexOf(startMarker);\n const endIndex = baseDescription.indexOf(endMarker);\n\n // Add the additional fields block with start and end markers\n let additionalFieldsBlock = startMarker + '\\n';\n this.additionalFieldTokens.forEach(token => {\n additionalFieldsBlock += `${token.description}: ${token.value}\\n`;\n });\n additionalFieldsBlock += endMarker;\n\n let description;\n if (startIndex !== -1 && endIndex !== -1) {\n // Replace existing block while maintaining text positions\n description = baseDescription.substring(0, startIndex) + additionalFieldsBlock + baseDescription.substring(endIndex + endMarker.length);\n } else {\n // First time adding the block\n description = baseDescription + additionalFieldsBlock;\n }\n\n this.updateEventDescriptionFromProp(description);\n this.updateEventDescription(description);\n }\n\n @RegisterComponent<NylasEventDescription, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-event-description',\n stateToProps: new Map([\n ['schedulerConfig.selectedConfiguration', 'selectedConfiguration'],\n ['schedulerConfig.selectedLanguage', 'selectedLanguage'],\n ['schedulerConfig.themeConfig', 'themeConfig'],\n ]),\n eventToProps: {},\n fireRegisterEvent: true,\n })\n render() {\n return (\n <Host>\n <div class=\"nylas-event-description\" part=\"nedesc\">\n <label htmlFor=\"description\">\n {i18next.t('nylasEventDescription.headerTitle')}\n <span class=\"label-icon\">\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">{i18next.t('nylasEventDescription.tooltip.desc')}</span>\n </tooltip-component>\n </span>\n </label>\n <div\n id=\"event-description\"\n class={{ 'event-description': true }}\n part=\"nedesc__textarea\"\n contentEditable=\"true\"\n onInput={e => this.handleChange(e)}\n onKeyDown={event => this.handleInputKeyDown(event)}\n ref={el => (this.descriptionRef = el as HTMLDivElement)}\n ></div>\n {!this.noTemplates && this.showTokens && this.filteredTokens?.length > 0 && (\n <div class=\"token-options\" part=\"nedesc__dropdown-content\">\n <ul tabindex=\"-1\" role=\"listbox\" aria-label={this.name} aria-activedescendant={this.ariaActivedescendant}>\n {this.filteredTokens.map(option => (\n <li\n tabindex=\"0\"\n key={option.label}\n id={option.label}\n class={{ active: this.ariaActivedescendant === option.label }}\n onClick={e => this.selectOption(e, option)}\n role=\"option\"\n >\n {this.getLabelHTML(option.labelHTML)}\n </li>\n ))}\n </ul>\n </div>\n )}\n {!this.noTemplates && (\n <span class=\"help-text\">\n {i18next.t('nylasEventTitle.helpText', { context: 'start', field: i18next.t('nylasEventTitle.description') })} <code>$</code>{' '}\n {i18next.t('nylasEventTitle.helpText', { context: 'end' })}\n <span class=\"label-icon\">\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" width=\"13\" height=\"13\" />\n <span slot=\"tooltip-content\">\n {i18next.t('nylasEventTitle.tooltip.desc')} <code>{'${invitee}'}</code>\n </span>\n </tooltip-component>\n </span>\n </span>\n )}\n {!this.noTemplates && !this.hideAutoPopulateButton && (\n <span class=\"add-additional-fields\">\n <button-component variant=\"basic\" onClick={() => this.handleAddAdditionalFields()}>\n {i18next.t('nylasEventDescription.addAdditionalFields.buttonText')}\n </button-component>\n <span class=\"label-icon\">\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">\n {i18next.t('nylasEventDescription.addAdditionalFields.tooltip.desc')} <code>{'${invitee}'}</code>\n </span>\n </tooltip-component>\n </span>\n </span>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"p-DJajrAgg.js","mappings":";;;;;;;;;AAAA,MAAM,wBAAwB,GAAG,8jMAA8jM;;;;;;;;;;;;;;;;MC+BllM,qBAAqB,GAAAA,kBAAA,CAAA,MAAA,qBAAA,SAAAC,CAAA,CAAA;AANlC,IAAA,WAAA,GAAA;;;;;;QAqBU,IAAgB,CAAA,gBAAA,GAAY,IAAI,CAAC,qBAAqB,EAAE,aAAa,EAAE,WAAW;AAMlF,QAAA,IAAI,CAAA,IAAA,GAAW,aAAa;AAU5B,QAAA,IAAsB,CAAA,sBAAA,GAAY,KAAK;AAKvC,QAAA,IAAW,CAAA,WAAA,GAAY,KAAK;AAU3B,QAAA,IAAA,CAAA,WAAW,GAAW,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,qBAAqB,EAAE,aAAa,EAAE,WAAW,IAAI,EAAE;AAC3G,QAAA,IAAU,CAAA,UAAA,GAAY,KAAK;QAI3B,IAAe,CAAA,eAAA,GAAyDC,kBAAsB,CAAC,GA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AE,MAAM,IAAI,CAAC,yBAAyB,EAAE,IAC9EA,QAAO,CAAC,CAAC,CAAC,sDAAsD,CAAC,CACjD,EACnB,CAAM,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,YAAY,EAAA,EACtB,CAAA,CAAA,mBAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EACE,CAAW,CAAA,WAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,IAAI,EAAC,cAAc,EAAG,CAAA,EACjC,CAAM,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,IAAI,EAAC,iBAAiB,EAAA,EACzBA,QAAO,CAAC,CAAC,CAAC,wDAAwD,CAAC,OAAE,CAAO,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EAAA,YAAY,CAAQ,CAC5F,CACW,CACf,CACF,CACR,CACG,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAtEX,UAAA,CAAA;AAVC,IAAA,iBAAiB,CAA2G;AAC3H,QAAA,IAAI,EAAE,yBAAyB;QAC/B,YAAY,EAAE,IAAI,GAAG,CAAC;YACpB,CAAC,uCAAuC,EAAE,uBAAuB,CAAC;YAClE,CAAC,kCAAkC,EAAE,kBAAkB,CAAC;YACxD,CAAC,6BAA6B,EAAE,aAAa,CAAC;SAC/C,CAAC;AACF,QAAA,YAAY,EAAE,EAAE;AAChB,QAAA,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;CAyED,EAAA,qBAAA,CAAA,SAAA,EAAA,QAAA,EAAA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement","eventDescriptionTokens","i18next"],"sources":["src/components/scheduler-editor/nylas-event-description/nylas-event-description.scss?tag=nylas-event-description&encapsulation=shadow","src/components/scheduler-editor/nylas-event-description/nylas-event-description.tsx"],"sourcesContent":["@use '../../../common/styles/variables' as *;\n\n:host {\n @include default-css-variables;\n}\n\n.nylas-event-description {\n display: flex;\n flex-direction: column;\n gap: 4px;\n position: relative;\n\n label {\n display: flex;\n align-items: center;\n color: var(--nylas-base-800);\n font-size: 16px;\n font-style: normal;\n font-weight: 400;\n line-height: 150%;\n\n /* 21px */\n span.label-icon {\n margin-left: 4px;\n\n tooltip-component {\n display: flex;\n }\n }\n }\n\n textarea {\n padding: 12px 16px;\n border-width: 1;\n resize: vertical;\n border-radius: 8px;\n font-family: var(--nylas-font-family);\n font-size: 16px;\n line-height: 24px;\n border: 1px solid var(--nylas-base-200);\n\n &::-webkit-resizer {\n display: none;\n }\n }\n\n div.event-description {\n padding: 12px 16px;\n border: 1px solid var(--nylas-base-200);\n border-radius: var(--nylas-border-radius-2x);\n white-space: nowrap;\n scrollbar-width: thin;\n min-height: 50px;\n overflow-y: auto;\n white-space: pre-wrap;\n line-height: 1.5;\n background-color: var(--nylas-base-0);\n /* Preserves line breaks */\n &::-webkit-scrollbar {\n width: 6px;\n height: 6px;\n }\n\n &.error {\n border-color: var(--nylas-error);\n border-width: 2px;\n outline: none;\n }\n }\n\n span.add-additional-fields {\n display: flex;\n align-items: center;\n gap: 8px;\n\n button-component {\n button {\n height: 35px;\n background-color: var(--nylas-base-0);\n }\n }\n }\n\n span.help-text {\n display: inline-block;\n gap: 4px;\n align-items: center;\n color: var(--nylas-base-500);\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 21px;\n position: relative;\n\n span.label-icon {\n display: inline-block;\n\n tooltip-component {\n &::part(tc__container) {\n position: unset;\n }\n\n &::part(tc__content) {\n position: absolute;\n top: 4px;\n left: 50%;\n transform: translateX(-50%);\n }\n }\n }\n }\n\n .highlighted-tag {\n background-color: var(--nylas-base-200);\n border-radius: var(--nylas-border-radius);\n padding: 2px 5px;\n margin-left: 4px;\n margin-bottom: 4px;\n display: inline-block;\n vertical-align: baseline;\n }\n\n .token-options {\n display: block;\n background-color: var(--nylas-base-0);\n width: 100%;\n max-height: 336px;\n margin-top: 28px;\n overflow: auto;\n z-index: 1;\n border-radius: 4px;\n position: absolute;\n bottom: 108px;\n\n box-shadow: 0px 4px 6px -2px #0000000d;\n box-shadow: 0px 10px 15px -3px #0000001a;\n\n @media #{$mobile} {\n right: 0;\n width: 325px;\n max-width: unset;\n }\n\n ul {\n padding: 0;\n list-style-type: none;\n color: var(--nylas-base-900);\n max-height: 336px;\n margin: 0;\n\n li {\n padding: 16px, 12px, 16px, 12px;\n color: var(--nylas-base-900);\n padding: 12px 16px;\n text-decoration: none;\n display: block;\n font-family: inherit;\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n letter-spacing: 0px;\n text-align: left;\n cursor: pointer;\n\n .token-label {\n display: flex;\n flex-direction: column;\n font-weight: 400;\n\n .token {\n color: var(--nylas-abse-900);\n font-size: 16px;\n line-height: 24px;\n }\n\n .description {\n color: var(--nylas-base-600);\n font-size: 14px;\n line-height: 21px;\n }\n }\n\n &:hover,\n &:focus,\n &:active,\n &.active {\n background-color: var(--nylas-base-100);\n\n .token-label {\n .token {\n color: var(--nylas-primary);\n }\n }\n }\n }\n }\n\n .selected {\n background-color: var(--nylas-base-100);\n }\n }\n}\n","import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug, getBrowser, isNonPrintableKey, sanitize } from '@/utils/utils';\nimport { AttachInternals, Component, Host, State, h, Element, Prop, Watch, Event, EventEmitter, Listen } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { Configuration } from '@nylas/core';\nimport i18next from '@/utils/i18n';\nimport { LANGUAGE_CODE } from '@/common/constants';\nimport { EVENT_TITLE_TOKENS as eventDescriptionTokens } from '@/common/constants';\nimport { ThemeConfig } from '@nylas/core';\ninterface CustomShadowRoot extends ShadowRoot {\n getSelection: () => Selection | null;\n}\n\ntype Token = {\n token: string;\n value: string;\n description: string;\n};\n\n/**\n * The `nylas-event-description` component is a form input for the description of an event.\n * @part nedesc - The event description container\n * @part nedesc__textarea - The event description textarea\n */\n@Component({\n tag: 'nylas-event-description',\n styleUrl: 'nylas-event-description.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasEventDescription {\n /**\n * The host element <nylas-event-description>\n */\n @Element() host!: HTMLElement;\n /**\n * @standalone\n * The selected config\n */\n @Prop() selectedConfiguration?: Configuration;\n\n /**\n * @standalone\n * The event description stored in the configuration\n */\n @Prop() eventDescription?: string = this.selectedConfiguration?.event_booking?.description;\n\n /**\n * @standalone\n * The name of the event description input.\n */\n @Prop() name: string = 'description';\n\n /**\n * The selected language.\n */\n @Prop() selectedLanguage?: LANGUAGE_CODE;\n\n /**\n * Hide the auto popolate button\n */\n @Prop() hideAutoPopulateButton: boolean = false;\n\n /**\n * Whether to show the tokens dropdown.\n */\n @Prop() noTemplates: boolean = false;\n /**\n * @standalone\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: ThemeConfig;\n\n /**\n * The selected event description state. This defaults to the event description from the configuration or an empty string.\n */\n @State() description: string = this.eventDescription || this.selectedConfiguration?.event_booking?.description || '';\n @State() showTokens: boolean = false;\n /**\n * The available token options for the dropdown.\n */\n @State() availableTokens: { label: string; value: string; labelHTML: Token }[] = eventDescriptionTokens.map(token => ({\n label: token.token,\n value: token.value,\n labelHTML: token,\n }));\n /**\n * The filtered token options for the dropdown based on the current query.\n */\n @State() filteredTokens: { label: string; value: string; labelHTML: Token }[] = this.availableTokens;\n /**\n * The aria-activedescendant attribute value. This is used to indicate the\n * currently active descendant in the tokens dropdown.\n */\n @State() ariaActivedescendant: string = '';\n /**\n * Stores the reference to the current word being typed.\n * This is used to update the event description with the selected token tag when\n * an option is selected from the dropdown by clicking on it.\n */\n @State() currentWord: {\n $value: string;\n fullText: string;\n index: number;\n focusOffset: number;\n } = { $value: '', fullText: '', index: -1, focusOffset: -1 };\n\n @State() validationError: string = '';\n\n @State() additionalFieldTokens: Token[] = [];\n // Reference to the description textarea element\n private descriptionRef!: HTMLDivElement;\n\n /**\n * The element internals.\n */\n @AttachInternals() internals!: ElementInternals;\n\n /**\n * When a name prop is passed, stencil does not automatically set the name attribute on the host element.\n * Since this component is form-associated, the name attribute is required for form submission.\n * This is a workaround to ensure that the name attribute is set on the host element.\n */\n @Watch('name')\n elementNameChangedHandler(newValue: string) {\n debug('nylas-event-description', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('selectedConfiguration')\n selectedConfigurationChangedHandler(newValue: Configuration) {\n debug('nylas-custom-booking-flow', 'selectedConfigurationChangedHandler', newValue);\n const description = newValue?.event_booking?.description || this.eventDescription || '';\n const additionalFields = newValue?.scheduler?.additional_fields || {};\n const newKeys = Object.keys(additionalFields) || [];\n const newTokens = newKeys.map(key => {\n return {\n token: `$${key}`,\n value: `\\${${key}}`,\n description: additionalFields[key].label || '',\n };\n });\n this.additionalFieldTokens = [...newTokens];\n this.availableTokens = [...eventDescriptionTokens, ...newTokens].map(token => ({\n label: token.token,\n value: token.value,\n labelHTML: token,\n }));\n this.filteredTokens = [...this.availableTokens];\n this.description = description;\n if (description) {\n this.updateEventDescriptionFromProp(description);\n }\n }\n\n @Watch('selectedLanguage')\n selectedLanguageChangedHandler(newVal: LANGUAGE_CODE, oldVal: LANGUAGE_CODE) {\n if (newVal === oldVal) return;\n i18next.changeLanguage(newVal);\n const titleTokens = {\n $invitee: 'invitee',\n $invitee_email: 'inviteeEmail',\n $duration: 'duration',\n };\n this.availableTokens = this.availableTokens.map(token => {\n if (titleTokens[token.label]) {\n token.labelHTML.description = i18next.t(`nylasEventTitle.eventTitleTokenDescription.${titleTokens[token.label]}`);\n }\n return token;\n });\n this.filteredTokens = [...this.availableTokens];\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.host.style.setProperty(`${key}`, value);\n }\n }\n }\n\n /**\n * Event emitted when the event description changes.\n */\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n }>;\n\n connectedCallback() {\n debug('nylas-event-description', 'connectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-event-description', 'componentWillLoad');\n this.host.setAttribute('name', this.name);\n this.applyThemeConfig(this.themeConfig);\n }\n\n componentDidLoad() {\n debug('nylas-event-description', 'componentDidLoad');\n if (this.selectedConfiguration) {\n this.selectedConfigurationChangedHandler(this.selectedConfiguration);\n } else {\n this.description = this.eventDescription || '';\n this.updateEventDescriptionFromProp(this.description);\n }\n }\n\n disconnectedCallback() {\n debug('nylas-event-description', 'disconnectedCallback');\n }\n\n @Listen('valueChanged', { target: 'document' })\n valueChangedHandler(event: CustomEvent<{ value: string; name: string }>) {\n const { name, value } = event.detail;\n if (name === 'additional-fields') {\n const additionalFields = JSON.parse(value.toString());\n const newKeys = Object.keys(additionalFields) || [];\n const newTokens = newKeys.map(key => {\n return {\n token: `$${key}`,\n value: `\\${${key}}`,\n description: additionalFields[key].label || '',\n };\n });\n this.additionalFieldTokens = [...newTokens];\n this.availableTokens = [...eventDescriptionTokens, ...newTokens].map(token => ({\n label: token.token,\n value: token.value,\n labelHTML: token,\n }));\n this.filteredTokens = [...this.availableTokens];\n }\n }\n\n updateEventDescriptionFromProp(newValue: string) {\n debug('nylas-event-description', 'updateEventDescriptionFromProp', newValue);\n const description = newValue || this.description;\n if (this.descriptionRef) {\n this.descriptionRef.innerHTML = this.highlightTokens(description);\n }\n }\n\n highlightTokens(description: string) {\n let outputHtml = description;\n [...eventDescriptionTokens, ...this.additionalFieldTokens].forEach(tokenObj => {\n const token = tokenObj.value;\n // Create a regular expression that matches the token as a whole word\n const regex = new RegExp(`(\\\\${token})(?!\\\\w)`, 'g');\n // Replace the token with a span element\n outputHtml = outputHtml?.replace(regex, '<span class=\"highlighted-tag\">$1</span>') || '';\n });\n return outputHtml;\n }\n\n getCurrentSelectionForBrowser() {\n const getSelectionTextData = (nodeValue, offset, node, allSelected) => {\n // Remove zero-width space characters from the text, because they are not visible and cause issues with the selection\n const text = nodeValue.replace(/[\\u200B-\\u200D\\uFEFF]/g, '');\n const dollarIndex = text.lastIndexOf('$');\n const lastWord = text.substring(dollarIndex).split(' ')[0];\n return {\n focusOffset: offset,\n dollarIndex,\n lastWord,\n currentText: text,\n node,\n allSelected,\n };\n };\n\n // Check if the selection has selected all the text in the node, we need this to handle the case where the user selects all the text and then types or deletes\n const isAllSelected = (selection: Selection) => selection.anchorOffset === 0 && selection.focusOffset === selection.focusNode?.nodeValue?.length;\n\n const currentBrowser = getBrowser();\n switch (currentBrowser) {\n case 'Chrome': {\n const shadowRootSelection = (this.host.shadowRoot as CustomShadowRoot)?.getSelection();\n const focusNode = shadowRootSelection?.focusNode;\n const focusNodeValue = focusNode?.nodeValue || '';\n const allSelected = shadowRootSelection && isAllSelected(shadowRootSelection);\n return getSelectionTextData(focusNodeValue, shadowRootSelection?.focusOffset || -1, focusNode, allSelected);\n }\n case 'Firefox': {\n const selection = document.getSelection();\n const anchorNodeValue = selection?.anchorNode?.nodeValue || '';\n const allSelectedFirefox = selection && isAllSelected(selection);\n return getSelectionTextData(anchorNodeValue, selection?.focusOffset || -1, selection?.anchorNode, allSelectedFirefox);\n }\n case 'Safari': {\n const windowSelection = window.getSelection();\n const anchorNode = (windowSelection as any)?.getComposedRanges(this.host.shadowRoot as CustomShadowRoot)[0];\n const currentText = anchorNode?.startContainer?.nodeValue || '';\n const allSelectedSafari = windowSelection && isAllSelected(windowSelection);\n return getSelectionTextData(currentText, anchorNode?.endOffset || -1, anchorNode?.startContainer, allSelectedSafari);\n }\n default: {\n console.warn('Browser not supported');\n return null;\n }\n }\n }\n\n handleChange(event: Event) {\n let textContent = (event.target as HTMLDivElement).textContent || '';\n textContent = sanitize(textContent);\n // All browsers handle Selection within Shadow DOM differently, so get the current selection based on the browser\n const currentSelection = this.getCurrentSelectionForBrowser();\n if (!currentSelection) {\n this.updateEventDescription(textContent);\n this.resetDropdown();\n return;\n }\n const { focusOffset, dollarIndex, lastWord, currentText } = currentSelection;\n\n if (dollarIndex === -1 || focusOffset < dollarIndex) {\n this.updateEventDescription(textContent);\n this.resetDropdown();\n return;\n }\n if (lastWord.startsWith('$')) {\n this.showTokens = true;\n // Update the current word being typed, we need this reference to update the event description with the selected token\n // because the user can select an option from the dropdown by clicking on it, which will not trigger the input event.\n this.currentWord = {\n $value: lastWord,\n fullText: currentText,\n index: dollarIndex,\n focusOffset,\n };\n this.populateSuggestionsDropdown(lastWord);\n } else {\n this.resetDropdown();\n }\n this.updateEventDescription(textContent);\n }\n\n handleInputKeyDown(event) {\n const selection = this.getCurrentSelectionForBrowser();\n\n // If no text is remaining in the description, reset the description to an empty string\n if (selection?.allSelected && !isNonPrintableKey(event)) {\n this.descriptionRef.innerHTML = '';\n }\n\n if (event.key === 'Enter') {\n event.preventDefault();\n const activeOption = this.host.shadowRoot?.getElementById(this.ariaActivedescendant);\n if (activeOption) {\n activeOption.click();\n this.ariaActivedescendant = '';\n } else {\n const textNode = selection?.node;\n const offset = selection?.focusOffset || 0;\n\n if (!textNode || offset === -1 || this.descriptionRef.childNodes.length === 0) {\n // If no text node exists or invalid selection, create new line at start\n const newTextNode = document.createTextNode('\\n');\n this.descriptionRef.insertBefore(newTextNode, this.descriptionRef.firstChild);\n\n // Set cursor after newline\n const range = document.createRange();\n range.setStart(newTextNode, 1);\n range.collapse(true);\n const sel = window.getSelection();\n sel?.removeAllRanges();\n sel?.addRange(range);\n } else if (textNode.nodeType === Node.TEXT_NODE) {\n const text = textNode.nodeValue || '';\n // Insert newline at cursor position\n const newText = text.slice(0, offset) + '\\n' + text.slice(offset);\n textNode.nodeValue = newText;\n\n // Move cursor after the newline\n const range = document.createRange();\n range.setStart(textNode, offset + 1);\n range.collapse(true);\n const sel = window.getSelection();\n sel?.removeAllRanges();\n sel?.addRange(range);\n }\n this.descriptionRef.focus();\n }\n } else if (event.key === 'ArrowDown') {\n if (this.showTokens) {\n event.preventDefault();\n }\n const activeOption = this.host.shadowRoot?.getElementById(this.ariaActivedescendant);\n if (activeOption) {\n const nextOption = activeOption.nextElementSibling;\n if (nextOption) {\n this.ariaActivedescendant = nextOption.id;\n } else {\n this.ariaActivedescendant = this.filteredTokens[0].label;\n }\n } else {\n this.ariaActivedescendant = this.filteredTokens[0].label;\n }\n } else if (event.key === 'ArrowUp') {\n if (this.showTokens) {\n event.preventDefault();\n }\n const activeOption = this.host.shadowRoot?.getElementById(this.ariaActivedescendant);\n if (activeOption) {\n const prevOption = activeOption.previousElementSibling;\n if (prevOption) {\n this.ariaActivedescendant = prevOption.id;\n } else {\n this.ariaActivedescendant = this.filteredTokens[this.filteredTokens.length - 1].label;\n }\n } else {\n this.ariaActivedescendant = this.filteredTokens[this.filteredTokens.length - 1].label;\n }\n } else if (event.key === 'Escape') {\n event.preventDefault();\n this.resetDropdown();\n } else if (event.key === 'Backspace' || event.key === 'Delete') {\n const parentNode = selection?.node?.parentNode;\n if (selection?.currentText.startsWith('${') && parentNode && parentNode.nodeName === 'SPAN') {\n event.preventDefault();\n parentNode.removeChild(selection.node);\n parentNode.remove();\n this.resetDropdown();\n }\n if (this.descriptionRef.textContent === '' || selection?.allSelected) {\n this.descriptionRef.innerHTML = '';\n this.updateEventDescription('');\n }\n }\n }\n\n selectOption(e: Event, option: { label: string; value: string; labelHTML: Token }) {\n e.preventDefault();\n const word = this.currentWord.fullText;\n const dollarWord = this.currentWord.$value;\n\n // Traverse the DOM to find the text node that contains the current word fullText\n let currentNode = this.descriptionRef.firstChild;\n let textNode: ChildNode | null = null;\n\n while (currentNode) {\n if (currentNode.nodeType === 3) {\n const currentNodeText = currentNode.textContent?.replace(/[\\u200B-\\u200D\\uFEFF]/g, '') || '';\n const wordText = word.replace(/[\\u200B-\\u200D\\uFEFF]/g, '');\n if (currentNodeText.includes(wordText)) {\n textNode = currentNode;\n break;\n }\n }\n currentNode = currentNode.nextSibling;\n }\n\n if (!textNode) {\n return;\n }\n // Split the text node into three parts: text before the token, the token, and text after the token\n const text = textNode.textContent || '';\n const index = text.indexOf(dollarWord);\n const textBefore = text.substring(0, index);\n const textAfter = text.substring(index + dollarWord.length);\n const newTextNode = document.createTextNode(textBefore);\n const newRange = document.createRange();\n\n // Create a new span element to replace the text node\n const tagSpan = document.createElement('span');\n tagSpan.classList.add('highlighted-tag');\n tagSpan.textContent = `${option.value}`;\n const newTextNodeAfter = document.createTextNode(textAfter);\n\n if (textAfter !== '') {\n // If there is text after the token, add it to the new span element\n textNode.replaceWith(newTextNode, tagSpan, newTextNodeAfter);\n newRange.setStart(newTextNodeAfter, 1);\n } else {\n // If there is no text after the token, add a zero-width space character (Without this, the cursor will not move outside the highlighted span element)\n const afterNode = document.createTextNode('\\u200B');\n textNode.replaceWith(newTextNode, tagSpan, afterNode);\n newRange.setStart(afterNode, 1);\n }\n\n // Hide the dropdown\n this.resetDropdown();\n this.descriptionRef.focus();\n\n // Set the focus to the new span element\n const sel = window.getSelection();\n newRange.collapse(true);\n sel?.removeAllRanges();\n sel?.addRange(newRange);\n\n // Update the event description with the selected token\n this.updateEventDescription(this.descriptionRef.textContent || '');\n }\n\n populateSuggestionsDropdown(query: string = '') {\n this.filteredTokens = this.availableTokens.filter(obj => {\n return obj.label.startsWith(query.toString()) || obj.value.startsWith(query.toString());\n });\n\n // Set the first option as the active descendant\n if (this.filteredTokens.length > 0) {\n this.ariaActivedescendant = this.filteredTokens[0].label;\n }\n }\n\n get isInternalsAvailable() {\n return typeof this.internals !== 'undefined' && typeof this.internals.setValidity === 'function' && typeof this.internals.setFormValue === 'function';\n }\n\n updateEventDescription(text: string) {\n const value = text.replace(/ +/g, ' ');\n this.isInternalsAvailable && this.internals?.setFormValue(value, this.name);\n this.valueChanged.emit({ value: value, name: this.name });\n }\n\n resetDropdown() {\n this.showTokens = false;\n this.ariaActivedescendant = '';\n }\n\n getLabelHTML(token: { token: string; description: string }) {\n return (\n <div class=\"token-label\">\n <span class=\"token\">{token.token}</span>\n <span class=\"description\">{token.description}</span>\n </div>\n );\n }\n\n handleAddAdditionalFields() {\n if (this.additionalFieldTokens.length === 0) {\n return;\n }\n\n // Remove any existing additional fields section while preserving content before and after\n const baseDescription = this.descriptionRef.innerHTML;\n const startMarker = '--- Additional Fields ---';\n const endMarker = '--- End Additional Fields ---';\n\n const startIndex = baseDescription.indexOf(startMarker);\n const endIndex = baseDescription.indexOf(endMarker);\n\n // Add the additional fields block with start and end markers\n let additionalFieldsBlock = startMarker + '\\n';\n this.additionalFieldTokens.forEach(token => {\n additionalFieldsBlock += `${token.description}: ${token.value}\\n`;\n });\n additionalFieldsBlock += endMarker;\n\n let description;\n if (startIndex !== -1 && endIndex !== -1) {\n // Replace existing block while maintaining text positions\n description = baseDescription.substring(0, startIndex) + additionalFieldsBlock + baseDescription.substring(endIndex + endMarker.length);\n } else {\n // First time adding the block\n description = baseDescription + additionalFieldsBlock;\n }\n\n this.updateEventDescriptionFromProp(description);\n this.updateEventDescription(description);\n }\n\n @RegisterComponent<NylasEventDescription, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-event-description',\n stateToProps: new Map([\n ['schedulerConfig.selectedConfiguration', 'selectedConfiguration'],\n ['schedulerConfig.selectedLanguage', 'selectedLanguage'],\n ['schedulerConfig.themeConfig', 'themeConfig'],\n ]),\n eventToProps: {},\n fireRegisterEvent: true,\n })\n render() {\n return (\n <Host>\n <div class=\"nylas-event-description\" part=\"nedesc\">\n <label htmlFor=\"description\">\n {i18next.t('nylasEventDescription.headerTitle')}\n <span class=\"label-icon\">\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">{i18next.t('nylasEventDescription.tooltip.desc')}</span>\n </tooltip-component>\n </span>\n </label>\n <div\n id=\"event-description\"\n class={{ 'event-description': true }}\n part=\"nedesc__textarea\"\n contentEditable=\"true\"\n onInput={e => this.handleChange(e)}\n onKeyDown={event => this.handleInputKeyDown(event)}\n ref={el => (this.descriptionRef = el as HTMLDivElement)}\n ></div>\n {!this.noTemplates && this.showTokens && this.filteredTokens?.length > 0 && (\n <div class=\"token-options\" part=\"nedesc__dropdown-content\">\n <ul tabindex=\"-1\" role=\"listbox\" aria-label={this.name} aria-activedescendant={this.ariaActivedescendant}>\n {this.filteredTokens.map(option => (\n <li\n tabindex=\"0\"\n key={option.label}\n id={option.label}\n class={{ active: this.ariaActivedescendant === option.label }}\n onClick={e => this.selectOption(e, option)}\n role=\"option\"\n >\n {this.getLabelHTML(option.labelHTML)}\n </li>\n ))}\n </ul>\n </div>\n )}\n {!this.noTemplates && (\n <span class=\"help-text\">\n {i18next.t('nylasEventTitle.helpText', { context: 'start', field: i18next.t('nylasEventTitle.description') })} <code>$</code>{' '}\n {i18next.t('nylasEventTitle.helpText', { context: 'end' })}\n <span class=\"label-icon\">\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" width=\"13\" height=\"13\" />\n <span slot=\"tooltip-content\">\n {i18next.t('nylasEventTitle.tooltip.desc')} <code>{'${invitee}'}</code>\n </span>\n </tooltip-component>\n </span>\n </span>\n )}\n {!this.noTemplates && !this.hideAutoPopulateButton && (\n <span class=\"add-additional-fields\">\n <button-component variant=\"basic\" onClick={() => this.handleAddAdditionalFields()}>\n {i18next.t('nylasEventDescription.addAdditionalFields.buttonText')}\n </button-component>\n <span class=\"label-icon\">\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">\n {i18next.t('nylasEventDescription.addAdditionalFields.tooltip.desc')} <code>{'${invitee}'}</code>\n </span>\n </tooltip-component>\n </span>\n </span>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -3,7 +3,7 @@ import { R as RegisterComponent } from './p-BlEWfYUR.js';
|
|
|
3
3
|
import { a as debug, b as instance } from './p-BtX8WBPn.js';
|
|
4
4
|
import { d as defineCustomElement$3 } from './p-7S1M5IE9.js';
|
|
5
5
|
import { d as defineCustomElement$2 } from './p-Crz-yl85.js';
|
|
6
|
-
import { d as defineCustomElement$1 } from './p-
|
|
6
|
+
import { d as defineCustomElement$1 } from './p-CelgQqJU.js';
|
|
7
7
|
|
|
8
8
|
const nylasEventCapacityCss = ":host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:\"Inter\", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;width:inherit}.nylas-event-capacity{display:flex;flex-direction:column;gap:4px}.nylas-event-capacity label{display:flex;align-items:center;gap:4px;color:var(--nylas-base-800);font-size:16px;font-style:normal;font-weight:400;line-height:150%;}.nylas-event-capacity label span.required{color:var(--nylas-error, #cc4841)}.nylas-event-capacity label span.label-icon{margin-left:4px}.nylas-event-capacity label span.label-icon tooltip-component{display:flex}.nylas-event-capacity label tooltip-component::part(tc__content){left:50px}.nylas-event-capacity__wrapper{display:flex;align-items:center;gap:0.5rem}.nylas-event-capacity__wrapper input-component{width:auto}.nylas-event-capacity__wrapper input-component::part(ic__input){border-width:1;border-radius:8px;border:1px solid var(--nylas-base-200);font-family:var(--nylas-font-family);font-size:16px;line-height:24px;width:80px}.nylas-event-capacity__wrapper input-component::part(ic__input--error){border:1px solid var(--nylas-error)}.nylas-event-capacity__wrapper input-component::part(ic__label--error){position:relative;margin-bottom:24px}.nylas-event-capacity__wrapper input-component::part(ic__error_message){position:absolute;top:54px;width:max-content}.nylas-event-capacity__wrapper span.attendees.error{margin-top:-24px}";
|
|
9
9
|
|
|
@@ -172,6 +172,6 @@ function defineCustomElement() {
|
|
|
172
172
|
}
|
|
173
173
|
|
|
174
174
|
export { NylasEventCapacity as N, defineCustomElement as d };
|
|
175
|
-
//# sourceMappingURL=p-
|
|
175
|
+
//# sourceMappingURL=p-DQZVOwPH.js.map
|
|
176
176
|
|
|
177
|
-
//# sourceMappingURL=p-
|
|
177
|
+
//# sourceMappingURL=p-DQZVOwPH.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-B6clCy4A.js","mappings":";;;;;;;AAAA,MAAM,qBAAqB,GAAG,+6GAA+6G;;;;;;;;;;;;;;;;MCuBh8G,kBAAkB,GAAAA,kBAAA,CAAA,MAAA,kBAAA,SAAAC,CAAA,CAAA;AAN/B,IAAA,WAAA,GAAA;;;;;;AAaU,QAAA,IAAI,CAAA,IAAA,GAAW,gBAAgB;AA4B9B,QAAA,IAAK,CAAA,KAAA,GAAW,EAAE;AA6J5B;IAjJC,iBAAiB,GAAA;AACf,QAAA,KAAK,CAAC,sBAAsB,EAAE,mBAAmB,CAAC;;IAGpD,oBAAoB,GAAA;AAClB,QAAA,KAAK,CAAC,sBAAsB,EAAE,sBAAsB,CAAC;;IAGvD,iBAAiB,GAAA;AACf,QAAA,KAAK,CAAC,sBAAsB,EAAE,mBAAmB,CAAC;QAElD,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC;;IAG3C,gBAAgB,GAAA;AACd,QAAA,KAAK,CAAC,sBAAsB,EAAE,kBAAkB,CAAC;QACjD,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC,QAAQ,IAAI,EAAE;QAChD,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE,IAAI,CAAC,qBAAqB,CAAC;AAChE,QAAA,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,qBAAqB,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC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,GAAG,WAAW,IAAGA,QAAO,CAAC,CAAC,CAAC,8BAA8B,CAAC,CAAQ,CACzG,CACP,CACG,CACD;;;;;;;;;;;;;;;;;;;;;;AAlCX,UAAA,CAAA;AApBC,IAAA,iBAAiB,CAAwG;AACxH,QAAA,IAAI,EAAE,sBAAsB;QAC5B,YAAY,EAAE,IAAI,GAAG,CAAC;YACpB,CAAC,kCAAkC,EAAE,kBAAkB,CAAC;YACxD,CAAC,6BAA6B,EAAE,aAAa,CAAC;SAC/C,CAAC;AACF,QAAA,YAAY,EAAE;AACZ,YAAA,YAAY,EAAE,OACZ,KAAiI,EACjI,8BAA6D,KAC3D;AACF,gBAAA,MAAM,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC,MAAM;gBAErC,IAAI,YAAY,EAAE;oBAChB,YAAY,CAAC,KAAK,CAAC;;aAEtB;AACF,SAAA;AACD,QAAA,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;CAqCD,EAAA,kBAAA,CAAA,SAAA,EAAA,QAAA,EAAA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement","i18next"],"sources":["src/components/scheduler-editor/nylas-event-capacity/nylas-event-capacity.scss?tag=nylas-event-capacity&encapsulation=shadow","src/components/scheduler-editor/nylas-event-capacity/nylas-event-capacity.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: inherit;\n}\n\n.nylas-event-capacity {\n display: flex;\n flex-direction: column;\n gap: 4px;\n\n label {\n display: flex;\n align-items: center;\n gap: 4px;\n color: var(--nylas-base-800);\n font-size: 16px;\n font-style: normal;\n font-weight: 400;\n line-height: 150%;\n\n /* 21px */\n span.required {\n color: var(--nylas-error, #cc4841);\n }\n\n span.label-icon {\n margin-left: 4px;\n\n tooltip-component {\n display: flex;\n }\n }\n\n tooltip-component {\n &::part(tc__content) {\n left: 50px;\n }\n }\n }\n}\n\n.nylas-event-capacity__wrapper {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n\n input-component {\n width: auto;\n }\n\n input-component::part(ic__input) {\n border-width: 1;\n border-radius: 8px;\n border: 1px solid var(--nylas-base-200);\n font-family: var(--nylas-font-family);\n font-size: 16px;\n line-height: 24px;\n width: 80px;\n }\n\n input-component::part(ic__input--error) {\n border: 1px solid var(--nylas-error);\n }\n\n input-component::part(ic__label--error) {\n position: relative;\n margin-bottom: 24px;\n }\n\n input-component::part(ic__error_message) {\n position: absolute;\n top: 54px;\n width: max-content;\n }\n\n span.attendees {\n &.error {\n margin-top: -24px;\n }\n }\n}\n","import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug } from '@/utils/utils';\nimport { AttachInternals, Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport i18next from '@/utils/i18n';\nimport { LANGUAGE_CODE } from '@/common/constants';\nimport { ThemeConfig } from '@nylas/core';\n/**\n * The `nylas-event-capacity` component is a UI component that allows users to set the event capacity for the scheduler configuration.\n *\n * @part necapacity - The nylas-event-capacity container\n * @part necapacity__body - The body of the event capacity section\n * @part necapacity__header - The header of the event capacity section\n * @part necapacity__drawer-toggle--container - The card's drawer toggle container\n * @part necapacity__input-numberfield - The event capacity input numberfield\n */\n@Component({\n tag: 'nylas-event-capacity',\n styleUrl: 'nylas-event-capacity.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasEventCapacity {\n @Element() host!: HTMLNylasEventCapacityElement;\n\n /**\n * @standalone\n * The name of the component\n */\n @Prop() name: string = 'event-capacity';\n /**\n * @standalone\n * The default event capacity\n */\n @Prop() capacity?: number;\n\n /**\n * The selected language.\n */\n @Prop() selectedLanguage?: LANGUAGE_CODE;\n\n /**\n * @standalone\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: ThemeConfig;\n\n /**\n * The element internals.\n */\n @AttachInternals() internals!: ElementInternals;\n\n /**\n * The current event capacity state\n */\n @State() selectedEventCapacity!: number;\n\n @State() error: string = '';\n\n /**\n * This event is fired when the event capacity value changes\n */\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n valueChanged?: (event: CustomEvent<{ value: string; name: string }>) => void;\n }>;\n\n // Lifecycle methods\n connectedCallback() {\n debug('nylas-event-capacity', 'connectedCallback');\n }\n\n disconnectedCallback() {\n debug('nylas-event-capacity', 'disconnectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-event-capacity', 'componentWillLoad');\n // See comment in the @Watch('name') decorator for more information.\n this.host.setAttribute('name', this.name);\n }\n\n componentDidLoad() {\n debug('nylas-event-capacity', 'componentDidLoad');\n this.selectedEventCapacity = this.capacity || 10;\n console.log('selectedEventCapacity', this.selectedEventCapacity);\n this.internals.setFormValue(this.selectedEventCapacity.toString(), this.name);\n }\n\n componentWillUpdate() {\n debug('nylas-event-capacity', 'componentWillUpdate');\n }\n\n componentDidUpdate() {\n debug('nylas-event-capacity', 'componentDidUpdate');\n }\n\n componentWillRender() {\n debug('nylas-event-capacity', 'componentWillRender');\n }\n\n componentDidRender() {\n debug('nylas-event-capacity', 'componentDidRender');\n }\n\n /**\n * When a name prop is passed, stencil does not automatically set the name attribute on the host element.\n * Since this component is form-associated, the name attribute is required for form submission.\n * This is a workaround to ensure that the name attribute is set on the host element.\n */\n @Watch('name')\n elementNameChangedHandler(newValue: string) {\n debug('nylas-event-capacity', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('selectedLanguage')\n selectedLanguageChangedHandler(newVal: LANGUAGE_CODE, oldVal: LANGUAGE_CODE) {\n if (newVal === oldVal) return;\n i18next.changeLanguage(newVal);\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.host.style.setProperty(`${key}`, value);\n }\n }\n }\n\n @Listen('nylasFormInputChanged')\n async nylasFormInputChangeHandler(event: CustomEvent<{ value: string; name: string }>) {\n const { name, value } = event.detail;\n\n if (name === 'event-capacity') {\n const parsedValue = parseInt(value);\n if (parsedValue < 1 || parsedValue > 500 || isNaN(parsedValue)) {\n this.error = i18next.t('fixFormErrors');\n this.internals.setValidity({ customError: true }, this.error);\n this.valueChanged.emit({ value: value.toString(), name: this.name });\n return;\n }\n this.error = '';\n this.internals.setValidity({ customError: false }, '');\n this.selectedEventCapacity = parseInt(value);\n this.internals.setFormValue(value.toString(), this.name);\n this.valueChanged.emit({ value: value.toString(), name: this.name });\n }\n }\n\n @RegisterComponent<NylasEventCapacity, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-event-capacity',\n stateToProps: new Map([\n ['schedulerConfig.selectedLanguage', 'selectedLanguage'],\n ['schedulerConfig.themeConfig', 'themeConfig'],\n ]),\n eventToProps: {\n valueChanged: async (\n event: CustomEvent<{ value: string; name: string; valueChanged?: (event: CustomEvent<{ value: string; name: string }>) => void }>,\n _nylasSchedulerConfigConnector: NylasSchedulerConfigConnector,\n ) => {\n const { valueChanged } = event.detail;\n // If a handler is passed, call it.\n if (valueChanged) {\n valueChanged(event);\n }\n },\n },\n fireRegisterEvent: true,\n })\n render() {\n const isComponentReady = typeof this.selectedEventCapacity !== 'undefined';\n return (\n <Host>\n <div class=\"nylas-event-capacity\" part=\"necapacity\">\n <label htmlFor=\"event-capacity\">\n <span>\n {i18next.t('nylasEventCapacity.headerTitle')}\n <span class=\"required\">*</span>\n </span>\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">{i18next.t('nylasEventCapacity.tooltip.desc')}</span>\n </tooltip-component>\n </label>\n {isComponentReady && (\n <div class=\"nylas-event-capacity__wrapper\">\n <input-component\n name=\"event-capacity\"\n id=\"event-capacity\"\n type=\"number\"\n pattern={/^[0-9]*$/}\n patternError={i18next.t('invalidInputFormat', { field: 'Event capacity' })}\n minValue={1}\n maxValue={500}\n required={false}\n exportparts=\"ic_input: necapacity__input-textfield\"\n defaultValue={typeof this.selectedEventCapacity === 'number' ? this.selectedEventCapacity.toString() : '10'}\n themeConfig={this.themeConfig}\n />\n <span class={this.error ? 'attendees error' : 'attendees'}>{i18next.t('nylasEventCapacity.attendees')}</span>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"p-DQZVOwPH.js","mappings":";;;;;;;AAAA,MAAM,qBAAqB,GAAG,+6GAA+6G;;;;;;;;;;;;;;;;MCuBh8G,kBAAkB,GAAAA,kBAAA,CAAA,MAAA,kBAAA,SAAAC,CAAA,CAAA;AAN/B,IAAA,WAAA,GAAA;;;;;;AAaU,QAAA,IAAI,CAAA,IAAA,GAAW,gBAAgB;AA4B9B,QAAA,IAAK,CAAA,KAAA,GAAW,EAAE;AA6J5B;IAjJC,iBAAiB,GAAA;AACf,QAAA,KAAK,CAAC,sBAAsB,EAAE,mBAAmB,CAAC;;IAGpD,oBAAoB,GAAA;AAClB,QAAA,KAAK,CAAC,sBAAsB,EAAE,sBAAsB,CAAC;;IAGvD,iBAAiB,GAAA;AACf,QAAA,KAAK,CAAC,sBAAsB,EAAE,mBAAmB,CAAC;QAElD,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC;;IAG3C,gBAAgB,GAAA;AACd,QAAA,KAAK,CAAC,sBAAsB,EAAE,kBAAkB,CAAC;QACjD,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC,QAAQ,IAAI,EAAE;QAChD,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE,IAAI,CAAC,qBAAqB,CAAC;AAChE,Q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CAAA,EACF,CAAM,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAE,IAAI,CAAC,KAAK,GAAG,iBAAiB,GAAG,WAAW,IAAGA,QAAO,CAAC,CAAC,CAAC,8BAA8B,CAAC,CAAQ,CACzG,CACP,CACG,CACD;;;;;;;;;;;;;;;;;;;;;;AAlCX,UAAA,CAAA;AApBC,IAAA,iBAAiB,CAAwG;AACxH,QAAA,IAAI,EAAE,sBAAsB;QAC5B,YAAY,EAAE,IAAI,GAAG,CAAC;YACpB,CAAC,kCAAkC,EAAE,kBAAkB,CAAC;YACxD,CAAC,6BAA6B,EAAE,aAAa,CAAC;SAC/C,CAAC;AACF,QAAA,YAAY,EAAE;AACZ,YAAA,YAAY,EAAE,OACZ,KAAiI,EACjI,8BAA6D,KAC3D;AACF,gBAAA,MAAM,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC,MAAM;gBAErC,IAAI,YAAY,EAAE;oBAChB,YAAY,CAAC,KAAK,CAAC;;aAEtB;AACF,SAAA;AACD,QAAA,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;CAqCD,EAAA,kBAAA,CAAA,SAAA,EAAA,QAAA,EAAA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement","i18next"],"sources":["src/components/scheduler-editor/nylas-event-capacity/nylas-event-capacity.scss?tag=nylas-event-capacity&encapsulation=shadow","src/components/scheduler-editor/nylas-event-capacity/nylas-event-capacity.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: inherit;\n}\n\n.nylas-event-capacity {\n display: flex;\n flex-direction: column;\n gap: 4px;\n\n label {\n display: flex;\n align-items: center;\n gap: 4px;\n color: var(--nylas-base-800);\n font-size: 16px;\n font-style: normal;\n font-weight: 400;\n line-height: 150%;\n\n /* 21px */\n span.required {\n color: var(--nylas-error, #cc4841);\n }\n\n span.label-icon {\n margin-left: 4px;\n\n tooltip-component {\n display: flex;\n }\n }\n\n tooltip-component {\n &::part(tc__content) {\n left: 50px;\n }\n }\n }\n}\n\n.nylas-event-capacity__wrapper {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n\n input-component {\n width: auto;\n }\n\n input-component::part(ic__input) {\n border-width: 1;\n border-radius: 8px;\n border: 1px solid var(--nylas-base-200);\n font-family: var(--nylas-font-family);\n font-size: 16px;\n line-height: 24px;\n width: 80px;\n }\n\n input-component::part(ic__input--error) {\n border: 1px solid var(--nylas-error);\n }\n\n input-component::part(ic__label--error) {\n position: relative;\n margin-bottom: 24px;\n }\n\n input-component::part(ic__error_message) {\n position: absolute;\n top: 54px;\n width: max-content;\n }\n\n span.attendees {\n &.error {\n margin-top: -24px;\n }\n }\n}\n","import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug } from '@/utils/utils';\nimport { AttachInternals, Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport i18next from '@/utils/i18n';\nimport { LANGUAGE_CODE } from '@/common/constants';\nimport { ThemeConfig } from '@nylas/core';\n/**\n * The `nylas-event-capacity` component is a UI component that allows users to set the event capacity for the scheduler configuration.\n *\n * @part necapacity - The nylas-event-capacity container\n * @part necapacity__body - The body of the event capacity section\n * @part necapacity__header - The header of the event capacity section\n * @part necapacity__drawer-toggle--container - The card's drawer toggle container\n * @part necapacity__input-numberfield - The event capacity input numberfield\n */\n@Component({\n tag: 'nylas-event-capacity',\n styleUrl: 'nylas-event-capacity.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasEventCapacity {\n @Element() host!: HTMLNylasEventCapacityElement;\n\n /**\n * @standalone\n * The name of the component\n */\n @Prop() name: string = 'event-capacity';\n /**\n * @standalone\n * The default event capacity\n */\n @Prop() capacity?: number;\n\n /**\n * The selected language.\n */\n @Prop() selectedLanguage?: LANGUAGE_CODE;\n\n /**\n * @standalone\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: ThemeConfig;\n\n /**\n * The element internals.\n */\n @AttachInternals() internals!: ElementInternals;\n\n /**\n * The current event capacity state\n */\n @State() selectedEventCapacity!: number;\n\n @State() error: string = '';\n\n /**\n * This event is fired when the event capacity value changes\n */\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n valueChanged?: (event: CustomEvent<{ value: string; name: string }>) => void;\n }>;\n\n // Lifecycle methods\n connectedCallback() {\n debug('nylas-event-capacity', 'connectedCallback');\n }\n\n disconnectedCallback() {\n debug('nylas-event-capacity', 'disconnectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-event-capacity', 'componentWillLoad');\n // See comment in the @Watch('name') decorator for more information.\n this.host.setAttribute('name', this.name);\n }\n\n componentDidLoad() {\n debug('nylas-event-capacity', 'componentDidLoad');\n this.selectedEventCapacity = this.capacity || 10;\n console.log('selectedEventCapacity', this.selectedEventCapacity);\n this.internals.setFormValue(this.selectedEventCapacity.toString(), this.name);\n }\n\n componentWillUpdate() {\n debug('nylas-event-capacity', 'componentWillUpdate');\n }\n\n componentDidUpdate() {\n debug('nylas-event-capacity', 'componentDidUpdate');\n }\n\n componentWillRender() {\n debug('nylas-event-capacity', 'componentWillRender');\n }\n\n componentDidRender() {\n debug('nylas-event-capacity', 'componentDidRender');\n }\n\n /**\n * When a name prop is passed, stencil does not automatically set the name attribute on the host element.\n * Since this component is form-associated, the name attribute is required for form submission.\n * This is a workaround to ensure that the name attribute is set on the host element.\n */\n @Watch('name')\n elementNameChangedHandler(newValue: string) {\n debug('nylas-event-capacity', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('selectedLanguage')\n selectedLanguageChangedHandler(newVal: LANGUAGE_CODE, oldVal: LANGUAGE_CODE) {\n if (newVal === oldVal) return;\n i18next.changeLanguage(newVal);\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.host.style.setProperty(`${key}`, value);\n }\n }\n }\n\n @Listen('nylasFormInputChanged')\n async nylasFormInputChangeHandler(event: CustomEvent<{ value: string; name: string }>) {\n const { name, value } = event.detail;\n\n if (name === 'event-capacity') {\n const parsedValue = parseInt(value);\n if (parsedValue < 1 || parsedValue > 500 || isNaN(parsedValue)) {\n this.error = i18next.t('fixFormErrors');\n this.internals.setValidity({ customError: true }, this.error);\n this.valueChanged.emit({ value: value.toString(), name: this.name });\n return;\n }\n this.error = '';\n this.internals.setValidity({ customError: false }, '');\n this.selectedEventCapacity = parseInt(value);\n this.internals.setFormValue(value.toString(), this.name);\n this.valueChanged.emit({ value: value.toString(), name: this.name });\n }\n }\n\n @RegisterComponent<NylasEventCapacity, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-event-capacity',\n stateToProps: new Map([\n ['schedulerConfig.selectedLanguage', 'selectedLanguage'],\n ['schedulerConfig.themeConfig', 'themeConfig'],\n ]),\n eventToProps: {\n valueChanged: async (\n event: CustomEvent<{ value: string; name: string; valueChanged?: (event: CustomEvent<{ value: string; name: string }>) => void }>,\n _nylasSchedulerConfigConnector: NylasSchedulerConfigConnector,\n ) => {\n const { valueChanged } = event.detail;\n // If a handler is passed, call it.\n if (valueChanged) {\n valueChanged(event);\n }\n },\n },\n fireRegisterEvent: true,\n })\n render() {\n const isComponentReady = typeof this.selectedEventCapacity !== 'undefined';\n return (\n <Host>\n <div class=\"nylas-event-capacity\" part=\"necapacity\">\n <label htmlFor=\"event-capacity\">\n <span>\n {i18next.t('nylasEventCapacity.headerTitle')}\n <span class=\"required\">*</span>\n </span>\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">{i18next.t('nylasEventCapacity.tooltip.desc')}</span>\n </tooltip-component>\n </label>\n {isComponentReady && (\n <div class=\"nylas-event-capacity__wrapper\">\n <input-component\n name=\"event-capacity\"\n id=\"event-capacity\"\n type=\"number\"\n pattern={/^[0-9]*$/}\n patternError={i18next.t('invalidInputFormat', { field: 'Event capacity' })}\n minValue={1}\n maxValue={500}\n required={false}\n exportparts=\"ic_input: necapacity__input-textfield\"\n defaultValue={typeof this.selectedEventCapacity === 'number' ? this.selectedEventCapacity.toString() : '10'}\n themeConfig={this.themeConfig}\n />\n <span class={this.error ? 'attendees error' : 'attendees'}>{i18next.t('nylasEventCapacity.attendees')}</span>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -6,7 +6,7 @@ import { d as defineCustomElement$5 } from './p-7S1M5IE9.js';
|
|
|
6
6
|
import { d as defineCustomElement$4 } from './p-Crz-yl85.js';
|
|
7
7
|
import { d as defineCustomElement$3 } from './p-ClTk9Ttz.js';
|
|
8
8
|
import { d as defineCustomElement$2 } from './p-D7lRYhTx.js';
|
|
9
|
-
import { d as defineCustomElement$1 } from './p-
|
|
9
|
+
import { d as defineCustomElement$1 } from './p-CelgQqJU.js';
|
|
10
10
|
|
|
11
11
|
const nylasBookingConfirmationRedirectCss = ":host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:\"Inter\", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;width:inherit}.nylas-booking-confirmation-redirect{width:inherit;display:flex;flex-direction:column}.nylas-booking-confirmation-redirect .nylas-booking-confirmation-redirect__dropdown span.label{display:flex;align-items:center;gap:4px;margin-bottom:4px;color:var(--nylas-base-800)}.nylas-booking-confirmation-redirect .nylas-booking-confirmation-redirect__dropdown span.label tooltip-component{display:flex}.nylas-booking-confirmation-redirect .nylas-booking-confirmation-redirect__dropdown select-dropdown::part(sd_dropdown){width:100%}.nylas-booking-confirmation-redirect .nylas-booking-confirmation-redirect__dropdown select-dropdown::part(sd_dropdown-button){width:100%;display:flex;justify-content:space-between;align-items:center;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);padding:1rem}.nylas-booking-confirmation-redirect .nylas-booking-confirmation-redirect__dropdown select-dropdown::part(sd_dropdown-content){width:100%;max-width:unset}.nylas-booking-confirmation-redirect .nylas-booking-confirmation-redirect__dropdown select-dropdown::part(sd_dropdown-button-selected-label){max-width:calc(100% - 2rem);font-family:var(--nylas-font-family);font-size:16px;line-height:24px}.nylas-booking-confirmation-redirect .nylas-booking-confirmation-redirect__dropdown input-component::part(ic__input_wrapper){margin-top:1rem}.nylas-booking-confirmation-redirect .nylas-booking-confirmation-redirect__dropdown span.error-message{color:var(--nylas-error)}";
|
|
12
12
|
|
|
@@ -253,6 +253,6 @@ function defineCustomElement() {
|
|
|
253
253
|
}
|
|
254
254
|
|
|
255
255
|
export { NylasBookingConfirmationRedirect as N, defineCustomElement as d };
|
|
256
|
-
//# sourceMappingURL=p-
|
|
256
|
+
//# sourceMappingURL=p-DhtHRxq1.js.map
|
|
257
257
|
|
|
258
|
-
//# sourceMappingURL=p-
|
|
258
|
+
//# sourceMappingURL=p-DhtHRxq1.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-B0o5xunX.js","mappings":";;;;;;;;;;AAAA,MAAM,mCAAmC,GAAG,uoHAAuoH;;;;;;;;;;;;;;;;MCyBtqH,gCAAgC,GAAAA,kBAAA,CAAA,MAA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yDD,EAAA,gCAAA,CAAA,SAAA,EAAA,QAAA,EAAA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement","i18next"],"sources":["src/components/scheduler-editor/nylas-booking-confirmation-redirect/nylas-booking-confirmation-redirect.scss?tag=nylas-booking-confirmation-redirect&encapsulation=shadow","src/components/scheduler-editor/nylas-booking-confirmation-redirect/nylas-booking-confirmation-redirect.tsx"],"sourcesContent":["@use '../../../common/styles/variables' as *;\n\n:host {\n display: block;\n @include default-css-variables;\n width: inherit;\n}\n\n.nylas-booking-confirmation-redirect {\n width: inherit;\n display: flex;\n flex-direction: column;\n\n .nylas-booking-confirmation-redirect__dropdown {\n span.label {\n display: flex;\n align-items: center;\n gap: 4px;\n margin-bottom: 4px;\n color: var(--nylas-base-800);\n\n tooltip-component {\n display: flex;\n }\n }\n\n select-dropdown::part(sd_dropdown) {\n width: 100%;\n }\n\n select-dropdown::part(sd_dropdown-button) {\n width: 100%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n border: 1px solid var(--nylas-base-200);\n border-radius: var(--nylas-border-radius-2x);\n padding: 1rem;\n }\n\n select-dropdown::part(sd_dropdown-content) {\n width: 100%;\n max-width: unset;\n }\n\n select-dropdown::part(sd_dropdown-button-selected-label) {\n max-width: calc(100% - 2rem);\n font-family: var(--nylas-font-family);\n font-size: 16px;\n line-height: 24px;\n }\n\n input-component::part(ic__input_wrapper) {\n margin-top: 1rem;\n }\n\n span.error-message {\n color: var(--nylas-error);\n }\n }\n}\n","import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug } from '@/utils/utils';\nimport { AttachInternals, Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { isValidUrl } from '@/utils/utils';\nimport { Configuration, ThemeConfig } from '@nylas/core';\nimport i18next from '@/utils/i18n';\nimport { LANGUAGE_CODE } from '@/common/constants';\n\n/**\n * The `nylas-booking-confirmation-redirect` component is a UI component that allows the user to choose a custom redirect URL after a booking is confirmed.\n * @part nbcr - The booking redirect container\n * @part nbcr__header - The header of the booking redirect\n * @part nbcr__dropdown - The dropdown container\n * @part nbcr__dropdown-button - The dropdown button\n * @part nbcr__dropdown-content - The dropdown content\n * @part nbcr__input-textfield - The input field content\n */\n@Component({\n tag: 'nylas-booking-confirmation-redirect',\n styleUrl: 'nylas-booking-confirmation-redirect.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasBookingConfirmationRedirect {\n @Element() host!: HTMLNylasBookingConfirmationRedirectElement;\n /**\n * @standalone\n * The selected config\n */\n @Prop() selectedConfiguration?: Configuration;\n /**\n * @standalone\n * The name of the confirmation redirect link.\n */\n @Prop() name: string = 'confirmation-redirect';\n /**\n * @standalone\n * The custom redirect URL.\n */\n @Prop() redirectUrl: string = '';\n /**\n * @standalone\n * The custom redirect URL error message\n */\n @Prop() redirectUrlErrorMessage: string = '';\n /**\n * The selected language.\n */\n @Prop() selectedLanguage?: LANGUAGE_CODE;\n /**\n * @standalone\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: ThemeConfig;\n\n /**\n * The element internals.\n */\n @AttachInternals() internals!: ElementInternals;\n\n /**\n * The current redirect URL.\n */\n @State() currentRedirectUrl: string = '';\n /**\n * The state for whether a custom URL can be added.\n */\n @State() acceptUrl!: boolean;\n\n @State() componentLoaded: boolean = false;\n\n @State() requiredError: string = '';\n @State() patternError: string = '';\n\n /**\n * This event is fired when the current redirect URL changes and is valid.\n */\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n valueChanged?: (event: CustomEvent<{ value: string; name: string }>) => void;\n }>;\n\n /**\n * When a name prop is passed, stencil does not automatically set the name attribute on the host element.\n * Since this component is form-associated, the name attribute is required for form submission.\n * This is a workaround to ensure that the name attribute is set on the host element.\n */\n @Watch('name')\n elementNameChangedHandler(newValue: string) {\n debug('nylas-booking-confirmation-redirect', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('selectedConfiguration')\n selectedConfigurationChangedHandler(newValue: Configuration) {\n debug('nylas-booking-confirmation-redirect', 'selectedConfigurationChangedHandler', newValue);\n if (newValue?.scheduler?.confirmation_redirect_url) {\n this.currentRedirectUrl = newValue?.scheduler?.confirmation_redirect_url;\n this.acceptUrl = newValue?.scheduler?.confirmation_redirect_url !== '';\n }\n }\n\n @Watch('selectedLanguage')\n selectedLanguageChangedHandler(newVal: LANGUAGE_CODE, oldVal: LANGUAGE_CODE) {\n if (newVal === oldVal) return;\n i18next.changeLanguage(newVal);\n this.requiredError = i18next.t('fieldRequired', { field: i18next.t('redirectUrl') });\n this.patternError = i18next.t('invalidInputFormat', { field: i18next.t('redirectUrl') });\n }\n\n @Watch('themeConfig')\n themeConfigChangedHandler(newVal: ThemeConfig, oldVal: ThemeConfig) {\n if (newVal === oldVal) return;\n this.applyThemeConfig(newVal);\n }\n\n // Lifecycle methods\n connectedCallback() {\n debug('nylas-booking-confirmation-redirect', 'connectedCallback');\n }\n\n disconnectedCallback() {\n debug('nylas-booking-confirmation-redirect', 'disconnectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-booking-confirmation-redirect', 'componentWillLoad');\n // See comment in the @Watch('name') decorator for more information.\n this.host.setAttribute('name', this.name);\n }\n\n componentDidLoad() {\n debug('nylas-booking-confirmation-redirect', 'componentDidLoad');\n if (this.selectedConfiguration) {\n this.selectedConfigurationChangedHandler(this.selectedConfiguration);\n } else {\n this.currentRedirectUrl = this.redirectUrl;\n this.acceptUrl = this.redirectUrl !== '';\n }\n this.componentLoaded = true;\n if (typeof this.internals.setFormValue === 'function') {\n this.internals.setFormValue(this.currentRedirectUrl.toString(), this.name);\n }\n }\n\n componentWillUpdate() {\n debug('nylas-booking-confirmation-redirect', 'componentWillUpdate');\n }\n\n componentDidUpdate() {\n debug('nylas-booking-confirmation-redirect', 'componentDidUpdate');\n }\n\n componentWillRender() {\n debug('nylas-booking-confirmation-redirect', 'componentWillRender');\n }\n\n componentDidRender() {\n debug('nylas-booking-confirmation-redirect', 'componentDidRender');\n }\n\n @Listen('nylasFormDropdownChanged')\n nylasFormDropdownChangedHandler(event: CustomEvent<{ value: string; name: string }>) {\n debug('nylas-booking-confirmation-redirect', 'nylasFormDropdownChangedHandler', event.detail);\n\n const { name, value } = event.detail;\n\n if (name === 'confirmation-redirect-dropdown') {\n if (value === 'custom') {\n this.acceptUrl = true;\n } else {\n this.acceptUrl = false;\n\n // Submit empty string to clear redirect URL\n this.internals.setFormValue('', this.name);\n this.valueChanged.emit({ name: this.name, value: '' });\n }\n }\n }\n\n @Listen('nylasFormInputBlurred')\n nylasFormInputBlurHandler(event: CustomEvent<{ value: string; name: string }>) {\n const { name, value } = event.detail;\n this.currentRedirectUrl = value;\n\n if (this.acceptUrl && name === 'confirmation-redirect') {\n this.redirectUrlErrorMessage = '';\n\n if (!isValidUrl(this.currentRedirectUrl)) {\n this.internals.setValidity({ customError: true }, i18next.t('nylasBookingConfirmationRedirect.customRedirectUrlErrorMessage'));\n this.redirectUrlErrorMessage = i18next.t('nylasBookingConfirmationRedirect.customRedirectUrlErrorMessage');\n return;\n }\n this.internals.setValidity({});\n\n // Pass as handler so that if event.defaultPrevented by parent app, this will be skipped.\n const valueChanged = (event: CustomEvent<{ value: string; name: string }>) => {\n const { value } = event.detail;\n this.internals.setFormValue(value.toString(), this.name);\n };\n this.valueChanged.emit({ ...event.detail, valueChanged });\n }\n }\n\n @Listen('formSubmitted', { target: 'document' })\n formSubmittedHandler(_event: CustomEvent) {\n if (this.acceptUrl && !isValidUrl(this.currentRedirectUrl)) {\n this.internals.setValidity({ customError: true }, i18next.t('nylasBookingConfirmationRedirect.customRedirectUrlErrorMessage'));\n this.redirectUrlErrorMessage = i18next.t('nylasBookingConfirmationRedirect.customRedirectUrlErrorMessage');\n } else {\n this.internals.setValidity({});\n }\n }\n\n applyThemeConfig(themeConfig?: ThemeConfig) {\n if (themeConfig) {\n for (const [key, value] of Object.entries(themeConfig)) {\n this.host.style.setProperty(`${key}`, value);\n }\n }\n }\n\n @RegisterComponent<NylasBookingConfirmationRedirect, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-booking-confirmation-redirect',\n stateToProps: new Map([\n ['schedulerConfig.selectedConfiguration', 'selectedConfiguration'],\n ['schedulerConfig.selectedLanguage', 'selectedLanguage'],\n ['schedulerConfig.themeConfig', 'themeConfig'],\n ]),\n eventToProps: {\n valueChanged: async (\n event: CustomEvent<{ value: string; name: string; valueChanged?: (event: CustomEvent<{ value: string; name: string }>) => void }>,\n _nylasSchedulerConfigConnector: NylasSchedulerConfigConnector,\n ) => {\n const { valueChanged } = event.detail;\n // If a handler is passed, call it.\n if (valueChanged) {\n valueChanged(event);\n }\n },\n },\n fireRegisterEvent: true,\n })\n render() {\n const redirectOptions = [\n {\n label: i18next.t('nylasBookingConfirmationRedirect.redirectOption', { context: 'default' }),\n value: 'default',\n },\n {\n label: i18next.t('nylasBookingConfirmationRedirect.redirectOption', { context: 'custom' }),\n value: 'custom',\n },\n ];\n\n return (\n <Host>\n <div class=\"nylas-booking-confirmation-redirect\" part=\"nbcr\">\n {redirectOptions.length > 0 && (\n <div class=\"nylas-booking-confirmation-redirect__dropdown\">\n <span class=\"label\">\n {i18next.t('nylasBookingConfirmationRedirect.dropdownLabel')}\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">{i18next.t('nylasBookingConfirmationRedirect.tooltip.desc')}</span>\n </tooltip-component>\n </span>\n {this.componentLoaded && (\n <select-dropdown\n name=\"confirmation-redirect-dropdown\"\n options={redirectOptions}\n withSearch={false}\n defaultSelectedOption={redirectOptions.find(option => option.value === (this.acceptUrl ? 'custom' : 'default'))}\n exportparts=\"sd_dropdown: nbcr__dropdown, sd_dropdown-button: nbcr__dropdown-button, sd_dropdown-content: nbcr__dropdown-content\"\n themeConfig={this.themeConfig}\n />\n )}\n {this.acceptUrl && (\n <div>\n <input-component\n name=\"confirmation-redirect\"\n id=\"confirmation-redirect\"\n type=\"text\"\n placeholder={i18next.t('nylasBookingConfirmationRedirect.customRedirectUrlPlaceholder')}\n required={false}\n part=\"ic__input_wrapper: nbcr__input-textfield\"\n requiredError={this.requiredError}\n patternError={this.patternError}\n defaultValue={this.currentRedirectUrl}\n themeConfig={this.themeConfig}\n />\n {this.redirectUrlErrorMessage && <span class=\"error-message\">{this.redirectUrlErrorMessage}</span>}\n </div>\n )}\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"p-DhtHRxq1.js","mappings":";;;;;;;;;;AAAA,MAAM,mCAAmC,GAAG,uoHAAuoH;;;;;;;;;;;;;;;;MCyBtqH,gCAAgC,GAAAA,kBAAA,CAAA,MAAA,gCAAA,SAAAC,CAAA,CAAA;AAN7C,IAAA,WAAA,GAAA;;;;;;AAiBU,QAAA,IAAI,CAAA,IAAA,GAAW,uBAAuB;AAKtC,QAAA,IAAW,CAAA,WAAA,GAAW,EAAE;AAKxB,QAAA,IAAuB,CAAA,uBAAA,GAAW,EAAE;AAmBnC,QAAA,IAAkB,CAAA,kBAAA,GAAW,EAAE;AAM/B,QAAA,IAAe,CAAA,eAAA,GAAY,KAAK;AAEhC,QAAA,IAAa,CAAA,aAAA,GAAW,EAAE;AAC1B,QAAA,IAAY,CAAA,YAAA,GAAW,EAAE;AAqOnC;AApNC,IAAA,yBAAyB,CAAC,QAAgB,EAAA;AACxC,QAAA,KAAK,CAAC,qCAAqC,EAAE,2BAA2B,EAAE,QAAQ,CAAC;QACnF,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC;;AAI1C,IAAA,mCAAmC,CAAC,QAAuB,EAAA;AACzD,QAAA,KAAK,CAAC,qCAAqC,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CAAC,uBAAuB,CAAQ,CAC9F,CACP,CACG,CACP,CACG,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAtDX,UAAA,CAAA;AArBC,IAAA,iBAAiB,CAAsH;AACtI,QAAA,IAAI,EAAE,qCAAqC;QAC3C,YAAY,EAAE,IAAI,GAAG,CAAC;YACpB,CAAC,uCAAuC,EAAE,uBAAuB,CAAC;YAClE,CAAC,kCAAkC,EAAE,kBAAkB,CAAC;YACxD,CAAC,6BAA6B,EAAE,aAAa,CAAC;SAC/C,CAAC;AACF,QAAA,YAAY,EAAE;AACZ,YAAA,YAAY,EAAE,OACZ,KAAiI,EACjI,8BAA6D,KAC3D;AACF,gBAAA,MAAM,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC,MAAM;gBAErC,IAAI,YAAY,EAAE;oBAChB,YAAY,CAAC,KAAK,CAAC;;aAEtB;AACF,SAAA;AACD,QAAA,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;CAyDD,EAAA,gCAAA,CAAA,SAAA,EAAA,QAAA,EAAA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement","i18next"],"sources":["src/components/scheduler-editor/nylas-booking-confirmation-redirect/nylas-booking-confirmation-redirect.scss?tag=nylas-booking-confirmation-redirect&encapsulation=shadow","src/components/scheduler-editor/nylas-booking-confirmation-redirect/nylas-booking-confirmation-redirect.tsx"],"sourcesContent":["@use '../../../common/styles/variables' as *;\n\n:host {\n display: block;\n @include default-css-variables;\n width: inherit;\n}\n\n.nylas-booking-confirmation-redirect {\n width: inherit;\n display: flex;\n flex-direction: column;\n\n .nylas-booking-confirmation-redirect__dropdown {\n span.label {\n display: flex;\n align-items: center;\n gap: 4px;\n margin-bottom: 4px;\n color: var(--nylas-base-800);\n\n tooltip-component {\n display: flex;\n }\n }\n\n select-dropdown::part(sd_dropdown) {\n width: 100%;\n }\n\n select-dropdown::part(sd_dropdown-button) {\n width: 100%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n border: 1px solid var(--nylas-base-200);\n border-radius: var(--nylas-border-radius-2x);\n padding: 1rem;\n }\n\n select-dropdown::part(sd_dropdown-content) {\n width: 100%;\n max-width: unset;\n }\n\n select-dropdown::part(sd_dropdown-button-selected-label) {\n max-width: calc(100% - 2rem);\n font-family: var(--nylas-font-family);\n font-size: 16px;\n line-height: 24px;\n }\n\n input-component::part(ic__input_wrapper) {\n margin-top: 1rem;\n }\n\n span.error-message {\n color: var(--nylas-error);\n }\n }\n}\n","import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug } from '@/utils/utils';\nimport { AttachInternals, Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { isValidUrl } from '@/utils/utils';\nimport { Configuration, ThemeConfig } from '@nylas/core';\nimport i18next from '@/utils/i18n';\nimport { LANGUAGE_CODE } from '@/common/constants';\n\n/**\n * The `nylas-booking-confirmation-redirect` component is a UI component that allows the user to choose a custom redirect URL after a booking is confirmed.\n * @part nbcr - The booking redirect container\n * @part nbcr__header - The header of the booking redirect\n * @part nbcr__dropdown - The dropdown container\n * @part nbcr__dropdown-button - The dropdown button\n * @part nbcr__dropdown-content - The dropdown content\n * @part nbcr__input-textfield - The input field content\n */\n@Component({\n tag: 'nylas-booking-confirmation-redirect',\n styleUrl: 'nylas-booking-confirmation-redirect.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasBookingConfirmationRedirect {\n @Element() host!: HTMLNylasBookingConfirmationRedirectElement;\n /**\n * @standalone\n * The selected config\n */\n @Prop() selectedConfiguration?: Configuration;\n /**\n * @standalone\n * The name of the confirmation redirect link.\n */\n @Prop() name: string = 'confirmation-redirect';\n /**\n * @standalone\n * The custom redirect URL.\n */\n @Prop() redirectUrl: string = '';\n /**\n * @standalone\n * The custom redirect URL error message\n */\n @Prop() redirectUrlErrorMessage: string = '';\n /**\n * The selected language.\n */\n @Prop() selectedLanguage?: LANGUAGE_CODE;\n /**\n * @standalone\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: ThemeConfig;\n\n /**\n * The element internals.\n */\n @AttachInternals() internals!: ElementInternals;\n\n /**\n * The current redirect URL.\n */\n @State() currentRedirectUrl: string = '';\n /**\n * The state for whether a custom URL can be added.\n */\n @State() acceptUrl!: boolean;\n\n @State() componentLoaded: boolean = false;\n\n @State() requiredError: string = '';\n @State() patternError: string = '';\n\n /**\n * This event is fired when the current redirect URL changes and is valid.\n */\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n valueChanged?: (event: CustomEvent<{ value: string; name: string }>) => void;\n }>;\n\n /**\n * When a name prop is passed, stencil does not automatically set the name attribute on the host element.\n * Since this component is form-associated, the name attribute is required for form submission.\n * This is a workaround to ensure that the name attribute is set on the host element.\n */\n @Watch('name')\n elementNameChangedHandler(newValue: string) {\n debug('nylas-booking-confirmation-redirect', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('selectedConfiguration')\n selectedConfigurationChangedHandler(newValue: Configuration) {\n debug('nylas-booking-confirmation-redirect', 'selectedConfigurationChangedHandler', newValue);\n if (newValue?.scheduler?.confirmation_redirect_url) {\n this.currentRedirectUrl = newValue?.scheduler?.confirmation_redirect_url;\n this.acceptUrl = newValue?.scheduler?.confirmation_redirect_url !== '';\n }\n }\n\n @Watch('selectedLanguage')\n selectedLanguageChangedHandler(newVal: LANGUAGE_CODE, oldVal: LANGUAGE_CODE) {\n if (newVal === oldVal) return;\n i18next.changeLanguage(newVal);\n this.requiredError = i18next.t('fieldRequired', { field: i18next.t('redirectUrl') });\n this.patternError = i18next.t('invalidInputFormat', { field: i18next.t('redirectUrl') });\n }\n\n @Watch('themeConfig')\n themeConfigChangedHandler(newVal: ThemeConfig, oldVal: ThemeConfig) {\n if (newVal === oldVal) return;\n this.applyThemeConfig(newVal);\n }\n\n // Lifecycle methods\n connectedCallback() {\n debug('nylas-booking-confirmation-redirect', 'connectedCallback');\n }\n\n disconnectedCallback() {\n debug('nylas-booking-confirmation-redirect', 'disconnectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-booking-confirmation-redirect', 'componentWillLoad');\n // See comment in the @Watch('name') decorator for more information.\n this.host.setAttribute('name', this.name);\n }\n\n componentDidLoad() {\n debug('nylas-booking-confirmation-redirect', 'componentDidLoad');\n if (this.selectedConfiguration) {\n this.selectedConfigurationChangedHandler(this.selectedConfiguration);\n } else {\n this.currentRedirectUrl = this.redirectUrl;\n this.acceptUrl = this.redirectUrl !== '';\n }\n this.componentLoaded = true;\n if (typeof this.internals.setFormValue === 'function') {\n this.internals.setFormValue(this.currentRedirectUrl.toString(), this.name);\n }\n }\n\n componentWillUpdate() {\n debug('nylas-booking-confirmation-redirect', 'componentWillUpdate');\n }\n\n componentDidUpdate() {\n debug('nylas-booking-confirmation-redirect', 'componentDidUpdate');\n }\n\n componentWillRender() {\n debug('nylas-booking-confirmation-redirect', 'componentWillRender');\n }\n\n componentDidRender() {\n debug('nylas-booking-confirmation-redirect', 'componentDidRender');\n }\n\n @Listen('nylasFormDropdownChanged')\n nylasFormDropdownChangedHandler(event: CustomEvent<{ value: string; name: string }>) {\n debug('nylas-booking-confirmation-redirect', 'nylasFormDropdownChangedHandler', event.detail);\n\n const { name, value } = event.detail;\n\n if (name === 'confirmation-redirect-dropdown') {\n if (value === 'custom') {\n this.acceptUrl = true;\n } else {\n this.acceptUrl = false;\n\n // Submit empty string to clear redirect URL\n this.internals.setFormValue('', this.name);\n this.valueChanged.emit({ name: this.name, value: '' });\n }\n }\n }\n\n @Listen('nylasFormInputBlurred')\n nylasFormInputBlurHandler(event: CustomEvent<{ value: string; name: string }>) {\n const { name, value } = event.detail;\n this.currentRedirectUrl = value;\n\n if (this.acceptUrl && name === 'confirmation-redirect') {\n this.redirectUrlErrorMessage = '';\n\n if (!isValidUrl(this.currentRedirectUrl)) {\n this.internals.setValidity({ customError: true }, i18next.t('nylasBookingConfirmationRedirect.customRedirectUrlErrorMessage'));\n this.redirectUrlErrorMessage = i18next.t('nylasBookingConfirmationRedirect.customRedirectUrlErrorMessage');\n return;\n }\n this.internals.setValidity({});\n\n // Pass as handler so that if event.defaultPrevented by parent app, this will be skipped.\n const valueChanged = (event: CustomEvent<{ value: string; name: string }>) => {\n const { value } = event.detail;\n this.internals.setFormValue(value.toString(), this.name);\n };\n this.valueChanged.emit({ ...event.detail, valueChanged });\n }\n }\n\n @Listen('formSubmitted', { target: 'document' })\n formSubmittedHandler(_event: CustomEvent) {\n if (this.acceptUrl && !isValidUrl(this.currentRedirectUrl)) {\n this.internals.setValidity({ customError: true }, i18next.t('nylasBookingConfirmationRedirect.customRedirectUrlErrorMessage'));\n this.redirectUrlErrorMessage = i18next.t('nylasBookingConfirmationRedirect.customRedirectUrlErrorMessage');\n } else {\n this.internals.setValidity({});\n }\n }\n\n applyThemeConfig(themeConfig?: ThemeConfig) {\n if (themeConfig) {\n for (const [key, value] of Object.entries(themeConfig)) {\n this.host.style.setProperty(`${key}`, value);\n }\n }\n }\n\n @RegisterComponent<NylasBookingConfirmationRedirect, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-booking-confirmation-redirect',\n stateToProps: new Map([\n ['schedulerConfig.selectedConfiguration', 'selectedConfiguration'],\n ['schedulerConfig.selectedLanguage', 'selectedLanguage'],\n ['schedulerConfig.themeConfig', 'themeConfig'],\n ]),\n eventToProps: {\n valueChanged: async (\n event: CustomEvent<{ value: string; name: string; valueChanged?: (event: CustomEvent<{ value: string; name: string }>) => void }>,\n _nylasSchedulerConfigConnector: NylasSchedulerConfigConnector,\n ) => {\n const { valueChanged } = event.detail;\n // If a handler is passed, call it.\n if (valueChanged) {\n valueChanged(event);\n }\n },\n },\n fireRegisterEvent: true,\n })\n render() {\n const redirectOptions = [\n {\n label: i18next.t('nylasBookingConfirmationRedirect.redirectOption', { context: 'default' }),\n value: 'default',\n },\n {\n label: i18next.t('nylasBookingConfirmationRedirect.redirectOption', { context: 'custom' }),\n value: 'custom',\n },\n ];\n\n return (\n <Host>\n <div class=\"nylas-booking-confirmation-redirect\" part=\"nbcr\">\n {redirectOptions.length > 0 && (\n <div class=\"nylas-booking-confirmation-redirect__dropdown\">\n <span class=\"label\">\n {i18next.t('nylasBookingConfirmationRedirect.dropdownLabel')}\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">{i18next.t('nylasBookingConfirmationRedirect.tooltip.desc')}</span>\n </tooltip-component>\n </span>\n {this.componentLoaded && (\n <select-dropdown\n name=\"confirmation-redirect-dropdown\"\n options={redirectOptions}\n withSearch={false}\n defaultSelectedOption={redirectOptions.find(option => option.value === (this.acceptUrl ? 'custom' : 'default'))}\n exportparts=\"sd_dropdown: nbcr__dropdown, sd_dropdown-button: nbcr__dropdown-button, sd_dropdown-content: nbcr__dropdown-content\"\n themeConfig={this.themeConfig}\n />\n )}\n {this.acceptUrl && (\n <div>\n <input-component\n name=\"confirmation-redirect\"\n id=\"confirmation-redirect\"\n type=\"text\"\n placeholder={i18next.t('nylasBookingConfirmationRedirect.customRedirectUrlPlaceholder')}\n required={false}\n part=\"ic__input_wrapper: nbcr__input-textfield\"\n requiredError={this.requiredError}\n patternError={this.patternError}\n defaultValue={this.currentRedirectUrl}\n themeConfig={this.themeConfig}\n />\n {this.redirectUrlErrorMessage && <span class=\"error-message\">{this.redirectUrlErrorMessage}</span>}\n </div>\n )}\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -7,7 +7,7 @@ import { d as defineCustomElement$5 } from './p-CEoh34h7.js';
|
|
|
7
7
|
import { d as defineCustomElement$4 } from './p-ClTk9Ttz.js';
|
|
8
8
|
import { d as defineCustomElement$3 } from './p-D7lRYhTx.js';
|
|
9
9
|
import { d as defineCustomElement$2 } from './p-ZNBlPB7r.js';
|
|
10
|
-
import { d as defineCustomElement$1 } from './p-
|
|
10
|
+
import { d as defineCustomElement$1 } from './p-CelgQqJU.js';
|
|
11
11
|
|
|
12
12
|
const nylasLimitFutureBookingsCss = ":host{--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:\"Inter\", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.nylas-limit-future-bookings{display:flex;justify-content:space-between;font-family:var(--nylas-font-family)}@media screen and (max-width: 768px){.nylas-limit-future-bookings{flex-direction:column;gap:0.5rem}}.nylas-limit-future-bookings label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:16px;font-style:normal;font-weight:400;line-height:150%;}.nylas-limit-future-bookings label span.label-icon{margin-left:4px}.nylas-limit-future-bookings label span.label-icon tooltip-component{display:flex}select-dropdown::part(sd_dropdown-button){border:none}";
|
|
13
13
|
|
|
@@ -215,6 +215,6 @@ function defineCustomElement() {
|
|
|
215
215
|
}
|
|
216
216
|
|
|
217
217
|
export { NylasLimitFutureBookings as N, defineCustomElement as d };
|
|
218
|
-
//# sourceMappingURL=p-
|
|
218
|
+
//# sourceMappingURL=p-DlQNeDle.js.map
|
|
219
219
|
|
|
220
|
-
//# sourceMappingURL=p-
|
|
220
|
+
//# sourceMappingURL=p-DlQNeDle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-CSWehFEc.js","mappings":";;;;;;;;;;;AAAA,MAAM,2BAA2B,GAAG,kuFAAkuF;;;;;;;;;;;;;;;;MC2B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;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement","i18next"],"sources":["src/components/scheduler-editor/nylas-limit-future-bookings/nylas-limit-future-bookings.scss?tag=nylas-limit-future-bookings&encapsulation=shadow","src/components/scheduler-editor/nylas-limit-future-bookings/nylas-limit-future-bookings.tsx"],"sourcesContent":["@use '../../../common/styles/variables' as *;\n\n:host {\n @include default-css-variables;\n}\n\n.nylas-limit-future-bookings {\n display: flex;\n justify-content: space-between;\n font-family: var(--nylas-font-family);\n @media #{$mobile} {\n flex-direction: column;\n gap: 0.5rem;\n }\n label {\n display: flex;\n align-items: center;\n color: var(--nylas-base-800);\n font-size: 16px;\n font-style: normal;\n font-weight: 400;\n line-height: 150%; /* 21px */\n span.label-icon {\n margin-left: 4px;\n tooltip-component {\n display: flex;\n }\n }\n }\n}\n\nselect-dropdown::part(sd_dropdown-button) {\n border: none;\n}\n","import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug } from '@/utils/utils';\nimport { AttachInternals, Component, Host, State, h, Element, Prop, Watch, Event, EventEmitter, Listen } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { Configuration } from '@nylas/core';\nimport i18next from '@/utils/i18n';\nimport { LANGUAGE_CODE } from '@/common/constants';\nimport { ThemeConfig } from '@nylas/core';\n\n/**\n * The `nylas-limit-future-bookings` component is a form input for the number of days in the future a guest is allowed to book an event.\n *\n * @part nlfb - The limit future bookings container\n * @part nlfb__number-dropdown - The number dropdown container\n * @part nlfb__number-dropdown-button - The number dropdown button\n * @part nlfb__number-dropdown-content - The number dropdown content\n * @part nlfb__period-dropdown - The period dropdown container\n * @part nlfb__period-dropdown-button - The period dropdown button\n * @part nlfb__period-dropdown-content - The period dropdown content\n */\n@Component({\n tag: 'nylas-limit-future-bookings',\n styleUrl: 'nylas-limit-future-bookings.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasLimitFutureBookings {\n /**\n * The host element <nylas-limit-future-bookings>\n */\n @Element() host!: HTMLElement;\n /**\n * @standalone\n * The selected config\n */\n @Prop() selectedConfiguration?: Configuration;\n /**\n * @standalone\n * The number of days into the future that invitees will see availability, as set in the configuration.\n */\n @Prop() availableDaysInFuture?: number;\n /**\n * @standalone\n * The name of the limit future bookings input.\n */\n @Prop() name: string = 'limit-future-bookings';\n /**\n * The selected language.\n */\n @Prop() selectedLanguage?: LANGUAGE_CODE;\n /**\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: ThemeConfig;\n /**\n * The selected number for the available days in the future.\n */\n @State() selectedNumber;\n /**\n * The selected period for the available days in the future.\n */\n @State() selectedPeriod;\n\n /**\n * The element internals.\n */\n @AttachInternals() internals!: ElementInternals;\n\n /**\n * When a name prop is passed, stencil does not automatically set the name attribute on the host element.\n * Since this component is form-associated, the name attribute is required for form submission.\n * This is a workaround to ensure that the name attribute is set on the host element.\n */\n @Watch('name')\n elementNameChangedHandler(newValue: string) {\n debug('nylas-limit-future-bookings', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('selectedConfiguration')\n selectedConfigurationChangedHandler(newVal: Configuration) {\n const daysInFuture = newVal?.scheduler?.available_days_in_future || this.availableDaysInFuture || 1;\n if (daysInFuture) {\n this.updateNumberAndPeriodFromDays(daysInFuture);\n }\n if (typeof this.internals.setFormValue !== 'function') {\n return;\n }\n this.internals.setFormValue(daysInFuture?.toString(), this.name);\n }\n\n @Watch('selectedLanguage')\n selectedLanguageChangedHandler(newVal: LANGUAGE_CODE, oldVal: LANGUAGE_CODE) {\n if (newVal === oldVal) return;\n i18next.changeLanguage(newVal);\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.host.style.setProperty(`${key}`, value);\n }\n }\n }\n\n /**\n * Event emitted when the future booking limit changes.\n */\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n }>;\n\n connectedCallback() {\n debug('nylas-limit-future-bookings', 'connectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-limit-future-bookings', 'componentWillLoad');\n this.host.setAttribute('name', this.name);\n }\n\n componentDidLoad() {\n debug('nylas-limit-future-bookings', 'componentDidLoad');\n if (this.selectedConfiguration) {\n this.selectedConfigurationChangedHandler(this.selectedConfiguration);\n } else {\n this.updateNumberAndPeriodFromDays(this.availableDaysInFuture || 1);\n }\n }\n\n disconnectedCallback() {\n debug('nylas-limit-future-bookings', 'disconnectedCallback');\n }\n\n @Listen('timePeriodChanged')\n timePeriodChangedHandler(\n event: CustomEvent<{\n number: number;\n period: string;\n }>,\n ) {\n const { number, period } = event.detail;\n let availableDaysInFuture;\n if (period === 'day') {\n availableDaysInFuture = number;\n } else if (period === 'week') {\n availableDaysInFuture = number * 7;\n } else {\n availableDaysInFuture = number * 30;\n }\n this.valueChanged.emit({ value: availableDaysInFuture, name: this.name });\n if (typeof this.internals.setFormValue !== 'function') {\n return;\n }\n this.internals.setFormValue(availableDaysInFuture.toString(), this.name);\n }\n\n updateNumberAndPeriodFromDays(days: number): void {\n let number, period;\n if (days >= 30 && days % 30 === 0) {\n number = days / 30;\n period = 'month';\n } else if (days >= 7 && days % 7 === 0) {\n number = days / 7;\n period = 'week';\n } else {\n number = days;\n period = 'day';\n }\n this.selectedNumber = number;\n this.selectedPeriod = period;\n }\n\n @RegisterComponent<NylasLimitFutureBookings, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-limit-future-bookings',\n stateToProps: new Map([\n ['schedulerConfig.selectedConfiguration', 'selectedConfiguration'],\n ['schedulerConfig.selectedLanguage', 'selectedLanguage'],\n ['schedulerConfig.themeConfig', 'themeConfig'],\n ]),\n eventToProps: {},\n fireRegisterEvent: true,\n })\n render() {\n const showTImePeriodSelector = typeof this.selectedNumber == 'number' && typeof this.selectedPeriod == 'string';\n return (\n <Host>\n <div class=\"nylas-limit-future-bookings\" part=\"nlfb\">\n <label>\n {i18next.t('nylasLimitFutureBookings.headerTitle')}\n <span class=\"label-icon\">\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">{i18next.t('nylasLimitFutureBookings.tooltip.desc')}</span>\n </tooltip-component>\n </span>\n </label>\n {showTImePeriodSelector && (\n <time-period-selector\n id=\"limit-future-bookings\"\n timePeriods={[\n { value: 'day', label: i18next.t('timePeriod', { context: 'day' }) },\n { value: 'week', label: i18next.t('timePeriod', { context: 'week' }) },\n { value: 'month', label: i18next.t('timePeriod', { context: 'month' }) },\n ]}\n exportparts=\"tps__number-dropdown: nlfb__number-dropdown, tps__number-dropdown-button: nlfb__number-dropdown-button, tps__number-dropdown-content: nlfb__number-dropdown-content, tps__period-dropdown: nlfb__period-dropdown, tps__period-dropdown-button: nlfb__period-dropdown-button, tps__period-dropdown-content: nlfb__period-dropdown-content\"\n defaultSelectedNumber={this.selectedNumber}\n defaultSelectedPeriod={this.selectedPeriod}\n themeConfig={this.themeConfig}\n />\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"p-DlQNeDle.js","mappings":";;;;;;;;;;;AAAA,MAAM,2BAA2B,GAAG,kuFAAkuF;;;;;;;;;;;;;;;;MC2BzvF,wBAAwB,GAAAA,kBAAA,CAAA,MAAA,wBAAA,SAAAC,CAAA,CAAA;AANrC,IAAA,WAAA,GAAA;;;;;;AAyBU,QAAA,IAAI,CAAA,IAAA,GAAW,uBAAuB;AAiL/C;AApJC,IAAA,yBAAyB,CAAC,QAAgB,EAAA;AACxC,QAAA,KAAK,CAAC,6BAA6B,EAAE,2BAA2B,EAAE,QAAQ,CAAC;QAC3E,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM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CAAC,EAAE;AACpE,gBAAA,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAEA,QAAO,CAAC,CAAC,CAAC,YAAY,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE;AACtE,gBAAA,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAEA,QAAO,CAAC,CAAC,CAAC,YAAY,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE;aACzE,EACD,WAAW,EAAC,0UAA0U,EACtV,qBAAqB,EAAE,IAAI,CAAC,cAAc,EAC1C,qBAAqB,EAAE,IAAI,CAAC,cAAc,EAC1C,WAAW,EAAE,IAAI,CAAC,WAAW,EAAA,CAC7B,CACH,CACG,CACD;;;;;;;;;;;;;;;;;;;;;;;;;AA7BX,UAAA,CAAA;AAVC,IAAA,iBAAiB,CAA8G;AAC9H,QAAA,IAAI,EAAE,6BAA6B;QACnC,YAAY,EAAE,IAAI,GAAG,CAAC;YACpB,CAAC,uCAAuC,EAAE,uBAAuB,CAAC;YAClE,CAAC,kCAAkC,EAAE,kBAAkB,CAAC;YACxD,CAAC,6BAA6B,EAAE,aAAa,CAAC;SAC/C,CAAC;AACF,QAAA,YAAY,EAAE,EAAE;AAChB,QAAA,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;CAgCD,EAAA,wBAAA,CAAA,SAAA,EAAA,QAAA,EAAA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement","i18next"],"sources":["src/components/scheduler-editor/nylas-limit-future-bookings/nylas-limit-future-bookings.scss?tag=nylas-limit-future-bookings&encapsulation=shadow","src/components/scheduler-editor/nylas-limit-future-bookings/nylas-limit-future-bookings.tsx"],"sourcesContent":["@use '../../../common/styles/variables' as *;\n\n:host {\n @include default-css-variables;\n}\n\n.nylas-limit-future-bookings {\n display: flex;\n justify-content: space-between;\n font-family: var(--nylas-font-family);\n @media #{$mobile} {\n flex-direction: column;\n gap: 0.5rem;\n }\n label {\n display: flex;\n align-items: center;\n color: var(--nylas-base-800);\n font-size: 16px;\n font-style: normal;\n font-weight: 400;\n line-height: 150%; /* 21px */\n span.label-icon {\n margin-left: 4px;\n tooltip-component {\n display: flex;\n }\n }\n }\n}\n\nselect-dropdown::part(sd_dropdown-button) {\n border: none;\n}\n","import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug } from '@/utils/utils';\nimport { AttachInternals, Component, Host, State, h, Element, Prop, Watch, Event, EventEmitter, Listen } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { Configuration } from '@nylas/core';\nimport i18next from '@/utils/i18n';\nimport { LANGUAGE_CODE } from '@/common/constants';\nimport { ThemeConfig } from '@nylas/core';\n\n/**\n * The `nylas-limit-future-bookings` component is a form input for the number of days in the future a guest is allowed to book an event.\n *\n * @part nlfb - The limit future bookings container\n * @part nlfb__number-dropdown - The number dropdown container\n * @part nlfb__number-dropdown-button - The number dropdown button\n * @part nlfb__number-dropdown-content - The number dropdown content\n * @part nlfb__period-dropdown - The period dropdown container\n * @part nlfb__period-dropdown-button - The period dropdown button\n * @part nlfb__period-dropdown-content - The period dropdown content\n */\n@Component({\n tag: 'nylas-limit-future-bookings',\n styleUrl: 'nylas-limit-future-bookings.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasLimitFutureBookings {\n /**\n * The host element <nylas-limit-future-bookings>\n */\n @Element() host!: HTMLElement;\n /**\n * @standalone\n * The selected config\n */\n @Prop() selectedConfiguration?: Configuration;\n /**\n * @standalone\n * The number of days into the future that invitees will see availability, as set in the configuration.\n */\n @Prop() availableDaysInFuture?: number;\n /**\n * @standalone\n * The name of the limit future bookings input.\n */\n @Prop() name: string = 'limit-future-bookings';\n /**\n * The selected language.\n */\n @Prop() selectedLanguage?: LANGUAGE_CODE;\n /**\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: ThemeConfig;\n /**\n * The selected number for the available days in the future.\n */\n @State() selectedNumber;\n /**\n * The selected period for the available days in the future.\n */\n @State() selectedPeriod;\n\n /**\n * The element internals.\n */\n @AttachInternals() internals!: ElementInternals;\n\n /**\n * When a name prop is passed, stencil does not automatically set the name attribute on the host element.\n * Since this component is form-associated, the name attribute is required for form submission.\n * This is a workaround to ensure that the name attribute is set on the host element.\n */\n @Watch('name')\n elementNameChangedHandler(newValue: string) {\n debug('nylas-limit-future-bookings', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('selectedConfiguration')\n selectedConfigurationChangedHandler(newVal: Configuration) {\n const daysInFuture = newVal?.scheduler?.available_days_in_future || this.availableDaysInFuture || 1;\n if (daysInFuture) {\n this.updateNumberAndPeriodFromDays(daysInFuture);\n }\n if (typeof this.internals.setFormValue !== 'function') {\n return;\n }\n this.internals.setFormValue(daysInFuture?.toString(), this.name);\n }\n\n @Watch('selectedLanguage')\n selectedLanguageChangedHandler(newVal: LANGUAGE_CODE, oldVal: LANGUAGE_CODE) {\n if (newVal === oldVal) return;\n i18next.changeLanguage(newVal);\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.host.style.setProperty(`${key}`, value);\n }\n }\n }\n\n /**\n * Event emitted when the future booking limit changes.\n */\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n }>;\n\n connectedCallback() {\n debug('nylas-limit-future-bookings', 'connectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-limit-future-bookings', 'componentWillLoad');\n this.host.setAttribute('name', this.name);\n }\n\n componentDidLoad() {\n debug('nylas-limit-future-bookings', 'componentDidLoad');\n if (this.selectedConfiguration) {\n this.selectedConfigurationChangedHandler(this.selectedConfiguration);\n } else {\n this.updateNumberAndPeriodFromDays(this.availableDaysInFuture || 1);\n }\n }\n\n disconnectedCallback() {\n debug('nylas-limit-future-bookings', 'disconnectedCallback');\n }\n\n @Listen('timePeriodChanged')\n timePeriodChangedHandler(\n event: CustomEvent<{\n number: number;\n period: string;\n }>,\n ) {\n const { number, period } = event.detail;\n let availableDaysInFuture;\n if (period === 'day') {\n availableDaysInFuture = number;\n } else if (period === 'week') {\n availableDaysInFuture = number * 7;\n } else {\n availableDaysInFuture = number * 30;\n }\n this.valueChanged.emit({ value: availableDaysInFuture, name: this.name });\n if (typeof this.internals.setFormValue !== 'function') {\n return;\n }\n this.internals.setFormValue(availableDaysInFuture.toString(), this.name);\n }\n\n updateNumberAndPeriodFromDays(days: number): void {\n let number, period;\n if (days >= 30 && days % 30 === 0) {\n number = days / 30;\n period = 'month';\n } else if (days >= 7 && days % 7 === 0) {\n number = days / 7;\n period = 'week';\n } else {\n number = days;\n period = 'day';\n }\n this.selectedNumber = number;\n this.selectedPeriod = period;\n }\n\n @RegisterComponent<NylasLimitFutureBookings, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-limit-future-bookings',\n stateToProps: new Map([\n ['schedulerConfig.selectedConfiguration', 'selectedConfiguration'],\n ['schedulerConfig.selectedLanguage', 'selectedLanguage'],\n ['schedulerConfig.themeConfig', 'themeConfig'],\n ]),\n eventToProps: {},\n fireRegisterEvent: true,\n })\n render() {\n const showTImePeriodSelector = typeof this.selectedNumber == 'number' && typeof this.selectedPeriod == 'string';\n return (\n <Host>\n <div class=\"nylas-limit-future-bookings\" part=\"nlfb\">\n <label>\n {i18next.t('nylasLimitFutureBookings.headerTitle')}\n <span class=\"label-icon\">\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">{i18next.t('nylasLimitFutureBookings.tooltip.desc')}</span>\n </tooltip-component>\n </span>\n </label>\n {showTImePeriodSelector && (\n <time-period-selector\n id=\"limit-future-bookings\"\n timePeriods={[\n { value: 'day', label: i18next.t('timePeriod', { context: 'day' }) },\n { value: 'week', label: i18next.t('timePeriod', { context: 'week' }) },\n { value: 'month', label: i18next.t('timePeriod', { context: 'month' }) },\n ]}\n exportparts=\"tps__number-dropdown: nlfb__number-dropdown, tps__number-dropdown-button: nlfb__number-dropdown-button, tps__number-dropdown-content: nlfb__number-dropdown-content, tps__period-dropdown: nlfb__period-dropdown, tps__period-dropdown-button: nlfb__period-dropdown-button, tps__period-dropdown-content: nlfb__period-dropdown-content\"\n defaultSelectedNumber={this.selectedNumber}\n defaultSelectedPeriod={this.selectedPeriod}\n themeConfig={this.themeConfig}\n />\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -6,7 +6,7 @@ import { d as defineCustomElement$5 } from './p-7S1M5IE9.js';
|
|
|
6
6
|
import { d as defineCustomElement$4 } from './p-Dl0kJKrG.js';
|
|
7
7
|
import { d as defineCustomElement$3 } from './p-ClTk9Ttz.js';
|
|
8
8
|
import { d as defineCustomElement$2 } from './p-D7lRYhTx.js';
|
|
9
|
-
import { d as defineCustomElement$1 } from './p-
|
|
9
|
+
import { d as defineCustomElement$1 } from './p-CelgQqJU.js';
|
|
10
10
|
|
|
11
11
|
const nylasTimeslotIntervalCss = ":host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:\"Inter\", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;width:inherit}.nylas-timeslot-interval{width:inherit;display:flex;flex-direction:column;margin:1rem;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-200)}.nylas-timeslot-interval .header{padding:1rem;border-bottom:1px solid var(--nylas-base-200)}.nylas-timeslot-interval .header h3{margin:0;font-size:16px;font-weight:600;line-height:20px;color:var(--nylas-base-900);text-align:left}.nylas-timeslot-interval .header p{margin:0.25rem 0 0 0;font-size:0.875rem;font-weight:400;line-height:20px;color:var(--nylas-base-600);text-align:left}.nylas-timeslot-interval .nylas-timeslot-interval__dropdown{padding:1rem;display:flex;flex-direction:column;gap:4px;background-color:var(--nylas-base-25)}.nylas-timeslot-interval .nylas-timeslot-interval__dropdown span.label{display:flex;align-items:center;gap:4px;color:var(--nylas-base-800)}.nylas-timeslot-interval .nylas-timeslot-interval__dropdown span.label tooltip-component{display:flex}.nylas-timeslot-interval .nylas-timeslot-interval__dropdown select-dropdown{margin-bottom:1.5rem}.nylas-timeslot-interval .nylas-timeslot-interval__dropdown select-dropdown::part(sd_dropdown){width:100%}.nylas-timeslot-interval .nylas-timeslot-interval__dropdown select-dropdown::part(sd_dropdown-content){width:100%;max-width:unset}.nylas-timeslot-interval .nylas-timeslot-interval__dropdown select-dropdown::part(sd_dropdown-button){width:100%;display:flex;justify-content:space-between;align-items:center;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);padding:1rem}.nylas-timeslot-interval .nylas-timeslot-interval__dropdown select-dropdown::part(sd_dropdown-button-selected-label){max-width:calc(100% - 2rem);font-family:var(--nylas-font-family);font-size:16px;line-height:24px}";
|
|
12
12
|
|
|
@@ -254,6 +254,6 @@ function defineCustomElement() {
|
|
|
254
254
|
}
|
|
255
255
|
|
|
256
256
|
export { NylasTimeslotInterval as N, defineCustomElement as d };
|
|
257
|
-
//# sourceMappingURL=p-
|
|
257
|
+
//# sourceMappingURL=p-DosSBspi.js.map
|
|
258
258
|
|
|
259
|
-
//# sourceMappingURL=p-
|
|
259
|
+
//# sourceMappingURL=p-DosSBspi.js.map
|