svelte-parse
Version:
An increidbly relaxed svelte-parser
261 lines (260 loc) • 4.61 kB
JSON
{
"type": "root",
"children": [
{
"type": "svelteScript",
"tagName": "script",
"properties": [],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "\n import Button from '@sveltekit/ui/Button';\n import Dropdown from '@sveltekit/ui/Dropdown';\n\n export let items = [\n {\n label: 'Menu Item 1',\n id: 1\n },\n {\n label: 'Menu Item 2',\n id: 2\n },\n {\n label: 'Menu Item 3',\n id: 3\n }\n ];\n\n export let width = '200px';\n",
"position": {
"start": {
"line": 1,
"column": 9,
"offset": 8
},
"end": {
"line": 21,
"column": 1,
"offset": 321
}
}
}
],
"position": {
"start": {
"line": 1,
"column": 1,
"offset": 0
},
"end": {
"line": 21,
"column": 10,
"offset": 330
}
}
},
{
"type": "text",
"value": "\n\n",
"position": {
"start": {
"line": 21,
"column": 10,
"offset": 330
},
"end": {
"line": 23,
"column": 1,
"offset": 332
}
}
},
{
"type": "svelteComponent",
"tagName": "Dropdown",
"properties": [
{
"type": "svelteProperty",
"name": "items",
"value": [
{
"type": "svelteDynamicContent",
"expression": {
"type": "svelteExpression",
"value": "items",
"position": {
"start": {
"line": 23,
"column": 12,
"offset": 343
},
"end": {
"line": 23,
"column": 17,
"offset": 348
}
}
},
"position": {
"start": {
"line": 23,
"column": 11,
"offset": 342
},
"end": {
"line": 23,
"column": 17,
"offset": 348
}
}
}
],
"modifiers": [],
"shorthand": "expression",
"position": {
"start": {
"line": 23,
"column": 11,
"offset": 342
},
"end": {
"line": 23,
"column": 17,
"offset": 348
}
}
},
{
"type": "svelteProperty",
"name": "width",
"value": [
{
"type": "svelteDynamicContent",
"expression": {
"type": "svelteExpression",
"value": "width",
"position": {
"start": {
"line": 23,
"column": 20,
"offset": 351
},
"end": {
"line": 23,
"column": 25,
"offset": 356
}
}
},
"position": {
"start": {
"line": 23,
"column": 19,
"offset": 350
},
"end": {
"line": 23,
"column": 25,
"offset": 356
}
}
}
],
"modifiers": [],
"shorthand": "expression",
"position": {
"start": {
"line": 23,
"column": 19,
"offset": 350
},
"end": {
"line": 23,
"column": 25,
"offset": 356
}
}
}
],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "\n ",
"position": {
"start": {
"line": 23,
"column": 27,
"offset": 358
},
"end": {
"line": 24,
"column": 3,
"offset": 361
}
}
},
{
"type": "svelteComponent",
"tagName": "Button",
"properties": [],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "Click me",
"position": {
"start": {
"line": 24,
"column": 11,
"offset": 369
},
"end": {
"line": 24,
"column": 19,
"offset": 377
}
}
}
],
"position": {
"start": {
"line": 24,
"column": 3,
"offset": 361
},
"end": {
"line": 24,
"column": 28,
"offset": 386
}
}
},
{
"type": "text",
"value": "\n",
"position": {
"start": {
"line": 24,
"column": 28,
"offset": 386
},
"end": {
"line": 25,
"column": 1,
"offset": 387
}
}
}
],
"position": {
"start": {
"line": 23,
"column": 1,
"offset": 332
},
"end": {
"line": 25,
"column": 12,
"offset": 398
}
}
}
],
"position": {
"start": {
"column": 1,
"line": 1,
"offset": 0
},
"end": {
"line": 25,
"column": 12,
"offset": 398
}
}
}