posthtml-component 1.0.0-beta.1
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.
- package/.c8rc +3 -0
- package/.clintonrc.json +20 -0
- package/.editorconfig +19 -0
- package/.huskyrc +7 -0
- package/.idea/posthtml-components.iml +8 -0
- package/.lintstagedrc +4 -0
- package/.nycrc +4 -0
- package/ava.config.js +5 -0
- package/changelog.md +48 -0
- package/license +21 -0
- package/package.json +52 -0
- package/readme.md +809 -0
- package/src/attributes.js +55 -0
- package/src/find-path.js +119 -0
- package/src/index.js +185 -0
- package/src/locals.js +105 -0
- package/src/slots.js +112 -0
- package/src/stacks.js +64 -0
- package/test/templates/components/child.html +41 -0
- package/test/templates/components/component-append-prepend.html +1 -0
- package/test/templates/components/component-locals-json-and-string.html +18 -0
- package/test/templates/components/component-locals.html +7 -0
- package/test/templates/components/component-mapped-attributes.html +7 -0
- package/test/templates/components/component-multiple-slot.html +1 -0
- package/test/templates/components/component.html +1 -0
- package/test/templates/components/form/index.html +1 -0
- package/test/templates/components/modal.html +1 -0
- package/test/templates/components/module-with-extend.html +1 -0
- package/test/templates/components/module.html +1 -0
- package/test/templates/components/nested-one-slot.html +5 -0
- package/test/templates/components/nested-one.html +1 -0
- package/test/templates/components/nested-three.html +1 -0
- package/test/templates/components/nested-two-slot.html +5 -0
- package/test/templates/components/nested-two.html +1 -0
- package/test/templates/components/parent.html +42 -0
- package/test/templates/components/script-locals.html +9 -0
- package/test/templates/custom/dark/components/button.html +1 -0
- package/test/templates/custom/dark/components/label/index.html +1 -0
- package/test/templates/dark/components/button.html +1 -0
- package/test/templates/dark/components/label/index.html +1 -0
- package/test/templates/dark/layouts/base.html +1 -0
- package/test/templates/layouts/base-locals.html +6 -0
- package/test/templates/layouts/base-render-slots-locals.html +8 -0
- package/test/templates/layouts/base.html +8 -0
- package/test/templates/layouts/extend-with-module.html +7 -0
- package/test/templates/layouts/extend.html +7 -0
- package/test/templates/layouts/playground.html +1 -0
- package/test/templates/layouts/slot-condition.html +8 -0
- package/test/templates/light/components/button.html +1 -0
- package/test/templates/light/layouts/base.html +1 -0
- package/test/test-errors.js +39 -0
- package/test/test-locals.js +74 -0
- package/test/test-nested.js +24 -0
- package/test/test-plugins.js +33 -0
- package/test/test-slots.js +76 -0
- package/test/test-x-tag.js +69 -0
- package/xo.config.js +15 -0
package/.c8rc
ADDED
package/.clintonrc.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"ignores": [
|
|
3
|
+
"test/**",
|
|
4
|
+
"tmp/**",
|
|
5
|
+
"src/**",
|
|
6
|
+
"lib/**",
|
|
7
|
+
"examples/**",
|
|
8
|
+
".idea/**",
|
|
9
|
+
"*.{html,jpg}",
|
|
10
|
+
"cache.json"
|
|
11
|
+
],
|
|
12
|
+
"rules": {
|
|
13
|
+
"pkg-main": "off",
|
|
14
|
+
"cli": "off",
|
|
15
|
+
"xo": "off",
|
|
16
|
+
"ava": "off",
|
|
17
|
+
"use-travis": "off",
|
|
18
|
+
"pkg-schema": "off"
|
|
19
|
+
}
|
|
20
|
+
}
|
package/.editorconfig
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
root = true
|
|
2
|
+
|
|
3
|
+
[*]
|
|
4
|
+
indent_style = space
|
|
5
|
+
indent_size = 2
|
|
6
|
+
end_of_line = lf
|
|
7
|
+
charset = utf-8
|
|
8
|
+
quote_type = single
|
|
9
|
+
trim_trailing_whitespace = true
|
|
10
|
+
insert_final_newline = true
|
|
11
|
+
|
|
12
|
+
[{package.json,*.yml,*.jade,*.pss,*.css,*.js,*.md,.*,*.ts}]
|
|
13
|
+
indent_size = 2
|
|
14
|
+
|
|
15
|
+
[{changelog.md,.*}]
|
|
16
|
+
insert_final_newline = false
|
|
17
|
+
|
|
18
|
+
[*.md]
|
|
19
|
+
trim_trailing_whitespace = false
|
package/.huskyrc
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="WEB_MODULE" version="4">
|
|
3
|
+
<component name="NewModuleRootManager">
|
|
4
|
+
<content url="file://$MODULE_DIR$" />
|
|
5
|
+
<orderEntry type="inheritedJdk" />
|
|
6
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
7
|
+
</component>
|
|
8
|
+
</module>
|
package/.lintstagedrc
ADDED
package/.nycrc
ADDED
package/ava.config.js
ADDED
package/changelog.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
## 1.0.0-beta.1 (2022-10-20)
|
|
2
|
+
|
|
3
|
+
* Added examples ([60a86fd](https://github.com/thewebartisan7/posthtml-components/commit/60a86fd))
|
|
4
|
+
* Added support for works with the same extends and modules syntax together with x-tag for easy migrat ([d5f665e](https://github.com/thewebartisan7/posthtml-components/commit/d5f665e))
|
|
5
|
+
* Allow to check if slot is defined via slots locals ([05582e6](https://github.com/thewebartisan7/posthtml-components/commit/05582e6))
|
|
6
|
+
* Apply expressions to initial tree and set nextNode after expression process ([112ccde](https://github.com/thewebartisan7/posthtml-components/commit/112ccde))
|
|
7
|
+
* Aware locals ([c78d53b](https://github.com/thewebartisan7/posthtml-components/commit/c78d53b))
|
|
8
|
+
* Before new ([4dc77d7](https://github.com/thewebartisan7/posthtml-components/commit/4dc77d7))
|
|
9
|
+
* Build examples script ([8fedbcc](https://github.com/thewebartisan7/posthtml-components/commit/8fedbcc))
|
|
10
|
+
* Check shorthand block name ([d87b379](https://github.com/thewebartisan7/posthtml-components/commit/d87b379))
|
|
11
|
+
* Cleaner find-path.js and more readme about namespace ([e15411d](https://github.com/thewebartisan7/posthtml-components/commit/e15411d))
|
|
12
|
+
* Complete refactor WIP ([45f00f5](https://github.com/thewebartisan7/posthtml-components/commit/45f00f5))
|
|
13
|
+
* Computed attributes ([049f153](https://github.com/thewebartisan7/posthtml-components/commit/049f153))
|
|
14
|
+
* Default slots without slot ([3fe6368](https://github.com/thewebartisan7/posthtml-components/commit/3fe6368))
|
|
15
|
+
* Examples site and docs ([9b853e6](https://github.com/thewebartisan7/posthtml-components/commit/9b853e6))
|
|
16
|
+
* Fix and enhance parseLocals ([b89c90a](https://github.com/thewebartisan7/posthtml-components/commit/b89c90a))
|
|
17
|
+
* Fix hardcoded slot tag name ([6f83229](https://github.com/thewebartisan7/posthtml-components/commit/6f83229))
|
|
18
|
+
* Fix merge attributes ([da41fdb](https://github.com/thewebartisan7/posthtml-components/commit/da41fdb))
|
|
19
|
+
* Fix parse attributes ([8321415](https://github.com/thewebartisan7/posthtml-components/commit/8321415))
|
|
20
|
+
* Fix tests ([252aa45](https://github.com/thewebartisan7/posthtml-components/commit/252aa45))
|
|
21
|
+
* Fix typo readme ([03f2e2f](https://github.com/thewebartisan7/posthtml-components/commit/03f2e2f))
|
|
22
|
+
* Initial commit ([ec6eae5](https://github.com/thewebartisan7/posthtml-components/commit/ec6eae5))
|
|
23
|
+
* More readme ([b5d9f86](https://github.com/thewebartisan7/posthtml-components/commit/b5d9f86))
|
|
24
|
+
* More readme ([2201df2](https://github.com/thewebartisan7/posthtml-components/commit/2201df2))
|
|
25
|
+
* More tests ([5ebaee4](https://github.com/thewebartisan7/posthtml-components/commit/5ebaee4))
|
|
26
|
+
* More tests ([2163943](https://github.com/thewebartisan7/posthtml-components/commit/2163943))
|
|
27
|
+
* Nested component tested ([8a1d117](https://github.com/thewebartisan7/posthtml-components/commit/8a1d117))
|
|
28
|
+
* Nested testing ([44a6154](https://github.com/thewebartisan7/posthtml-components/commit/44a6154))
|
|
29
|
+
* Push once and prepend ([1cfe598](https://github.com/thewebartisan7/posthtml-components/commit/1cfe598))
|
|
30
|
+
* Readme ([96ff607](https://github.com/thewebartisan7/posthtml-components/commit/96ff607))
|
|
31
|
+
* Readme ([4c8e4b8](https://github.com/thewebartisan7/posthtml-components/commit/4c8e4b8))
|
|
32
|
+
* Readme ([5e7b754](https://github.com/thewebartisan7/posthtml-components/commit/5e7b754))
|
|
33
|
+
* Readme update ([c02a781](https://github.com/thewebartisan7/posthtml-components/commit/c02a781))
|
|
34
|
+
* Readme update ([66a6213](https://github.com/thewebartisan7/posthtml-components/commit/66a6213))
|
|
35
|
+
* Readme update ([6ccf1ab](https://github.com/thewebartisan7/posthtml-components/commit/6ccf1ab))
|
|
36
|
+
* Readme updated ([3c5ac7e](https://github.com/thewebartisan7/posthtml-components/commit/3c5ac7e))
|
|
37
|
+
* Remove comments ([9f4216f](https://github.com/thewebartisan7/posthtml-components/commit/9f4216f))
|
|
38
|
+
* Shorthands slot names and other enhancements ([a091cc2](https://github.com/thewebartisan7/posthtml-components/commit/a091cc2))
|
|
39
|
+
* Slot is fill and fill is slot ([fc4283c](https://github.com/thewebartisan7/posthtml-components/commit/fc4283c))
|
|
40
|
+
* Slot locals ([6d4b3dc](https://github.com/thewebartisan7/posthtml-components/commit/6d4b3dc))
|
|
41
|
+
* Split in multiple files ([9f660c7](https://github.com/thewebartisan7/posthtml-components/commit/9f660c7))
|
|
42
|
+
* Unique default slot name from filename ([25259ef](https://github.com/thewebartisan7/posthtml-components/commit/25259ef))
|
|
43
|
+
* update ([827fe7f](https://github.com/thewebartisan7/posthtml-components/commit/827fe7f))
|
|
44
|
+
* Update readme ([19ef893](https://github.com/thewebartisan7/posthtml-components/commit/19ef893))
|
|
45
|
+
* Update readme ([42fa034](https://github.com/thewebartisan7/posthtml-components/commit/42fa034))
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
package/license
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2016 PostHTML
|
|
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.
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "posthtml-component",
|
|
3
|
+
"version": "1.0.0-beta.1",
|
|
4
|
+
"description": "PostHTML Components Blade-like with slots, attributes as props and custom tag",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": "thewebartisan7/posthtml-components",
|
|
7
|
+
"author": "Damir Grgic <damir@tuta.io> (https://github.com/thewebartisan7)",
|
|
8
|
+
"main": "src",
|
|
9
|
+
"engines": {
|
|
10
|
+
"node": ">=12"
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"version": "conventional-changelog -i changelog.md -s -r 0 && git add changelog.md",
|
|
14
|
+
"test": "c8 ava",
|
|
15
|
+
"pretest": "clinton && xo",
|
|
16
|
+
"build-examples": "node ./examples"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"posthtml",
|
|
20
|
+
"posthtml-component",
|
|
21
|
+
"posthtml-components",
|
|
22
|
+
"components",
|
|
23
|
+
"html"
|
|
24
|
+
],
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"deepmerge": "^4.2.2",
|
|
27
|
+
"posthtml-attrs-parser": "^0.1.1",
|
|
28
|
+
"posthtml-expressions": "^1.9.0",
|
|
29
|
+
"posthtml-match-helper": "^1.0.3",
|
|
30
|
+
"posthtml-parser": "^0.11.0",
|
|
31
|
+
"posthtml-render": "^3.0.0",
|
|
32
|
+
"style-to-object": "^0.3.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@commitlint/cli": "^12.0.1",
|
|
36
|
+
"@commitlint/config-angular": "^12.0.1",
|
|
37
|
+
"ava": "^3.15.0",
|
|
38
|
+
"c8": "^7.6.0",
|
|
39
|
+
"clinton": "^0.14.0",
|
|
40
|
+
"conventional-changelog-cli": "^2.1.1",
|
|
41
|
+
"highlight.js": "^11.6.0",
|
|
42
|
+
"husky": "^5.1.3",
|
|
43
|
+
"lint-staged": "^10.5.4",
|
|
44
|
+
"markdown-it-anchor": "^8.6.5",
|
|
45
|
+
"markdown-it-include": "^2.0.0",
|
|
46
|
+
"markdown-it-toc-done-right": "^4.2.0",
|
|
47
|
+
"posthtml": "^0.16.6",
|
|
48
|
+
"posthtml-beautify": "^0.7.0",
|
|
49
|
+
"posthtml-markdownit": "^1.3.0",
|
|
50
|
+
"xo": "^0.37.1"
|
|
51
|
+
}
|
|
52
|
+
}
|