@limetech/lime-elements 38.2.3 → 38.3.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 (145) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/cjs/files-c08d24d4.js +44 -0
  3. package/dist/cjs/files-c08d24d4.js.map +1 -0
  4. package/dist/cjs/index.cjs.js +9 -0
  5. package/dist/cjs/index.cjs.js.map +1 -1
  6. package/dist/cjs/limel-action-bar_2.cjs.entry.js +1 -1
  7. package/dist/cjs/limel-callout.cjs.entry.js +1 -1
  8. package/dist/cjs/limel-chart.cjs.entry.js +1 -1
  9. package/dist/cjs/limel-chip_2.cjs.entry.js +1 -1
  10. package/dist/cjs/limel-file-dropzone_2.cjs.entry.js +8 -43
  11. package/dist/cjs/limel-file-dropzone_2.cjs.entry.js.map +1 -1
  12. package/dist/cjs/limel-file-viewer.cjs.entry.js +1 -1
  13. package/dist/cjs/limel-file.cjs.entry.js +1 -1
  14. package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +1 -1
  15. package/dist/cjs/limel-linear-progress.cjs.entry.js +1 -1
  16. package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +404 -19
  17. package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js.map +1 -1
  18. package/dist/cjs/limel-snackbar.cjs.entry.js +1 -1
  19. package/dist/cjs/limel-text-editor.cjs.entry.js +11 -1
  20. package/dist/cjs/limel-text-editor.cjs.entry.js.map +1 -1
  21. package/dist/cjs/text-editor.types-5e5567e2.js +13 -0
  22. package/dist/cjs/text-editor.types-5e5567e2.js.map +1 -0
  23. package/dist/cjs/{translations-0d53f9bc.js → translations-b5da5dcd.js} +55 -4
  24. package/dist/cjs/translations-b5da5dcd.js.map +1 -0
  25. package/dist/collection/components/text-editor/prosemirror-adapter/plugins/image/inserter.js +195 -0
  26. package/dist/collection/components/text-editor/prosemirror-adapter/plugins/image/inserter.js.map +1 -0
  27. package/dist/collection/components/text-editor/prosemirror-adapter/plugins/image/node.js +128 -0
  28. package/dist/collection/components/text-editor/prosemirror-adapter/plugins/image/node.js.map +1 -0
  29. package/dist/collection/components/text-editor/prosemirror-adapter/plugins/image/view.js +139 -0
  30. package/dist/collection/components/text-editor/prosemirror-adapter/plugins/image/view.js.map +1 -0
  31. package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.css +187 -0
  32. package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.js +60 -3
  33. package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.js.map +1 -1
  34. package/dist/collection/components/text-editor/text-editor.js +63 -1
  35. package/dist/collection/components/text-editor/text-editor.js.map +1 -1
  36. package/dist/collection/components/text-editor/text-editor.types.js +9 -1
  37. package/dist/collection/components/text-editor/text-editor.types.js.map +1 -1
  38. package/dist/collection/components/text-editor/utils/html-converter.js +7 -4
  39. package/dist/collection/components/text-editor/utils/html-converter.js.map +1 -1
  40. package/dist/collection/components/text-editor/utils/markdown-converter.js +8 -8
  41. package/dist/collection/components/text-editor/utils/markdown-converter.js.map +1 -1
  42. package/dist/collection/global/translations.js +9 -2
  43. package/dist/collection/global/translations.js.map +1 -1
  44. package/dist/collection/translations/da.js +6 -0
  45. package/dist/collection/translations/da.js.map +1 -1
  46. package/dist/collection/translations/de.js +5 -0
  47. package/dist/collection/translations/de.js.map +1 -1
  48. package/dist/collection/translations/en.js +5 -0
  49. package/dist/collection/translations/en.js.map +1 -1
  50. package/dist/collection/translations/fi.js +7 -1
  51. package/dist/collection/translations/fi.js.map +1 -1
  52. package/dist/collection/translations/fr.js +5 -0
  53. package/dist/collection/translations/fr.js.map +1 -1
  54. package/dist/collection/translations/nl.js +6 -0
  55. package/dist/collection/translations/nl.js.map +1 -1
  56. package/dist/collection/translations/no.js +6 -0
  57. package/dist/collection/translations/no.js.map +1 -1
  58. package/dist/collection/translations/sv.js +5 -0
  59. package/dist/collection/translations/sv.js.map +1 -1
  60. package/dist/esm/files-2be62a61.js +41 -0
  61. package/dist/esm/files-2be62a61.js.map +1 -0
  62. package/dist/esm/index.js +2 -0
  63. package/dist/esm/index.js.map +1 -1
  64. package/dist/esm/limel-action-bar_2.entry.js +1 -1
  65. package/dist/esm/limel-callout.entry.js +1 -1
  66. package/dist/esm/limel-chart.entry.js +1 -1
  67. package/dist/esm/limel-chip_2.entry.js +1 -1
  68. package/dist/esm/limel-file-dropzone_2.entry.js +2 -37
  69. package/dist/esm/limel-file-dropzone_2.entry.js.map +1 -1
  70. package/dist/esm/limel-file-viewer.entry.js +1 -1
  71. package/dist/esm/limel-file.entry.js +1 -1
  72. package/dist/esm/limel-flatpickr-adapter.entry.js +1 -1
  73. package/dist/esm/limel-linear-progress.entry.js +1 -1
  74. package/dist/esm/limel-prosemirror-adapter.entry.js +404 -19
  75. package/dist/esm/limel-prosemirror-adapter.entry.js.map +1 -1
  76. package/dist/esm/limel-snackbar.entry.js +1 -1
  77. package/dist/esm/limel-text-editor.entry.js +11 -1
  78. package/dist/esm/limel-text-editor.entry.js.map +1 -1
  79. package/dist/esm/text-editor.types-e82469d1.js +13 -0
  80. package/dist/esm/text-editor.types-e82469d1.js.map +1 -0
  81. package/dist/esm/{translations-7ad188e0.js → translations-8b7272f2.js} +55 -4
  82. package/dist/esm/translations-8b7272f2.js.map +1 -0
  83. package/dist/lime-elements/index.esm.js +1 -1
  84. package/dist/lime-elements/index.esm.js.map +1 -1
  85. package/dist/lime-elements/lime-elements.esm.js +1 -1
  86. package/dist/lime-elements/{p-fc7f9e93.entry.js → p-24a46d85.entry.js} +2 -2
  87. package/dist/lime-elements/{p-54b4a06b.entry.js → p-2ca8f253.entry.js} +2 -2
  88. package/dist/lime-elements/{p-0468e34c.entry.js → p-3479aa66.entry.js} +2 -2
  89. package/dist/lime-elements/{p-b78a9a5c.entry.js → p-54710fb8.entry.js} +2 -2
  90. package/dist/lime-elements/{p-180675a5.entry.js → p-5ac99c32.entry.js} +2 -2
  91. package/dist/lime-elements/{p-7fdab6b0.entry.js → p-62a21e92.entry.js} +2 -2
  92. package/dist/lime-elements/p-62a21e92.entry.js.map +1 -0
  93. package/dist/lime-elements/{p-28c6b698.entry.js → p-8c15a058.entry.js} +2 -2
  94. package/dist/lime-elements/p-9ca516ed.js +2 -0
  95. package/dist/lime-elements/p-9ca516ed.js.map +1 -0
  96. package/dist/lime-elements/{p-fefef194.entry.js → p-ae417884.entry.js} +2 -2
  97. package/dist/lime-elements/{p-ffe954d4.entry.js → p-bda61285.entry.js} +2 -2
  98. package/dist/lime-elements/{p-8ada443f.entry.js → p-c348740c.entry.js} +2 -2
  99. package/dist/lime-elements/p-dbcde7db.entry.js +2 -0
  100. package/dist/lime-elements/p-dbcde7db.entry.js.map +1 -0
  101. package/dist/lime-elements/p-dc3d2ee1.js +2 -0
  102. package/dist/lime-elements/p-dc3d2ee1.js.map +1 -0
  103. package/dist/lime-elements/p-e3d7aba7.js +2 -0
  104. package/dist/lime-elements/p-e3d7aba7.js.map +1 -0
  105. package/dist/lime-elements/p-f641bcb0.entry.js +2 -0
  106. package/dist/lime-elements/p-f641bcb0.entry.js.map +1 -0
  107. package/dist/types/components/text-editor/prosemirror-adapter/plugins/image/inserter.d.ts +15 -0
  108. package/dist/types/components/text-editor/prosemirror-adapter/plugins/image/node.d.ts +14 -0
  109. package/dist/types/components/text-editor/prosemirror-adapter/plugins/image/view.d.ts +4 -0
  110. package/dist/types/components/text-editor/prosemirror-adapter/prosemirror-adapter.d.ts +14 -0
  111. package/dist/types/components/text-editor/text-editor.d.ts +18 -0
  112. package/dist/types/components/text-editor/text-editor.types.d.ts +51 -0
  113. package/dist/types/components/text-editor/utils/markdown-converter.d.ts +2 -1
  114. package/dist/types/components.d.ts +34 -2
  115. package/dist/types/global/translations.d.ts +1 -1
  116. package/dist/types/translations/da.d.ts +6 -0
  117. package/dist/types/translations/de.d.ts +5 -0
  118. package/dist/types/translations/en.d.ts +5 -0
  119. package/dist/types/translations/fi.d.ts +7 -1
  120. package/dist/types/translations/fr.d.ts +5 -0
  121. package/dist/types/translations/nl.d.ts +6 -0
  122. package/dist/types/translations/no.d.ts +6 -0
  123. package/dist/types/translations/sv.d.ts +5 -0
  124. package/package.json +1 -1
  125. package/dist/cjs/translations-0d53f9bc.js.map +0 -1
  126. package/dist/collection/components/text-editor/prosemirror-adapter/plugins/image-remover-plugin.js +0 -78
  127. package/dist/collection/components/text-editor/prosemirror-adapter/plugins/image-remover-plugin.js.map +0 -1
  128. package/dist/esm/translations-7ad188e0.js.map +0 -1
  129. package/dist/lime-elements/p-7fdab6b0.entry.js.map +0 -1
  130. package/dist/lime-elements/p-ad9801f8.entry.js +0 -2
  131. package/dist/lime-elements/p-ad9801f8.entry.js.map +0 -1
  132. package/dist/lime-elements/p-e5545944.entry.js +0 -2
  133. package/dist/lime-elements/p-e5545944.entry.js.map +0 -1
  134. package/dist/lime-elements/p-efd753ba.js +0 -2
  135. package/dist/lime-elements/p-efd753ba.js.map +0 -1
  136. package/dist/types/components/text-editor/prosemirror-adapter/plugins/image-remover-plugin.d.ts +0 -4
  137. /package/dist/lime-elements/{p-fc7f9e93.entry.js.map → p-24a46d85.entry.js.map} +0 -0
  138. /package/dist/lime-elements/{p-54b4a06b.entry.js.map → p-2ca8f253.entry.js.map} +0 -0
  139. /package/dist/lime-elements/{p-0468e34c.entry.js.map → p-3479aa66.entry.js.map} +0 -0
  140. /package/dist/lime-elements/{p-b78a9a5c.entry.js.map → p-54710fb8.entry.js.map} +0 -0
  141. /package/dist/lime-elements/{p-180675a5.entry.js.map → p-5ac99c32.entry.js.map} +0 -0
  142. /package/dist/lime-elements/{p-28c6b698.entry.js.map → p-8c15a058.entry.js.map} +0 -0
  143. /package/dist/lime-elements/{p-fefef194.entry.js.map → p-ae417884.entry.js.map} +0 -0
  144. /package/dist/lime-elements/{p-ffe954d4.entry.js.map → p-bda61285.entry.js.map} +0 -0
  145. /package/dist/lime-elements/{p-8ada443f.entry.js.map → p-c348740c.entry.js.map} +0 -0
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d1052409.js');
6
- const translations = require('./translations-0d53f9bc.js');
6
+ const translations = require('./translations-b5da5dcd.js');
7
7
  const randomString = require('./random-string-e8ad4419.js');
8
8
 
9
9
  /**
@@ -11,6 +11,8 @@ const TextEditor = class {
11
11
  constructor(hostRef) {
12
12
  index.registerInstance(this, hostRef);
13
13
  this.change = index.createEvent(this, "change", 7);
14
+ this.imagePasted = index.createEvent(this, "imagePasted", 7);
15
+ this.imageRemoved = index.createEvent(this, "imageRemoved", 7);
14
16
  this.triggerStart = index.createEvent(this, "triggerStart", 7);
15
17
  this.triggerStop = index.createEvent(this, "triggerStop", 7);
16
18
  this.triggerChange = index.createEvent(this, "triggerChange", 7);
@@ -33,6 +35,14 @@ const TextEditor = class {
33
35
  event.stopPropagation();
34
36
  this.change.emit(event.detail);
35
37
  };
38
+ this.handleImagePasted = (event) => {
39
+ event.stopPropagation();
40
+ this.imagePasted.emit(event.detail);
41
+ };
42
+ this.handleImageRemoved = (event) => {
43
+ event.stopPropagation();
44
+ this.imageRemoved.emit(event.detail);
45
+ };
36
46
  this.contentType = 'markdown';
37
47
  this.language = 'en';
38
48
  this.disabled = false;
@@ -70,7 +80,7 @@ const TextEditor = class {
70
80
  ];
71
81
  }
72
82
  return [
73
- index.h("limel-prosemirror-adapter", { "aria-placeholder": this.placeholder, contentType: this.contentType, onChange: this.handleChange, customElements: this.customElements, value: this.value, "aria-controls": this.helperTextId, id: this.editorId, "aria-disabled": this.disabled, language: this.language, triggerCharacters: this.triggers, disabled: this.disabled }),
83
+ index.h("limel-prosemirror-adapter", { "aria-placeholder": this.placeholder, contentType: this.contentType, onChange: this.handleChange, onImagePasted: this.handleImagePasted, onImageRemoved: this.handleImageRemoved, customElements: this.customElements, value: this.value, "aria-controls": this.helperTextId, id: this.editorId, "aria-disabled": this.disabled, language: this.language, triggerCharacters: this.triggers, disabled: this.disabled }),
74
84
  this.renderPlaceholder(),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QACIA,kBAAM,KAAK,EAAC,aAAa,iBAAa,MAAM,IACvC,IAAI,CAAC,WAAW,CACd,EACT;GACL;;;;;;;","names":["h","createRandomString","Host"],"sources":["./src/components/text-editor/text-editor.scss?tag=limel-text-editor&encapsulation=shadow","./src/components/text-editor/text-editor.tsx"],"sourcesContent":["@use '../../style/internal/shared_input-select-picker';\n@use '../../style/mixins.scss';\n\n/**\n * @prop --text-editor-max-height: the tallest height the text editor can become when auto-resizing itself. Defaults to `calc(100vh - (env(safe-area-inset-top) + env(safe-area-inset-bottom)) - 4rem)`.\n * @prop --text-editor-fade-out-background-color: the color of the fade-out effect at the top and bottom of the text editor, when the text-editor is in readonly state. Defaults to rgb(var(--contrast-100)).\n */\n\n@include shared_input-select-picker.lime-looks-like-input-value;\n.lime-looks-like-input-value {\n padding: var(--limel-text-editor-padding);\n}\n\n* {\n box-sizing: border-box;\n}\n\n:host(limel-text-editor) {\n --limel-text-editor-outline-color: #{shared_input-select-picker.$lime-text-field-outline-color};\n --limel-text-editor-background-color: #{shared_input-select-picker.$background-color-normal};\n --limel-text-editor-label-color: #{shared_input-select-picker.$label-color};\n --limel-prosemirror-adapter-toolbar-opacity: 0.6;\n --limel-text-editor-padding: 0.25rem 1rem 0.75rem 1rem;\n --limel-prosemirror-adapter-toolbar-grid-template-rows: 1fr;\n --limel-prosemirror-adapter-toolbar-grid-template-rows-transition-duration: 0.3s;\n --limel-prosemirror-adapter-toolbar-transition-timing-function: cubic-bezier(\n 0.19,\n 0.23,\n 0.26,\n 0.89\n );\n\n position: relative;\n isolation: isolate;\n display: flex;\n flex-direction: column;\n\n width: 100%;\n min-width: 5rem;\n min-height: 5rem;\n height: 100%;\n max-height: var(\n --text-editor-max-height,\n calc(\n 100vh - (env(safe-area-inset-top) + env(safe-area-inset-bottom)) -\n 4rem\n )\n );\n padding: 1px; // prevents visual defects that can appear due to the backdrop-filter and closeness to borders\n}\n\n:host(limel-text-editor:focus-within),\n:host(limel-text-editor:not([ui='minimal']):hover) {\n --limel-prosemirror-adapter-toolbar-opacity: 1;\n}\n\n:host(limel-text-editor[ui='minimal']:not(:focus-within)) {\n --limel-text-editor-padding: 0.75rem 1rem 0.75rem 1rem;\n --limel-prosemirror-adapter-toolbar-grid-template-rows: 0fr;\n --limel-prosemirror-adapter-toolbar-grid-template-rows-transition-duration: 0.46s;\n --limel-prosemirror-adapter-action-bar-padding-top-bottom: 0;\n --limel-prosemirror-adapter-toolbar-opacity: 0;\n --limel-text-editor-placeholder-top: 0;\n min-height: 2.5rem;\n}\n\n:host(limel-text-editor:hover) {\n --limel-text-editor-outline-color: #{shared_input-select-picker.$lime-text-field-outline-color--hovered};\n}\n\n:host(limel-text-editor:focus-within) {\n --limel-text-editor-outline-color: #{shared_input-select-picker.$lime-text-field-outline-color--focused};\n}\n\n:host(limel-text-editor:focus-within),\n:host(limel-text-editor:focus) {\n .placeholder {\n opacity: 0;\n }\n}\n\n:host(limel-text-editor[disabled]:not([disabled='false'])) {\n @include shared_input-select-picker.looks-disabled;\n\n limel-prosemirror-adapter {\n pointer-events: none;\n }\n}\n\n:host(limel-text-editor[invalid]:not([invalid='false'])) {\n --limel-text-editor-outline-color: var(--lime-error-text-color);\n}\n\n:host(limel-text-editor[readonly]:not([readonly='false'])) {\n --limel-text-editor-padding: 0.75rem 1rem 0.75rem 1rem;\n --limel-text-editor-placeholder-top: 0;\n --limel-text-editor-outline-color: transparent;\n --limel-text-editor-background-color: transparent;\n\n limel-markdown {\n // displayed when `readonly` instead of the adapter\n display: block;\n padding: var(--limel-text-editor-padding);\n overflow-y: auto;\n\n &:before,\n &:after {\n z-index: 1;\n pointer-events: none;\n content: '';\n display: block;\n position: absolute;\n width: 100%;\n }\n &:after {\n height: 1.75rem;\n top: 0;\n background: linear-gradient(\n var(\n --text-editor-fade-out-background-color,\n rgb(var(--contrast-100))\n ),\n transparent\n );\n }\n\n &:before {\n height: 2rem;\n bottom: -0.25rem;\n background: linear-gradient(\n transparent,\n var(\n --text-editor-fade-out-background-color,\n rgb(var(--contrast-100))\n )\n );\n }\n }\n}\n\n.notched-outline {\n transition: bottom\n var(--limel-h-l-grid-template-rows-transition-speed, 0.46s)\n cubic-bezier(1, 0.09, 0, 0.89);\n pointer-events: none;\n position: absolute;\n inset: 0;\n bottom: var(--limel-text-editor-notched-outline-bottom, 0);\n\n display: flex;\n background-color: var(--limel-text-editor-background-color);\n}\n\n.leading-outline,\n.notch,\n.trailing-outline {\n transition: border-color 0.2s ease;\n border-width: 1px;\n border-style: solid;\n border-color: var(--limel-text-editor-outline-color);\n}\n\n.leading-outline {\n flex-shrink: 0;\n width: 0.75rem;\n border-right-width: 0;\n border-top-left-radius: 0.25rem;\n border-bottom-left-radius: 0.25rem;\n}\n\n.notch {\n flex-shrink: 0;\n\n position: relative;\n z-index: 2;\n\n border-top-width: 0;\n border-right-width: 0;\n border-left-width: 0;\n\n max-width: calc(100% - 1.5rem);\n}\n\n.trailing-outline {\n flex-grow: 1;\n border-left-width: 0;\n border-top-right-radius: 0.25rem;\n border-bottom-right-radius: 0.25rem;\n}\n\nlabel {\n transform: translateY(-50%);\n\n @include mixins.truncate-text;\n display: block;\n padding: 0 0.25rem;\n\n color: var(--limel-text-editor-label-color);\n font-size: 0.65rem; // `10.4px` similar to MDC's floating label\n letter-spacing: var(--mdc-typography-subtitle1-letter-spacing, 0.009375em);\n\n :host(limel-text-editor[required]:not([required='false'])) & {\n &::after {\n content: '*';\n }\n }\n}\n\n.placeholder {\n transition-property: top;\n transition-duration: var(\n --limel-prosemirror-adapter-toolbar-grid-template-rows-transition-duration\n );\n transition-timing-function: var(\n --limel-prosemirror-adapter-toolbar-transition-timing-function\n );\n @include mixins.truncate-text;\n pointer-events: none;\n position: absolute;\n top: var(--limel-text-editor-placeholder-top, 2.25rem);\n left: 0;\n right: 0;\n\n padding: var(--limel-text-editor-padding);\n font-style: italic;\n font-size: 0.875rem;\n color: shared_input-select-picker.$input-placeholder-color;\n}\n\nlimel-prosemirror-adapter {\n flex-grow: 1;\n\n min-width: 0;\n min-height: 0;\n height: 100%;\n overflow: hidden auto;\n}\n\n@include mixins.hide-helper-line-when-not-needed(limel-text-editor);\n:host(limel-text-editor.has-helper-text:focus-within),\n:host(limel-text-editor.has-helper-text[invalid]:not([invalid='false'])) {\n .notched-outline {\n --limel-text-editor-notched-outline-bottom: 1rem;\n }\n}\n\n:host(limel-text-editor[allow-resize]) {\n limel-prosemirror-adapter {\n resize: vertical;\n }\n}\n","import { Component, Event, EventEmitter, Host, Prop, h } from '@stencil/core';\nimport { FormComponent } from '../form/form.types';\nimport { Languages } from '../date-picker/date.types';\nimport { createRandomString } from '../../util/random-string';\nimport { CustomElementDefinition } from '../../global/shared-types/custom-element.types';\nimport { TriggerCharacter, TriggerEventDetail } from './text-editor.types';\nimport { EditorUiType } from './types';\n\n/**\n * A rich text editor that offers a rich text editing experience with markdown support,\n * in the sense that you can easily type markdown syntax and see the rendered\n * result as rich text in real-time. For instance, you can type `# Hello, world!`\n * and see it directly turning to a heading 1 (an `<h1>` HTML element).\n *\n * Naturally, you can use standard keyboard hotkeys such as <kbd>Ctrl</kbd> + <kbd>B</kbd>\n * to toggle bold text, <kbd>Ctrl</kbd> + <kbd>I</kbd> to toggle italic text, and so on.\n *\n * @exampleComponent limel-example-text-editor-basic\n * @exampleComponent limel-example-text-editor-as-form-component\n * @exampleComponent limel-example-text-editor-with-markdown\n * @exampleComponent limel-example-text-editor-with-html\n * @exampleComponent limel-example-text-editor-with-tables\n * @exampleComponent limel-example-text-editor-allow-resize\n * @exampleComponent limel-example-text-editor-size\n * @exampleComponent limel-example-text-editor-ui\n * @exampleComponent limel-example-text-editor-custom-element\n * @exampleComponent limel-example-text-editor-triggers\n * @exampleComponent limel-example-text-editor-composite\n * @beta\n */\n@Component({\n tag: 'limel-text-editor',\n shadow: { delegatesFocus: true },\n styleUrl: 'text-editor.scss',\n})\nexport class TextEditor implements FormComponent<string> {\n /** The type of content that the editor should handle and emit, defaults to `markdown`\n *\n * Assumed to be set only once, so not reactive to changes\n */\n @Prop()\n public contentType: 'markdown' | 'html' = 'markdown';\n\n /**\n * Defines the language for translations.\n */\n @Prop({ reflect: true })\n public language: Languages = 'en';\n\n /**\n * Set to `true` to disable the field.\n * Use `disabled` to indicate that the field can normally be interacted\n * with, but is currently disabled. This tells the user that if certain\n * requirements are met, the field may become enabled again.\n */\n @Prop({ reflect: true })\n public disabled?: boolean = false;\n\n /**\n * Set to `true` to make the component read-only.\n * Use `readonly` when the field is only there to present the data it holds,\n * and will not become possible for the current user to edit.\n * :::note\n * Consider that it might be better to use `limel-markdown`\n * instead of `limel-text-editor` when the goal is visualizing data.\n * :::\n */\n @Prop({ reflect: true })\n public readonly?: boolean = false;\n\n /**\n * Optional helper text to display below the input field when it has focus\n */\n @Prop({ reflect: true })\n public helperText?: string;\n\n /**\n * The placeholder text shown inside the input field,\n * when the field is empty.\n */\n @Prop({ reflect: true })\n public placeholder?: string;\n\n /**\n * The label of the editor\n */\n @Prop({ reflect: true })\n public label?: string;\n\n /**\n * Set to `true` to indicate that the current value of the editor is\n * invalid.\n */\n @Prop({ reflect: true })\n public invalid?: boolean = false;\n\n /**\n * Description of the text inside the editor as markdown\n */\n @Prop({ reflect: true })\n public value: string;\n\n /**\n * A list of custom elements\n *\n * Any `CustomElement` that should be used inside the text editor needs\n * to be defined here.\n *\n * @private\n * @alpha\n */\n @Prop()\n public customElements: CustomElementDefinition[] = [];\n\n /**\n * A set of trigger characters\n *\n * Defining a character here will enable trigger events to be sent if the\n * character is detected in the editor.\n *\n * @private\n * @alpha\n */\n @Prop()\n public triggers: TriggerCharacter[] = [];\n\n /**\n * Set to `true` to indicate that the field is required.\n *\n * :::important\n * An empty but required field is not automatically considered invalid.\n * You must make sure to check the validity of the field on your own,\n * and properly handle the `invalid` state.\n * :::\n */\n @Prop({ reflect: true })\n public required?: boolean = false;\n\n /**\n * Set to `true` to allow the user to vertically resize the editor.\n * Set to `false` to disable the resize functionality.\n */\n @Prop({ reflect: true })\n public allowResize: boolean = true;\n\n /**\n * Specifies the visual appearance of the editor.\n *\n * - `standard`: The default editor appearance with a full toolbar and\n * standard layout.\n * - `minimal`: A compact editor appearance, ideal for limited space\n * scenarios such as mobile devices. In this mode, the toolbar is hidden\n * until the editor is focused.\n */\n @Prop({ reflect: true })\n public ui?: EditorUiType = 'standard';\n\n /**\n * Dispatched when a change is made to the editor\n */\n @Event()\n public change: EventEmitter<string>;\n\n /**\n * Dispatched if a trigger character is detected.\n *\n * @private\n * @alpha\n */\n @Event()\n public triggerStart: EventEmitter<TriggerEventDetail>;\n\n /**\n * Dispatched if a trigger session is ended. That is if the selection\n * goes outside the trigger input or if something is inserted using the\n * supplied `TextEditor` insert function.\n *\n * @private\n * @alpha\n */\n @Event()\n public triggerStop: EventEmitter<TriggerEventDetail>;\n\n /**\n * Dispatched if a input is changed during an active trigger.\n *\n * @private\n * @alpha\n */\n @Event()\n public triggerChange: EventEmitter<TriggerEventDetail>;\n\n private helperTextId: string;\n private editorId: string;\n\n public constructor() {\n this.helperTextId = createRandomString();\n this.editorId = createRandomString();\n }\n\n public render() {\n return (\n <Host\n class={{\n 'has-helper-text': !!this.helperText,\n }}\n >\n <span class=\"notched-outline\">\n <span class=\"leading-outline\" />\n {this.renderLabel()}\n <span class=\"trailing-outline\" />\n </span>\n {this.renderEditor()}\n </Host>\n );\n }\n\n private renderEditor() {\n if (this.readonly && !this.value) {\n return [\n <span class=\"lime-looks-like-input-value\">–</span>,\n this.renderHelperLine(),\n ];\n }\n\n if (this.readonly) {\n return [\n <limel-markdown\n value={this.value}\n aria-controls={this.helperTextId}\n id={this.editorId}\n />,\n this.renderPlaceholder(),\n this.renderHelperLine(),\n ];\n }\n\n return [\n <limel-prosemirror-adapter\n aria-placeholder={this.placeholder}\n contentType={this.contentType}\n onChange={this.handleChange}\n customElements={this.customElements}\n value={this.value}\n aria-controls={this.helperTextId}\n id={this.editorId}\n aria-disabled={this.disabled}\n language={this.language}\n triggerCharacters={this.triggers}\n disabled={this.disabled}\n />,\n this.renderPlaceholder(),\n this.renderHelperLine(),\n ];\n }\n\n private renderLabel() {\n if (!this.label) {\n return;\n }\n\n return (\n <span class=\"notch\">\n <label htmlFor={this.editorId}>{this.label}</label>\n </span>\n );\n }\n\n private renderPlaceholder() {\n if (!this.placeholder || this.value) {\n return;\n }\n\n return (\n <span class=\"placeholder\" aria-hidden=\"true\">\n {this.placeholder}\n </span>\n );\n }\n\n private renderHelperLine = () => {\n if (!this.helperText) {\n return;\n }\n\n return (\n <limel-helper-line\n helperText={this.helperText}\n helperTextId={this.helperTextId}\n invalid={this.isInvalid()}\n />\n );\n };\n\n private isInvalid = () => {\n if (this.readonly) {\n // A readonly field can never be invalid.\n return false;\n }\n\n if (this.invalid) {\n return true;\n }\n };\n\n private handleChange = (event: CustomEvent<string>) => {\n event.stopPropagation();\n this.change.emit(event.detail);\n };\n}\n"],"version":3}
1
+ {"file":"limel-text-editor.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,aAAa,GAAG,knOAAknO;;MC0C3nO,UAAU;EAkLnB;;;;;;;;IAuFQ,qBAAgB,GAAG;MACvB,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;QAClB,OAAO;OACV;MAED,QACIA,+BACI,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,YAAY,EAAE,IAAI,CAAC,YAAY,EAC/B,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE,GAC3B,EACJ;KACL,CAAC;IAEM,cAAS,GAAG;MAChB,IAAI,IAAI,CAAC,QAAQ,EAAE;;QAEf,OAAO,KAAK,CAAC;OAChB;MAED,IAAI,IAAI,CAAC,OAAO,EAAE;QACd,OAAO,IAAI,CAAC;OACf;KACJ,CAAC;IAEM,iBAAY,GAAG,CAAC,KAA0B;MAC9C,KAAK,CAAC,eAAe,EAAE,CAAC;MACxB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;KAClC,CAAC;IAEM,sBAAiB,GAAG,CAAC,KAAi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AgB,EAAE;OAC1B,CAAC;KACL;IAED,OAAO;MACHA,2DACsB,IAAI,CAAC,WAAW,EAClC,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,QAAQ,EAAE,IAAI,CAAC,YAAY,EAC3B,aAAa,EAAE,IAAI,CAAC,iBAAiB,EACrC,cAAc,EAAE,IAAI,CAAC,kBAAkB,EACvC,cAAc,EAAE,IAAI,CAAC,cAAc,EACnC,KAAK,EAAE,IAAI,CAAC,KAAK,mBACF,IAAI,CAAC,YAAY,EAChC,EAAE,EAAE,IAAI,CAAC,QAAQ,mBACF,IAAI,CAAC,QAAQ,EAC5B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,iBAAiB,EAAE,IAAI,CAAC,QAAQ,EAChC,QAAQ,EAAE,IAAI,CAAC,QAAQ,GACzB;MACF,IAAI,CAAC,iBAAiB,EAAE;MACxB,IAAI,CAAC,gBAAgB,EAAE;KAC1B,CAAC;GACL;EAEO,WAAW;IACf,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;MACb,OAAO;KACV;IAED,QACIA,kBAAM,KAAK,EAAC,OAAO,IACfA,mBAAO,OAAO,EAAE,IAAI,CAAC,QAAQ,IAAG,IAAI,CAAC,KAAK,CAAS,CAChD,EACT;GACL;EAEO,iBAAiB;IACrB,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,KAAK,EAAE;MACjC,OAAO;KACV;IAED,QACIA,kBAAM,KAAK,EAAC,aAAa,iBAAa,MAAM,IACvC,IAAI,CAAC,WAAW,CACd,EACT;GACL;;;;;;;","names":["h","createRandomString","Host"],"sources":["./src/components/text-editor/text-editor.scss?tag=limel-text-editor&encapsulation=shadow","./src/components/text-editor/text-editor.tsx"],"sourcesContent":["@use '../../style/internal/shared_input-select-picker';\n@use '../../style/mixins.scss';\n\n/**\n * @prop --text-editor-max-height: the tallest height the text editor can become when auto-resizing itself. Defaults to `calc(100vh - (env(safe-area-inset-top) + env(safe-area-inset-bottom)) - 4rem)`.\n * @prop --text-editor-fade-out-background-color: the color of the fade-out effect at the top and bottom of the text editor, when the text-editor is in readonly state. Defaults to rgb(var(--contrast-100)).\n */\n\n@include shared_input-select-picker.lime-looks-like-input-value;\n.lime-looks-like-input-value {\n padding: var(--limel-text-editor-padding);\n}\n\n* {\n box-sizing: border-box;\n}\n\n:host(limel-text-editor) {\n --limel-text-editor-outline-color: #{shared_input-select-picker.$lime-text-field-outline-color};\n --limel-text-editor-background-color: #{shared_input-select-picker.$background-color-normal};\n --limel-text-editor-label-color: #{shared_input-select-picker.$label-color};\n --limel-prosemirror-adapter-toolbar-opacity: 0.6;\n --limel-text-editor-padding: 0.25rem 1rem 0.75rem 1rem;\n --limel-prosemirror-adapter-toolbar-grid-template-rows: 1fr;\n --limel-prosemirror-adapter-toolbar-grid-template-rows-transition-duration: 0.3s;\n --limel-prosemirror-adapter-toolbar-transition-timing-function: cubic-bezier(\n 0.19,\n 0.23,\n 0.26,\n 0.89\n );\n\n position: relative;\n isolation: isolate;\n display: flex;\n flex-direction: column;\n\n width: 100%;\n min-width: 5rem;\n min-height: 5rem;\n height: 100%;\n max-height: var(\n --text-editor-max-height,\n calc(\n 100vh - (env(safe-area-inset-top) + env(safe-area-inset-bottom)) -\n 4rem\n )\n );\n padding: 1px; // prevents visual defects that can appear due to the backdrop-filter and closeness to borders\n}\n\n:host(limel-text-editor:focus-within),\n:host(limel-text-editor:not([ui='minimal']):hover) {\n --limel-prosemirror-adapter-toolbar-opacity: 1;\n}\n\n:host(limel-text-editor[ui='minimal']:not(:focus-within)) {\n --limel-text-editor-padding: 0.75rem 1rem 0.75rem 1rem;\n --limel-prosemirror-adapter-toolbar-grid-template-rows: 0fr;\n --limel-prosemirror-adapter-toolbar-grid-template-rows-transition-duration: 0.46s;\n --limel-prosemirror-adapter-action-bar-padding-top-bottom: 0;\n --limel-prosemirror-adapter-toolbar-opacity: 0;\n --limel-text-editor-placeholder-top: 0;\n min-height: 2.5rem;\n}\n\n:host(limel-text-editor:hover) {\n --limel-text-editor-outline-color: #{shared_input-select-picker.$lime-text-field-outline-color--hovered};\n}\n\n:host(limel-text-editor:focus-within) {\n --limel-text-editor-outline-color: #{shared_input-select-picker.$lime-text-field-outline-color--focused};\n}\n\n:host(limel-text-editor:focus-within),\n:host(limel-text-editor:focus) {\n .placeholder {\n opacity: 0;\n }\n}\n\n:host(limel-text-editor[disabled]:not([disabled='false'])) {\n @include shared_input-select-picker.looks-disabled;\n\n limel-prosemirror-adapter {\n pointer-events: none;\n }\n}\n\n:host(limel-text-editor[invalid]:not([invalid='false'])) {\n --limel-text-editor-outline-color: var(--lime-error-text-color);\n}\n\n:host(limel-text-editor[readonly]:not([readonly='false'])) {\n --limel-text-editor-padding: 0.75rem 1rem 0.75rem 1rem;\n --limel-text-editor-placeholder-top: 0;\n --limel-text-editor-outline-color: transparent;\n --limel-text-editor-background-color: transparent;\n\n limel-markdown {\n // displayed when `readonly` instead of the adapter\n display: block;\n padding: var(--limel-text-editor-padding);\n overflow-y: auto;\n\n &:before,\n &:after {\n z-index: 1;\n pointer-events: none;\n content: '';\n display: block;\n position: absolute;\n width: 100%;\n }\n &:after {\n height: 1.75rem;\n top: 0;\n background: linear-gradient(\n var(\n --text-editor-fade-out-background-color,\n rgb(var(--contrast-100))\n ),\n transparent\n );\n }\n\n &:before {\n height: 2rem;\n bottom: -0.25rem;\n background: linear-gradient(\n transparent,\n var(\n --text-editor-fade-out-background-color,\n rgb(var(--contrast-100))\n )\n );\n }\n }\n}\n\n.notched-outline {\n transition: bottom\n var(--limel-h-l-grid-template-rows-transition-speed, 0.46s)\n cubic-bezier(1, 0.09, 0, 0.89);\n pointer-events: none;\n position: absolute;\n inset: 0;\n bottom: var(--limel-text-editor-notched-outline-bottom, 0);\n\n display: flex;\n background-color: var(--limel-text-editor-background-color);\n}\n\n.leading-outline,\n.notch,\n.trailing-outline {\n transition: border-color 0.2s ease;\n border-width: 1px;\n border-style: solid;\n border-color: var(--limel-text-editor-outline-color);\n}\n\n.leading-outline {\n flex-shrink: 0;\n width: 0.75rem;\n border-right-width: 0;\n border-top-left-radius: 0.25rem;\n border-bottom-left-radius: 0.25rem;\n}\n\n.notch {\n flex-shrink: 0;\n\n position: relative;\n z-index: 2;\n\n border-top-width: 0;\n border-right-width: 0;\n border-left-width: 0;\n\n max-width: calc(100% - 1.5rem);\n}\n\n.trailing-outline {\n flex-grow: 1;\n border-left-width: 0;\n border-top-right-radius: 0.25rem;\n border-bottom-right-radius: 0.25rem;\n}\n\nlabel {\n transform: translateY(-50%);\n\n @include mixins.truncate-text;\n display: block;\n padding: 0 0.25rem;\n\n color: var(--limel-text-editor-label-color);\n font-size: 0.65rem; // `10.4px` similar to MDC's floating label\n letter-spacing: var(--mdc-typography-subtitle1-letter-spacing, 0.009375em);\n\n :host(limel-text-editor[required]:not([required='false'])) & {\n &::after {\n content: '*';\n }\n }\n}\n\n.placeholder {\n transition-property: top;\n transition-duration: var(\n --limel-prosemirror-adapter-toolbar-grid-template-rows-transition-duration\n );\n transition-timing-function: var(\n --limel-prosemirror-adapter-toolbar-transition-timing-function\n );\n @include mixins.truncate-text;\n pointer-events: none;\n position: absolute;\n top: var(--limel-text-editor-placeholder-top, 2.25rem);\n left: 0;\n right: 0;\n\n padding: var(--limel-text-editor-padding);\n font-style: italic;\n font-size: 0.875rem;\n color: shared_input-select-picker.$input-placeholder-color;\n}\n\nlimel-prosemirror-adapter {\n flex-grow: 1;\n\n min-width: 0;\n min-height: 0;\n height: 100%;\n overflow: hidden auto;\n}\n\n@include mixins.hide-helper-line-when-not-needed(limel-text-editor);\n:host(limel-text-editor.has-helper-text:focus-within),\n:host(limel-text-editor.has-helper-text[invalid]:not([invalid='false'])) {\n .notched-outline {\n --limel-text-editor-notched-outline-bottom: 1rem;\n }\n}\n\n:host(limel-text-editor[allow-resize]) {\n limel-prosemirror-adapter {\n resize: vertical;\n }\n}\n","import { Component, Event, EventEmitter, Host, Prop, h } from '@stencil/core';\nimport { FormComponent } from '../form/form.types';\nimport { Languages } from '../date-picker/date.types';\nimport { createRandomString } from '../../util/random-string';\nimport { CustomElementDefinition } from '../../global/shared-types/custom-element.types';\nimport {\n TriggerCharacter,\n TriggerEventDetail,\n ImageInserter,\n ImageInfo,\n} from './text-editor.types';\nimport { EditorUiType } from './types';\n\n/**\n * A rich text editor that offers a rich text editing experience with markdown support,\n * in the sense that you can easily type markdown syntax and see the rendered\n * result as rich text in real-time. For instance, you can type `# Hello, world!`\n * and see it directly turning to a heading 1 (an `<h1>` HTML element).\n *\n * Naturally, you can use standard keyboard hotkeys such as <kbd>Ctrl</kbd> + <kbd>B</kbd>\n * to toggle bold text, <kbd>Ctrl</kbd> + <kbd>I</kbd> to toggle italic text, and so on.\n *\n * @exampleComponent limel-example-text-editor-basic\n * @exampleComponent limel-example-text-editor-as-form-component\n * @exampleComponent limel-example-text-editor-with-markdown\n * @exampleComponent limel-example-text-editor-with-html\n * @exampleComponent limel-example-text-editor-with-tables\n * @exampleComponent limel-example-text-editor-with-inline-images-file-storage\n * @exampleComponent limel-example-text-editor-with-inline-images-base64\n * @exampleComponent limel-example-text-editor-allow-resize\n * @exampleComponent limel-example-text-editor-size\n * @exampleComponent limel-example-text-editor-ui\n * @exampleComponent limel-example-text-editor-custom-element\n * @exampleComponent limel-example-text-editor-triggers\n * @exampleComponent limel-example-text-editor-composite\n * @beta\n */\n@Component({\n tag: 'limel-text-editor',\n shadow: { delegatesFocus: true },\n styleUrl: 'text-editor.scss',\n})\nexport class TextEditor implements FormComponent<string> {\n /** The type of content that the editor should handle and emit, defaults to `markdown`\n *\n * Assumed to be set only once, so not reactive to changes\n */\n @Prop()\n public contentType: 'markdown' | 'html' = 'markdown';\n\n /**\n * Defines the language for translations.\n */\n @Prop({ reflect: true })\n public language: Languages = 'en';\n\n /**\n * Set to `true` to disable the field.\n * Use `disabled` to indicate that the field can normally be interacted\n * with, but is currently disabled. This tells the user that if certain\n * requirements are met, the field may become enabled again.\n */\n @Prop({ reflect: true })\n public disabled?: boolean = false;\n\n /**\n * Set to `true` to make the component read-only.\n * Use `readonly` when the field is only there to present the data it holds,\n * and will not become possible for the current user to edit.\n * :::note\n * Consider that it might be better to use `limel-markdown`\n * instead of `limel-text-editor` when the goal is visualizing data.\n * :::\n */\n @Prop({ reflect: true })\n public readonly?: boolean = false;\n\n /**\n * Optional helper text to display below the input field when it has focus\n */\n @Prop({ reflect: true })\n public helperText?: string;\n\n /**\n * The placeholder text shown inside the input field,\n * when the field is empty.\n */\n @Prop({ reflect: true })\n public placeholder?: string;\n\n /**\n * The label of the editor\n */\n @Prop({ reflect: true })\n public label?: string;\n\n /**\n * Set to `true` to indicate that the current value of the editor is\n * invalid.\n */\n @Prop({ reflect: true })\n public invalid?: boolean = false;\n\n /**\n * Description of the text inside the editor as markdown\n */\n @Prop({ reflect: true })\n public value: string;\n\n /**\n * A list of custom elements\n *\n * Any `CustomElement` that should be used inside the text editor needs\n * to be defined here.\n *\n * @private\n * @alpha\n */\n @Prop()\n public customElements: CustomElementDefinition[] = [];\n\n /**\n * A set of trigger characters\n *\n * Defining a character here will enable trigger events to be sent if the\n * character is detected in the editor.\n *\n * @private\n * @alpha\n */\n @Prop()\n public triggers: TriggerCharacter[] = [];\n\n /**\n * Set to `true` to indicate that the field is required.\n *\n * :::important\n * An empty but required field is not automatically considered invalid.\n * You must make sure to check the validity of the field on your own,\n * and properly handle the `invalid` state.\n * :::\n */\n @Prop({ reflect: true })\n public required?: boolean = false;\n\n /**\n * Set to `true` to allow the user to vertically resize the editor.\n * Set to `false` to disable the resize functionality.\n */\n @Prop({ reflect: true })\n public allowResize: boolean = true;\n\n /**\n * Specifies the visual appearance of the editor.\n *\n * - `standard`: The default editor appearance with a full toolbar and\n * standard layout.\n * - `minimal`: A compact editor appearance, ideal for limited space\n * scenarios such as mobile devices. In this mode, the toolbar is hidden\n * until the editor is focused.\n */\n @Prop({ reflect: true })\n public ui?: EditorUiType = 'standard';\n\n /**\n * Dispatched when a change is made to the editor\n */\n @Event()\n public change: EventEmitter<string>;\n\n /**\n * Dispatched when a image is pasted into the editor\n *\n * @private\n * @alpha\n */\n @Event()\n private imagePasted: EventEmitter<ImageInserter>;\n\n /**\n * Dispatched when a image is removed from the editor\n *\n * @private\n * @alpha\n */\n @Event()\n private imageRemoved: EventEmitter<ImageInfo>;\n\n /**\n * Dispatched if a trigger character is detected.\n *\n * @private\n * @alpha\n */\n @Event()\n public triggerStart: EventEmitter<TriggerEventDetail>;\n\n /**\n * Dispatched if a trigger session is ended. That is if the selection\n * goes outside the trigger input or if something is inserted using the\n * supplied `TextEditor` insert function.\n *\n * @private\n * @alpha\n */\n @Event()\n public triggerStop: EventEmitter<TriggerEventDetail>;\n\n /**\n * Dispatched if a input is changed during an active trigger.\n *\n * @private\n * @alpha\n */\n @Event()\n public triggerChange: EventEmitter<TriggerEventDetail>;\n\n private helperTextId: string;\n private editorId: string;\n\n public constructor() {\n this.helperTextId = createRandomString();\n this.editorId = createRandomString();\n }\n\n public render() {\n return (\n <Host\n class={{\n 'has-helper-text': !!this.helperText,\n }}\n >\n <span class=\"notched-outline\">\n <span class=\"leading-outline\" />\n {this.renderLabel()}\n <span class=\"trailing-outline\" />\n </span>\n {this.renderEditor()}\n </Host>\n );\n }\n\n private renderEditor() {\n if (this.readonly && !this.value) {\n return [\n <span class=\"lime-looks-like-input-value\">–</span>,\n this.renderHelperLine(),\n ];\n }\n\n if (this.readonly) {\n return [\n <limel-markdown\n value={this.value}\n aria-controls={this.helperTextId}\n id={this.editorId}\n />,\n this.renderPlaceholder(),\n this.renderHelperLine(),\n ];\n }\n\n return [\n <limel-prosemirror-adapter\n aria-placeholder={this.placeholder}\n contentType={this.contentType}\n onChange={this.handleChange}\n onImagePasted={this.handleImagePasted}\n onImageRemoved={this.handleImageRemoved}\n customElements={this.customElements}\n value={this.value}\n aria-controls={this.helperTextId}\n id={this.editorId}\n aria-disabled={this.disabled}\n language={this.language}\n triggerCharacters={this.triggers}\n disabled={this.disabled}\n />,\n this.renderPlaceholder(),\n this.renderHelperLine(),\n ];\n }\n\n private renderLabel() {\n if (!this.label) {\n return;\n }\n\n return (\n <span class=\"notch\">\n <label htmlFor={this.editorId}>{this.label}</label>\n </span>\n );\n }\n\n private renderPlaceholder() {\n if (!this.placeholder || this.value) {\n return;\n }\n\n return (\n <span class=\"placeholder\" aria-hidden=\"true\">\n {this.placeholder}\n </span>\n );\n }\n\n private renderHelperLine = () => {\n if (!this.helperText) {\n return;\n }\n\n return (\n <limel-helper-line\n helperText={this.helperText}\n helperTextId={this.helperTextId}\n invalid={this.isInvalid()}\n />\n );\n };\n\n private isInvalid = () => {\n if (this.readonly) {\n // A readonly field can never be invalid.\n return false;\n }\n\n if (this.invalid) {\n return true;\n }\n };\n\n private handleChange = (event: CustomEvent<string>) => {\n event.stopPropagation();\n this.change.emit(event.detail);\n };\n\n private handleImagePasted = (event: CustomEvent<ImageInserter>) => {\n event.stopPropagation();\n this.imagePasted.emit(event.detail);\n };\n\n private handleImageRemoved = (event: CustomEvent<ImageInfo>) => {\n event.stopPropagation();\n this.imageRemoved.emit(event.detail);\n };\n}\n"],"version":3}
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * @alpha
5
+ */
6
+ exports.ImageState = void 0;
7
+ (function (ImageState) {
8
+ ImageState["LOADING"] = "loading";
9
+ ImageState["FAILED"] = "failed";
10
+ ImageState["SUCCESS"] = "success";
11
+ })(exports.ImageState || (exports.ImageState = {}));
12
+
13
+ //# sourceMappingURL=text-editor.types-5e5567e2.js.map
@@ -0,0 +1 @@
1
+ {"file":"text-editor.types-5e5567e2.js","mappings":";;AA6FA;;;AAGYA;AAAZ,WAAY,UAAU;EAClB,iCAAmB,CAAA;EACnB,+BAAiB,CAAA;EACjB,iCAAmB,CAAA;AACvB,CAAC,EAJWA,kBAAU,KAAVA,kBAAU;;","names":["ImageState"],"sources":["./src/components/text-editor/text-editor.types.ts"],"sourcesContent":["import { CustomElement } from '../../global/shared-types/custom-element.types';\nimport { FileInfo } from '../../global/shared-types/file.types';\n\n/**\n * Represents a trigger character and its position in the text.\n *\n * @alpha\n */\nexport type Trigger = {\n character: TriggerCharacter;\n position: number;\n};\n\n/**\n * A character that triggers a specific action in the text editor.\n *\n * @alpha\n */\nexport type TriggerCharacter =\n | '@'\n | '#'\n | '$'\n | '!'\n | '?'\n | '&'\n | '*'\n | '%'\n | '+'\n | '-'\n | '='\n | '/'\n | '\\\\'\n | '^'\n | '~'\n | '`'\n | ':'\n | ';'\n | '|'\n | '.'\n | ','\n | '<'\n | '>'\n | '['\n | ']'\n | '{'\n | '}'\n | '('\n | ')'\n | \"'\";\n\n/**\n * @alpha\n */\nexport type TextEditorNode = {\n /**\n * The top node\n */\n node: CustomElement | string;\n\n /**\n * One more more children under the top node\n */\n children?: Array<TextEditorNode | string>;\n};\n\n/**\n * @alpha\n */\nexport interface ImageInserter {\n fileInfo: FileInfo;\n\n /**\n * Method to insert a thumbnail at the cursor position.\n */\n insertThumbnail: () => void;\n\n /**\n * Method to insert the image at the thumbnail position.\n * Thumbnail must be inserted before calling this method.\n *\n * @param src - The src url of the uploaded image.\n * If not provided, the image will be inserted with base64 data.\n *\n */\n insertImage: (src?: string) => void;\n\n /**\n * Method to insert a failed thumbnail at the thumbnail position.\n * Thumbnail must be inserted before calling this method.\n */\n insertFailedThumbnail: () => void;\n}\n\n/**\n * @alpha\n */\nexport enum ImageState {\n LOADING = 'loading',\n FAILED = 'failed',\n SUCCESS = 'success',\n}\n\n/**\n * @alpha\n */\nexport interface ImageInfo {\n /**\n * Unique ID of the image file.\n */\n fileInfoId: string;\n /**\n * The source of the image.\n * Can either be a URL pointing to the image or a base64 encoded string.\n */\n src: string;\n /**\n * The current state of the image.\n */\n state: ImageState;\n}\n\n/**\n * @alpha\n */\nexport interface TextEditor {\n /**\n * Method to insert either text or a node at the cursor position\n */\n insert: (input: TextEditorNode | string) => void;\n\n /**\n * Method to insert an HTML string at the cursor position\n */\n insertHtml: (input: string) => Promise<void>;\n\n stopTrigger: () => void;\n}\n\n/**\n * @alpha\n */\nexport interface TriggerEventDetail {\n /**\n * The trigger that triggered this event\n *\n */\n trigger: TriggerCharacter;\n\n /**\n * The text editor\n */\n textEditor: TextEditor;\n\n /**\n * Current value of the trigger\n */\n value: string;\n}\n"],"version":3}
@@ -16,6 +16,7 @@ const da = {
16
16
  'date-picker.quarter.heading': 'Kvartal',
17
17
  'date-picker.year.heading': 'År',
18
18
  'chip-set.clear-all': 'Ryd alle',
19
+ 'snackbar.dismiss': 'Luk',
19
20
  'file-viewer.message.unsupported-filetype': 'Denne fil kan ikke vises!',
20
21
  'file-viewer.download': 'Hent',
21
22
  'file-viewer.exit-fullscreen': 'Afslut fuldskærm',
@@ -24,6 +25,7 @@ const da = {
24
25
  'file-viewer.more-actions': 'Mere…',
25
26
  'editor-menu.bold': 'Fed',
26
27
  'editor-menu.italic': 'Kursiv',
28
+ 'editor-menu.strikethrough': 'Gennemstreget',
27
29
  'editor-menu.h1': 'Overskrift 1',
28
30
  'editor-menu.h2': 'Overskrift 2',
29
31
  'editor-menu.h3': 'Overskrift 3',
@@ -35,6 +37,10 @@ const da = {
35
37
  'editor-link-menu.link': 'Link',
36
38
  'editor-menu.code-block': 'Kodeblok',
37
39
  'editor-menu.code': 'Kode',
40
+ 'editor-image-view.loading': 'Indlæser billede: { filename }...',
41
+ 'editor-image-view.failed': 'Noget gik galt med billede: { filename }',
42
+ 'editor-image-view.success': 'Billede: { filename } er klar',
43
+ 'editor-image-view.resize-handle': 'Træk til højre eller venstre for at ændre størrelsen på billedet',
38
44
  'progress-bar': 'Fremskridtsindikator',
39
45
  };
40
46
 
@@ -63,6 +69,7 @@ const de = {
63
69
  'file-viewer.more-actions': 'Mehr…',
64
70
  'editor-menu.bold': 'Fett',
65
71
  'editor-menu.italic': 'Kursiv',
72
+ 'editor-menu.strikethrough': 'Durchgestrichen',
66
73
  'editor-menu.h1': 'Überschrift 1',
67
74
  'editor-menu.h2': 'Überschrift 2',
68
75
  'editor-menu.h3': 'Überschrift 3',
@@ -74,6 +81,10 @@ const de = {
74
81
  'editor-link-menu.link': 'Link',
75
82
  'editor-menu.code-block': 'Codeblock',
76
83
  'editor-menu.code': 'Code',
84
+ 'editor-image-view.loading': 'Lade Bild: { filename }...',
85
+ 'editor-image-view.failed': 'Beim Laden des Bildes ist etwas schief gelaufen: { filename }',
86
+ 'editor-image-view.success': 'Bild: { filename } ist bereit',
87
+ 'editor-image-view.resize-handle': 'Ziehen Sie nach rechts oder links, um die Größe des Bildes zu ändern.',
77
88
  'progress-bar': 'Fortschrittsbalken',
78
89
  };
79
90
 
@@ -102,6 +113,7 @@ const en = {
102
113
  'file-viewer.more-actions': 'More…',
103
114
  'editor-menu.bold': 'Bold',
104
115
  'editor-menu.italic': 'Italic',
116
+ 'editor-menu.strikethrough': 'Strikethrough',
105
117
  'editor-menu.h1': 'Heading 1',
106
118
  'editor-menu.h2': 'Heading 2',
107
119
  'editor-menu.h3': 'Heading 3',
@@ -113,13 +125,17 @@ const en = {
113
125
  'editor-link-menu.link': 'Link',
114
126
  'editor-menu.code-block': 'Code block',
115
127
  'editor-menu.code': 'Code',
128
+ 'editor-image-view.loading': 'Loading image: { filename }...',
129
+ 'editor-image-view.failed': 'Something went wrong with image: { filename }',
130
+ 'editor-image-view.success': 'Image: { filename } is ready',
131
+ 'editor-image-view.resize-handle': 'Drag to right or left to resize the image',
116
132
  'progress-bar': 'Progress bar',
117
133
  };
118
134
 
119
135
  const fi = {
120
136
  remove: 'Poista',
121
137
  save: 'Tallenna',
122
- canceL: 'Peruuta',
138
+ cancel: 'Peruuta',
123
139
  loading: 'Ladataan…',
124
140
  value: 'Arvo',
125
141
  'callout.note': 'Huomio',
@@ -132,6 +148,7 @@ const fi = {
132
148
  'date-picker.quarter.heading': 'Vuosineljännes',
133
149
  'date-picker.year.heading': 'Vuosi',
134
150
  'chip-set.clear-all': 'Tyhjennä kaikki',
151
+ 'snackbar.dismiss': 'Sulje',
135
152
  'file-viewer.message.unsupported-filetype': 'Tätä tiedostoa ei voi näyttää!',
136
153
  'file-viewer.download': 'Ladata',
137
154
  'file-viewer.exit-fullscreen': 'Poistu koko näytöstä',
@@ -140,6 +157,7 @@ const fi = {
140
157
  'file-viewer.more-actions': 'Lisää…',
141
158
  'editor-menu.bold': 'Lihavoitu',
142
159
  'editor-menu.italic': 'Kursivoitu',
160
+ 'editor-menu.strikethrough': 'Yliviivaus',
143
161
  'editor-menu.h1': 'Otsikkotaso 1',
144
162
  'editor-menu.h2': 'Otsikkotaso 2',
145
163
  'editor-menu.h3': 'Otsikkotaso 3',
@@ -151,6 +169,10 @@ const fi = {
151
169
  'editor-link-menu.link': 'Linkki',
152
170
  'editor-menu.code-block': 'Koodilohko',
153
171
  'editor-menu.code': 'Koodi',
172
+ 'editor-image-view.loading': 'Ladataan kuvaa: { filename }...',
173
+ 'editor-image-view.failed': 'Jokin meni pieleen kuvan kanssa: { filename }',
174
+ 'editor-image-view.success': 'Kuva: { filename } on valmis',
175
+ 'editor-image-view.resize-handle': 'Vedä oikealle tai vasemmalle muuttaaksesi kuvan kokoa',
154
176
  'progress-bar': 'Edistymispalkki',
155
177
  };
156
178
 
@@ -179,6 +201,7 @@ const fr = {
179
201
  'file-viewer.more-actions': 'Plus…',
180
202
  'editor-menu.bold': 'Gras',
181
203
  'editor-menu.italic': 'Italique',
204
+ 'editor-menu.strikethrough': 'Barré',
182
205
  'editor-menu.h1': 'Titre 1',
183
206
  'editor-menu.h2': 'Titre 2',
184
207
  'editor-menu.h3': 'Titre 3',
@@ -190,6 +213,10 @@ const fr = {
190
213
  'editor-link-menu.link': 'Lien',
191
214
  'editor-menu.code-block': 'Bloc de code',
192
215
  'editor-menu.code': 'Code',
216
+ 'editor-image-view.loading': "Chargement de l'image: { filename }...",
217
+ 'editor-image-view.failed': "Un problème est survenu avec l'image: { filename }",
218
+ 'editor-image-view.success': 'Image: { filename } est prête',
219
+ 'editor-image-view.resize-handle': "Faites glisser vers la droite ou la gauche pour redimensionner l'image",
193
220
  'progress-bar': 'Barre de progression',
194
221
  };
195
222
 
@@ -209,6 +236,7 @@ const nl = {
209
236
  'date-picker.quarter.heading': 'Kwartaal',
210
237
  'date-picker.year.heading': 'Jaar',
211
238
  'chip-set.clear-all': 'Alles wissen',
239
+ 'snackbar.dismiss': 'Sluiten',
212
240
  'file-viewer.message.unsupported-filetype': 'Kan dit bestand niet weergeven!',
213
241
  'file-viewer.download': 'Downloaden',
214
242
  'file-viewer.exit-fullscreen': 'Verlaat volledig scherm',
@@ -217,6 +245,7 @@ const nl = {
217
245
  'file-viewer.more-actions': 'Meer…',
218
246
  'editor-menu.bold': 'Vet',
219
247
  'editor-menu.italic': 'Cursief',
248
+ 'editor-menu.strikethrough': 'Doorhalen',
220
249
  'editor-menu.h1': 'Kopniveau 1',
221
250
  'editor-menu.h2': 'Kopniveau 2',
222
251
  'editor-menu.h3': 'Kopniveau 3',
@@ -228,6 +257,10 @@ const nl = {
228
257
  'editor-link-menu.link': 'Link',
229
258
  'editor-menu.code-block': 'Codeblok',
230
259
  'editor-menu.code': 'Code',
260
+ 'editor-image-view.loading': 'Afbeelding wordt geladen: { filename }...',
261
+ 'editor-image-view.failed': 'Er is iets misgegaan met de afbeelding: { filename }',
262
+ 'editor-image-view.success': 'Afbeelding: { filename } is klaar',
263
+ 'editor-image-view.resize-handle': 'Sleep naar rechts of links om de afbeeldingsgrootte te veranderen',
231
264
  'progress-bar': 'Voortgangsbalk',
232
265
  };
233
266
 
@@ -255,6 +288,7 @@ const no = {
255
288
  'file-viewer.more-actions': 'Mer…',
256
289
  'editor-menu.bold': 'Fet',
257
290
  'editor-menu.italic': 'Kursiv',
291
+ 'editor-menu.strikethrough': 'Gjennomstreking',
258
292
  'editor-menu.h1': 'Overskrift 1',
259
293
  'editor-menu.h2': 'Overskrift 2',
260
294
  'editor-menu.h3': 'Overskrifts 3',
@@ -266,7 +300,12 @@ const no = {
266
300
  'editor-link-menu.link': 'Lenke',
267
301
  'editor-menu.code-block': 'Kodeblokk',
268
302
  'editor-menu.code': 'Kode',
303
+ 'editor-image-view.loading': 'Laster bilde: { filename }...',
304
+ 'editor-image-view.failed': 'Noe gikk galt med bildet: { filename }',
305
+ 'editor-image-view.success': 'Bilde: { filename } er klart',
306
+ 'editor-image-view.resize-handle': 'Dra til høyre eller venstre for å endre størrelsen på bildet',
269
307
  'progress-bar': 'Fremdriftsindikator',
308
+ 'snackbar.dismiss': 'Lukk',
270
309
  };
271
310
 
272
311
  const sv = {
@@ -294,6 +333,7 @@ const sv = {
294
333
  'file-viewer.more-actions': 'Mer…',
295
334
  'editor-menu.bold': 'Fet',
296
335
  'editor-menu.italic': 'Kursiv',
336
+ 'editor-menu.strikethrough': 'Genomstruken',
297
337
  'editor-menu.h1': 'Rubrik 1',
298
338
  'editor-menu.h2': 'Rubrik 2',
299
339
  'editor-menu.h3': 'Rubrik 3',
@@ -305,6 +345,10 @@ const sv = {
305
345
  'editor-link-menu.link': 'Länk',
306
346
  'editor-menu.code-block': 'Kodblock',
307
347
  'editor-menu.code': 'Kod',
348
+ 'editor-image-view.loading': 'Laddar bilden: { filename }...',
349
+ 'editor-image-view.failed': 'Något gick fel med bilden: { filename }',
350
+ 'editor-image-view.success': 'Bilden: { filename } är redo',
351
+ 'editor-image-view.resize-handle': 'Dra åt höger eller vänster för att ändra storlek på bilden',
308
352
  'progress-bar': 'Förloppsindikator',
309
353
  };
310
354
 
@@ -318,9 +362,16 @@ const allTranslations = {
318
362
  nl: nl,
319
363
  sv: sv,
320
364
  };
365
+ const REGEX = /\{\s*(\w+)\s*\}/g;
321
366
  class Translations {
322
- get(key, language = 'en') {
323
- return allTranslations[language][key];
367
+ get(key, language = 'en', params) {
368
+ const translation = allTranslations[language][key];
369
+ if (!translation) {
370
+ return key;
371
+ }
372
+ return translation.replace(REGEX, (match, mergeCodeKey) => {
373
+ return params[mergeCodeKey] || match;
374
+ });
324
375
  }
325
376
  }
326
377
  const translations = new Translations();
@@ -330,4 +381,4 @@ const translate = (() => {
330
381
 
331
382
  exports.translate = translate;
332
383
 
333
- //# sourceMappingURL=translations-0d53f9bc.js.map
384
+ //# sourceMappingURL=translations-b5da5dcd.js.map
@@ -0,0 +1 @@
1
+ {"file":"translations-b5da5dcd.js","mappings":";;AAAA,WAAe;EACX,MAAM,EAAE,OAAO;EACf,IAAI,EAAE,KAAK;EACX,MAAM,EAAE,UAAU;EAClB,OAAO,EAAE,WAAW;EACpB,KAAK,EAAE,OAAO;EACd,cAAc,EAAE,QAAQ;EACxB,mBAAmB,EAAE,QAAQ;EAC7B,aAAa,EAAE,KAAK;EACpB,iBAAiB,EAAE,UAAU;EAC7B,iBAAiB,EAAE,UAAU;EAC7B,mBAAmB,EAAE,MAAM;EAC3B,2BAA2B,EAAE,OAAO;EACpC,6BAA6B,EAAE,SAAS;EACxC,0BAA0B,EAAE,IAAI;EAChC,oBAAoB,EAAE,UAAU;EAChC,kBAAkB,EAAE,KAAK;EACzB,0CAA0C,EAAE,2BAA2B;EACvE,sBAAsB,EAAE,MAAM;EAC9B,6BAA6B,EAAE,kBAAkB;EACjD,gCAAgC,EAAE,kBAAkB;EACpD,6BAA6B,EAAE,kBAAkB;EACjD,0BAA0B,EAAE,OAAO;EACnC,kBAAkB,EAAE,KAAK;EACzB,oBAAoB,EAAE,QAAQ;EAC9B,2BAA2B,EAAE,eAAe;EAC5C,gBAAgB,EAAE,cAAc;EAChC,gBAAgB,EAAE,cAAc;EAChC,gBAAgB,EAAE,cAAc;EAChC,2BAA2B,EAAE,YAAY;EACzC,2BAA2B,EAAE,kBAAkB;EAC/C,wBAAwB,EAAE,WAAW;EACrC,kBAAkB,EAAE,aAAa;EACjC,uBAAuB,EAAE,OAAO;EAChC,uBAAuB,EAAE,MAAM;EAC/B,wBAAwB,EAAE,UAAU;EACpC,kBAAkB,EAAE,MAAM;EAC1B,2BAA2B,EAAE,mCAAmC;EAChE,0BAA0B,EAAE,0CAA0C;EACtE,2BAA2B,EAAE,+BAA+B;EAC5D,iCAAiC,EAC7B,kEAAkE;EAC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AAE,CAAC;AACxC,kBAAe,CAAC;EACZ,OAAO,YAAY,CAAC;AACxB,CAAC,GAAG;;;;","names":[],"sources":["./src/translations/da.ts","./src/translations/de.ts","./src/translations/en.ts","./src/translations/fi.ts","./src/translations/fr.ts","./src/translations/nl.ts","./src/translations/no.ts","./src/translations/sv.ts","./src/global/translations.ts"],"sourcesContent":["export default {\n remove: 'Fjern',\n save: 'Gem',\n cancel: 'Annullér',\n loading: 'Indlæser…',\n value: 'Værdi',\n 'callout.note': 'Bemærk',\n 'callout.important': 'Vigtig',\n 'callout.tip': 'Tip',\n 'callout.caution': 'Advarsel',\n 'callout.warning': 'Advarsel',\n 'date-picker.today': 'Idag',\n 'date-picker.month.heading': 'Måned',\n 'date-picker.quarter.heading': 'Kvartal',\n 'date-picker.year.heading': 'År',\n 'chip-set.clear-all': 'Ryd alle',\n 'snackbar.dismiss': 'Luk',\n 'file-viewer.message.unsupported-filetype': 'Denne fil kan ikke vises!',\n 'file-viewer.download': 'Hent',\n 'file-viewer.exit-fullscreen': 'Afslut fuldskærm',\n 'file-viewer.open-in-fullscreen': 'Åbn i fuld skærm',\n 'file-viewer.open-in-new-tab': 'Åbn i en ny fane',\n 'file-viewer.more-actions': 'Mere…',\n 'editor-menu.bold': 'Fed',\n 'editor-menu.italic': 'Kursiv',\n 'editor-menu.strikethrough': 'Gennemstreget',\n 'editor-menu.h1': 'Overskrift 1',\n 'editor-menu.h2': 'Overskrift 2',\n 'editor-menu.h3': 'Overskrift 3',\n 'editor-menu.bulleted-list': 'Punktliste',\n 'editor-menu.numbered-list': 'Nummereret liste',\n 'editor-menu.blockquote': 'Blokcitat',\n 'editor-menu.link': 'Tilføj link',\n 'editor-link-menu.text': 'Tekst',\n 'editor-link-menu.link': 'Link',\n 'editor-menu.code-block': 'Kodeblok',\n 'editor-menu.code': 'Kode',\n 'editor-image-view.loading': 'Indlæser billede: { filename }...',\n 'editor-image-view.failed': 'Noget gik galt med billede: { filename }',\n 'editor-image-view.success': 'Billede: { filename } er klar',\n 'editor-image-view.resize-handle':\n 'Træk til højre eller venstre for at ændre størrelsen på billedet',\n 'progress-bar': 'Fremskridtsindikator',\n};\n","export default {\n remove: 'Entfernen',\n save: 'Speichern',\n cancel: 'Abbrechen',\n loading: 'Laden…',\n value: 'Wert',\n 'callout.note': 'Hinweis',\n 'callout.important': 'Wichtig',\n 'callout.tip': 'Tipp',\n 'callout.caution': 'Vorsicht',\n 'callout.warning': 'Warnung',\n 'date-picker.today': 'Heute',\n 'date-picker.month.heading': 'Monat',\n 'date-picker.quarter.heading': 'Quartal',\n 'date-picker.year.heading': 'Jahr',\n 'chip-set.clear-all': 'Alles löschen',\n 'snackbar.dismiss': 'Schließen',\n 'file-viewer.message.unsupported-filetype':\n 'Diese Datei kann nicht angezeigt werden!',\n 'file-viewer.download': 'Herunterladen',\n 'file-viewer.exit-fullscreen': 'Vollbildmodus beenden',\n 'file-viewer.open-in-fullscreen': 'Im Vollbildmodus öffnen',\n 'file-viewer.open-in-new-tab': 'In einem neuen Tab öffnen',\n 'file-viewer.more-actions': 'Mehr…',\n 'editor-menu.bold': 'Fett',\n 'editor-menu.italic': 'Kursiv',\n 'editor-menu.strikethrough': 'Durchgestrichen',\n 'editor-menu.h1': 'Überschrift 1',\n 'editor-menu.h2': 'Überschrift 2',\n 'editor-menu.h3': 'Überschrift 3',\n 'editor-menu.bulleted-list': 'Aufzählungsliste',\n 'editor-menu.numbered-list': 'Nummerierte Liste',\n 'editor-menu.blockquote': 'Zitatblock',\n 'editor-menu.link': 'Link',\n 'editor-link-menu.text': 'Text',\n 'editor-link-menu.link': 'Link',\n 'editor-menu.code-block': 'Codeblock',\n 'editor-menu.code': 'Code',\n 'editor-image-view.loading': 'Lade Bild: { filename }...',\n 'editor-image-view.failed':\n 'Beim Laden des Bildes ist etwas schief gelaufen: { filename }',\n 'editor-image-view.success': 'Bild: { filename } ist bereit',\n 'editor-image-view.resize-handle':\n 'Ziehen Sie nach rechts oder links, um die Größe des Bildes zu ändern.',\n 'progress-bar': 'Fortschrittsbalken',\n};\n","export default {\n remove: 'Remove',\n save: 'Save',\n cancel: 'Cancel',\n loading: 'Loading…',\n value: 'Value',\n 'callout.note': 'Note',\n 'callout.important': 'Important',\n 'callout.tip': 'Tip',\n 'callout.caution': 'Caution',\n 'callout.warning': 'Warning',\n 'date-picker.today': 'Today',\n 'date-picker.month.heading': 'Month',\n 'date-picker.quarter.heading': 'Quarter',\n 'date-picker.year.heading': 'Year',\n 'chip-set.clear-all': 'Clear all',\n 'snackbar.dismiss': 'Dismiss',\n 'file-viewer.message.unsupported-filetype': 'Cannot display this file!',\n 'file-viewer.download': 'Download',\n 'file-viewer.exit-fullscreen': 'Exit fullscreen',\n 'file-viewer.open-in-fullscreen': 'Open in fullscreen',\n 'file-viewer.open-in-new-tab': 'Open in a new tab',\n 'file-viewer.more-actions': 'More…',\n 'editor-menu.bold': 'Bold',\n 'editor-menu.italic': 'Italic',\n 'editor-menu.strikethrough': 'Strikethrough',\n 'editor-menu.h1': 'Heading 1',\n 'editor-menu.h2': 'Heading 2',\n 'editor-menu.h3': 'Heading 3',\n 'editor-menu.bulleted-list': 'Bulleted list',\n 'editor-menu.numbered-list': 'Numbered list',\n 'editor-menu.blockquote': 'Blockquote',\n 'editor-menu.link': 'Link',\n 'editor-link-menu.text': 'Text',\n 'editor-link-menu.link': 'Link',\n 'editor-menu.code-block': 'Code block',\n 'editor-menu.code': 'Code',\n 'editor-image-view.loading': 'Loading image: { filename }...',\n 'editor-image-view.failed': 'Something went wrong with image: { filename }',\n 'editor-image-view.success': 'Image: { filename } is ready',\n 'editor-image-view.resize-handle':\n 'Drag to right or left to resize the image',\n 'progress-bar': 'Progress bar',\n};\n","export default {\n remove: 'Poista',\n save: 'Tallenna',\n cancel: 'Peruuta',\n loading: 'Ladataan…',\n value: 'Arvo',\n 'callout.note': 'Huomio',\n 'callout.important': 'Tärkeää',\n 'callout.tip': 'Vinkki',\n 'callout.caution': 'Varoitus',\n 'callout.warning': 'Varoitus',\n 'date-picker.today': 'Tänään',\n 'date-picker.month.heading': 'Kuukausi',\n 'date-picker.quarter.heading': 'Vuosineljännes',\n 'date-picker.year.heading': 'Vuosi',\n 'chip-set.clear-all': 'Tyhjennä kaikki',\n 'snackbar.dismiss': 'Sulje',\n 'file-viewer.message.unsupported-filetype':\n 'Tätä tiedostoa ei voi näyttää!',\n 'file-viewer.download': 'Ladata',\n 'file-viewer.exit-fullscreen': 'Poistu koko näytöstä',\n 'file-viewer.open-in-fullscreen': 'Avaa koko näytössä',\n 'file-viewer.open-in-new-tab': 'Avaa uudella välilehdellä',\n 'file-viewer.more-actions': 'Lisää…',\n 'editor-menu.bold': 'Lihavoitu',\n 'editor-menu.italic': 'Kursivoitu',\n 'editor-menu.strikethrough': 'Yliviivaus',\n 'editor-menu.h1': 'Otsikkotaso 1',\n 'editor-menu.h2': 'Otsikkotaso 2',\n 'editor-menu.h3': 'Otsikkotaso 3',\n 'editor-menu.bulleted-list': 'Luettelomerkitty lista',\n 'editor-menu.numbered-list': 'Numeroitu lista',\n 'editor-menu.blockquote': 'Lohkoteksti',\n 'editor-menu.link': 'Lisää linkki',\n 'editor-link-menu.text': 'Teksti',\n 'editor-link-menu.link': 'Linkki',\n 'editor-menu.code-block': 'Koodilohko',\n 'editor-menu.code': 'Koodi',\n 'editor-image-view.loading': 'Ladataan kuvaa: { filename }...',\n 'editor-image-view.failed': 'Jokin meni pieleen kuvan kanssa: { filename }',\n 'editor-image-view.success': 'Kuva: { filename } on valmis',\n 'editor-image-view.resize-handle':\n 'Vedä oikealle tai vasemmalle muuttaaksesi kuvan kokoa',\n 'progress-bar': 'Edistymispalkki',\n};\n","export default {\n remove: 'Supprimer',\n save: 'Enregistrer',\n cancel: 'Annuler',\n loading: 'Chargement…',\n value: 'Valeur',\n 'callout.note': 'Note',\n 'callout.important': 'Important',\n 'callout.tip': 'Conseil',\n 'callout.caution': 'Prudence',\n 'callout.warning': 'Avertissement',\n 'date-picker.today': \"Aujourd'hui\",\n 'date-picker.month.heading': 'Mois',\n 'date-picker.quarter.heading': 'Trimestre',\n 'date-picker.year.heading': 'Année',\n 'chip-set.clear-all': 'Tout effacer',\n 'snackbar.dismiss': 'Fermer',\n 'file-viewer.message.unsupported-filetype':\n \"Impossible d'afficher ce fichier!\",\n 'file-viewer.download': 'Télécharger',\n 'file-viewer.exit-fullscreen': 'Quitter le mode plein écran',\n 'file-viewer.open-in-fullscreen': 'Ouvrir en plein écran',\n 'file-viewer.open-in-new-tab': 'Ouvrir dans un nouvel onglet',\n 'file-viewer.more-actions': 'Plus…',\n 'editor-menu.bold': 'Gras',\n 'editor-menu.italic': 'Italique',\n 'editor-menu.strikethrough': 'Barré',\n 'editor-menu.h1': 'Titre 1',\n 'editor-menu.h2': 'Titre 2',\n 'editor-menu.h3': 'Titre 3',\n 'editor-menu.bulleted-list': 'Liste à puces',\n 'editor-menu.numbered-list': 'Liste numérotée',\n 'editor-menu.blockquote': 'Bloc de citation',\n 'editor-menu.link': 'Lien',\n 'editor-link-menu.text': 'Texte',\n 'editor-link-menu.link': 'Lien',\n 'editor-menu.code-block': 'Bloc de code',\n 'editor-menu.code': 'Code',\n 'editor-image-view.loading': \"Chargement de l'image: { filename }...\",\n 'editor-image-view.failed':\n \"Un problème est survenu avec l'image: { filename }\",\n 'editor-image-view.success': 'Image: { filename } est prête',\n 'editor-image-view.resize-handle':\n \"Faites glisser vers la droite ou la gauche pour redimensionner l'image\",\n 'progress-bar': 'Barre de progression',\n};\n","export default {\n remove: 'Verwijder',\n save: 'Opslaan',\n cancel: 'Annuleren',\n loading: 'Laden…',\n value: 'Waarde',\n 'callout.note': 'Opmerking',\n 'callout.important': 'Belangrijk',\n 'callout.tip': 'Tip',\n 'callout.caution': 'Waarschuwing',\n 'callout.warning': 'Waarschuwing',\n 'date-picker.today': 'Vandaag',\n 'date-picker.month.heading': 'Maand',\n 'date-picker.quarter.heading': 'Kwartaal',\n 'date-picker.year.heading': 'Jaar',\n 'chip-set.clear-all': 'Alles wissen',\n 'snackbar.dismiss': 'Sluiten',\n 'file-viewer.message.unsupported-filetype':\n 'Kan dit bestand niet weergeven!',\n 'file-viewer.download': 'Downloaden',\n 'file-viewer.exit-fullscreen': 'Verlaat volledig scherm',\n 'file-viewer.open-in-fullscreen': 'Open in volledig scherm',\n 'file-viewer.open-in-new-tab': 'Openen op een nieuw tabblad',\n 'file-viewer.more-actions': 'Meer…',\n 'editor-menu.bold': 'Vet',\n 'editor-menu.italic': 'Cursief',\n 'editor-menu.strikethrough': 'Doorhalen',\n 'editor-menu.h1': 'Kopniveau 1',\n 'editor-menu.h2': 'Kopniveau 2',\n 'editor-menu.h3': 'Kopniveau 3',\n 'editor-menu.bulleted-list': 'Opsomming',\n 'editor-menu.numbered-list': 'Genummerde lijst',\n 'editor-menu.blockquote': 'Blokcitaat',\n 'editor-menu.link': 'Link toevoegen',\n 'editor-link-menu.text': 'Tekst',\n 'editor-link-menu.link': 'Link',\n 'editor-menu.code-block': 'Codeblok',\n 'editor-menu.code': 'Code',\n 'editor-image-view.loading': 'Afbeelding wordt geladen: { filename }...',\n 'editor-image-view.failed':\n 'Er is iets misgegaan met de afbeelding: { filename }',\n 'editor-image-view.success': 'Afbeelding: { filename } is klaar',\n 'editor-image-view.resize-handle':\n 'Sleep naar rechts of links om de afbeeldingsgrootte te veranderen',\n 'progress-bar': 'Voortgangsbalk',\n};\n","export default {\n remove: 'Fjerne',\n save: 'Lagre',\n cancel: 'Avbryt',\n loading: 'Laster…',\n value: 'Verdi',\n 'callout.note': 'Note',\n 'callout.important': 'Viktig',\n 'callout.tip': 'Tip',\n 'callout.caution': 'Advarsel',\n 'callout.warning': 'Advarsel',\n 'date-picker.today': 'I dag',\n 'date-picker.month.heading': 'Måned',\n 'date-picker.quarter.heading': 'Kvartal',\n 'date-picker.year.heading': 'År',\n 'chip-set.clear-all': 'Fjern alle',\n 'file-viewer.message.unsupported-filetype': 'Kan ikke vise denne filen!',\n 'file-viewer.download': 'Nedlasting',\n 'file-viewer.exit-fullscreen': 'Gå ut av fullskjerm',\n 'file-viewer.open-in-fullscreen': 'Åpne i fullskjerm',\n 'file-viewer.open-in-new-tab': 'Åpne i en ny fane',\n 'file-viewer.more-actions': 'Mer…',\n 'editor-menu.bold': 'Fet',\n 'editor-menu.italic': 'Kursiv',\n 'editor-menu.strikethrough': 'Gjennomstreking',\n 'editor-menu.h1': 'Overskrift 1',\n 'editor-menu.h2': 'Overskrift 2',\n 'editor-menu.h3': 'Overskrifts 3',\n 'editor-menu.bulleted-list': 'Punktliste',\n 'editor-menu.numbered-list': 'Nummerert liste',\n 'editor-menu.blockquote': 'Blokksitat',\n 'editor-menu.link': 'Legg til lenke',\n 'editor-link-menu.text': 'Tekst',\n 'editor-link-menu.link': 'Lenke',\n 'editor-menu.code-block': 'Kodeblokk',\n 'editor-menu.code': 'Kode',\n 'editor-image-view.loading': 'Laster bilde: { filename }...',\n 'editor-image-view.failed': 'Noe gikk galt med bildet: { filename }',\n 'editor-image-view.success': 'Bilde: { filename } er klart',\n 'editor-image-view.resize-handle':\n 'Dra til høyre eller venstre for å endre størrelsen på bildet',\n 'progress-bar': 'Fremdriftsindikator',\n 'snackbar.dismiss': 'Lukk',\n};\n","export default {\n remove: 'Ta bort',\n save: 'Spara',\n cancel: 'Avbryt',\n loading: 'Laddar…',\n value: 'Värde',\n 'callout.note': 'Obs',\n 'callout.important': 'Viktigt',\n 'callout.tip': 'Tips',\n 'callout.caution': 'Varning',\n 'callout.warning': 'Varning',\n 'date-picker.today': 'Idag',\n 'date-picker.month.heading': 'Månad',\n 'date-picker.quarter.heading': 'Kvartal',\n 'date-picker.year.heading': 'År',\n 'chip-set.clear-all': 'Rensa alla',\n 'snackbar.dismiss': 'Stäng',\n 'file-viewer.message.unsupported-filetype': 'Kan inte visa den här filen!',\n 'file-viewer.download': 'Ladda ner',\n 'file-viewer.exit-fullscreen': 'Avsluta fullskärmsläge',\n 'file-viewer.open-in-fullscreen': 'Öppna i fullskärmsläge',\n 'file-viewer.open-in-new-tab': 'Öppna i ny flik',\n 'file-viewer.more-actions': 'Mer…',\n 'editor-menu.bold': 'Fet',\n 'editor-menu.italic': 'Kursiv',\n 'editor-menu.strikethrough': 'Genomstruken',\n 'editor-menu.h1': 'Rubrik 1',\n 'editor-menu.h2': 'Rubrik 2',\n 'editor-menu.h3': 'Rubrik 3',\n 'editor-menu.bulleted-list': 'Punktlista',\n 'editor-menu.numbered-list': 'Numrerad lista',\n 'editor-menu.blockquote': 'Blockcitat',\n 'editor-menu.link': 'Lägg till länk',\n 'editor-link-menu.text': 'Text',\n 'editor-link-menu.link': 'Länk',\n 'editor-menu.code-block': 'Kodblock',\n 'editor-menu.code': 'Kod',\n 'editor-image-view.loading': 'Laddar bilden: { filename }...',\n 'editor-image-view.failed': 'Något gick fel med bilden: { filename }',\n 'editor-image-view.success': 'Bilden: { filename } är redo',\n 'editor-image-view.resize-handle':\n 'Dra åt höger eller vänster för att ändra storlek på bilden',\n 'progress-bar': 'Förloppsindikator',\n};\n","import da from '../translations/da';\nimport de from '../translations/de';\nimport en from '../translations/en';\nimport fi from '../translations/fi';\nimport fr from '../translations/fr';\nimport nl from '../translations/nl';\nimport no from '../translations/no';\nimport sv from '../translations/sv';\n\nconst allTranslations = {\n da: da,\n de: de,\n en: en,\n fi: fi,\n fr: fr,\n no: no,\n nl: nl,\n sv: sv,\n};\n\nconst REGEX = /\\{\\s*(\\w+)\\s*\\}/g;\n\nexport class Translations {\n public get(key: string, language = 'en', params?: object): string {\n const translation = allTranslations[language][key];\n if (!translation) {\n return key;\n }\n\n return translation.replace(\n REGEX,\n (match: string, mergeCodeKey: string) => {\n return params[mergeCodeKey] || match;\n },\n );\n }\n}\n\nconst translations = new Translations();\nexport default (() => {\n return translations;\n})();\n"],"version":3}
@@ -0,0 +1,195 @@
1
+ import { Plugin, PluginKey } from 'prosemirror-state';
2
+ import { createFileInfo } from '../../../../../util/files';
3
+ import { ImageState, } from '../../../text-editor.types';
4
+ import { Node, Slice, Fragment } from 'prosemirror-model';
5
+ import { imageCache } from './node';
6
+ export const pluginKey = new PluginKey('imageInserterPlugin');
7
+ export const createImageInserterPlugin = (imagePastedCallback, imageRemovedCallback) => {
8
+ return new Plugin({
9
+ key: pluginKey,
10
+ props: {
11
+ handlePaste: (view, event, slice) => {
12
+ return processPasteEvent(view, event, slice);
13
+ },
14
+ handleDOMEvents: {
15
+ imagePasted: (_, event) => {
16
+ imagePastedCallback(event.detail);
17
+ },
18
+ },
19
+ },
20
+ state: {
21
+ init: () => {
22
+ return { insertedImages: {} };
23
+ },
24
+ apply: (tr, pluginState) => {
25
+ const newState = Object.assign({}, pluginState);
26
+ newState.insertedImages = getImagesFromTransaction(tr);
27
+ findAndHandleRemovedImages(imageRemovedCallback, pluginState.insertedImages, newState.insertedImages);
28
+ return newState;
29
+ },
30
+ },
31
+ });
32
+ };
33
+ const getImagesFromTransaction = (tr) => {
34
+ const images = {};
35
+ tr.doc.descendants((node) => {
36
+ if (node.type.name === 'image') {
37
+ images[node.attrs.fileInfoId] = node;
38
+ }
39
+ });
40
+ return images;
41
+ };
42
+ const findAndHandleRemovedImages = (imageRemovedCallback, previousImages, newImages) => {
43
+ const removedKeys = Object.keys(previousImages).filter((key) => !(key in newImages));
44
+ for (const removedKey of removedKeys) {
45
+ const removedImage = previousImages[removedKey];
46
+ const imageInfo = {
47
+ fileInfoId: removedImage.attrs.fileInfoId,
48
+ src: removedImage.attrs.src,
49
+ state: removedImage.attrs.state,
50
+ };
51
+ imageRemovedCallback(imageInfo);
52
+ imageCache.delete(removedImage.attrs.fileInfoId);
53
+ }
54
+ };
55
+ export const imageInserterFactory = (view, base64Data, fileInfo) => {
56
+ return {
57
+ fileInfo: fileInfo,
58
+ insertThumbnail: createThumbnailInserter(view, base64Data, fileInfo),
59
+ insertImage: createImageInserter(view, fileInfo),
60
+ insertFailedThumbnail: createFailedThumbnailInserter(view, fileInfo),
61
+ };
62
+ };
63
+ const createThumbnailInserter = (view, base64Data, fileInfo) => () => {
64
+ const { state, dispatch } = view;
65
+ const { schema } = state;
66
+ const placeholderNode = schema.nodes.image.create({
67
+ src: base64Data,
68
+ alt: fileInfo.filename,
69
+ fileInfoId: fileInfo.id,
70
+ state: ImageState.LOADING,
71
+ });
72
+ const transaction = state.tr.replaceSelectionWith(placeholderNode);
73
+ dispatch(transaction);
74
+ };
75
+ const createImageInserter = (view, fileInfo) => (src) => {
76
+ const { state, dispatch } = view;
77
+ const { schema } = state;
78
+ const tr = state.tr;
79
+ state.doc.descendants((node, pos) => {
80
+ if (node.attrs.fileInfoId === fileInfo.id) {
81
+ const imageNode = schema.nodes.image.create({
82
+ src: src ? src : node.attrs.src,
83
+ alt: fileInfo.filename,
84
+ fileInfoId: fileInfo.id,
85
+ state: ImageState.SUCCESS,
86
+ });
87
+ tr.replaceWith(pos, pos + node.nodeSize, imageNode);
88
+ return false;
89
+ }
90
+ });
91
+ dispatch(tr);
92
+ };
93
+ const createFailedThumbnailInserter = (view, fileInfo) => () => {
94
+ const { state, dispatch } = view;
95
+ const { schema } = state;
96
+ const tr = state.tr;
97
+ state.doc.descendants((node, pos) => {
98
+ if (node.attrs.fileInfoId === fileInfo.id) {
99
+ const errorPlaceholderNode = schema.nodes.image.create({
100
+ src: node.attrs.src,
101
+ alt: fileInfo.filename,
102
+ fileInfoId: fileInfo.id,
103
+ state: ImageState.FAILED,
104
+ });
105
+ tr.replaceWith(pos, pos + node.nodeSize, errorPlaceholderNode);
106
+ return false;
107
+ }
108
+ });
109
+ dispatch(tr);
110
+ };
111
+ /**
112
+ * Check if a given ProseMirror node or fragment contains any image nodes.
113
+ * @param node - The ProseMirror node or fragment to check.
114
+ * @returns A boolean indicating whether the node contains any image nodes.
115
+ */
116
+ const isImageNode = (node) => {
117
+ if (node instanceof Node) {
118
+ if (node.type.name === 'image') {
119
+ return true;
120
+ }
121
+ let found = false;
122
+ node.content.forEach((child) => {
123
+ if (isImageNode(child)) {
124
+ found = true;
125
+ }
126
+ });
127
+ return found;
128
+ }
129
+ else if (node instanceof Fragment) {
130
+ let found = false;
131
+ node.forEach((child) => {
132
+ if (isImageNode(child)) {
133
+ found = true;
134
+ }
135
+ });
136
+ return found;
137
+ }
138
+ return false;
139
+ };
140
+ /**
141
+ * Filter out image nodes from a ProseMirror fragment.
142
+ * @param fragment - The ProseMirror fragment to filter.
143
+ * @returns A new fragment with image nodes removed.
144
+ */
145
+ const filterImageNodes = (fragment) => {
146
+ const filteredChildren = [];
147
+ fragment.forEach((child) => {
148
+ if (!isImageNode(child)) {
149
+ if (child.content.size > 0) {
150
+ const filteredContent = filterImageNodes(child.content);
151
+ const newNode = child.copy(filteredContent);
152
+ filteredChildren.push(newNode);
153
+ }
154
+ else {
155
+ filteredChildren.push(child);
156
+ }
157
+ }
158
+ });
159
+ return Fragment.fromArray(filteredChildren);
160
+ };
161
+ /**
162
+ * Process a paste event and trigger an imagePasted event if an image file is pasted.
163
+ * If an HTML image element is pasted, this image is filtered out from the slice content.
164
+ *
165
+ * @param view - The ProseMirror editor view.
166
+ * @param event - The paste event.
167
+ * @returns A boolean; True if an image file was pasted to prevent default paste behavior, otherwise false.
168
+ */
169
+ const processPasteEvent = (view, event, slice) => {
170
+ const clipboardData = event.clipboardData;
171
+ if (!clipboardData) {
172
+ return false;
173
+ }
174
+ const files = Array.from(clipboardData.files || []);
175
+ for (const file of files) {
176
+ if (file.type.startsWith('image/')) {
177
+ const reader = new FileReader();
178
+ reader.onloadend = () => {
179
+ view.dom.dispatchEvent(new CustomEvent('imagePasted', {
180
+ detail: imageInserterFactory(view, reader.result, createFileInfo(file)),
181
+ }));
182
+ };
183
+ reader.readAsDataURL(file);
184
+ }
185
+ }
186
+ const filteredSlice = new Slice(filterImageNodes(slice.content), slice.openStart, slice.openEnd);
187
+ if (filteredSlice.content.childCount < slice.content.childCount) {
188
+ const { state, dispatch } = view;
189
+ const tr = state.tr.replaceSelection(filteredSlice);
190
+ dispatch(tr);
191
+ return true;
192
+ }
193
+ return files.length > 0;
194
+ };
195
+ //# sourceMappingURL=inserter.js.map