UNPKG

svelte-parse

Version:

An increidbly relaxed svelte-parser

996 lines (995 loc) 21.2 kB
{ "type": "root", "children": [ { "type": "svelteBranchingBlock", "name": "if", "branches": [ { "type": "svelteBranch", "name": "if", "expression": { "type": "svelteExpression", "value": "circular", "position": { "start": { "line": 1, "column": 6, "offset": 5 }, "end": { "line": 1, "column": 14, "offset": 13 } } }, "children": [ { "type": "text", "value": "\n ", "position": { "start": { "line": 1, "column": 15, "offset": 14 }, "end": { "line": 2, "column": 5, "offset": 19 } } }, { "type": "svelteElement", "tagName": "div", "properties": [ { "type": "svelteDirective", "name": "use", "value": [ { "type": "svelteDynamicContent", "position": { "start": { "line": 3, "column": 21, "offset": 44 }, "end": { "line": 3, "column": 26, "offset": 49 } }, "expression": { "type": "svelteExpression", "value": "use", "position": { "start": { "line": 3, "column": 22, "offset": 45 }, "end": { "line": 3, "column": 25, "offset": 48 } } } } ], "modifiers": [], "shorthand": "none", "position": { "start": { "line": 3, "column": 9, "offset": 32 }, "end": { "line": 3, "column": 26, "offset": 49 } }, "specifier": "actions" }, { "type": "svelteDirective", "name": "use", "value": [], "modifiers": [], "shorthand": "none", "position": { "start": { "line": 4, "column": 9, "offset": 58 }, "end": { "line": 4, "column": 19, "offset": 68 } }, "specifier": "events" }, { "type": "svelteProperty", "name": "class", "value": [ { "type": "svelteDynamicContent", "position": { "start": { "line": 5, "column": 16, "offset": 84 }, "end": { "line": 5, "column": 25, "offset": 93 } }, "expression": { "type": "svelteExpression", "value": "classes", "position": { "start": { "line": 5, "column": 17, "offset": 85 }, "end": { "line": 5, "column": 24, "offset": 92 } } } } ], "modifiers": [], "shorthand": "none", "position": { "start": { "line": 5, "column": 9, "offset": 77 }, "end": { "line": 5, "column": 26, "offset": 94 } } }, { "type": "svelteProperty", "name": "...props", "value": [ { "type": "svelteDynamicContent", "expression": { "type": "svelteExpression", "value": "...props", "position": { "start": { "line": 6, "column": 10, "offset": 104 }, "end": { "line": 6, "column": 18, "offset": 112 } } }, "position": { "start": { "line": 6, "column": 9, "offset": 103 }, "end": { "line": 6, "column": 18, "offset": 112 } } } ], "modifiers": [], "shorthand": "expression", "position": { "start": { "line": 6, "column": 9, "offset": 103 }, "end": { "line": 6, "column": 18, "offset": 112 } } } ], "selfClosing": false, "children": [ { "type": "svelteElement", "tagName": "slot", "properties": [], "selfClosing": false, "children": [], "position": { "start": { "line": 7, "column": 6, "offset": 119 }, "end": { "line": 7, "column": 19, "offset": 132 } } } ], "position": { "start": { "line": 2, "column": 5, "offset": 19 }, "end": { "line": 7, "column": 25, "offset": 138 } } }, { "type": "text", "value": "\n", "position": { "start": { "line": 7, "column": 25, "offset": 138 }, "end": { "line": 8, "column": 1, "offset": 139 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 8, "column": 1, "offset": 139 } } }, { "type": "svelteBranch", "name": "else", "expression": { "type": "svelteExpression", "value": "" }, "children": [ { "type": "text", "value": "\n ", "position": { "start": { "line": 8, "column": 8, "offset": 146 }, "end": { "line": 9, "column": 5, "offset": 151 } } }, { "type": "svelteElement", "tagName": "div", "properties": [ { "type": "svelteDirective", "name": "use", "value": [ { "type": "svelteDynamicContent", "position": { "start": { "line": 10, "column": 21, "offset": 176 }, "end": { "line": 10, "column": 26, "offset": 181 } }, "expression": { "type": "svelteExpression", "value": "use", "position": { "start": { "line": 10, "column": 22, "offset": 177 }, "end": { "line": 10, "column": 25, "offset": 180 } } } } ], "modifiers": [], "shorthand": "none", "position": { "start": { "line": 10, "column": 9, "offset": 164 }, "end": { "line": 10, "column": 26, "offset": 181 } }, "specifier": "actions" }, { "type": "svelteDirective", "name": "use", "value": [], "modifiers": [], "shorthand": "none", "position": { "start": { "line": 11, "column": 9, "offset": 190 }, "end": { "line": 11, "column": 19, "offset": 200 } }, "specifier": "events" }, { "type": "svelteProperty", "name": "class", "value": [ { "type": "svelteDynamicContent", "position": { "start": { "line": 12, "column": 16, "offset": 216 }, "end": { "line": 12, "column": 25, "offset": 225 } }, "expression": { "type": "svelteExpression", "value": "classes", "position": { "start": { "line": 12, "column": 17, "offset": 217 }, "end": { "line": 12, "column": 24, "offset": 224 } } } } ], "modifiers": [], "shorthand": "none", "position": { "start": { "line": 12, "column": 9, "offset": 209 }, "end": { "line": 12, "column": 26, "offset": 226 } } }, { "type": "svelteProperty", "name": "...props", "value": [ { "type": "svelteDynamicContent", "expression": { "type": "svelteExpression", "value": "...props", "position": { "start": { "line": 13, "column": 10, "offset": 236 }, "end": { "line": 13, "column": 18, "offset": 244 } } }, "position": { "start": { "line": 13, "column": 9, "offset": 235 }, "end": { "line": 13, "column": 18, "offset": 244 } } } ], "modifiers": [], "shorthand": "expression", "position": { "start": { "line": 13, "column": 9, "offset": 235 }, "end": { "line": 13, "column": 18, "offset": 244 } } } ], "selfClosing": false, "children": [ { "type": "svelteElement", "tagName": "div", "properties": [ { "type": "svelteProperty", "name": "class", "value": [ { "type": "text", "value": "visible", "position": { "start": { "line": 15, "column": 16, "offset": 272 }, "end": {} } }, { "type": "text", "value": " ", "position": { "start": { "line": 15, "column": 23, "offset": 279 }, "end": {} } }, { "type": "text", "value": "content", "position": { "start": { "line": 15, "column": 24, "offset": 280 }, "end": { "line": 15, "column": 32, "offset": 288 } } } ], "modifiers": [], "shorthand": "none", "position": { "start": { "line": 15, "column": 9, "offset": 265 }, "end": { "line": 15, "column": 32, "offset": 288 } } } ], "selfClosing": false, "children": [ { "type": "svelteElement", "tagName": "slot", "properties": [ { "type": "svelteProperty", "name": "name", "value": [ { "type": "text", "value": "visible", "position": { "start": { "line": 16, "column": 18, "offset": 306 }, "end": { "line": 16, "column": 26, "offset": 314 } } } ], "modifiers": [], "shorthand": "none", "position": { "start": { "line": 16, "column": 12, "offset": 300 }, "end": { "line": 16, "column": 26, "offset": 314 } } } ], "selfClosing": false, "children": [], "position": { "start": { "line": 16, "column": 6, "offset": 294 }, "end": { "line": 16, "column": 34, "offset": 322 } } } ], "position": { "start": { "line": 14, "column": 6, "offset": 251 }, "end": { "line": 16, "column": 40, "offset": 328 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 16, "column": 40, "offset": 328 }, "end": { "line": 17, "column": 5, "offset": 333 } } }, { "type": "svelteElement", "tagName": "div", "properties": [ { "type": "svelteProperty", "name": "class", "value": [ { "type": "text", "value": "hidden", "position": { "start": { "line": 18, "column": 16, "offset": 354 }, "end": {} } }, { "type": "text", "value": " ", "position": { "start": { "line": 18, "column": 22, "offset": 360 }, "end": {} } }, { "type": "text", "value": "content", "position": { "start": { "line": 18, "column": 23, "offset": 361 }, "end": { "line": 18, "column": 31, "offset": 369 } } } ], "modifiers": [], "shorthand": "none", "position": { "start": { "line": 18, "column": 9, "offset": 347 }, "end": { "line": 18, "column": 31, "offset": 369 } } } ], "selfClosing": false, "children": [ { "type": "svelteElement", "tagName": "slot", "properties": [ { "type": "svelteProperty", "name": "name", "value": [ { "type": "text", "value": "hidden", "position": { "start": { "line": 19, "column": 18, "offset": 387 }, "end": { "line": 19, "column": 25, "offset": 394 } } } ], "modifiers": [], "shorthand": "none", "position": { "start": { "line": 19, "column": 12, "offset": 381 }, "end": { "line": 19, "column": 25, "offset": 394 } } } ], "selfClosing": false, "children": [], "position": { "start": { "line": 19, "column": 6, "offset": 375 }, "end": { "line": 19, "column": 33, "offset": 402 } } } ], "position": { "start": { "line": 17, "column": 5, "offset": 333 }, "end": { "line": 19, "column": 39, "offset": 408 } } } ], "position": { "start": { "line": 9, "column": 5, "offset": 151 }, "end": { "line": 19, "column": 45, "offset": 414 } } }, { "type": "text", "value": "\n", "position": { "start": { "line": 19, "column": 45, "offset": 414 }, "end": { "line": 20, "column": 1, "offset": 415 } } } ], "position": { "start": { "line": 8, "column": 1, "offset": 139 }, "end": { "line": 20, "column": 1, "offset": 415 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 20, "column": 6, "offset": 420 } } }, { "type": "text", "value": "\n\n", "position": { "start": { "line": 20, "column": 6, "offset": 420 }, "end": { "line": 22, "column": 1, "offset": 422 } } }, { "type": "svelteScript", "tagName": "script", "properties": [ { "type": "svelteProperty", "name": "context", "value": [ { "type": "text", "value": "module", "position": { "start": { "line": 22, "column": 18, "offset": 439 }, "end": { "line": 22, "column": 25, "offset": 446 } } } ], "modifiers": [], "shorthand": "none", "position": { "start": { "line": 22, "column": 9, "offset": 430 }, "end": { "line": 22, "column": 25, "offset": 446 } } } ], "selfClosing": false, "children": [ { "type": "text", "value": "\n import { exclude, eventsBuilder, actions, clsxd } from '../../lib'\n import { current_component } from 'svelte/internal'\n", "position": { "start": { "line": 22, "column": 26, "offset": 447 }, "end": { "line": 25, "column": 1, "offset": 575 } } } ], "position": { "start": { "line": 22, "column": 1, "offset": 422 }, "end": { "line": 25, "column": 10, "offset": 584 } } }, { "type": "text", "value": "\n\n", "position": { "start": { "line": 25, "column": 10, "offset": 584 }, "end": { "line": 27, "column": 1, "offset": 586 } } }, { "type": "svelteScript", "tagName": "script", "properties": [], "selfClosing": false, "children": [ { "type": "text", "value": "\n const events = eventsBuilder(current_component)\n\n export let use = [];\n let className = '';\n export { className as class };\n\n export let animation = '';\n export let direction = '';\n export let size = '';\n export let instant = false;\n export let circular = false;\n export let active = false;\n export let disabled = false;\n\n $: classes = clsxd(\n 'ui',\n animation,\n size,\n direction,\n circular && 'circular image',\n { 'active': active },\n { 'instant': instant },\n { 'disabled': disabled },\n className,\n 'reveal'\n )\n $: props = exclude($$props, ['use', 'class', 'animation', 'direction', 'size', 'instant', 'circular', 'active', 'disabled'])\n", "position": { "start": { "line": 27, "column": 9, "offset": 594 }, "end": { "line": 55, "column": 1, "offset": 1346 } } } ], "position": { "start": { "line": 27, "column": 1, "offset": 586 }, "end": { "line": 55, "column": 10, "offset": 1355 } } } ], "position": { "start": { "column": 1, "line": 1, "offset": 0 }, "end": { "line": 55, "column": 10, "offset": 1355 } } }