flet-webview 0.1.0__py3-none-any.whl → 0.2.0.dev44__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.

Potentially problematic release.


This version of flet-webview might be problematic. Click here for more details.

flet_webview/__init__.py CHANGED
@@ -1,8 +1,8 @@
1
- from flet_webview.webview import (
2
- WebView,
3
- WebviewConsoleMessageEvent,
4
- WebviewJavaScriptEvent,
5
- WebviewLogLevelSeverity,
6
- WebviewRequestMethod,
7
- WebviewScrollEvent,
1
+ from .types import (
2
+ LogLevelSeverity,
3
+ RequestMethod,
4
+ WebViewConsoleMessageEvent,
5
+ WebViewJavaScriptEvent,
6
+ WebViewScrollEvent,
8
7
  )
8
+ from .webview import WebView
flet_webview/types.py ADDED
@@ -0,0 +1,71 @@
1
+ from dataclasses import dataclass
2
+ from enum import Enum
3
+
4
+ import flet as ft
5
+
6
+ __all__ = [
7
+ "RequestMethod",
8
+ "LogLevelSeverity",
9
+ "WebViewScrollEvent",
10
+ "WebViewConsoleMessageEvent",
11
+ "WebViewJavaScriptEvent",
12
+ ]
13
+
14
+
15
+ class RequestMethod(Enum):
16
+ """Defines the supported HTTP methods for loading a page in a `WebView`."""
17
+
18
+ GET = "get"
19
+ """HTTP GET method."""
20
+
21
+ POST = "post"
22
+ """HTTP POST method."""
23
+
24
+
25
+ class LogLevelSeverity(Enum):
26
+ """Represents the severity of a JavaScript log message."""
27
+
28
+ ERROR = "error"
29
+ """
30
+ Indicates an error message was logged via an "error" event of the
31
+ `console.error` method.
32
+ """
33
+
34
+ WARNING = "warning"
35
+ """Indicates a warning message was logged using the `console.warning` method."""
36
+
37
+ DEBUG = "debug"
38
+ """Indicates a debug message was logged using the `console.debug` method."""
39
+
40
+ INFO = "info"
41
+ """Indicates an informational message was logged using the `console.info` method."""
42
+
43
+ LOG = "log"
44
+ """Indicates a log message was logged using the `console.log` method."""
45
+
46
+
47
+ @dataclass
48
+ class WebViewScrollEvent(ft.Event[ft.EventControlType]):
49
+ x: float
50
+ """The value of the horizontal offset with the origin being at the leftmost of the `WebView`."""
51
+
52
+ y: float
53
+ """The value of the vertical offset with the origin being at the topmost of the `WebView`."""
54
+
55
+
56
+ @dataclass
57
+ class WebViewConsoleMessageEvent(ft.Event[ft.EventControlType]):
58
+ message: str
59
+ """The message written to the console."""
60
+
61
+ severity_level: LogLevelSeverity
62
+ """The severity of a JavaScript log message."""
63
+
64
+
65
+ @dataclass
66
+ class WebViewJavaScriptEvent(ft.Event[ft.EventControlType]):
67
+ message: str
68
+ """The message to be displayed in the window."""
69
+
70
+ url: str
71
+ """The URL of the page requesting the dialog."""