svelte-parse
Version:
An increidbly relaxed svelte-parser
353 lines (352 loc) • 7.35 kB
JSON
{
"type": "root",
"children": [
{
"type": "svelteElement",
"tagName": "i",
"properties": [
{
"type": "svelteDirective",
"name": "use",
"value": [
{
"type": "svelteDynamicContent",
"position": {
"start": {
"line": 2,
"column": 17,
"offset": 20
},
"end": {
"line": 2,
"column": 22,
"offset": 25
}
},
"expression": {
"type": "svelteExpression",
"value": "use",
"position": {
"start": {
"line": 2,
"column": 18,
"offset": 21
},
"end": {
"line": 2,
"column": 21,
"offset": 24
}
}
}
}
],
"modifiers": [],
"shorthand": "none",
"position": {
"start": {
"line": 2,
"column": 5,
"offset": 8
},
"end": {
"line": 2,
"column": 22,
"offset": 25
}
},
"specifier": "actions"
},
{
"type": "svelteDirective",
"name": "use",
"value": [],
"modifiers": [],
"shorthand": "none",
"position": {
"start": {
"line": 3,
"column": 5,
"offset": 30
},
"end": {
"line": 3,
"column": 15,
"offset": 40
}
},
"specifier": "events"
},
{
"type": "svelteProperty",
"name": "class",
"value": [
{
"type": "svelteDynamicContent",
"position": {
"start": {
"line": 4,
"column": 12,
"offset": 52
},
"end": {
"line": 20,
"column": 7,
"offset": 479
}
},
"expression": {
"type": "svelteExpression",
"value": "clsxd(\n name,\n size,\n color,\n [flipped, { 'flipped': flipped }],\n [rotated, { 'rotated': rotated }],\n [corner, { 'corner': corner }],\n bordered && 'bordered',\n circular && 'circular',\n disabled && 'disabled',\n inverted && 'inverted',\n loading && 'loading',\n fitted && 'fitted',\n link && 'link',\n className,\n 'icon'\n )",
"position": {
"start": {
"line": 4,
"column": 13,
"offset": 53
},
"end": {
"line": 20,
"column": 6,
"offset": 478
}
}
}
}
],
"modifiers": [],
"shorthand": "none",
"position": {
"start": {
"line": 4,
"column": 5,
"offset": 45
},
"end": {
"line": 20,
"column": 8,
"offset": 480
}
}
},
{
"type": "svelteProperty",
"name": "...exclude($$props, [\n 'use', 'class', 'color', 'name', 'size', 'corner', 'flipped', 'rotated', 'bordered', \n 'circular', 'disabled', 'inverted', 'loading', 'fitted', 'link', 'flipped', 'roated'\n ])",
"value": [
{
"type": "svelteDynamicContent",
"expression": {
"type": "svelteExpression",
"value": "...exclude($$props, [\n 'use', 'class', 'color', 'name', 'size', 'corner', 'flipped', 'rotated', 'bordered', \n 'circular', 'disabled', 'inverted', 'loading', 'fitted', 'link', 'flipped', 'roated'\n ])",
"position": {
"start": {
"line": 21,
"column": 6,
"offset": 486
},
"end": {
"line": 24,
"column": 7,
"offset": 701
}
}
},
"position": {
"start": {
"line": 21,
"column": 5,
"offset": 485
},
"end": {
"line": 24,
"column": 7,
"offset": 701
}
}
}
],
"modifiers": [],
"shorthand": "expression",
"position": {
"start": {
"line": 21,
"column": 5,
"offset": 485
},
"end": {
"line": 24,
"column": 7,
"offset": 701
}
}
}
],
"selfClosing": false,
"children": [],
"position": {
"start": {
"line": 1,
"column": 1,
"offset": 0
},
"end": {
"line": 25,
"column": 6,
"offset": 708
}
}
},
{
"type": "text",
"value": "\n\n",
"position": {
"start": {
"line": 25,
"column": 6,
"offset": 708
},
"end": {
"line": 27,
"column": 1,
"offset": 710
}
}
},
{
"type": "svelteScript",
"tagName": "script",
"properties": [
{
"type": "svelteProperty",
"name": "context",
"value": [
{
"type": "text",
"value": "module",
"position": {
"start": {
"line": 27,
"column": 18,
"offset": 727
},
"end": {
"line": 27,
"column": 25,
"offset": 734
}
}
}
],
"modifiers": [],
"shorthand": "none",
"position": {
"start": {
"line": 27,
"column": 9,
"offset": 718
},
"end": {
"line": 27,
"column": 25,
"offset": 734
}
}
}
],
"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": 27,
"column": 26,
"offset": 735
},
"end": {
"line": 30,
"column": 1,
"offset": 863
}
}
}
],
"position": {
"start": {
"line": 27,
"column": 1,
"offset": 710
},
"end": {
"line": 30,
"column": 10,
"offset": 872
}
}
},
{
"type": "text",
"value": "\n\n",
"position": {
"start": {
"line": 30,
"column": 10,
"offset": 872
},
"end": {
"line": 32,
"column": 1,
"offset": 874
}
}
},
{
"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 color = '';\n export let name = '';\n export let corner = '';\n export let size = '';\n export let flipped = '';\n export let rotated = '';\n export let bordered = false;\n export let circular = false;\n export let disabled = false;\n export let inverted = false;\n export let loading = false;\n export let fitted = false;\n export let link = false;\n",
"position": {
"start": {
"line": 32,
"column": 9,
"offset": 882
},
"end": {
"line": 52,
"column": 1,
"offset": 1410
}
}
}
],
"position": {
"start": {
"line": 32,
"column": 1,
"offset": 874
},
"end": {
"line": 52,
"column": 10,
"offset": 1419
}
}
}
],
"position": {
"start": {
"column": 1,
"line": 1,
"offset": 0
},
"end": {
"line": 52,
"column": 10,
"offset": 1419
}
}
}