@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.
@@ -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 {};
@@ -47,6 +47,7 @@ export declare class rList_definition {
47
47
  can_insert: boolean;
48
48
  onInsert: Function | undefined;
49
49
  inserter_icon: boolean;
50
+ insert_incremental: boolean;
50
51
  onOpen: Function | undefined;
51
52
  downloadable: boolean;
52
53
  downloadableFunc: Function | undefined;
@@ -55,6 +55,7 @@ export class rList_definition {
55
55
  can_insert = false;
56
56
  onInsert = undefined;
57
57
  inserter_icon = false;
58
+ insert_incremental = true;
58
59
  onOpen = undefined;
59
60
  downloadable = false;
60
61
  downloadableFunc = undefined;
@@ -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>
@@ -3,6 +3,7 @@ declare const __propDef: {
3
3
  props: {
4
4
  action: Function;
5
5
  icon?: boolean | undefined;
6
+ incremental?: boolean | undefined;
6
7
  };
7
8
  events: {
8
9
  [evt: string]: CustomEvent<any>;
@@ -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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@humandialog/forms.svelte",
3
- "version": "1.7.10",
3
+ "version": "1.7.11",
4
4
  "description": "Basic Svelte UI components for Object Reef applications",
5
5
  "devDependencies": {
6
6
  "@playwright/test": "^1.28.1",