@icure/form 1.0.5 → 1.0.9

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 (97) hide show
  1. package/{lib/components → components}/index.d.ts +0 -0
  2. package/{lib/components → components}/index.js +0 -0
  3. package/components/iqr-form/fields/datePicker.d.ts +10 -0
  4. package/{lib/components → components}/iqr-form/fields/datePicker.js +26 -12
  5. package/components/iqr-form/fields/dateTimePicker.d.ts +10 -0
  6. package/{lib/components → components}/iqr-form/fields/dateTimePicker.js +18 -12
  7. package/components/iqr-form/fields/measureField.d.ts +8 -0
  8. package/{lib/components → components}/iqr-form/fields/measureField.js +13 -12
  9. package/components/iqr-form/fields/multipleChoice.d.ts +8 -0
  10. package/{lib/components → components}/iqr-form/fields/multipleChoice.js +13 -12
  11. package/components/iqr-form/fields/numberField.d.ts +8 -0
  12. package/{lib/components → components}/iqr-form/fields/numberField.js +13 -12
  13. package/{lib/components → components}/iqr-form/fields/textfield.d.ts +0 -0
  14. package/components/iqr-form/fields/textfield.js +138 -0
  15. package/components/iqr-form/fields/timePicker.d.ts +10 -0
  16. package/{lib/components → components}/iqr-form/fields/timePicker.js +18 -12
  17. package/{lib/components → components}/iqr-form/index.d.ts +0 -0
  18. package/{lib/components → components}/iqr-form/index.js +30 -25
  19. package/{lib/components → components}/iqr-form/model/index.d.ts +36 -18
  20. package/{lib/components → components}/iqr-form/model/index.js +9 -4
  21. package/{lib/components → components}/iqr-form/renderer/cards.d.ts +1 -1
  22. package/components/iqr-form/renderer/cards.js +54 -0
  23. package/{lib/components → components}/iqr-form/renderer/form.d.ts +1 -1
  24. package/components/iqr-form/renderer/form.js +91 -0
  25. package/components/iqr-form/renderer/index.d.ts +6 -0
  26. package/components/iqr-form/renderer/index.js +2 -0
  27. package/components/iqr-form-loader/fieldsValuesProviders.d.ts +13 -0
  28. package/components/iqr-form-loader/fieldsValuesProviders.js +46 -0
  29. package/components/iqr-form-loader/formValuesContainer.d.ts +33 -0
  30. package/components/iqr-form-loader/formValuesContainer.js +110 -0
  31. package/components/iqr-form-loader/index.d.ts +3 -0
  32. package/components/iqr-form-loader/index.js +15 -0
  33. package/components/iqr-form-loader/models.d.ts +14 -0
  34. package/{lib/components/iqr-form/renderer/index.js → components/iqr-form-loader/models.js} +0 -0
  35. package/components/iqr-text-field/index.d.ts +26 -0
  36. package/{lib/components → components}/iqr-text-field/index.js +316 -171
  37. package/components/iqr-text-field/plugin/caret-fix-plugin.d.ts +2 -0
  38. package/{lib/components → components}/iqr-text-field/plugin/caret-fix-plugin.js +10 -6
  39. package/components/iqr-text-field/plugin/has-content-class-plugin.d.ts +2 -0
  40. package/{lib/components → components}/iqr-text-field/plugin/has-content-class-plugin.js +7 -5
  41. package/components/iqr-text-field/plugin/mask-plugin.d.ts +2 -0
  42. package/{lib/components → components}/iqr-text-field/plugin/mask-plugin.js +19 -12
  43. package/components/iqr-text-field/plugin/regexp-plugin.d.ts +2 -0
  44. package/{lib/components → components}/iqr-text-field/plugin/regexp-plugin.js +7 -4
  45. package/components/iqr-text-field/prosemirror-commands.d.ts +6 -0
  46. package/{lib/components → components}/iqr-text-field/prosemirror-commands.js +4 -3
  47. package/{lib/components → components}/iqr-text-field/prosemirror-utils.d.ts +1 -1
  48. package/{lib/components → components}/iqr-text-field/prosemirror-utils.js +1 -1
  49. package/{lib/components → components}/iqr-text-field/schema/common-marks.d.ts +1 -1
  50. package/components/iqr-text-field/schema/common-marks.js +93 -0
  51. package/{lib/components → components}/iqr-text-field/schema/date-time-schema.d.ts +0 -0
  52. package/{lib/components → components}/iqr-text-field/schema/date-time-schema.js +13 -13
  53. package/{lib/components → components}/iqr-text-field/schema/decimal-schema.d.ts +0 -0
  54. package/{lib/components → components}/iqr-text-field/schema/decimal-schema.js +4 -4
  55. package/{lib/components → components}/iqr-text-field/schema/index.d.ts +6 -6
  56. package/components/iqr-text-field/schema/index.js +25 -0
  57. package/{lib/components → components}/iqr-text-field/schema/markdown-schema.d.ts +0 -0
  58. package/{lib/components → components}/iqr-text-field/schema/markdown-schema.js +65 -32
  59. package/{lib/components → components}/iqr-text-field/schema/measure-schema.d.ts +0 -0
  60. package/{lib/components → components}/iqr-text-field/schema/measure-schema.js +5 -5
  61. package/{lib/components → components}/iqr-text-field/schema/token-schema.d.ts +0 -0
  62. package/{lib/components → components}/iqr-text-field/schema/token-schema.js +10 -7
  63. package/{lib/components → components}/iqr-text-field/schema/utils.d.ts +1 -1
  64. package/{lib/components → components}/iqr-text-field/schema/utils.js +2 -2
  65. package/{lib/components → components}/iqr-text-field/selection-companion.d.ts +2 -2
  66. package/{lib/components → components}/iqr-text-field/selection-companion.js +13 -12
  67. package/components/iqr-text-field/styles/paths.d.ts +5 -0
  68. package/components/iqr-text-field/styles/paths.js +36 -0
  69. package/{lib/components → components}/iqr-text-field/suggestion-palette.d.ts +11 -15
  70. package/{lib/components → components}/iqr-text-field/suggestion-palette.js +41 -24
  71. package/{lib/index.d.ts → index.d.ts} +0 -0
  72. package/{lib/index.js → index.js} +0 -0
  73. package/package.json +13 -47
  74. package/utils/icure-utils.d.ts +19 -0
  75. package/utils/icure-utils.js +105 -0
  76. package/utils/languages.d.ts +8 -0
  77. package/utils/languages.js +14 -0
  78. package/utils/no-lodash.d.ts +5 -0
  79. package/utils/no-lodash.js +19 -0
  80. package/lib/components/iqr-form/fields/datePicker.d.ts +0 -8
  81. package/lib/components/iqr-form/fields/dateTimePicker.d.ts +0 -8
  82. package/lib/components/iqr-form/fields/measureField.d.ts +0 -8
  83. package/lib/components/iqr-form/fields/multipleChoice.d.ts +0 -8
  84. package/lib/components/iqr-form/fields/numberField.d.ts +0 -8
  85. package/lib/components/iqr-form/fields/textfield.js +0 -86
  86. package/lib/components/iqr-form/fields/timePicker.d.ts +0 -8
  87. package/lib/components/iqr-form/renderer/cards.js +0 -44
  88. package/lib/components/iqr-form/renderer/form.js +0 -45
  89. package/lib/components/iqr-form/renderer/index.d.ts +0 -3
  90. package/lib/components/iqr-text-field/index.d.ts +0 -2
  91. package/lib/components/iqr-text-field/plugin/caret-fix-plugin.d.ts +0 -2
  92. package/lib/components/iqr-text-field/plugin/has-content-class-plugin.d.ts +0 -2
  93. package/lib/components/iqr-text-field/plugin/mask-plugin.d.ts +0 -2
  94. package/lib/components/iqr-text-field/plugin/regexp-plugin.d.ts +0 -2
  95. package/lib/components/iqr-text-field/prosemirror-commands.d.ts +0 -4
  96. package/lib/components/iqr-text-field/schema/common-marks.js +0 -90
  97. package/lib/components/iqr-text-field/schema/index.js +0 -18
@@ -22,7 +22,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
22
22
  };
23
23
  Object.defineProperty(exports, "__esModule", { value: true });
24
24
  // Import the LitElement base class and html helper function
25
- const lit_element_1 = require("lit-element");
25
+ const lit_1 = require("lit");
26
+ const decorators_1 = require("lit/decorators");
26
27
  const prosemirror_state_1 = require("prosemirror-state");
27
28
  const prosemirror_view_1 = require("prosemirror-view");
28
29
  const prosemirror_history_1 = require("prosemirror-history");
@@ -38,8 +39,8 @@ const suggestion_palette_1 = require("./suggestion-palette");
38
39
  const caret_fix_plugin_1 = require("./plugin/caret-fix-plugin");
39
40
  const prosemirror_utils_1 = require("./prosemirror-utils");
40
41
  // @ts-ignore
41
- const lit_element_2 = require("lit-element");
42
- const baseCss = lit_element_2.css `@charset "UTF-8";
42
+ const lit_2 = require("lit");
43
+ const baseCss = lit_2.css `@charset "UTF-8";
43
44
  :host {
44
45
  --bg-color-1: #F44336;
45
46
  }
@@ -431,6 +432,10 @@ h3 {
431
432
  box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.25);
432
433
  border-radius: 8px;
433
434
  padding: 8px;
435
+ width: 220px;
436
+ min-height: 120px;
437
+ max-height: 320px;
438
+ overflow-y: scroll;
434
439
  }
435
440
 
436
441
  .menu .input-container {
@@ -483,6 +488,9 @@ h3 {
483
488
  justify-content: flex-start;
484
489
  box-shadow: none;
485
490
  border: none;
491
+ white-space: nowrap;
492
+ overflow-x: hidden;
493
+ text-overflow: ellipsis;
486
494
  }
487
495
 
488
496
  .menu-container .item:hover {
@@ -520,7 +528,8 @@ span[data-content]:hover::after {
520
528
  background: #274768;
521
529
  color: #FFFFFF;
522
530
  font-size: 9px;
523
- top: -10px;
531
+ line-height: 12px;
532
+ top: -12px;
524
533
  left: 0px;
525
534
  padding: 0px 2px;
526
535
  }
@@ -598,14 +607,12 @@ span[data-content]::before {
598
607
  border-radius: 4px;
599
608
  color: #274768;
600
609
  }
601
-
602
610
  .suggestion-palette ul li svg {
603
611
  height: 12px;
604
612
  width: 12px;
605
613
  border-radius: 4px;
606
614
  transform-origin: center center;
607
615
  }
608
-
609
616
  .suggestion-palette ul li svg path {
610
617
  fill: #809ab4;
611
618
  }
@@ -665,7 +672,7 @@ span.code-count-3::after, span.code-count-3::before {
665
672
  /* background: linear-gradient(90deg, var(--bg-code-color-1) 0%, var(--bg-code-color-2) 100%);*/
666
673
  }`;
667
674
  // @ts-ignore
668
- const kendoCss = lit_element_2.css `.iqr-text-field {
675
+ const kendoCss = lit_2.css `.iqr-text-field {
669
676
  position: relative;
670
677
  padding-top: 1.4em;
671
678
  display: inline-flex;
@@ -789,27 +796,45 @@ const kendoCss = lit_element_2.css `.iqr-text-field {
789
796
  const mask_plugin_1 = require("./plugin/mask-plugin");
790
797
  const has_content_class_plugin_1 = require("./plugin/has-content-class-plugin");
791
798
  const regexp_plugin_1 = require("./plugin/regexp-plugin");
799
+ const no_lodash_1 = require("../../utils/no-lodash");
800
+ const paths_1 = require("./styles/paths");
801
+ const languages_1 = require("../../utils/languages");
792
802
  // Extend the LitElement base class
793
- class IqrTextField extends lit_element_1.LitElement {
803
+ class IqrTextField extends lit_1.LitElement {
794
804
  constructor() {
795
805
  super();
796
806
  this.suggestionStopWords = new Set();
797
807
  this.linksProvider = () => Promise.resolve(undefined);
798
- this.suggestionProvider = () => [];
808
+ this.suggestionProvider = () => __awaiter(this, void 0, void 0, function* () { return []; });
809
+ this.ownersProvider = () => __awaiter(this, void 0, void 0, function* () { return []; });
799
810
  this.codeColorProvider = () => 'XI';
800
811
  this.linkColorProvider = () => 'cat1';
801
- this.codeContentProvider = (codes) => codes.map(c => c.code).join(',');
812
+ this.codeContentProvider = (codes) => codes.map((c) => c.code).join(',');
802
813
  this.schema = 'styled-text-with-codes';
803
814
  this.label = '';
804
815
  this.labelPosition = 'float';
805
816
  this.placeholder = '';
817
+ this.textRegex = '';
806
818
  this.value = '';
807
- this.displayOwnerMenu = false;
819
+ this.defaultLanguage = 'en';
820
+ this.valueProvider = undefined;
821
+ this.metaProvider = undefined;
822
+ this.handleValueChanged = undefined;
823
+ this.handleMetaChanged = undefined;
824
+ this.displayOwnersMenu = false;
825
+ this.ownerInputValue = '';
826
+ this.availableOwners = [];
827
+ this.displayLanguagesMenu = false;
828
+ this.languageInputValue = '';
829
+ this.displayVersionsMenu = false;
808
830
  this.suggestions = false;
809
831
  this.links = false;
810
- this.textRegex = '';
832
+ this.displayedLanguage = this.defaultLanguage;
833
+ this.displayedVersion = '0';
834
+ this.availableLanguages = [this.displayedLanguage];
811
835
  this.windowListeners = [];
812
836
  this.mouseCount = 0;
837
+ this.serviceId = undefined;
813
838
  }
814
839
  connectedCallback() {
815
840
  super.connectedCallback();
@@ -821,157 +846,117 @@ class IqrTextField extends lit_element_1.LitElement {
821
846
  }
822
847
  disconnectedCallback() {
823
848
  super.disconnectedCallback();
824
- this.windowListeners.forEach(wl => window.removeEventListener(wl[0], wl[1]));
849
+ this.windowListeners.forEach((wl) => window.removeEventListener(wl[0], wl[1]));
825
850
  }
826
851
  static get styles() {
827
852
  return [baseCss, kendoCss];
828
853
  }
829
854
  render() {
830
- return lit_element_1.html `
831
- <div id="root" class="iqr-text-field" data-placeholder=${this.placeholder}>
855
+ var _a, _b;
856
+ return lit_1.html `
857
+ <div id="root" class="iqr-text-field" data-placeholder=${this.placeholder}>
832
858
  <label class="iqr-label ${this.labelPosition}"><span>${this.label}</span></label>
833
859
  <div class="iqr-input">
834
860
  <div id="editor"></div>
835
- <div id="extra" class=${'extra' + (this.displayOwnerMenu ? ' forced' : '')}>
836
- <div class="info">
837
- ~${this.owner}
838
- </div>
861
+ <div id="extra" class=${'extra' + (this.displayOwnersMenu ? ' forced' : '')}>
862
+ <div class="info">~${this.owner}</div>
839
863
  <div class="buttons-container">
840
864
  <div class="menu-container">
841
- <button data-content="${this.owner}" @click="${this.toggleOwnerMenu}" class="btn menu-trigger author">
842
- <svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">
843
- <path fill-rule="evenodd" clip-rule="evenodd" d="M10 5C10 7.76142 7.76142 10 5 10C2.23858 10 0 7.76142 0 5C0 2.23858 2.23858 0 5 0C7.76142 0 10 2.23858 10 5ZM7 3C7 4.10457 6.10457 5 5 5C3.89543 5 3 4.10457 3 3C3 1.89543 3.89543 1 5 1C6.10457 1 7 1.89543 7 3ZM5.00001 9C6.53071 9 7.8606 8.1402 8.53306 6.8772C7.62844 6.33518 6.37946 6 5.00001 6C3.62055 6 2.37158 6.33517 1.46695 6.87719C2.13941 8.14019 3.4693 9 5.00001 9Z"/>
844
- </svg>
845
- </button>
846
- ${this.displayOwnerMenu ? lit_element_1.html `
847
- <div id="menu" class="menu">
848
- <div class="input-container">
849
- <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
850
- <path d="M12.9167 11.6667H12.2583L12.025 11.4417C12.8417 10.4917 13.3333 9.25833 13.3333 7.91667C13.3333 4.925 10.9083 2.5 7.91667 2.5C4.925 2.5 2.5 4.925 2.5 7.91667C2.5 10.9083 4.925 13.3333 7.91667 13.3333C9.25833 13.3333 10.4917 12.8417 11.4417 12.025L11.6667 12.2583V12.9167L15.8333 17.075L17.075 15.8333L12.9167 11.6667ZM7.91667 11.6667C5.84167 11.6667 4.16667 9.99167 4.16667 7.91667C4.16667 5.84167 5.84167 4.16667 7.91667 4.16667C9.99167 4.16667 11.6667 5.84167 11.6667 7.91667C11.6667 9.99167 9.99167 11.6667 7.91667 11.6667Z" fill="#809AB4"/>
851
- </svg>
852
- <input>
853
- </div>
854
- <button class="item">
855
- Jean René
856
- </button>
857
- <button class="item">
858
- Jean José
859
- </button>
860
- <button class="item">
861
- Marie-Josée Perrec
862
- </button>
863
- </div>
864
- ` : ''}
865
- </div>
865
+ <button data-content="${this.owner}" @click="${this.toggleOwnerMenu}" class="btn menu-trigger author">${paths_1.ownerPicto}</button>
866
+ ${this.displayOwnersMenu
867
+ ? lit_1.html `
868
+ <div id="menu" class="menu">
869
+ <div class="input-container">${paths_1.searchPicto} <input id="ownerSearch" @input="${this.searchOwner}" /></div>
870
+ ${(_a = this.availableOwners) === null || _a === void 0 ? void 0 : _a.map((x) => lit_1.html `<button @click="${this.handleOwnerButtonClicked(x.id)}" id="${x.id}" class="item">${x.text} @</button>`)}
871
+ </div>
872
+ `
873
+ : ''}
874
+ </div>
866
875
  <div class="menu-container">
867
- <button data-content="01/02/20" class="btn date">
868
- <svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">
869
- <path fill-rule="evenodd" clip-rule="evenodd" d="M2 0C0.895431 0 0 0.89543 0 2V8C0 9.10457 0.89543 10 2 10H8C9.10457 10 10 9.10457 10 8V2C10 0.895431 9.10457 0 8 0H2ZM1 3V8C1 8.55229 1.44772 9 2 9H8C8.55229 9 9 8.55229 9 8V3H1ZM8 8H5V5H8V8Z"/>
870
- </svg>
871
- </button>
876
+ <button data-content="01/02/20" class="btn date">${paths_1.datePicto}</button>
872
877
  </div>
873
878
  <div class="menu-container">
874
- <button data-content="1.0" class="btn version">
875
- <svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">
876
- <path fill-rule="evenodd" clip-rule="evenodd" d="M5 10C7.76141 10 10 7.76142 10 5C10 2.23858 7.76141 0 5 0C2.23859 0 0 2.23858 0 5C0 7.76142 2.23859 10 5 10ZM3.5 3.33172C3.03394 3.16698 2.70001 2.72249 2.70001 2.2C2.70001 1.53726 3.23727 1 3.90002 1C4.56274 1 5.10001 1.53726 5.10001 2.2C5.10001 2.72249 4.76608 3.16698 4.30002 3.33172V5.04041C4.73386 4.59767 5.31354 4.29838 5.96133 4.22028C6.12021 3.74364 6.56998 3.4 7.10001 3.4C7.76276 3.4 8.30002 3.93726 8.30002 4.6C8.30002 5.26274 7.76276 5.8 7.10001 5.8C6.58722 5.8 6.14957 5.47836 5.97775 5.02583C5.13132 5.16293 4.46295 5.8313 4.32584 6.67775C4.77838 6.84955 5.10001 7.28722 5.10001 7.8C5.10001 8.46274 4.56274 9 3.90002 9C3.23727 9 2.70001 8.46274 2.70001 7.8C2.70001 7.27751 3.03394 6.83302 3.5 6.66828V3.33172ZM3.5 7.8C3.5 7.58001 3.67758 7.4015 3.89722 7.4H3.9028C4.12241 7.4015 4.29999 7.58001 4.29999 7.8C4.29999 8.0209 4.12091 8.2 3.89999 8.2C3.67908 8.2 3.5 8.0209 3.5 7.8ZM6.70001 4.59555V4.60446C6.70239 4.82333 6.88055 5.00001 7.09998 5.00001C7.32089 5.00001 7.5 4.82092 7.5 4.60001C7.5 4.37909 7.32089 4.2 7.09998 4.2C6.88055 4.2 6.70239 4.37669 6.70001 4.59555ZM3.89999 2.6C4.12091 2.6 4.29999 2.42091 4.29999 2.2C4.29999 1.97909 4.12091 1.8 3.89999 1.8C3.67908 1.8 3.5 1.97909 3.5 2.2C3.5 2.42091 3.67908 2.6 3.89999 2.6Z"/>
877
- </svg>
878
- </button>
879
+ <button data-content="1.0" class="btn version">${paths_1.versionPicto}</button>
879
880
  </div>
880
881
  <div class="menu-container">
881
- <button data-content="fr" class="btn language">
882
- <svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">
883
- <path d="M5 0C2.2379 0 0 2.2379 0 5C0 7.7621 2.2379 10 5 10C7.7621 10 10 7.7621 10 5C10 2.2379 7.7621 0 5 0ZM9.03226 5C9.03226 5.45363 8.95363 5.89113 8.81452 6.29839H8.40524C8.31855 6.29839 8.23589 6.26411 8.1754 6.20161L7.53024 5.54435C7.43952 5.45161 7.43952 5.3004 7.53226 5.20766L7.78427 4.95565V4.78024C7.78427 4.71976 7.76008 4.66129 7.71774 4.61895L7.52823 4.42944C7.48589 4.3871 7.42742 4.3629 7.36694 4.3629H7.04435C6.91935 4.3629 6.81653 4.26008 6.81653 4.13508C6.81653 4.0746 6.84073 4.01613 6.88306 3.97379L7.07258 3.78427C7.11492 3.74194 7.17339 3.71774 7.23387 3.71774H7.87903C8.00403 3.71774 8.10685 3.61492 8.10685 3.48992V3.3004C8.10685 3.1754 8.00403 3.07258 7.87903 3.07258H7.13911C6.96169 3.07258 6.81653 3.21774 6.81653 3.39516V3.48589C6.81653 3.625 6.72782 3.74798 6.59677 3.79234L5.95968 4.00403C5.89315 4.02621 5.84879 4.08669 5.84879 4.15726V4.20161C5.84879 4.29032 5.77621 4.3629 5.6875 4.3629H5.36492C5.27621 4.3629 5.20363 4.29032 5.20363 4.20161C5.20363 4.1129 5.13105 4.04032 5.04234 4.04032H4.97984C4.91935 4.04032 4.8629 4.0746 4.83468 4.12903L4.64516 4.50605C4.59073 4.61492 4.47984 4.68347 4.35685 4.68347H3.91129C3.73387 4.68347 3.58871 4.53831 3.58871 4.36089V3.85081C3.58871 3.76613 3.62298 3.68347 3.68347 3.62298L4.08871 3.21774C4.18145 3.125 4.23387 2.99798 4.23387 2.86492C4.23387 2.79637 4.27823 2.73387 4.34476 2.71169L5.15121 2.44355C5.18548 2.43145 5.21573 2.41331 5.23992 2.38911L5.78024 1.84879C5.82258 1.80645 5.84677 1.74798 5.84677 1.6875C5.84677 1.5625 5.74395 1.45968 5.61895 1.45968H5.20161L4.87903 1.78226V1.94355C4.87903 2.03226 4.80645 2.10484 4.71774 2.10484H4.39516C4.30645 2.10484 4.23387 2.03226 4.23387 1.94355V1.54032C4.23387 1.48992 4.25806 1.44153 4.29839 1.41129L4.88105 0.97379C4.91935 0.971774 4.95766 0.967742 4.99597 0.967742C7.22379 0.967742 9.03226 2.77621 9.03226 5ZM2.62298 2.84476C2.62298 2.78427 2.64718 2.72581 2.68952 2.68347L3.20161 2.17137C3.24395 2.12903 3.30242 2.10484 3.3629 2.10484C3.4879 2.10484 3.59073 2.20766 3.59073 2.33266V2.65524C3.59073 2.71573 3.56653 2.77419 3.52419 2.81653L3.33468 3.00605C3.29234 3.04839 3.23387 3.07258 3.17339 3.07258H2.85081C2.72581 3.07258 2.62298 2.96976 2.62298 2.84476ZM5.20363 9.02218V8.87903C5.20363 8.70161 5.05847 8.55645 4.88105 8.55645H4.47379C4.25605 8.55645 3.93548 8.4496 3.76008 8.31855L3.3125 7.98185C3.08065 7.80847 2.94556 7.53629 2.94556 7.24798V6.76613C2.94556 6.44355 3.11492 6.14516 3.39113 5.97984L4.25605 5.46169C4.39919 5.37702 4.5625 5.33065 4.72782 5.33065H5.35685C5.57661 5.33065 5.78831 5.40927 5.95363 5.5504L6.8246 6.29839H7.19355C7.36492 6.29839 7.52823 6.36694 7.64919 6.4879L7.99798 6.83669C8.06653 6.90524 8.16129 6.94355 8.25806 6.94355H8.52823C7.875 8.13105 6.6371 8.9496 5.20363 9.02218Z"/>
884
- </svg>
885
- </button>
882
+ <button data-content="${this.displayedLanguage}" @click="${this.toggleLanguageMenu}" class="btn menu-trigger language">${paths_1.i18nPicto}</button>
883
+ ${this.displayLanguagesMenu
884
+ ? lit_1.html `
885
+ <div id="menu" class="menu">
886
+ <div class="input-container">${paths_1.searchPicto} <input /></div>
887
+ ${(_b = this.availableLanguages) === null || _b === void 0 ? void 0 : _b.map((x) => lit_1.html `<button id="${x}" class="item">${languages_1.languageName(x)}</button>`)}
888
+ </div>
889
+ `
890
+ : ''}
886
891
  </div>
887
892
  </div>
888
893
  </div>
889
894
  </div>
890
895
  </div>
891
- `;
896
+ `;
892
897
  }
893
898
  toggleOwnerMenu() {
894
- this.displayOwnerMenu = !this.displayOwnerMenu;
899
+ this.displayOwnersMenu = !this.displayOwnersMenu;
900
+ }
901
+ searchOwner(e) {
902
+ const text = e.target.value;
903
+ setTimeout(() => __awaiter(this, void 0, void 0, function* () {
904
+ if (this._ownerSearch.value === text) {
905
+ if (this.ownersProvider) {
906
+ const availableOwners = yield this.ownersProvider(text.split(' '));
907
+ console.log(availableOwners);
908
+ this.availableOwners = availableOwners;
909
+ }
910
+ }
911
+ }), 300);
912
+ }
913
+ handleOwnerButtonClicked(id) {
914
+ this.handleMetaChanged && this.serviceId && this.handleMetaChanged(this.serviceId, { revision: this.displayedVersion, owner: { id } });
915
+ }
916
+ toggleLanguageMenu() {
917
+ this.displayLanguagesMenu = !this.displayLanguagesMenu;
895
918
  }
896
919
  mouseDown() {
897
920
  this.mouseCount++;
898
- console.log(this.mouseCount);
899
921
  }
900
922
  mouseUp() {
901
923
  var _a, _b, _c, _d, _e, _f, _g;
902
924
  this.mouseCount = 0;
903
925
  if (!((_c = (_b = (_a = this.view) === null || _a === void 0 ? void 0 : _a.dom) === null || _b === void 0 ? void 0 : _b.classList) === null || _c === void 0 ? void 0 : _c.contains('ProseMirror-focused'))) {
904
- (_g = (_f = (_e = (_d = this.view) === null || _d === void 0 ? void 0 : _d.dom) === null || _e === void 0 ? void 0 : _e.parentElement) === null || _f === void 0 ? void 0 : _f.querySelectorAll('.companion')) === null || _g === void 0 ? void 0 : _g.forEach(x => {
926
+ (_g = (_f = (_e = (_d = this.view) === null || _d === void 0 ? void 0 : _d.dom) === null || _e === void 0 ? void 0 : _e.parentElement) === null || _f === void 0 ? void 0 : _f.querySelectorAll('.companion')) === null || _g === void 0 ? void 0 : _g.forEach((x) => {
927
+ ;
905
928
  x.style.display = 'none';
906
929
  });
907
930
  }
908
931
  }
909
932
  firstUpdated() {
910
- var _a;
911
- const schema = this.proseMirrorSchema = schema_1.createSchema(this.schema, (t, c, isC) => isC ? this.codeColorProvider(t, c) : this.linkColorProvider(t, c), this.codeContentProvider);
912
- const tokenizer = markdown_it_1.default("commonmark", { html: false });
913
- this.parser = this.schema === 'date' ? {
914
- parse: (value) => schema.node("paragraph", {}, [
915
- schema.node("date", {}, value ? [schema.text(value)] : []),
916
- ])
917
- } : this.schema === 'date-time' ? {
918
- parse: (value) => {
919
- const date = value ? value.split(' ')[0] : '';
920
- const time = value ? value.split(' ')[1] : '';
921
- return schema.node("paragraph", {}, [
922
- schema.node("date", {}, date && date.length ? [schema.text(date)] : [schema.text(' ')]),
923
- schema.node("time", {}, time && time.length ? [schema.text(time)] : [schema.text(' ')]),
924
- ]);
925
- }
926
- } : this.schema === 'text-document' ? new prosemirror_markdown_1.MarkdownParser(schema, markdown_it_1.default("commonmark", { html: false }), {
927
- blockquote: { block: "blockquote" },
928
- paragraph: { block: "paragraph" },
929
- list_item: { block: "list_item" },
930
- bullet_list: { block: "bullet_list" },
931
- ordered_list: { block: "ordered_list", getAttrs: tok => ({ order: +(tok.attrGet("start") || 1) }) },
932
- heading: { block: "heading", getAttrs: tok => ({ level: +tok.tag.slice(1) }) },
933
- hr: { node: "horizontal_rule" },
934
- image: { node: "image", getAttrs: tok => {
935
- var _a;
936
- return ({
937
- src: tok.attrGet("src"),
938
- title: tok.attrGet("title") || null,
939
- alt: ((_a = (tok.children || [])[0]) === null || _a === void 0 ? void 0 : _a.content) || null
940
- });
941
- } },
942
- hardbreak: { node: "hard_break" },
943
- em: prosemirror_utils_1.hasMark(schema.spec.marks, 'em') ? { mark: "em" } : { ignore: true },
944
- strong: prosemirror_utils_1.hasMark(schema.spec.marks, 'strong') ? { mark: "strong" } : { ignore: true },
945
- link: prosemirror_utils_1.hasMark(schema.spec.marks, 'link') ? { mark: "link", getAttrs: tok => ({
946
- href: tok.attrGet("href"),
947
- title: tok.attrGet("title") || null
948
- }) } : { ignore: true }
949
- }) : new prosemirror_markdown_1.MarkdownParser(schema, { parse: (src, env) => {
950
- return tokenizer.parse(src, env).filter(t => !t.type.startsWith('paragraph_'));
951
- } }, {
952
- em: prosemirror_utils_1.hasMark(schema.spec.marks, 'em') ? { mark: "em" } : { ignore: true },
953
- strong: prosemirror_utils_1.hasMark(schema.spec.marks, 'strong') ? { mark: "strong" } : { ignore: true },
954
- link: prosemirror_utils_1.hasMark(schema.spec.marks, 'link') ? { mark: "link", getAttrs: tok => ({
955
- href: tok.attrGet("href"),
956
- title: tok.attrGet("title") || null
957
- }) } : { ignore: true }
958
- });
933
+ var _a, _b, _c;
934
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
959
935
  const cmp = this;
936
+ const pms = (this.proseMirrorSchema = schema_1.createSchema(this.schema, (t, c, isC) => (isC ? this.codeColorProvider(t, c) : this.linkColorProvider(t, c)), this.codeContentProvider));
937
+ this.parser = this.makeParser(pms);
960
938
  this.container = ((_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('editor')) || undefined;
961
- let br = schema.nodes.hard_break;
962
- const hardBreak = prosemirror_commands_1.chainCommands(prosemirror_commands_1.exitCode, (state, dispatch) => {
963
- dispatch && dispatch(state.tr.replaceSelectionWith(br.create()).scrollIntoView());
964
- return true;
965
- });
966
- const replaceRangeWithSuggestion = (from, to, sug) => __awaiter(this, void 0, void 0, function* () {
967
- const link = yield this.linksProvider(sug);
968
- return link && cmp.view.state.tr.replaceWith(from, to, this.proseMirrorSchema.text(sug.text, [this.proseMirrorSchema.mark('link', link)])) || undefined;
969
- });
970
939
  if (this.container) {
971
- let headingsKeymap = prosemirror_keymap_1.keymap([1, 2, 3, 4, 5, 6].reduce((acc, idx) => {
972
- return Object.assign(acc, { [`Mod-ctrl-${idx}`]: prosemirror_commands_1.setBlockType(this.proseMirrorSchema.nodes.heading, { level: '' + idx }) });
940
+ const br = pms.nodes.hard_break;
941
+ const hardBreak = prosemirror_commands_1.chainCommands(prosemirror_commands_1.exitCode, (state, dispatch) => {
942
+ dispatch && dispatch(state.tr.replaceSelectionWith(br.create()).scrollIntoView());
943
+ return true;
944
+ });
945
+ const replaceRangeWithSuggestion = (from, to, sug) => __awaiter(this, void 0, void 0, function* () {
946
+ const link = yield this.linksProvider(sug);
947
+ return (link && cmp.view && cmp.view.state.tr.replaceWith(from, to, pms.text(sug.text, [pms.mark('link', link)]))) || undefined;
948
+ });
949
+ const headingsKeymap = prosemirror_keymap_1.keymap([1, 2, 3, 4, 5, 6].reduce((acc, idx) => {
950
+ return Object.assign(acc, { [`Mod-ctrl-${idx}`]: prosemirror_commands_1.setBlockType(pms.nodes.heading, { level: '' + idx }) });
973
951
  }, {}));
974
- const parsedDoc = this.parser.parse(this.value);
952
+ const providedValue = this.valueProvider && this.valueProvider();
953
+ const displayedVersionedValue = (_c = (_b = providedValue === null || providedValue === void 0 ? void 0 : providedValue.versions) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.value;
954
+ this.serviceId = providedValue === null || providedValue === void 0 ? void 0 : providedValue.id;
955
+ this.availableLanguages = displayedVersionedValue && Object.keys(displayedVersionedValue).length ? no_lodash_1.sorted(Object.keys(displayedVersionedValue)) : this.availableLanguages;
956
+ if (!this.availableLanguages.includes(this.displayedLanguage)) {
957
+ this.displayedLanguage = this.availableLanguages[0];
958
+ }
959
+ const parsedDoc = this.parser.parse(this.valueProvider ? (displayedVersionedValue === null || displayedVersionedValue === void 0 ? void 0 : displayedVersionedValue[this.displayedLanguage]) || '' : this.value);
975
960
  this.view = new prosemirror_view_1.EditorView(this.container, {
976
961
  state: prosemirror_state_1.EditorState.create({
977
962
  doc: parsedDoc,
@@ -979,102 +964,262 @@ class IqrTextField extends lit_element_1.LitElement {
979
964
  plugins: [
980
965
  caret_fix_plugin_1.caretFixPlugin(),
981
966
  prosemirror_history_1.history(),
982
- this.links ?
983
- new prosemirror_state_1.Plugin({
984
- view(editorView) { return new selection_companion_1.SelectionCompanion(editorView, () => cmp.mouseCount > 0); }
985
- }) : null,
986
- this.suggestions ?
987
- new prosemirror_state_1.Plugin({
988
- view(editorView) { return (cmp.suggestionPalette = new suggestion_palette_1.SuggestionPalette(editorView, (terms) => cmp.suggestionProvider(terms), () => cmp.suggestionStopWords)); }
989
- }) : null,
990
- this.suggestions ?
991
- prosemirror_keymap_1.keymap({
992
- "Tab": (state, dispatch) => { return cmp.suggestionPalette && cmp.suggestionPalette.focusOrInsert(this.view, replaceRangeWithSuggestion) || false; },
993
- "ArrowUp": (state, dispatch) => { return cmp.suggestionPalette && cmp.suggestionPalette.arrowUp() || false; },
994
- "ArrowDown": (state, dispatch) => { return cmp.suggestionPalette && cmp.suggestionPalette.arrowDown() || false; },
995
- "Enter": (state, dispatch) => { return cmp.suggestionPalette && cmp.suggestionPalette.insert(this.view, replaceRangeWithSuggestion) || false; },
996
- }) : null,
997
- prosemirror_keymap_1.keymap({ "Mod-z": prosemirror_history_1.undo, "Mod-Shift-z": prosemirror_history_1.redo }),
998
- prosemirror_keymap_1.keymap(Object.assign({}, schema.marks.strong ? { "Mod-b": prosemirror_commands_1.toggleMark(schema.marks.strong) } : {}, schema.marks.em ? { "Mod-i": prosemirror_commands_1.toggleMark(schema.marks.em) } : {}, schema.nodes.paragraph ? { "Alt-ArrowUp": prosemirror_commands_1.joinUp } : {}, schema.nodes.paragraph ? { "Alt-ArrowDown": prosemirror_commands_1.joinDown } : {}, schema.nodes.paragraph ? { "Alt-Enter": hardBreak } : {}, schema.nodes.paragraph ? { "Shift-Enter": hardBreak } : {}, schema.nodes.ordered_list ? { "Shift-ctrl-1": prosemirror_schema_list_1.wrapInList(schema.nodes.ordered_list) } : {}, schema.nodes.bullet_list ? { "Shift-ctrl-*": prosemirror_schema_list_1.wrapInList(schema.nodes.bullet_list) } : {}, schema.nodes.blockquote ? { "Shift-ctrl-w": prosemirror_commands_2.wrapInIfNeeded(schema.nodes.blockquote) } : {}, schema.nodes.blockquote ? { "Shift-ctrl-u": prosemirror_commands_2.unwrapFrom(schema.nodes.blockquote) } : {}, schema.nodes.paragraph ? { "Mod-ctrl-0": prosemirror_commands_1.setBlockType(schema.nodes.paragraph) } : {}, schema.nodes.paragraph ? { "Shift-ctrl-0": prosemirror_commands_1.setBlockType(schema.nodes.paragraph) } : {}, schema.nodes.list_item ? { "Enter": prosemirror_schema_list_1.splitListItem(schema.nodes.list_item) } : {}, schema.nodes.ordered_list || schema.nodes.bullet_list ? { "Mod-(": prosemirror_schema_list_1.liftListItem(schema.nodes.list_item) } : {}, schema.nodes.ordered_list || schema.nodes.bullet_list ? { "Mod-[": prosemirror_schema_list_1.liftListItem(schema.nodes.list_item) } : {}, schema.nodes.ordered_list || schema.nodes.bullet_list ? { "Mod-)": prosemirror_schema_list_1.sinkListItem(schema.nodes.list_item) } : {}, schema.nodes.ordered_list || schema.nodes.bullet_list ? { "Mod-]": prosemirror_schema_list_1.sinkListItem(schema.nodes.list_item) } : {})),
999
- schema.nodes.heading ? headingsKeymap : null,
967
+ this.links
968
+ ? new prosemirror_state_1.Plugin({
969
+ view(editorView) {
970
+ return new selection_companion_1.SelectionCompanion(editorView, () => cmp.mouseCount > 0);
971
+ },
972
+ })
973
+ : null,
974
+ this.suggestions
975
+ ? new prosemirror_state_1.Plugin({
976
+ view(editorView) {
977
+ return (cmp.suggestionPalette = new suggestion_palette_1.SuggestionPalette(editorView, (terms) => cmp.suggestionProvider(terms), () => cmp.suggestionStopWords));
978
+ },
979
+ })
980
+ : null,
981
+ this.suggestions
982
+ ? prosemirror_keymap_1.keymap({
983
+ Tab: () => {
984
+ return (cmp.suggestionPalette && this.view && cmp.suggestionPalette.focusOrInsert(this.view, replaceRangeWithSuggestion)) || false;
985
+ },
986
+ ArrowUp: () => {
987
+ return (cmp.suggestionPalette && cmp.suggestionPalette.arrowUp()) || false;
988
+ },
989
+ ArrowDown: () => {
990
+ return (cmp.suggestionPalette && cmp.suggestionPalette.arrowDown()) || false;
991
+ },
992
+ Enter: () => {
993
+ return (cmp.suggestionPalette && this.view && cmp.suggestionPalette.insert(this.view, replaceRangeWithSuggestion)) || false;
994
+ },
995
+ })
996
+ : null,
997
+ prosemirror_keymap_1.keymap({ 'Mod-z': prosemirror_history_1.undo, 'Mod-Shift-z': prosemirror_history_1.redo }),
998
+ prosemirror_keymap_1.keymap(Object.assign({}, pms.marks.strong ? { 'Mod-b': prosemirror_commands_1.toggleMark(pms.marks.strong) } : {}, pms.marks.em ? { 'Mod-i': prosemirror_commands_1.toggleMark(pms.marks.em) } : {}, pms.nodes.paragraph ? { 'Alt-ArrowUp': prosemirror_commands_1.joinUp } : {}, pms.nodes.paragraph ? { 'Alt-ArrowDown': prosemirror_commands_1.joinDown } : {}, pms.nodes.paragraph ? { 'Alt-Enter': hardBreak } : {}, pms.nodes.paragraph ? { 'Shift-Enter': hardBreak } : {}, pms.nodes.ordered_list ? { 'Shift-ctrl-1': prosemirror_schema_list_1.wrapInList(pms.nodes.ordered_list) } : {}, pms.nodes.bullet_list ? { 'Shift-ctrl-*': prosemirror_schema_list_1.wrapInList(pms.nodes.bullet_list) } : {}, pms.nodes.blockquote ? { 'Shift-ctrl-w': prosemirror_commands_2.wrapInIfNeeded(pms.nodes.blockquote) } : {}, pms.nodes.blockquote ? { 'Shift-ctrl-u': prosemirror_commands_2.unwrapFrom(pms.nodes.blockquote) } : {}, pms.nodes.paragraph ? { 'Mod-ctrl-0': prosemirror_commands_1.setBlockType(pms.nodes.paragraph) } : {}, pms.nodes.paragraph ? { 'Shift-ctrl-0': prosemirror_commands_1.setBlockType(pms.nodes.paragraph) } : {}, pms.nodes.list_item ? { Enter: prosemirror_schema_list_1.splitListItem(pms.nodes.list_item) } : {}, pms.nodes.ordered_list || pms.nodes.bullet_list ? { 'Mod-(': prosemirror_schema_list_1.liftListItem(pms.nodes.list_item) } : {}, pms.nodes.ordered_list || pms.nodes.bullet_list ? { 'Mod-[': prosemirror_schema_list_1.liftListItem(pms.nodes.list_item) } : {}, pms.nodes.ordered_list || pms.nodes.bullet_list ? { 'Mod-)': prosemirror_schema_list_1.sinkListItem(pms.nodes.list_item) } : {}, pms.nodes.ordered_list || pms.nodes.bullet_list ? { 'Mod-]': prosemirror_schema_list_1.sinkListItem(pms.nodes.list_item) } : {})),
999
+ pms.nodes.heading ? headingsKeymap : null,
1000
1000
  mask_plugin_1.maskPlugin(),
1001
1001
  regexp_plugin_1.regexpPlugin(),
1002
- has_content_class_plugin_1.hasContentClassPlugin(this.shadowRoot),
1003
- prosemirror_keymap_1.keymap(prosemirror_commands_1.baseKeymap)
1004
- ].filter(x => !!x).map(x => x)
1002
+ has_content_class_plugin_1.hasContentClassPlugin(this.shadowRoot || undefined),
1003
+ prosemirror_keymap_1.keymap(prosemirror_commands_1.baseKeymap),
1004
+ ]
1005
+ .filter((x) => !!x)
1006
+ .map((x) => x),
1005
1007
  }),
1006
1008
  dispatchTransaction: (tr) => {
1007
1009
  this.view && this.view.updateState(this.view.state.apply(tr));
1008
1010
  //current state as json in text area
1009
1011
  //this.view && console.log(JSON.stringify(this.view.state.doc.toJSON(), null, 2));
1010
- }
1012
+ },
1011
1013
  });
1012
1014
  }
1013
1015
  }
1016
+ makeParser(pms) {
1017
+ const tokenizer = markdown_it_1.default('commonmark', { html: false });
1018
+ return this.schema === 'date'
1019
+ ? {
1020
+ parse: (value) => pms.node('paragraph', {}, [pms.node('date', {}, value ? [pms.text(value)] : [])]),
1021
+ }
1022
+ : this.schema === 'time'
1023
+ ? {
1024
+ parse: (value) => pms.node('paragraph', {}, [pms.node('time', {}, value ? [pms.text(value)] : [])]),
1025
+ }
1026
+ : this.schema === 'measure'
1027
+ ? {
1028
+ parse: (value) => {
1029
+ const decimal = value ? value.split(' ')[0] : '';
1030
+ const unit = value ? value.split(' ')[1] : '';
1031
+ return pms.node('paragraph', {}, [
1032
+ pms.node('decimal', {}, decimal && decimal.length ? [pms.text(decimal)] : [pms.text(' ')]),
1033
+ pms.node('unit', {}, unit && unit.length ? [pms.text(unit)] : [pms.text(' ')]),
1034
+ ]);
1035
+ },
1036
+ }
1037
+ : this.schema === 'date-time'
1038
+ ? {
1039
+ parse: (value) => {
1040
+ const date = value ? value.split(' ')[0] : '';
1041
+ const time = value ? value.split(' ')[1] : '';
1042
+ return pms.node('paragraph', {}, [
1043
+ pms.node('date', {}, date && date.length ? [pms.text(date)] : [pms.text(' ')]),
1044
+ pms.node('time', {}, time && time.length ? [pms.text(time)] : [pms.text(' ')]),
1045
+ ]);
1046
+ },
1047
+ }
1048
+ : this.schema === 'text-document'
1049
+ ? new prosemirror_markdown_1.MarkdownParser(pms, markdown_it_1.default('commonmark', { html: false }), {
1050
+ blockquote: { block: 'blockquote' },
1051
+ paragraph: { block: 'paragraph' },
1052
+ list_item: { block: 'list_item' },
1053
+ bullet_list: { block: 'bullet_list' },
1054
+ ordered_list: { block: 'ordered_list', getAttrs: (tok) => ({ order: +(tok.attrGet('start') || 1) }) },
1055
+ heading: { block: 'heading', getAttrs: (tok) => ({ level: +tok.tag.slice(1) }) },
1056
+ hr: { node: 'horizontal_rule' },
1057
+ image: {
1058
+ node: 'image',
1059
+ getAttrs: (tok) => {
1060
+ var _a;
1061
+ return ({
1062
+ src: tok.attrGet('src'),
1063
+ title: tok.attrGet('title') || null,
1064
+ alt: ((_a = (tok.children || [])[0]) === null || _a === void 0 ? void 0 : _a.content) || null,
1065
+ });
1066
+ },
1067
+ },
1068
+ hardBreak: { node: 'hard_break' },
1069
+ em: prosemirror_utils_1.hasMark(pms.spec.marks, 'em') ? { mark: 'em' } : { ignore: true },
1070
+ strong: prosemirror_utils_1.hasMark(pms.spec.marks, 'strong') ? { mark: 'strong' } : { ignore: true },
1071
+ link: prosemirror_utils_1.hasMark(pms.spec.marks, 'link')
1072
+ ? {
1073
+ mark: 'link',
1074
+ getAttrs: (tok) => ({
1075
+ href: tok.attrGet('href'),
1076
+ title: tok.attrGet('title') || null,
1077
+ }),
1078
+ }
1079
+ : { ignore: true },
1080
+ })
1081
+ : new prosemirror_markdown_1.MarkdownParser(pms, {
1082
+ parse: (src, env) => {
1083
+ return tokenizer.parse(src, env).filter((t) => !t.type.startsWith('paragraph_'));
1084
+ },
1085
+ }, {
1086
+ em: prosemirror_utils_1.hasMark(pms.spec.marks, 'em') ? { mark: 'em' } : { ignore: true },
1087
+ strong: prosemirror_utils_1.hasMark(pms.spec.marks, 'strong') ? { mark: 'strong' } : { ignore: true },
1088
+ link: prosemirror_utils_1.hasMark(pms.spec.marks, 'link')
1089
+ ? {
1090
+ mark: 'link',
1091
+ getAttrs: (tok) => ({
1092
+ href: tok.attrGet('href'),
1093
+ title: tok.attrGet('title') || null,
1094
+ }),
1095
+ }
1096
+ : { ignore: true },
1097
+ });
1098
+ }
1014
1099
  }
1015
1100
  __decorate([
1016
- lit_element_1.property(),
1101
+ decorators_1.property(),
1017
1102
  __metadata("design:type", Set)
1018
1103
  ], IqrTextField.prototype, "suggestionStopWords", void 0);
1019
1104
  __decorate([
1020
- lit_element_1.property(),
1105
+ decorators_1.property(),
1021
1106
  __metadata("design:type", Function)
1022
1107
  ], IqrTextField.prototype, "linksProvider", void 0);
1023
1108
  __decorate([
1024
- lit_element_1.property(),
1109
+ decorators_1.property(),
1025
1110
  __metadata("design:type", Function)
1026
1111
  ], IqrTextField.prototype, "suggestionProvider", void 0);
1027
1112
  __decorate([
1028
- lit_element_1.property(),
1113
+ decorators_1.property(),
1114
+ __metadata("design:type", Function)
1115
+ ], IqrTextField.prototype, "ownersProvider", void 0);
1116
+ __decorate([
1117
+ decorators_1.property(),
1029
1118
  __metadata("design:type", Function)
1030
1119
  ], IqrTextField.prototype, "codeColorProvider", void 0);
1031
1120
  __decorate([
1032
- lit_element_1.property(),
1121
+ decorators_1.property(),
1033
1122
  __metadata("design:type", Function)
1034
1123
  ], IqrTextField.prototype, "linkColorProvider", void 0);
1035
1124
  __decorate([
1036
- lit_element_1.property(),
1125
+ decorators_1.property(),
1037
1126
  __metadata("design:type", Function)
1038
1127
  ], IqrTextField.prototype, "codeContentProvider", void 0);
1039
1128
  __decorate([
1040
- lit_element_1.property(),
1129
+ decorators_1.property(),
1041
1130
  __metadata("design:type", String)
1042
1131
  ], IqrTextField.prototype, "schema", void 0);
1043
1132
  __decorate([
1044
- lit_element_1.property(),
1045
- __metadata("design:type", String)
1133
+ decorators_1.property(),
1134
+ __metadata("design:type", Object)
1046
1135
  ], IqrTextField.prototype, "label", void 0);
1047
1136
  __decorate([
1048
- lit_element_1.property(),
1137
+ decorators_1.property(),
1049
1138
  __metadata("design:type", String)
1050
1139
  ], IqrTextField.prototype, "labelPosition", void 0);
1051
1140
  __decorate([
1052
- lit_element_1.property(),
1053
- __metadata("design:type", String)
1141
+ decorators_1.property(),
1142
+ __metadata("design:type", Object)
1054
1143
  ], IqrTextField.prototype, "placeholder", void 0);
1055
1144
  __decorate([
1056
- lit_element_1.property(),
1057
- __metadata("design:type", String)
1145
+ decorators_1.property(),
1146
+ __metadata("design:type", Object)
1147
+ ], IqrTextField.prototype, "textRegex", void 0);
1148
+ __decorate([
1149
+ decorators_1.property(),
1150
+ __metadata("design:type", Object)
1058
1151
  ], IqrTextField.prototype, "value", void 0);
1059
1152
  __decorate([
1060
- lit_element_1.property(),
1153
+ decorators_1.property(),
1154
+ __metadata("design:type", Object)
1155
+ ], IqrTextField.prototype, "defaultLanguage", void 0);
1156
+ __decorate([
1157
+ decorators_1.property(),
1061
1158
  __metadata("design:type", String)
1062
1159
  ], IqrTextField.prototype, "owner", void 0);
1063
1160
  __decorate([
1064
- lit_element_1.property(),
1065
- __metadata("design:type", Boolean)
1066
- ], IqrTextField.prototype, "displayOwnerMenu", void 0);
1161
+ decorators_1.property(),
1162
+ __metadata("design:type", Function)
1163
+ ], IqrTextField.prototype, "valueProvider", void 0);
1164
+ __decorate([
1165
+ decorators_1.property(),
1166
+ __metadata("design:type", Function)
1167
+ ], IqrTextField.prototype, "metaProvider", void 0);
1168
+ __decorate([
1169
+ decorators_1.property(),
1170
+ __metadata("design:type", Function)
1171
+ ], IqrTextField.prototype, "handleValueChanged", void 0);
1172
+ __decorate([
1173
+ decorators_1.property(),
1174
+ __metadata("design:type", Function)
1175
+ ], IqrTextField.prototype, "handleMetaChanged", void 0);
1067
1176
  __decorate([
1068
- lit_element_1.property(),
1069
- __metadata("design:type", Boolean)
1177
+ decorators_1.state(),
1178
+ __metadata("design:type", Object)
1179
+ ], IqrTextField.prototype, "displayOwnersMenu", void 0);
1180
+ __decorate([
1181
+ decorators_1.state(),
1182
+ __metadata("design:type", Object)
1183
+ ], IqrTextField.prototype, "ownerInputValue", void 0);
1184
+ __decorate([
1185
+ decorators_1.state(),
1186
+ __metadata("design:type", Array)
1187
+ ], IqrTextField.prototype, "availableOwners", void 0);
1188
+ __decorate([
1189
+ decorators_1.state(),
1190
+ __metadata("design:type", Object)
1191
+ ], IqrTextField.prototype, "displayLanguagesMenu", void 0);
1192
+ __decorate([
1193
+ decorators_1.state(),
1194
+ __metadata("design:type", Object)
1195
+ ], IqrTextField.prototype, "languageInputValue", void 0);
1196
+ __decorate([
1197
+ decorators_1.state(),
1198
+ __metadata("design:type", Object)
1199
+ ], IqrTextField.prototype, "displayVersionsMenu", void 0);
1200
+ __decorate([
1201
+ decorators_1.state(),
1202
+ __metadata("design:type", Object)
1070
1203
  ], IqrTextField.prototype, "suggestions", void 0);
1071
1204
  __decorate([
1072
- lit_element_1.property(),
1073
- __metadata("design:type", Boolean)
1205
+ decorators_1.state(),
1206
+ __metadata("design:type", Object)
1074
1207
  ], IqrTextField.prototype, "links", void 0);
1075
1208
  __decorate([
1076
- lit_element_1.property(),
1077
- __metadata("design:type", String)
1078
- ], IqrTextField.prototype, "textRegex", void 0);
1209
+ decorators_1.state(),
1210
+ __metadata("design:type", Object)
1211
+ ], IqrTextField.prototype, "displayedLanguage", void 0);
1212
+ __decorate([
1213
+ decorators_1.state(),
1214
+ __metadata("design:type", Object)
1215
+ ], IqrTextField.prototype, "displayedVersion", void 0);
1216
+ __decorate([
1217
+ decorators_1.state(),
1218
+ __metadata("design:type", Object)
1219
+ ], IqrTextField.prototype, "availableLanguages", void 0);
1220
+ __decorate([
1221
+ decorators_1.query('#ownerSearch'),
1222
+ __metadata("design:type", HTMLInputElement)
1223
+ ], IqrTextField.prototype, "_ownerSearch", void 0);
1079
1224
  // Register the new element with the browser.
1080
1225
  customElements.define('iqr-text-field', IqrTextField);