@limetech/lime-elements 37.61.4 → 37.61.6

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 (34) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/cjs/limel-progress-flow-item.cjs.entry.js +8 -2
  3. package/dist/cjs/limel-progress-flow-item.cjs.entry.js.map +1 -1
  4. package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +33 -6
  5. package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js.map +1 -1
  6. package/dist/cjs/limel-text-editor.cjs.entry.js +1 -1
  7. package/dist/cjs/limel-text-editor.cjs.entry.js.map +1 -1
  8. package/dist/collection/components/progress-flow/progress-flow-item/progress-flow-item.css +14 -16
  9. package/dist/collection/components/progress-flow/progress-flow-item/progress-flow-item.js +7 -1
  10. package/dist/collection/components/progress-flow/progress-flow-item/progress-flow-item.js.map +1 -1
  11. package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.js +31 -7
  12. package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.js.map +1 -1
  13. package/dist/collection/components/text-editor/text-editor.js +1 -1
  14. package/dist/collection/components/text-editor/text-editor.js.map +1 -1
  15. package/dist/collection/test-assets/icons/lock.svg +6 -0
  16. package/dist/esm/limel-progress-flow-item.entry.js +8 -2
  17. package/dist/esm/limel-progress-flow-item.entry.js.map +1 -1
  18. package/dist/esm/limel-prosemirror-adapter.entry.js +33 -6
  19. package/dist/esm/limel-prosemirror-adapter.entry.js.map +1 -1
  20. package/dist/esm/limel-text-editor.entry.js +1 -1
  21. package/dist/esm/limel-text-editor.entry.js.map +1 -1
  22. package/dist/lime-elements/lime-elements.esm.js +1 -1
  23. package/dist/lime-elements/{p-81c918c4.entry.js → p-595fdf97.entry.js} +2 -2
  24. package/dist/lime-elements/{p-81c918c4.entry.js.map → p-595fdf97.entry.js.map} +1 -1
  25. package/dist/lime-elements/p-97571329.entry.js +2 -0
  26. package/dist/lime-elements/p-97571329.entry.js.map +1 -0
  27. package/dist/lime-elements/p-ccc605fe.entry.js +2 -0
  28. package/dist/lime-elements/p-ccc605fe.entry.js.map +1 -0
  29. package/dist/types/components/text-editor/prosemirror-adapter/prosemirror-adapter.d.ts +4 -0
  30. package/package.json +2 -2
  31. package/dist/lime-elements/p-bc63c12e.entry.js +0 -2
  32. package/dist/lime-elements/p-bc63c12e.entry.js.map +0 -1
  33. package/dist/lime-elements/p-df684b38.entry.js +0 -2
  34. package/dist/lime-elements/p-df684b38.entry.js.map +0 -1
@@ -10,11 +10,14 @@ import { t as translate$1 } from './translations-d6a1fb0b.js';
10
10
  import { c as createRandomString } from './random-string-812b1c35.js';
11
11
  import { i as isItem } from './isItem-b0459122.js';
12
12
  import { i as isEqual } from './isEqual-90c6e6fc.js';
13
+ import { d as debounce } from './debounce-9a05c91c.js';
13
14
  import './eq-c1c7f528.js';
14
15
  import './_getNative-93d6bfe9.js';
15
16
  import './isArrayLike-385e0f31.js';
16
17
  import './_defineProperty-2105cb48.js';
17
18
  import './_commonjsHelpers-5ec8f9b7.js';
19
+ import './toNumber-a6ed64f0.js';
20
+ import './isSymbol-5bf20921.js';
18
21
 
19
22
  /** Built-in value references. */
20
23
  var objectCreate = Object.create;
@@ -26072,10 +26075,12 @@ const createActionBarInteractionPlugin = (menuCommandFactory) => {
26072
26075
 
26073
26076
  const prosemirrorAdapterCss = "@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-prosemirror-adapter){display:flex;flex-direction:column}:host(limel-prosemirror-adapter) .toolbar{order:1}:host(limel-prosemirror-adapter) div#editor{order:2;height:100%;flex-grow:1}:host(limel-prosemirror-adapter) div[contenteditable=true]{height:100%}*{box-sizing:border-box}:host(limel-prosemirror-adapter:hover) .toolbar,:host(limel-prosemirror-adapter:focus-within) .toolbar{will-change:grid-template-rows}:host(limel-prosemirror-adapter:hover) limel-action-bar,:host(limel-prosemirror-adapter:focus-within) limel-action-bar{will-change:opacity, padding}:host(limel-prosemirror-adapter:hover) .ProseMirror,:host(limel-prosemirror-adapter:focus-within) .ProseMirror{will-change:padding}.ProseMirror-menubar-wrapper{display:grid;grid-template-rows:auto 1fr}.ProseMirror-textblock-dropdown{min-width:3em}.ProseMirror-tooltip .ProseMirror-menu{width:-webkit-fit-content;width:fit-content;white-space:pre}.toolbar{--action-bar-border-radius:0.25rem;border-radius:var(--action-bar-border-radius);flex-shrink:0;position:sticky;z-index:1;top:0;width:100%;display:grid;grid-template-rows:var(--limel-prosemirror-adapter-toolbar-grid-template-rows);transition-property:grid-template-rows;transition-duration:var(--limel-prosemirror-adapter-toolbar-grid-template-rows-transition-duration);transition-timing-function:var(--limel-prosemirror-adapter-toolbar-transition-timing-function);background-color:rgba(var(--contrast-200), 0.5);backdrop-filter:blur(0.5rem);-webkit-backdrop-filter:blur(0.5rem)}limel-action-bar{min-width:0;transition-property:padding, opacity;transition-duration:var(--limel-prosemirror-adapter-toolbar-grid-template-rows-transition-duration);transition-timing-function:var(--limel-prosemirror-adapter-toolbar-transition-timing-function);opacity:var(--limel-prosemirror-adapter-toolbar-opacity);padding:var(--limel-prosemirror-adapter-action-bar-padding-top-bottom, 0.125rem) 0.25rem;background-color:transparent;overflow:hidden}.ProseMirror{transition-duration:padding;transition-duration:var(--limel-prosemirror-adapter-toolbar-grid-template-rows-transition-duration);transition-timing-function:var(--limel-prosemirror-adapter-toolbar-transition-timing-function);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;padding:var(--limel-text-editor-padding)}.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}limel-portal{width:25rem}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))}";
26074
26077
 
26078
+ const DEBOUNCE_TIMEOUT = 300;
26075
26079
  const ProsemirrorAdapter = class {
26076
26080
  constructor(hostRef) {
26077
26081
  registerInstance(this, hostRef);
26078
26082
  this.change = createEvent(this, "change", 7);
26083
+ this.changeWaiting = false;
26079
26084
  /**
26080
26085
  * Used to stop change event emitting as result of getting updated value from consumer
26081
26086
  */
@@ -26105,13 +26110,16 @@ const ProsemirrorAdapter = class {
26105
26110
  this.handleTransaction = (transaction) => {
26106
26111
  const newState = this.view.state.apply(transaction);
26107
26112
  this.view.updateState(newState);
26108
- if (this.suppressChangeEvent) {
26113
+ if (this.suppressChangeEvent || transaction.getMeta('pointer')) {
26109
26114
  return;
26110
26115
  }
26111
- if (transaction.getMeta('pointer')) {
26116
+ const content = this.contentConverter.serialize(this.view, this.schema);
26117
+ if (content === this.lastEmittedValue) {
26112
26118
  return;
26113
26119
  }
26114
- this.change.emit(this.contentConverter.serialize(this.view, this.schema));
26120
+ this.lastEmittedValue = content;
26121
+ this.changeWaiting = true;
26122
+ this.changeEmitter(content);
26115
26123
  };
26116
26124
  this.handleActionBarItem = (event) => {
26117
26125
  event.preventDefault();
@@ -26156,6 +26164,13 @@ const ProsemirrorAdapter = class {
26156
26164
  this.link = { href: href, text: text };
26157
26165
  this.isLinkMenuOpen = true;
26158
26166
  };
26167
+ this.changeEmitter = debounce((value) => {
26168
+ this.change.emit(value);
26169
+ this.changeWaiting = false;
26170
+ }, DEBOUNCE_TIMEOUT);
26171
+ this.handleBlur = () => {
26172
+ this.changeEmitter.flush();
26173
+ };
26159
26174
  this.contentType = 'markdown';
26160
26175
  this.value = undefined;
26161
26176
  this.language = undefined;
@@ -26166,10 +26181,19 @@ const ProsemirrorAdapter = class {
26166
26181
  this.portalId = createRandomString();
26167
26182
  }
26168
26183
  watchValue(newValue) {
26169
- if (!this.view ||
26170
- newValue === this.contentConverter.serialize(this.view, this.schema)) {
26184
+ if (!this.view) {
26185
+ return;
26186
+ }
26187
+ if (this.changeWaiting) {
26188
+ // A change is pending; do not update the editor's content
26189
+ return;
26190
+ }
26191
+ const currentContent = this.contentConverter.serialize(this.view, this.schema);
26192
+ // If the new value is the same as the current content, do nothing
26193
+ if (newValue === currentContent) {
26171
26194
  return;
26172
26195
  }
26196
+ // Update the editor's content with the new value
26173
26197
  this.updateView(newValue);
26174
26198
  }
26175
26199
  componentWillLoad() {
@@ -26191,8 +26215,10 @@ const ProsemirrorAdapter = class {
26191
26215
  this.host.addEventListener('open-editor-link-menu', this.handleOpenLinkMenu);
26192
26216
  }
26193
26217
  disconnectedCallback() {
26218
+ var _a, _b, _c;
26194
26219
  this.host.removeEventListener('open-editor-link-menu', this.handleOpenLinkMenu);
26195
- this.view.destroy();
26220
+ (_b = (_a = this.view) === null || _a === void 0 ? void 0 : _a.dom) === null || _b === void 0 ? void 0 : _b.removeEventListener('blur', this.handleBlur);
26221
+ (_c = this.view) === null || _c === void 0 ? void 0 : _c.destroy();
26196
26222
  }
26197
26223
  render() {
26198
26224
  return [
@@ -26226,6 +26252,7 @@ const ProsemirrorAdapter = class {
26226
26252
  state: this.createEditorState(initialDoc),
26227
26253
  dispatchTransaction: this.handleTransaction,
26228
26254
  });
26255
+ this.view.dom.addEventListener('blur', this.handleBlur);
26229
26256
  if (this.value) {
26230
26257
  this.updateView(this.value);
26231
26258
  }