{"mappings":";oIAEA,IAAMA,EAAe,WACfC,EAAgB,YA8CTC,EAAa,iBAQbC,EAAaC,EAAK,OAA0B,CACvD,KAAM,aAEN,YAAU,CACR,MAAO,CACL,aAAc,WACd,eAAgB,CAAA,EAChB,UAAW,GACX,eAAgB,KAIpB,MAAO,aAEP,SAAO,CACL,MAAO,GAAG,KAAK,QAAQ,YAAY,KAGrC,WAAS,CACP,MAAO,CACL,CAAE,IAAK,IAAI,IAIf,WAAW,CAAE,eAAAC,CAAc,EAAE,CAC3B,MAAO,CAAC,KAAMC,EAAgB,KAAK,QAAQ,eAAgBD,CAAc,EAAG,CAAC,GAG/E,aAAW,CACT,MAAO,CACL,iBAAkB,IAAM,CAAC,CAAE,SAAAE,EAAU,MAAAC,CAAK,IACpC,KAAK,QAAQ,eACRA,EAAK,EAAG,WAAW,KAAK,KAAM,KAAK,QAAQ,aAAc,KAAK,QAAQ,SAAS,EAAE,iBAAiBR,EAAc,KAAK,OAAO,cAAcC,CAAa,CAAC,EAAE,IAAG,EAE/JM,EAAS,WAAW,KAAK,KAAM,KAAK,QAAQ,aAAc,KAAK,QAAQ,SAAS,IAK7F,sBAAoB,CAClB,MAAO,CACL,cAAe,IAAM,KAAK,OAAO,SAAS,iBAAgB,IAI9D,eAAa,CACX,IAAIE,EAAYC,EAAkB,CAChC,KAAMR,EACN,KAAM,KAAK,IACZ,CAAA,EAED,OAAI,KAAK,QAAQ,WAAa,KAAK,QAAQ,kBACzCO,EAAYC,EAAkB,CAC5B,KAAMR,EACN,KAAM,KAAK,KACX,UAAW,KAAK,QAAQ,UACxB,eAAgB,KAAK,QAAQ,eAC7B,cAAe,IAAe,KAAK,OAAO,cAAcD,CAAa,EACrE,OAAQ,KAAK,MACd,CAAA,GAEI,CACLQ,GAGL,CAAA","names":["ListItemName","TextStyleName","inputRegex","BulletList","Node","HTMLAttributes","mergeAttributes","commands","chain","inputRule","wrappingInputRule"],"sources":["../esm/npm/@tiptap/extension-bullet-list@2.27.3/node_modules/@tiptap/extension-bullet-list/src/bullet-list.ts"],"sourcesContent":["import { mergeAttributes, Node, wrappingInputRule } from '@tiptap/core'\n\nconst ListItemName = 'listItem'\nconst TextStyleName = 'textStyle'\n\nexport interface BulletListOptions {\n  /**\n   * The node name for the list items\n   * @default 'listItem'\n   * @example 'paragraph'\n   */\n  itemTypeName: string,\n\n  /**\n   * HTML attributes to add to the bullet list element\n   * @default {}\n   * @example { class: 'foo' }\n   */\n  HTMLAttributes: Record\u003cstring, any\u003e,\n\n  /**\n   * Keep the marks when splitting the list\n   * @default false\n   * @example true\n   */\n  keepMarks: boolean,\n\n  /**\n   * Keep the attributes when splitting the list\n   * @default false\n   * @example true\n   */\n  keepAttributes: boolean,\n}\n\ndeclare module '@tiptap/core' {\n  interface Commands\u003cReturnType\u003e {\n    bulletList: {\n      /**\n       * Toggle a bullet list\n       */\n      toggleBulletList: () =\u003e ReturnType,\n    }\n  }\n}\n\n/**\n * Matches a bullet list to a dash or asterisk.\n */\nexport const inputRegex = /^\\s*([-+*])\\s$/\n\n/**\n * This extension allows you to create bullet lists.\n * This requires the ListItem extension\n * @see https://tiptap.dev/api/nodes/bullet-list\n * @see https://tiptap.dev/api/nodes/list-item.\n */\nexport const BulletList = Node.create\u003cBulletListOptions\u003e({\n  name: 'bulletList',\n\n  addOptions() {\n    return {\n      itemTypeName: 'listItem',\n      HTMLAttributes: {},\n      keepMarks: false,\n      keepAttributes: false,\n    }\n  },\n\n  group: 'block list',\n\n  content() {\n    return `${this.options.itemTypeName}+`\n  },\n\n  parseHTML() {\n    return [\n      { tag: 'ul' },\n    ]\n  },\n\n  renderHTML({ HTMLAttributes }) {\n    return ['ul', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n  },\n\n  addCommands() {\n    return {\n      toggleBulletList: () =\u003e ({ commands, chain }) =\u003e {\n        if (this.options.keepAttributes) {\n          return chain().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(ListItemName, this.editor.getAttributes(TextStyleName)).run()\n        }\n        return commands.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)\n      },\n    }\n  },\n\n  addKeyboardShortcuts() {\n    return {\n      'Mod-Shift-8': () =\u003e this.editor.commands.toggleBulletList(),\n    }\n  },\n\n  addInputRules() {\n    let inputRule = wrappingInputRule({\n      find: inputRegex,\n      type: this.type,\n    })\n\n    if (this.options.keepMarks || this.options.keepAttributes) {\n      inputRule = wrappingInputRule({\n        find: inputRegex,\n        type: this.type,\n        keepMarks: this.options.keepMarks,\n        keepAttributes: this.options.keepAttributes,\n        getAttributes: () =\u003e { return this.editor.getAttributes(TextStyleName) },\n        editor: this.editor,\n      })\n    }\n    return [\n      inputRule,\n    ]\n  },\n})\n"],"version":3}
