instaui 0.1.4__py3-none-any.whl → 0.1.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- instaui/components/echarts/echarts.js +128 -0
- instaui/components/echarts/echarts.py +194 -0
- instaui/components/echarts/static/echarts.esm.min.js +45 -0
- instaui/components/element.py +50 -4
- instaui/components/html/__init__.py +30 -19
- instaui/components/html/_preset.py +4 -0
- instaui/components/html/heading.py +51 -0
- instaui/components/html/range.py +3 -0
- instaui/components/html/select.py +13 -31
- instaui/components/html/table.py +36 -0
- instaui/components/markdown/static/marked.esm.js +0 -1
- instaui/components/shiki_code/shiki_code.js +126 -0
- instaui/components/shiki_code/shiki_code.py +99 -0
- instaui/components/shiki_code/static/langs/css.mjs +5 -0
- instaui/components/shiki_code/static/langs/markdown.mjs +5 -0
- instaui/components/shiki_code/static/langs/python.mjs +5 -0
- instaui/components/shiki_code/static/langs/shell.mjs +2 -0
- instaui/components/shiki_code/static/langs/shellscript.mjs +5 -0
- instaui/components/shiki_code/static/shiki-core.js +5784 -0
- instaui/components/shiki_code/static/shiki-style.css +175 -0
- instaui/components/shiki_code/static/shiki-transformers.js +461 -0
- instaui/components/shiki_code/static/themes/vitesse-dark.mjs +2 -0
- instaui/components/shiki_code/static/themes/vitesse-light.mjs +2 -0
- instaui/components/value_element.py +7 -3
- instaui/consts.py +2 -1
- instaui/daisyui/__init__.py +8 -2
- instaui/daisyui/_index.py +5 -0
- instaui/daisyui/table.py +35 -0
- instaui/event/js_event.py +1 -0
- instaui/event/web_event.py +6 -7
- instaui/fastapi_server/server.py +4 -12
- instaui/handlers/event_handler.py +3 -1
- instaui/handlers/watch_handler.py +4 -0
- instaui/html_tools.py +40 -2
- instaui/runtime/_app.py +37 -3
- instaui/runtime/_link_manager.py +89 -0
- instaui/runtime/resource.py +19 -9
- instaui/shadcn_classless/_index.py +42 -0
- instaui/shadcn_classless/static/shadcn-classless.css +403 -0
- instaui/static/insta-ui.css +1 -1
- instaui/static/insta-ui.esm-browser.prod.js +1314 -1253
- instaui/static/insta-ui.js.map +1 -1
- instaui/static/instaui-tools-browser.js +511 -0
- instaui/static/templates/webview.html +78 -0
- instaui/tailwind/__init__.py +6 -0
- instaui/tailwind/_index.py +24 -0
- instaui/{static/tailwindcss.min.js → tailwind/static/tailwindcss-v3.min.js} +62 -62
- instaui/tailwind/static/tailwindcss-v4.min.js +8 -0
- instaui/template/_utils.py +23 -0
- instaui/template/webview_template.py +50 -0
- instaui/ui/__init__.py +8 -2
- instaui/ui/__init__.pyi +7 -1
- instaui/vars/event_context.py +4 -0
- instaui/vars/web_computed.py +30 -30
- instaui/watch/web_watch.py +5 -6
- instaui/webview/__init__.py +1 -0
- instaui/webview/_utils.py +8 -0
- instaui/webview/api.py +72 -0
- instaui/webview/func.py +114 -0
- instaui/webview/index.py +162 -0
- instaui/webview/resource.py +172 -0
- instaui/zero/func.py +19 -12
- instaui/zero/scope.py +46 -28
- {instaui-0.1.4.dist-info → instaui-0.1.5.dist-info}/METADATA +4 -1
- {instaui-0.1.4.dist-info → instaui-0.1.5.dist-info}/RECORD +67 -47
- instaui/components/highlight_code/code.js +0 -63
- instaui/components/highlight_code/code.py +0 -117
- instaui/components/highlight_code/static/core.min.js +0 -307
- instaui/components/highlight_code/static/languages/css.min.js +0 -31
- instaui/components/highlight_code/static/languages/javascript.min.js +0 -81
- instaui/components/highlight_code/static/languages/json.min.js +0 -8
- instaui/components/highlight_code/static/languages/python-repl.min.js +0 -5
- instaui/components/highlight_code/static/languages/python.min.js +0 -42
- instaui/components/highlight_code/static/languages/shell.min.js +0 -5
- instaui/components/highlight_code/static/styles/default.min.css +0 -9
- instaui/components/highlight_code/static/styles/github-dark-dimmed.min.css +0 -9
- instaui/components/highlight_code/static/styles/github-dark.min.css +0 -10
- instaui/components/highlight_code/static/styles/github.min.css +0 -10
- instaui/handlers/computed_handler.py +0 -42
- instaui/handlers/config_handler.py +0 -13
- {instaui-0.1.4.dist-info → instaui-0.1.5.dist-info}/LICENSE +0 -0
- {instaui-0.1.4.dist-info → instaui-0.1.5.dist-info}/WHEEL +0 -0
@@ -1,8 +0,0 @@
|
|
1
|
-
/*! `json` grammar compiled for Highlight.js 11.10.0 */
|
2
|
-
var hljsGrammar=(()=>{"use strict";return e=>{
|
3
|
-
const a=["true","false","null"],r={scope:"literal",beginKeywords:a.join(" ")}
|
4
|
-
;return{name:"JSON",aliases:["jsonc"],keywords:{literal:a},contains:[{
|
5
|
-
className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{
|
6
|
-
match:/[{}[\],:]/,className:"punctuation",relevance:0
|
7
|
-
},e.QUOTE_STRING_MODE,r,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],
|
8
|
-
illegal:"\\S"}}})();export default hljsGrammar;
|
@@ -1,5 +0,0 @@
|
|
1
|
-
/*! `python-repl` grammar compiled for Highlight.js 11.10.0 */
|
2
|
-
var hljsGrammar=(()=>{"use strict";return a=>({aliases:["pycon"],contains:[{
|
3
|
-
className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}
|
4
|
-
},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]})})()
|
5
|
-
;export default hljsGrammar;
|
@@ -1,42 +0,0 @@
|
|
1
|
-
/*! `python` grammar compiled for Highlight.js 11.10.0 */
|
2
|
-
var hljsGrammar=(()=>{"use strict";return e=>{
|
3
|
-
const n=e.regex,a=/[\p{XID_Start}_]\p{XID_Continue}*/u,s=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],t={
|
4
|
-
$pattern:/[A-Za-z]\w+|__\w+__/,keyword:s,
|
5
|
-
built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],
|
6
|
-
literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],
|
7
|
-
type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]
|
8
|
-
},i={className:"meta",begin:/^(>>>|\.\.\.) /},r={className:"subst",begin:/\{/,
|
9
|
-
end:/\}/,keywords:t,illegal:/#/},l={begin:/\{\{/,relevance:0},o={
|
10
|
-
className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{
|
11
|
-
begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,
|
12
|
-
contains:[e.BACKSLASH_ESCAPE,i],relevance:10},{
|
13
|
-
begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,
|
14
|
-
contains:[e.BACKSLASH_ESCAPE,i],relevance:10},{
|
15
|
-
begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,
|
16
|
-
contains:[e.BACKSLASH_ESCAPE,i,l,r]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,
|
17
|
-
end:/"""/,contains:[e.BACKSLASH_ESCAPE,i,l,r]},{begin:/([uU]|[rR])'/,end:/'/,
|
18
|
-
relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{
|
19
|
-
begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,
|
20
|
-
end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,
|
21
|
-
contains:[e.BACKSLASH_ESCAPE,l,r]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,
|
22
|
-
contains:[e.BACKSLASH_ESCAPE,l,r]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]
|
23
|
-
},b="[0-9](_?[0-9])*",c=`(\\b(${b}))?\\.(${b})|\\b(${b})\\.`,d="\\b|"+s.join("|"),m={
|
24
|
-
className:"number",relevance:0,variants:[{
|
25
|
-
begin:`(\\b(${b})|(${c}))[eE][+-]?(${b})[jJ]?(?=${d})`},{begin:`(${c})[jJ]?`},{
|
26
|
-
begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{
|
27
|
-
begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`
|
28
|
-
},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${b})[jJ](?=${d})`
|
29
|
-
}]},g={className:"comment",begin:n.lookahead(/# type:/),end:/$/,keywords:t,
|
30
|
-
contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},p={
|
31
|
-
className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,
|
32
|
-
end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:t,
|
33
|
-
contains:["self",i,m,o,e.HASH_COMMENT_MODE]}]};return r.contains=[o,m,i],{
|
34
|
-
name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:t,
|
35
|
-
illegal:/(<\/|\?)|=>/,contains:[i,m,{scope:"variable.language",match:/\bself\b/
|
36
|
-
},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"
|
37
|
-
},o,g,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,a],scope:{1:"keyword",
|
38
|
-
3:"title.function"},contains:[p]},{variants:[{
|
39
|
-
match:[/\bclass/,/\s+/,a,/\s*/,/\(\s*/,a,/\s*\)/]},{match:[/\bclass/,/\s+/,a]}],
|
40
|
-
scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{
|
41
|
-
className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[m,p,o]}]}}})()
|
42
|
-
;export default hljsGrammar;
|
@@ -1,5 +0,0 @@
|
|
1
|
-
/*! `shell` grammar compiled for Highlight.js 11.10.0 */
|
2
|
-
var hljsGrammar=(()=>{"use strict";return s=>({name:"Shell Session",
|
3
|
-
aliases:["console","shellsession"],contains:[{className:"meta.prompt",
|
4
|
-
begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,
|
5
|
-
subLanguage:"bash"}}]})})();export default hljsGrammar;
|
@@ -1,9 +0,0 @@
|
|
1
|
-
/*!
|
2
|
-
Theme: Default
|
3
|
-
Description: Original highlight.js style
|
4
|
-
Author: (c) Ivan Sagalaev <maniac@softwaremaniacs.org>
|
5
|
-
Maintainer: @highlightjs/core-team
|
6
|
-
Website: https://highlightjs.org/
|
7
|
-
License: see project LICENSE
|
8
|
-
Touched: 2021
|
9
|
-
*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#f3f3f3;color:#444}.hljs-comment{color:#697070}.hljs-punctuation,.hljs-tag{color:#444a}.hljs-tag .hljs-attr,.hljs-tag .hljs-name{color:#444}.hljs-attribute,.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-name,.hljs-selector-tag{font-weight:700}.hljs-deletion,.hljs-number,.hljs-quote,.hljs-selector-class,.hljs-selector-id,.hljs-string,.hljs-template-tag,.hljs-type{color:#800}.hljs-section,.hljs-title{color:#800;font-weight:700}.hljs-link,.hljs-operator,.hljs-regexp,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-symbol,.hljs-template-variable,.hljs-variable{color:#ab5656}.hljs-literal{color:#695}.hljs-addition,.hljs-built_in,.hljs-bullet,.hljs-code{color:#397300}.hljs-meta{color:#1f7199}.hljs-meta .hljs-string{color:#38a}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}
|
@@ -1,9 +0,0 @@
|
|
1
|
-
pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!
|
2
|
-
Theme: GitHub Dark Dimmed
|
3
|
-
Description: Dark dimmed theme as seen on github.com
|
4
|
-
Author: github.com
|
5
|
-
Maintainer: @Hirse
|
6
|
-
Updated: 2021-05-15
|
7
|
-
|
8
|
-
Colors taken from GitHub's CSS
|
9
|
-
*/.hljs{color:#adbac7;background:#22272e}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#f47067}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#dcbdfb}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable{color:#6cb6ff}.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#96d0ff}.hljs-built_in,.hljs-symbol{color:#f69d50}.hljs-code,.hljs-comment,.hljs-formula{color:#768390}.hljs-name,.hljs-quote,.hljs-selector-pseudo,.hljs-selector-tag{color:#8ddb8c}.hljs-subst{color:#adbac7}.hljs-section{color:#316dca;font-weight:700}.hljs-bullet{color:#eac55f}.hljs-emphasis{color:#adbac7;font-style:italic}.hljs-strong{color:#adbac7;font-weight:700}.hljs-addition{color:#b4f1b4;background-color:#1b4721}.hljs-deletion{color:#ffd8d3;background-color:#78191b}
|
@@ -1,10 +0,0 @@
|
|
1
|
-
pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!
|
2
|
-
Theme: GitHub Dark
|
3
|
-
Description: Dark theme as seen on github.com
|
4
|
-
Author: github.com
|
5
|
-
Maintainer: @Hirse
|
6
|
-
Updated: 2021-05-15
|
7
|
-
|
8
|
-
Outdated base version: https://github.com/primer/github-syntax-dark
|
9
|
-
Current colors taken from GitHub's CSS
|
10
|
-
*/.hljs{color:#c9d1d9;background:#0d1117}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#ff7b72}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#d2a8ff}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable{color:#79c0ff}.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#a5d6ff}.hljs-built_in,.hljs-symbol{color:#ffa657}.hljs-code,.hljs-comment,.hljs-formula{color:#8b949e}.hljs-name,.hljs-quote,.hljs-selector-pseudo,.hljs-selector-tag{color:#7ee787}.hljs-subst{color:#c9d1d9}.hljs-section{color:#1f6feb;font-weight:700}.hljs-bullet{color:#f2cc60}.hljs-emphasis{color:#c9d1d9;font-style:italic}.hljs-strong{color:#c9d1d9;font-weight:700}.hljs-addition{color:#aff5b4;background-color:#033a16}.hljs-deletion{color:#ffdcd7;background-color:#67060c}
|
@@ -1,10 +0,0 @@
|
|
1
|
-
pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!
|
2
|
-
Theme: GitHub
|
3
|
-
Description: Light theme as seen on github.com
|
4
|
-
Author: github.com
|
5
|
-
Maintainer: @Hirse
|
6
|
-
Updated: 2021-05-15
|
7
|
-
|
8
|
-
Outdated base version: https://github.com/primer/github-syntax-light
|
9
|
-
Current colors taken from GitHub's CSS
|
10
|
-
*/.hljs{color:#24292e;background:#fff}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#d73a49}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#6f42c1}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable{color:#005cc5}.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#032f62}.hljs-built_in,.hljs-symbol{color:#e36209}.hljs-code,.hljs-comment,.hljs-formula{color:#6a737d}.hljs-name,.hljs-quote,.hljs-selector-pseudo,.hljs-selector-tag{color:#22863a}.hljs-subst{color:#24292e}.hljs-section{color:#005cc5;font-weight:700}.hljs-bullet{color:#735c0f}.hljs-emphasis{color:#24292e;font-style:italic}.hljs-strong{color:#24292e;font-weight:700}.hljs-addition{color:#22863a;background-color:#f0fff4}.hljs-deletion{color:#b31d28;background-color:#ffeef0}
|
@@ -1,42 +0,0 @@
|
|
1
|
-
import threading
|
2
|
-
from typing import Callable, Dict, Optional
|
3
|
-
|
4
|
-
from instaui.runtime.context import get_context
|
5
|
-
from instaui.systems import func_system
|
6
|
-
|
7
|
-
|
8
|
-
ASYNC_URL = "/instaui/computed/async"
|
9
|
-
SYNC_URL = "/instaui/computed/sync"
|
10
|
-
INIT_URL = "/instaui/computed/init"
|
11
|
-
|
12
|
-
_computed_handlers: Dict[str, Callable] = {}
|
13
|
-
dict_lock = threading.Lock()
|
14
|
-
|
15
|
-
|
16
|
-
def register_handler(key: str, handler: Callable):
|
17
|
-
if key in _computed_handlers:
|
18
|
-
return
|
19
|
-
with dict_lock:
|
20
|
-
_computed_handlers[key] = handler
|
21
|
-
|
22
|
-
|
23
|
-
def get_handler(key: str) -> Optional[Callable]:
|
24
|
-
return _computed_handlers.get(key)
|
25
|
-
|
26
|
-
|
27
|
-
def get_statistics_info():
|
28
|
-
return {
|
29
|
-
"_computed_handlers count": len(_computed_handlers),
|
30
|
-
"_computed_handlers keys": list(_computed_handlers.keys()),
|
31
|
-
}
|
32
|
-
|
33
|
-
|
34
|
-
def create_handler_key(
|
35
|
-
page_path: str,
|
36
|
-
handler: Callable,
|
37
|
-
):
|
38
|
-
_, lineno, _ = func_system.get_function_location_info(handler)
|
39
|
-
|
40
|
-
if get_context().debug_mode:
|
41
|
-
return f"path:{page_path}|line:{lineno}"
|
42
|
-
return f"{page_path}|{lineno}"
|
@@ -1,13 +0,0 @@
|
|
1
|
-
from typing import Callable, Dict
|
2
|
-
|
3
|
-
ASYNC_URL = "/instaui/config/async"
|
4
|
-
SYNC_URL = "/instaui/config/sync"
|
5
|
-
_handlers: Dict[str, Callable] = {}
|
6
|
-
|
7
|
-
|
8
|
-
def register_handler(key: str, handler: Callable):
|
9
|
-
_handlers[key] = handler
|
10
|
-
|
11
|
-
|
12
|
-
def get_handler(key: str) -> Callable:
|
13
|
-
return _handlers[key]
|
File without changes
|
File without changes
|