Skip to content

Commit

Permalink
Merge pull request #28 from ProjectPenrose/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
alexsc6955 authored Jan 24, 2024
2 parents e396f5d + 73c34b3 commit 7d0ab97
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 57 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.4.10] - 2024-01-24
### Removed
- `createElement` function and related files

## [0.4.9] - 2024-01-20
### Changed
- `createElement` function replaced by `document.createElement` in `Paradox.buildElement` function because it was causing issues with elements attributes
Expand Down
8 changes: 0 additions & 8 deletions build/core/buildElement/helpers/createElement.d.ts

This file was deleted.

17 changes: 0 additions & 17 deletions build/core/buildElement/helpers/createElement.js

This file was deleted.

5 changes: 2 additions & 3 deletions build/core/buildElement/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
};
Object.defineProperty(exports, "__esModule", { value: true });
const getText_1 = __importDefault(require("./helpers/getText"));
const createElement_1 = __importDefault(require("./helpers/createElement"));
const setAttributes_1 = __importDefault(require("./helpers/setAttributes"));
const handleEvents_1 = __importDefault(require("./helpers/handleEvents"));
const applyStyles_1 = __importDefault(require("./helpers/applyStyles"));
Expand All @@ -29,8 +28,8 @@ function buildElement(tag, options = { id: "", classList: "", children: [], attr
throw new Error("Tag is required");
// Destructure and provide default values for the options parameter
const { id = "", classList = "", children = [], attributes = {}, events = {}, text = "", style = {} } = options;
// Create a new HTML element
const element = (0, createElement_1.default)(tag);
// Create a new HTML element TODO: Review createElement function
const element = document.createElement(tag);
// Set the element ID if provided
if (id)
element.id = id.trim();
Expand Down
3 changes: 0 additions & 3 deletions build/core/buildElement/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,3 @@ export type ParadoxEventListenerWeakMap = WeakMap<HTMLElement, Map<string, Event
export type ParadoxElementMemoizedText = {
[key: string]: string;
};
export type ParadoxElementCache = {
[key: string]: HTMLElement;
};
6 changes: 3 additions & 3 deletions examples/paradox-app/package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "penrose-paradox",
"version": "0.4.9",
"version": "0.4.10",
"description": "Simple vanilla JavaScript library for beginners",
"keywords": [
"penrose",
Expand Down
18 changes: 0 additions & 18 deletions src/core/buildElement/helpers/createElement.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/core/buildElement/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import getText from "./helpers/getText";
import createElement from "./helpers/createElement";
import setAttributes from "./helpers/setAttributes";
import handleEvents from "./helpers/handleEvents";
import applyStyles from "./helpers/applyStyles";
Expand Down
4 changes: 1 addition & 3 deletions src/core/buildElement/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,4 @@ export type ParadoxElementOptions = {

export type ParadoxEventListenerWeakMap = WeakMap<HTMLElement, Map<string, EventListener>>;

export type ParadoxElementMemoizedText = { [key: string]: string };

export type ParadoxElementCache = { [key: string]: HTMLElement };
export type ParadoxElementMemoizedText = { [key: string]: string };

0 comments on commit 7d0ab97

Please sign in to comment.