@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 +21 -0
- package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +30 -30
- package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-text-editor.cjs.entry.js +20 -7
- package/dist/cjs/limel-text-editor.cjs.entry.js.map +1 -1
- package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.js +30 -30
- package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.js.map +1 -1
- package/dist/collection/components/text-editor/text-editor.css +5 -1
- package/dist/collection/components/text-editor/text-editor.js +20 -7
- package/dist/collection/components/text-editor/text-editor.js.map +1 -1
- package/dist/esm/limel-prosemirror-adapter.entry.js +30 -30
- package/dist/esm/limel-prosemirror-adapter.entry.js.map +1 -1
- package/dist/esm/limel-text-editor.entry.js +21 -8
- package/dist/esm/limel-text-editor.entry.js.map +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/p-357a0c67.entry.js +2 -0
- package/dist/lime-elements/p-357a0c67.entry.js.map +1 -0
- package/dist/lime-elements/{p-3619d8ca.entry.js → p-b4669729.entry.js} +2 -2
- package/dist/lime-elements/{p-3619d8ca.entry.js.map → p-b4669729.entry.js.map} +1 -1
- package/dist/types/components/text-editor/text-editor.d.ts +4 -1
- package/package.json +1 -1
- package/dist/lime-elements/p-e9d2525d.entry.js +0 -2
- package/dist/lime-elements/p-e9d2525d.entry.js.map +0 -1
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;
|