refactor gallary to simplify codebase

This commit is contained in:
Fabio Pliger
2024-02-01 12:13:52 -06:00
parent 6fd8c6a245
commit 316652a61d
13 changed files with 126 additions and 276 deletions

View File

@@ -2,6 +2,7 @@ import sys
import js as globalThis
from polyscript import js_modules
from pyscript.util import NotSupported
RUNNING_IN_WORKER = not hasattr(globalThis, "document")

View File

@@ -1,4 +1,5 @@
from pyodide.ffi import to_js
from pyscript import window

View File

@@ -1,8 +1,9 @@
from textwrap import dedent
from pyscript import document, when, window
from pyweb import JSProperty, js_property, pydom
from pyscript import document, when, window
# Global attributes that all elements have (this list is a subset of the official one)
# and tries to capture the most used ones
GLOBAL_ATTRIBUTES = [

View File

@@ -1,8 +1,9 @@
"""Markdown module to generate web/HTML components from Markdown code"""
from pyscript import document, window
from pyweb import pydom
from pyweb.ui.elements import TextElementBase, script
from pyscript import document, window
class markdown(TextElementBase):
"""Markdown component to render HTML from Markdown code"""

View File

@@ -1,10 +1,11 @@
import string
from textwrap import dedent
from pyscript import document, when, window
from pyweb import JSProperty, js_property, pydom
from pyweb.ui import elements as el
from pyscript import document, when, window
class ShoeBase(pydom.Element):
tag = "div"