flet-webview 0.2.0.dev49__tar.gz → 0.2.0.dev57__tar.gz

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.

Files changed (28) hide show
  1. {flet_webview-0.2.0.dev49/src/flet_webview.egg-info → flet_webview-0.2.0.dev57}/PKG-INFO +1 -1
  2. {flet_webview-0.2.0.dev49 → flet_webview-0.2.0.dev57}/pyproject.toml +36 -14
  3. {flet_webview-0.2.0.dev49 → flet_webview-0.2.0.dev57}/src/flet_webview/__init__.py +9 -0
  4. {flet_webview-0.2.0.dev49 → flet_webview-0.2.0.dev57}/src/flet_webview/types.py +17 -7
  5. {flet_webview-0.2.0.dev49 → flet_webview-0.2.0.dev57}/src/flet_webview/webview.py +60 -48
  6. {flet_webview-0.2.0.dev49 → flet_webview-0.2.0.dev57/src/flet_webview.egg-info}/PKG-INFO +1 -1
  7. {flet_webview-0.2.0.dev49 → flet_webview-0.2.0.dev57}/src/flutter/flet_webview/pubspec.lock +11 -11
  8. {flet_webview-0.2.0.dev49 → flet_webview-0.2.0.dev57}/src/flutter/flet_webview/pubspec.yaml +1 -1
  9. {flet_webview-0.2.0.dev49 → flet_webview-0.2.0.dev57}/LICENSE +0 -0
  10. {flet_webview-0.2.0.dev49 → flet_webview-0.2.0.dev57}/README.md +0 -0
  11. {flet_webview-0.2.0.dev49 → flet_webview-0.2.0.dev57}/setup.cfg +0 -0
  12. {flet_webview-0.2.0.dev49 → flet_webview-0.2.0.dev57}/src/flet_webview.egg-info/SOURCES.txt +0 -0
  13. {flet_webview-0.2.0.dev49 → flet_webview-0.2.0.dev57}/src/flet_webview.egg-info/dependency_links.txt +0 -0
  14. {flet_webview-0.2.0.dev49 → flet_webview-0.2.0.dev57}/src/flet_webview.egg-info/requires.txt +0 -0
  15. {flet_webview-0.2.0.dev49 → flet_webview-0.2.0.dev57}/src/flet_webview.egg-info/top_level.txt +0 -0
  16. {flet_webview-0.2.0.dev49 → flet_webview-0.2.0.dev57}/src/flutter/flet_webview/CHANGELOG.md +0 -0
  17. {flet_webview-0.2.0.dev49 → flet_webview-0.2.0.dev57}/src/flutter/flet_webview/LICENSE +0 -0
  18. {flet_webview-0.2.0.dev49 → flet_webview-0.2.0.dev57}/src/flutter/flet_webview/README.md +0 -0
  19. {flet_webview-0.2.0.dev49 → flet_webview-0.2.0.dev57}/src/flutter/flet_webview/analysis_options.yaml +0 -0
  20. {flet_webview-0.2.0.dev49 → flet_webview-0.2.0.dev57}/src/flutter/flet_webview/lib/flet_webview.dart +0 -0
  21. {flet_webview-0.2.0.dev49 → flet_webview-0.2.0.dev57}/src/flutter/flet_webview/lib/src/extension.dart +0 -0
  22. {flet_webview-0.2.0.dev49 → flet_webview-0.2.0.dev57}/src/flutter/flet_webview/lib/src/utils/webview.dart +0 -0
  23. {flet_webview-0.2.0.dev49 → flet_webview-0.2.0.dev57}/src/flutter/flet_webview/lib/src/webview.dart +0 -0
  24. {flet_webview-0.2.0.dev49 → flet_webview-0.2.0.dev57}/src/flutter/flet_webview/lib/src/webview_mobile_and_mac.dart +0 -0
  25. {flet_webview-0.2.0.dev49 → flet_webview-0.2.0.dev57}/src/flutter/flet_webview/lib/src/webview_web.dart +0 -0
  26. {flet_webview-0.2.0.dev49 → flet_webview-0.2.0.dev57}/src/flutter/flet_webview/lib/src/webview_web_vain.dart +0 -0
  27. {flet_webview-0.2.0.dev49 → flet_webview-0.2.0.dev57}/src/flutter/flet_webview/lib/src/webview_windows_and_linux.dart +0 -0
  28. {flet_webview-0.2.0.dev49 → flet_webview-0.2.0.dev57}/src/flutter/flet_webview/lib/src/webview_windows_and_linux_vain.dart +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flet-webview
3
- Version: 0.2.0.dev49
3
+ Version: 0.2.0.dev57
4
4
  Summary: Display web content in Flet apps using WebView.
5
5
  Author-email: Flet contributors <hello@flet.dev>
6
6
  License-Expression: Apache-2.0
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "flet-webview"
3
- version = "0.2.0.dev49"
3
+ version = "0.2.0.dev57"
4
4
  description = "Display web content in Flet apps using WebView."
5
5
  readme = "README.md"
6
6
  authors = [{ name = "Flet contributors", email = "hello@flet.dev" }]
@@ -20,22 +20,43 @@ Issues = "https://github.com/flet-dev/flet-webview/issues"
20
20
  "flutter.flet_webview" = ["**/*"]
21
21
 
22
22
  [dependency-groups]
23
+ test = [
24
+ "pytest >=7.2.0",
25
+ ]
26
+ lint = [
27
+ "ruff >=0.11.7",
28
+ ]
23
29
  dev = [
24
- "pre-commit>=4.2.0",
25
- "ruff>=0.11.7",
30
+ "pre-commit >=4.2.0",
31
+ { include-group = 'lint' },
32
+ { include-group = 'test' },
33
+ ]
34
+ docs-coverage = [
35
+ "docstr-coverage >=2.3.2",
26
36
  ]
27
37
  docs = [
28
- "mkdocs",
29
- "mkdocs-material",
30
- "mkdocstrings[python]",
31
- "mkdocstrings-python-xref",
32
- "mike",
33
- "markdown>=3.6",
34
- "pymdown-extensions",
35
- "mkdocs-glightbox",
36
- "mkdocs-section-index",
37
- "griffe-modernized-annotations",
38
- "pygments>=2.16",
38
+ "mkdocs >=1.6.1",
39
+ "mkdocs-material >=9.6.15",
40
+ "mkdocstrings-python >=1.16.12",
41
+ "mkdocstrings-python-xref >=1.16.3",
42
+ "mike >=2.1.3",
43
+ "markdown >=3.6",
44
+ "pymdown-extensions >=10.16",
45
+ "mkdocs-exclude >=1.0.2",
46
+ "mkdocs-glightbox >=0.4.0",
47
+ "mkdocs-open-in-new-tab >=1.0.8",
48
+ "mkdocs-section-index >=0.3.10",
49
+ "griffe-modernized-annotations >=1.0.8",
50
+ "griffe-warnings-deprecated >=1.1.0",
51
+ "pygments >=2.16",
52
+ "markdown-exec[ansi] >=1.11.0",
53
+ "pydocstyle >=6.3.0",
54
+ "linkcheckmd >=1.4.0",
55
+ { include-group = 'docs-coverage' },
56
+ ]
57
+ all = [
58
+ { include-group = 'dev' },
59
+ { include-group = 'docs' },
39
60
  ]
40
61
 
41
62
  [build-system]
@@ -64,6 +85,7 @@ select = [
64
85
  "I"
65
86
  ]
66
87
  preview = true
88
+ pydocstyle = { convention = 'google' }
67
89
 
68
90
  [tool.ruff.format]
69
91
  quote-style = "double"
@@ -6,3 +6,12 @@ from .types import (
6
6
  WebViewScrollEvent,
7
7
  )
8
8
  from .webview import WebView
9
+
10
+ __all__ = [
11
+ "LogLevelSeverity",
12
+ "RequestMethod",
13
+ "WebView",
14
+ "WebViewConsoleMessageEvent",
15
+ "WebViewJavaScriptEvent",
16
+ "WebViewScrollEvent",
17
+ ]
@@ -1,14 +1,18 @@
1
1
  from dataclasses import dataclass
2
2
  from enum import Enum
3
+ from typing import TYPE_CHECKING
3
4
 
4
5
  import flet as ft
5
6
 
7
+ if TYPE_CHECKING:
8
+ from .webview import WebView # noqa
9
+
6
10
  __all__ = [
7
- "RequestMethod",
8
11
  "LogLevelSeverity",
9
- "WebViewScrollEvent",
12
+ "RequestMethod",
10
13
  "WebViewConsoleMessageEvent",
11
14
  "WebViewJavaScriptEvent",
15
+ "WebViewScrollEvent",
12
16
  ]
13
17
 
14
18
 
@@ -45,16 +49,22 @@ class LogLevelSeverity(Enum):
45
49
 
46
50
 
47
51
  @dataclass
48
- class WebViewScrollEvent(ft.Event[ft.EventControlType]):
52
+ class WebViewScrollEvent(ft.Event["WebView"]):
49
53
  x: float
50
- """The value of the horizontal offset with the origin being at the leftmost of the `WebView`."""
54
+ """
55
+ The value of the horizontal offset with the origin being at the
56
+ leftmost of the `WebView`.
57
+ """
51
58
 
52
59
  y: float
53
- """The value of the vertical offset with the origin being at the topmost of the `WebView`."""
60
+ """
61
+ The value of the vertical offset with the origin being at the
62
+ topmost of the `WebView`.
63
+ """
54
64
 
55
65
 
56
66
  @dataclass
57
- class WebViewConsoleMessageEvent(ft.Event[ft.EventControlType]):
67
+ class WebViewConsoleMessageEvent(ft.Event["WebView"]):
58
68
  message: str
59
69
  """The message written to the console."""
60
70
 
@@ -63,7 +73,7 @@ class WebViewConsoleMessageEvent(ft.Event[ft.EventControlType]):
63
73
 
64
74
 
65
75
  @dataclass
66
- class WebViewJavaScriptEvent(ft.Event[ft.EventControlType]):
76
+ class WebViewJavaScriptEvent(ft.Event["WebView"]):
67
77
  message: str
68
78
  """The message to be displayed in the window."""
69
79
 
@@ -1,5 +1,5 @@
1
1
  import asyncio
2
- from typing import List, Optional
2
+ from typing import Optional
3
3
 
4
4
  import flet as ft
5
5
 
@@ -27,103 +27,101 @@ class WebView(ft.ConstrainedControl):
27
27
 
28
28
  enable_javascript: Optional[bool] = None
29
29
  """
30
- Enable or disable the JavaScript execution on the page.
31
-
32
- Note that disabling the JavaScript execution on the page may result to unexpected web page behaviour.
30
+ Enable or disable the JavaScript execution on the page.
31
+
32
+ Note that disabling the JavaScript execution on the page may result to
33
+ unexpected web page behaviour.
33
34
  """
34
35
 
35
- prevent_links: Optional[List[str]] = None
36
+ prevent_links: Optional[list[str]] = None
36
37
  """List of url-prefixes that should not be followed/loaded/downloaded."""
37
38
 
38
39
  bgcolor: Optional[ft.ColorValue] = None
39
40
  """Defines the background color of the WebView."""
40
41
 
41
- on_page_started: ft.OptionalControlEventHandler["WebView"] = None
42
+ on_page_started: Optional[ft.ControlEventHandler["WebView"]] = None
42
43
  """
43
44
  Fires soon as the first loading process of the webview page is started.
44
-
45
- Event handler argument's `data` property is of type `str` and contains the URL.
46
-
45
+
46
+ Event handler argument's [`data`][flet.Event.data] property is of type
47
+ `str` and contains the URL.
48
+
47
49
  Note:
48
50
  Works only on the following platforms: iOS, Android and macOS.
49
51
  """
50
52
 
51
- on_page_ended: ft.OptionalControlEventHandler["WebView"] = None
53
+ on_page_ended: Optional[ft.ControlEventHandler["WebView"]] = None
52
54
  """
53
55
  Fires when all the webview page loading processes are ended.
54
-
55
- Event handler argument's `data` property is of type `str` and contains the URL.
56
-
56
+
57
+ Event handler argument's [`data`][flet.Event.data] property is of type `str`
58
+ and contains the URL.
59
+
57
60
  Note:
58
61
  Works only on the following platforms: iOS, Android and macOS.
59
62
  """
60
63
 
61
- on_web_resource_error: ft.OptionalControlEventHandler["WebView"] = None
64
+ on_web_resource_error: Optional[ft.ControlEventHandler["WebView"]] = None
62
65
  """
63
66
  Fires when there is error with loading a webview page resource.
64
-
65
- Event handler argument's `data` property is of type `str` and contains the error message.
66
-
67
+
68
+ Event handler argument's [`data`][flet.Event.data] property is of type
69
+ `str` and contains the error message.
70
+
67
71
  Note:
68
72
  Works only on the following platforms: iOS, Android and macOS.
69
73
  """
70
74
 
71
- on_progress: ft.OptionalControlEventHandler["WebView"] = None
75
+ on_progress: Optional[ft.ControlEventHandler["WebView"]] = None
72
76
  """
73
77
  Fires when the progress of the webview page loading is changed.
74
-
75
- Event handler argument's `data` property is of type `int` and contains the progress value.
76
-
78
+
79
+ Event handler argument's [`data`][flet.Event.data] property is of type
80
+ `int` and contains the progress value.
81
+
77
82
  Note:
78
83
  Works only on the following platforms: iOS, Android and macOS.
79
84
  """
80
85
 
81
- on_url_change: ft.OptionalControlEventHandler["WebView"] = None
86
+ on_url_change: Optional[ft.ControlEventHandler["WebView"]] = None
82
87
  """
83
88
  Fires when the URL of the webview page is changed.
84
-
85
- Event handler argument's `data` property is of type `str` and contains the new URL.
86
-
89
+
90
+ Event handler argument's [`data`][flet.Event.data] property is of type
91
+ `str` and contains the new URL.
92
+
87
93
  Note:
88
94
  Works only on the following platforms: iOS, Android and macOS.
89
95
  """
90
96
 
91
- on_scroll: ft.OptionalEventHandler[WebViewScrollEvent["WebView"]] = None
97
+ on_scroll: Optional[ft.EventHandler[WebViewScrollEvent]] = None
92
98
  """
93
99
  Fires when the web page's scroll position changes.
94
-
95
- Event handler argument is of type `WebviewScrollEvent`.
96
-
100
+
97
101
  Note:
98
102
  Works only on the following platforms: iOS, Android and macOS.
99
103
  """
100
104
 
101
- on_console_message: ft.OptionalEventHandler[
102
- WebViewConsoleMessageEvent["WebView"]
103
- ] = None
105
+ on_console_message: Optional[ft.EventHandler[WebViewConsoleMessageEvent]] = None
104
106
  """
105
107
  Fires when a log message is written to the JavaScript console.
106
-
107
- Event handler argument is of type `WebviewConsoleMessageEvent`.
108
-
108
+
109
109
  Note:
110
110
  Works only on the following platforms: iOS, Android and macOS.
111
111
  """
112
112
 
113
- on_javascript_alert_dialog: ft.OptionalEventHandler[
114
- WebViewJavaScriptEvent["WebView"]
115
- ] = None
113
+ on_javascript_alert_dialog: Optional[ft.EventHandler[WebViewJavaScriptEvent]] = None
116
114
  """
117
115
  Fires when the web page attempts to display a JavaScript alert() dialog.
118
-
119
- Event handler argument is of type `WebviewJavaScriptEvent`.
120
-
116
+
121
117
  Note:
122
118
  Works only on the following platforms: iOS, Android and macOS.
123
119
  """
124
120
 
125
121
  def _check_mobile_or_mac_platform(self):
126
- """Checks/Validates support for the current platform (iOS, Android, or macOS)."""
122
+ """
123
+ Checks/Validates support for the current platform (iOS, Android, or macOS).
124
+ """
127
125
  assert self.page is not None, "WebView must be added to page first."
128
126
  if self.page.web or self.page.platform not in [
129
127
  ft.PagePlatform.ANDROID,
@@ -312,10 +310,12 @@ class WebView(ft.ConstrainedControl):
312
310
 
313
311
  async def get_current_url_async(self) -> Optional[str]:
314
312
  """
315
- Returns the current URL that the WebView is displaying or `None` if no URL was ever loaded.
313
+ Returns the current URL that the WebView is displaying or `None`
314
+ if no URL was ever loaded.
316
315
 
317
316
  Returns:
318
- The current URL that the WebView is displaying or `None` if no URL was ever loaded.
317
+ The current URL that the WebView is displaying or `None`
318
+ if no URL was ever loaded.
319
319
 
320
320
  Note:
321
321
  Works only on the following platforms: iOS, Android and macOS.
@@ -373,7 +373,10 @@ class WebView(ft.ConstrainedControl):
373
373
  Works only on the following platforms: iOS, Android and macOS.
374
374
  """
375
375
  self._check_mobile_or_mac_platform()
376
- await self._invoke_method_async("load_file", arguments={"path": path})
376
+ await self._invoke_method_async(
377
+ method_name="load_file",
378
+ arguments={"path": path},
379
+ )
377
380
 
378
381
  def load_request(self, url: str, method: RequestMethod = RequestMethod.GET):
379
382
  """
@@ -428,7 +431,10 @@ class WebView(ft.ConstrainedControl):
428
431
  Works only on the following platforms: iOS, Android and macOS.
429
432
  """
430
433
  self._check_mobile_or_mac_platform()
431
- await self._invoke_method_async("run_javascript", arguments={"value": value})
434
+ await self._invoke_method_async(
435
+ method_name="run_javascript",
436
+ arguments={"value": value},
437
+ )
432
438
 
433
439
  def load_html(self, value: str, base_url: Optional[str] = None):
434
440
  """
@@ -486,7 +492,10 @@ class WebView(ft.ConstrainedControl):
486
492
  Works only on the following platforms: iOS, Android and macOS.
487
493
  """
488
494
  self._check_mobile_or_mac_platform()
489
- await self._invoke_method_async("scroll_to", arguments={"x": x, "y": y})
495
+ await self._invoke_method_async(
496
+ method_name="scroll_to",
497
+ arguments={"x": x, "y": y},
498
+ )
490
499
 
491
500
  def scroll_by(self, x: int, y: int):
492
501
  """
@@ -514,4 +523,7 @@ class WebView(ft.ConstrainedControl):
514
523
  Works only on the following platforms: iOS, Android and macOS.
515
524
  """
516
525
  self._check_mobile_or_mac_platform()
517
- await self._invoke_method_async("scroll_by", arguments={"x": x, "y": y})
526
+ await self._invoke_method_async(
527
+ method_name="scroll_by",
528
+ arguments={"x": x, "y": y},
529
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flet-webview
3
- Version: 0.2.0.dev49
3
+ Version: 0.2.0.dev57
4
4
  Summary: Display web content in Flet apps using WebView.
5
5
  Author-email: Flet contributors <hello@flet.dev>
6
6
  License-Expression: Apache-2.0
@@ -126,7 +126,7 @@ packages:
126
126
  description:
127
127
  path: "packages/flet"
128
128
  ref: main
129
- resolved-ref: b996d06ff462b88f5b31d6cceafac34ea6f57968
129
+ resolved-ref: cf8823c5d766ea7866480986aa3ee871f4091e78
130
130
  url: "https://github.com/flet-dev/flet.git"
131
131
  source: git
132
132
  version: "0.70.0"
@@ -147,10 +147,10 @@ packages:
147
147
  dependency: "direct dev"
148
148
  description:
149
149
  name: flutter_lints
150
- sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04
150
+ sha256: "9e8c3858111da373efc5aa341de011d9bd23e2c5c5e0c62bccf32438e192d7b1"
151
151
  url: "https://pub.dev"
152
152
  source: hosted
153
- version: "2.0.3"
153
+ version: "3.0.2"
154
154
  flutter_localizations:
155
155
  dependency: transitive
156
156
  description: flutter
@@ -258,10 +258,10 @@ packages:
258
258
  dependency: transitive
259
259
  description:
260
260
  name: lints
261
- sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452"
261
+ sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290
262
262
  url: "https://pub.dev"
263
263
  source: hosted
264
- version: "2.1.1"
264
+ version: "3.0.0"
265
265
  logging:
266
266
  dependency: transitive
267
267
  description:
@@ -727,10 +727,10 @@ packages:
727
727
  dependency: transitive
728
728
  description:
729
729
  name: webview_flutter_android
730
- sha256: f6e6afef6e234801da77170f7a1847ded8450778caf2fe13979d140484be3678
730
+ sha256: "9573ad97890d199ac3ab32399aa33a5412163b37feb573eb5b0a76b35e9ffe41"
731
731
  url: "https://pub.dev"
732
732
  source: hosted
733
- version: "4.7.0"
733
+ version: "4.8.2"
734
734
  webview_flutter_platform_interface:
735
735
  dependency: "direct main"
736
736
  description:
@@ -751,10 +751,10 @@ packages:
751
751
  dependency: transitive
752
752
  description:
753
753
  name: webview_flutter_wkwebview
754
- sha256: a3d461fe3467014e05f3ac4962e5fdde2a4bf44c561cb53e9ae5c586600fdbc3
754
+ sha256: "71523b9048cf510cfa1fd4e0a3fa5e476a66e0884d5df51d59d5023dba237107"
755
755
  url: "https://pub.dev"
756
756
  source: hosted
757
- version: "3.22.0"
757
+ version: "3.22.1"
758
758
  win32:
759
759
  dependency: transitive
760
760
  description:
@@ -775,10 +775,10 @@ packages:
775
775
  dependency: transitive
776
776
  description:
777
777
  name: window_manager
778
- sha256: "51d50168ab267d344b975b15390426b1243600d436770d3f13de67e55b05ec16"
778
+ sha256: "7eb6d6c4164ec08e1bf978d6e733f3cebe792e2a23fb07cbca25c2872bfdbdcd"
779
779
  url: "https://pub.dev"
780
780
  source: hosted
781
- version: "0.5.0"
781
+ version: "0.5.1"
782
782
  window_to_front:
783
783
  dependency: transitive
784
784
  description:
@@ -24,4 +24,4 @@ dependencies:
24
24
  dev_dependencies:
25
25
  flutter_test:
26
26
  sdk: flutter
27
- flutter_lints: ^2.0.0
27
+ flutter_lints: ^3.0.0