svelte-parse
Version:
An increidbly relaxed svelte-parser
399 lines (398 loc) • 7.29 kB
JSON
{
"type": "root",
"children": [
{
"type": "svelteScript",
"tagName": "script",
"properties": [
{
"type": "svelteProperty",
"name": "context",
"value": [
{
"type": "text",
"value": "module",
"position": {
"start": {
"line": 1,
"column": 18,
"offset": 17
},
"end": {
"line": 1,
"column": 25,
"offset": 24
}
}
}
],
"modifiers": [],
"shorthand": "none",
"position": {
"start": {
"line": 1,
"column": 9,
"offset": 8
},
"end": {
"line": 1,
"column": 25,
"offset": 24
}
}
}
],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "\n export const notices = {}\n",
"position": {
"start": {
"line": 1,
"column": 26,
"offset": 25
},
"end": {
"line": 3,
"column": 1,
"offset": 54
}
}
}
],
"position": {
"start": {
"line": 1,
"column": 1,
"offset": 0
},
"end": {
"line": 3,
"column": 10,
"offset": 63
}
}
},
{
"type": "text",
"value": "\n\n",
"position": {
"start": {
"line": 3,
"column": 10,
"offset": 63
},
"end": {
"line": 5,
"column": 1,
"offset": 65
}
}
},
{
"type": "svelteScript",
"tagName": "script",
"properties": [],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "\n export let position = 'top'\n\n let container\n let positionClass\n $: positionClass = position === 'top' ? 'is-top' : 'is-bottom'\n\n export function insert(el) {\n container.insertAdjacentElement('afterbegin', el)\n }\n",
"position": {
"start": {
"line": 5,
"column": 9,
"offset": 73
},
"end": {
"line": 15,
"column": 1,
"offset": 296
}
}
}
],
"position": {
"start": {
"line": 5,
"column": 1,
"offset": 65
},
"end": {
"line": 15,
"column": 10,
"offset": 305
}
}
},
{
"type": "text",
"value": "\n\n",
"position": {
"start": {
"line": 15,
"column": 10,
"offset": 305
},
"end": {
"line": 17,
"column": 1,
"offset": 307
}
}
},
{
"type": "svelteStyle",
"tagName": "style",
"properties": [
{
"type": "svelteProperty",
"name": "lang",
"value": [
{
"type": "text",
"value": "scss",
"position": {
"start": {
"line": 17,
"column": 14,
"offset": 320
},
"end": {
"line": 17,
"column": 19,
"offset": 325
}
}
}
],
"modifiers": [],
"shorthand": "none",
"position": {
"start": {
"line": 17,
"column": 8,
"offset": 314
},
"end": {
"line": 17,
"column": 19,
"offset": 325
}
}
}
],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "\n .notices {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n padding: 3em;\n z-index: 1000;\n pointer-events: none;\n display: flex;\n\n &.is-top {\n flex-direction: column;\n }\n\n &.is-bottom {\n flex-direction: column-reverse;\n }\n\n :global([class*='has-background-'] .text) {\n color: transparent !important;\n filter: invert(1) brightness(2.5) grayscale(1) contrast(9);\n background: inherit;\n background-clip: text !important;\n -webkit-background-clip: text !important;\n }\n }\n",
"position": {
"start": {
"line": 17,
"column": 20,
"offset": 326
},
"end": {
"line": 46,
"column": 1,
"offset": 911
}
}
}
],
"position": {
"start": {
"line": 17,
"column": 1,
"offset": 307
},
"end": {
"line": 46,
"column": 9,
"offset": 919
}
}
},
{
"type": "text",
"value": "\n\n",
"position": {
"start": {
"line": 46,
"column": 9,
"offset": 919
},
"end": {
"line": 48,
"column": 1,
"offset": 921
}
}
},
{
"type": "svelteElement",
"tagName": "div",
"properties": [
{
"type": "svelteProperty",
"name": "class",
"value": [
{
"type": "text",
"value": "notices",
"position": {
"start": {
"line": 48,
"column": 13,
"offset": 933
},
"end": {}
}
},
{
"type": "text",
"value": " ",
"position": {
"start": {
"line": 48,
"column": 20,
"offset": 940
},
"end": {
"line": 48,
"column": 21,
"offset": 941
}
}
},
{
"type": "svelteDynamicContent",
"position": {
"start": {
"line": 48,
"column": 21,
"offset": 941
},
"end": {
"line": 48,
"column": 36,
"offset": 956
}
},
"expression": {
"type": "svelteExpression",
"value": "positionClass",
"position": {
"start": {
"line": 48,
"column": 22,
"offset": 942
},
"end": {
"line": 48,
"column": 35,
"offset": 955
}
}
}
}
],
"modifiers": [],
"shorthand": "none",
"position": {
"start": {
"line": 48,
"column": 6,
"offset": 926
},
"end": {
"line": 48,
"column": 37,
"offset": 957
}
}
},
{
"type": "svelteDirective",
"name": "bind",
"value": [
{
"type": "svelteDynamicContent",
"position": {
"start": {
"line": 48,
"column": 48,
"offset": 968
},
"end": {
"line": 48,
"column": 59,
"offset": 979
}
},
"expression": {
"type": "svelteExpression",
"value": "container",
"position": {
"start": {
"line": 48,
"column": 49,
"offset": 969
},
"end": {
"line": 48,
"column": 58,
"offset": 978
}
}
}
}
],
"modifiers": [],
"shorthand": "none",
"position": {
"start": {
"line": 48,
"column": 38,
"offset": 958
},
"end": {
"line": 48,
"column": 59,
"offset": 979
}
},
"specifier": "this"
}
],
"selfClosing": true,
"children": [],
"position": {
"start": {
"line": 48,
"column": 1,
"offset": 921
},
"end": {
"line": 48,
"column": 62,
"offset": 982
}
}
}
],
"position": {
"start": {
"column": 1,
"line": 1,
"offset": 0
},
"end": {
"line": 48,
"column": 62,
"offset": 982
}
}
}