@humandialog/forms.svelte 1.7.10 → 1.7.11
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/components/document/editor.svelte +7 -1
- package/components/document/editor.svelte.d.ts +4 -0
- package/components/list/List.d.ts +1 -0
- package/components/list/List.js +1 -0
- package/components/list/list.inserter.svelte +2 -0
- package/components/list/list.inserter.svelte.d.ts +1 -0
- package/components/list/list.svelte +1 -1
- package/package.json +1 -1
|
@@ -864,7 +864,7 @@ export function removeTemporaryImage(temporarySrc) {
|
|
|
864
864
|
editor.commands.deleteRange(image.range);
|
|
865
865
|
}
|
|
866
866
|
export function addLink(title, href) {
|
|
867
|
-
editor.chain().setLink({ href }).insertContent(title).unsetMark("link").insertContent(" ").focus().run();
|
|
867
|
+
editor.chain().insertContent(" ").setLink({ href }).insertContent(title).unsetMark("link").insertContent(" ").focus().run();
|
|
868
868
|
}
|
|
869
869
|
export function getInnerHtml() {
|
|
870
870
|
return editor.getHTML();
|
|
@@ -1045,6 +1045,12 @@ export function preventBlur() {
|
|
|
1045
1045
|
export function hasChanged() {
|
|
1046
1046
|
return hasChangedValue;
|
|
1047
1047
|
}
|
|
1048
|
+
export function getCurrentCursorPos() {
|
|
1049
|
+
return editor.state.selection.$anchor.pos;
|
|
1050
|
+
}
|
|
1051
|
+
export function setCursorPos(num) {
|
|
1052
|
+
editor.commands.focus(num);
|
|
1053
|
+
}
|
|
1048
1054
|
const paletteMarksCommands = () => [
|
|
1049
1055
|
{ caption: i18n({ en: "Bold", es: "Negrita", pl: "Pogrubiony" }), description: "Marks text as bolded", tags: "strong,bold", icon: FaBold, on_choice: makeBold, is_active: () => editor?.isActive("bold") },
|
|
1050
1056
|
{ caption: i18n({ en: "Italic", es: "Cursiva", pl: "Kursywa" }), description: "Marks text as italic", tags: "italic,em", icon: FaItalic, on_choice: makeItalic, is_active: () => editor?.isActive("italic") },
|
|
@@ -88,6 +88,8 @@ declare const __propDef: {
|
|
|
88
88
|
isActiveHorizontalRule?: (() => boolean) | undefined;
|
|
89
89
|
preventBlur?: (() => void) | undefined;
|
|
90
90
|
hasChanged?: (() => boolean) | undefined;
|
|
91
|
+
getCurrentCursorPos?: (() => any) | undefined;
|
|
92
|
+
setCursorPos?: ((num: any) => void) | undefined;
|
|
91
93
|
};
|
|
92
94
|
events: {
|
|
93
95
|
click: MouseEvent;
|
|
@@ -165,5 +167,7 @@ export default class Editor extends SvelteComponentTyped<EditorProps, EditorEven
|
|
|
165
167
|
get isActiveHorizontalRule(): () => boolean;
|
|
166
168
|
get preventBlur(): () => void;
|
|
167
169
|
get hasChanged(): () => boolean;
|
|
170
|
+
get getCurrentCursorPos(): () => any;
|
|
171
|
+
get setCursorPos(): (num: any) => void;
|
|
168
172
|
}
|
|
169
173
|
export {};
|
package/components/list/List.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
<script>import { getContext } from "svelte";
|
|
2
2
|
export let action;
|
|
3
3
|
export let icon = false;
|
|
4
|
+
export let incremental = true;
|
|
4
5
|
let definition = getContext("rList-definition");
|
|
5
6
|
definition.can_insert = true;
|
|
6
7
|
definition.onInsert = action;
|
|
7
8
|
definition.inserter_icon = icon;
|
|
9
|
+
definition.insert_incremental = incremental;
|
|
8
10
|
</script>
|
|
@@ -187,7 +187,7 @@ export async function addRowAfter(after = null) {
|
|
|
187
187
|
if (detail.cancel)
|
|
188
188
|
activate_after_dom_update = last_activated_element;
|
|
189
189
|
else {
|
|
190
|
-
if (detail.incremental) {
|
|
190
|
+
if (detail.incremental && definition.insert_incremental) {
|
|
191
191
|
let current_active = getActive(selectionKey);
|
|
192
192
|
await addRowAfter(current_active);
|
|
193
193
|
}
|