motui 1.0.0__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.
Files changed (151) hide show
  1. motui-1.0.0/.github/workflows/ci.yml +64 -0
  2. motui-1.0.0/.github/workflows/release.yml +61 -0
  3. motui-1.0.0/.gitignore +8 -0
  4. motui-1.0.0/LICENSE +21 -0
  5. motui-1.0.0/PKG-INFO +641 -0
  6. motui-1.0.0/README.md +617 -0
  7. motui-1.0.0/docs/API.md +1665 -0
  8. motui-1.0.0/docs/COMPONENTS.md +1416 -0
  9. motui-1.0.0/docs/DESIGN.md +1140 -0
  10. motui-1.0.0/pyproject.toml +60 -0
  11. motui-1.0.0/src/motui/__init__.py +146 -0
  12. motui-1.0.0/src/motui/__main__.py +15 -0
  13. motui-1.0.0/src/motui/app.py +1208 -0
  14. motui-1.0.0/src/motui/chrome.py +1260 -0
  15. motui-1.0.0/src/motui/demo/__init__.py +87 -0
  16. motui-1.0.0/src/motui/demo/__main__.py +8 -0
  17. motui-1.0.0/src/motui/demo/content.py +80 -0
  18. motui-1.0.0/src/motui/demo/fixture.md +346 -0
  19. motui-1.0.0/src/motui/demo/page.py +61 -0
  20. motui-1.0.0/src/motui/demo/pages/__init__.py +1 -0
  21. motui-1.0.0/src/motui/demo/pages/action.py +51 -0
  22. motui-1.0.0/src/motui/demo/pages/choice.py +57 -0
  23. motui-1.0.0/src/motui/demo/pages/chrome.py +151 -0
  24. motui-1.0.0/src/motui/demo/pages/content.py +137 -0
  25. motui-1.0.0/src/motui/demo/pages/data.py +94 -0
  26. motui-1.0.0/src/motui/demo/pages/feedback.py +75 -0
  27. motui-1.0.0/src/motui/demo/pages/input.py +57 -0
  28. motui-1.0.0/src/motui/demo/pages/layout.py +74 -0
  29. motui-1.0.0/src/motui/demo/pages/overview.py +38 -0
  30. motui-1.0.0/src/motui/demo/pages/streaming.py +192 -0
  31. motui-1.0.0/src/motui/demo/pages/styles.py +87 -0
  32. motui-1.0.0/src/motui/demo/registry.py +49 -0
  33. motui-1.0.0/src/motui/demo/script.py +175 -0
  34. motui-1.0.0/src/motui/demo/session.py +444 -0
  35. motui-1.0.0/src/motui/demo/shell.py +107 -0
  36. motui-1.0.0/src/motui/interaction/__init__.py +31 -0
  37. motui-1.0.0/src/motui/interaction/focus.py +267 -0
  38. motui-1.0.0/src/motui/interaction/gesture.py +616 -0
  39. motui-1.0.0/src/motui/interaction/pointer.py +266 -0
  40. motui-1.0.0/src/motui/interaction/search.py +403 -0
  41. motui-1.0.0/src/motui/kernel/__init__.py +170 -0
  42. motui-1.0.0/src/motui/kernel/ansi.py +277 -0
  43. motui-1.0.0/src/motui/kernel/block.py +298 -0
  44. motui-1.0.0/src/motui/kernel/events.py +121 -0
  45. motui-1.0.0/src/motui/kernel/frame.py +1286 -0
  46. motui-1.0.0/src/motui/kernel/lines.py +661 -0
  47. motui-1.0.0/src/motui/kernel/painter.py +201 -0
  48. motui-1.0.0/src/motui/kernel/screen.py +329 -0
  49. motui-1.0.0/src/motui/kernel/selection.py +297 -0
  50. motui-1.0.0/src/motui/kernel/style.py +407 -0
  51. motui-1.0.0/src/motui/kernel/text.py +581 -0
  52. motui-1.0.0/src/motui/kernel/theme.py +172 -0
  53. motui-1.0.0/src/motui/kernel/viewport.py +334 -0
  54. motui-1.0.0/src/motui/keys/__init__.py +53 -0
  55. motui-1.0.0/src/motui/keys/console.py +425 -0
  56. motui-1.0.0/src/motui/keys/decoder.py +429 -0
  57. motui-1.0.0/src/motui/keys/keymap.py +95 -0
  58. motui-1.0.0/src/motui/keys/sources.py +305 -0
  59. motui-1.0.0/src/motui/py.typed +0 -0
  60. motui-1.0.0/src/motui/testing.py +61 -0
  61. motui-1.0.0/src/motui/widgets/__init__.py +99 -0
  62. motui-1.0.0/src/motui/widgets/autocomplete.py +105 -0
  63. motui-1.0.0/src/motui/widgets/button.py +109 -0
  64. motui-1.0.0/src/motui/widgets/checkbox.py +96 -0
  65. motui-1.0.0/src/motui/widgets/choice.py +437 -0
  66. motui-1.0.0/src/motui/widgets/collapsible.py +172 -0
  67. motui-1.0.0/src/motui/widgets/decor.py +245 -0
  68. motui-1.0.0/src/motui/widgets/diff.py +281 -0
  69. motui-1.0.0/src/motui/widgets/editor.py +107 -0
  70. motui-1.0.0/src/motui/widgets/field.py +369 -0
  71. motui-1.0.0/src/motui/widgets/input.py +152 -0
  72. motui-1.0.0/src/motui/widgets/layout.py +304 -0
  73. motui-1.0.0/src/motui/widgets/link.py +75 -0
  74. motui-1.0.0/src/motui/widgets/list.py +366 -0
  75. motui-1.0.0/src/motui/widgets/markdown/__init__.py +104 -0
  76. motui-1.0.0/src/motui/widgets/markdown/blocks.py +336 -0
  77. motui-1.0.0/src/motui/widgets/markdown/component.py +473 -0
  78. motui-1.0.0/src/motui/widgets/markdown/context.py +35 -0
  79. motui-1.0.0/src/motui/widgets/markdown/inline.py +233 -0
  80. motui-1.0.0/src/motui/widgets/markdown/nested.py +252 -0
  81. motui-1.0.0/src/motui/widgets/markdown/tables.py +113 -0
  82. motui-1.0.0/src/motui/widgets/palette.py +145 -0
  83. motui-1.0.0/src/motui/widgets/progress.py +96 -0
  84. motui-1.0.0/src/motui/widgets/radio.py +221 -0
  85. motui-1.0.0/src/motui/widgets/shortcutbar.py +74 -0
  86. motui-1.0.0/src/motui/widgets/slider.py +249 -0
  87. motui-1.0.0/src/motui/widgets/spinner.py +60 -0
  88. motui-1.0.0/src/motui/widgets/statusline.py +111 -0
  89. motui-1.0.0/src/motui/widgets/syntax.py +566 -0
  90. motui-1.0.0/src/motui/widgets/table.py +698 -0
  91. motui-1.0.0/src/motui/widgets/tabs.py +240 -0
  92. motui-1.0.0/src/motui/widgets/textbuf.py +813 -0
  93. motui-1.0.0/src/motui/widgets/tree.py +403 -0
  94. motui-1.0.0/tests/_doubles.py +83 -0
  95. motui-1.0.0/tests/golden/README.md +20 -0
  96. motui-1.0.0/tests/golden/pages/action.txt +71 -0
  97. motui-1.0.0/tests/golden/pages/choice.txt +71 -0
  98. motui-1.0.0/tests/golden/pages/chrome.txt +71 -0
  99. motui-1.0.0/tests/golden/pages/content.txt +71 -0
  100. motui-1.0.0/tests/golden/pages/data.txt +71 -0
  101. motui-1.0.0/tests/golden/pages/feedback.txt +71 -0
  102. motui-1.0.0/tests/golden/pages/input.txt +71 -0
  103. motui-1.0.0/tests/golden/pages/layout.txt +71 -0
  104. motui-1.0.0/tests/golden/pages/overview.txt +71 -0
  105. motui-1.0.0/tests/golden/pages/streaming.txt +71 -0
  106. motui-1.0.0/tests/golden/pages/styles.txt +71 -0
  107. motui-1.0.0/tests/test_ansi.py +135 -0
  108. motui-1.0.0/tests/test_api_doc.py +94 -0
  109. motui-1.0.0/tests/test_api_root.py +195 -0
  110. motui-1.0.0/tests/test_app.py +936 -0
  111. motui-1.0.0/tests/test_block.py +91 -0
  112. motui-1.0.0/tests/test_chrome.py +1155 -0
  113. motui-1.0.0/tests/test_container_hit.py +175 -0
  114. motui-1.0.0/tests/test_core_text.py +860 -0
  115. motui-1.0.0/tests/test_decoder_fuzz.py +157 -0
  116. motui-1.0.0/tests/test_demo_protocol.py +503 -0
  117. motui-1.0.0/tests/test_focus.py +466 -0
  118. motui-1.0.0/tests/test_frame.py +955 -0
  119. motui-1.0.0/tests/test_gesture.py +745 -0
  120. motui-1.0.0/tests/test_golden_frames.py +110 -0
  121. motui-1.0.0/tests/test_keys.py +291 -0
  122. motui-1.0.0/tests/test_keys_sources.py +422 -0
  123. motui-1.0.0/tests/test_packaging.py +102 -0
  124. motui-1.0.0/tests/test_painter.py +266 -0
  125. motui-1.0.0/tests/test_pointer.py +331 -0
  126. motui-1.0.0/tests/test_readme_examples.py +202 -0
  127. motui-1.0.0/tests/test_render_invariants.py +157 -0
  128. motui-1.0.0/tests/test_screen.py +247 -0
  129. motui-1.0.0/tests/test_search.py +250 -0
  130. motui-1.0.0/tests/test_selection.py +302 -0
  131. motui-1.0.0/tests/test_style.py +146 -0
  132. motui-1.0.0/tests/test_theme.py +164 -0
  133. motui-1.0.0/tests/test_viewport.py +363 -0
  134. motui-1.0.0/tests/test_widgets_action.py +301 -0
  135. motui-1.0.0/tests/test_widgets_autocomplete.py +147 -0
  136. motui-1.0.0/tests/test_widgets_basics.py +720 -0
  137. motui-1.0.0/tests/test_widgets_choice.py +338 -0
  138. motui-1.0.0/tests/test_widgets_containers.py +244 -0
  139. motui-1.0.0/tests/test_widgets_diff.py +145 -0
  140. motui-1.0.0/tests/test_widgets_editing.py +997 -0
  141. motui-1.0.0/tests/test_widgets_forms.py +369 -0
  142. motui-1.0.0/tests/test_widgets_list.py +271 -0
  143. motui-1.0.0/tests/test_widgets_markdown.py +713 -0
  144. motui-1.0.0/tests/test_widgets_palette.py +233 -0
  145. motui-1.0.0/tests/test_widgets_statusline.py +134 -0
  146. motui-1.0.0/tests/test_widgets_syntax.py +378 -0
  147. motui-1.0.0/tests/test_widgets_table.py +596 -0
  148. motui-1.0.0/tools/apidoc.py +348 -0
  149. motui-1.0.0/tools/framebench.py +219 -0
  150. motui-1.0.0/tools/golden.py +151 -0
  151. motui-1.0.0/uv.lock +151 -0
@@ -0,0 +1,64 @@
1
+ # The gate, on both platforms, on every push and pull request.
2
+ #
3
+ # One interpreter (3.12, the package's floor), one pinned uv (the version
4
+ # the group's agents ran the local gates with), and the spec's gate lines:
5
+ # pytest, framebench, the golden check and the two piped demo runs. The
6
+ # lines a shell would spell differently are the redirect (``< /dev/null`` /
7
+ # ``< NUL``) and the framebench pipe (its output kept in the log while the
8
+ # hash line is checked), so those two steps carry a small ``python -c``
9
+ # wrapper instead of branching on ``runner.os``: one spelling, every shell.
10
+
11
+ name: ci
12
+
13
+ on:
14
+ push:
15
+ pull_request:
16
+
17
+ permissions:
18
+ contents: read
19
+
20
+ jobs:
21
+ test:
22
+ name: ${{ matrix.os }}
23
+ runs-on: ${{ matrix.os }}
24
+ strategy:
25
+ fail-fast: false
26
+ matrix:
27
+ os: [ubuntu-latest, windows-latest]
28
+ steps:
29
+ - uses: actions/checkout@v4
30
+
31
+ - uses: actions/setup-python@v5
32
+ with:
33
+ python-version: "3.12"
34
+
35
+ - name: uv, pinned to the dev toolchain
36
+ uses: astral-sh/setup-uv@v5
37
+ with:
38
+ version: "0.12.21"
39
+
40
+ - name: install -- the lock is the dependency set, CI does not drift it
41
+ run: uv sync --locked
42
+
43
+ - name: pytest
44
+ run: uv run pytest -q
45
+
46
+ - name: framebench -- exit 0 and the render-hash line present
47
+ # The digest's *value* is not asserted: it is a property of the
48
+ # machine's rendering, and a moved hash is a finding for a human,
49
+ # not a red CI. The exit code and the line's presence are asserted.
50
+ run: |
51
+ uv run python -c "import re, subprocess, sys; done = subprocess.run([sys.executable, 'tools/framebench.py'], capture_output=True, text=True); sys.stdout.write(done.stdout); sys.stderr.write(done.stderr); raise SystemExit(0 if done.returncode == 0 and re.search(r'^render-hash : [0-9a-f]{64}$', done.stdout, re.M) else 1)"
52
+
53
+ - name: golden frames -- every page byte for byte
54
+ run: uv run python tools/golden.py --check
55
+
56
+ - name: demo -- the piped replay, stdin on the null device
57
+ # ``< /dev/null`` is bash's spelling and ``< NUL`` is cmd's;
58
+ # PowerShell has no redirection operator at all. The wrapper is the
59
+ # one spelling all three shells run, so the step needs no branch.
60
+ run: |
61
+ uv run python -c "import subprocess, sys; raise SystemExit(subprocess.run([sys.executable, '-m', 'motui'], stdin=subprocess.DEVNULL).returncode)"
62
+
63
+ - name: demo -- every page dumped
64
+ run: uv run python -m motui --pages
@@ -0,0 +1,61 @@
1
+ # Releases: a ``v*`` tag builds the package and publishes it.
2
+ #
3
+ # Written now, run later: this group ships the file configured and does not
4
+ # push, tag or execute it -- the first real run is the maintainer's call.
5
+ #
6
+ # Publishing is PyPI **trusted publishing** (an OIDC exchange, no API token):
7
+ # there are no secrets in this repository. The one-time setup lives on PyPI:
8
+ # add a publisher (or a "pending publisher") for this repository and this
9
+ # workflow file, and give it the environment name spelled below -- ``pypi``.
10
+ # The job's ``environment:`` must match that name exactly; the job-level
11
+ # ``id-token: write`` is what lets the publish step mint the token PyPI
12
+ # verifies. Change the name here if the publisher is configured with
13
+ # another one; nothing else in this file needs touching.
14
+ #
15
+ # The matrix builds on both platforms -- the cross-platform proof -- and the
16
+ # wheel is pure Python (``py3-none-any``), so exactly one upload happens:
17
+ # the Linux leg's. A run of this workflow without the publisher configured
18
+ # fails at the last step and publishes nothing.
19
+
20
+ name: release
21
+
22
+ on:
23
+ push:
24
+ tags: ["v*"]
25
+
26
+ permissions:
27
+ contents: read
28
+
29
+ jobs:
30
+ release:
31
+ name: ${{ matrix.os }}
32
+ runs-on: ${{ matrix.os }}
33
+ # The environment name PyPI's trusted publisher must carry (see above).
34
+ # It gates the whole job -- the Windows leg included, deliberately: the
35
+ # two legs are one release.
36
+ environment: pypi
37
+ permissions:
38
+ contents: read
39
+ id-token: write
40
+ strategy:
41
+ fail-fast: false
42
+ matrix:
43
+ os: [ubuntu-latest, windows-latest]
44
+ steps:
45
+ - uses: actions/checkout@v4
46
+
47
+ - uses: actions/setup-python@v5
48
+ with:
49
+ python-version: "3.12"
50
+
51
+ - name: uv, pinned to the dev toolchain
52
+ uses: astral-sh/setup-uv@v5
53
+ with:
54
+ version: "0.12.21"
55
+
56
+ - name: build -- the sdist and the wheel, from the locked tree
57
+ run: uv build
58
+
59
+ - name: publish to PyPI -- trusted publishing, one upload
60
+ if: runner.os == 'Linux'
61
+ uses: pypa/gh-action-pypi-publish@release/v1
motui-1.0.0/.gitignore ADDED
@@ -0,0 +1,8 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ .venv/
4
+ dist/
5
+ *.egg-info/
6
+ .pytest_cache/
7
+ .ruff_cache/
8
+ .zcode/
motui-1.0.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Shingwha
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.