@highstate/designer 0.4.2 → 0.4.4
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/.output/nitro.json +15 -0
- package/.output/public/_nuxt/B-YqONwZ.js +1 -0
- package/.output/public/_nuxt/COXQCz2I.js +1 -0
- package/.output/public/_nuxt/DNF_Kfc9.js +1 -0
- package/.output/public/_nuxt/DYyPqv2f.js +164 -0
- package/.output/public/_nuxt/builds/latest.json +1 -0
- package/.output/public/_nuxt/builds/meta/c81be379-d98f-426f-8eac-c45f3b97a743.json +1 -0
- package/.output/public/_nuxt/entry.BSAdMt6G.css +5 -0
- package/.output/public/_nuxt/error-404.BJkSn6RI.css +1 -0
- package/.output/public/_nuxt/error-500.TOCKLquH.css +1 -0
- package/.output/public/favicon.ico +0 -0
- package/.output/public/robots.txt +1 -0
- package/.output/server/index.mjs +12266 -0
- package/.output/server/index.mjs.map +1 -0
- package/.output/server/node_modules/@babel/parser/lib/index.js +14183 -0
- package/.output/server/node_modules/@babel/parser/package.json +50 -0
- package/.output/server/node_modules/@trpc/server/dist/http.mjs +7 -0
- package/.output/server/node_modules/@trpc/server/dist/index.mjs +11 -0
- package/.output/server/node_modules/@trpc/server/dist/observable/observable.mjs +175 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/createProxy.mjs +73 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/error/TRPCError.mjs +78 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/error/formatter.mjs +5 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/error/getErrorShape.mjs +29 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/http/contentType.mjs +224 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/http/contentTypeParsers.mjs +12 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/http/getHTTPStatusCode.mjs +76 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/http/isAbortError.mjs +7 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/http/parseConnectionParams.mjs +39 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/http/resolveResponse.mjs +569 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/initTRPC.mjs +80 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/middleware.mjs +90 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/parser.mjs +40 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs +194 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/rootConfig.mjs +6 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/router.mjs +176 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/rpc/codes.mjs +54 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/stream/jsonl.mjs +597 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/stream/sse.mjs +359 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/stream/tracked.mjs +25 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/stream/utils/asyncIterable.mjs +167 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/stream/utils/createDeferred.mjs +15 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/stream/utils/disposable.mjs +41 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/stream/utils/mergeAsyncIterables.mjs +239 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/stream/utils/readableStreamFrom.mjs +23 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/stream/utils/timerResource.mjs +23 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/stream/utils/withPing.mjs +127 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/transformer.mjs +101 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/utils.mjs +83 -0
- package/.output/server/node_modules/@trpc/server/dist/vendor/unpromise/unpromise.mjs +289 -0
- package/.output/server/node_modules/@trpc/server/package.json +156 -0
- package/.output/server/node_modules/@unhead/dom/dist/index.mjs +197 -0
- package/.output/server/node_modules/@unhead/dom/package.json +40 -0
- package/.output/server/node_modules/@unhead/shared/dist/index.mjs +641 -0
- package/.output/server/node_modules/@unhead/shared/package.json +45 -0
- package/.output/server/node_modules/@unhead/ssr/dist/index.mjs +95 -0
- package/.output/server/node_modules/@unhead/ssr/package.json +40 -0
- package/.output/server/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js +6690 -0
- package/.output/server/node_modules/@vue/compiler-core/package.json +58 -0
- package/.output/server/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +686 -0
- package/.output/server/node_modules/@vue/compiler-dom/package.json +57 -0
- package/.output/server/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +1404 -0
- package/.output/server/node_modules/@vue/compiler-ssr/package.json +34 -0
- package/.output/server/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js +1789 -0
- package/.output/server/node_modules/@vue/reactivity/package.json +55 -0
- package/.output/server/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js +6654 -0
- package/.output/server/node_modules/@vue/runtime-core/package.json +52 -0
- package/.output/server/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js +1669 -0
- package/.output/server/node_modules/@vue/runtime-dom/package.json +60 -0
- package/.output/server/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js +857 -0
- package/.output/server/node_modules/@vue/server-renderer/package.json +55 -0
- package/.output/server/node_modules/@vue/shared/dist/shared.cjs.prod.js +594 -0
- package/.output/server/node_modules/@vue/shared/package.json +47 -0
- package/.output/server/node_modules/devalue/index.js +3 -0
- package/.output/server/node_modules/devalue/package.json +34 -0
- package/.output/server/node_modules/devalue/src/base64.js +110 -0
- package/.output/server/node_modules/devalue/src/constants.js +6 -0
- package/.output/server/node_modules/devalue/src/parse.js +160 -0
- package/.output/server/node_modules/devalue/src/stringify.js +232 -0
- package/.output/server/node_modules/devalue/src/uneval.js +351 -0
- package/.output/server/node_modules/devalue/src/utils.js +113 -0
- package/.output/server/node_modules/entities/lib/decode.js +536 -0
- package/.output/server/node_modules/entities/lib/decode_codepoint.js +76 -0
- package/.output/server/node_modules/entities/lib/generated/decode-data-html.js +9 -0
- package/.output/server/node_modules/entities/lib/generated/decode-data-xml.js +9 -0
- package/.output/server/node_modules/entities/package.json +90 -0
- package/.output/server/node_modules/estree-walker/dist/umd/estree-walker.js +344 -0
- package/.output/server/node_modules/estree-walker/package.json +37 -0
- package/.output/server/node_modules/hookable/dist/index.mjs +290 -0
- package/.output/server/node_modules/hookable/package.json +49 -0
- package/.output/server/node_modules/packrup/dist/index.mjs +108 -0
- package/.output/server/node_modules/packrup/package.json +58 -0
- package/.output/server/node_modules/source-map-js/lib/array-set.js +121 -0
- package/.output/server/node_modules/source-map-js/lib/base64-vlq.js +140 -0
- package/.output/server/node_modules/source-map-js/lib/base64.js +67 -0
- package/.output/server/node_modules/source-map-js/lib/binary-search.js +111 -0
- package/.output/server/node_modules/source-map-js/lib/mapping-list.js +79 -0
- package/.output/server/node_modules/source-map-js/lib/quick-sort.js +132 -0
- package/.output/server/node_modules/source-map-js/lib/source-map-consumer.js +1188 -0
- package/.output/server/node_modules/source-map-js/lib/source-map-generator.js +444 -0
- package/.output/server/node_modules/source-map-js/lib/source-node.js +413 -0
- package/.output/server/node_modules/source-map-js/lib/util.js +594 -0
- package/.output/server/node_modules/source-map-js/package.json +71 -0
- package/.output/server/node_modules/source-map-js/source-map.js +8 -0
- package/.output/server/node_modules/ufo/dist/index.mjs +630 -0
- package/.output/server/node_modules/ufo/package.json +47 -0
- package/.output/server/node_modules/unhead/dist/index.mjs +748 -0
- package/.output/server/node_modules/unhead/package.json +46 -0
- package/.output/server/node_modules/vue/dist/vue.cjs.js +80 -0
- package/.output/server/node_modules/vue/dist/vue.cjs.prod.js +66 -0
- package/.output/server/node_modules/vue/index.js +7 -0
- package/.output/server/node_modules/vue/index.mjs +1 -0
- package/.output/server/node_modules/vue/package.json +112 -0
- package/.output/server/node_modules/vue/server-renderer/index.mjs +1 -0
- package/.output/server/node_modules/vue-bundle-renderer/dist/runtime.mjs +196 -0
- package/.output/server/node_modules/vue-bundle-renderer/package.json +50 -0
- package/.output/server/node_modules/zod/lib/index.mjs +4382 -0
- package/.output/server/node_modules/zod/package.json +122 -0
- package/.output/server/package.json +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { TagsWithInnerContent, SelfClosingTags } from '@unhead/shared';
|
|
2
|
+
|
|
3
|
+
function encodeAttribute(value) {
|
|
4
|
+
return String(value).replace(/"/g, """);
|
|
5
|
+
}
|
|
6
|
+
function propsToString(props) {
|
|
7
|
+
let attrs = "";
|
|
8
|
+
for (const key in props) {
|
|
9
|
+
if (!Object.prototype.hasOwnProperty.call(props, key)) {
|
|
10
|
+
continue;
|
|
11
|
+
}
|
|
12
|
+
const value = props[key];
|
|
13
|
+
if (value !== false && value !== null) {
|
|
14
|
+
attrs += value === true ? ` ${key}` : ` ${key}="${encodeAttribute(value)}"`;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return attrs;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function ssrRenderTags(tags, options) {
|
|
21
|
+
const schema = { htmlAttrs: {}, bodyAttrs: {}, tags: { head: "", bodyClose: "", bodyOpen: "" } };
|
|
22
|
+
const lineBreaks = !options?.omitLineBreaks ? "\n" : "";
|
|
23
|
+
for (const tag of tags) {
|
|
24
|
+
if (Object.keys(tag.props).length === 0 && !tag.innerHTML && !tag.textContent) {
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
if (tag.tag === "htmlAttrs" || tag.tag === "bodyAttrs") {
|
|
28
|
+
Object.assign(schema[tag.tag], tag.props);
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
const s = tagToString(tag);
|
|
32
|
+
const tagPosition = tag.tagPosition || "head";
|
|
33
|
+
schema.tags[tagPosition] += schema.tags[tagPosition] ? `${lineBreaks}${s}` : s;
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
headTags: schema.tags.head,
|
|
37
|
+
bodyTags: schema.tags.bodyClose,
|
|
38
|
+
bodyTagsOpen: schema.tags.bodyOpen,
|
|
39
|
+
htmlAttrs: propsToString(schema.htmlAttrs),
|
|
40
|
+
bodyAttrs: propsToString(schema.bodyAttrs)
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function escapeHtml(str) {
|
|
45
|
+
return str.replace(/[&<>"'/]/g, (char) => {
|
|
46
|
+
switch (char) {
|
|
47
|
+
case "&":
|
|
48
|
+
return "&";
|
|
49
|
+
case "<":
|
|
50
|
+
return "<";
|
|
51
|
+
case ">":
|
|
52
|
+
return ">";
|
|
53
|
+
case '"':
|
|
54
|
+
return """;
|
|
55
|
+
case "'":
|
|
56
|
+
return "'";
|
|
57
|
+
case "/":
|
|
58
|
+
return "/";
|
|
59
|
+
default:
|
|
60
|
+
return char;
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
function tagToString(tag) {
|
|
65
|
+
const attrs = propsToString(tag.props);
|
|
66
|
+
const openTag = `<${tag.tag}${attrs}>`;
|
|
67
|
+
if (!TagsWithInnerContent.has(tag.tag))
|
|
68
|
+
return SelfClosingTags.has(tag.tag) ? openTag : `${openTag}</${tag.tag}>`;
|
|
69
|
+
let content = String(tag.innerHTML || "");
|
|
70
|
+
if (tag.textContent)
|
|
71
|
+
content = escapeHtml(String(tag.textContent));
|
|
72
|
+
return SelfClosingTags.has(tag.tag) ? openTag : `${openTag}${content}</${tag.tag}>`;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
async function renderSSRHead(head, options) {
|
|
76
|
+
const beforeRenderCtx = { shouldRender: true };
|
|
77
|
+
await head.hooks.callHook("ssr:beforeRender", beforeRenderCtx);
|
|
78
|
+
if (!beforeRenderCtx.shouldRender) {
|
|
79
|
+
return {
|
|
80
|
+
headTags: "",
|
|
81
|
+
bodyTags: "",
|
|
82
|
+
bodyTagsOpen: "",
|
|
83
|
+
htmlAttrs: "",
|
|
84
|
+
bodyAttrs: ""
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
const ctx = { tags: await head.resolveTags() };
|
|
88
|
+
await head.hooks.callHook("ssr:render", ctx);
|
|
89
|
+
const html = ssrRenderTags(ctx.tags, options);
|
|
90
|
+
const renderCtx = { tags: ctx.tags, html };
|
|
91
|
+
await head.hooks.callHook("ssr:rendered", renderCtx);
|
|
92
|
+
return renderCtx.html;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export { escapeHtml, propsToString, renderSSRHead, ssrRenderTags, tagToString };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@unhead/ssr",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "1.11.18",
|
|
5
|
+
"author": "Harlan Wilton <harlan@harlanzw.com>",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"funding": "https://github.com/sponsors/harlan-zw",
|
|
8
|
+
"homepage": "https://unhead.unjs.io",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/unjs/unhead.git",
|
|
12
|
+
"directory": "packages/ssr"
|
|
13
|
+
},
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/unjs/unhead/issues"
|
|
16
|
+
},
|
|
17
|
+
"sideEffects": false,
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"import": "./dist/index.mjs",
|
|
22
|
+
"require": "./dist/index.cjs"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"main": "dist/index.cjs",
|
|
26
|
+
"module": "dist/index.mjs",
|
|
27
|
+
"types": "dist/index.d.ts",
|
|
28
|
+
"files": [
|
|
29
|
+
"dist"
|
|
30
|
+
],
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@unhead/schema": "1.11.18",
|
|
33
|
+
"@unhead/shared": "1.11.18"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "unbuild .",
|
|
37
|
+
"stub": "unbuild . --stub",
|
|
38
|
+
"export:sizes": "npx export-size . -r"
|
|
39
|
+
}
|
|
40
|
+
}
|