posthtml-component 2.2.0 → 2.2.2
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/package.json +2 -2
- package/src/index.js +5 -5
- package/src/valid-attributes.js +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "posthtml-component",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.2",
|
|
4
4
|
"description": "Laravel Blade-inspired components for PostHTML with slots, attributes as props, custom tags and more.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "posthtml/posthtml-components",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"style-to-object": "^1.0.6"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@biomejs/biome": "2.
|
|
42
|
+
"@biomejs/biome": "2.3.2",
|
|
43
43
|
"@vitest/coverage-v8": "^3.0.4",
|
|
44
44
|
"conventional-changelog-cli": "^5.0.0",
|
|
45
45
|
"highlight.js": "^11.6.0",
|
package/src/index.js
CHANGED
|
@@ -166,8 +166,6 @@ let processCounter = 0;
|
|
|
166
166
|
* @return {Object} PostHTML tree
|
|
167
167
|
*/
|
|
168
168
|
function processTree(options) {
|
|
169
|
-
const filledSlots = {};
|
|
170
|
-
|
|
171
169
|
return (tree, messages) => {
|
|
172
170
|
log(`Processing tree number ${processCounter}..`, 'processTree');
|
|
173
171
|
|
|
@@ -176,6 +174,8 @@ function processTree(options) {
|
|
|
176
174
|
}
|
|
177
175
|
|
|
178
176
|
match.call(tree, options.matcher, currentNode => {
|
|
177
|
+
const filledSlots = {};
|
|
178
|
+
|
|
179
179
|
log(`Match found for tag "${currentNode.tag}"..`, 'processTree');
|
|
180
180
|
|
|
181
181
|
if (!currentNode.attrs) {
|
|
@@ -229,14 +229,14 @@ function processTree(options) {
|
|
|
229
229
|
return currentNode.content || nextNode.content;
|
|
230
230
|
});
|
|
231
231
|
|
|
232
|
+
// Process <slot> tags
|
|
233
|
+
processSlotContent(nextNode, filledSlots, options);
|
|
234
|
+
|
|
232
235
|
nextNode = processTree(options)(nextNode, messages);
|
|
233
236
|
|
|
234
237
|
// Process <fill> tags
|
|
235
238
|
processFillContent(nextNode, filledSlots, options);
|
|
236
239
|
|
|
237
|
-
// Process <slot> tags
|
|
238
|
-
processSlotContent(nextNode, filledSlots, options);
|
|
239
|
-
|
|
240
240
|
// Remove component tag and replace content with <yield>
|
|
241
241
|
currentNode.tag = false;
|
|
242
242
|
currentNode.content = content;
|
package/src/valid-attributes.js
CHANGED
|
@@ -890,6 +890,7 @@ module.exports = {
|
|
|
890
890
|
],
|
|
891
891
|
'DIV': [
|
|
892
892
|
'accesskey',
|
|
893
|
+
'align',
|
|
893
894
|
'autocapitalize',
|
|
894
895
|
'autofocus',
|
|
895
896
|
'class',
|
|
@@ -3015,6 +3016,7 @@ module.exports = {
|
|
|
3015
3016
|
],
|
|
3016
3017
|
'TABLE': [
|
|
3017
3018
|
'accesskey',
|
|
3019
|
+
'align',
|
|
3018
3020
|
'autocapitalize',
|
|
3019
3021
|
'autofocus',
|
|
3020
3022
|
'class',
|
|
@@ -3073,6 +3075,7 @@ module.exports = {
|
|
|
3073
3075
|
],
|
|
3074
3076
|
'TD': [
|
|
3075
3077
|
'accesskey',
|
|
3078
|
+
'align',
|
|
3076
3079
|
'autocapitalize',
|
|
3077
3080
|
'autofocus',
|
|
3078
3081
|
'class',
|
|
@@ -3206,6 +3209,7 @@ module.exports = {
|
|
|
3206
3209
|
'TH': [
|
|
3207
3210
|
'abbr',
|
|
3208
3211
|
'accesskey',
|
|
3212
|
+
'align',
|
|
3209
3213
|
'autocapitalize',
|
|
3210
3214
|
'autofocus',
|
|
3211
3215
|
'class',
|