@limetech/lime-elements 37.19.0-dev.1 → 37.19.1

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 (82) hide show
  1. package/CHANGELOG.md +10 -2
  2. package/dist/{esm/icons-d4830de7.js → cjs/file-metadata-f259bba5.js} +56 -33
  3. package/dist/cjs/file-metadata-f259bba5.js.map +1 -0
  4. package/dist/cjs/index.cjs.js +0 -6
  5. package/dist/cjs/index.cjs.js.map +1 -1
  6. package/dist/cjs/limel-action-bar.cjs.entry.js +1 -1
  7. package/dist/cjs/limel-action-bar.cjs.entry.js.map +1 -1
  8. package/dist/cjs/limel-file-dropzone_2.cjs.entry.js +1 -2
  9. package/dist/cjs/limel-file-dropzone_2.cjs.entry.js.map +1 -1
  10. package/dist/cjs/limel-file.cjs.entry.js +1 -2
  11. package/dist/cjs/limel-file.cjs.entry.js.map +1 -1
  12. package/dist/cjs/limel-text-editor.cjs.entry.js +88 -4
  13. package/dist/cjs/limel-text-editor.cjs.entry.js.map +1 -1
  14. package/dist/collection/components/action-bar/action-bar.css +2 -1
  15. package/dist/collection/components/file/icon-background-colors.js +0 -11
  16. package/dist/collection/components/file/icon-background-colors.js.map +1 -1
  17. package/dist/collection/components/file/icon-fill-colors.js +0 -11
  18. package/dist/collection/components/file/icon-fill-colors.js.map +1 -1
  19. package/dist/collection/components/file/icons.js +0 -9
  20. package/dist/collection/components/file/icons.js.map +1 -1
  21. package/dist/collection/components/text-editor/menu/{default-menu.js → full-menu.js} +4 -4
  22. package/dist/collection/components/text-editor/menu/full-menu.js.map +1 -0
  23. package/dist/collection/components/text-editor/menu/menu-filter.js +83 -0
  24. package/dist/collection/components/text-editor/menu/menu-filter.js.map +1 -0
  25. package/dist/collection/components/text-editor/menu/types.js +2 -0
  26. package/dist/collection/components/text-editor/menu/types.js.map +1 -0
  27. package/dist/collection/components/text-editor/text-editor.js +5 -2
  28. package/dist/collection/components/text-editor/text-editor.js.map +1 -1
  29. package/dist/collection/interface.js +2 -3
  30. package/dist/collection/interface.js.map +1 -1
  31. package/dist/{cjs/icons-8ecb9740.js → esm/file-metadata-9a4780e2.js} +50 -36
  32. package/dist/esm/file-metadata-9a4780e2.js.map +1 -0
  33. package/dist/esm/index.js +0 -2
  34. package/dist/esm/index.js.map +1 -1
  35. package/dist/esm/limel-action-bar.entry.js +1 -1
  36. package/dist/esm/limel-action-bar.entry.js.map +1 -1
  37. package/dist/esm/limel-file-dropzone_2.entry.js +1 -2
  38. package/dist/esm/limel-file-dropzone_2.entry.js.map +1 -1
  39. package/dist/esm/limel-file.entry.js +1 -2
  40. package/dist/esm/limel-file.entry.js.map +1 -1
  41. package/dist/esm/limel-text-editor.entry.js +88 -4
  42. package/dist/esm/limel-text-editor.entry.js.map +1 -1
  43. package/dist/lime-elements/index.esm.js +1 -1
  44. package/dist/lime-elements/index.esm.js.map +1 -1
  45. package/dist/lime-elements/lime-elements.esm.js +1 -1
  46. package/dist/lime-elements/{p-7968bfa0.entry.js → p-10edf8b8.entry.js} +2 -2
  47. package/dist/lime-elements/p-10edf8b8.entry.js.map +1 -0
  48. package/dist/lime-elements/p-8bc1584b.js +2 -0
  49. package/dist/lime-elements/p-8bc1584b.js.map +1 -0
  50. package/dist/lime-elements/p-af964180.entry.js +2 -0
  51. package/dist/lime-elements/p-af964180.entry.js.map +1 -0
  52. package/dist/lime-elements/p-c9ffb1b4.entry.js +2 -0
  53. package/dist/lime-elements/{p-a1ffb47f.entry.js.map → p-c9ffb1b4.entry.js.map} +1 -1
  54. package/dist/lime-elements/p-fc91537a.entry.js +2 -0
  55. package/dist/lime-elements/{p-6c36f090.entry.js.map → p-fc91537a.entry.js.map} +1 -1
  56. package/dist/types/components/file/icon-background-colors.d.ts +0 -11
  57. package/dist/types/components/file/icon-fill-colors.d.ts +0 -11
  58. package/dist/types/components/file/icons.d.ts +0 -9
  59. package/dist/types/components/text-editor/menu/{default-menu.d.ts → full-menu.d.ts} +3 -3
  60. package/dist/types/components/text-editor/menu/menu-filter.d.ts +11 -0
  61. package/dist/types/components/text-editor/menu/types.d.ts +35 -0
  62. package/dist/types/interface.d.ts +2 -3
  63. package/package.json +1 -1
  64. package/dist/cjs/file-metadata-062e1135.js +0 -58
  65. package/dist/cjs/file-metadata-062e1135.js.map +0 -1
  66. package/dist/cjs/icons-8ecb9740.js.map +0 -1
  67. package/dist/collection/components/file/index.js +0 -4
  68. package/dist/collection/components/file/index.js.map +0 -1
  69. package/dist/collection/components/text-editor/menu/default-menu.js.map +0 -1
  70. package/dist/esm/file-metadata-f5ba6228.js +0 -53
  71. package/dist/esm/file-metadata-f5ba6228.js.map +0 -1
  72. package/dist/esm/icons-d4830de7.js.map +0 -1
  73. package/dist/lime-elements/p-35e7a41b.js +0 -2
  74. package/dist/lime-elements/p-35e7a41b.js.map +0 -1
  75. package/dist/lime-elements/p-48b9449e.js +0 -2
  76. package/dist/lime-elements/p-48b9449e.js.map +0 -1
  77. package/dist/lime-elements/p-613d6e99.entry.js +0 -2
  78. package/dist/lime-elements/p-613d6e99.entry.js.map +0 -1
  79. package/dist/lime-elements/p-6c36f090.entry.js +0 -2
  80. package/dist/lime-elements/p-7968bfa0.entry.js.map +0 -1
  81. package/dist/lime-elements/p-a1ffb47f.entry.js +0 -2
  82. package/dist/types/components/file/index.d.ts +0 -4
@@ -1 +1 @@
1
- {"file":"limel-file.entry.cjs.js","mappings":";;;;;;;;;;AAAA,MAAM,OAAO,GAAG,EAAE;;ACYlB,MAAM,iBAAiB,GAAS;EAC5B,EAAE,EAAE,IAAI;EACR,IAAI,EAAE,IAAI;EACV,SAAS,EAAE,IAAI;CAClB,CAAC;MAyCW,IAAI;;;;;IA2EL,mBAAc,GAAG,CAAC,KAA8B;MACpD,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;MAC3B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;KACrC,CAAC;IAuDM,wB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,CAAC,KAAK,CAAC;SACtD,EACD,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI;KAE5B,CAAC;GACL;EAEO,aAAa;IACjB,MAAM,OAAO,IACTJ,4BACI,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,WAAW,EAAC,iBAAiB,EAC7B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,mBAAmB,EAClC,UAAU,EAAE,IAAI,CAAC,kBAAkB,EACnC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,EAC1B,KAAK,EAAE,IAAI,CAAC,cAAc,CAAC,oBAAoB,CAAC,GAClD,CACL,CAAC;IAEF,IAAI,IAAI,CAAC,KAAK,EAAE;MACZ,OAAO,OAAO,CAAC;KAClB;IAED,QACIA,8BACI,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,IAEvC,OAAO,CACO,EACrB;GACL;EAeO,cAAc,CAAC,KAAY;IAC/B,KAAK,CAAC,eAAe,EAAE,CAAC;IACxB,KAAK,CAAC,cAAc,EAAE,CAAC;GAC1B;EAEO,cAAc,CAAC,GAAW;IAC9B,OAAOK,sBAAS,CAAC,GAAG,CAAC,QAAQ,GAAG,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;GACtD;;;;;;","names":["h","getFileIcon","getFileExtensionTitle","getFileColor","getFileBackgroundColor","translate"],"sources":["./src/components/file/file.scss?tag=limel-file&encapsulation=shadow","./src/components/file/file.tsx"],"sourcesContent":["/**\n * @prop --icon-background-color: Background color of the icon. Defaults to `--contrast-400`.\n * @prop --icon-color: Color of the icon. Defaults to `--contrast-1100`.\n */\n","import translate from '../../global/translations';\nimport { Chip } from '../chip-set/chip.types';\nimport { Languages } from '../date-picker/date.types';\nimport { Component, Event, EventEmitter, h, Prop } from '@stencil/core';\nimport {\n getFileBackgroundColor,\n getFileColor,\n getFileExtensionTitle,\n getFileIcon,\n} from '../../util/file-metadata';\nimport { FileInfo } from '../../global/shared-types/file.types';\n\nconst DEFAULT_FILE_CHIP: Chip = {\n id: null,\n text: null,\n removable: true,\n};\n\n/**\n * This component lets end-users select a *single* file from their device\n * storage. Regardless of the user's device or operating system, this component\n * opens up a file picker dialog that allows the user to choose a file.\n *\n * ## Using correct labels\n *\n * This file picker can be used in different contexts. The component's distinct\n * visual design including the upload icon hints end-users that this is not a\n * normal input field like other fields in the form for example.\n *\n * :::important\n * you need to use a descriptive `label` that clarifies the\n * functionality of the file picker, and/or provides users with clear\n * instructions.\n *\n * Depending on the context, you may need to avoid labels such as:\n * - File\n * - Document\n *\n * and instead consider using labels like:\n * - Attach a file\n * - Upload a file\n * - Choose a document\n * - Choose a file\n *\n * and similar phrases...\n * :::\n *\n * @exampleComponent limel-example-file\n * @exampleComponent limel-example-file-custom-icon\n * @exampleComponent limel-example-file-accepted-types\n * @exampleComponent limel-example-file-composite\n */\n@Component({\n tag: 'limel-file',\n shadow: true,\n styleUrl: 'file.scss',\n})\nexport class File {\n /**\n * The selected file.\n */\n @Prop()\n public value: FileInfo;\n\n /**\n * The input label.\n */\n @Prop({ reflect: true })\n public label: string;\n\n /**\n * Set to `true` to indicate that the field is required.\n */\n @Prop({ reflect: true })\n public required: boolean = false;\n\n /**\n * True if the input should be disabled\n */\n @Prop({ reflect: true })\n public disabled: boolean = false;\n\n /**\n * Set to `true` to disable adding and removing files, but allow interaction\n * with any already existing file.\n */\n @Prop({ reflect: true })\n public readonly: boolean = false;\n\n /**\n * Set to `true` to indicate that the current value of the chosen file is\n * invalid.\n */\n @Prop({ reflect: true })\n public invalid = false;\n\n /**\n * The [accepted file types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#unique_file_type_specifiers)\n */\n @Prop({ reflect: true })\n public accept: string = '*';\n\n /**\n * Defines the localisation for translations.\n */\n @Prop()\n public language: Languages = 'en';\n\n /**\n * Dispatched when a file is selected/deselected\n */\n @Event()\n private change: EventEmitter<FileInfo>;\n\n /**\n * Dispatched when clicking on a chip\n */\n @Event()\n private interact: EventEmitter<number | string>;\n\n public render() {\n return (\n <limel-file-dropzone\n disabled={this.disabled || this.readonly || !!this.value}\n accept={this.accept}\n onFilesSelected={this.handleNewFiles}\n >\n {this.renderChipset()}\n </limel-file-dropzone>\n );\n }\n\n private handleNewFiles = (event: CustomEvent<FileInfo[]>) => {\n this.preventAndStop(event);\n this.change.emit(event.detail[0]);\n };\n\n private getChipArray(): Chip[] {\n if (!this.value) {\n return [];\n }\n\n return [\n {\n ...DEFAULT_FILE_CHIP,\n text: this.value.filename,\n id: this.value.id,\n icon: {\n name: getFileIcon(this.value),\n title: getFileExtensionTitle(this.value),\n color: getFileColor(this.value),\n backgroundColor: getFileBackgroundColor(this.value),\n },\n href: this.value.href,\n },\n ];\n }\n\n private renderChipset() {\n const chipset = (\n <limel-chip-set\n disabled={this.disabled}\n readonly={this.readonly}\n invalid={this.invalid}\n label={this.label}\n leadingIcon=\"upload_to_cloud\"\n language={this.language}\n onChange={this.handleChipSetChange}\n onInteract={this.handleChipInteract}\n required={this.required}\n type=\"input\"\n value={this.getChipArray()}\n title={this.getTranslation('drag-and-drop-tips')}\n />\n );\n\n if (this.value) {\n return chipset;\n }\n\n return (\n <limel-file-input\n accept={this.accept}\n disabled={this.disabled || this.readonly}\n >\n {chipset}\n </limel-file-input>\n );\n }\n\n private handleChipSetChange = (event: CustomEvent) => {\n event.stopPropagation();\n const file = !event.detail.length ? event.detail[0] : null;\n if (!file) {\n this.change.emit(file);\n }\n };\n\n private handleChipInteract = (event: CustomEvent<Chip>) => {\n this.preventAndStop(event);\n this.interact.emit(event.detail.id);\n };\n\n private preventAndStop(event: Event) {\n event.stopPropagation();\n event.preventDefault();\n }\n\n private getTranslation(key: string) {\n return translate.get(`file.${key}`, this.language);\n }\n}\n"],"version":3}
1
+ {"file":"limel-file.entry.cjs.js","mappings":";;;;;;;;;AAAA,MAAM,OAAO,GAAG,EAAE;;ACYlB,MAAM,iBAAiB,GAAS;EAC5B,EAAE,EAAE,IAAI;EACR,IAAI,EAAE,IAAI;EACV,SAAS,EAAE,IAAI;CAClB,CAAC;MAyCW,IAAI;;;;;IA2EL,mBAAc,GAAG,CAAC,KAA8B;MACpD,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;MAC3B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;KACrC,CAAC;IAuDM,wBAAmB,GAAG,CAAC,KAAkB;MAC7C,KAAK,CAAC,eAAe,EAAE,CAAC;MACxB,MAAM,IAAI,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;MAC3D,IAAI,CAAC,IAAI,EAAE;QACP,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;OAC1B;KACJ,CAAC;IAEM,uBAAkB,GAAG,CAAC,KAAwB;MAClD,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;MAC3B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;KACvC,CAAC;;;oBA/HyB,KAAK;oBAML,KAAK;oBAOL,KAAK;mBAOf,KAAK;kBAME,GAAG;oBAME,IAAI;;EAc1B,MAAM;IACT,QACIA,iCACI,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,EACxD,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,eAAe,EAA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E,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,IAEvC,OAAO,CACO,EACrB;GACL;EAeO,cAAc,CAAC,KAAY;IAC/B,KAAK,CAAC,eAAe,EAAE,CAAC;IACxB,KAAK,CAAC,cAAc,EAAE,CAAC;GAC1B;EAEO,cAAc,CAAC,GAAW;IAC9B,OAAOK,sBAAS,CAAC,GAAG,CAAC,QAAQ,GAAG,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;GACtD;;;;;;","names":["h","getFileIcon","getFileExtensionTitle","getFileColor","getFileBackgroundColor","translate"],"sources":["./src/components/file/file.scss?tag=limel-file&encapsulation=shadow","./src/components/file/file.tsx"],"sourcesContent":["/**\n * @prop --icon-background-color: Background color of the icon. Defaults to `--contrast-400`.\n * @prop --icon-color: Color of the icon. Defaults to `--contrast-1100`.\n */\n","import translate from '../../global/translations';\nimport { Chip } from '../chip-set/chip.types';\nimport { Languages } from '../date-picker/date.types';\nimport { Component, Event, EventEmitter, h, Prop } from '@stencil/core';\nimport {\n getFileBackgroundColor,\n getFileColor,\n getFileExtensionTitle,\n getFileIcon,\n} from '../../util/file-metadata';\nimport { FileInfo } from '../../global/shared-types/file.types';\n\nconst DEFAULT_FILE_CHIP: Chip = {\n id: null,\n text: null,\n removable: true,\n};\n\n/**\n * This component lets end-users select a *single* file from their device\n * storage. Regardless of the user's device or operating system, this component\n * opens up a file picker dialog that allows the user to choose a file.\n *\n * ## Using correct labels\n *\n * This file picker can be used in different contexts. The component's distinct\n * visual design including the upload icon hints end-users that this is not a\n * normal input field like other fields in the form for example.\n *\n * :::important\n * you need to use a descriptive `label` that clarifies the\n * functionality of the file picker, and/or provides users with clear\n * instructions.\n *\n * Depending on the context, you may need to avoid labels such as:\n * - File\n * - Document\n *\n * and instead consider using labels like:\n * - Attach a file\n * - Upload a file\n * - Choose a document\n * - Choose a file\n *\n * and similar phrases...\n * :::\n *\n * @exampleComponent limel-example-file\n * @exampleComponent limel-example-file-custom-icon\n * @exampleComponent limel-example-file-accepted-types\n * @exampleComponent limel-example-file-composite\n */\n@Component({\n tag: 'limel-file',\n shadow: true,\n styleUrl: 'file.scss',\n})\nexport class File {\n /**\n * The selected file.\n */\n @Prop()\n public value: FileInfo;\n\n /**\n * The input label.\n */\n @Prop({ reflect: true })\n public label: string;\n\n /**\n * Set to `true` to indicate that the field is required.\n */\n @Prop({ reflect: true })\n public required: boolean = false;\n\n /**\n * True if the input should be disabled\n */\n @Prop({ reflect: true })\n public disabled: boolean = false;\n\n /**\n * Set to `true` to disable adding and removing files, but allow interaction\n * with any already existing file.\n */\n @Prop({ reflect: true })\n public readonly: boolean = false;\n\n /**\n * Set to `true` to indicate that the current value of the chosen file is\n * invalid.\n */\n @Prop({ reflect: true })\n public invalid = false;\n\n /**\n * The [accepted file types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#unique_file_type_specifiers)\n */\n @Prop({ reflect: true })\n public accept: string = '*';\n\n /**\n * Defines the localisation for translations.\n */\n @Prop()\n public language: Languages = 'en';\n\n /**\n * Dispatched when a file is selected/deselected\n */\n @Event()\n private change: EventEmitter<FileInfo>;\n\n /**\n * Dispatched when clicking on a chip\n */\n @Event()\n private interact: EventEmitter<number | string>;\n\n public render() {\n return (\n <limel-file-dropzone\n disabled={this.disabled || this.readonly || !!this.value}\n accept={this.accept}\n onFilesSelected={this.handleNewFiles}\n >\n {this.renderChipset()}\n </limel-file-dropzone>\n );\n }\n\n private handleNewFiles = (event: CustomEvent<FileInfo[]>) => {\n this.preventAndStop(event);\n this.change.emit(event.detail[0]);\n };\n\n private getChipArray(): Chip[] {\n if (!this.value) {\n return [];\n }\n\n return [\n {\n ...DEFAULT_FILE_CHIP,\n text: this.value.filename,\n id: this.value.id,\n icon: {\n name: getFileIcon(this.value),\n title: getFileExtensionTitle(this.value),\n color: getFileColor(this.value),\n backgroundColor: getFileBackgroundColor(this.value),\n },\n href: this.value.href,\n },\n ];\n }\n\n private renderChipset() {\n const chipset = (\n <limel-chip-set\n disabled={this.disabled}\n readonly={this.readonly}\n invalid={this.invalid}\n label={this.label}\n leadingIcon=\"upload_to_cloud\"\n language={this.language}\n onChange={this.handleChipSetChange}\n onInteract={this.handleChipInteract}\n required={this.required}\n type=\"input\"\n value={this.getChipArray()}\n title={this.getTranslation('drag-and-drop-tips')}\n />\n );\n\n if (this.value) {\n return chipset;\n }\n\n return (\n <limel-file-input\n accept={this.accept}\n disabled={this.disabled || this.readonly}\n >\n {chipset}\n </limel-file-input>\n );\n }\n\n private handleChipSetChange = (event: CustomEvent) => {\n event.stopPropagation();\n const file = !event.detail.length ? event.detail[0] : null;\n if (!file) {\n this.change.emit(file);\n }\n };\n\n private handleChipInteract = (event: CustomEvent<Chip>) => {\n this.preventAndStop(event);\n this.interact.emit(event.detail.id);\n };\n\n private preventAndStop(event: Event) {\n event.stopPropagation();\n event.preventDefault();\n }\n\n private getTranslation(key: string) {\n return translate.get(`file.${key}`, this.language);\n }\n}\n"],"version":3}
@@ -15910,17 +15910,17 @@ function exampleSetup(options) {
15910
15910
  }
15911
15911
 
15912
15912
  /**
15913
- * Creates the default menu for the text editor
15913
+ * Creates the full menu for the text editor
15914
15914
  * based on the default menu already in prosemirror-example-setup
15915
15915
  * @param schema - the schema to use for the menu
15916
15916
  *
15917
15917
  * @returns the default menu for the text editor
15918
15918
  */
15919
- const buildDefaultMenu = (schema) => {
15919
+ const buildFullMenu = (schema) => {
15920
15920
  const menuItems = buildMenuItems(schema);
15921
15921
  const { inlineMenu, insertHorizontalRule } = menuItems;
15922
15922
  const typeMenu = getNewMenu(menuItems.typeMenu);
15923
- const newHorizontalRule = new MenuItem(Object.assign(Object.assign({}, insertHorizontalRule.spec), { label: 'hr' }));
15923
+ const newHorizontalRule = new MenuItem(Object.assign(Object.assign({}, insertHorizontalRule.spec), { title: 'hr', label: 'hr' }));
15924
15924
  const historyButtons = menuItems.fullMenu[2];
15925
15925
  const blockMenu = getBlockMenu(menuItems.blockMenu);
15926
15926
  return [
@@ -15942,6 +15942,88 @@ const getBlockMenu = (blockMenu) => {
15942
15942
  return [...blockMenu[0].slice(0, 5)];
15943
15943
  };
15944
15944
 
15945
+ /**
15946
+ * The available items for the editor toolbar
15947
+ * The values must match the titles of the menuItem
15948
+ *
15949
+ * {@link MenuItem.spec}
15950
+ */
15951
+ const allItems = {
15952
+ strong: 'Toggle strong style',
15953
+ emphasis: 'Toggle emphasis',
15954
+ code: 'Toggle code font',
15955
+ link: 'Add or remove link',
15956
+ 'horizontal rule': 'hr',
15957
+ paragraph: 'Change to paragraph',
15958
+ 'code block': 'Change to code block',
15959
+ 'heading 1': 'Change to heading 1',
15960
+ 'heading 2': 'Change to heading 2',
15961
+ 'heading 3': 'Change to heading 3',
15962
+ 'heading 4': 'Change to heading 4',
15963
+ 'heading 5': 'Change to heading 5',
15964
+ 'heading 6': 'Change to heading 6',
15965
+ undo: 'Undo last change',
15966
+ redo: 'Redo last undone change',
15967
+ 'bullet list': 'Wrap in bullet list',
15968
+ 'ordered list': 'Wrap in ordered list',
15969
+ 'block quote': 'Wrap in block quote',
15970
+ 'join above': 'Join with above block',
15971
+ 'lift out': 'Lift out of enclosing block',
15972
+ };
15973
+ const defaultItems = [
15974
+ 'strong',
15975
+ 'emphasis',
15976
+ 'link',
15977
+ 'heading 1',
15978
+ 'heading 2',
15979
+ 'heading 3',
15980
+ 'heading 4',
15981
+ 'heading 5',
15982
+ 'heading 6',
15983
+ 'block quote',
15984
+ 'bullet list',
15985
+ 'ordered list',
15986
+ ];
15987
+ /**
15988
+ * Filters the full menu recursively based on the items provided
15989
+ *
15990
+ * @param menu - The menu to filter
15991
+ * @param items - The menu items to display. If undefined, all items will be displayed
15992
+ * @returns The filtered menu
15993
+ */
15994
+ const getFilteredMenu = (menu, items) => {
15995
+ let menuItems = defaultItems.map((item) => allItems[item]);
15996
+ if (items !== undefined) {
15997
+ menuItems = menuItems.concat(items.map((item) => allItems[item]));
15998
+ }
15999
+ return menu
16000
+ .filter((item) => {
16001
+ if (isMenuItem(item)) {
16002
+ return Object.values(menuItems).includes(item.spec.title);
16003
+ }
16004
+ else if (isDropdown(item)) {
16005
+ return true;
16006
+ }
16007
+ return false;
16008
+ })
16009
+ .filter(Boolean)
16010
+ .map(createFilteredDropdown(items));
16011
+ };
16012
+ const createFilteredDropdown = (items) => (item) => {
16013
+ if (isDropdown(item)) {
16014
+ return new Dropdown(getFilteredMenu(item.content, items), {
16015
+ label: item.label,
16016
+ });
16017
+ }
16018
+ return item;
16019
+ };
16020
+ const isMenuItem = (item) => {
16021
+ return item.spec !== undefined;
16022
+ };
16023
+ const isDropdown = (item) => {
16024
+ return item.content !== undefined;
16025
+ };
16026
+
15945
16027
  const textEditorCss = "@charset \"UTF-8\";:host{--mdc-theme-primary:var(\n --lime-primary-color,\n rgb(var(--color-teal-default))\n );--mdc-theme-secondary:var(\n --lime-secondary-color,\n rgb(var(--contrast-1100))\n );--mdc-theme-on-primary:var(\n --lime-on-primary-color,\n rgb(var(--contrast-100))\n );--mdc-theme-on-secondary:var(\n --lime-on-secondary-color,\n rgb(var(--contrast-100))\n );--mdc-theme-text-disabled-on-background:var(\n --lime-text-disabled-on-background-color,\n rgba(var(--contrast-1700), 0.38)\n );--mdc-theme-text-primary-on-background:var(\n --lime-text-primary-on-background-color,\n rgba(var(--contrast-1700), 0.87)\n );--mdc-theme-text-secondary-on-background:var(\n --lime-text-secondary-on-background-color,\n rgba(var(--contrast-1700), 0.54)\n );--mdc-theme-error:var(\n --lime-error-background-color,\n rgb(var(--color-red-dark))\n );--lime-error-text-color:rgb(var(--color-red-darker));--mdc-theme-surface:var(\n --lime-surface-background-color,\n rgb(var(--contrast-100))\n );--mdc-theme-on-surface:var(\n --lime-on-surface-color,\n rgb(var(--contrast-1500))\n )}:host(limel-text-editor){isolation:isolate;display:block}*{box-sizing:border-box}.ProseMirror-menubar-wrapper{transition:border 0.2s ease;display:grid;grid-template-rows:auto 1fr;border-radius:0.25rem;border:1px solid;border-color:rgba(var(--contrast-700), 0.65)}.ProseMirror-menubar-wrapper:hover{border-color:rgba(var(--contrast-700), 1)}.ProseMirror-menubar-wrapper:focus-within{border-color:var(--mdc-theme-primary)}.ProseMirror-textblock-dropdown{min-width:3em}.ProseMirror-tooltip .ProseMirror-menu{width:-webkit-fit-content;width:fit-content;white-space:pre}.ProseMirror{position:relative;word-wrap:break-word;white-space:pre-wrap;white-space:break-spaces;-webkit-font-variant-ligatures:none;font-variant-ligatures:none;font-feature-settings:\"liga\" 0;border-bottom-left-radius:0.5rem;border-bottom-right-radius:0.5rem;padding:0.5rem 1rem;background-color:rgb(var(--contrast-100))}.ProseMirror [draggable][contenteditable=false]{user-select:text}.ProseMirror:focus-visible{outline:none}.ProseMirror-hideselection{caret-color:transparent}.ProseMirror-hideselection *::selection{background:transparent}.ProseMirror-hideselection *::-moz-selection{background:transparent}.ProseMirror-selectednode{outline:0.125rem solid rgb(var(--color-sky-light))}li.ProseMirror-selectednode{outline:none}li.ProseMirror-selectednode:after{content:\"\";position:absolute;left:-2rem;right:-0.125rem;top:-0.125rem;bottom:-0.125rem;border:0.125rem solid rgb(var(--color-sky-light));pointer-events:none}img.ProseMirror-separator{display:inline !important;border:none !important;margin:0 !important}div#editor .ProseMirror-menubar{position:sticky !important;z-index:1;top:0}div#editor .ProseMirror-menubar[style*=\"position: fixed\"]{box-shadow:0 0.25rem 0.5rem -0.5rem rgb(var(--color-black), 0.8)}.ProseMirror-menubar{position:relative;z-index:1;display:flex;flex-wrap:wrap;gap:0.25rem;align-items:center;padding:0.125rem;background-color:rgb(var(--contrast-100));border-top-left-radius:0.5rem;border-top-right-radius:0.5rem}.ProseMirror-menuitem{position:relative;flex-shrink:0;display:flex;align-items:center;justify-content:center;white-space:nowrap;line-height:1;height:1.5rem;min-width:1.5rem;border-radius:0.25rem;color:rgb(var(--contrast-1100));font-size:0.8125rem}.ProseMirror-menuitem:not(:has(.ProseMirror-menu-disabled)){transition:color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-out;cursor:pointer;color:var(--mdc-theme-on-surface);background-color:transparent}.ProseMirror-menuitem:not(:has(.ProseMirror-menu-disabled)):hover{color:var(--mdc-theme-on-surface);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}.ProseMirror-menuitem:not(:has(.ProseMirror-menu-disabled)):active{box-shadow:var(--button-shadow-pressed);transform:translate3d(0, 0.08rem, 0)}.ProseMirror-menuitem:has(.ProseMirror-menu-active){box-shadow:var(--button-shadow-inset);color:var(--mdc-theme-primary)}.ProseMirror-menuitem:has(.ProseMirror-menu-active) svg{color:var(--mdc-theme-primary)}.ProseMirror-menuitem:has(.ProseMirror-menu-dropdown-menu){box-shadow:var(--button-shadow-inset)}.ProseMirror-menuitem svg{fill:currentColor;height:1rem;color:rgb(var(--contrast-1100))}.ProseMirror-menuseparator{border-radius:1rem;background-color:rgb(var(--contrast-600));width:0.125rem;height:1rem}.ProseMirror-menu-dropdown{position:relative;display:flex;align-items:center;gap:0.5rem;padding:0 0.5rem}.ProseMirror-menu-dropdown:after{content:\"\";border-left:0.25rem solid transparent;border-right:0.25rem solid transparent;border-top:0.25rem solid currentColor}.ProseMirror-menu-dropdown-menu,.ProseMirror-menu-submenu{box-shadow:0px 5px 5px -3px rgba(0, 0, 0, 0.2), 0px 8px 10px 1px rgba(0, 0, 0, 0.14), 0px 3px 14px 2px rgba(0, 0, 0, 0.12)}.ProseMirror-menu-dropdown-menu{position:absolute;top:100%;background:rgb(var(--contrast-100));border-radius:0.25rem;padding:0.125rem}.ProseMirror-menu-submenu{position:absolute;background:rgb(var(--contrast-100));border-radius:0.25rem;padding:0.125rem;display:none;min-width:4em;left:100%;top:-0.75rem}.ProseMirror-menu-dropdown-item{transition:background-color 0.2s ease;cursor:pointer;border-radius:0.375rem;min-height:2.5rem;display:flex;align-items:center;width:100%}.ProseMirror-menu-dropdown-item>div{padding:0 1rem;width:100%}.ProseMirror-menu-dropdown-item:not(:has(.ProseMirror-menu-disabled)):hover{background-color:rgb(var(--contrast-300))}.ProseMirror-menu-submenu-wrap{position:relative;margin-right:-0.25rem}.ProseMirror-menu-submenu-wrap:hover .ProseMirror-menu-submenu{display:block}.ProseMirror-menu-submenu-label{position:relative;display:flex;align-items:center;justify-content:space-between;gap:0.5rem}.ProseMirror-menu-submenu-label:after{content:\"\";border-top:0.25rem solid transparent;border-bottom:0.25rem solid transparent;border-left:0.25rem solid currentColor}.ProseMirror-menu-disabled{opacity:0.3;cursor:default}.ProseMirror-menu-submenu-wrap-active .ProseMirror-menu-submenu{display:block}blockquote{position:relative;font-weight:100;font-size:0.875rem;max-width:100%;line-height:1.4;margin:0;padding:0.5rem 1.25rem;border-radius:0.05rem 0.75rem;background-color:rgb(var(--contrast-300))}blockquote:before,blockquote:after{position:absolute;font-size:2.75rem;opacity:0.4}blockquote:before{content:\"“\";left:0;top:-0.75rem}blockquote:after{content:\"”\";right:0;bottom:-2rem}:host(limel-markdown.truncate-paragraphs) p{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}p,li{font-size:0.875rem;word-break:break-word;hyphens:auto;-webkit-hyphens:auto}a{word-break:break-all}p{margin-top:0;margin-bottom:0.5rem}p:only-child{margin-bottom:0}a{transition:color 0.2s ease;color:var(--markdown-hyperlink-color, rgb(var(--color-blue-dark)));text-decoration:none}a:hover{color:var(--markdown-hyperlink-color--hovered, rgb(var(--color-blue-default)))}hr{margin:1.75rem 0 2rem 0;border-width:0;border-top:1px solid rgb(var(--contrast-500))}dl{display:grid;grid-template-columns:1fr 2fr;grid-template-rows:1fr;margin-bottom:2rem;border:1px solid rgb(var(--contrast-400));border-radius:0.375rem;background-color:rgb(var(--contrast-200))}dl dt,dl dd{padding:0.375rem 0.5rem;font-size:0.875rem;margin:0}dl dt:nth-of-type(even),dl dd:nth-of-type(even){background-color:rgb(var(--contrast-300))}dl dt:first-child{border-top-left-radius:0.375rem}dl dt:last-child{border-bottom-left-radius:0.375rem}dl dd:first-child{border-top-right-radius:0.375rem}dl dd:last-child{border-bottom-right-radius:0.375rem}h1{font-size:1.5rem}h2{font-size:1.25rem}h3{font-size:1.125rem}h4{font-size:1rem}h5{font-size:0.875rem}h6{font-size:0.75rem}h1,h2{margin-top:0.5rem;margin-bottom:0.5rem;letter-spacing:-0.03125rem;font-weight:500}h3,h4{margin-top:0.75rem;margin-bottom:0.25rem;font-weight:600}h5,h6{margin-top:0.5rem;margin-bottom:0.125rem;font-weight:600}h1,h2,h3,h4,h5,h6{word-break:break-word;hyphens:auto;-webkit-hyphens:auto}:not([contenteditable=true]) h1,:not([contenteditable=true]) h2,:not([contenteditable=true]) h3,:not([contenteditable=true]) h4,:not([contenteditable=true]) h5,:not([contenteditable=true]) h6{text-wrap:balance}[contenteditable=true] h1,[contenteditable=true] h2,[contenteditable=true] h3,[contenteditable=true] h4,[contenteditable=true] h5,[contenteditable=true] h6{text-wrap:initial}ul{list-style:none}ul li{position:relative;margin-left:0.75rem}ul li:before{content:\"\";position:absolute;left:-0.5rem;top:0.5rem;width:0.25rem;height:0.25rem;border-radius:50%;background-color:rgb(var(--contrast-700));display:block}ol{margin-top:0.25rem;padding-left:1rem}ul{margin-top:0.25rem;padding-left:0}ul ul,ul ol,ol ol,ol ul{margin-left:0}li{margin-bottom:0.25rem}code{font-family:ui-monospace, \"Cascadia Code\", \"Source Code Pro\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace;font-size:0.8125rem;letter-spacing:-0.0125rem;color:rgb(var(--contrast-1300));-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;display:inline-block;border-radius:0.25rem;padding:0.03125rem 0.25rem;background-color:rgb(var(--contrast-600))}pre>code{display:block;margin:0.5rem 0;padding:0.5rem 0.75rem;overflow:auto;white-space:pre-wrap}:host(limel-markdown:not(.no-table-styles)) table{table-layout:auto;min-width:100%;border-collapse:collapse;border-spacing:0;background:transparent;margin:0.75rem 0;border:1px solid rgb(var(--contrast-400))}:host(limel-markdown:not(.no-table-styles)) th,:host(limel-markdown:not(.no-table-styles)) td{text-align:left;vertical-align:top;transition:background-color 0.2s ease;font-size:0.875rem}:host(limel-markdown:not(.no-table-styles)) td{padding:0.5rem 0.375rem 0.75rem 0.375rem}:host(limel-markdown:not(.no-table-styles)) tr th{background-color:rgb(var(--contrast-400));padding:0.25rem 0.375rem;font-weight:normal}:host(limel-markdown:not(.no-table-styles)) tr th:only-child{text-align:center}:host(limel-markdown:not(.no-table-styles)) tbody tr:nth-child(odd) td{background-color:rgb(var(--contrast-200))}:host(limel-markdown:not(.no-table-styles)) tbody tr:hover td{background-color:rgb(var(--contrast-300))}";
15946
16028
 
15947
16029
  const TextEditor = class {
@@ -15959,7 +16041,9 @@ const TextEditor = class {
15959
16041
  nodes: addListNodes(schema.spec.nodes, 'paragraph block*', 'block'),
15960
16042
  marks: schema.spec.marks,
15961
16043
  });
15962
- const menu = buildDefaultMenu(mySchema);
16044
+ const menu = buildFullMenu(mySchema)
16045
+ .map((items) => getFilteredMenu(items, undefined))
16046
+ .filter((items) => items.length);
15963
16047
  this.view = new EditorView(this.host.shadowRoot.querySelector('#editor'), {
15964
16048
  state: EditorState.create({
15965
16049
  doc: DOMParser.fromSchema(mySchema).parse(this.host.shadowRoot.querySelector('#editor')),