@limetech/lime-elements 37.28.0 → 37.29.0

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,24 @@
1
+ ## [37.29.0](https://github.com/Lundalogik/lime-elements/compare/v37.28.1...v37.29.0) (2024-05-02)
2
+
3
+
4
+ ### Features
5
+
6
+
7
+ * **text-editor:** enable `helperText` prop ([ded2ba4](https://github.com/Lundalogik/lime-elements/commit/ded2ba40eec78baf804c6dcec4dc1a40f8466253))
8
+
9
+ ### Bug Fixes
10
+
11
+
12
+ * **text-editor:** better align the content with the `label` & `helperText` ([3317bf0](https://github.com/Lundalogik/lime-elements/commit/3317bf006a558e062f90a83e193640e996f9a60a))
13
+
14
+ ## [37.28.1](https://github.com/Lundalogik/lime-elements/compare/v37.28.0...v37.28.1) (2024-05-02)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+
20
+ * **text-editor:** fix broken menu ([968ad40](https://github.com/Lundalogik/lime-elements/commit/968ad4076ea42f877e0dc735a3ee253fe945d01e))
21
+
1
22
  ## [37.28.0](https://github.com/Lundalogik/lime-elements/compare/v37.27.0...v37.28.0) (2024-05-02)
2
23
 
3
24
 
@@ -24718,6 +24718,36 @@ const ProsemirrorAdapter = class {
24718
24718
  constructor(hostRef) {
24719
24719
  index.registerInstance(this, hostRef);
24720
24720
  this.change = index.createEvent(this, "change", 7);
24721
+ this.initializeTextEditor = async () => {
24722
+ this.actionBarItems = textEditorMenuItems;
24723
+ const mySchema = new Schema({
24724
+ nodes: addListNodes(schema$1.spec.nodes, 'paragraph block*', 'block'),
24725
+ marks: schema$1.spec.marks,
24726
+ });
24727
+ // Parse initial content directly if 'value' is provided
24728
+ const initialContentElement = document.createElement('div');
24729
+ initialContentElement.innerHTML = '<p></p>';
24730
+ if (this.value) {
24731
+ initialContentElement.innerHTML =
24732
+ await this.contentConverter.parseAsHTML(this.value, schema$1);
24733
+ }
24734
+ const initialDoc = DOMParser.fromSchema(mySchema).parse(initialContentElement);
24735
+ this.view = new EditorView(this.host.shadowRoot.querySelector('#editor'), {
24736
+ state: EditorState.create({
24737
+ doc: initialDoc,
24738
+ plugins: exampleSetup({
24739
+ schema: mySchema,
24740
+ menuBar: false,
24741
+ }),
24742
+ }),
24743
+ dispatchTransaction: (transaction) => {
24744
+ const newState = this.view.state.apply(transaction);
24745
+ this.view.updateState(newState);
24746
+ this.change.emit(this.contentConverter.serialize(this.view, schema$1));
24747
+ },
24748
+ });
24749
+ this.menuCommandFactory = new MenuCommandFactory(mySchema);
24750
+ };
24721
24751
  this.handleActionBarItem = (event) => {
24722
24752
  event.preventDefault();
24723
24753
  const { text } = event.detail;
@@ -24755,36 +24785,6 @@ const ProsemirrorAdapter = class {
24755
24785
  index.h("div", { id: "editor" }),
24756
24786
  ];
24757
24787
  }
24758
- async initializeTextEditor() {
24759
- this.actionBarItems = textEditorMenuItems;
24760
- const mySchema = new Schema({
24761
- nodes: addListNodes(schema$1.spec.nodes, 'paragraph block*', 'block'),
24762
- marks: schema$1.spec.marks,
24763
- });
24764
- // Parse initial content directly if 'value' is provided
24765
- const initialContentElement = document.createElement('div');
24766
- initialContentElement.innerHTML = '<p></p>';
24767
- if (this.value) {
24768
- initialContentElement.innerHTML =
24769
- await this.contentConverter.parseAsHTML(this.value, schema$1);
24770
- }
24771
- const initialDoc = DOMParser.fromSchema(mySchema).parse(initialContentElement);
24772
- this.view = new EditorView(this.host.shadowRoot.querySelector('#editor'), {
24773
- state: EditorState.create({
24774
- doc: initialDoc,
24775
- plugins: exampleSetup({
24776
- schema: mySchema,
24777
- menuBar: false,
24778
- }),
24779
- }),
24780
- dispatchTransaction: (transaction) => {
24781
- const newState = this.view.state.apply(transaction);
24782
- this.view.updateState(newState);
24783
- this.change.emit(this.contentConverter.serialize(this.view, schema$1));
24784
- },
24785
- });
24786
- this.menuCommandFactory = new MenuCommandFactory(mySchema);
24787
- }
24788
24788
  executeCommand(command) {
24789
24789
  const { state } = this.view;
24790
24790
  const selection = state.selection;