@ni/nimble-components 34.8.2 → 34.8.4

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 (76) hide show
  1. package/dist/all-components-bundle.js +92 -47
  2. package/dist/all-components-bundle.js.map +1 -1
  3. package/dist/all-components-bundle.min.js +2395 -2388
  4. package/dist/all-components-bundle.min.js.map +1 -1
  5. package/dist/esm/anchor/types.js.map +1 -1
  6. package/dist/esm/banner/index.js.map +1 -1
  7. package/dist/esm/banner/types.js.map +1 -1
  8. package/dist/esm/breadcrumb/breadcrumb.foundation.spec.js.map +1 -1
  9. package/dist/esm/breadcrumb/types.js.map +1 -1
  10. package/dist/esm/chip/index.js.map +1 -1
  11. package/dist/esm/chip/types.js.map +1 -1
  12. package/dist/esm/combobox/models/combobox-form-associated.js.map +1 -1
  13. package/dist/esm/dialog/index.js +0 -1
  14. package/dist/esm/dialog/index.js.map +1 -1
  15. package/dist/esm/drawer/index.js +0 -1
  16. package/dist/esm/drawer/index.js.map +1 -1
  17. package/dist/esm/drawer/types.js.map +1 -1
  18. package/dist/esm/mapping/icon/index.js +1 -1
  19. package/dist/esm/mapping/icon/index.js.map +1 -1
  20. package/dist/esm/menu-button/types.js.map +1 -1
  21. package/dist/esm/number-field/types.js.map +1 -1
  22. package/dist/esm/patterns/button/types.js.map +1 -1
  23. package/dist/esm/patterns/dropdown/types.js.map +1 -1
  24. package/dist/esm/rich-text/editor/index.js.map +1 -1
  25. package/dist/esm/rich-text/editor/testing/types.js.map +1 -1
  26. package/dist/esm/rich-text/editor/types.js.map +1 -1
  27. package/dist/esm/rich-text-mention/base/models/mention-validator.js +2 -2
  28. package/dist/esm/rich-text-mention/base/models/mention-validator.js.map +1 -1
  29. package/dist/esm/select/models/select-form-associated.js.map +1 -1
  30. package/dist/esm/spinner/types.js.map +1 -1
  31. package/dist/esm/table/components/row/index.js.map +1 -1
  32. package/dist/esm/table/index.js.map +1 -1
  33. package/dist/esm/table/models/expansion-manager.js +1 -1
  34. package/dist/esm/table/models/expansion-manager.js.map +1 -1
  35. package/dist/esm/table/types.js.map +1 -1
  36. package/dist/esm/table-column/base/cell-view/template.js +1 -1
  37. package/dist/esm/table-column/base/cell-view/template.js.map +1 -1
  38. package/dist/esm/table-column/base/group-header-view/template.js +1 -1
  39. package/dist/esm/table-column/base/group-header-view/template.js.map +1 -1
  40. package/dist/esm/table-column/base/types.js.map +1 -1
  41. package/dist/esm/table-column/date-text/index.js +1 -1
  42. package/dist/esm/table-column/date-text/index.js.map +1 -1
  43. package/dist/esm/table-column/date-text/models/format-helper.js +1 -1
  44. package/dist/esm/table-column/date-text/models/format-helper.js.map +1 -1
  45. package/dist/esm/table-column/date-text/types.js.map +1 -1
  46. package/dist/esm/table-column/enum-base/index.js.map +1 -1
  47. package/dist/esm/table-column/enum-base/types.js.map +1 -1
  48. package/dist/esm/table-column/mapping/types.js.map +1 -1
  49. package/dist/esm/table-column/mixins/custom-sort-order.js +1 -3
  50. package/dist/esm/table-column/mixins/custom-sort-order.js.map +1 -1
  51. package/dist/esm/table-column/mixins/fractional-width-column.js +2 -6
  52. package/dist/esm/table-column/mixins/fractional-width-column.js.map +1 -1
  53. package/dist/esm/table-column/mixins/groupable-column.js +2 -6
  54. package/dist/esm/table-column/mixins/groupable-column.js.map +1 -1
  55. package/dist/esm/table-column/mixins/placeholder.js +1 -3
  56. package/dist/esm/table-column/mixins/placeholder.js.map +1 -1
  57. package/dist/esm/table-column/mixins/sortable-column.js +3 -9
  58. package/dist/esm/table-column/mixins/sortable-column.js.map +1 -1
  59. package/dist/esm/table-column/number-text/models/number-text-unit-format.js.map +1 -1
  60. package/dist/esm/table-column/number-text/types.js.map +1 -1
  61. package/dist/esm/table-column/text/index.js.map +1 -1
  62. package/dist/esm/table-column/text-base/cell-view/index.js.map +1 -1
  63. package/dist/esm/table-column/text-base/group-header-view/index.js.map +1 -1
  64. package/dist/esm/table-column/text-base/index.js +1 -1
  65. package/dist/esm/table-column/text-base/index.js.map +1 -1
  66. package/dist/esm/text-area/types.js.map +1 -1
  67. package/dist/esm/text-field/types.js.map +1 -1
  68. package/dist/esm/theme-provider/design-token-values.js.map +1 -1
  69. package/dist/esm/theme-provider/design-tokens.js.map +1 -1
  70. package/dist/esm/theme-provider/index.js +1 -1
  71. package/dist/esm/theme-provider/index.js.map +1 -1
  72. package/dist/esm/tooltip/types.js.map +1 -1
  73. package/dist/esm/tree-view/types.js.map +1 -1
  74. package/dist/esm/utilities/unit-format/default-unit-format.js.map +1 -1
  75. package/dist/esm/wafer-map/types.js.map +1 -1
  76. package/package.json +5 -11
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/anchor/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;CAChB,CAAC","sourcesContent":["/**\n * Anchor appearance states\n * @public\n */\nexport const AnchorAppearance = {\n default: undefined,\n prominent: 'prominent'\n} as const;\nexport type AnchorAppearance =\n (typeof AnchorAppearance)[keyof typeof AnchorAppearance];\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/anchor/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;CAChB,CAAC","sourcesContent":["/**\n * Anchor appearance states\n * @public\n */\nexport const AnchorAppearance = {\n default: undefined,\n prominent: 'prominent'\n} as const;\nexport type AnchorAppearance = (typeof AnchorAppearance)[keyof typeof AnchorAppearance];\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/banner/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EACH,WAAW,EACX,6BAA6B,EAC7B,YAAY,EACZ,iBA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EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC;AACzE,MAAM,CAAC,MAAM,SAAS,GAAG,eAAe,CAAC","sourcesContent":["import { attr } from '@ni/fast-element';\nimport {\n applyMixins,\n ARIAGlobalStatesAndProperties,\n DesignSystem,\n FoundationElement\n} from '@ni/fast-foundation';\nimport { styles } from './styles';\nimport { template } from './template';\nimport { BannerSeverity, type BannerToggleEventDetail } from './types';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-banner': Banner;\n }\n}\n\n/**\n * A nimble-styled notification banner for persistent messages.\n */\nexport class Banner extends FoundationElement {\n /**\n * @public\n * @description\n * Whether the banner is visible or not\n */\n @attr({ mode: 'boolean' })\n public open = false;\n\n /**\n * @public\n * @description\n * Severity of the banner's message\n */\n @attr()\n public severity: BannerSeverity = BannerSeverity.default;\n\n /**\n * @public\n * @description\n * Whether the banner title is hidden\n */\n @attr({ attribute: 'title-hidden', mode: 'boolean' })\n public titleHidden = false;\n\n /**\n * @public\n * @description\n * Hides the dismiss button\n */\n @attr({ attribute: 'prevent-dismiss', mode: 'boolean' })\n public preventDismiss = false;\n\n /**\n * @internal\n */\n public openChanged(): void {\n const eventDetail: BannerToggleEventDetail = {\n newState: this.open,\n oldState: !this.open\n };\n this.$emit('toggle', eventDetail);\n }\n\n /**\n * @internal\n */\n public dismissBanner(): void {\n this.open = false;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface Banner extends ARIAGlobalStatesAndProperties {}\napplyMixins(Banner, ARIAGlobalStatesAndProperties);\n\nconst nimbleBanner = Banner.compose({\n baseName: 'banner',\n template,\n styles\n});\n\nDesignSystem.getOrCreate().withPrefix('nimble').register(nimbleBanner());\nexport const bannerTag = 'nimble-banner';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/banner/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,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,QAAQ;IAClB,QAAQ;IACR,MAAM;CACT,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC;AACzE,MAAM,CAAC,MAAM,SAAS,GAAG,eAAe,CAAC","sourcesContent":["import { attr } from '@ni/fast-element';\nimport {\n applyMixins,\n ARIAGlobalStatesAndProperties,\n DesignSystem,\n FoundationElement\n} from '@ni/fast-foundation';\nimport { styles } from './styles';\nimport { template } from './template';\nimport { BannerSeverity, type BannerToggleEventDetail } from './types';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-banner': Banner;\n }\n}\n\n/**\n * A nimble-styled notification banner for persistent messages.\n */\nexport class Banner extends FoundationElement {\n /**\n * @public\n * @description\n * Whether the banner is visible or not\n */\n @attr({ mode: 'boolean' })\n public open = false;\n\n /**\n * @public\n * @description\n * Severity of the banner's message\n */\n @attr()\n public severity: BannerSeverity = BannerSeverity.default;\n\n /**\n * @public\n * @description\n * Whether the banner title is hidden\n */\n @attr({ attribute: 'title-hidden', mode: 'boolean' })\n public titleHidden = false;\n\n /**\n * @public\n * @description\n * Hides the dismiss button\n */\n @attr({ attribute: 'prevent-dismiss', mode: 'boolean' })\n public preventDismiss = false;\n\n /**\n * @internal\n */\n public openChanged(): void {\n const eventDetail: BannerToggleEventDetail = {\n newState: this.open,\n oldState: !this.open\n };\n this.$emit('toggle', eventDetail);\n }\n\n /**\n * @internal\n */\n public dismissBanner(): void {\n this.open = false;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface Banner extends ARIAGlobalStatesAndProperties {}\napplyMixins(Banner, ARIAGlobalStatesAndProperties);\n\nconst nimbleBanner = Banner.compose({\n baseName: 'banner',\n template,\n styles\n});\n\nDesignSystem.getOrCreate().withPrefix('nimble').register(nimbleBanner());\nexport const bannerTag = 'nimble-banner';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/banner/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;IAClB,WAAW,EAAE,aAAa;CACpB,CAAC","sourcesContent":["/**\n * Severities of banners.\n * @public\n */\nexport const BannerSeverity = {\n default: undefined,\n error: 'error',\n warning: 'warning',\n information: 'information'\n} as const;\n\nexport type BannerSeverity =\n (typeof BannerSeverity)[keyof typeof BannerSeverity];\n\n/**\n * The type of the detail associated with the `toggle`\n * event on the banner.\n */\nexport interface BannerToggleEventDetail {\n newState: boolean;\n oldState: boolean;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/banner/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;IAClB,WAAW,EAAE,aAAa;CACpB,CAAC","sourcesContent":["/**\n * Severities of banners.\n * @public\n */\nexport const BannerSeverity = {\n default: undefined,\n error: 'error',\n warning: 'warning',\n information: 'information'\n} as const;\n\nexport type BannerSeverity = (typeof BannerSeverity)[keyof typeof BannerSeverity];\n\n/**\n * The type of the detail associated with the `toggle`\n * event on the banner.\n */\nexport interface BannerToggleEventDetail {\n newState: boolean;\n oldState: boolean;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"breadcrumb.foundation.spec.js","sourceRoot":"","sources":["../../../src/breadcrumb/breadcrumb.foundation.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,CAAC;AAC/B,OAAO,EAAE,kBAAkB,IAAI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C,CACvE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAElB,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,sBAAsB,CAAC,CAAC;QAC7D,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QAC5C,OAAO,CAAC,IAAI,GAAG,GAAG,CAAC;QAEnB,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAC3B,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAE3B,MAAM,GAAG,CAAC,UAAU,EAAE,CAAC;QAEvB,MAAM,CACF,OAAO,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,cAAc,CAAC,CACvE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAEjB,MAAM,CACF,OAAO,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,cAAc,CAAC,CACvE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAElB,MAAM,UAAU,EAAE,CAAC;IACvB,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["import { breadcrumbItemTemplate } from '@ni/fast-foundation';\nimport { DOM } from '@ni/fast-element';\nimport { Breadcrumb } from '.';\nimport { breadcrumbTemplate as template } from './template';\nimport { fixture } from '../utilities/tests/fixture';\nimport { BreadcrumbItem } from '../breadcrumb-item';\n\nconst fastBreadcrumb = Breadcrumb.compose({\n baseName: 'breadcrumb',\n template\n});\n\nconst fastBreadcrumbItem = BreadcrumbItem.compose({\n baseName: 'breadcrumb-item',\n breadcrumbItemTemplate\n});\n\ninterface BreadcrumbTestSetup {\n element: Breadcrumb;\n connect: () => Promise<void>;\n disconnect: () => Promise<void>;\n item1: BreadcrumbItem;\n item2: BreadcrumbItem;\n item3: BreadcrumbItem;\n}\n\nasync function setup(): Promise<BreadcrumbTestSetup> {\n const { element, connect, disconnect } = await fixture<Breadcrumb>([\n fastBreadcrumb(),\n fastBreadcrumbItem()\n ]);\n\n const item1 = document.createElement(\n 'fast-breadcrumb-item'\n ) as BreadcrumbItem;\n const item2 = document.createElement(\n 'fast-breadcrumb-item'\n ) as BreadcrumbItem;\n const item3 = document.createElement(\n 'fast-breadcrumb-item'\n ) as BreadcrumbItem;\n\n element.appendChild(item1);\n element.appendChild(item2);\n element.appendChild(item3);\n\n return {\n element,\n connect,\n disconnect,\n item1,\n item2,\n item3\n };\n}\n\ndescribe('Breadcrumb', () => {\n it('should include a `role` of `navigation`', async () => {\n const { element, connect, disconnect } = await setup();\n\n await connect();\n\n expect(element.getAttribute('role')).toEqual('navigation');\n\n await disconnect();\n });\n\n it('should include a `role` of `list`', async () => {\n const { element, connect, disconnect } = await setup();\n\n await connect();\n\n expect(element.shadowRoot?.querySelector(\"[role='list']\")).not.toEqual(\n null\n );\n\n await disconnect();\n });\n\n it('should not render a separator on last item', async () => {\n const { element, connect, disconnect } = await setup();\n\n await connect();\n\n const items: NodeListOf<BreadcrumbItem> = element.querySelectorAll(\n 'fast-breadcrumb-item'\n );\n\n const lastItem: BreadcrumbItem | undefined = items[items.length - 1];\n\n expect(lastItem?.separator).toEqual(false);\n\n await disconnect();\n });\n\n it('should set the `aria-current` on the internal, last node, anchor when `href` is passed', async () => {\n const { element, connect, disconnect, item1, item2, item3 } = await setup();\n\n const anchor1 = document.createElement('a');\n anchor1.href = '#';\n\n const anchor2 = document.createElement('a');\n anchor2.href = '#';\n\n const anchor3 = document.createElement('a');\n anchor3.href = '#';\n\n item1.appendChild(anchor1);\n item2.appendChild(anchor2);\n item3.appendChild(anchor3);\n\n await connect();\n\n expect(\n element.querySelectorAll('a[href]')[2]?.getAttribute('aria-current')\n ).toEqual('page');\n\n await disconnect();\n });\n\n it('should remove aria-current from any prior Breadcrumb Item children with hrefs when a new node is appended', async () => {\n const { element, connect, disconnect, item1, item2, item3 } = await setup();\n\n item1.setAttribute('href', '#');\n item2.setAttribute('href', '#');\n item3.setAttribute('href', '#');\n\n await connect();\n\n expect(\n element\n .querySelectorAll('fast-breadcrumb-item')[2]\n ?.getAttribute('aria-current')\n ).toEqual('page');\n\n const item4 = document.createElement('fast-breadcrumb-item');\n (item4 as BreadcrumbItem).setAttribute('href', '#');\n element.appendChild(item4);\n\n await DOM.nextUpdate();\n\n expect(\n element\n .querySelectorAll('fast-breadcrumb-item')[2]\n ?.hasAttribute('aria-current')\n ).toEqual(false);\n\n expect(\n element\n .querySelectorAll('fast-breadcrumb-item')[3]\n ?.getAttribute('aria-current')\n ).toEqual('page');\n\n await disconnect();\n });\n\n it('should remove aria-current from any prior Breadcrumb Item children with child anchors when a new node is appended', async () => {\n const { element, connect, disconnect, item1, item2, item3 } = await setup();\n\n const anchor1 = document.createElement('a');\n anchor1.href = '#';\n\n const anchor2 = document.createElement('a');\n anchor2.href = '#';\n\n const anchor3 = document.createElement('a');\n anchor3.href = '#';\n\n item1.appendChild(anchor1);\n item2.appendChild(anchor2);\n item3.appendChild(anchor3);\n\n await connect();\n\n expect(\n element.querySelectorAll('a[href]')[2]?.getAttribute('aria-current')\n ).toEqual('page');\n\n const item4 = document.createElement('fast-breadcrumb-item');\n const anchor4 = document.createElement('a');\n anchor4.href = '#';\n\n item4.appendChild(anchor4);\n element.appendChild(item4);\n\n await DOM.nextUpdate();\n\n expect(\n element.querySelectorAll('a[href]')[2]?.hasAttribute('aria-current')\n ).toEqual(false);\n\n expect(\n element.querySelectorAll('a[href]')[3]?.getAttribute('aria-current')\n ).toEqual('page');\n\n await disconnect();\n });\n});\n"]}
1
+ {"version":3,"file":"breadcrumb.foundation.spec.js","sourceRoot":"","sources":["../../../src/breadcrumb/breadcrumb.foundation.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,CA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,EAAE,YAAY,CAAC,cAAc,CAAC,CACvE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAElB,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,sBAAsB,CAAC,CAAC;QAC7D,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QAC5C,OAAO,CAAC,IAAI,GAAG,GAAG,CAAC;QAEnB,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAC3B,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAE3B,MAAM,GAAG,CAAC,UAAU,EAAE,CAAC;QAEvB,MAAM,CACF,OAAO,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,cAAc,CAAC,CACvE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAEjB,MAAM,CACF,OAAO,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,cAAc,CAAC,CACvE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAElB,MAAM,UAAU,EAAE,CAAC;IACvB,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["import { breadcrumbItemTemplate } from '@ni/fast-foundation';\nimport { DOM } from '@ni/fast-element';\nimport { Breadcrumb } from '.';\nimport { breadcrumbTemplate as template } from './template';\nimport { fixture } from '../utilities/tests/fixture';\nimport { BreadcrumbItem } from '../breadcrumb-item';\n\nconst fastBreadcrumb = Breadcrumb.compose({\n baseName: 'breadcrumb',\n template\n});\n\nconst fastBreadcrumbItem = BreadcrumbItem.compose({\n baseName: 'breadcrumb-item',\n breadcrumbItemTemplate\n});\n\ninterface BreadcrumbTestSetup {\n element: Breadcrumb;\n connect: () => Promise<void>;\n disconnect: () => Promise<void>;\n item1: BreadcrumbItem;\n item2: BreadcrumbItem;\n item3: BreadcrumbItem;\n}\n\nasync function setup(): Promise<BreadcrumbTestSetup> {\n const { element, connect, disconnect } = await fixture<Breadcrumb>([\n fastBreadcrumb(),\n fastBreadcrumbItem()\n ]);\n\n const item1 = document.createElement(\n 'fast-breadcrumb-item'\n ) as BreadcrumbItem;\n const item2 = document.createElement(\n 'fast-breadcrumb-item'\n ) as BreadcrumbItem;\n const item3 = document.createElement(\n 'fast-breadcrumb-item'\n ) as BreadcrumbItem;\n\n element.appendChild(item1);\n element.appendChild(item2);\n element.appendChild(item3);\n\n return {\n element,\n connect,\n disconnect,\n item1,\n item2,\n item3\n };\n}\n\ndescribe('Breadcrumb', () => {\n it('should include a `role` of `navigation`', async () => {\n const { element, connect, disconnect } = await setup();\n\n await connect();\n\n expect(element.getAttribute('role')).toEqual('navigation');\n\n await disconnect();\n });\n\n it('should include a `role` of `list`', async () => {\n const { element, connect, disconnect } = await setup();\n\n await connect();\n\n expect(element.shadowRoot?.querySelector(\"[role='list']\")).not.toEqual(\n null\n );\n\n await disconnect();\n });\n\n it('should not render a separator on last item', async () => {\n const { element, connect, disconnect } = await setup();\n\n await connect();\n\n const items: NodeListOf<BreadcrumbItem> = element.querySelectorAll(\n 'fast-breadcrumb-item'\n );\n\n const lastItem: BreadcrumbItem | undefined = items[items.length - 1];\n\n expect(lastItem?.separator).toEqual(false);\n\n await disconnect();\n });\n\n it('should set the `aria-current` on the internal, last node, anchor when `href` is passed', async () => {\n const {\n element, connect, disconnect, item1, item2, item3\n } = await setup();\n\n const anchor1 = document.createElement('a');\n anchor1.href = '#';\n\n const anchor2 = document.createElement('a');\n anchor2.href = '#';\n\n const anchor3 = document.createElement('a');\n anchor3.href = '#';\n\n item1.appendChild(anchor1);\n item2.appendChild(anchor2);\n item3.appendChild(anchor3);\n\n await connect();\n\n expect(\n element.querySelectorAll('a[href]')[2]?.getAttribute('aria-current')\n ).toEqual('page');\n\n await disconnect();\n });\n\n it('should remove aria-current from any prior Breadcrumb Item children with hrefs when a new node is appended', async () => {\n const {\n element, connect, disconnect, item1, item2, item3\n } = await setup();\n\n item1.setAttribute('href', '#');\n item2.setAttribute('href', '#');\n item3.setAttribute('href', '#');\n\n await connect();\n\n expect(\n element\n .querySelectorAll('fast-breadcrumb-item')[2]\n ?.getAttribute('aria-current')\n ).toEqual('page');\n\n const item4 = document.createElement('fast-breadcrumb-item');\n (item4 as BreadcrumbItem).setAttribute('href', '#');\n element.appendChild(item4);\n\n await DOM.nextUpdate();\n\n expect(\n element\n .querySelectorAll('fast-breadcrumb-item')[2]\n ?.hasAttribute('aria-current')\n ).toEqual(false);\n\n expect(\n element\n .querySelectorAll('fast-breadcrumb-item')[3]\n ?.getAttribute('aria-current')\n ).toEqual('page');\n\n await disconnect();\n });\n\n it('should remove aria-current from any prior Breadcrumb Item children with child anchors when a new node is appended', async () => {\n const {\n element, connect, disconnect, item1, item2, item3\n } = await setup();\n\n const anchor1 = document.createElement('a');\n anchor1.href = '#';\n\n const anchor2 = document.createElement('a');\n anchor2.href = '#';\n\n const anchor3 = document.createElement('a');\n anchor3.href = '#';\n\n item1.appendChild(anchor1);\n item2.appendChild(anchor2);\n item3.appendChild(anchor3);\n\n await connect();\n\n expect(\n element.querySelectorAll('a[href]')[2]?.getAttribute('aria-current')\n ).toEqual('page');\n\n const item4 = document.createElement('fast-breadcrumb-item');\n const anchor4 = document.createElement('a');\n anchor4.href = '#';\n\n item4.appendChild(anchor4);\n element.appendChild(item4);\n\n await DOM.nextUpdate();\n\n expect(\n element.querySelectorAll('a[href]')[2]?.hasAttribute('aria-current')\n ).toEqual(false);\n\n expect(\n element.querySelectorAll('a[href]')[3]?.getAttribute('aria-current')\n ).toEqual('page');\n\n await disconnect();\n });\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/breadcrumb/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAChC,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;CAChB,CAAC","sourcesContent":["/**\n * Predefined icon appearance states\n * @public\n */\nexport const BreadcrumbAppearance = {\n default: undefined,\n prominent: 'prominent'\n} as const;\nexport type BreadcrumbAppearance =\n (typeof BreadcrumbAppearance)[keyof typeof BreadcrumbAppearance];\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/breadcrumb/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAChC,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;CAChB,CAAC","sourcesContent":["/**\n * Predefined icon appearance states\n * @public\n */\nexport const BreadcrumbAppearance = {\n default: undefined,\n prominent: 'prominent'\n} as const;\nexport type BreadcrumbAppearance = (typeof BreadcrumbAppearance)[keyof typeof BreadcrumbAppearance];\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/chip/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,uBAAuB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EACH,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,QAAQ,EAIX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAYtE;;GAEG;AACH,MAAM,OAAO,IAAK,SAAQ,iBAAiB;IAA3C;;QAEW,cAAS,GAAG,KAAK,CAAC;QAGlB,aAAQ,GAAG,KAAK,CAAC;QAGjB,eAAU,GAAmB,cAAc,CAAC,OAAO,CAAC;QAQ3D,gBAAgB;QAET,gBAAW,GAAG,KAAK,CAAC;IAqB/B,CAAC;IAnBG,gBAAgB;IAChB,IAAW,kBAAkB;QACzB,OAAO,eAAe,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC7C,CAAC;IAED,gBAAgB;IAChB,IAAW,mBAAmB;QAC1B,OAAO,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;IAKD,gBAAgB;IACT,iBAAiB;QACpB,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACjB,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACzB,CAAC;IACL,CAAC;CACJ;AArCU;IADN,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;uCACD;AAGlB;IADN,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;sCACF;AAGjB;IADN,IAAI,EAAE;wCACoD;AAG3C;IADf,IAAI,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC;sCAClC;AAO3B;IADN,UAAU;yCACgB;AAsB/B,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAE5B,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAc;IACzC,QAAQ,EAAE,MAAM;IAChB,QAAQ;IACR,MAAM;IACN,aAAa,EAAE;QACX,cAAc,EAAE,IAAI;KACvB;CACJ,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;AACvE,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC","sourcesContent":["import { attr, nullableNumberConverter, observable } from '@ni/fast-element';\nimport {\n applyMixins,\n DesignSystem,\n FoundationElement,\n StartEnd,\n type EndOptions,\n type FoundationElementDefinition,\n type StartOptions\n} from '@ni/fast-foundation';\nimport { styles } from './styles';\nimport { template } from './template';\nimport { ChipAppearance } from './types';\nimport { slotTextContent } from '../utilities/models/slot-text-content';\nimport { itemRemoveLabel } from '../label-provider/core/label-tokens';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-chip': Chip;\n }\n}\n\nexport type ChipOptions = FoundationElementDefinition &\n StartOptions &\n EndOptions;\n\n/**\n * A Nimble chip component\n */\nexport class Chip extends FoundationElement {\n @attr({ mode: 'boolean' })\n public removable = false;\n\n @attr({ mode: 'boolean' })\n public disabled = false;\n\n @attr()\n public appearance: ChipAppearance = ChipAppearance.outline;\n\n @attr({ attribute: 'tabindex', converter: nullableNumberConverter })\n public override tabIndex!: number;\n\n /** @internal */\n public readonly content?: HTMLElement[];\n\n /** @internal */\n @observable\n public hasOverflow = false;\n\n /** @internal */\n public get elementTextContent(): string {\n return slotTextContent(this.contentSlot);\n }\n\n /** @internal */\n public get removeButtonContent(): string {\n return itemRemoveLabel.getValueFor(this);\n }\n\n /** @internal */\n public contentSlot!: HTMLSlotElement;\n\n /** @internal */\n public handleRemoveClick(): void {\n if (this.removable) {\n this.$emit('remove');\n }\n }\n}\napplyMixins(Chip, StartEnd);\n\nconst nimbleChip = Chip.compose<ChipOptions>({\n baseName: 'chip',\n template,\n styles,\n shadowOptions: {\n delegatesFocus: true\n }\n});\n\nDesignSystem.getOrCreate().withPrefix('nimble').register(nimbleChip());\nexport const chipTag = 'nimble-chip';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/chip/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,uBAAuB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EACH,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,QAAQ,EAIX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC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AC;AACvE,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC","sourcesContent":["import { attr, nullableNumberConverter, observable } from '@ni/fast-element';\nimport {\n applyMixins,\n DesignSystem,\n FoundationElement,\n StartEnd,\n type EndOptions,\n type FoundationElementDefinition,\n type StartOptions\n} from '@ni/fast-foundation';\nimport { styles } from './styles';\nimport { template } from './template';\nimport { ChipAppearance } from './types';\nimport { slotTextContent } from '../utilities/models/slot-text-content';\nimport { itemRemoveLabel } from '../label-provider/core/label-tokens';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-chip': Chip;\n }\n}\n\nexport type ChipOptions = FoundationElementDefinition\n & StartOptions\n & EndOptions;\n\n/**\n * A Nimble chip component\n */\nexport class Chip extends FoundationElement {\n @attr({ mode: 'boolean' })\n public removable = false;\n\n @attr({ mode: 'boolean' })\n public disabled = false;\n\n @attr()\n public appearance: ChipAppearance = ChipAppearance.outline;\n\n @attr({ attribute: 'tabindex', converter: nullableNumberConverter })\n public override tabIndex!: number;\n\n /** @internal */\n public readonly content?: HTMLElement[];\n\n /** @internal */\n @observable\n public hasOverflow = false;\n\n /** @internal */\n public get elementTextContent(): string {\n return slotTextContent(this.contentSlot);\n }\n\n /** @internal */\n public get removeButtonContent(): string {\n return itemRemoveLabel.getValueFor(this);\n }\n\n /** @internal */\n public contentSlot!: HTMLSlotElement;\n\n /** @internal */\n public handleRemoveClick(): void {\n if (this.removable) {\n this.$emit('remove');\n }\n }\n}\napplyMixins(Chip, StartEnd);\n\nconst nimbleChip = Chip.compose<ChipOptions>({\n baseName: 'chip',\n template,\n styles,\n shadowOptions: {\n delegatesFocus: true\n }\n});\n\nDesignSystem.getOrCreate().withPrefix('nimble').register(nimbleChip());\nexport const chipTag = 'nimble-chip';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/chip/types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;CACR,CAAC","sourcesContent":["export const ChipAppearance = {\n outline: 'outline',\n block: 'block'\n} as const;\nexport type ChipAppearance =\n (typeof ChipAppearance)[keyof typeof ChipAppearance];\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/chip/types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;CACR,CAAC","sourcesContent":["export const ChipAppearance = {\n outline: 'outline',\n block: 'block'\n} as const;\nexport type ChipAppearance = (typeof ChipAppearance)[keyof typeof ChipAppearance];\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"combobox-form-associated.js","sourceRoot":"","sources":["../../../../src/combobox/models/combobox-form-associated.ts"],"names":[],"mappings":"AAAA,yKAAyK;AACzK,yCAAyC;AACzC,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErE,+CAA+C;AAC/C,MAAM,QAAS,SAAQ,cAAc;CAAG;AAIxC;;;;;GAKG;AACH,MAAM,OAAO,sBAAuB,SAAQ,cAAc,CAAC,QAAQ,CAAC;IAApE;;QACW,UAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IACnD,CAAC;CAAA","sourcesContent":["// Based on: https://github.com/microsoft/fast/blob/%40microsoft/fast-foundation_v2.49.5/packages/web-components/fast-foundation/src/combobox/combobox.form-associated.ts\n/* eslint-disable max-classes-per-file */\nimport { FormAssociated, ListboxElement } from '@ni/fast-foundation';\n\n// eslint-disable-next-line jsdoc/require-jsdoc\nclass Combobox extends ListboxElement {}\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\ninterface Combobox extends FormAssociated {}\n\n/**\n * A form-associated base class for the Combobox component. This was copied from the\n * FAST FormAssociatedCombobox (which is not exported by fast-foundation)\n *\n * @internal\n */\nexport class FormAssociatedCombobox extends FormAssociated(Combobox) {\n public proxy = document.createElement('input');\n}\n"]}
1
+ {"version":3,"file":"combobox-form-associated.js","sourceRoot":"","sources":["../../../../src/combobox/models/combobox-form-associated.ts"],"names":[],"mappings":"AAAA,yKAAyK;AACzK,yCAAyC;AACzC,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErE,+CAA+C;AAC/C,MAAM,QAAS,SAAQ,cAAc;CAAG;AAIxC;;;;;GAKG;AACH,MAAM,OAAO,sBAAuB,SAAQ,cAAc,CAAC,QAAQ,CAAC;IAApE;;QACW,UAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IACnD,CAAC;CAAA","sourcesContent":["// Based on: https://github.com/microsoft/fast/blob/%40microsoft/fast-foundation_v2.49.5/packages/web-components/fast-foundation/src/combobox/combobox.form-associated.ts\n/* eslint-disable max-classes-per-file */\nimport { FormAssociated, ListboxElement } from '@ni/fast-foundation';\n\n// eslint-disable-next-line jsdoc/require-jsdoc\nclass Combobox extends ListboxElement {}\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\ninterface Combobox extends FormAssociated {}\n\n/**\n * A form-associated base class for the Combobox component. This was copied from the\n * FAST FormAssociatedCombobox (which is not exported by fast-foundation)\n *\n * @internal\n */\nexport class FormAssociatedCombobox extends FormAssociated(Combobox) {\n public proxy = document.createElement('input');\n}\n"]}
@@ -8,7 +8,6 @@ export { UserDismissed };
8
8
  /**
9
9
  * A nimble-styled dialog.
10
10
  */
11
- // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
12
11
  export class Dialog extends FoundationElement {
13
12
  constructor() {
14
13
  super(...arguments);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/dialog/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EACH,WAAW,EACX,6BAA6B,EAC7B,YAAY,EACZ,iBAAiB,EACpB,MAA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,WAAW,CAAC,MAAM,EAAE,6BAA6B,CAAC,CAAC;AAEnD,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC;IAChC,QAAQ,EAAE,QAAQ;IAClB,QAAQ;IACR,MAAM;IACN,SAAS,EAAE,MAAM;CACpB,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC;AACzE,MAAM,CAAC,MAAM,SAAS,GAAG,eAAe,CAAC","sourcesContent":["import { attr, observable } from '@ni/fast-element';\nimport {\n applyMixins,\n ARIAGlobalStatesAndProperties,\n DesignSystem,\n FoundationElement\n} from '@ni/fast-foundation';\nimport { UserDismissed } from '../patterns/dialog/types';\nimport { styles } from './styles';\nimport { template } from './template';\n\nexport { UserDismissed };\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-dialog': Dialog;\n }\n}\n\n/**\n * A nimble-styled dialog.\n */\n// eslint-disable-next-line @typescript-eslint/no-invalid-void-type\nexport class Dialog<CloseReason = void> extends FoundationElement {\n // We want the member to match the name of the constant\n // eslint-disable-next-line @typescript-eslint/naming-convention\n public static readonly UserDismissed = UserDismissed;\n\n /**\n * @public\n * @description\n * Prevents dismissing the dialog via the Escape key\n */\n @attr({ attribute: 'prevent-dismiss', mode: 'boolean' })\n public preventDismiss = false;\n\n /**\n * @public\n * @description\n * Hides the header of the dialog.\n */\n @attr({ attribute: 'header-hidden', mode: 'boolean' })\n public headerHidden = false;\n\n /**\n * @public\n * @description\n * Hides the footer of the dialog.\n */\n @attr({ attribute: 'footer-hidden', mode: 'boolean' })\n public footerHidden = false;\n\n /**\n * The ref to the internal dialog element.\n *\n * @internal\n */\n public readonly dialogElement!: HTMLDialogElement;\n\n /** @internal */\n @observable\n public footerIsEmpty = true;\n\n /** @internal */\n @observable\n public readonly slottedFooterElements?: HTMLElement[];\n\n /**\n * True if the dialog is open/showing, false otherwise\n */\n public get open(): boolean {\n return this.resolveShow !== undefined;\n }\n\n private resolveShow?: (reason: CloseReason | UserDismissed) => void;\n\n /**\n * Opens the dialog\n * @returns Promise that is resolved when the dialog is closed. The value of the resolved Promise is the reason value passed to the close() method, or UserDismissed if the dialog was closed via the ESC key.\n */\n public async show(): Promise<CloseReason | UserDismissed> {\n if (this.open) {\n throw new Error('Dialog is already open');\n }\n this.dialogElement.showModal();\n return await new Promise((resolve, _reject) => {\n this.resolveShow = resolve;\n });\n }\n\n /**\n * Closes the dialog\n * @param reason An optional value indicating how/why the dialog was closed.\n */\n public close(reason: CloseReason): void {\n if (!this.open) {\n throw new Error('Dialog is not open');\n }\n this.dialogElement.close();\n this.doResolveShow(reason);\n }\n\n public slottedFooterElementsChanged(\n _prev: HTMLElement[] | undefined,\n next: HTMLElement[] | undefined\n ): void {\n this.footerIsEmpty = !next?.length;\n }\n\n /**\n * @internal\n */\n public cancelHandler(event: Event): boolean {\n if (this.preventDismiss) {\n event.preventDefault();\n } else {\n this.doResolveShow(UserDismissed);\n }\n return true;\n }\n\n /**\n * @internal\n */\n public closeHandler(event: Event): void {\n if (event.target !== this.dialogElement) {\n return;\n }\n if (this.resolveShow) {\n // If\n // - the browser implements dialogs with the CloseWatcher API, and\n // - the user presses ESC without first interacting with the dialog (e.g. clicking, scrolling),\n // the cancel event is not fired, but the close event still is, and the dialog just closes.\n this.doResolveShow(UserDismissed);\n }\n }\n\n private doResolveShow(reason: CloseReason | UserDismissed): void {\n if (!this.resolveShow) {\n throw new Error(\n 'Do not call doResolveShow unless there is a promise to resolve'\n );\n }\n this.resolveShow(reason);\n this.resolveShow = undefined;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface Dialog extends ARIAGlobalStatesAndProperties {}\napplyMixins(Dialog, ARIAGlobalStatesAndProperties);\n\nconst nimbleDialog = Dialog.compose({\n baseName: 'dialog',\n template,\n styles,\n baseClass: Dialog\n});\n\nDesignSystem.getOrCreate().withPrefix('nimble').register(nimbleDialog());\nexport const dialogTag = 'nimble-dialog';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/dialog/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EACH,WAAW,EACX,6BAA6B,EAC7B,YAAY,EACZ,iBAAiB,EACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,aAAa,EAAE,CAAC;AAQzB;;GAEG;AACH,MAAM,OAAO,MAA2B,SAAQ,iBAAiB;IAAjE;;QAKI;;;;WAIG;QAEI,mBAAc,GAAG,KAAK,CAAC;QAE9B;;;;WAIG;QAEI,iBAAY,GAAG,KAAK,CAAC;QAE5B;;;;WAIG;QAEI,iBAAY,GAAG,KAAK,CAAC;QAS5B,gBAAgB;QAET,kBAAa,GAAG,IAAI,CAAC;IAqFhC,CAAC;IA/EG;;OAEG;IACH,IAAW,IAAI;QACX,OAAO,IAAI,CAAC,WAAW,KAAK,SAAS,CAAC;IAC1C,CAAC;IAID;;;OAGG;IACI,KAAK,CAAC,IAAI;QACb,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;QAC9C,CAAC;QACD,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,CAAC;QAC/B,OAAO,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE;YAC1C,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC;QAC/B,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,MAAmB;QAC5B,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YACb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CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;4CAC1B;AAQrB;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;4CAC1B;AAWrB;IADN,UAAU;6CACiB;AAIZ;IADf,UAAU;qDAC2C;AAqF1D,WAAW,CAAC,MAAM,EAAE,6BAA6B,CAAC,CAAC;AAEnD,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC;IAChC,QAAQ,EAAE,QAAQ;IAClB,QAAQ;IACR,MAAM;IACN,SAAS,EAAE,MAAM;CACpB,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC;AACzE,MAAM,CAAC,MAAM,SAAS,GAAG,eAAe,CAAC","sourcesContent":["import { attr, observable } from '@ni/fast-element';\nimport {\n applyMixins,\n ARIAGlobalStatesAndProperties,\n DesignSystem,\n FoundationElement\n} from '@ni/fast-foundation';\nimport { UserDismissed } from '../patterns/dialog/types';\nimport { styles } from './styles';\nimport { template } from './template';\n\nexport { UserDismissed };\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-dialog': Dialog;\n }\n}\n\n/**\n * A nimble-styled dialog.\n */\nexport class Dialog<CloseReason = void> extends FoundationElement {\n // We want the member to match the name of the constant\n // eslint-disable-next-line @typescript-eslint/naming-convention\n public static readonly UserDismissed = UserDismissed;\n\n /**\n * @public\n * @description\n * Prevents dismissing the dialog via the Escape key\n */\n @attr({ attribute: 'prevent-dismiss', mode: 'boolean' })\n public preventDismiss = false;\n\n /**\n * @public\n * @description\n * Hides the header of the dialog.\n */\n @attr({ attribute: 'header-hidden', mode: 'boolean' })\n public headerHidden = false;\n\n /**\n * @public\n * @description\n * Hides the footer of the dialog.\n */\n @attr({ attribute: 'footer-hidden', mode: 'boolean' })\n public footerHidden = false;\n\n /**\n * The ref to the internal dialog element.\n *\n * @internal\n */\n public readonly dialogElement!: HTMLDialogElement;\n\n /** @internal */\n @observable\n public footerIsEmpty = true;\n\n /** @internal */\n @observable\n public readonly slottedFooterElements?: HTMLElement[];\n\n /**\n * True if the dialog is open/showing, false otherwise\n */\n public get open(): boolean {\n return this.resolveShow !== undefined;\n }\n\n private resolveShow?: (reason: CloseReason | UserDismissed) => void;\n\n /**\n * Opens the dialog\n * @returns Promise that is resolved when the dialog is closed. The value of the resolved Promise is the reason value passed to the close() method, or UserDismissed if the dialog was closed via the ESC key.\n */\n public async show(): Promise<CloseReason | UserDismissed> {\n if (this.open) {\n throw new Error('Dialog is already open');\n }\n this.dialogElement.showModal();\n return await new Promise((resolve, _reject) => {\n this.resolveShow = resolve;\n });\n }\n\n /**\n * Closes the dialog\n * @param reason An optional value indicating how/why the dialog was closed.\n */\n public close(reason: CloseReason): void {\n if (!this.open) {\n throw new Error('Dialog is not open');\n }\n this.dialogElement.close();\n this.doResolveShow(reason);\n }\n\n public slottedFooterElementsChanged(\n _prev: HTMLElement[] | undefined,\n next: HTMLElement[] | undefined\n ): void {\n this.footerIsEmpty = !next?.length;\n }\n\n /**\n * @internal\n */\n public cancelHandler(event: Event): boolean {\n if (this.preventDismiss) {\n event.preventDefault();\n } else {\n this.doResolveShow(UserDismissed);\n }\n return true;\n }\n\n /**\n * @internal\n */\n public closeHandler(event: Event): void {\n if (event.target !== this.dialogElement) {\n return;\n }\n if (this.resolveShow) {\n // If\n // - the browser implements dialogs with the CloseWatcher API, and\n // - the user presses ESC without first interacting with the dialog (e.g. clicking, scrolling),\n // the cancel event is not fired, but the close event still is, and the dialog just closes.\n this.doResolveShow(UserDismissed);\n }\n }\n\n private doResolveShow(reason: CloseReason | UserDismissed): void {\n if (!this.resolveShow) {\n throw new Error(\n 'Do not call doResolveShow unless there is a promise to resolve'\n );\n }\n this.resolveShow(reason);\n this.resolveShow = undefined;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface Dialog extends ARIAGlobalStatesAndProperties {}\napplyMixins(Dialog, ARIAGlobalStatesAndProperties);\n\nconst nimbleDialog = Dialog.compose({\n baseName: 'dialog',\n template,\n styles,\n baseClass: Dialog\n});\n\nDesignSystem.getOrCreate().withPrefix('nimble').register(nimbleDialog());\nexport const dialogTag = 'nimble-dialog';\n"]}
@@ -11,7 +11,6 @@ export { UserDismissed };
11
11
  * Drawer control. Shows content in a panel on the left / right side of the screen,
12
12
  * which animates to be visible with a slide-in / slide-out animation.
13
13
  */
14
- // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
15
14
  export class Drawer extends FoundationElement {
16
15
  constructor() {
17
16
  super(...arguments);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/drawer/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EACH,WAAW,EACX,6BAA6B,EAC7B,YAAY,EACZ,iBAAiB,EACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,OAAO,EAAE,aAAa,EAAE,CAAC;AAQzB;;;GAGG;AACH,mEAAmE;AACnE,MAAM,OAAO,MAA2B,SAAQ,iBAAiB;IAAjE;;QAMW,aAAQ,GAAmB,cAAc,CAAC,KAAK,CAAC;QAGhD,mBAAc,GAAG,KAAK,CAAC;QAGtB,YAAO,GAAG,KAAK,CAAC;QAkFP,gCAA2B,GAAG,GAAS,EAAE,CAAC,IAAI,CAAC,mBAAmB,EAAE,CAAC;IA4C1F,CAAC;IAzHG;;OAEG;I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AC,KAAK,EAAE,CAAC;YACpB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;YACrB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACzC,CAAC;IACL,CAAC;;AAxID,uDAAuD;AACvD,gEAAgE;AACzC,oBAAa,GAAG,aAAa,AAAhB,CAAiB;AAG9C;IADN,IAAI;wCACkD;AAGhD;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,iBAAiB,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;8CAC1B;AAqIlC,WAAW,CAAC,MAAM,EAAE,6BAA6B,CAAC,CAAC;AAEnD,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC;IAChC,QAAQ,EAAE,QAAQ;IAClB,QAAQ;IACR,MAAM;CACT,CAAC,CAAC;AACH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC;AACzE,MAAM,CAAC,MAAM,SAAS,GAAG,eAAe,CAAC","sourcesContent":["import { attr } from '@ni/fast-element';\nimport {\n applyMixins,\n ARIAGlobalStatesAndProperties,\n DesignSystem,\n FoundationElement\n} from '@ni/fast-foundation';\nimport { eventAnimationEnd } from '@ni/fast-web-utilities';\nimport { UserDismissed } from '../patterns/dialog/types';\nimport { styles } from './styles';\nimport { template } from './template';\nimport { DrawerLocation } from './types';\n\nexport { UserDismissed };\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-drawer': Drawer;\n }\n}\n\n/**\n * Drawer control. Shows content in a panel on the left / right side of the screen,\n * which animates to be visible with a slide-in / slide-out animation.\n */\n// eslint-disable-next-line @typescript-eslint/no-invalid-void-type\nexport class Drawer<CloseReason = void> extends FoundationElement {\n // We want the member to match the name of the constant\n // eslint-disable-next-line @typescript-eslint/naming-convention\n public static readonly UserDismissed = UserDismissed;\n\n @attr\n public location: DrawerLocation = DrawerLocation.right;\n\n @attr({ attribute: 'prevent-dismiss', mode: 'boolean' })\n public preventDismiss = false;\n\n public dialog!: HTMLDialogElement;\n private closing = false;\n\n private resolveShow?: (reason: CloseReason | UserDismissed) => void;\n private closeReason!: CloseReason | UserDismissed;\n\n /**\n * True if the drawer is open, opening, or closing. Otherwise, false.\n */\n public get open(): boolean {\n return this.resolveShow !== undefined;\n }\n\n /**\n * Opens the drawer\n * @returns Promise that is resolved when the drawer finishes closing. The value of the resolved\n * Promise is the reason value passed to the close() method, or UserDismissed if the drawer was\n * closed via the ESC key.\n */\n public async show(): Promise<CloseReason | UserDismissed> {\n if (this.open) {\n throw new Error('Drawer is already open');\n }\n this.openDialog();\n return await new Promise((resolve, _reject) => {\n this.resolveShow = resolve;\n });\n }\n\n /**\n * Closes the drawer\n * @param reason An optional value indicating how/why the drawer was closed.\n */\n public close(reason: CloseReason): void {\n if (!this.open || this.closing) {\n throw new Error('Drawer is not open or already closing');\n }\n this.closeReason = reason;\n this.closeDialog();\n }\n\n /**\n * @internal\n */\n public cancelHandler(event: Event): boolean {\n // Allowing the dialog to close itself bypasses the drawer's animation logic, so we\n // should close the drawer ourselves when preventDismiss is false.\n event.preventDefault();\n\n if (!this.preventDismiss) {\n this.closeReason = UserDismissed;\n this.closeDialog();\n }\n return true;\n }\n\n /**\n * @internal\n */\n public closeHandler(event: Event): void {\n if (event.target !== this.dialog) {\n return;\n }\n if (this.resolveShow) {\n // If\n // - the browser implements dialogs with the CloseWatcher API, and\n // - the user presses ESC without first interacting with the drawer (e.g. clicking, scrolling),\n // the cancel event is not fired, but the close event still is, and the drawer just closes.\n // The animation is never started, so there is no animation end listener to clean up.\n this.doResolveShow(UserDismissed);\n }\n }\n\n private doResolveShow(reason: CloseReason | UserDismissed): void {\n if (!this.resolveShow) {\n throw new Error(\n 'Do not call doResolveShow unless there is a promise to resolve'\n );\n }\n this.resolveShow(reason);\n this.resolveShow = undefined;\n }\n\n private readonly animationEndHandlerFunction = (): void => this.animationEndHandler();\n\n private openDialog(): void {\n this.dialog.showModal();\n this.triggerAnimation();\n }\n\n private closeDialog(): void {\n this.closing = true;\n this.triggerAnimation();\n }\n\n private triggerAnimation(): void {\n // Read the offsetHeight of the dialog to trigger a reflow. This guarantees that the browser\n // has processed the 'animating' class being removed before trying to readd it, even if the previous\n // animation has just finished. Otherwise, problems can occur. For example, trying to close the\n // drawer immediately after the opening animation ends does not actually close the drawer.\n // https://github.com/ni/nimble/issues/1994\n void this.dialog.offsetHeight;\n\n this.dialog.classList.add('animating');\n if (this.closing) {\n this.dialog.classList.add('closing');\n }\n\n this.dialog.addEventListener(\n eventAnimationEnd,\n this.animationEndHandlerFunction\n );\n }\n\n private animationEndHandler(): void {\n this.dialog.removeEventListener(\n eventAnimationEnd,\n this.animationEndHandlerFunction\n );\n this.dialog.classList.remove('animating');\n if (this.closing) {\n this.dialog.classList.remove('closing');\n this.dialog.close();\n this.closing = false;\n this.doResolveShow(this.closeReason);\n }\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface Drawer extends ARIAGlobalStatesAndProperties {}\napplyMixins(Drawer, ARIAGlobalStatesAndProperties);\n\nconst nimbleDrawer = Drawer.compose({\n baseName: 'drawer',\n template,\n styles\n});\nDesignSystem.getOrCreate().withPrefix('nimble').register(nimbleDrawer());\nexport const drawerTag = 'nimble-drawer';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/drawer/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EACH,WAAW,EACX,6BAA6B,EAC7B,YAAY,EACZ,iBAAiB,EACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;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AI,CAAC,2BAA2B,CACnC,CAAC;IACN,CAAC;IAEO,mBAAmB;QACvB,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAC3B,iBAAiB,EACjB,IAAI,CAAC,2BAA2B,CACnC,CAAC;QACF,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAC1C,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YACxC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YACpB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;YACrB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACzC,CAAC;IACL,CAAC;;AAxID,uDAAuD;AACvD,gEAAgE;AACzC,oBAAa,GAAG,aAAa,AAAhB,CAAiB;AAG9C;IADN,IAAI;wCACkD;AAGhD;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,iBAAiB,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;8CAC1B;AAqIlC,WAAW,CAAC,MAAM,EAAE,6BAA6B,CAAC,CAAC;AAEnD,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC;IAChC,QAAQ,EAAE,QAAQ;IAClB,QAAQ;IACR,MAAM;CACT,CAAC,CAAC;AACH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC;AACzE,MAAM,CAAC,MAAM,SAAS,GAAG,eAAe,CAAC","sourcesContent":["import { attr } from '@ni/fast-element';\nimport {\n applyMixins,\n ARIAGlobalStatesAndProperties,\n DesignSystem,\n FoundationElement\n} from '@ni/fast-foundation';\nimport { eventAnimationEnd } from '@ni/fast-web-utilities';\nimport { UserDismissed } from '../patterns/dialog/types';\nimport { styles } from './styles';\nimport { template } from './template';\nimport { DrawerLocation } from './types';\n\nexport { UserDismissed };\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-drawer': Drawer;\n }\n}\n\n/**\n * Drawer control. Shows content in a panel on the left / right side of the screen,\n * which animates to be visible with a slide-in / slide-out animation.\n */\nexport class Drawer<CloseReason = void> extends FoundationElement {\n // We want the member to match the name of the constant\n // eslint-disable-next-line @typescript-eslint/naming-convention\n public static readonly UserDismissed = UserDismissed;\n\n @attr\n public location: DrawerLocation = DrawerLocation.right;\n\n @attr({ attribute: 'prevent-dismiss', mode: 'boolean' })\n public preventDismiss = false;\n\n public dialog!: HTMLDialogElement;\n private closing = false;\n\n private resolveShow?: (reason: CloseReason | UserDismissed) => void;\n private closeReason!: CloseReason | UserDismissed;\n\n /**\n * True if the drawer is open, opening, or closing. Otherwise, false.\n */\n public get open(): boolean {\n return this.resolveShow !== undefined;\n }\n\n /**\n * Opens the drawer\n * @returns Promise that is resolved when the drawer finishes closing. The value of the resolved\n * Promise is the reason value passed to the close() method, or UserDismissed if the drawer was\n * closed via the ESC key.\n */\n public async show(): Promise<CloseReason | UserDismissed> {\n if (this.open) {\n throw new Error('Drawer is already open');\n }\n this.openDialog();\n return await new Promise((resolve, _reject) => {\n this.resolveShow = resolve;\n });\n }\n\n /**\n * Closes the drawer\n * @param reason An optional value indicating how/why the drawer was closed.\n */\n public close(reason: CloseReason): void {\n if (!this.open || this.closing) {\n throw new Error('Drawer is not open or already closing');\n }\n this.closeReason = reason;\n this.closeDialog();\n }\n\n /**\n * @internal\n */\n public cancelHandler(event: Event): boolean {\n // Allowing the dialog to close itself bypasses the drawer's animation logic, so we\n // should close the drawer ourselves when preventDismiss is false.\n event.preventDefault();\n\n if (!this.preventDismiss) {\n this.closeReason = UserDismissed;\n this.closeDialog();\n }\n return true;\n }\n\n /**\n * @internal\n */\n public closeHandler(event: Event): void {\n if (event.target !== this.dialog) {\n return;\n }\n if (this.resolveShow) {\n // If\n // - the browser implements dialogs with the CloseWatcher API, and\n // - the user presses ESC without first interacting with the drawer (e.g. clicking, scrolling),\n // the cancel event is not fired, but the close event still is, and the drawer just closes.\n // The animation is never started, so there is no animation end listener to clean up.\n this.doResolveShow(UserDismissed);\n }\n }\n\n private doResolveShow(reason: CloseReason | UserDismissed): void {\n if (!this.resolveShow) {\n throw new Error(\n 'Do not call doResolveShow unless there is a promise to resolve'\n );\n }\n this.resolveShow(reason);\n this.resolveShow = undefined;\n }\n\n private readonly animationEndHandlerFunction = (): void => this.animationEndHandler();\n\n private openDialog(): void {\n this.dialog.showModal();\n this.triggerAnimation();\n }\n\n private closeDialog(): void {\n this.closing = true;\n this.triggerAnimation();\n }\n\n private triggerAnimation(): void {\n // Read the offsetHeight of the dialog to trigger a reflow. This guarantees that the browser\n // has processed the 'animating' class being removed before trying to readd it, even if the previous\n // animation has just finished. Otherwise, problems can occur. For example, trying to close the\n // drawer immediately after the opening animation ends does not actually close the drawer.\n // https://github.com/ni/nimble/issues/1994\n void this.dialog.offsetHeight;\n\n this.dialog.classList.add('animating');\n if (this.closing) {\n this.dialog.classList.add('closing');\n }\n\n this.dialog.addEventListener(\n eventAnimationEnd,\n this.animationEndHandlerFunction\n );\n }\n\n private animationEndHandler(): void {\n this.dialog.removeEventListener(\n eventAnimationEnd,\n this.animationEndHandlerFunction\n );\n this.dialog.classList.remove('animating');\n if (this.closing) {\n this.dialog.classList.remove('closing');\n this.dialog.close();\n this.closing = false;\n this.doResolveShow(this.closeReason);\n }\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface Drawer extends ARIAGlobalStatesAndProperties {}\napplyMixins(Drawer, ARIAGlobalStatesAndProperties);\n\nconst nimbleDrawer = Drawer.compose({\n baseName: 'drawer',\n template,\n styles\n});\nDesignSystem.getOrCreate().withPrefix('nimble').register(nimbleDrawer());\nexport const drawerTag = 'nimble-drawer';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/drawer/types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;CACR,CAAC","sourcesContent":["export const DrawerLocation = {\n left: 'left',\n right: 'right'\n} as const;\nexport type DrawerLocation =\n (typeof DrawerLocation)[keyof typeof DrawerLocation];\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/drawer/types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;CACR,CAAC","sourcesContent":["export const DrawerLocation = {\n left: 'left',\n right: 'right'\n} as const;\nexport type DrawerLocation = (typeof DrawerLocation)[keyof typeof DrawerLocation];\n"]}
@@ -25,7 +25,7 @@ export class MappingIcon extends Mapping {
25
25
  this.resolvedIcon = undefined;
26
26
  await customElements.whenDefined(icon);
27
27
  }
28
- catch (ex) {
28
+ catch (_ex) {
29
29
  // If any error (i.e. invalid custom element name) don't continue
30
30
  // Don't update the resolvedIcon as it was already set to undefined before async resolution
31
31
  // (in case other async resolutions were started)
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/mapping/icon/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAQxC,SAAS,WAAW,CAAC,YAAsC;IACvD,OAAO,YAAY,CAAC,SAAS,YAAY,IAAI,CAAC;AAClD,CAAC;AAED;;;;GAIG;AACH,MAAM,OAAO,WAAY,SAAQ,OAAmB;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S,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;+CAC1B;AAQnB;IADN,UAAU;iDACkB;AAyCjC,MAAM,WAAW,GAAG,WAAW,CAAC,OAAO,CAAC;IACpC,QAAQ,EAAE,cAAc;IACxB,QAAQ;IACR,MAAM;CACT,CAAC,CAAC;AACH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;AACxE,MAAM,CAAC,MAAM,cAAc,GAAG,qBAAqB,CAAC","sourcesContent":["import { attr, observable } from '@ni/fast-element';\nimport { DesignSystem } from '@ni/fast-foundation';\nimport { Mapping } from '../base';\nimport { template } from '../base/template';\nimport type { IconSeverity } from '../../icon-base/types';\nimport { Icon } from '../../icon-base';\nimport type { MappingKey } from '../base/types';\nimport { styles } from '../base/styles';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-mapping-icon': MappingIcon;\n }\n}\n\nfunction isIconClass(elementClass: CustomElementConstructor): boolean {\n return elementClass.prototype instanceof Icon;\n}\n\n/**\n * Maps a data value to an icon.\n * One or more may be added as children of a nimble-table-column-mapping element to define\n * how specific data values should be displayed as icons in that column's cells.\n */\nexport class MappingIcon extends Mapping<MappingKey> {\n @attr()\n public icon?: string;\n\n @attr()\n public severity: IconSeverity;\n\n @attr()\n public text?: string;\n\n @attr({ attribute: 'text-hidden', mode: 'boolean' })\n public textHidden = false;\n\n /**\n * @internal\n * Calculated asynchronously by the icon mapping based on the configured icon value.\n * When assigned, it corresponds to an element name that is resolved to type of Nimble Icon.\n */\n @observable\n public resolvedIcon?: string;\n\n // Allow icons to be defined asynchronously from when the property is configured\n private async resolveIconAsync(icon: string): Promise<void> {\n try {\n // Clear the current resolution while waiting for async resolution\n this.resolvedIcon = undefined;\n await customElements.whenDefined(icon);\n } catch (ex) {\n // If any error (i.e. invalid custom element name) don't continue\n // Don't update the resolvedIcon as it was already set to undefined before async resolution\n // (in case other async resolutions were started)\n return;\n }\n\n if (icon !== this.icon) {\n // Possible the icon has changed while waiting for async resolution\n // Don't update the resolvedIcon as it was already set to undefined before async resolution\n // (in case other async resolutions were started)\n return;\n }\n\n const elementClass = customElements.get(icon)!;\n this.resolvedIcon = isIconClass(elementClass) ? icon : undefined;\n }\n\n private iconChanged(): void {\n const icon = this.icon;\n if (!icon) {\n this.resolvedIcon = undefined;\n return;\n }\n const elementClass = customElements.get(icon);\n if (elementClass) {\n this.resolvedIcon = isIconClass(elementClass) ? icon : undefined;\n return;\n }\n void this.resolveIconAsync(icon);\n }\n}\n\nconst iconMapping = MappingIcon.compose({\n baseName: 'mapping-icon',\n template,\n styles\n});\nDesignSystem.getOrCreate().withPrefix('nimble').register(iconMapping());\nexport const mappingIconTag = 'nimble-mapping-icon';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/mapping/icon/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAQxC,SAAS,WAAW,CAAC,YAAsC;IACvD,OAAO,YAAY,CAAC,SAAS,YAAY,IAAI,CAAC;AAClD,CAAC;AAED;;;;GAIG;AACH,MAAM,OAAO,WAAY,SAAQ,OAAmB;IAApD;;QAWW,eAAU,GAAG,KAAK,CAAC;IA+C9B,CAAC;IArCG,gFAAgF;IACxE,KAAK,CAAC,gBAAgB,CAAC,IAAY;QACvC,IAAI,CAAC;YACD,kEAAkE;YAClE,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC;YAC9B,MAAM,cA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,CAAC;AACH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;AACxE,MAAM,CAAC,MAAM,cAAc,GAAG,qBAAqB,CAAC","sourcesContent":["import { attr, observable } from '@ni/fast-element';\nimport { DesignSystem } from '@ni/fast-foundation';\nimport { Mapping } from '../base';\nimport { template } from '../base/template';\nimport type { IconSeverity } from '../../icon-base/types';\nimport { Icon } from '../../icon-base';\nimport type { MappingKey } from '../base/types';\nimport { styles } from '../base/styles';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-mapping-icon': MappingIcon;\n }\n}\n\nfunction isIconClass(elementClass: CustomElementConstructor): boolean {\n return elementClass.prototype instanceof Icon;\n}\n\n/**\n * Maps a data value to an icon.\n * One or more may be added as children of a nimble-table-column-mapping element to define\n * how specific data values should be displayed as icons in that column's cells.\n */\nexport class MappingIcon extends Mapping<MappingKey> {\n @attr()\n public icon?: string;\n\n @attr()\n public severity: IconSeverity;\n\n @attr()\n public text?: string;\n\n @attr({ attribute: 'text-hidden', mode: 'boolean' })\n public textHidden = false;\n\n /**\n * @internal\n * Calculated asynchronously by the icon mapping based on the configured icon value.\n * When assigned, it corresponds to an element name that is resolved to type of Nimble Icon.\n */\n @observable\n public resolvedIcon?: string;\n\n // Allow icons to be defined asynchronously from when the property is configured\n private async resolveIconAsync(icon: string): Promise<void> {\n try {\n // Clear the current resolution while waiting for async resolution\n this.resolvedIcon = undefined;\n await customElements.whenDefined(icon);\n } catch (_ex) {\n // If any error (i.e. invalid custom element name) don't continue\n // Don't update the resolvedIcon as it was already set to undefined before async resolution\n // (in case other async resolutions were started)\n return;\n }\n\n if (icon !== this.icon) {\n // Possible the icon has changed while waiting for async resolution\n // Don't update the resolvedIcon as it was already set to undefined before async resolution\n // (in case other async resolutions were started)\n return;\n }\n\n const elementClass = customElements.get(icon)!;\n this.resolvedIcon = isIconClass(elementClass) ? icon : undefined;\n }\n\n private iconChanged(): void {\n const icon = this.icon;\n if (!icon) {\n this.resolvedIcon = undefined;\n return;\n }\n const elementClass = customElements.get(icon);\n if (elementClass) {\n this.resolvedIcon = isIconClass(elementClass) ? icon : undefined;\n return;\n }\n void this.resolveIconAsync(icon);\n }\n}\n\nconst iconMapping = MappingIcon.compose({\n baseName: 'mapping-icon',\n template,\n styles\n});\nDesignSystem.getOrCreate().withPrefix('nimble').register(iconMapping());\nexport const mappingIconTag = 'nimble-mapping-icon';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/menu-button/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACH,gBAAgB,EAChB,uBAAuB,EAC1B,MAAM,0BAA0B,CAAC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAC9B,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;CACN,CAAC","sourcesContent":["/**\n * Types of menu button appearance.\n * @public\n */\nexport {\n ButtonAppearance,\n ButtonAppearanceVariant\n} from '../patterns/button/types';\n\n/**\n * The options of where to position the menu relative to the menu button.\n */\nexport const MenuButtonPosition = {\n above: 'above',\n below: 'below',\n auto: 'auto'\n} as const;\nexport type MenuButtonPosition =\n (typeof MenuButtonPosition)[keyof typeof MenuButtonPosition];\n\n/**\n * The type of the detail associated with the `toggle` and `beforetoggle`\n * events on the menu button.\n */\nexport interface MenuButtonToggleEventDetail {\n newState: boolean;\n oldState: boolean;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/menu-button/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACH,gBAAgB,EAChB,uBAAuB,EAC1B,MAAM,0BAA0B,CAAC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAC9B,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;CACN,CAAC","sourcesContent":["/**\n * Types of menu button appearance.\n * @public\n */\nexport {\n ButtonAppearance,\n ButtonAppearanceVariant\n} from '../patterns/button/types';\n\n/**\n * The options of where to position the menu relative to the menu button.\n */\nexport const MenuButtonPosition = {\n above: 'above',\n below: 'below',\n auto: 'auto'\n} as const;\nexport type MenuButtonPosition = (typeof MenuButtonPosition)[keyof typeof MenuButtonPosition];\n\n/**\n * The type of the detail associated with the `toggle` and `beforetoggle`\n * events on the menu button.\n */\nexport interface MenuButtonToggleEventDetail {\n newState: boolean;\n oldState: boolean;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/number-field/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACjC,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,SAAS,EAAE,WAAW;CAChB,CAAC","sourcesContent":["/**\n * Values for the 'appearance' property of the number field\n */\nexport const NumberFieldAppearance = {\n underline: 'underline',\n outline: 'outline',\n block: 'block',\n frameless: 'frameless'\n} as const;\n\nexport type NumberFieldAppearance =\n (typeof NumberFieldAppearance)[keyof typeof NumberFieldAppearance];\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/number-field/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACjC,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,SAAS,EAAE,WAAW;CAChB,CAAC","sourcesContent":["/**\n * Values for the 'appearance' property of the number field\n */\nexport const NumberFieldAppearance = {\n underline: 'underline',\n outline: 'outline',\n block: 'block',\n frameless: 'frameless'\n} as const;\n\nexport type NumberFieldAppearance = (typeof NumberFieldAppearance)[keyof typeof NumberFieldAppearance];\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/patterns/button/types.ts"],"names":[],"mappings":"AAiCA;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;CACR,CAAC;AAIX;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACnC,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;CACV,CAAC","sourcesContent":["/**\n * The interface that buttons of various types implement. The properties in this interface\n * are leveraged by the shared button pattern css.\n */\nexport interface ButtonPattern {\n /**\n * The appearance the button should have.\n */\n appearance: ButtonAppearance;\n\n /**\n * Specify as 'true' to hide the text content of the button. The button will\n * become square, and the text content will be used as the label of the button\n * for accessibility purposes.\n */\n contentHidden: boolean;\n\n /**\n * Whether or not the button is disabled.\n */\n disabled: boolean;\n}\n\n/**\n * Interface for buttons that support appearance variants.\n */\nexport interface ButtonAppearanceVariantPattern {\n /**\n * The appearance variant the button should have.\n */\n appearanceVariant: ButtonAppearanceVariant;\n}\n\n/**\n * Types of button appearance.\n * @public\n */\nexport const ButtonAppearance = {\n outline: 'outline',\n ghost: 'ghost',\n block: 'block'\n} as const;\nexport type ButtonAppearance =\n (typeof ButtonAppearance)[keyof typeof ButtonAppearance];\n\n/**\n * Types of button appearance variants.\n * @public\n */\nexport const ButtonAppearanceVariant = {\n default: undefined,\n primary: 'primary',\n accent: 'accent'\n} as const;\nexport type ButtonAppearanceVariant =\n (typeof ButtonAppearanceVariant)[keyof typeof ButtonAppearanceVariant];\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/patterns/button/types.ts"],"names":[],"mappings":"AAiCA;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;CACR,CAAC;AAGX;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACnC,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;CACV,CAAC","sourcesContent":["/**\n * The interface that buttons of various types implement. The properties in this interface\n * are leveraged by the shared button pattern css.\n */\nexport interface ButtonPattern {\n /**\n * The appearance the button should have.\n */\n appearance: ButtonAppearance;\n\n /**\n * Specify as 'true' to hide the text content of the button. The button will\n * become square, and the text content will be used as the label of the button\n * for accessibility purposes.\n */\n contentHidden: boolean;\n\n /**\n * Whether or not the button is disabled.\n */\n disabled: boolean;\n}\n\n/**\n * Interface for buttons that support appearance variants.\n */\nexport interface ButtonAppearanceVariantPattern {\n /**\n * The appearance variant the button should have.\n */\n appearanceVariant: ButtonAppearanceVariant;\n}\n\n/**\n * Types of button appearance.\n * @public\n */\nexport const ButtonAppearance = {\n outline: 'outline',\n ghost: 'ghost',\n block: 'block'\n} as const;\nexport type ButtonAppearance = (typeof ButtonAppearance)[keyof typeof ButtonAppearance];\n\n/**\n * Types of button appearance variants.\n * @public\n */\nexport const ButtonAppearanceVariant = {\n default: undefined,\n primary: 'primary',\n accent: 'accent'\n} as const;\nexport type ButtonAppearanceVariant = (typeof ButtonAppearanceVariant)[keyof typeof ButtonAppearanceVariant];\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/patterns/dropdown/types.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;CACR,CAAC;AAIX,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAC9B,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,SAAS,EAAE,WAAW;CAChB,CAAC","sourcesContent":["import type { ListOption } from '../../list-option';\nimport type { ErrorPattern } from '../error/types';\n\n/**\n * The interface that dropdowns of various types implement. The properties in this interface\n * are leveraged by the shared dropdown pattern css.\n */\nexport interface DropdownPattern extends ErrorPattern {\n position?: DropdownPosition;\n}\n\nexport const DropdownPosition = {\n above: 'above',\n below: 'below'\n} as const;\nexport type DropdownPosition =\n (typeof DropdownPosition)[keyof typeof DropdownPosition];\n\nexport const DropdownAppearance = {\n underline: 'underline',\n outline: 'outline',\n block: 'block',\n frameless: 'frameless'\n} as const;\nexport type DropdownAppearance =\n (typeof DropdownAppearance)[keyof typeof DropdownAppearance];\n\n/**\n * @internal\n *\n * This interface is used to register options with their parent once their\n * 'connectedCallback' method is run. This allows for the \"owner\", like the\n * Select, to have its value set to that newly registered option earlier than it\n * might otherwise in certain situations. One such scenario is in an Angular\n * reactive form, where the form value is set to an option immediately after\n * dynamically adding it.\n */\nexport interface ListOptionOwner extends HTMLElement {\n registerOption: (option: ListOption) => void;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/patterns/dropdown/types.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;CACR,CAAC;AAGX,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAC9B,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,SAAS,EAAE,WAAW;CAChB,CAAC","sourcesContent":["import type { ListOption } from '../../list-option';\nimport type { ErrorPattern } from '../error/types';\n\n/**\n * The interface that dropdowns of various types implement. The properties in this interface\n * are leveraged by the shared dropdown pattern css.\n */\nexport interface DropdownPattern extends ErrorPattern {\n position?: DropdownPosition;\n}\n\nexport const DropdownPosition = {\n above: 'above',\n below: 'below'\n} as const;\nexport type DropdownPosition = (typeof DropdownPosition)[keyof typeof DropdownPosition];\n\nexport const DropdownAppearance = {\n underline: 'underline',\n outline: 'outline',\n block: 'block',\n frameless: 'frameless'\n} as const;\nexport type DropdownAppearance = (typeof DropdownAppearance)[keyof typeof DropdownAppearance];\n\n/**\n * @internal\n *\n * This interface is used to register options with their parent once their\n * 'connectedCallback' method is run. This allows for the \"owner\", like the\n * Select, to have its value set to that newly registered option earlier than it\n * might otherwise in certain situations. One such scenario is in an Angular\n * reactive form, where the form value is set to an option immediately after\n * dynamically adding it.\n */\nexport interface ListOptionOwner extends HTMLElement {\n registerOption: (option: ListOption) => void;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/rich-text/editor/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EACH,WAAW,EACX,6BAA6B,EAC7B,YAAY,EACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EACH,cAAc,EACd,MAAM,EAEN,MAAM,EACT,MAAM,cAAc,CAAC;AAEtB,OAAO,SAAS,MAAM,8BAA8B,CAAC;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EACH,cAAc,EACd,mBAAmB,EAGtB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAInC,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAQrE;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,iBAAiB,CAAC,QAAQ,CAAC;IAA/D;;QACI;;WAEG;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N,UAAU;0DAC8B;AAOlC;IADN,UAAU;sDACgB;AAMpB;IADN,UAAU;8DACwB;AAM5B;IADN,UAAU;4DACkC;AA4iBjD,WAAW,CAAC,cAAc,EAAE,6BAA6B,CAAC,CAAC;AAE3D,MAAM,oBAAoB,GAAG,cAAc,CAAC,OAAO,CAAC;IAChD,QAAQ,EAAE,kBAAkB;IAC5B,QAAQ;IACR,MAAM;IACN,aAAa,EAAE;QACX,cAAc,EAAE,IAAI;KACvB;CACJ,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE;KACrB,UAAU,CAAC,QAAQ,CAAC;KACpB,QAAQ,CAAC,oBAAoB,EAAE,CAAC,CAAC;AACtC,MAAM,CAAC,MAAM,iBAAiB,GAAG,yBAAyB,CAAC","sourcesContent":["import { observable, attr, DOM } from '@ni/fast-element';\nimport {\n applyMixins,\n ARIAGlobalStatesAndProperties,\n DesignSystem\n} from '@ni/fast-foundation';\nimport { keyEnter, keySpace } from '@ni/fast-web-utilities';\nimport {\n findParentNode,\n isList,\n type AnyExtension,\n Editor\n} from '@tiptap/core';\n\nimport HardBreak from '@tiptap/extension-hard-break';\nimport type { SuggestionProps } from '@tiptap/suggestion';\nimport { template } from './template';\nimport { styles } from './styles';\nimport type { ToggleButton } from '../../toggle-button';\nimport {\n TipTapNodeName,\n mentionPluginPrefix,\n type MentionDetail,\n type FormatButtonsState\n} from './types';\nimport { mixinErrorPattern } from '../../patterns/error/types';\nimport { RichTextMarkdownParser } from '../models/markdown-parser';\nimport { RichTextMarkdownSerializer } from '../models/markdown-serializer';\nimport { RichText } from '../base';\nimport type { RichTextMentionListbox } from '../mention-listbox';\nimport type { MappingConfigs } from '../../rich-text-mention/base/types';\nimport type { MentionExtensionConfiguration } from '../models/mention-extension-configuration';\nimport { createTiptapEditor } from './models/create-tiptap-editor';\nimport { EditorConfiguration } from '../models/editor-configuration';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-rich-text-editor': RichTextEditor;\n }\n}\n\n/**\n * A nimble styled rich text editor\n */\nexport class RichTextEditor extends mixinErrorPattern(RichText) {\n /**\n * @internal\n */\n public editorDiv = this.createEditor();\n\n /**\n * @internal\n */\n public tiptapEditor = createTiptapEditor(\n () => {},\n () => {},\n this.editorDiv,\n [],\n this.mentionListbox,\n this.placeholder\n );\n\n /**\n * @internal\n */\n public readonly xmlSerializer = new XMLSerializer();\n\n /**\n * @internal\n */\n public richTextMarkdownSerializer = new RichTextMarkdownSerializer([]);\n\n /**\n * Whether to disable user from editing and interacting with toolbar buttons\n *\n * @public\n * HTML Attribute: disabled\n */\n @attr({ mode: 'boolean' })\n public disabled = false;\n\n /**\n * Whether to hide the footer of the rich text editor\n *\n * @public\n * HTML Attribute: footer-hidden\n */\n @attr({ attribute: 'footer-hidden', mode: 'boolean' })\n public footerHidden = false;\n\n /**\n * @public\n * HTML Attribute: placeholder\n */\n @attr\n public placeholder?: string;\n\n /**\n * True if the editor is empty or contains only whitespace, false otherwise.\n *\n * @public\n */\n public get empty(): boolean {\n // Tiptap [isEmpty](https://tiptap.dev/api/editor#is-empty) returns false even if the editor has only whitespace.\n // Get the prose mirror textContent of all the nodes with whitespace trimmed to see if it is empty\n // Mention nodes are formatted as empty text content, so if empty make sure there are no mention nodes remaining\n if (this.tiptapEditor.state.doc.textContent.trim() === '') {\n let hasMention = false;\n this.tiptapEditor.state.doc.descendants(node => {\n if (node.type.name.startsWith(mentionPluginPrefix)) {\n hasMention = true;\n }\n const continueDescent = hasMention === false;\n return continueDescent;\n });\n return !hasMention;\n }\n return false;\n }\n\n /**\n * @internal\n */\n public mentionListbox?: RichTextMentionListbox;\n\n /**\n * @internal\n */\n @observable\n public boldButton!: ToggleButton;\n\n /**\n * @internal\n */\n @observable\n public italicsButton!: ToggleButton;\n\n /**\n * @internal\n */\n @observable\n public bulletListButton!: ToggleButton;\n\n /**\n * @internal\n */\n @observable\n public numberedListButton!: ToggleButton;\n\n /**\n * The width of the vertical scrollbar, if displayed.\n * @internal\n */\n @observable\n public scrollbarWidth = -1;\n\n /**\n * @internal\n */\n @observable\n public activeMentionCharacter = '';\n\n /**\n * @internal\n */\n @observable\n public activeMappingConfigs?: MappingConfigs;\n\n /**\n * @internal\n */\n public activeMentionCommand?: SuggestionProps['command'];\n\n /**\n * @internal\n */\n public editorContainer!: HTMLDivElement;\n\n private resizeObserver?: ResizeObserver;\n private updateScrollbarWidthQueued = false;\n\n /**\n * @internal\n */\n public override connectedCallback(): void {\n super.connectedCallback();\n if (!this.editorDiv.isConnected) {\n this.editorContainer.append(this.editorDiv);\n }\n this.bindEditorTransactionEvent();\n this.bindEditorUpdateEvent();\n this.stopNativeInputEventPropagation();\n this.resizeObserver = new ResizeObserver(() => this.onResize());\n this.resizeObserver.observe(this);\n }\n\n /**\n * @internal\n */\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.unbindEditorTransactionEvent();\n this.unbindEditorUpdateEvent();\n this.unbindNativeInputEvent();\n this.resizeObserver?.disconnect();\n }\n\n /**\n * @internal\n */\n public disabledChanged(): void {\n this.disableEditor();\n this.disableMentionViewElement();\n }\n\n /**\n * Update the placeholder text and view of the editor.\n * @internal\n */\n public placeholderChanged(_prev: unknown, _next: unknown): void {\n // In TipTap v3, extension options cannot be modified after initialization.\n // We need to reinitialize the editor with the new placeholder value.\n // This workaround will be updated once the upstream issue is resolved.\n // See: https://github.com/ni/nimble/issues/2752\n const currentContent = this.getMarkdown();\n const { from, to } = this.tiptapEditor.view.state.selection;\n\n this.initializeEditor(); // Destroys and recreates entire editor\n this.setMarkdown(currentContent);\n this.tiptapEditor.commands.setTextSelection({ from, to });\n }\n\n /**\n * @internal\n */\n public ariaLabelChanged(_prev: unknown, _next: unknown): void {\n if (this.ariaLabel !== null && this.ariaLabel !== undefined) {\n this.editorDiv.setAttribute('aria-label', this.ariaLabel);\n } else {\n this.editorDiv.removeAttribute('aria-label');\n }\n }\n\n /**\n * @internal\n */\n public configurationChanged(\n prev: EditorConfiguration | undefined,\n next: EditorConfiguration\n ): void {\n const formatButtonsState = this.getButtonsState(this.tiptapEditor);\n const { from, to } = this.tiptapEditor.view.state.selection;\n if (this.isMentionExtensionConfigUnchanged(prev, next)) {\n this.setMarkdown(this.getMarkdown());\n } else {\n const mentionExtensionConfig = this.getMentionExtensionConfig();\n const currentStateMarkdown = this.getMarkdown();\n this.richTextMarkdownSerializer = new RichTextMarkdownSerializer(\n mentionExtensionConfig.map(config => config.name)\n );\n this.initializeEditor();\n this.setMarkdown(currentStateMarkdown);\n }\n this.tiptapEditor.commands.setTextSelection({ from, to });\n this.resetEditorButtonsState(formatButtonsState);\n this.setActiveMappingConfigs();\n }\n\n /**\n * @internal\n */\n public activeMentionCharacterChanged(): void {\n this.setActiveMappingConfigs();\n }\n\n /**\n * Toggle the bold mark and focus back to the editor\n * @internal\n */\n public boldButtonClick(): void {\n this.tiptapEditor.chain().focus().toggleBold().run();\n }\n\n /**\n * Toggle the bold mark and focus back to the editor\n * @internal\n */\n public boldButtonKeyDown(event: KeyboardEvent): boolean {\n if (this.keyActivatesButton(event)) {\n this.tiptapEditor.chain().focus().toggleBold().run();\n return false;\n }\n return true;\n }\n\n /**\n * Toggle the italics mark and focus back to the editor\n * @internal\n */\n public italicsButtonClick(): void {\n this.tiptapEditor.chain().focus().toggleItalic().run();\n }\n\n /**\n * Toggle the italics mark and focus back to the editor\n * @internal\n */\n public italicsButtonKeyDown(event: KeyboardEvent): boolean {\n if (this.keyActivatesButton(event)) {\n this.tiptapEditor.chain().focus().toggleItalic().run();\n return false;\n }\n return true;\n }\n\n /**\n * Toggle the unordered list node and focus back to the editor\n * @internal\n */\n public bulletListButtonClick(): void {\n this.tiptapEditor.chain().focus().toggleBulletList().run();\n }\n\n /**\n * Toggle the unordered list node and focus back to the editor\n * @internal\n */\n public bulletListButtonKeyDown(event: KeyboardEvent): boolean {\n if (this.keyActivatesButton(event)) {\n this.tiptapEditor.chain().focus().toggleBulletList().run();\n return false;\n }\n return true;\n }\n\n /**\n * Toggle the ordered list node and focus back to the editor\n * @internal\n */\n public numberedListButtonClick(): void {\n this.tiptapEditor.chain().focus().toggleOrderedList().run();\n }\n\n /**\n * Toggle the ordered list node and focus back to the editor\n * @internal\n */\n public numberedListButtonKeyDown(event: KeyboardEvent): boolean {\n if (this.keyActivatesButton(event)) {\n this.tiptapEditor.chain().focus().toggleOrderedList().run();\n return false;\n }\n return true;\n }\n\n /**\n * Inserts the mention character into the editor and focus back to the editor\n * @internal\n */\n public mentionButtonClick(character: string): void {\n this.tiptapEditor\n .chain()\n .insertContent(\n this.shouldInsertSpace() ? ` ${character}` : character\n )\n .focus()\n .run();\n }\n\n /**\n * This function load tip tap editor with provided markdown content by parsing into html\n * @public\n */\n public setMarkdown(markdown: string): void {\n const html = this.getHtmlContent(markdown);\n this.tiptapEditor.commands.setContent(html, { emitUpdate: false });\n this.disableMentionViewElement();\n }\n\n /**\n * This function returns markdown string by serializing tiptap editor document using prosemirror MarkdownSerializer\n * @public\n */\n public getMarkdown(): string {\n return this.richTextMarkdownSerializer.serializeDOMToMarkdown(\n this.tiptapEditor.state.doc\n );\n }\n\n /**\n * @internal\n */\n public stopEventPropagation(event: Event): boolean {\n // Don't bubble the 'change' event from the toggle button because\n // all the formatting button has its own 'toggle' event through 'click' and 'keydown'.\n event.stopPropagation();\n return false;\n }\n\n public getMentionedHrefs(): string[] {\n const mentionedHrefs = new Set<string>();\n this.tiptapEditor.state.doc.descendants(node => {\n if (node.type.name.startsWith(mentionPluginPrefix)) {\n mentionedHrefs.add(node.attrs.href as string);\n }\n });\n return Array.from(mentionedHrefs);\n }\n\n /**\n * @internal\n */\n public getMentionExtensionConfig(): MentionExtensionConfiguration[] {\n return this.configuration instanceof EditorConfiguration\n ? this.configuration.mentionExtensionConfig\n : [];\n }\n\n /**\n * @internal\n */\n public onMentionSelect(event: CustomEvent<MentionDetail>): void {\n if (this.activeMentionCommand) {\n this.activeMentionCommand({\n href: event.detail.href,\n label: event.detail.displayName\n });\n }\n }\n\n /**\n * @internal\n */\n public focusoutHandler(): void {\n if (!this.mentionListbox?.open) {\n return;\n }\n this.mentionListbox?.close();\n }\n\n public override createConfig(): void {\n this.validate();\n if (this.richTextValidator.isValid()) {\n if (\n this.richTextUpdateTracker.updateButtonLabel\n || this.richTextUpdateTracker.updateMappingConfigs\n || this.richTextUpdateTracker.updatePattern\n ) {\n this.configuration = new EditorConfiguration(\n this.mentionElements\n );\n }\n } else {\n this.configuration = undefined;\n }\n }\n\n private isMentionExtensionConfigUnchanged(\n prev: EditorConfiguration | undefined,\n next: EditorConfiguration | undefined\n ): boolean {\n const prevConfigCharacters = prev?.mentionExtensionConfig\n .map(config => config.character)\n .sort((a, b) => a.localeCompare(b))\n .toString();\n const nextConfigCharacters = next?.mentionExtensionConfig\n .map(config => config.character)\n .sort((a, b) => a.localeCompare(b))\n .toString();\n return prevConfigCharacters === nextConfigCharacters;\n }\n\n private createEditor(): HTMLDivElement {\n const editor = document.createElement('div');\n editor.className = 'editor';\n editor.setAttribute('aria-multiline', 'true');\n editor.setAttribute('role', 'textbox');\n editor.setAttribute('aria-disabled', 'false');\n return editor;\n }\n\n private initializeEditor(): void {\n this.unbindEditorTransactionEvent();\n this.unbindEditorUpdateEvent();\n this.unbindNativeInputEvent();\n this.tiptapEditor?.destroy();\n this.tiptapEditor = createTiptapEditor(\n character => {\n this.activeMentionCharacter = character;\n },\n command => {\n this.activeMentionCommand = command;\n },\n this.editorDiv,\n this.configuration instanceof EditorConfiguration\n ? this.configuration.mentionExtensionConfig\n : [],\n this.mentionListbox,\n this.placeholder\n );\n this.disableEditor();\n this.disableMentionViewElement();\n this.bindEditorTransactionEvent();\n this.bindEditorUpdateEvent();\n this.stopNativeInputEventPropagation();\n }\n\n /**\n * This function takes the Fragment from parseMarkdownToDOM function and return the serialized string using XMLSerializer\n */\n private getHtmlContent(markdown: string): string {\n const parseResult = RichTextMarkdownParser.parseMarkdownToDOM(\n markdown,\n this.configuration?.parserMentionConfig\n );\n return this.xmlSerializer.serializeToString(parseResult.fragment);\n }\n\n /**\n * Binding the \"transaction\" event to the editor allows continuous monitoring the events and updating the button state in response to\n * various actions such as mouse events, keyboard events, changes in the editor content etc,.\n * https://tiptap.dev/api/events#transaction\n */\n private bindEditorTransactionEvent(): void {\n this.tiptapEditor.on('transaction', () => {\n this.updateEditorButtonsState();\n });\n }\n\n private unbindEditorTransactionEvent(): void {\n this.tiptapEditor.off('transaction');\n }\n\n private updateEditorButtonsState(): void {\n if (!this.$fastController.isConnected) {\n return;\n }\n\n const { extensionManager, state } = this.tiptapEditor;\n const { extensions } = extensionManager;\n const { selection } = state;\n const parentList = findParentNode((node: { type: { name: string } }) => isList(node.type.name, extensions))(selection);\n\n this.boldButton.checked = this.tiptapEditor.isActive('bold');\n this.italicsButton.checked = this.tiptapEditor.isActive('italic');\n this.bulletListButton.checked = parentList?.node.type.name === TipTapNodeName.bulletList;\n this.numberedListButton.checked = parentList?.node.type.name === TipTapNodeName.numberedList;\n }\n\n private keyActivatesButton(event: KeyboardEvent): boolean {\n switch (event.key) {\n case keySpace:\n case keyEnter:\n return true;\n default:\n return false;\n }\n }\n\n private unbindEditorUpdateEvent(): void {\n this.tiptapEditor.off('update');\n }\n\n /**\n * input event is fired when there is a change in the content of the editor.\n *\n * https://tiptap.dev/api/events#update\n */\n private bindEditorUpdateEvent(): void {\n this.tiptapEditor.on('update', () => {\n this.$emit('input');\n this.queueUpdateScrollbarWidth();\n });\n }\n\n private disableEditor(): void {\n this.tiptapEditor.setEditable(!this.disabled);\n this.setEditorTabIndex();\n this.editorDiv.setAttribute(\n 'aria-disabled',\n this.disabled ? 'true' : 'false'\n );\n this.mentionListbox?.close();\n }\n\n private disableMentionViewElement(): void {\n this.tiptapEditor.state.doc.descendants((node, pos) => {\n if (node.type.name.startsWith(mentionPluginPrefix)) {\n const updatedAttrs = {\n ...node.attrs,\n disabled: this.disabled ? '' : null\n };\n const updatedNode = this.tiptapEditor.schema.node(\n node.type.name,\n updatedAttrs,\n node.content\n );\n const updatedTransaction = this.tiptapEditor.state.tr.replaceWith(\n pos,\n pos + node.nodeSize,\n updatedNode\n );\n this.tiptapEditor.view.dispatch(updatedTransaction);\n }\n return true;\n });\n }\n\n /**\n * Stopping the native input event propagation emitted by the contenteditable element in the Tiptap\n * since there is an issue (linked below) in ProseMirror where selecting the text and removing it\n * does not trigger the native HTMLElement input event. So using the \"update\" event emitted by the\n * Tiptap to capture it as an \"input\" customEvent in the rich text editor.\n *\n * Prose Mirror issue: https://discuss.prosemirror.net/t/how-to-handle-select-backspace-delete-cut-type-kind-of-events-handletextinput-or-handledomevents-input-doesnt-help/4844\n */\n private stopNativeInputEventPropagation(): void {\n this.tiptapEditor.view.dom.addEventListener('input', event => {\n event.stopPropagation();\n });\n }\n\n private unbindNativeInputEvent(): void {\n this.tiptapEditor.view.dom.removeEventListener('input', () => {});\n }\n\n private queueUpdateScrollbarWidth(): void {\n if (!this.$fastController.isConnected) {\n return;\n }\n if (!this.updateScrollbarWidthQueued) {\n this.updateScrollbarWidthQueued = true;\n DOM.queueUpdate(() => this.updateScrollbarWidth());\n }\n }\n\n private updateScrollbarWidth(): void {\n this.updateScrollbarWidthQueued = false;\n this.scrollbarWidth = this.tiptapEditor.view.dom.offsetWidth\n - this.tiptapEditor.view.dom.clientWidth;\n }\n\n private onResize(): void {\n this.scrollbarWidth = this.tiptapEditor.view.dom.offsetWidth\n - this.tiptapEditor.view.dom.clientWidth;\n }\n\n private getTipTapExtension(\n extensionName: string\n ): AnyExtension | undefined {\n return this.tiptapEditor.extensionManager.extensions.find(\n (extension: { name: string }) => extension.name === extensionName\n );\n }\n\n private setEditorTabIndex(): void {\n this.tiptapEditor.setOptions({\n editorProps: {\n attributes: {\n tabindex: this.disabled ? '-1' : '0'\n }\n }\n });\n }\n\n private setActiveMappingConfigs(): void {\n this.activeMappingConfigs = this.activeMentionCharacter\n ? this.getMentionExtensionConfigFromCharacter(\n this.activeMentionCharacter\n )?.mappingConfigs\n : undefined;\n }\n\n private shouldInsertSpace(): boolean {\n const { $anchor, $head } = this.tiptapEditor.view.state.selection;\n\n const isAtStartOfLine = $head.parentOffset === 0 || $anchor.parentOffset === 0;\n const nodeBeforeSelection = $anchor.pos < $head.pos ? $anchor.nodeBefore : $head.nodeBefore;\n const isHardBreakNode = nodeBeforeSelection?.type.name === HardBreak.name;\n const hasWhitespaceBeforeCurrentPosition = nodeBeforeSelection?.textContent.endsWith(' ');\n\n return (\n !isAtStartOfLine\n && !isHardBreakNode\n && !hasWhitespaceBeforeCurrentPosition\n );\n }\n\n private getMentionExtensionConfigFromCharacter(\n character: string\n ): MentionExtensionConfiguration | undefined {\n return this.getMentionExtensionConfig().find(\n config => config.character === character\n );\n }\n\n private resetEditorButtonsState(\n buttonsState: FormatButtonsState | undefined\n ): void {\n if (buttonsState?.bold && !this.tiptapEditor.isActive('bold')) {\n this.tiptapEditor.chain().focus().toggleBold().run();\n }\n if (buttonsState?.italics && !this.tiptapEditor.isActive('italic')) {\n this.tiptapEditor.chain().focus().toggleItalic().run();\n }\n }\n\n private getButtonsState(\n tiptapEditor: Editor\n ): FormatButtonsState | undefined {\n if (!this.$fastController.isConnected) {\n return undefined;\n }\n return {\n bold: tiptapEditor.isActive('bold'),\n italics: tiptapEditor.isActive('italic')\n };\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface RichTextEditor extends ARIAGlobalStatesAndProperties {}\napplyMixins(RichTextEditor, ARIAGlobalStatesAndProperties);\n\nconst nimbleRichTextEditor = RichTextEditor.compose({\n baseName: 'rich-text-editor',\n template,\n styles,\n shadowOptions: {\n delegatesFocus: true\n }\n});\n\nDesignSystem.getOrCreate()\n .withPrefix('nimble')\n .register(nimbleRichTextEditor());\nexport const richTextEditorTag = 'nimble-rich-text-editor';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/rich-text/editor/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;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C,CAAC;AACtC,MAAM,CAAC,MAAM,iBAAiB,GAAG,yBAAyB,CAAC","sourcesContent":["import { observable, attr, DOM } from '@ni/fast-element';\nimport {\n applyMixins,\n ARIAGlobalStatesAndProperties,\n DesignSystem\n} from '@ni/fast-foundation';\nimport { keyEnter, keySpace } from '@ni/fast-web-utilities';\nimport {\n findParentNode,\n isList,\n type AnyExtension,\n Editor\n} from '@tiptap/core';\n\nimport HardBreak from '@tiptap/extension-hard-break';\nimport type { SuggestionProps } from '@tiptap/suggestion';\nimport { template } from './template';\nimport { styles } from './styles';\nimport type { ToggleButton } from '../../toggle-button';\nimport {\n TipTapNodeName,\n mentionPluginPrefix,\n type MentionDetail,\n type FormatButtonsState\n} from './types';\nimport { mixinErrorPattern } from '../../patterns/error/types';\nimport { RichTextMarkdownParser } from '../models/markdown-parser';\nimport { RichTextMarkdownSerializer } from '../models/markdown-serializer';\nimport { RichText } from '../base';\nimport type { RichTextMentionListbox } from '../mention-listbox';\nimport type { MappingConfigs } from '../../rich-text-mention/base/types';\nimport type { MentionExtensionConfiguration } from '../models/mention-extension-configuration';\nimport { createTiptapEditor } from './models/create-tiptap-editor';\nimport { EditorConfiguration } from '../models/editor-configuration';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-rich-text-editor': RichTextEditor;\n }\n}\n\n/**\n * A nimble styled rich text editor\n */\nexport class RichTextEditor extends mixinErrorPattern(RichText) {\n /**\n * @internal\n */\n public editorDiv = this.createEditor();\n\n /**\n * @internal\n */\n public tiptapEditor = createTiptapEditor(\n () => {},\n () => {},\n this.editorDiv,\n [],\n this.mentionListbox,\n this.placeholder\n );\n\n /**\n * @internal\n */\n public readonly xmlSerializer = new XMLSerializer();\n\n /**\n * @internal\n */\n public richTextMarkdownSerializer = new RichTextMarkdownSerializer([]);\n\n /**\n * Whether to disable user from editing and interacting with toolbar buttons\n *\n * @public\n * HTML Attribute: disabled\n */\n @attr({ mode: 'boolean' })\n public disabled = false;\n\n /**\n * Whether to hide the footer of the rich text editor\n *\n * @public\n * HTML Attribute: footer-hidden\n */\n @attr({ attribute: 'footer-hidden', mode: 'boolean' })\n public footerHidden = false;\n\n /**\n * @public\n * HTML Attribute: placeholder\n */\n @attr\n public placeholder?: string;\n\n /**\n * True if the editor is empty or contains only whitespace, false otherwise.\n *\n * @public\n */\n public get empty(): boolean {\n // Tiptap [isEmpty](https://tiptap.dev/api/editor#is-empty) returns false even if the editor has only whitespace.\n // Get the prose mirror textContent of all the nodes with whitespace trimmed to see if it is empty\n // Mention nodes are formatted as empty text content, so if empty make sure there are no mention nodes remaining\n if (this.tiptapEditor.state.doc.textContent.trim() === '') {\n let hasMention = false;\n this.tiptapEditor.state.doc.descendants(node => {\n if (node.type.name.startsWith(mentionPluginPrefix)) {\n hasMention = true;\n }\n const continueDescent = hasMention === false;\n return continueDescent;\n });\n return !hasMention;\n }\n return false;\n }\n\n /**\n * @internal\n */\n public mentionListbox?: RichTextMentionListbox;\n\n /**\n * @internal\n */\n @observable\n public boldButton!: ToggleButton;\n\n /**\n * @internal\n */\n @observable\n public italicsButton!: ToggleButton;\n\n /**\n * @internal\n */\n @observable\n public bulletListButton!: ToggleButton;\n\n /**\n * @internal\n */\n @observable\n public numberedListButton!: ToggleButton;\n\n /**\n * The width of the vertical scrollbar, if displayed.\n * @internal\n */\n @observable\n public scrollbarWidth = -1;\n\n /**\n * @internal\n */\n @observable\n public activeMentionCharacter = '';\n\n /**\n * @internal\n */\n @observable\n public activeMappingConfigs?: MappingConfigs;\n\n /**\n * @internal\n */\n public activeMentionCommand?: SuggestionProps['command'];\n\n /**\n * @internal\n */\n public editorContainer!: HTMLDivElement;\n\n private resizeObserver?: ResizeObserver;\n private updateScrollbarWidthQueued = false;\n\n /**\n * @internal\n */\n public override connectedCallback(): void {\n super.connectedCallback();\n if (!this.editorDiv.isConnected) {\n this.editorContainer.append(this.editorDiv);\n }\n this.bindEditorTransactionEvent();\n this.bindEditorUpdateEvent();\n this.stopNativeInputEventPropagation();\n this.resizeObserver = new ResizeObserver(() => this.onResize());\n this.resizeObserver.observe(this);\n }\n\n /**\n * @internal\n */\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.unbindEditorTransactionEvent();\n this.unbindEditorUpdateEvent();\n this.unbindNativeInputEvent();\n this.resizeObserver?.disconnect();\n }\n\n /**\n * @internal\n */\n public disabledChanged(): void {\n this.disableEditor();\n this.disableMentionViewElement();\n }\n\n /**\n * Update the placeholder text and view of the editor.\n * @internal\n */\n public placeholderChanged(_prev: unknown, _next: unknown): void {\n // In TipTap v3, extension options cannot be modified after initialization.\n // We need to reinitialize the editor with the new placeholder value.\n // This workaround will be updated once the upstream issue is resolved.\n // See: https://github.com/ni/nimble/issues/2752\n const currentContent = this.getMarkdown();\n const { from, to } = this.tiptapEditor.view.state.selection;\n\n this.initializeEditor(); // Destroys and recreates entire editor\n this.setMarkdown(currentContent);\n this.tiptapEditor.commands.setTextSelection({ from, to });\n }\n\n /**\n * @internal\n */\n public ariaLabelChanged(_prev: unknown, _next: unknown): void {\n if (this.ariaLabel !== null && this.ariaLabel !== undefined) {\n this.editorDiv.setAttribute('aria-label', this.ariaLabel);\n } else {\n this.editorDiv.removeAttribute('aria-label');\n }\n }\n\n /**\n * @internal\n */\n public configurationChanged(\n prev: EditorConfiguration | undefined,\n next: EditorConfiguration\n ): void {\n const formatButtonsState = this.getButtonsState(this.tiptapEditor);\n const { from, to } = this.tiptapEditor.view.state.selection;\n if (this.isMentionExtensionConfigUnchanged(prev, next)) {\n this.setMarkdown(this.getMarkdown());\n } else {\n const mentionExtensionConfig = this.getMentionExtensionConfig();\n const currentStateMarkdown = this.getMarkdown();\n this.richTextMarkdownSerializer = new RichTextMarkdownSerializer(\n mentionExtensionConfig.map(config => config.name)\n );\n this.initializeEditor();\n this.setMarkdown(currentStateMarkdown);\n }\n this.tiptapEditor.commands.setTextSelection({ from, to });\n this.resetEditorButtonsState(formatButtonsState);\n this.setActiveMappingConfigs();\n }\n\n /**\n * @internal\n */\n public activeMentionCharacterChanged(): void {\n this.setActiveMappingConfigs();\n }\n\n /**\n * Toggle the bold mark and focus back to the editor\n * @internal\n */\n public boldButtonClick(): void {\n this.tiptapEditor.chain().focus().toggleBold().run();\n }\n\n /**\n * Toggle the bold mark and focus back to the editor\n * @internal\n */\n public boldButtonKeyDown(event: KeyboardEvent): boolean {\n if (this.keyActivatesButton(event)) {\n this.tiptapEditor.chain().focus().toggleBold().run();\n return false;\n }\n return true;\n }\n\n /**\n * Toggle the italics mark and focus back to the editor\n * @internal\n */\n public italicsButtonClick(): void {\n this.tiptapEditor.chain().focus().toggleItalic().run();\n }\n\n /**\n * Toggle the italics mark and focus back to the editor\n * @internal\n */\n public italicsButtonKeyDown(event: KeyboardEvent): boolean {\n if (this.keyActivatesButton(event)) {\n this.tiptapEditor.chain().focus().toggleItalic().run();\n return false;\n }\n return true;\n }\n\n /**\n * Toggle the unordered list node and focus back to the editor\n * @internal\n */\n public bulletListButtonClick(): void {\n this.tiptapEditor.chain().focus().toggleBulletList().run();\n }\n\n /**\n * Toggle the unordered list node and focus back to the editor\n * @internal\n */\n public bulletListButtonKeyDown(event: KeyboardEvent): boolean {\n if (this.keyActivatesButton(event)) {\n this.tiptapEditor.chain().focus().toggleBulletList().run();\n return false;\n }\n return true;\n }\n\n /**\n * Toggle the ordered list node and focus back to the editor\n * @internal\n */\n public numberedListButtonClick(): void {\n this.tiptapEditor.chain().focus().toggleOrderedList().run();\n }\n\n /**\n * Toggle the ordered list node and focus back to the editor\n * @internal\n */\n public numberedListButtonKeyDown(event: KeyboardEvent): boolean {\n if (this.keyActivatesButton(event)) {\n this.tiptapEditor.chain().focus().toggleOrderedList().run();\n return false;\n }\n return true;\n }\n\n /**\n * Inserts the mention character into the editor and focus back to the editor\n * @internal\n */\n public mentionButtonClick(character: string): void {\n this.tiptapEditor\n .chain()\n .insertContent(\n this.shouldInsertSpace() ? ` ${character}` : character\n )\n .focus()\n .run();\n }\n\n /**\n * This function load tip tap editor with provided markdown content by parsing into html\n * @public\n */\n public setMarkdown(markdown: string): void {\n const html = this.getHtmlContent(markdown);\n this.tiptapEditor.commands.setContent(html, { emitUpdate: false });\n this.disableMentionViewElement();\n }\n\n /**\n * This function returns markdown string by serializing tiptap editor document using prosemirror MarkdownSerializer\n * @public\n */\n public getMarkdown(): string {\n return this.richTextMarkdownSerializer.serializeDOMToMarkdown(\n this.tiptapEditor.state.doc\n );\n }\n\n /**\n * @internal\n */\n public stopEventPropagation(event: Event): boolean {\n // Don't bubble the 'change' event from the toggle button because\n // all the formatting button has its own 'toggle' event through 'click' and 'keydown'.\n event.stopPropagation();\n return false;\n }\n\n public getMentionedHrefs(): string[] {\n const mentionedHrefs = new Set<string>();\n this.tiptapEditor.state.doc.descendants(node => {\n if (node.type.name.startsWith(mentionPluginPrefix)) {\n mentionedHrefs.add(node.attrs.href as string);\n }\n });\n return Array.from(mentionedHrefs);\n }\n\n /**\n * @internal\n */\n public getMentionExtensionConfig(): MentionExtensionConfiguration[] {\n return this.configuration instanceof EditorConfiguration\n ? this.configuration.mentionExtensionConfig\n : [];\n }\n\n /**\n * @internal\n */\n public onMentionSelect(event: CustomEvent<MentionDetail>): void {\n if (this.activeMentionCommand) {\n this.activeMentionCommand({\n href: event.detail.href,\n label: event.detail.displayName\n });\n }\n }\n\n /**\n * @internal\n */\n public focusoutHandler(): void {\n if (!this.mentionListbox?.open) {\n return;\n }\n this.mentionListbox?.close();\n }\n\n public override createConfig(): void {\n this.validate();\n if (this.richTextValidator.isValid()) {\n if (\n this.richTextUpdateTracker.updateButtonLabel\n || this.richTextUpdateTracker.updateMappingConfigs\n || this.richTextUpdateTracker.updatePattern\n ) {\n this.configuration = new EditorConfiguration(\n this.mentionElements\n );\n }\n } else {\n this.configuration = undefined;\n }\n }\n\n private isMentionExtensionConfigUnchanged(\n prev: EditorConfiguration | undefined,\n next: EditorConfiguration | undefined\n ): boolean {\n const prevConfigCharacters = prev?.mentionExtensionConfig\n .map(config => config.character)\n .sort((a, b) => a.localeCompare(b))\n .toString();\n const nextConfigCharacters = next?.mentionExtensionConfig\n .map(config => config.character)\n .sort((a, b) => a.localeCompare(b))\n .toString();\n return prevConfigCharacters === nextConfigCharacters;\n }\n\n private createEditor(): HTMLDivElement {\n const editor = document.createElement('div');\n editor.className = 'editor';\n editor.setAttribute('aria-multiline', 'true');\n editor.setAttribute('role', 'textbox');\n editor.setAttribute('aria-disabled', 'false');\n return editor;\n }\n\n private initializeEditor(): void {\n this.unbindEditorTransactionEvent();\n this.unbindEditorUpdateEvent();\n this.unbindNativeInputEvent();\n this.tiptapEditor?.destroy();\n this.tiptapEditor = createTiptapEditor(\n character => {\n this.activeMentionCharacter = character;\n },\n command => {\n this.activeMentionCommand = command;\n },\n this.editorDiv,\n this.configuration instanceof EditorConfiguration\n ? this.configuration.mentionExtensionConfig\n : [],\n this.mentionListbox,\n this.placeholder\n );\n this.disableEditor();\n this.disableMentionViewElement();\n this.bindEditorTransactionEvent();\n this.bindEditorUpdateEvent();\n this.stopNativeInputEventPropagation();\n }\n\n /**\n * This function takes the Fragment from parseMarkdownToDOM function and return the serialized string using XMLSerializer\n */\n private getHtmlContent(markdown: string): string {\n const parseResult = RichTextMarkdownParser.parseMarkdownToDOM(\n markdown,\n this.configuration?.parserMentionConfig\n );\n return this.xmlSerializer.serializeToString(parseResult.fragment);\n }\n\n /**\n * Binding the \"transaction\" event to the editor allows continuous monitoring the events and updating the button state in response to\n * various actions such as mouse events, keyboard events, changes in the editor content etc,.\n * https://tiptap.dev/api/events#transaction\n */\n private bindEditorTransactionEvent(): void {\n this.tiptapEditor.on('transaction', () => {\n this.updateEditorButtonsState();\n });\n }\n\n private unbindEditorTransactionEvent(): void {\n this.tiptapEditor.off('transaction');\n }\n\n private updateEditorButtonsState(): void {\n if (!this.$fastController.isConnected) {\n return;\n }\n\n const { extensionManager, state } = this.tiptapEditor;\n const { extensions } = extensionManager;\n const { selection } = state;\n const parentList = findParentNode((node: { type: { name: string } }) => isList(node.type.name, extensions))(selection);\n\n this.boldButton.checked = this.tiptapEditor.isActive('bold');\n this.italicsButton.checked = this.tiptapEditor.isActive('italic');\n this.bulletListButton.checked = parentList?.node.type.name === TipTapNodeName.bulletList;\n this.numberedListButton.checked = parentList?.node.type.name === TipTapNodeName.numberedList;\n }\n\n private keyActivatesButton(event: KeyboardEvent): boolean {\n switch (event.key) {\n case keySpace:\n case keyEnter:\n return true;\n default:\n return false;\n }\n }\n\n private unbindEditorUpdateEvent(): void {\n this.tiptapEditor.off('update');\n }\n\n /**\n * input event is fired when there is a change in the content of the editor.\n *\n * https://tiptap.dev/api/events#update\n */\n private bindEditorUpdateEvent(): void {\n this.tiptapEditor.on('update', () => {\n this.$emit('input');\n this.queueUpdateScrollbarWidth();\n });\n }\n\n private disableEditor(): void {\n this.tiptapEditor.setEditable(!this.disabled);\n this.setEditorTabIndex();\n this.editorDiv.setAttribute(\n 'aria-disabled',\n this.disabled ? 'true' : 'false'\n );\n this.mentionListbox?.close();\n }\n\n private disableMentionViewElement(): void {\n this.tiptapEditor.state.doc.descendants((node, pos) => {\n if (node.type.name.startsWith(mentionPluginPrefix)) {\n const updatedAttrs = {\n ...node.attrs,\n disabled: this.disabled ? '' : null\n };\n const updatedNode = this.tiptapEditor.schema.node(\n node.type.name,\n updatedAttrs,\n node.content\n );\n const updatedTransaction = this.tiptapEditor.state.tr.replaceWith(\n pos,\n pos + node.nodeSize,\n updatedNode\n );\n this.tiptapEditor.view.dispatch(updatedTransaction);\n }\n return true;\n });\n }\n\n /**\n * Stopping the native input event propagation emitted by the contenteditable element in the Tiptap\n * since there is an issue (linked below) in ProseMirror where selecting the text and removing it\n * does not trigger the native HTMLElement input event. So using the \"update\" event emitted by the\n * Tiptap to capture it as an \"input\" customEvent in the rich text editor.\n *\n * Prose Mirror issue: https://discuss.prosemirror.net/t/how-to-handle-select-backspace-delete-cut-type-kind-of-events-handletextinput-or-handledomevents-input-doesnt-help/4844\n */\n private stopNativeInputEventPropagation(): void {\n this.tiptapEditor.view.dom.addEventListener('input', event => {\n event.stopPropagation();\n });\n }\n\n private unbindNativeInputEvent(): void {\n this.tiptapEditor.view.dom.removeEventListener('input', () => {});\n }\n\n private queueUpdateScrollbarWidth(): void {\n if (!this.$fastController.isConnected) {\n return;\n }\n if (!this.updateScrollbarWidthQueued) {\n this.updateScrollbarWidthQueued = true;\n DOM.queueUpdate(() => this.updateScrollbarWidth());\n }\n }\n\n private updateScrollbarWidth(): void {\n this.updateScrollbarWidthQueued = false;\n this.scrollbarWidth = this.tiptapEditor.view.dom.offsetWidth\n - this.tiptapEditor.view.dom.clientWidth;\n }\n\n private onResize(): void {\n this.scrollbarWidth = this.tiptapEditor.view.dom.offsetWidth\n - this.tiptapEditor.view.dom.clientWidth;\n }\n\n private getTipTapExtension(\n extensionName: string\n ): AnyExtension | undefined {\n return this.tiptapEditor.extensionManager.extensions.find(\n (extension: { name: string }) => extension.name === extensionName\n );\n }\n\n private setEditorTabIndex(): void {\n this.tiptapEditor.setOptions({\n editorProps: {\n attributes: {\n tabindex: this.disabled ? '-1' : '0'\n }\n }\n });\n }\n\n private setActiveMappingConfigs(): void {\n this.activeMappingConfigs = this.activeMentionCharacter\n ? this.getMentionExtensionConfigFromCharacter(\n this.activeMentionCharacter\n )?.mappingConfigs\n : undefined;\n }\n\n private shouldInsertSpace(): boolean {\n const { $anchor, $head } = this.tiptapEditor.view.state.selection;\n\n const isAtStartOfLine = $head.parentOffset === 0 || $anchor.parentOffset === 0;\n const nodeBeforeSelection = $anchor.pos < $head.pos ? $anchor.nodeBefore : $head.nodeBefore;\n const isHardBreakNode = nodeBeforeSelection?.type.name === HardBreak.name;\n const hasWhitespaceBeforeCurrentPosition = nodeBeforeSelection?.textContent.endsWith(' ');\n\n return (\n !isAtStartOfLine\n && !isHardBreakNode\n && !hasWhitespaceBeforeCurrentPosition\n );\n }\n\n private getMentionExtensionConfigFromCharacter(\n character: string\n ): MentionExtensionConfiguration | undefined {\n return this.getMentionExtensionConfig().find(\n config => config.character === character\n );\n }\n\n private resetEditorButtonsState(\n buttonsState: FormatButtonsState | undefined\n ): void {\n if (buttonsState?.bold && !this.tiptapEditor.isActive('bold')) {\n this.tiptapEditor.chain().focus().toggleBold().run();\n }\n if (buttonsState?.italics && !this.tiptapEditor.isActive('italic')) {\n this.tiptapEditor.chain().focus().toggleItalic().run();\n }\n }\n\n private getButtonsState(\n tiptapEditor: Editor\n ): FormatButtonsState | undefined {\n if (!this.$fastController.isConnected) {\n return undefined;\n }\n return {\n bold: tiptapEditor.isActive('bold'),\n italics: tiptapEditor.isActive('italic')\n };\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface RichTextEditor extends ARIAGlobalStatesAndProperties {}\napplyMixins(RichTextEditor, ARIAGlobalStatesAndProperties);\n\nconst nimbleRichTextEditor = RichTextEditor.compose({\n baseName: 'rich-text-editor',\n template,\n styles,\n shadowOptions: {\n delegatesFocus: true\n }\n});\n\nDesignSystem.getOrCreate()\n .withPrefix('nimble')\n .register(nimbleRichTextEditor());\nexport const richTextEditorTag = 'nimble-rich-text-editor';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/rich-text/editor/testing/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,UAAU,EACb,MAAM,wBAAwB,CAAC;AAEhC,MAAM,CAAC,MAAM,aAAa,GAAG;IACzB,IAAI,EAAE,CAAC;IACP,OAAO,EAAE,CAAC;IACV,UAAU,EAAE,CAAC;IACb,YAAY,EAAE,CAAC;CACT,CAAC;AAGX,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,EAAE,EAAE,UAAU;IACd,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,aAAa;CACd,CAAC","sourcesContent":["import {\n keyArrowDown,\n keyArrowLeft,\n keyArrowRight,\n keyArrowUp\n} from '@ni/fast-web-utilities';\n\nexport const ToolbarButton = {\n bold: 0,\n italics: 1,\n bulletList: 2,\n numberedList: 3\n} as const;\nexport type ToolbarButton = (typeof ToolbarButton)[keyof typeof ToolbarButton];\n\nexport const ArrowKeyButton = {\n up: keyArrowUp,\n down: keyArrowDown,\n left: keyArrowLeft,\n right: keyArrowRight\n} as const;\nexport type ArrowKeyButton =\n (typeof ArrowKeyButton)[keyof typeof ArrowKeyButton];\n\nexport type LabelProvider =\n | 'toggleBold'\n | 'toggleItalics'\n | 'toggleBulletedList'\n | 'toggleNumberedList';\n\nexport type ToolbarButtonKey = keyof typeof ToolbarButton;\n\nexport interface MappingConfiguration {\n key?: string;\n displayName?: string;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/rich-text/editor/testing/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,UAAU,EACb,MAAM,wBAAwB,CAAC;AAEhC,MAAM,CAAC,MAAM,aAAa,GAAG;IACzB,IAAI,EAAE,CAAC;IACP,OAAO,EAAE,CAAC;IACV,UAAU,EAAE,CAAC;IACb,YAAY,EAAE,CAAC;CACT,CAAC;AAGX,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,EAAE,EAAE,UAAU;IACd,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,aAAa;CACd,CAAC","sourcesContent":["import {\n keyArrowDown,\n keyArrowLeft,\n keyArrowRight,\n keyArrowUp\n} from '@ni/fast-web-utilities';\n\nexport const ToolbarButton = {\n bold: 0,\n italics: 1,\n bulletList: 2,\n numberedList: 3\n} as const;\nexport type ToolbarButton = (typeof ToolbarButton)[keyof typeof ToolbarButton];\n\nexport const ArrowKeyButton = {\n up: keyArrowUp,\n down: keyArrowDown,\n left: keyArrowLeft,\n right: keyArrowRight\n} as const;\nexport type ArrowKeyButton = (typeof ArrowKeyButton)[keyof typeof ArrowKeyButton];\n\nexport type LabelProvider = 'toggleBold'\n | 'toggleItalics'\n | 'toggleBulletedList'\n | 'toggleNumberedList';\n\nexport type ToolbarButtonKey = keyof typeof ToolbarButton;\n\nexport interface MappingConfiguration {\n key?: string;\n displayName?: string;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/rich-text/editor/types.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,UAAU,EAAE,YAAY;IACxB,YAAY,EAAE,aAAa;CACrB,CAAC;AAsBX,MAAM,CAAC,MAAM,mBAAmB,GAAG,iBAAiB,CAAC","sourcesContent":["import type { SuggestionProps } from '@tiptap/suggestion';\n\n/**\n * TipTap node types.\n * @public\n */\nexport const TipTapNodeName = {\n bulletList: 'bulletList',\n numberedList: 'orderedList'\n} as const;\n\nexport type TipTapNodeName =\n (typeof TipTapNodeName)[keyof typeof TipTapNodeName];\n\nexport interface MentionExtensionConfig {\n name: string;\n key: string;\n character: string;\n viewElement: string;\n}\n\nexport interface FormatButtonsState {\n bold: boolean;\n italics: boolean;\n}\n\nexport interface MentionDetail {\n href: string;\n displayName: string;\n}\n\nexport const mentionPluginPrefix = 'mention-plugin-';\n\nexport type ActiveMentionCommandEmitter = (\n command?: SuggestionProps['command']\n) => void;\n\nexport type ActiveMentionCharacterEmitter = (character: string) => void;\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/rich-text/editor/types.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,UAAU,EAAE,YAAY;IACxB,YAAY,EAAE,aAAa;CACrB,CAAC;AAqBX,MAAM,CAAC,MAAM,mBAAmB,GAAG,iBAAiB,CAAC","sourcesContent":["import type { SuggestionProps } from '@tiptap/suggestion';\n\n/**\n * TipTap node types.\n * @public\n */\nexport const TipTapNodeName = {\n bulletList: 'bulletList',\n numberedList: 'orderedList'\n} as const;\n\nexport type TipTapNodeName = (typeof TipTapNodeName)[keyof typeof TipTapNodeName];\n\nexport interface MentionExtensionConfig {\n name: string;\n key: string;\n character: string;\n viewElement: string;\n}\n\nexport interface FormatButtonsState {\n bold: boolean;\n italics: boolean;\n}\n\nexport interface MentionDetail {\n href: string;\n displayName: string;\n}\n\nexport const mentionPluginPrefix = 'mention-plugin-';\n\nexport type ActiveMentionCommandEmitter = (\n command?: SuggestionProps['command']\n) => void;\n\nexport type ActiveMentionCharacterEmitter = (character: string) => void;\n"]}
@@ -80,7 +80,7 @@ export class RichTextMentionValidator extends Validator {
80
80
  new URL(url);
81
81
  return false;
82
82
  }
83
- catch (error) {
83
+ catch (_error) {
84
84
  return true;
85
85
  }
86
86
  }
@@ -91,7 +91,7 @@ export class RichTextMentionValidator extends Validator {
91
91
  new RegExp(pattern);
92
92
  return false;
93
93
  }
94
- catch (error) {
94
+ catch (_error) {
95
95
  return true;
96
96
  }
97
97
  }