Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closes: #39 Add a way to specify the position of child components. #70

Merged
merged 25 commits into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d0e913a
feat(component.py,-dom_method,py,-parser.py,-parent.fyre,-store.fyre)…
SuelenKarbivnychyy Jul 27, 2023
af0e363
fix(dom_methods.py): handle a edge case when specifying position of c…
SuelenKarbivnychyy Jul 28, 2023
0c2f1bb
delete extra test
SuelenKarbivnychyy Aug 1, 2023
956d54c
feat(dom_methods.py,-store.fyre): deleted <pyml> from store.fyre and …
SuelenKarbivnychyy Aug 1, 2023
7937443
refactor(test_quote-folder): its just a test folder for better explan…
SuelenKarbivnychyy Aug 4, 2023
c7ab9d5
refactor(dom_methods.py-parser.py-component.py): update the code stru…
SuelenKarbivnychyy Aug 7, 2023
b8d1008
fix: parsing algo
sansyrox Aug 12, 2023
4d2ac7b
fix(parser.py): added support for new self.current_children list
SuelenKarbivnychyy Aug 15, 2023
bcbc8bc
fix(parser.py): fix the node order rendering
SuelenKarbivnychyy Aug 21, 2023
02006e1
fix(parser.py): Fixed node order rendering
SuelenKarbivnychyy Aug 21, 2023
73ba5d6
fix(Developed-a-way-of-adding-original-name-when-the-component-is-cre…
SuelenKarbivnychyy Aug 22, 2023
2dd127a
style(parser.py): reformat specific part of code
SuelenKarbivnychyy Aug 23, 2023
7d79a9b
refactor(component.py): refactor code
SuelenKarbivnychyy Aug 28, 2023
8616919
refactor: Merged files, fixed conflicts
SuelenKarbivnychyy Aug 28, 2023
ecf7897
deleted empty spaces
SuelenKarbivnychyy Aug 29, 2023
6efec43
fix(__init__.fyre): fixed a bug
SuelenKarbivnychyy Aug 29, 2023
6ad7037
test: add a testing application
sansyrox Aug 29, 2023
5c8212e
Merge branch 'sk-39' of https://github.com/SuelenKarbivnychyy/starfyr…
SuelenKarbivnychyy Aug 30, 2023
bdd93d7
fix(parser.py): Fixed order of slot compoments
SuelenKarbivnychyy Aug 31, 2023
76a9921
minor improvements
sansyrox Sep 1, 2023
e3c29ce
update the algo
sansyrox Sep 2, 2023
8e244a0
add parser explanation
sansyrox Sep 2, 2023
7b6da80
docs(parser.py): added comments
SuelenKarbivnychyy Sep 5, 2023
3e9fb64
refactor(parser.py): added a TODO
SuelenKarbivnychyy Sep 5, 2023
8e8000d
Update starfyre/parser.py
sansyrox Sep 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 89 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion starfyre/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def create_component(pyml="", css="", js="", client_side_python="", component_na
pyml_root = parser.get_root()

if pyml_root is None:
return Component("div", {}, [], {}, {}, uuid="store", js=js)
return Component("div", {}, [], {}, {}, uuid="store", js=js, original_name="div")

return pyml_root

Expand Down
3 changes: 3 additions & 0 deletions starfyre/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ def main(path, build):
stderr=None,
)

print(result.stdout.decode("utf-8"))



if __name__ == "__main__":
main()
6 changes: 6 additions & 0 deletions starfyre/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,20 @@ class Component:
html: str = ""
css: str = ""
js: str = ""
original_name: str = ""
# on any property change, rebuild the tree


def render(self):
pass

@property
def is_text_component(self):
return self.tag == "TEXT_NODE"

@property
def is_slot_component(self):
return self.tag == "slot"

def __repr__(self):
return f"<{self.tag}> {self.data} {self.children} </{self.tag}>"
6 changes: 5 additions & 1 deletion starfyre/dom_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def is_attribute(name):
css = ""
js = "\n"
if parentElement is None:
parentElement = Component("div", {"id": "root"}, [], {}, {}, uuid=uuid4())
parentElement = Component("div", {"id": "root"}, [], {}, {}, uuid=uuid4(), original_name="div")
component.parentComponent = parentElement

tag = component.tag
Expand Down Expand Up @@ -91,9 +91,12 @@ def is_attribute(name):
if not component.is_text_component:
html += f"{prop_string} >"



# Render children
children = component.children
# childElements.forEach(childElement => render(childElement, dom));

for childElement in children:
childElement.parentElement = component
new_html, new_css, new_js = render_helper(childElement)
Expand All @@ -104,6 +107,7 @@ def is_attribute(name):
html += f"</{tag}>\n"

component.html = html

return html, css, js


Expand Down
Loading