wagtail-tw-blocks 0.1.0__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.
@@ -0,0 +1,12 @@
1
+ {
2
+ "dependencies": {
3
+ "@tailwindcss/cli": "^4.1.11",
4
+ "tailwindcss": "^4.1.11"
5
+ },
6
+ "devDependencies": {
7
+ "@tailwindcss/typography": "^0.5.16",
8
+ "daisyui": "^5.0.50",
9
+ "prettier": "^3.6.2",
10
+ "prettier-plugin-tailwindcss": "^0.6.14"
11
+ }
12
+ }
@@ -0,0 +1,17 @@
1
+ <div class="grid gap-4">
2
+ {% for item in self.items %}
3
+ <div
4
+ class="collapse collapse-{{ self.variant }} bg-base-100 rounded-box border-base-300 border shadow-sm"
5
+ >
6
+ <input
7
+ type="radio"
8
+ name="{{ self.name|slugify }}"
9
+ checked="{{ item.is_expanded }}"
10
+ />
11
+ <div class="collapse-title font-semibold">{{ item.title }}</div>
12
+ <div class="collapse-content">
13
+ <div class="prose prose-sm">{{ item.content }}</div>
14
+ </div>
15
+ </div>
16
+ {% endfor %}
17
+ </div>
@@ -0,0 +1,23 @@
1
+ {% load wagtailcore_tags %}
2
+
3
+ <div
4
+ role="alert"
5
+ class="alert alert-{{ self.variant }} alert-{{ self.level }} {% if self.is_vertical %} alert-vertical {% endif %}"
6
+ >
7
+ <span class="badge badge-sm badge-{{ self.level }} lg:badge-md">
8
+ {{ self.level }}
9
+ </span>
10
+
11
+ <div>{{ self.message }}</div>
12
+
13
+ <div class="flex items-center gap-1 flex-wrap">
14
+ {% for action in self.actions %}
15
+ <a
16
+ href="{% if self.action.page %}{% pageurl self.action.page %}{% else %}{{ self.action.url }}{% endif %}"
17
+ class="btn btn-sm btn-{{ self.level }} md:btn-md"
18
+ >
19
+ {{ self.action.label }}
20
+ </a>
21
+ {% endfor %}
22
+ </div>
23
+ </div>
@@ -0,0 +1,51 @@
1
+ {% load i18n wagtailembeds_tags wagtailimages_tags %}
2
+
3
+ <div
4
+ class="carousel size-full {% if self.is_vertical %} carousel-vertical {% endif %}"
5
+ >
6
+ {% for item in self.items %}
7
+ <div class="carousel-item relative w-full">
8
+ {% if item.image %}
9
+ <figure class="skeleton overflow-clip">
10
+ {% image item.image scale-100 %}
11
+ </figure>
12
+ {% else %}{% embed item.video %}{% endif %}
13
+
14
+ <div class="absolute inset-x-4 bottom-4 flex items-center justify-between">
15
+ {% if not forloop.first %}
16
+ <div
17
+ class="tooltip tooltip-right tooltip-primary rtl:tooltip-left mr-auto rtl:ml-auto rtl:mr-0"
18
+ data-tip="{% trans 'Swipe left' %}"
19
+ >
20
+ <button
21
+ class="btn btn-circle btn-xs btn-primary md:btn-md xl:btn-lg 2xl:btn-xl"
22
+ >
23
+ <span class="sr-only">{% trans 'Swipe left' %}</span>
24
+ <i
25
+ date-lucide="chevron-left"
26
+ class="size-4 md:size-6 rtl:rotate-180"
27
+ ></i>
28
+ </button>
29
+ </div>
30
+ {% endif %}
31
+ <!---->
32
+ {% if not forloop.last %}
33
+ <div
34
+ class="tooltip tooltip-left tooltip-primary rtl:tooltip-right ml-auto rtl:mr-auto rtl:ml-0"
35
+ data-tip="{% trans 'Swipe right' %}"
36
+ >
37
+ <button
38
+ class="btn btn-circle btn-xs btn-primary md:btn-md xl:btn-lg 2xl:btn-xl"
39
+ >
40
+ <span class="sr-only">{% trans 'Swipe right' %}</span>
41
+ <i
42
+ date-lucide="chevron-right"
43
+ class="size-4 md:size-6 rtl:rotate-180"
44
+ ></i>
45
+ </button>
46
+ </div>
47
+ {% endif %}
48
+ </div>
49
+ </div>
50
+ {% endfor %}
51
+ </div>
@@ -0,0 +1,46 @@
1
+ {% load i18n %}
2
+
3
+ <div
4
+ class="card card-sm lg:card-md 2xl:card-lg border border-base-300 bg-base-200"
5
+ >
6
+ <div class="flex items-center justify-between gap-4 p-2">
7
+ <div class="flex items-center gap-2">
8
+ <div class="size-5 rounded-full bg-green-500"></div>
9
+ <div class="size-5 rounded-full bg-yellow-500"></div>
10
+ <div class="size-5 rounded-full bg-red-500"></div>
11
+ </div>
12
+
13
+ {% if self.show_language %}
14
+ <div
15
+ class="tooltip tooltip-bottom tooltip-primary"
16
+ data-tip="{% trans 'Programming language' %}"
17
+ >
18
+ <span class="badge badge-sm badge-primary lg:badge-md">
19
+ <i data-lucide="terminal" class="size-4 lg:size-5"></i>
20
+ <span class="sr-only">{% trans 'Programming language' %}</span>
21
+ <span>{{ self.language|title }}</span>
22
+ </span>
23
+ </div>
24
+ {% endif %}
25
+
26
+ <!---->
27
+ {% if self.show_language %}
28
+ <div
29
+ class="tooltip tooltip-left tooltip-primary rtl:tooltip-right"
30
+ data-tip="{% trans 'Copy' %}"
31
+ >
32
+ <button
33
+ class="btn btn-xs btn-copy btn-soft btn-square btn-primary lg:btn-sm"
34
+ data-clipboard-text="{{ self.code }}"
35
+ >
36
+ <span class="sr-only">{% trans 'Copy' %}</span>
37
+ <i data-lucide="copy" class="size-4 lg:size-5"></i>
38
+ </button>
39
+ </div>
40
+ {% endif %}
41
+ </div>
42
+
43
+ <pre
44
+ class="overflow-x-auto max-w-full"
45
+ ><code class="p-4 bg-transparent language-{{ self.language }}">{{ self.code }}</code></pre>
46
+ </div>
@@ -0,0 +1,11 @@
1
+ {% load wagtailimages_tags %}
2
+
3
+ <figure class="diff aspect-video" tabindex="0">
4
+ <div class="diff-item-1 size-full" role="img" tabindex="0">
5
+ {% image self.item_1 scale-100 %}
6
+ </div>
7
+ <div class="diff-item-2 size-full" role="img">
8
+ {% image self.item_2 scale-100 %}
9
+ </div>
10
+ <div class="diff-resizer"></div>
11
+ </figure>
@@ -0,0 +1,18 @@
1
+ <div
2
+ class="alert alert-soft alert-outlined alert-dashed alert-info alert-success alert-error alert-warning"
3
+ ></div>
4
+
5
+ <button
6
+ class="btn btn-circle btn-square btn-xs btn-ghost btn-soft btn-outlined btn-primary btn-secondary btn-accent btn-success btn-info btn-warning btn-error sm:btn-sm md:btn-md xl:btn-lg 2xl:btn-xl"
7
+ ></button>
8
+
9
+ <div
10
+ class="card card-side card-xs sm:card-sm md:card-md xl:card-lg 2xl:card-xl"
11
+ >
12
+ <div class="card-body">
13
+ <div class="card-title"></div>
14
+ <div class="card-actions"></div>
15
+ </div>
16
+ </div>
17
+
18
+ <div class="collapse-plus collapse-arrow collapse-open"></div>
@@ -0,0 +1,185 @@
1
+ Metadata-Version: 2.4
2
+ Name: wagtail-tw-blocks
3
+ Version: 0.1.0
4
+ Summary: A collection of reusable, production-ready content blocks for Wagtail CMS, styled with Tailwind CSS and daisyUI.
5
+ License: MIT
6
+ License-File: LICENSE
7
+ Author: Yousef Abu Shanab
8
+ Author-email: josephyousef249@gmail.com
9
+ Requires-Python: >=3.10
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Programming Language :: Python :: 3.14
17
+ Requires-Dist: django (>=5.2.1)
18
+ Requires-Dist: wagtail (>=7.0)
19
+ Description-Content-Type: text/markdown
20
+
21
+ # wagtail-tw-blocks
22
+
23
+ [![CI](https://github.com/youzarsiph/wagtail-tw-blocks/actions/workflows/ci.yml/badge.svg)](https://github.com/youzarsiph/wagtail-tw-blocks/actions/workflows/ci.yml)
24
+ [![CD](https://github.com/youzarsiph/wagtail-tw-blocks/actions/workflows/cd.yml/badge.svg)](https://github.com/youzarsiph/wagtail-tw-blocks/actions/workflows/cd.yml)
25
+ [![Code Style: Black](https://github.com/youzarsiph/wagtail-tw-blocks/actions/workflows/black.yml/badge.svg)](https://github.com/youzarsiph/wagtail-tw-blocks/actions/workflows/black.yml)
26
+ [![Code Linting: Ruff](https://github.com/youzarsiph/wagtail-tw-blocks/actions/workflows/ruff.yml/badge.svg)](https://github.com/youzarsiph/wagtail-tw-blocks/actions/workflows/ruff.yml)
27
+ [![Docker Image](https://github.com/youzarsiph/wagtail-tw-blocks/actions/workflows/docker-image.yml/badge.svg)](https://github.com/youzarsiph/wagtail-tw-blocks/actions/workflows/docker-image.yml)
28
+ [![Docker Publish](https://github.com/youzarsiph/wagtail-tw-blocks/actions/workflows/docker-publish.yml/badge.svg)](https://github.com/youzarsiph/wagtail-tw-blocks/actions/workflows/docker-publish.yml)
29
+ [![PyPI - Version](https://img.shields.io/pypi/v/wagtail-tw-blocks?logo=pypi&logoColor=white)](https://pypi.org/project/wagtail-tw-blocks/)
30
+ [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/wagtail-tw-blocks?logo=python&logoColor=white)](https://pypi.org/project/wagtail-tw-blocks/)
31
+ [![PyPI - Downloads](https://img.shields.io/pypi/dm/wagtail-tw-blocks?logo=pypi&logoColor=white)](https://pypi.org/project/wagtail-tw-blocks/)
32
+ [![PyPI - License](https://img.shields.io/pypi/l/wagtail-tw-blocks?logo=pypi&logoColor=white)](https://pypi.org/project/wagtail-tw-blocks/)
33
+
34
+ ## Overview
35
+
36
+ **wagtail-tw-blocks** is a collection of reusable, production-ready content blocks for Wagtail CMS, styled with Tailwind CSS and daisyUI. It provides a set of common UI components—ready to drop into your `StreamField`—so you can build rich, modern page layouts without reinventing the wheel.
37
+
38
+ ---
39
+
40
+ ## Available blocks
41
+
42
+ - **Accordion (Collapse):** Expandable/collapsible sections for FAQs or structured content.
43
+ - **Alert:** Highlight important messages or status updates.
44
+ - **Carousel:** Image or content slider with responsive design.
45
+ - **Code:** Syntax-highlighted code snippets for technical content (Requires `highlight.js` and `clipboard.js` to be included in your page).
46
+ - **Diff:** Side-by-side or inline difference highlighting for image comparisons.
47
+
48
+ ---
49
+
50
+ ## Installation
51
+
52
+ ```bash
53
+ pip install wagtail-tw-blocks
54
+ ```
55
+
56
+ ---
57
+
58
+ ## Configuration
59
+
60
+ Add `wagtail_blocks` to your `INSTALLED_APPS` **after** configuring your Wagtail settings:
61
+
62
+ ```python
63
+ # project/settings.py
64
+
65
+ INSTALLED_APPS = [
66
+ "wagtail_blocks",
67
+ # ...
68
+ ]
69
+ ```
70
+
71
+ ### Available settings
72
+
73
+ You can customize the behavior of `wagtail-tw-blocks` by adding the following settings to your Django settings file:
74
+
75
+ ```python
76
+ # project/settings.py
77
+
78
+ # Extend or override the default programming languages for the CodeBlock
79
+ WAGTAIL_BLOCKS_PROGRAMMING_LANGUAGES = [
80
+ ('python', 'Python'),
81
+ ('javascript', 'JavaScript'),
82
+ ('html', 'HTML'),
83
+ ('css', 'CSS'),
84
+ ('java', 'Java'),
85
+ ('csharp', 'C#'),
86
+ ('cpp', 'C++'),
87
+ ('ruby', 'Ruby'),
88
+ ('go', 'Go'),
89
+ ('php', 'PHP'),
90
+ # ...
91
+ ]
92
+
93
+ # Show or hide the programming language label in the CodeBlock
94
+ WAGTAIL_BLOCKS_SHOW_PROGRAMMING_LANGUAGE = True # Default is True
95
+
96
+ # Show or hide the copy button in the CodeBlock
97
+ WAGTAIL_BLOCKS_SHOW_COPY_BUTTON = True # Default is True
98
+ ---
99
+
100
+ ## Usage example
101
+
102
+ ```python
103
+ # blog/models.py
104
+
105
+ from wagtail_blocks import blocks
106
+ from wagtail.admin.panels import FieldPanel
107
+ from wagtail.fields import StreamField
108
+ from wagtail.models import Page
109
+ from django.utils.translation import gettext_lazy as _
110
+
111
+
112
+ class Article(Page):
113
+ content = StreamField(
114
+ [
115
+ ("accordion", blocks.AccordionBlock()),
116
+ ("alert", blocks.AlertBlock()),
117
+ ("carousel", blocks.CarouselBlock()),
118
+ ("code", blocks.CodeBlock()),
119
+ ("diff", blocks.DiffBlock()),
120
+ ],
121
+ help_text=_("Article content"),
122
+ )
123
+
124
+ content_panels = Page.content_panels + [
125
+ FieldPanel("content"),
126
+ # ...
127
+ ]
128
+ ```
129
+
130
+ ```html
131
+ <!-- blog/base.html -->
132
+
133
+ {% load static %}
134
+
135
+ <!doctype html>
136
+
137
+ <html data-theme="luxury">
138
+ <head>
139
+ <meta charset="UTF-8" />
140
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
141
+ <title>Wagtail Blocks Usage Example</title>
142
+ <!-- You also may want to include TailwindCSS and daisyUI -->
143
+ <link href="{% static 'wagtail_blocks/css/styles.css' %}" rel="stylesheet" type="text/css" />
144
+ </head>
145
+
146
+ <body>
147
+ <!-- ... -->
148
+ <main>
149
+ {{ article.content }}
150
+ </main>
151
+ </body>
152
+ </html>
153
+ ```
154
+
155
+ ---
156
+
157
+ ## Key features
158
+
159
+ - **Modern design:** Tailwind CSS + daisyUI styling for clean, responsive layouts.
160
+ - **Multiple themes:** All daisyUI themes included, with easy customization.
161
+ - **CI/CD:** GitHub Actions pipelines for automated testing and deployment.
162
+ - **Dependency management:** Poetry for reproducible, maintainable installs.
163
+ - **Code formatting:** Black for consistent, automatic formatting.
164
+ - **Linting:** Ruff for fast, comprehensive linting.
165
+ - **Testing:** Django test runner for unit and integration tests.
166
+ - **Starter configs:** `.gitignore`, `pyproject.toml`, and other essentials included.
167
+
168
+ ---
169
+
170
+ ## Contributing
171
+
172
+ We welcome community contributions. See the [CONTRIBUTING](CONTRIBUTING.md) guide for setup instructions, coding standards, and workflow. Opening an issue before major changes helps align on scope and direction.
173
+
174
+ ---
175
+
176
+ ## Support
177
+
178
+ For questions, bug reports, or feature requests, open an issue or join the conversation in [GitHub Discussions](https://github.com/youzarsiph/wagtail-tw-blocks/discussions).
179
+
180
+ ---
181
+
182
+ ## License
183
+
184
+ Licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
185
+
@@ -0,0 +1,19 @@
1
+ wagtail_blocks/__init__.py,sha256=n4vTL1f0Ctj2Z8_Uqu2JZsKxmfdJiRpjw8T43QmDfU0,1154
2
+ wagtail_blocks/apps.py,sha256=tOZ8btDhg8nCbNbbjTr6N4MQUEuC600is3PN-ufHJcU,300
3
+ wagtail_blocks/blocks.py,sha256=hhqA6hhl1Wir2LXBCxYB5QiZWlFVMk79UhO42BDnIhM,5043
4
+ wagtail_blocks/static/wagtail_blocks/.prettierrc,sha256=GyU5YqXRkB3eeDxAGhpB3jYr_WU3MHW4p60vg_HmoUU,90
5
+ wagtail_blocks/static/wagtail_blocks/README.md,sha256=8gnnrxo9Ex_Tsn_XqiO-S04CW9uMP5uFc_XWfem72h4,427
6
+ wagtail_blocks/static/wagtail_blocks/css/app.css,sha256=ml0bDAwl7AYoiJb0-RYwj0mfB_Wp6enIBiX_Z5ZJ4zE,95
7
+ wagtail_blocks/static/wagtail_blocks/css/styles.css,sha256=b5f_oikmD5ZIrLauJUo0-IzlzeoBHapkokC6xmQV36Q,142715
8
+ wagtail_blocks/static/wagtail_blocks/package-lock.json,sha256=IEPpdJ4bDbAcuIaN7UCJbHoaSuN2cF9D4jvSa2tw8ME,44816
9
+ wagtail_blocks/static/wagtail_blocks/package.json,sha256=efWO1d-Nq8mu890fHS1OXjQ92xu5xxh3Q_fc0oDy9pc,259
10
+ wagtail_blocks/templates/wagtail_blocks/blocks/accordion.html,sha256=LhdIxrZqZH2vVZmVmuqOrrpe59txNXv-J4G2hdhx5J8,491
11
+ wagtail_blocks/templates/wagtail_blocks/blocks/alert.html,sha256=rlxlE6G7386sA78tpklyqjHS9Rp_n8uGAWy46dLUa2U,639
12
+ wagtail_blocks/templates/wagtail_blocks/blocks/carousel.html,sha256=fi1Ov1VU4EvXsBznanoBF2W-TSsFQnk4bWRuZCq1ZZc,1608
13
+ wagtail_blocks/templates/wagtail_blocks/blocks/code.html,sha256=IQFivbS1CR7eAgf9TKz2HN7PznassCi1gZUI-ZqRyFc,1460
14
+ wagtail_blocks/templates/wagtail_blocks/blocks/diff.html,sha256=0taQyr32qrWHaMFb6EGiMbs3HDckG2LDU887HXzCHWs,328
15
+ wagtail_blocks/templates/wagtail_blocks/styles.html,sha256=AgLY1cmnmoXybUEJe4I88uo_jWQ3z6sTIeUKIciu3f4,599
16
+ wagtail_tw_blocks-0.1.0.dist-info/METADATA,sha256=M7YPWanaZYIjRpzHeP3cl1LBTmc4RGfhFTjk-BCN6hQ,6670
17
+ wagtail_tw_blocks-0.1.0.dist-info/WHEEL,sha256=M5asmiAlL6HEcOq52Yi5mmk9KmTVjY2RDPtO4p9DMrc,88
18
+ wagtail_tw_blocks-0.1.0.dist-info/licenses/LICENSE,sha256=RkaGOqhDfc5U9-5mc3OHBMOo1VW7UOb8JQ614C0kqm4,1074
19
+ wagtail_tw_blocks-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: poetry-core 2.2.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Yousef Abu Shanab
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.