UNPKG

storybook-addon-playground

Version:

A playground to enable consumers learn how to use the component library or to reproduce bugs

19 lines (17 loc) 611 B
function parseTagFromLineText(lineText) { return lineText.match(/<([a-zA-Z0-9]+)/)?.[1]; } function getEditorStateInfo(state) { const cursorPos = state.selection.main.head; const line = state.doc.lineAt(cursorPos); const lineTextUpToCursor = line.text.substring(0, cursorPos - line.from); const lineTextAfterCursor = line.text.substring(cursorPos - line.from); return { cursorPos, fullLineText: line.text, lineTextUpToCursor, lineTextAfterCursor, }; } export { getEditorStateInfo, parseTagFromLineText }; //# sourceMappingURL=extensions-utils.js.map