hyperflask 0.1.3__tar.gz → 0.1.5__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 (68) hide show
  1. {hyperflask-0.1.3 → hyperflask-0.1.5}/PKG-INFO +1 -1
  2. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/app.py +13 -3
  3. hyperflask-0.1.5/hyperflask/layouts/email.mjml +80 -0
  4. hyperflask-0.1.3/hyperflask/layout.html → hyperflask-0.1.5/hyperflask/layouts/web.html +1 -1
  5. hyperflask-0.1.5/hyperflask/static/app.css +27 -0
  6. hyperflask-0.1.5/hyperflask/ui/components/feedback/Loading.html +4 -0
  7. {hyperflask-0.1.3 → hyperflask-0.1.5}/pyproject.toml +1 -1
  8. hyperflask-0.1.3/hyperflask/ui/components/feedback/Loading.html +0 -4
  9. {hyperflask-0.1.3 → hyperflask-0.1.5}/LICENSE +0 -0
  10. {hyperflask-0.1.3 → hyperflask-0.1.5}/README.md +0 -0
  11. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/__init__.py +0 -0
  12. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/__main__.py +0 -0
  13. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/api.py +0 -0
  14. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/cli.py +0 -0
  15. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/components/__init__.py +0 -0
  16. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/components/alpine.py +0 -0
  17. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/components/core.py +0 -0
  18. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/components/webcomponent.py +0 -0
  19. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/factory.py +0 -0
  20. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/forms/__init__.py +0 -0
  21. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/forms/fields.py +0 -0
  22. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/forms/widgets.py +0 -0
  23. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/page_helpers.py +0 -0
  24. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/reactivity.py +0 -0
  25. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/resources.py +0 -0
  26. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/static/alpine.js +0 -0
  27. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/static/app.js +0 -0
  28. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/static/htmx.js +0 -0
  29. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/static/reactive.js +0 -0
  30. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/static/stimulus.js +0 -0
  31. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/static/translations.js +0 -0
  32. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/ui/components/README.md +0 -0
  33. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/ui/components/actions/Button.html +0 -0
  34. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/ui/components/actions/Dropdown.html +0 -0
  35. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/ui/components/actions/DropdownItem.html +0 -0
  36. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/ui/components/actions/LinkButton.html +0 -0
  37. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/ui/components/actions/Modal.html +0 -0
  38. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/ui/components/actions/ModalAction.html +0 -0
  39. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/ui/components/actions/ModalTitle.html +0 -0
  40. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/ui/components/data-display/Accordion.html +0 -0
  41. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/ui/components/data-display/AccordionPanel.html +0 -0
  42. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/ui/components/data-input/Checkbox.html +0 -0
  43. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/ui/components/data-input/FileInput.html +0 -0
  44. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/ui/components/data-input/FormControl.html +0 -0
  45. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/ui/components/data-input/Input.html +0 -0
  46. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/ui/components/data-input/LabeledCheckbox.html +0 -0
  47. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/ui/components/data-input/LabeledTextInput.html +0 -0
  48. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/ui/components/data-input/Radiobox.html +0 -0
  49. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/ui/components/data-input/Range.html +0 -0
  50. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/ui/components/data-input/Rating.html +0 -0
  51. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/ui/components/data-input/Select.html +0 -0
  52. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/ui/components/data-input/Textarea.html +0 -0
  53. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/ui/components/data-input/Toggle.html +0 -0
  54. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/ui/components/feedback/Toast.html +0 -0
  55. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/ui/components/layout/Footer.html +0 -0
  56. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/ui/components/layout/FooterLink.html +0 -0
  57. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/ui/components/layout/FooterNav.html +0 -0
  58. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/ui/components/layout/Indicator.html +0 -0
  59. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/ui/components/navigation/Link.html +0 -0
  60. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/ui/components/navigation/Navbar.html +0 -0
  61. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/ui/forms.html +0 -0
  62. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/ui/icons.html +0 -0
  63. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/ui/modal.html +0 -0
  64. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/utils/__init__.py +0 -0
  65. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/utils/htmx.py +0 -0
  66. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/utils/page_actions.py +0 -0
  67. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/utils/request.py +0 -0
  68. {hyperflask-0.1.3 → hyperflask-0.1.5}/hyperflask/utils/tokens.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hyperflask
3
- Version: 0.1.3
3
+ Version: 0.1.5
4
4
  Summary: Full stack web framework
5
5
  Home-page: https://github.com/hyperflask/hyperflask
6
6
  License: MIT
@@ -1,6 +1,7 @@
1
1
  # flask
2
2
  from flask import Flask
3
3
  from jinja2 import ChoiceLoader, FileSystemLoader, PrefixLoader
4
+ from werkzeug.middleware.proxy_fix import ProxyFix
4
5
  # hyperflask extensions
5
6
  from jinja_layout import LayoutExtension
6
7
  from jinja_wtforms import WtformExtension
@@ -54,7 +55,9 @@ class Hyperflask(Flask):
54
55
  def __init__(self, *args, static_mode="hybrid", instrument=False, layouts_folder="layouts", partials_folder="partials",
55
56
  emails_folder="emails", forms_folder="forms", assets_folder="assets", pages_folder="pages", migrations_folder="migrations",
56
57
  config=None, config_filename="config.yml", **kwargs):
58
+
57
59
  super().__init__(*args, **kwargs)
60
+ self.wsgi_app = ProxyFix(self.wsgi_app, x_for=1, x_proto=1, x_host=1, x_prefix=1)
58
61
 
59
62
  self.config.update({
60
63
  "FREEZER_DESTINATION": os.path.join(self.root_path, "_site"),
@@ -91,8 +94,8 @@ class Hyperflask(Flask):
91
94
  self.jinja_env.loader.loaders.append(layout_loader)
92
95
  self.jinja_env.loader.loaders.append(PrefixLoader({os.path.basename(layouts_folder): layout_loader}))
93
96
  self.jinja_env.loader.loaders.extend([
94
- FileLoader(os.path.join(os.path.dirname(__file__), "layout.html")),
95
- FileLoader(os.path.join(os.path.dirname(__file__), "layout.html"), "hyperflask_layout.html"),
97
+ FileLoader(os.path.join(os.path.dirname(__file__), "layouts/web.html"), "layout.html"),
98
+ FileLoader(os.path.join(os.path.dirname(__file__), "layouts/web.html"), "hyperflask_layout.html"),
96
99
  PrefixLoader({"ui": FileSystemLoader(os.path.join(os.path.dirname(__file__), "ui"))})
97
100
  ])
98
101
 
@@ -141,13 +144,20 @@ class Hyperflask(Flask):
141
144
  "bootstrap-icons/font": "bootstrap-icons"
142
145
  })
143
146
  self.assets.bundle(
144
- {"@hyperflask": ["app.js"],
147
+ {"@hyperflask": ["app.js", "app.css"],
145
148
  "@hyperflask/reactive": ["reactive.js"],
146
149
  "@hyperflask/alpine": ["alpine.js"]},
147
150
  assets_folder=os.path.join(os.path.dirname(__file__), "static")
148
151
  )
149
152
  self.assets.include("@hyperflask", 0)
150
153
 
154
+ self.extensions['mail_templates'].jinja_env.add_extension(LayoutExtension)
155
+ self.extensions['mail_templates'].jinja_env.default_layout = "layout.mjml"
156
+ self.extensions['mail_templates'].loaders.extend([
157
+ FileLoader(os.path.join(os.path.dirname(__file__), 'layouts/email.mjml'), 'layout.mjml'),
158
+ FileLoader(os.path.join(os.path.dirname(__file__), 'layouts/email.mjml'), 'hyperflask_layout.mjml')
159
+ ])
160
+
151
161
  self.macros.register_from_directory(os.path.join(os.path.dirname(__file__), "ui"))
152
162
  if hasattr(file_routes, "loader"):
153
163
  self.forms.register_from_loader(file_routes.loader, "pages")
@@ -0,0 +1,80 @@
1
+ <mjml>
2
+ <mj-head>
3
+ {% block head %}
4
+ <mj-title>{% block head_title %}{{config.get("SITE_TITLE", "")}}{% endblock %}</mj-title>
5
+ <mj-preview>Pre-header Text</mj-preview>
6
+ <mj-attributes>
7
+ <mj-all font-family="'Helvetica Neue', Helvetica, Arial, sans-serif"></mj-all>
8
+ <mj-text font-weight="400" font-size="16px" color="#000000" line-height="24px" font-family="'Helvetica Neue', Helvetica, Arial, sans-serif"></mj-text>
9
+ </mj-attributes>
10
+ <mj-style inline="inline">
11
+ .body-section {
12
+ -webkit-box-shadow: 1px 4px 11px 0px rgba(0, 0, 0, 0.15);
13
+ -moz-box-shadow: 1px 4px 11px 0px rgba(0, 0, 0, 0.15);
14
+ box-shadow: 1px 4px 11px 0px rgba(0, 0, 0, 0.15);
15
+ }
16
+ </mj-style>
17
+ <mj-style inline="inline">
18
+ .footer-link {
19
+ color: #4d4d4d
20
+ }
21
+ </mj-style>
22
+ {% endblock %}
23
+ </mj-head>
24
+ <mj-body {% block body_tags %}background-color="{{config.get("EMAIL_BACKGROUND_COLOR", "#c8c8c8")}}" width="600px"{% endblock %}>
25
+ <mj-section full-width="full-width" background-color="{{config.get("EMAIL_BACKGROUND_ACCENT_COLOR", "#a6a6a6")}}" padding-bottom="0">
26
+ <mj-column width="100%">
27
+ <mj-text color="#4d4d4d" font-weight="bold" align="center" font-size="16px" letter-spacing="1px">
28
+ {% block brand %}
29
+ {{config.get("SITE_TITLE", "")}}
30
+ {% endblock %}
31
+ </mj-text>
32
+ <mj-wrapper padding="0">
33
+ <mj-section background-color="#fff">
34
+ <mj-column width="100%" padding-left="15px" padding-right="15px">
35
+ <mj-text color="#2d2d2d" font-weight="bold" font-size="20px">
36
+ {% block title %}
37
+ {% if title is defined %}{{ title }}{% endif %}
38
+ {% endblock %}
39
+ </mj-text>
40
+ </mj-column>
41
+ </mj-section>
42
+ </mj-wrapper>
43
+ </mj-column>
44
+ </mj-section>
45
+ <mj-wrapper padding-top="0" padding-bottom="0" css-class="body-section">
46
+ {% block body %}
47
+ <mj-section background-color="#ffffff" padding-left="15px" padding-right="15px">
48
+ <mj-column width="100%">
49
+ {% block content %}{% endblock %}
50
+ </mj-column>
51
+ </mj-section>
52
+ {% endblock %}
53
+ </mj-wrapper>
54
+
55
+ <mj-wrapper full-width="full-width">
56
+ {% block footer %}
57
+ <mj-section>
58
+ <mj-column width="100%" padding="0">
59
+ {% block footer_content %}
60
+ <mj-text color="#4d4d4d" font-size="11px" align="center" line-height="16px">
61
+ You are receiving this email because you have agreed to receive emails from us.
62
+ </mj-text>
63
+ {% endblock %}
64
+ </mj-column>
65
+ </mj-section>
66
+ <mj-section padding-top="0">
67
+ <mj-group>
68
+ <mj-column width="100%" padding-right="0">
69
+ <mj-text color="#4d4d4d" font-size="11px" align="center" line-height="16px" font-weight="bold">
70
+ {% block footer_links %}
71
+ <a class="footer-link" href="{{url_for('index', _external=True)}}">Go to site</a>
72
+ {% endblock %}
73
+ </mj-text>
74
+ </mj-column>
75
+ </mj-group>
76
+ </mj-section>
77
+ {% endblock %}
78
+ </mj-wrapper>
79
+ </mj-body>
80
+ </mjml>
@@ -4,7 +4,7 @@
4
4
  {% block head -%}
5
5
  {% block head_metas %}
6
6
  <meta charset="utf-8">
7
- <meta name="viewport" content="width=device-width, initial-scale=1">
7
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
8
8
  {% endblock %}
9
9
  {% if config["PWA"] -%}
10
10
  <link rel="manifest" href="{{url_for("pwa_manifest")}}" />
@@ -0,0 +1,27 @@
1
+
2
+ .htmx-indicator {
3
+ display:none;
4
+ }
5
+ .htmx-indicator-visible {
6
+ visibility: hidden;
7
+ }
8
+ .htmx-request .htmx-indicator,
9
+ .htmx-request.htmx-indicator {
10
+ display: block;
11
+ }
12
+ .htmx-request .htmx-indicator-inline,
13
+ .htmx-request.htmx-indicator-inline {
14
+ display: inline;
15
+ }
16
+ .htmx-request .htmx-indicator-visible,
17
+ .htmx-request.htmx-indicator-visible {
18
+ visibility: visible;
19
+ }
20
+ .htmx-request .htmx-indicator-hidden,
21
+ .htmx-request.htmx-indicator-hidden {
22
+ display: none;
23
+ }
24
+ .htmx-request .htmx-indicator-invisible,
25
+ .htmx-request.htmx-indicator-invisible {
26
+ visibility: hidden;
27
+ }
@@ -0,0 +1,4 @@
1
+ {% macro Loading(style="spinner", size="md") -%}
2
+ <span class="loading {{kwargs.pop('class', '')}} {% if style %} loading-{{style}}{% endif %} {% if size %} loading-{{size}}{% endif %}" {{ html_attrs(kwargs) }}>
3
+ </span>
4
+ {%- endmacro %}
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "hyperflask"
3
- version = "0.1.3"
3
+ version = "0.1.5"
4
4
  description = "Full stack web framework"
5
5
  authors = ["Maxime Bouroumeau-Fuseau <maxime.bouroumeau@gmail.com>"]
6
6
  readme = "README.md"
@@ -1,4 +0,0 @@
1
- {% macro Loading(style="spinner", size="md") -%}
2
- <span class="loading {% if style %} loading-{{style}}{% endif %} {% if size %} loading-{{size}}{% endif %}">
3
- </span>
4
- {%- endmacro %}
File without changes
File without changes
File without changes
File without changes