@unhead/shared 1.3.3 → 1.3.5
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/dist/index.cjs +3 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +3 -2
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -488,7 +488,7 @@ async function normaliseTag(tagName, input, e) {
|
|
|
488
488
|
input.innerHTML = input.children;
|
|
489
489
|
delete input.children;
|
|
490
490
|
}
|
|
491
|
-
tag.props = await normaliseProps(
|
|
491
|
+
tag.props = await normaliseProps({ ...input });
|
|
492
492
|
Object.keys(tag.props).filter((k) => TagConfigKeys.includes(k)).forEach((k) => {
|
|
493
493
|
if (!["innerHTML", "textContent"].includes(k) || TagsWithInnerContent.includes(tag.tag)) {
|
|
494
494
|
tag[k] = tag.props[k];
|
|
@@ -523,7 +523,7 @@ function normaliseClassProp(v) {
|
|
|
523
523
|
}
|
|
524
524
|
return (Array.isArray(v) ? v.join(" ") : v).split(" ").filter((c) => c.trim()).filter(Boolean).join(" ");
|
|
525
525
|
}
|
|
526
|
-
async function normaliseProps(
|
|
526
|
+
async function normaliseProps(props) {
|
|
527
527
|
for (const k of Object.keys(props)) {
|
|
528
528
|
const isDataKey = k.startsWith("data-");
|
|
529
529
|
if (props[k] instanceof Promise) {
|
|
@@ -550,6 +550,7 @@ async function normaliseEntryTags(e) {
|
|
|
550
550
|
});
|
|
551
551
|
return (await Promise.all(tagPromises)).flat().filter(Boolean).map((t, i) => {
|
|
552
552
|
t._e = e._i;
|
|
553
|
+
e.mode && (t._m = e.mode);
|
|
553
554
|
t._p = (e._i << TagEntityBits) + i;
|
|
554
555
|
return t;
|
|
555
556
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ declare function whitelistSafeInput(input: Record<string, MaybeArray<Record<stri
|
|
|
40
40
|
|
|
41
41
|
declare function normaliseTag<T extends HeadTag>(tagName: T['tag'], input: HeadTag['props'] | string, e: HeadEntry<T>): Promise<T | T[] | false>;
|
|
42
42
|
declare function normaliseClassProp(v: Required<Required<Head>['htmlAttrs']['class']>): string;
|
|
43
|
-
declare function normaliseProps<T extends HeadTag>(
|
|
43
|
+
declare function normaliseProps<T extends HeadTag>(props: T['props']): Promise<T['props']>;
|
|
44
44
|
declare const TagEntityBits = 10;
|
|
45
45
|
declare function normaliseEntryTags<T extends {} = Head>(e: HeadEntry<T>): Promise<HeadTag[]>;
|
|
46
46
|
|
package/dist/index.mjs
CHANGED
|
@@ -486,7 +486,7 @@ async function normaliseTag(tagName, input, e) {
|
|
|
486
486
|
input.innerHTML = input.children;
|
|
487
487
|
delete input.children;
|
|
488
488
|
}
|
|
489
|
-
tag.props = await normaliseProps(
|
|
489
|
+
tag.props = await normaliseProps({ ...input });
|
|
490
490
|
Object.keys(tag.props).filter((k) => TagConfigKeys.includes(k)).forEach((k) => {
|
|
491
491
|
if (!["innerHTML", "textContent"].includes(k) || TagsWithInnerContent.includes(tag.tag)) {
|
|
492
492
|
tag[k] = tag.props[k];
|
|
@@ -521,7 +521,7 @@ function normaliseClassProp(v) {
|
|
|
521
521
|
}
|
|
522
522
|
return (Array.isArray(v) ? v.join(" ") : v).split(" ").filter((c) => c.trim()).filter(Boolean).join(" ");
|
|
523
523
|
}
|
|
524
|
-
async function normaliseProps(
|
|
524
|
+
async function normaliseProps(props) {
|
|
525
525
|
for (const k of Object.keys(props)) {
|
|
526
526
|
const isDataKey = k.startsWith("data-");
|
|
527
527
|
if (props[k] instanceof Promise) {
|
|
@@ -548,6 +548,7 @@ async function normaliseEntryTags(e) {
|
|
|
548
548
|
});
|
|
549
549
|
return (await Promise.all(tagPromises)).flat().filter(Boolean).map((t, i) => {
|
|
550
550
|
t._e = e._i;
|
|
551
|
+
e.mode && (t._m = e.mode);
|
|
551
552
|
t._p = (e._i << TagEntityBits) + i;
|
|
552
553
|
return t;
|
|
553
554
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unhead/shared",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.5",
|
|
5
5
|
"author": "Harlan Wilton <harlan@harlanzw.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"funding": "https://github.com/sponsors/harlan-zw",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"dist"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@unhead/schema": "1.3.
|
|
37
|
+
"@unhead/schema": "1.3.5"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"packrup": "^0.1.0"
|