@nylas/web-elements 2.3.0-canary-20251209175526 → 2.3.1-canary-20260108142854

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/cdn/nylas-scheduler-editor/nylas-scheduler-editor.es.js +1 -1
  2. package/dist/cdn/nylas-scheduling/nylas-scheduling.es.js +438 -429
  3. package/dist/cjs/google-logo-icon_6.cjs.entry.js +1 -1
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/nylas-booked-event-card_11.cjs.entry.js +8 -0
  6. package/dist/cjs/nylas-booked-event-card_11.cjs.entry.js.map +1 -1
  7. package/dist/cjs/nylas-scheduler-editor.cjs.entry.js +1 -1
  8. package/dist/cjs/nylas-scheduling.cjs.entry.js +1 -1
  9. package/dist/cjs/nylas-web-elements.cjs.js +1 -1
  10. package/dist/cjs/{version-D_4EnJgV.js → version-D5oikJAU.js} +3 -3
  11. package/dist/cjs/{version-D_4EnJgV.js.map → version-D5oikJAU.js.map} +1 -1
  12. package/dist/collection/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.js +10 -0
  13. package/dist/collection/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.js.map +1 -1
  14. package/dist/collection/version.js +1 -1
  15. package/dist/collection/version.js.map +1 -1
  16. package/dist/components/nylas-editor-tabs-group.js +1 -1
  17. package/dist/components/nylas-editor-tabs.js +1 -1
  18. package/dist/components/nylas-scheduler-editor.js +3 -3
  19. package/dist/components/nylas-scheduling.js +2 -2
  20. package/dist/components/nylas-timeslot-picker.js +1 -1
  21. package/dist/components/{p-CA4KcUhc.js → p-B690XnX4.js} +3 -3
  22. package/dist/components/{p-CA4KcUhc.js.map → p-B690XnX4.js.map} +1 -1
  23. package/dist/components/{p-hfBT257C.js → p-BJIZGV9U.js} +3 -3
  24. package/dist/components/{p-hfBT257C.js.map → p-BJIZGV9U.js.map} +1 -1
  25. package/dist/components/{p-ne-_OsQh.js → p-D_fU0kvl.js} +11 -2
  26. package/dist/components/p-D_fU0kvl.js.map +1 -0
  27. package/dist/components/{p-ZwBvJqr6.js → p-o1X1utox.js} +3 -3
  28. package/dist/components/{p-ZwBvJqr6.js.map → p-o1X1utox.js.map} +1 -1
  29. package/dist/esm/google-logo-icon_6.entry.js +1 -1
  30. package/dist/esm/loader.js +1 -1
  31. package/dist/esm/nylas-booked-event-card_11.entry.js +8 -0
  32. package/dist/esm/nylas-booked-event-card_11.entry.js.map +1 -1
  33. package/dist/esm/nylas-scheduler-editor.entry.js +1 -1
  34. package/dist/esm/nylas-scheduling.entry.js +1 -1
  35. package/dist/esm/nylas-web-elements.js +1 -1
  36. package/dist/esm/{version-yv4SSiN0.js → version-CdAV0HaJ.js} +3 -3
  37. package/dist/esm/{version-yv4SSiN0.js.map → version-CdAV0HaJ.js.map} +1 -1
  38. package/dist/nylas-web-elements/nylas-web-elements.esm.js +1 -1
  39. package/dist/nylas-web-elements/{p-ee5119c1.entry.js → p-51a60db6.entry.js} +2 -2
  40. package/dist/nylas-web-elements/{p-5ae85f94.entry.js → p-544c4297.entry.js} +2 -2
  41. package/dist/nylas-web-elements/p-544c4297.entry.js.map +1 -0
  42. package/dist/nylas-web-elements/{p-9415d294.entry.js → p-92c0b1ae.entry.js} +2 -2
  43. package/dist/nylas-web-elements/{p-yv4SSiN0.js → p-CdAV0HaJ.js} +2 -2
  44. package/dist/nylas-web-elements/{p-yv4SSiN0.js.map → p-CdAV0HaJ.js.map} +1 -1
  45. package/dist/nylas-web-elements/{p-ff89f781.entry.js → p-fbd050a2.entry.js} +2 -2
  46. package/dist/stencil.config.js +1 -0
  47. package/dist/stencil.config.js.map +1 -1
  48. package/dist/types/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.d.ts +1 -0
  49. package/dist/types/version.d.ts +1 -1
  50. package/package.json +2 -2
  51. package/dist/components/p-ne-_OsQh.js.map +0 -1
  52. package/dist/nylas-web-elements/p-5ae85f94.entry.js.map +0 -1
  53. /package/dist/nylas-web-elements/{p-ee5119c1.entry.js.map → p-51a60db6.entry.js.map} +0 -0
  54. /package/dist/nylas-web-elements/{p-9415d294.entry.js.map → p-92c0b1ae.entry.js.map} +0 -0
  55. /package/dist/nylas-web-elements/{p-ff89f781.entry.js.map → p-fbd050a2.entry.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"stencil.config.js","sourceRoot":"","sources":["../stencil.config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAQrC,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,oBAAoB,EAAE,YAAY,EAAE,mBAAmB,EAAE,gBAAgB,CAAC,CAAC;AAElI,MAAM,MAAM,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;AACrC,MAAM,IAAI,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;AAErD,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC;AAC1C,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC;AAE3C,MAAM,aAAa,GAAmB;IACpC;QACE,IAAI,EAAE,MAAM;QACZ,GAAG;QACH,aAAa,EAAE,WAAW;QAC1B,4BAA4B,EAAE,IAAI;QAClC,uCAAuC,EAAE,IAAI;KAC9C;IACD;QACE,IAAI,EAAE,sBAAsB;QAC5B,GAAG,EAAE,GAAG,GAAG,aAAa;QACxB,wBAAwB,EAAE,IAAI;QAC9B,eAAe,EAAE,KAAK;QACtB,IAAI,EAAE;YACJ;gBACE,GAAG,EAAE,oBAAoB;gBACzB,IAAI,EAAE,GAAG,GAAG,oBAA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EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;SACnD;QACD,eAAe,EAAE,OAAO;QACxB,SAAS,EAAE;YACT,4BAA4B,EAAE,yCAAyC;SACxE;QACD,uBAAuB,EAAE,CAAC,+BAA+B,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC;QAClF,gBAAgB,EAAE;YAChB,gBAAgB,EAAE,wBAAwB;SAC3C;QACD,WAAW,EAAE,gCAAgC;QAC7C,kBAAkB,EAAE,CAAC,yBAAyB,CAAC;QAE/C,GAAG,CAAC,IAAI,IAAI;YACV,MAAM,EAAE,IAAI;YACZ,OAAO,EAAE,KAAK;SACf,CAAC;KACH;IACD,YAAY,EAAE,sBAAsB;IACpC,QAAQ,EAAE,KAAK;IACf,QAAQ,EAAE,IAAI;IACd,SAAS,EAAE,IAAI;CAChB,CAAC","sourcesContent":["import { Config } from '@stencil/core';\nimport { reactOutputTarget } from '@stencil/react-output-target';\nimport { sass } from '@stencil/sass';\nimport { OutputTarget } from '@stencil/core/internal';\n\n/**\n * This is a list of modules that are not transpiled by Babel.\n * We need to add them here so that Jest can transpile them.\n * See: https://stackoverflow.com/questions/68310447/how-to-tune-typescript-stenciljs-with-jest-to-support-es6-dynamic-module-imports\n */\nconst esmModules = ['d3-*', 'internmap', 'node-fetch', 'data-uri-to-buffer', 'fetch-blob', 'formdata-polyfill', 'fake-indexeddb'];\n\nconst isTest = !!process.env.IS_TEST;\nconst isCI = !!process.env.IS_CI || !!process.env.CI;\n\nconst dir = isTest ? 'dist-test' : 'dist';\nconst wwwDir = isTest ? 'www-test' : 'www';\n\nconst outputTargets: OutputTarget[] = [\n {\n type: 'dist',\n dir,\n esmLoaderPath: '../loader',\n isPrimaryPackageOutputTarget: true,\n transformAliasedImportPathsInCollection: true,\n },\n {\n type: 'dist-custom-elements',\n dir: `${dir}/components`,\n generateTypeDeclarations: true,\n externalRuntime: false,\n copy: [\n {\n src: '**/*.{jpg,png,svg}',\n dest: `${dir}/components/assets`,\n warn: true,\n },\n ],\n },\n {\n type: 'docs-readme',\n },\n {\n type: 'docs-json',\n file: 'components-docs.json',\n supplementalPublicTypes: 'src/types/index.ts',\n },\n {\n type: 'docs-vscode',\n file: 'vscode-data.json',\n },\n {\n type: 'www',\n dir: wwwDir,\n serviceWorker: null, // disable service workers\n copy: [{ src: 'pages' }, { src: '**/test/*.html' }, { src: '**/test/*.css' }],\n prerenderConfig: './prerender.config.ts',\n },\n];\n\nif (!isTest) {\n outputTargets.push(\n reactOutputTarget({\n outDir: '../../../javascript/packages/react/src/elements',\n }),\n );\n}\n\nexport const config: Config = {\n namespace: 'nylas-web-elements',\n globalStyle: 'src/common/nylas-theme/index.css',\n taskQueue: 'async',\n sourceMap: true,\n devServer: {\n openBrowser: false,\n },\n transformAliasedImportPaths: true,\n extras: {\n enableImportInjection: true,\n },\n plugins: [\n sass({\n includePaths: ['./node_modules/'],\n }),\n ],\n rollupPlugins: {\n before: [],\n after: [],\n },\n outputTargets,\n validatePrimaryPackageOutputTarget: true,\n testing: {\n /**\n * Gitlab CI doesn't allow sandbox, therefor this parameters must be passed to your Headless Chrome\n * before it can run your tests\n */\n browserArgs: [\n '--no-sandbox',\n '--disable-setuid-sandbox',\n '--disable-dev-shm-usage',\n '--disable-gpu',\n '--window-size=1920,1080',\n ...(isCI ? ['--silent', '--disable-logging'] : []),\n ],\n browserHeadless: 'shell',\n transform: {\n '^.+\\\\.(ts|tsx|js|jsx|css)$': '@stencil/core/testing/jest-preprocessor',\n },\n transformIgnorePatterns: [`node_modules/(?!(?:.pnpm/)?(${esmModules.join('|')}))`],\n moduleNameMapper: {\n '^@/utils/(.*)$': '<rootDir>/src/utils/$1',\n },\n globalSetup: '<rootDir>/jest.global-setup.ts',\n setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],\n // Suppress console logs in CI/CD environment\n ...(isCI && {\n silent: true,\n verbose: false,\n }),\n },\n globalScript: 'src/common/global.ts',\n buildEs5: false,\n minifyJs: true,\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,CAAC,IAAI,CAAC;QAClF,gBAAgB,EAAE;YAChB,gBAAgB,EAAE,wBAAwB;YAC1C,aAAa,EAAE,uBAAuB;SACvC;QACD,WAAW,EAAE,gCAAgC;QAC7C,kBAAkB,EAAE,CAAC,yBAAyB,CAAC;QAE/C,GAAG,CAAC,IAAI,IAAI;YACV,MAAM,EAAE,IAAI;YACZ,OAAO,EAAE,KAAK;SACf,CAAC;KACH;IACD,YAAY,EAAE,sBAAsB;IACpC,QAAQ,EAAE,KAAK;IACf,QAAQ,EAAE,IAAI;IACd,SAAS,EAAE,IAAI;CAChB,CAAC","sourcesContent":["import { Config } from '@stencil/core';\nimport { reactOutputTarget } from '@stencil/react-output-target';\nimport { sass } from '@stencil/sass';\nimport { OutputTarget } from '@stencil/core/internal';\n\n/**\n * This is a list of modules that are not transpiled by Babel.\n * We need to add them here so that Jest can transpile them.\n * See: https://stackoverflow.com/questions/68310447/how-to-tune-typescript-stenciljs-with-jest-to-support-es6-dynamic-module-imports\n */\nconst esmModules = ['d3-*', 'internmap', 'node-fetch', 'data-uri-to-buffer', 'fetch-blob', 'formdata-polyfill', 'fake-indexeddb'];\n\nconst isTest = !!process.env.IS_TEST;\nconst isCI = !!process.env.IS_CI || !!process.env.CI;\n\nconst dir = isTest ? 'dist-test' : 'dist';\nconst wwwDir = isTest ? 'www-test' : 'www';\n\nconst outputTargets: OutputTarget[] = [\n {\n type: 'dist',\n dir,\n esmLoaderPath: '../loader',\n isPrimaryPackageOutputTarget: true,\n transformAliasedImportPathsInCollection: true,\n },\n {\n type: 'dist-custom-elements',\n dir: `${dir}/components`,\n generateTypeDeclarations: true,\n externalRuntime: false,\n copy: [\n {\n src: '**/*.{jpg,png,svg}',\n dest: `${dir}/components/assets`,\n warn: true,\n },\n ],\n },\n {\n type: 'docs-readme',\n },\n {\n type: 'docs-json',\n file: 'components-docs.json',\n supplementalPublicTypes: 'src/types/index.ts',\n },\n {\n type: 'docs-vscode',\n file: 'vscode-data.json',\n },\n {\n type: 'www',\n dir: wwwDir,\n serviceWorker: null, // disable service workers\n copy: [{ src: 'pages' }, { src: '**/test/*.html' }, { src: '**/test/*.css' }],\n prerenderConfig: './prerender.config.ts',\n },\n];\n\nif (!isTest) {\n outputTargets.push(\n reactOutputTarget({\n outDir: '../../../javascript/packages/react/src/elements',\n }),\n );\n}\n\nexport const config: Config = {\n namespace: 'nylas-web-elements',\n globalStyle: 'src/common/nylas-theme/index.css',\n taskQueue: 'async',\n sourceMap: true,\n devServer: {\n openBrowser: false,\n },\n transformAliasedImportPaths: true,\n extras: {\n enableImportInjection: true,\n },\n plugins: [\n sass({\n includePaths: ['./node_modules/'],\n }),\n ],\n rollupPlugins: {\n before: [],\n after: [],\n },\n outputTargets,\n validatePrimaryPackageOutputTarget: true,\n testing: {\n /**\n * Gitlab CI doesn't allow sandbox, therefor this parameters must be passed to your Headless Chrome\n * before it can run your tests\n */\n browserArgs: [\n '--no-sandbox',\n '--disable-setuid-sandbox',\n '--disable-dev-shm-usage',\n '--disable-gpu',\n '--window-size=1920,1080',\n ...(isCI ? ['--silent', '--disable-logging'] : []),\n ],\n browserHeadless: 'shell',\n transform: {\n '^.+\\\\.(ts|tsx|js|jsx|css)$': '@stencil/core/testing/jest-preprocessor',\n },\n transformIgnorePatterns: [`node_modules/(?!(?:.pnpm/)?(${esmModules.join('|')}))`],\n moduleNameMapper: {\n '^@/utils/(.*)$': '<rootDir>/src/utils/$1',\n '^@/version$': '<rootDir>/src/version',\n },\n globalSetup: '<rootDir>/jest.global-setup.ts',\n setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],\n // Suppress console logs in CI/CD environment\n ...(isCI && {\n silent: true,\n verbose: false,\n }),\n },\n globalScript: 'src/common/global.ts',\n buildEs5: false,\n minifyJs: true,\n minifyCss: true,\n};\n"]}
@@ -27,6 +27,7 @@ export declare class NylasTimeslotPicker {
27
27
  selectedLanguageChanged(newLanguage: LANGUAGE_CODE): void;
28
28
  selectedDateChanged(newVal: Date | null | undefined): void;
29
29
  availabilityChanged(newVal: AvailabilityTimeslot[] | undefined): void;
30
+ selectedTimezoneChanged(newTimezone: string): void;
30
31
  themeConfigChanged(newThemeConfig: ThemeConfig): void;
31
32
  connectedCallback(): void;
32
33
  disconnectedCallback(): void;
@@ -1 +1 @@
1
- export declare const version = "2.3.0-canary-20251209175526";
1
+ export declare const version = "2.3.1-canary-20260108142854";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nylas/web-elements",
3
- "version": "2.3.0-canary-20251209175526",
3
+ "version": "2.3.1-canary-20260108142854",
4
4
  "description": "Nylas Web Elements",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -56,7 +56,7 @@
56
56
  "rrule": "2.8.1",
57
57
  "sanitize-html": "^2.13.0",
58
58
  "sortablejs": "^1.15.6",
59
- "@nylas/core": "^1.3.0-canary-20251209175526",
59
+ "@nylas/core": "^1.3.0",
60
60
  "@nylas/identity": "^3.1.0"
61
61
  },
62
62
  "devDependencies": {
@@ -1 +0,0 @@
1
- {"file":"p-ne-_OsQh.js","mappings":";;;;;;;AAAA,MAAM,sBAAsB,GAAG,y5HAAy5H;;;;;;;;;;;;;;;;MC0B36H,mBAAmB,GAAAA,kBAAA,CAAA,MAAA,mBAAA,SAAAC,CAAA,CAAA;AALhC,IAAA,WAAA,GAAA;;;;;;;AAiCqD,QAAA,IAAgB,CAAA,gBAAA,GAAW,IAAI,CAAC,cAAc,EAAE,CAAC,eAAe,EAAE,CAAC,QAAQ;AAI/E,QAAA,IAAA,CAAA,YAAY,GAAU,IAAI,IAAI,EAAE;AAqBtE,QAAA,IAAK,CAAA,KAAA,GAA2B,EAAE;QA2FnC,IAAA,CAAA,uBAAuB,GAAG,OAAO,KAAY,EAAE,QAA8B,KAAI;YACvF,KAAK,CAAC,cAAc,EAAE;AACtB,YAAA,KAAK,CAAC,CAAA,wCAAA,CAA0C,EAAE,QAAQ,CAAC;YAC3D,IAAI,QAAQ,EAAE;AAC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ACvC,IAAI,QAAQ,IAAI,QAAQ,EAAE,QAAQ,IAAI,QAAQ,EAAE,QAAQ,EAAE;oBACxD,MAAM,MAAM,GAAG,MAAM,uBAAuB,CAAC,SAAS,CAAC,0BAA0B,CAAC,QAAQ,CAAC;AAC3F,oBAAA,IAAI,MAAM,IAAI,OAAO,IAAI,MAAM,EAAE;wBAC/B,MAAM,YAAY,GAAG,MAAM,CAAC,KAAK,EAAE,OAAO,IAAI,iDAAiD;AAC/F,wBAAA,IAAI,YAAY,KAAK,eAAe,EAAE;AACpC,4BAAA,IAAI,CAAC,yBAAyB,CAAC,YAAY,EAAE,MAAM,CAAC;;6BAC/C;AACL,4BAAA,IAAI,CAAC,yBAAyB,CAAC,YAAY,EAAE,OAAO,CAAC;;;;qBAGpD;AACL,oBAAA,uBAAuB,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC;;aAE/D;AACD,YAAA,qBAAqB,EAAE,OAAO,KAAqC,EAAE,wBAAiD,KAAI;gBACxH,KAAK,CAAC,uBAAuB,EAAE,uBAAuB,EAAE,KAAK,CAAC,MAAM,CAAC;aACtE;AACF,SAAA;AACD,QAAA,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;CAiFD,EAAA,mBAAA,CAAA,SAAA,EAAA,QAAA,EAAA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement","i18next"],"sources":["src/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.scss?tag=nylas-timeslot-picker&encapsulation=shadow","src/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.tsx"],"sourcesContent":["@use '../../../common/styles/variables' as *;\n\n:host {\n display: block;\n height: calc(100% - 48px); //48px is the height of the header\n @include default-css-variables;\n}\n\n.time-picker-wrapper {\n display: flex;\n flex-direction: column;\n height: 100%;\n}\n\n.timeslots {\n position: relative;\n display: flex;\n flex-direction: column;\n gap: 0.75rem;\n align-items: center;\n overflow-y: scroll;\n padding: 0.5rem 1.5rem 1.5rem;\n flex: 1;\n}\n\n.time {\n /* Frame 12 */\n box-sizing: border-box;\n\n /* Auto layout */\n\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n padding: 4px 12px;\n gap: 0.5rem;\n font-size: 16px;\n font-weight: 500;\n font-family: inherit;\n\n width: 100%;\n height: 48px;\n\n color: var(--nylas-base-800);\n background: var(--nylas-base-0);\n border: none;\n outline: 1.5px solid var(--nylas-base-200);\n border-radius: var(--nylas-border-radius-2x);\n\n flex: none;\n order: 4;\n align-self: stretch;\n flex-grow: 0;\n\n cursor: pointer;\n\n &:hover,\n &:focus {\n color: var(--nylas-primary);\n outline-color: var(--nylas-primary);\n }\n\n &.selected {\n font-weight: 600;\n color: var(--nylas-primary);\n outline: 2px solid var(--nylas-primary);\n border-color: transparent;\n box-shadow: 0 0 0 2px var(--nylas-primary);\n }\n\n .time-label {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 4px;\n\n span.spots {\n font-size: 14px;\n font-family: var(--nylas-font-family);\n font-weight: 400;\n color: var(--nylas-base-600);\n }\n }\n}\n\n.empty {\n text-align: center;\n padding: 0 1.5rem;\n color: var(--nylas-base-600);\n font-size: min(max(12px, 2vw), 14px);\n height: 450px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n@keyframes pulsate {\n 0% {\n background-color: var(--nylas-base-50);\n }\n\n 50% {\n background-color: var(--nylas-base-100);\n }\n\n 100% {\n background-color: var(--nylas-base-50);\n }\n}\n\n.loading {\n padding: 0 1.5rem;\n\n .timeslot-skeleton {\n width: 100%;\n height: 4rem;\n background-color: var(--nylas-base-50);\n margin-bottom: 0.5rem;\n border-radius: var(--nylas-border-radius-2x);\n animation: pulsate 1.5s infinite ease-in-out;\n }\n}\n\n.footer {\n width: 100%;\n padding: 14px;\n box-sizing: border-box;\n border-top: 1px solid var(--nylas-base-200);\n}","import { RegisterComponent } from '@/common/register-component';\nimport { debug, isSameDayTimezone } from '@/utils/utils';\nimport { Component, Element, Event, EventEmitter, Host, Method, Prop, State, Watch, h } from '@stencil/core';\nimport { NylasSchedulerConnector } from '../../..';\nimport { NylasScheduling } from '../nylas-scheduling/nylas-scheduling';\nimport { AvailabilityTimeslot } from '@/stores/scheduler-store';\nimport type { ThemeConfig, Timeslot } from '@nylas/core';\nimport i18next from '@/utils/i18n';\nimport { LANGUAGE_CODE, LANGUAGE_CODE_TO_LOCALE_MAP } from '@/common/constants';\n\n/**\n * The `nylas-timeslot-picker` component is a UI component that allows users to select a timeslot from a list of available timeslots.\n *\n * @slot timeslot-picker-cta-label - The label for the timeslot picker CTA. Default is \"Next\".\n * @part ntp - The timeslot picker component.\n * @part ntp__timeslot - The timeslot button.\n * @part ntp__timeslot--selected - The selected timeslot button.\n * @part ntp__button-primary - The timeslot picker CTA.\n * @part ntp__time-picker-wrapper - The timeslot picker wrapper.\n * @part ntp__timeslots - The timeslot picker timeslots.\n */\n@Component({\n tag: 'nylas-timeslot-picker',\n styleUrl: 'nylas-timeslot-picker.scss',\n shadow: true,\n})\nexport class NylasTimeslotPicker {\n /**\n * The host element.\n * Used to manage the host element of the provider.\n */\n @Element() private host!: HTMLNylasTimeslotPickerElement;\n /**\n * @standalone\n * The available timeslots.\n */\n @Prop({ attribute: 'availability' }) readonly availability?: AvailabilityTimeslot[];\n /**\n * @standalone\n * The loading state prop. Used to display loading state when fetching availability.\n */\n @Prop({ attribute: 'loading-state' }) readonly isLoading?: boolean;\n /**\n * @standalone\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: any;\n /**\n * The selected timeslot.\n */\n @Prop({ attribute: 'selected-timeslot' }) readonly selectedTimeslot?: Timeslot;\n /**\n * The selected timezone.\n */\n @Prop({ attribute: 'selected-timezone' }) readonly selectedTimezone: string = Intl.DateTimeFormat().resolvedOptions().timeZone;\n /**\n * The selected date.\n */\n @Prop({ attribute: 'selected-date' }) readonly selectedDate?: Date = new Date();\n /**\n * The selected language.\n */\n @Prop() selectedLanguage?: string;\n /**\n * The 12-hour time format.\n */\n @Prop() hour12?: boolean;\n\n /**\n * This event is fired when a timeslot is selected.\n */\n @Event() readonly timeslotSelected!: EventEmitter<Timeslot>;\n /**\n * This event is fired when a timeslot is confirmed. By default, this will proceed to the booking form page.\n */\n @Event() readonly timeslotConfirmed!: EventEmitter<{ timeslot: Timeslot; host: HTMLNylasTimeslotPickerElement }>;\n\n @Event() readonly validateTimeslotError!: EventEmitter<{ error: string; type: 'error' | 'info' }>;\n\n @State() times: AvailabilityTimeslot[] = [];\n @State() hoveredTimeslotIndex?: number;\n @State() selectedTimeslotIndex?: string;\n\n @Watch('selectedLanguage')\n selectedLanguageChanged(newLanguage: LANGUAGE_CODE) {\n i18next.changeLanguage(newLanguage);\n }\n\n @Watch('selectedDate')\n selectedDateChanged(newVal: Date | null | undefined) {\n debug(`[nylas-timeslot-picker] Selected date changed`, { newVal });\n\n if (newVal) {\n this.selectedTimeslotIndex = '';\n if (typeof newVal !== 'undefined') {\n const availableTimes = this.availability?.filter(timeslot => isSameDayTimezone(timeslot.start_time, newVal, this.selectedTimezone)).map(timeslot => timeslot);\n this.times = availableTimes || [];\n }\n }\n }\n\n @Watch('availability')\n availabilityChanged(newVal: AvailabilityTimeslot[] | undefined) {\n debug(`[nylas-timeslot-picker] Available times changed`, { newVal, selectedDate: this.selectedDate });\n if (typeof newVal !== 'undefined') {\n const availableTimes = newVal\n ?.filter(timeslot => this.selectedDate && isSameDayTimezone(timeslot.start_time, this.selectedDate, this.selectedTimezone))\n .map(timeslot => timeslot);\n this.times = availableTimes || [];\n }\n }\n\n @Watch('themeConfig')\n themeConfigChanged(newThemeConfig: ThemeConfig) {\n this.applyThemeConfig(newThemeConfig);\n }\n\n connectedCallback() {\n // Use queueMicrotask to defer theme application until after React has set props.\n // This fixes the timing issue where connectedCallback fires before React sets themeConfig.\n queueMicrotask(() => {\n if (this.themeConfig) {\n this.applyThemeConfig(this.themeConfig);\n this.host.setAttribute('data-themed', '');\n }\n });\n }\n\n disconnectedCallback() {}\n\n async componentWillLoad() {\n debug(`[nylas-timeslot-picker] Component will load`, { selectedDate: this.selectedDate, availability: this.availability, times: this.times });\n }\n\n async componentDidLoad() {\n debug(`[nylas-timeslot-picker] Component did load`);\n const availableTimes = this.availability\n ?.filter(timeslot => this.selectedDate && isSameDayTimezone(timeslot.start_time, this.selectedDate, this.selectedTimezone))\n .map(timeslot => timeslot);\n this.times = availableTimes || [];\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 private getTimeslotId(timeslot: Timeslot, index: number) {\n const date = new Date(timeslot.start_time);\n const eventId = timeslot.event_id;\n return `${date.toLocaleDateString()}-${index}${eventId ? `-${eventId}` : ''}`;\n }\n\n private onClickSelectTime(timeslot: Timeslot, index: number) {\n debug(`[nylas-timeslot-picker] Time selected`, timeslot, index);\n this.selectedTimeslotIndex = this.getTimeslotId(timeslot, index);\n this.timeslotSelected.emit({\n start_time: timeslot.start_time,\n end_time: timeslot.end_time,\n emails: timeslot.emails,\n capacity: timeslot?.capacity,\n event_id: timeslot?.event_id,\n master_id: timeslot?.master_id,\n calendar_id: timeslot?.calendar_id,\n });\n }\n\n private handleConfirmedTimeslot = async (event: Event, timeslot: Timeslot | undefined) => {\n event.preventDefault();\n debug(`[nylas-timeslot-picker] Confirm timeslot`, timeslot);\n if (timeslot) {\n this.timeslotConfirmed.emit({ timeslot, host: this.host });\n }\n };\n\n @Method()\n async emitValidateTimeslotError(error: string, type: 'error' | 'info') {\n this.validateTimeslotError.emit({ error, type });\n }\n\n private handleMouseEnter = (index: number) => {\n this.hoveredTimeslotIndex = index;\n };\n\n private handleMouseLeave = () => {\n this.hoveredTimeslotIndex = -1;\n };\n\n private getTimeSlotLabel(timeslot: Timeslot) {\n const locale = LANGUAGE_CODE_TO_LOCALE_MAP[this.selectedLanguage || 'en'];\n const timeFormat = new Intl.DateTimeFormat(locale, {\n hour: '2-digit',\n minute: '2-digit',\n timeZone: this.selectedTimezone,\n hour12: this.hour12,\n });\n return `${timeFormat.format(timeslot.start_time)} - ${timeFormat.format(timeslot.end_time)}`;\n }\n\n @RegisterComponent<NylasTimeslotPicker, NylasSchedulerConnector, Exclude<NylasScheduling['stores'], undefined>>({\n name: 'nylas-timeslot-picker',\n stateToProps: new Map([\n ['scheduler.selectedDate', 'selectedDate'],\n ['scheduler.availability', 'availability'],\n ['scheduler.selectedTimeslot', 'selectedTimeslot'],\n ['scheduler.selectedTimezone', 'selectedTimezone'],\n ['scheduler.selectedLanguage', 'selectedLanguage'],\n ['scheduler.isLoading', 'isLoading'],\n ['scheduler.themeConfig', 'themeConfig'],\n ['scheduler.hour12', 'hour12'],\n ]),\n eventToProps: {\n timeslotSelected: async (event: CustomEvent<Timeslot>, nylasSchedulerConnector: NylasSchedulerConnector) => {\n debug('nylas-timeslot-picker', 'timeslotSelected', event.detail);\n nylasSchedulerConnector.scheduler.selectTime(event.detail);\n },\n timeslotConfirmed: async (event: CustomEvent<{ timeslot: Timeslot; host: HTMLNylasTimeslotPickerElement }>, nylasSchedulerConnector: NylasSchedulerConnector) => {\n debug('nylas-timeslot-picker', 'timeslotConfirmed', event.detail);\n const { timeslot, host } = event.detail;\n if (timeslot && timeslot?.event_id && timeslot?.capacity) {\n const result = await nylasSchedulerConnector.scheduler.validateGroupEventTimeslot(timeslot);\n if (result && 'error' in result) {\n const errorMessage = result.error?.message || 'An error occurred while validating the timeslot';\n if (errorMessage === 'Event is full') {\n host.emitValidateTimeslotError(errorMessage, 'info');\n } else {\n host.emitValidateTimeslotError(errorMessage, 'error');\n }\n }\n } else {\n nylasSchedulerConnector.scheduler.toggleAdditionalData(true);\n }\n },\n validateTimeslotError: async (event: CustomEvent<{ error: string }>, _nylasSchedulerConnector: NylasSchedulerConnector) => {\n debug('nylas-timeslot-picker', 'validateTimeslotError', event.detail);\n },\n },\n fireRegisterEvent: true,\n })\n render() {\n const locale = LANGUAGE_CODE_TO_LOCALE_MAP[this.selectedLanguage || 'en'];\n if (this.isLoading) {\n return (\n <Host>\n <div class={'loading'}>\n {new Array(6).fill(0).map((_, i) => (\n <div class={'timeslot-skeleton'} style={{ animationDelay: `${i * 20}ms` }} />\n ))}\n </div>\n </Host>\n );\n }\n\n if (this.availability && this.availability.length === 0) {\n return (\n <Host>\n <div class={'empty'}>\n <span>No dates available</span>\n </div>\n </Host>\n );\n }\n\n const filteredTimes = this.times.filter(timeslot => {\n const groupEvent = timeslot?.event_id || timeslot?.master_id;\n const showCapacity = typeof timeslot?.capacity === 'number' && timeslot?.capacity > 0;\n return !(groupEvent && !showCapacity);\n });\n\n if ((!this.times || this.times.length === 0 || filteredTimes.length === 0) && !!this.selectedDate) {\n return (\n <Host>\n <div class={'empty'}>\n <span>No time slots available for selected date</span>\n </div>\n </Host>\n );\n }\n\n if (!this.selectedDate) return <Host></Host>;\n\n return (\n <Host part=\"ntp\">\n <div class={'time-picker-wrapper'} part=\"ntp__time-picker-wrapper\">\n <div class={'timeslots'} part=\"ntp__timeslots\">\n {filteredTimes.map((timeslot, index) => {\n const showCapacity = typeof timeslot?.capacity === 'number' && timeslot?.capacity > 0;\n const isSelected = this.selectedTimeslotIndex == this.getTimeslotId(timeslot, index);\n return (\n <button\n part={`ntp__timeslot ${this.selectedTimeslot?.start_time?.getTime() === timeslot.start_time.getTime() ? 'ntp__timeslot--selected' : ''}`}\n class={{\n time: true,\n selected: typeof this.selectedTimeslot !== 'undefined' && isSelected,\n }}\n onClick={() => this.onClickSelectTime(timeslot, index)}\n onMouseEnter={() => this.handleMouseEnter(index)}\n onMouseLeave={() => this.handleMouseLeave()}\n >\n <div class=\"time-label\" part=\"ntp__time-label\">\n {this.hoveredTimeslotIndex == index || isSelected\n ? this.getTimeSlotLabel(timeslot)\n : timeslot.start_time.toLocaleTimeString(locale, { hour: '2-digit', minute: '2-digit', timeZone: this.selectedTimezone, hour12: this.hour12 })}\n <span class=\"spots\">{showCapacity ? i18next.t('spotsLeft', { count: timeslot?.capacity }) : null}</span>\n </div>\n </button>\n );\n })}\n </div>\n {this.selectedTimeslot && (\n <div class={'footer'}>\n <button-component variant={'primary'} onClick={(event: Event) => this.handleConfirmedTimeslot(event, this.selectedTimeslot)} part=\"ntp__button-primary\">\n <slot name=\"timeslot-picker-cta-label\">{i18next.t('nextButton')}</slot>\n </button-component>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}