Precise DOM morphing
morphing typescript dom
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Rename project to Morphlex

+38 -92
+4 -4
README.md
··· 1 - # MorphLite 1 + # Morphlex 2 2 3 - Morphlite is an attempt to create a DOM morphing function in less than 100 lines of code with no runtime dependencies, to use with [HTMZ](https://leanrada.com/htmz/) in small projects. It is still very much a work-in-progress. 3 + Morphlex is an attempt to create a DOM morphing function in less than 100 lines of code with no runtime dependencies, to use with [HTMZ](https://leanrada.com/htmz/) in small projects. It is still very much a work-in-progress. 4 4 5 5 ## Why are we doing this? 6 6 ··· 16 16 17 17 ## Current status 18 18 19 - We have a basic sketch of the morphing function in `src/morphlite.ts` that can handle simple cases. Now, we’re copying tests from [Morphdom](https://github.com/patrick-steele-idem/morphdom), [Idiomorph](https://github.com/bigskysoftware/idiomorph), [Alpine Morph](https://github.com/alpinejs/alpine/tree/main/packages/morph), and [nanomorph](https://github.com/choojs/nanomorph). 19 + We have a basic sketch of the morphing function in `src/morphlex.ts` that can handle simple cases. Now, we’re copying tests from [Morphdom](https://github.com/patrick-steele-idem/morphdom), [Idiomorph](https://github.com/bigskysoftware/idiomorph), [Alpine Morph](https://github.com/alpinejs/alpine/tree/main/packages/morph), and [nanomorph](https://github.com/choojs/nanomorph). 20 20 21 21 ## Run tests 22 22 ··· 27 27 ## Usage 28 28 29 29 ```javascript 30 - import { morph } from "morphlite"; 30 + import { morph } from "morphlex"; 31 31 32 32 morph(currentNode, guideNode); 33 33 ```
dist/morphlite.d.ts dist/morphlex.d.ts
+1 -1
dist/morphlite.js dist/morphlex.js
··· 108 108 function isTextArea(element) { 109 109 return element.localName === "textarea"; 110 110 } 111 - //# sourceMappingURL=morphlite.js.map 111 + //# sourceMappingURL=morphlex.js.map
+29 -83
package-lock.json
··· 1 1 { 2 - "name": "morphlite", 2 + "name": "morphlex", 3 3 "version": "0.0.1", 4 4 "lockfileVersion": 3, 5 5 "requires": true, 6 6 "packages": { 7 7 "": { 8 - "name": "morphlite", 8 + "name": "morphlex", 9 9 "version": "0.0.1", 10 10 "license": "MIT", 11 11 "devDependencies": { ··· 427 427 "version": "4.12.0", 428 428 "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.12.0.tgz", 429 429 "integrity": "sha512-+ac02NL/2TCKRrJu2wffk1kZ+RyqxVUlbjSagNgPm94frxtr+XDL12E5Ll1enWskLrtrZ2r8L3wED1orIibV/w==", 430 - "cpu": [ 431 - "arm" 432 - ], 430 + "cpu": ["arm"], 433 431 "dev": true, 434 432 "optional": true, 435 - "os": [ 436 - "android" 437 - ] 433 + "os": ["android"] 438 434 }, 439 435 "node_modules/@rollup/rollup-android-arm64": { 440 436 "version": "4.12.0", 441 437 "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.12.0.tgz", 442 438 "integrity": "sha512-OBqcX2BMe6nvjQ0Nyp7cC90cnumt8PXmO7Dp3gfAju/6YwG0Tj74z1vKrfRz7qAv23nBcYM8BCbhrsWqO7PzQQ==", 443 - "cpu": [ 444 - "arm64" 445 - ], 439 + "cpu": ["arm64"], 446 440 "dev": true, 447 441 "optional": true, 448 - "os": [ 449 - "android" 450 - ] 442 + "os": ["android"] 451 443 }, 452 444 "node_modules/@rollup/rollup-darwin-arm64": { 453 445 "version": "4.12.0", 454 446 "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.12.0.tgz", 455 447 "integrity": "sha512-X64tZd8dRE/QTrBIEs63kaOBG0b5GVEd3ccoLtyf6IdXtHdh8h+I56C2yC3PtC9Ucnv0CpNFJLqKFVgCYe0lOQ==", 456 - "cpu": [ 457 - "arm64" 458 - ], 448 + "cpu": ["arm64"], 459 449 "dev": true, 460 450 "optional": true, 461 - "os": [ 462 - "darwin" 463 - ] 451 + "os": ["darwin"] 464 452 }, 465 453 "node_modules/@rollup/rollup-darwin-x64": { 466 454 "version": "4.12.0", 467 455 "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.12.0.tgz", 468 456 "integrity": "sha512-cc71KUZoVbUJmGP2cOuiZ9HSOP14AzBAThn3OU+9LcA1+IUqswJyR1cAJj3Mg55HbjZP6OLAIscbQsQLrpgTOg==", 469 - "cpu": [ 470 - "x64" 471 - ], 457 + "cpu": ["x64"], 472 458 "dev": true, 473 459 "optional": true, 474 - "os": [ 475 - "darwin" 476 - ] 460 + "os": ["darwin"] 477 461 }, 478 462 "node_modules/@rollup/rollup-linux-arm-gnueabihf": { 479 463 "version": "4.12.0", 480 464 "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.12.0.tgz", 481 465 "integrity": "sha512-a6w/Y3hyyO6GlpKL2xJ4IOh/7d+APaqLYdMf86xnczU3nurFTaVN9s9jOXQg97BE4nYm/7Ga51rjec5nfRdrvA==", 482 - "cpu": [ 483 - "arm" 484 - ], 466 + "cpu": ["arm"], 485 467 "dev": true, 486 468 "optional": true, 487 - "os": [ 488 - "linux" 489 - ] 469 + "os": ["linux"] 490 470 }, 491 471 "node_modules/@rollup/rollup-linux-arm64-gnu": { 492 472 "version": "4.12.0", 493 473 "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.12.0.tgz", 494 474 "integrity": "sha512-0fZBq27b+D7Ar5CQMofVN8sggOVhEtzFUwOwPppQt0k+VR+7UHMZZY4y+64WJ06XOhBTKXtQB/Sv0NwQMXyNAA==", 495 - "cpu": [ 496 - "arm64" 497 - ], 475 + "cpu": ["arm64"], 498 476 "dev": true, 499 477 "optional": true, 500 - "os": [ 501 - "linux" 502 - ] 478 + "os": ["linux"] 503 479 }, 504 480 "node_modules/@rollup/rollup-linux-arm64-musl": { 505 481 "version": "4.12.0", 506 482 "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.12.0.tgz", 507 483 "integrity": "sha512-eTvzUS3hhhlgeAv6bfigekzWZjaEX9xP9HhxB0Dvrdbkk5w/b+1Sxct2ZuDxNJKzsRStSq1EaEkVSEe7A7ipgQ==", 508 - "cpu": [ 509 - "arm64" 510 - ], 484 + "cpu": ["arm64"], 511 485 "dev": true, 512 486 "optional": true, 513 - "os": [ 514 - "linux" 515 - ] 487 + "os": ["linux"] 516 488 }, 517 489 "node_modules/@rollup/rollup-linux-riscv64-gnu": { 518 490 "version": "4.12.0", 519 491 "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.12.0.tgz", 520 492 "integrity": "sha512-ix+qAB9qmrCRiaO71VFfY8rkiAZJL8zQRXveS27HS+pKdjwUfEhqo2+YF2oI+H/22Xsiski+qqwIBxVewLK7sw==", 521 - "cpu": [ 522 - "riscv64" 523 - ], 493 + "cpu": ["riscv64"], 524 494 "dev": true, 525 495 "optional": true, 526 - "os": [ 527 - "linux" 528 - ] 496 + "os": ["linux"] 529 497 }, 530 498 "node_modules/@rollup/rollup-linux-x64-gnu": { 531 499 "version": "4.12.0", 532 500 "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.12.0.tgz", 533 501 "integrity": "sha512-TenQhZVOtw/3qKOPa7d+QgkeM6xY0LtwzR8OplmyL5LrgTWIXpTQg2Q2ycBf8jm+SFW2Wt/DTn1gf7nFp3ssVA==", 534 - "cpu": [ 535 - "x64" 536 - ], 502 + "cpu": ["x64"], 537 503 "dev": true, 538 504 "optional": true, 539 - "os": [ 540 - "linux" 541 - ] 505 + "os": ["linux"] 542 506 }, 543 507 "node_modules/@rollup/rollup-linux-x64-musl": { 544 508 "version": "4.12.0", 545 509 "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.12.0.tgz", 546 510 "integrity": "sha512-LfFdRhNnW0zdMvdCb5FNuWlls2WbbSridJvxOvYWgSBOYZtgBfW9UGNJG//rwMqTX1xQE9BAodvMH9tAusKDUw==", 547 - "cpu": [ 548 - "x64" 549 - ], 511 + "cpu": ["x64"], 550 512 "dev": true, 551 513 "optional": true, 552 - "os": [ 553 - "linux" 554 - ] 514 + "os": ["linux"] 555 515 }, 556 516 "node_modules/@rollup/rollup-win32-arm64-msvc": { 557 517 "version": "4.12.0", 558 518 "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.12.0.tgz", 559 519 "integrity": "sha512-JPDxovheWNp6d7AHCgsUlkuCKvtu3RB55iNEkaQcf0ttsDU/JZF+iQnYcQJSk/7PtT4mjjVG8N1kpwnI9SLYaw==", 560 - "cpu": [ 561 - "arm64" 562 - ], 520 + "cpu": ["arm64"], 563 521 "dev": true, 564 522 "optional": true, 565 - "os": [ 566 - "win32" 567 - ] 523 + "os": ["win32"] 568 524 }, 569 525 "node_modules/@rollup/rollup-win32-ia32-msvc": { 570 526 "version": "4.12.0", 571 527 "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.12.0.tgz", 572 528 "integrity": "sha512-fjtuvMWRGJn1oZacG8IPnzIV6GF2/XG+h71FKn76OYFqySXInJtseAqdprVTDTyqPxQOG9Exak5/E9Z3+EJ8ZA==", 573 - "cpu": [ 574 - "ia32" 575 - ], 529 + "cpu": ["ia32"], 576 530 "dev": true, 577 531 "optional": true, 578 - "os": [ 579 - "win32" 580 - ] 532 + "os": ["win32"] 581 533 }, 582 534 "node_modules/@rollup/rollup-win32-x64-msvc": { 583 535 "version": "4.12.0", 584 536 "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.12.0.tgz", 585 537 "integrity": "sha512-ZYmr5mS2wd4Dew/JjT0Fqi2NPB/ZhZ2VvPp7SmvPZb4Y1CG/LRcS6tcRo2cYU7zLK5A7cdbhWnnWmUjoI4qapg==", 586 - "cpu": [ 587 - "x64" 588 - ], 538 + "cpu": ["x64"], 589 539 "dev": true, 590 540 "optional": true, 591 - "os": [ 592 - "win32" 593 - ] 541 + "os": ["win32"] 594 542 }, 595 543 "node_modules/@tootallnate/quickjs-emscripten": { 596 544 "version": "0.23.0", ··· 2269 2217 "dev": true, 2270 2218 "hasInstallScript": true, 2271 2219 "optional": true, 2272 - "os": [ 2273 - "darwin" 2274 - ], 2220 + "os": ["darwin"], 2275 2221 "engines": { 2276 2222 "node": "^8.16.0 || ^10.6.0 || >=11.0.0" 2277 2223 }
+4 -4
package.json
··· 1 1 { 2 - "name": "morphlite", 2 + "name": "morphlex", 3 3 "version": "0.0.1", 4 - "description": "Morphlite is an attempt to create a DOM morphing function in less than 100 lines of code to use with [HTMZ](https://leanrada.com/htmz/) in small projects.", 5 - "main": "dist/morphlite.js", 6 - "types": "dist/morphlite.d.ts", 4 + "description": "Morphlex is an attempt to create a DOM morphing function in less than 100 lines of code.", 5 + "main": "dist/morphlex.js", 6 + "types": "dist/morphlex.d.ts", 7 7 "scripts": { 8 8 "test": "web-test-runner test/**/*.test.js --node-resolve", 9 9 "build": "tsc",
src/morphlite.ts src/morphlex.ts
test/morphlite.test.js test/morphlex.test.js