@ni/nimble-components 20.3.1 → 20.3.2

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.
@@ -16288,7 +16288,7 @@
16288
16288
 
16289
16289
  /**
16290
16290
  * Do not edit directly
16291
- * Generated on Fri, 15 Sep 2023 20:18:18 GMT
16291
+ * Generated on Fri, 15 Sep 2023 20:59:38 GMT
16292
16292
  */
16293
16293
 
16294
16294
  const Information100DarkUi = "#a46eff";
@@ -44882,6 +44882,66 @@ img.ProseMirror-separator {
44882
44882
  group: 'inline',
44883
44883
  });
44884
44884
 
44885
+ const HardBreak = Node$1.create({
44886
+ name: 'hardBreak',
44887
+ addOptions() {
44888
+ return {
44889
+ keepMarks: true,
44890
+ HTMLAttributes: {},
44891
+ };
44892
+ },
44893
+ inline: true,
44894
+ group: 'inline',
44895
+ selectable: false,
44896
+ parseHTML() {
44897
+ return [
44898
+ { tag: 'br' },
44899
+ ];
44900
+ },
44901
+ renderHTML({ HTMLAttributes }) {
44902
+ return ['br', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)];
44903
+ },
44904
+ renderText() {
44905
+ return '\n';
44906
+ },
44907
+ addCommands() {
44908
+ return {
44909
+ setHardBreak: () => ({ commands, chain, state, editor, }) => {
44910
+ return commands.first([
44911
+ () => commands.exitCode(),
44912
+ () => commands.command(() => {
44913
+ const { selection, storedMarks } = state;
44914
+ if (selection.$from.parent.type.spec.isolating) {
44915
+ return false;
44916
+ }
44917
+ const { keepMarks } = this.options;
44918
+ const { splittableMarks } = editor.extensionManager;
44919
+ const marks = storedMarks
44920
+ || (selection.$to.parentOffset && selection.$from.marks());
44921
+ return chain()
44922
+ .insertContent({ type: this.name })
44923
+ .command(({ tr, dispatch }) => {
44924
+ if (dispatch && marks && keepMarks) {
44925
+ const filteredMarks = marks
44926
+ .filter(mark => splittableMarks.includes(mark.type.name));
44927
+ tr.ensureMarks(filteredMarks);
44928
+ }
44929
+ return true;
44930
+ })
44931
+ .run();
44932
+ }),
44933
+ ]);
44934
+ },
44935
+ };
44936
+ },
44937
+ addKeyboardShortcuts() {
44938
+ return {
44939
+ 'Mod-Enter': () => this.editor.commands.setHardBreak(),
44940
+ 'Shift-Enter': () => this.editor.commands.setHardBreak(),
44941
+ };
44942
+ },
44943
+ });
44944
+
44885
44945
  const styles$q = css `
44886
44946
  .positioning-region {
44887
44947
  display: flex;
@@ -58508,8 +58568,9 @@ img.ProseMirror-separator {
58508
58568
  const supportedTokenizerRules = zeroTokenizerConfiguration.enable([
58509
58569
  'emphasis',
58510
58570
  'list',
58571
+ 'escape',
58511
58572
  'autolink',
58512
- 'escape'
58573
+ 'newline'
58513
58574
  ]);
58514
58575
  supportedTokenizerRules.validateLink = href => /^https?:\/\//i.test(href);
58515
58576
  /**
@@ -58595,7 +58656,8 @@ img.ProseMirror-separator {
58595
58656
  orderedList: orderedListNode,
58596
58657
  doc: defaultMarkdownSerializer.nodes.doc,
58597
58658
  paragraph: defaultMarkdownSerializer.nodes.paragraph,
58598
- text: defaultMarkdownSerializer.nodes.text
58659
+ text: defaultMarkdownSerializer.nodes.text,
58660
+ hardBreak: defaultMarkdownSerializer.nodes.hard_break
58599
58661
  };
58600
58662
  const marks = {
58601
58663
  italic: defaultMarkdownSerializer.marks.em,
@@ -58862,6 +58924,7 @@ img.ProseMirror-separator {
58862
58924
  placeholder: '',
58863
58925
  showOnlyWhenEditable: false
58864
58926
  }),
58927
+ HardBreak,
58865
58928
  customLink.configure({
58866
58929
  // HTMLAttribute cannot be in camelCase as we want to match it with the name in Tiptap
58867
58930
  // eslint-disable-next-line @typescript-eslint/naming-convention