cleanup everything
This commit is contained in:
BIN
frontend/dist/Inter-Variable.ttf
vendored
Normal file
BIN
frontend/dist/Inter-Variable.ttf
vendored
Normal file
Binary file not shown.
@@ -3,14 +3,14 @@
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Vite + Svelte + TS</title>
|
||||
<link href="dist/style.css" rel="stylesheet">
|
||||
<title>Embed demo</title>
|
||||
<link href="/style.css" rel="stylesheet">
|
||||
<link href="/tailwind.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script src="/dist/appviewer.iife.js">
|
||||
<script src="/appviewer.iife.js">
|
||||
</script>
|
||||
<script src="/static/tailwind.js">
|
||||
</script>
|
||||
<script>
|
||||
loadApp(document.getElementById("app"), {
|
||||
1
frontend/dist/tailwind.css
vendored
Normal file
1
frontend/dist/tailwind.css
vendored
Normal file
File diff suppressed because one or more lines are too long
5
frontend/embed/README.md
Normal file
5
frontend/embed/README.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# Build the app preview embed code
|
||||
|
||||
./embed/build.sh
|
||||
|
||||
serve dist
|
||||
5
frontend/embed/build.sh
Executable file
5
frontend/embed/build.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
npm run build-embed
|
||||
cp static/Inter-Variable.ttf dist
|
||||
cp static/tailwind.js dist
|
||||
npx tailwindcss -o src/lib/assets/app.css --minify -o dist/tailwind.css
|
||||
cp embed/index.html dist
|
||||
840
frontend/embed/index.html
Normal file
840
frontend/embed/index.html
Normal file
@@ -0,0 +1,840 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Embed demo</title>
|
||||
<link href="/style.css" rel="stylesheet">
|
||||
<link href="/tailwind.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script src="/appviewer.iife.js">
|
||||
</script>
|
||||
</script>
|
||||
<script>
|
||||
loadApp(document.getElementById("app"), {
|
||||
"grid": [
|
||||
{
|
||||
"3": {
|
||||
"h": 2,
|
||||
"w": 1,
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"max": {
|
||||
"h": 100,
|
||||
"w": 3
|
||||
},
|
||||
"min": {
|
||||
"h": 1,
|
||||
"w": 1
|
||||
},
|
||||
"fixed": false,
|
||||
"draggable": true,
|
||||
"resizable": true,
|
||||
"customDragger": false,
|
||||
"customResizer": false
|
||||
},
|
||||
"12": {
|
||||
"h": 5,
|
||||
"w": 3,
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"id": "a",
|
||||
"max": {
|
||||
"h": 100,
|
||||
"w": 12
|
||||
},
|
||||
"min": {
|
||||
"h": 1,
|
||||
"w": 1
|
||||
},
|
||||
"fixed": false,
|
||||
"draggable": true,
|
||||
"resizable": true,
|
||||
"customDragger": false,
|
||||
"customResizer": false
|
||||
},
|
||||
"id": "a",
|
||||
"data": {
|
||||
"id": "a",
|
||||
"card": false,
|
||||
"type": "htmlcomponent",
|
||||
"softWrap": false,
|
||||
"configuration": {},
|
||||
"componentInput": {
|
||||
"eval": "<img\n\tsrc=\"https://images.unsplash.com/photo-1554629947-334ff61d85dc?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1024&h=1280&q=80\"\n>\n<div class=\"absolute top-4 left-2 text-white\">\n\tHello ${ctx.username}\n</div>\t\t\t\n",
|
||||
"type": "template",
|
||||
"value": "<img\n\tsrc=\"https://images.unsplash.com/photo-1554629947-334ff61d85dc?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1024&h=1280&q=80\"\n>\n<div class=\"absolute top-4 left-2 text-white\">\n\tHello ${ctx.username}\n</div>\t\t\t\n",
|
||||
"fieldType": "template"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"3": {
|
||||
"h": 10,
|
||||
"w": 3,
|
||||
"x": 0,
|
||||
"y": 2,
|
||||
"max": {
|
||||
"h": 100,
|
||||
"w": 3
|
||||
},
|
||||
"min": {
|
||||
"h": 1,
|
||||
"w": 1
|
||||
},
|
||||
"fixed": false,
|
||||
"draggable": true,
|
||||
"resizable": true,
|
||||
"customDragger": false,
|
||||
"customResizer": false
|
||||
},
|
||||
"12": {
|
||||
"h": 10,
|
||||
"w": 6,
|
||||
"x": 3,
|
||||
"y": 0,
|
||||
"id": "b",
|
||||
"max": {
|
||||
"h": 100,
|
||||
"w": 12
|
||||
},
|
||||
"min": {
|
||||
"h": 1,
|
||||
"w": 1
|
||||
},
|
||||
"fixed": false,
|
||||
"draggable": true,
|
||||
"resizable": true,
|
||||
"customDragger": false,
|
||||
"customResizer": false
|
||||
},
|
||||
"id": "b",
|
||||
"data": {
|
||||
"id": "b",
|
||||
"card": true,
|
||||
"type": "tablecomponent",
|
||||
"actionButtons": [],
|
||||
"configuration": {
|
||||
"search": {
|
||||
"type": "static",
|
||||
"value": "Disabled",
|
||||
"fieldType": "select",
|
||||
"onlyStatic": true,
|
||||
"optionValuesKey": "tableSearchOptions"
|
||||
}
|
||||
},
|
||||
"componentInput": {
|
||||
"type": "static",
|
||||
"value": [
|
||||
{
|
||||
"id": 1,
|
||||
"age": 42,
|
||||
"name": "A cell with a long name"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"age": 84,
|
||||
"name": "A briefer cell"
|
||||
}
|
||||
],
|
||||
"fieldType": "array",
|
||||
"subFieldType": "object"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"3": {
|
||||
"h": 8,
|
||||
"w": 2,
|
||||
"x": 0,
|
||||
"y": 12,
|
||||
"max": {
|
||||
"h": 100,
|
||||
"w": 3
|
||||
},
|
||||
"min": {
|
||||
"h": 1,
|
||||
"w": 1
|
||||
},
|
||||
"fixed": false,
|
||||
"draggable": true,
|
||||
"resizable": true,
|
||||
"customDragger": false,
|
||||
"customResizer": false
|
||||
},
|
||||
"12": {
|
||||
"h": 8,
|
||||
"w": 6,
|
||||
"x": 0,
|
||||
"y": 10,
|
||||
"max": {
|
||||
"h": 100,
|
||||
"w": 12
|
||||
},
|
||||
"min": {
|
||||
"h": 1,
|
||||
"w": 1
|
||||
},
|
||||
"fixed": false,
|
||||
"draggable": true,
|
||||
"resizable": true,
|
||||
"customDragger": false,
|
||||
"customResizer": false
|
||||
},
|
||||
"id": "c",
|
||||
"data": {
|
||||
"id": "c",
|
||||
"card": true,
|
||||
"type": "scatterchartcomponent",
|
||||
"configuration": {
|
||||
"pannable": {
|
||||
"type": "static",
|
||||
"value": false,
|
||||
"fieldType": "boolean",
|
||||
"onlyStatic": true
|
||||
},
|
||||
"zoomable": {
|
||||
"type": "static",
|
||||
"value": false,
|
||||
"fieldType": "boolean",
|
||||
"onlyStatic": true
|
||||
}
|
||||
},
|
||||
"componentInput": {
|
||||
"type": "static",
|
||||
"value": [
|
||||
{
|
||||
"data": [
|
||||
{
|
||||
"x": 25,
|
||||
"y": 50
|
||||
},
|
||||
{
|
||||
"x": 23,
|
||||
"y": 23
|
||||
},
|
||||
{
|
||||
"x": 12,
|
||||
"y": 37
|
||||
}
|
||||
],
|
||||
"label": "foo",
|
||||
"backgroundColor": "rgb(255, 12, 137)"
|
||||
},
|
||||
{
|
||||
"data": [
|
||||
{
|
||||
"x": 32,
|
||||
"y": 32
|
||||
},
|
||||
{
|
||||
"x": 25,
|
||||
"y": 42
|
||||
},
|
||||
{
|
||||
"x": 3,
|
||||
"y": 27
|
||||
}
|
||||
],
|
||||
"label": "foobar",
|
||||
"backgroundColor": "orange"
|
||||
}
|
||||
],
|
||||
"fieldType": "array",
|
||||
"subFieldType": "object"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"3": {
|
||||
"h": 8,
|
||||
"w": 2,
|
||||
"x": 0,
|
||||
"y": 20,
|
||||
"max": {
|
||||
"h": 100,
|
||||
"w": 3
|
||||
},
|
||||
"min": {
|
||||
"h": 1,
|
||||
"w": 1
|
||||
},
|
||||
"fixed": false,
|
||||
"draggable": true,
|
||||
"resizable": true,
|
||||
"customDragger": false,
|
||||
"customResizer": false
|
||||
},
|
||||
"12": {
|
||||
"h": 8,
|
||||
"w": 6,
|
||||
"x": 6,
|
||||
"y": 10,
|
||||
"id": "d",
|
||||
"max": {
|
||||
"h": 100,
|
||||
"w": 12
|
||||
},
|
||||
"min": {
|
||||
"h": 1,
|
||||
"w": 1
|
||||
},
|
||||
"fixed": false,
|
||||
"draggable": true,
|
||||
"resizable": true,
|
||||
"customDragger": false,
|
||||
"customResizer": false
|
||||
},
|
||||
"id": "d",
|
||||
"data": {
|
||||
"id": "d",
|
||||
"card": false,
|
||||
"type": "displaycomponent",
|
||||
"configuration": {},
|
||||
"componentInput": {
|
||||
"type": "connected",
|
||||
"value": {
|
||||
"foo": 42
|
||||
},
|
||||
"fields": {
|
||||
"x": {
|
||||
"type": "connected",
|
||||
"value": "gooo",
|
||||
"visible": true,
|
||||
"fieldType": "string",
|
||||
"connection": {
|
||||
"path": "result",
|
||||
"componentId": "e"
|
||||
}
|
||||
}
|
||||
},
|
||||
"runnable": {
|
||||
"name": "Inline Script 1",
|
||||
"type": "runnableByName",
|
||||
"inlineScript": {
|
||||
"path": "/inline-script/Inline Script 1",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"required": [
|
||||
"x"
|
||||
],
|
||||
"properties": {
|
||||
"x": {
|
||||
"type": "string",
|
||||
"default": null,
|
||||
"description": ""
|
||||
}
|
||||
}
|
||||
},
|
||||
"content": "// import * as wmill from \"https://deno.land/x/windmill@v1.57.1/mod.ts\"\n\nexport async function main(x: string) {\n return x\n}\n",
|
||||
"language": "deno"
|
||||
}
|
||||
},
|
||||
"fieldType": "object",
|
||||
"connection": {
|
||||
"path": "result",
|
||||
"componentId": "e"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"3": {
|
||||
"h": 1,
|
||||
"w": 2,
|
||||
"x": 1,
|
||||
"y": 0,
|
||||
"max": {
|
||||
"h": 100,
|
||||
"w": 3
|
||||
},
|
||||
"min": {
|
||||
"h": 1,
|
||||
"w": 1
|
||||
},
|
||||
"fixed": false,
|
||||
"draggable": true,
|
||||
"resizable": true,
|
||||
"customDragger": false,
|
||||
"customResizer": false
|
||||
},
|
||||
"12": {
|
||||
"h": 1,
|
||||
"w": 3,
|
||||
"x": 9,
|
||||
"y": 0,
|
||||
"id": "e",
|
||||
"max": {
|
||||
"h": 100,
|
||||
"w": 12
|
||||
},
|
||||
"min": {
|
||||
"h": 1,
|
||||
"w": 1
|
||||
},
|
||||
"fixed": false,
|
||||
"draggable": true,
|
||||
"resizable": true,
|
||||
"customDragger": false,
|
||||
"customResizer": false
|
||||
},
|
||||
"id": "e",
|
||||
"data": {
|
||||
"id": "e",
|
||||
"card": false,
|
||||
"type": "textinputcomponent",
|
||||
"softWrap": true,
|
||||
"configuration": {
|
||||
"placeholder": {
|
||||
"type": "static",
|
||||
"value": "Type...",
|
||||
"fieldType": "text",
|
||||
"onlyStatic": true
|
||||
}
|
||||
},
|
||||
"verticalAlignment": "center"
|
||||
}
|
||||
},
|
||||
{
|
||||
"3": {
|
||||
"h": 1,
|
||||
"w": 2,
|
||||
"x": 1,
|
||||
"y": 1,
|
||||
"max": {
|
||||
"h": 100,
|
||||
"w": 3
|
||||
},
|
||||
"min": {
|
||||
"h": 1,
|
||||
"w": 1
|
||||
},
|
||||
"fixed": false,
|
||||
"draggable": true,
|
||||
"resizable": true,
|
||||
"customDragger": false,
|
||||
"customResizer": false
|
||||
},
|
||||
"12": {
|
||||
"h": 1,
|
||||
"w": 3,
|
||||
"x": 9,
|
||||
"y": 1,
|
||||
"max": {
|
||||
"h": 100,
|
||||
"w": 12
|
||||
},
|
||||
"min": {
|
||||
"h": 1,
|
||||
"w": 1
|
||||
},
|
||||
"fixed": false,
|
||||
"draggable": true,
|
||||
"resizable": true,
|
||||
"customDragger": false,
|
||||
"customResizer": false
|
||||
},
|
||||
"id": "f",
|
||||
"data": {
|
||||
"id": "f",
|
||||
"card": false,
|
||||
"type": "passwordinputcomponent",
|
||||
"softWrap": true,
|
||||
"configuration": {
|
||||
"placeholder": {
|
||||
"type": "static",
|
||||
"value": "Password",
|
||||
"fieldType": "text",
|
||||
"onlyStatic": true
|
||||
}
|
||||
},
|
||||
"verticalAlignment": "center"
|
||||
}
|
||||
},
|
||||
{
|
||||
"3": {
|
||||
"h": 1,
|
||||
"w": 2,
|
||||
"x": 0,
|
||||
"y": 28,
|
||||
"max": {
|
||||
"h": 100,
|
||||
"w": 3
|
||||
},
|
||||
"min": {
|
||||
"h": 1,
|
||||
"w": 1
|
||||
},
|
||||
"fixed": false,
|
||||
"draggable": true,
|
||||
"resizable": true,
|
||||
"customDragger": false,
|
||||
"customResizer": false
|
||||
},
|
||||
"12": {
|
||||
"h": 1,
|
||||
"w": 3,
|
||||
"x": 9,
|
||||
"y": 2,
|
||||
"max": {
|
||||
"h": 100,
|
||||
"w": 12
|
||||
},
|
||||
"min": {
|
||||
"h": 1,
|
||||
"w": 1
|
||||
},
|
||||
"fixed": false,
|
||||
"draggable": true,
|
||||
"resizable": true,
|
||||
"customDragger": false,
|
||||
"customResizer": false
|
||||
},
|
||||
"id": "g",
|
||||
"data": {
|
||||
"id": "g",
|
||||
"card": false,
|
||||
"type": "dateinputcomponent",
|
||||
"softWrap": true,
|
||||
"configuration": {
|
||||
"maxDate": {
|
||||
"type": "static",
|
||||
"value": "",
|
||||
"fieldType": "date"
|
||||
},
|
||||
"minDate": {
|
||||
"type": "static",
|
||||
"value": "",
|
||||
"fieldType": "date"
|
||||
}
|
||||
},
|
||||
"verticalAlignment": "center"
|
||||
}
|
||||
},
|
||||
{
|
||||
"3": {
|
||||
"h": 1,
|
||||
"w": 1,
|
||||
"x": 2,
|
||||
"y": 12,
|
||||
"max": {
|
||||
"h": 100,
|
||||
"w": 3
|
||||
},
|
||||
"min": {
|
||||
"h": 1,
|
||||
"w": 1
|
||||
},
|
||||
"fixed": false,
|
||||
"draggable": true,
|
||||
"resizable": true,
|
||||
"customDragger": false,
|
||||
"customResizer": false
|
||||
},
|
||||
"12": {
|
||||
"h": 1,
|
||||
"w": 2,
|
||||
"x": 9,
|
||||
"y": 3,
|
||||
"max": {
|
||||
"h": 100,
|
||||
"w": 12
|
||||
},
|
||||
"min": {
|
||||
"h": 1,
|
||||
"w": 1
|
||||
},
|
||||
"fixed": false,
|
||||
"draggable": true,
|
||||
"resizable": true,
|
||||
"customDragger": false,
|
||||
"customResizer": false
|
||||
},
|
||||
"id": "h",
|
||||
"data": {
|
||||
"id": "h",
|
||||
"card": false,
|
||||
"type": "checkboxcomponent",
|
||||
"softWrap": true,
|
||||
"configuration": {
|
||||
"label": {
|
||||
"type": "static",
|
||||
"value": "Label",
|
||||
"fieldType": "text"
|
||||
}
|
||||
},
|
||||
"verticalAlignment": "center",
|
||||
"horizontalAlignment": "center"
|
||||
}
|
||||
},
|
||||
{
|
||||
"3": {
|
||||
"h": 1,
|
||||
"w": 2,
|
||||
"x": 0,
|
||||
"y": 29,
|
||||
"max": {
|
||||
"h": 100,
|
||||
"w": 3
|
||||
},
|
||||
"min": {
|
||||
"h": 1,
|
||||
"w": 1
|
||||
},
|
||||
"fixed": false,
|
||||
"draggable": true,
|
||||
"resizable": true,
|
||||
"customDragger": false,
|
||||
"customResizer": false
|
||||
},
|
||||
"12": {
|
||||
"h": 1,
|
||||
"w": 3,
|
||||
"x": 9,
|
||||
"y": 4,
|
||||
"max": {
|
||||
"h": 100,
|
||||
"w": 12
|
||||
},
|
||||
"min": {
|
||||
"h": 1,
|
||||
"w": 1
|
||||
},
|
||||
"fixed": false,
|
||||
"draggable": true,
|
||||
"resizable": true,
|
||||
"customDragger": false,
|
||||
"customResizer": false
|
||||
},
|
||||
"id": "i",
|
||||
"data": {
|
||||
"id": "i",
|
||||
"card": false,
|
||||
"type": "selectcomponent",
|
||||
"softWrap": true,
|
||||
"configuration": {
|
||||
"items": {
|
||||
"type": "static",
|
||||
"value": [
|
||||
{
|
||||
"label": "Foo",
|
||||
"value": "foo"
|
||||
},
|
||||
{
|
||||
"label": "Bar",
|
||||
"value": "bar"
|
||||
}
|
||||
],
|
||||
"fieldType": "array",
|
||||
"subFieldType": "object"
|
||||
},
|
||||
"itemKey": {
|
||||
"type": "static",
|
||||
"value": "value",
|
||||
"fieldType": "text"
|
||||
}
|
||||
},
|
||||
"verticalAlignment": "center"
|
||||
}
|
||||
},
|
||||
{
|
||||
"3": {
|
||||
"h": 1,
|
||||
"w": 1,
|
||||
"x": 2,
|
||||
"y": 13,
|
||||
"max": {
|
||||
"h": 100,
|
||||
"w": 3
|
||||
},
|
||||
"min": {
|
||||
"h": 1,
|
||||
"w": 1
|
||||
},
|
||||
"fixed": false,
|
||||
"draggable": true,
|
||||
"resizable": true,
|
||||
"customDragger": false,
|
||||
"customResizer": false
|
||||
},
|
||||
"12": {
|
||||
"h": 1,
|
||||
"w": 2,
|
||||
"x": 0,
|
||||
"y": 5,
|
||||
"max": {
|
||||
"h": 100,
|
||||
"w": 12
|
||||
},
|
||||
"min": {
|
||||
"h": 1,
|
||||
"w": 1
|
||||
},
|
||||
"fixed": false,
|
||||
"draggable": true,
|
||||
"resizable": true,
|
||||
"customDragger": false,
|
||||
"customResizer": false
|
||||
},
|
||||
"id": "j",
|
||||
"data": {
|
||||
"id": "j",
|
||||
"card": false,
|
||||
"type": "buttoncomponent",
|
||||
"softWrap": true,
|
||||
"configuration": {
|
||||
"size": {
|
||||
"type": "static",
|
||||
"value": "xs",
|
||||
"fieldType": "select",
|
||||
"onlyStatic": true,
|
||||
"optionValuesKey": "buttonSizeOptions"
|
||||
},
|
||||
"color": {
|
||||
"type": "static",
|
||||
"value": "blue",
|
||||
"fieldType": "select",
|
||||
"onlyStatic": true,
|
||||
"optionValuesKey": "buttonColorOptions"
|
||||
},
|
||||
"label": {
|
||||
"type": "static",
|
||||
"value": "Press me",
|
||||
"fieldType": "text"
|
||||
}
|
||||
},
|
||||
"componentInput": {
|
||||
"type": "runnable",
|
||||
"fields": {},
|
||||
"fieldType": "any"
|
||||
},
|
||||
"verticalAlignment": "center",
|
||||
"horizontalAlignment": "center"
|
||||
}
|
||||
},
|
||||
{
|
||||
"3": {
|
||||
"h": 5,
|
||||
"w": 3,
|
||||
"x": 0,
|
||||
"y": 30,
|
||||
"max": {
|
||||
"h": 100,
|
||||
"w": 3
|
||||
},
|
||||
"min": {
|
||||
"h": 1,
|
||||
"w": 1
|
||||
},
|
||||
"fixed": false,
|
||||
"draggable": true,
|
||||
"resizable": true,
|
||||
"customDragger": false,
|
||||
"customResizer": false
|
||||
},
|
||||
"12": {
|
||||
"h": 5,
|
||||
"w": 6,
|
||||
"x": 0,
|
||||
"y": 18,
|
||||
"id": "k",
|
||||
"max": {
|
||||
"h": 100,
|
||||
"w": 12
|
||||
},
|
||||
"min": {
|
||||
"h": 1,
|
||||
"w": 1
|
||||
},
|
||||
"fixed": false,
|
||||
"draggable": true,
|
||||
"resizable": true,
|
||||
"customDragger": false,
|
||||
"customResizer": false
|
||||
},
|
||||
"id": "k",
|
||||
"data": {
|
||||
"id": "k",
|
||||
"card": true,
|
||||
"type": "formcomponent",
|
||||
"configuration": {
|
||||
"size": {
|
||||
"type": "static",
|
||||
"value": "xs",
|
||||
"fieldType": "select",
|
||||
"onlyStatic": true,
|
||||
"optionValuesKey": "buttonSizeOptions"
|
||||
},
|
||||
"color": {
|
||||
"type": "static",
|
||||
"value": "dark",
|
||||
"fieldType": "select",
|
||||
"onlyStatic": true,
|
||||
"optionValuesKey": "buttonColorOptions"
|
||||
},
|
||||
"label": {
|
||||
"type": "static",
|
||||
"value": "Submit",
|
||||
"fieldType": "text"
|
||||
}
|
||||
},
|
||||
"componentInput": {
|
||||
"type": "runnable",
|
||||
"fields": {
|
||||
"x": {
|
||||
"type": "user",
|
||||
"value": null,
|
||||
"visible": true,
|
||||
"fieldType": "string"
|
||||
},
|
||||
"y": {
|
||||
"type": "user",
|
||||
"value": null,
|
||||
"visible": true,
|
||||
"fieldType": "string"
|
||||
}
|
||||
},
|
||||
"runnable": {
|
||||
"name": "Inline Script 0",
|
||||
"type": "runnableByName",
|
||||
"inlineScript": {
|
||||
"path": "/inline-script/Inline Script 0",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"required": [
|
||||
"x",
|
||||
"y"
|
||||
],
|
||||
"properties": {
|
||||
"x": {
|
||||
"type": "string",
|
||||
"default": null,
|
||||
"description": ""
|
||||
},
|
||||
"y": {
|
||||
"type": "string",
|
||||
"default": null,
|
||||
"description": ""
|
||||
}
|
||||
}
|
||||
},
|
||||
"content": "// import * as wmill from \"https://deno.land/x/windmill@v1.57.1/mod.ts\"\n\nexport async function main(x: string, y: string) {\n return x\n}\n",
|
||||
"language": "deno"
|
||||
}
|
||||
},
|
||||
"fieldType": "any"
|
||||
},
|
||||
"horizontalAlignment": "center"
|
||||
}
|
||||
}
|
||||
],
|
||||
"fullscreen": false,
|
||||
"unusedInlineScripts": []
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -4,6 +4,7 @@
|
||||
"scripts": {
|
||||
"dev": "vite dev",
|
||||
"build": "vite build",
|
||||
"build-embed": "vite build -c vite.embed.config.js",
|
||||
"preview": "vite preview",
|
||||
"check": "svelte-check --tsconfig ./tsconfig.json --threshold warning",
|
||||
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
import commonjs from '@rollup/plugin-commonjs'
|
||||
import resolve from '@rollup/plugin-node-resolve'
|
||||
import typescript from '@rollup/plugin-typescript'
|
||||
import svelte from 'rollup-plugin-svelte'
|
||||
import terser from '@rollup/plugin-terser'
|
||||
import sveltePreprocess from 'svelte-preprocess'
|
||||
|
||||
const production = !process.env.ROLLUP_WATCH
|
||||
|
||||
export default {
|
||||
// The file we created with our web component wrapper.
|
||||
input: 'src/embed.js',
|
||||
output: {
|
||||
sourcemap: !production,
|
||||
format: 'iife',
|
||||
name: 'app',
|
||||
// We output it to public. This way, our svelte kit
|
||||
// app will also host the web components.
|
||||
file: 'build/app.js'
|
||||
},
|
||||
// Normal rollup svelte configuration. Nothing fancy
|
||||
// happening here.
|
||||
plugins: [
|
||||
typescript(),
|
||||
svelte({
|
||||
preprocess: sveltePreprocess({
|
||||
sourceMap: !production,
|
||||
postcss: true
|
||||
}),
|
||||
// We just make sure that no global CSS is injeced
|
||||
// into the page that imports this script.
|
||||
emitCss: false,
|
||||
compilerOptions: {
|
||||
dev: !production
|
||||
|
||||
// customElement: true,
|
||||
}
|
||||
}),
|
||||
resolve({ browser: true, dedupe: ['svelte'] }),
|
||||
commonjs()
|
||||
]
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
// import { sveltekit } from '@sveltejs/kit/vite'
|
||||
import { sveltekit } from '@sveltejs/kit/vite'
|
||||
import { readFileSync } from 'fs'
|
||||
import { fileURLToPath } from 'url'
|
||||
import { svelte } from '@sveltejs/vite-plugin-svelte'
|
||||
|
||||
const file = fileURLToPath(new URL('package.json', import.meta.url))
|
||||
const json = readFileSync(file, 'utf8')
|
||||
@@ -15,7 +14,7 @@ const config = {
|
||||
preview: {
|
||||
port: 3000
|
||||
},
|
||||
plugins: [svelte()],
|
||||
plugins: [sveltekit()],
|
||||
define: {
|
||||
__pkg__: version
|
||||
},
|
||||
@@ -24,35 +23,8 @@ const config = {
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
path: 'path-browserify',
|
||||
$lib: ['/src/lib'],
|
||||
'$lib/*': ['/src/lib/*'],
|
||||
'$app/navigation': ['/src/lib/fakesvelte.js'],
|
||||
'$app/stores': ['/src/lib/fakesvelte.js'],
|
||||
'$app/environment': ['/src/lib/fakesvelte.js']
|
||||
path: 'path-browserify'
|
||||
}
|
||||
},
|
||||
build: {
|
||||
lib: {
|
||||
// Could also be a dictionary or array of multiple entry points
|
||||
entry: 'src/embed.js',
|
||||
name: 'AppViewer',
|
||||
// the proper extensions will be added
|
||||
fileName: 'appviewer',
|
||||
formats: ['iife']
|
||||
}
|
||||
// rollupOptions: {
|
||||
// external: ['highlight.js'],
|
||||
// input: 'src/embed.js',
|
||||
// output: {
|
||||
// format: 'esm',
|
||||
// name: 'app',
|
||||
// // We output it to public. This way, our svelte kit
|
||||
// // app will also host the web components.
|
||||
// dir: 'build'
|
||||
// // file: 'build/app.js'
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
59
frontend/vite.embed.config.js
Normal file
59
frontend/vite.embed.config.js
Normal file
@@ -0,0 +1,59 @@
|
||||
// import { sveltekit } from '@sveltejs/kit/vite'
|
||||
import { readFileSync } from 'fs'
|
||||
import { fileURLToPath } from 'url'
|
||||
import { svelte } from '@sveltejs/vite-plugin-svelte'
|
||||
|
||||
const file = fileURLToPath(new URL('package.json', import.meta.url))
|
||||
const json = readFileSync(file, 'utf8')
|
||||
const version = JSON.parse(json)
|
||||
|
||||
/** @type {import('vite').UserConfig} */
|
||||
const config = {
|
||||
server: {
|
||||
port: 3000
|
||||
},
|
||||
preview: {
|
||||
port: 3000
|
||||
},
|
||||
plugins: [svelte()],
|
||||
define: {
|
||||
__pkg__: version
|
||||
},
|
||||
optimizeDeps: {
|
||||
include: ['highlight.js', 'highlight.js/lib/core']
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
path: 'path-browserify',
|
||||
$lib: ['/src/lib'],
|
||||
'$lib/*': ['/src/lib/*'],
|
||||
'$app/navigation': ['/src/lib/fakesvelte.js'],
|
||||
'$app/stores': ['/src/lib/fakesvelte.js'],
|
||||
'$app/environment': ['/src/lib/fakesvelte.js']
|
||||
}
|
||||
},
|
||||
build: {
|
||||
lib: {
|
||||
// Could also be a dictionary or array of multiple entry points
|
||||
entry: ['src/embed.js'],
|
||||
name: 'AppViewer',
|
||||
// the proper extensions will be added
|
||||
fileName: 'appviewer',
|
||||
formats: ['iife']
|
||||
}
|
||||
// rollupOptions: {
|
||||
// external: ['highlight.js'],
|
||||
// input: 'src/embed.js',
|
||||
// output: {
|
||||
// format: 'esm',
|
||||
// name: 'app',
|
||||
// // We output it to public. This way, our svelte kit
|
||||
// // app will also host the web components.
|
||||
// dir: 'build'
|
||||
// // file: 'build/app.js'
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
export default config
|
||||
Reference in New Issue
Block a user