complete
This commit is contained in:
@@ -1,20 +1,11 @@
|
||||
import { createRenderer, getRequestDependencies, getPreloadLinks, getPrefetchLinks } from 'vue-bundle-renderer/runtime';
|
||||
import { l as buildAssetsURL, u as useRuntimeConfig, m as getResponseStatusText, n as getResponseStatus, o as defineRenderHandler, q as publicAssetsURL, r as getQuery, t as createError, v as destr, x as getRouteRules, j as joinURL, y as useNitroApp } from '../nitro/nitro.mjs';
|
||||
import { b as buildAssetsURL, u as useRuntimeConfig, g as getResponseStatusText, a as getResponseStatus, d as decodePath, c as defineRenderHandler, p as publicAssetsURL, e as getQuery, f as createError, h as destr, i as getRouteRules, j as joinURL, k as useNitroApp } from '../nitro/nitro.mjs';
|
||||
import { renderToString } from 'vue/server-renderer';
|
||||
import { createHead as createHead$1, propsToString, renderSSRHead } from 'unhead/server';
|
||||
import { stringify, uneval } from 'devalue';
|
||||
import { isRef, toValue } from 'vue';
|
||||
import 'node:http';
|
||||
import 'node:https';
|
||||
import 'node:events';
|
||||
import 'node:buffer';
|
||||
import 'node:fs';
|
||||
import 'node:path';
|
||||
import 'node:crypto';
|
||||
import 'node:url';
|
||||
import 'consola';
|
||||
import 'fast-xml-parser';
|
||||
import 'ipx';
|
||||
import { FlatMetaPlugin } from 'unhead/plugins';
|
||||
import { walkResolver } from 'unhead/utils';
|
||||
import { isRef, toValue, hasInjectionContext, inject, ref, watchEffect, getCurrentInstance, onBeforeUnmount, onDeactivated, onActivated } from 'vue';
|
||||
|
||||
const VueResolver = (_, value) => {
|
||||
return isRef(value) ? toValue(value) : value;
|
||||
@@ -33,6 +24,57 @@ function vueInstall(head) {
|
||||
return plugin.install;
|
||||
}
|
||||
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function injectHead() {
|
||||
if (hasInjectionContext()) {
|
||||
const instance = inject(headSymbol);
|
||||
if (!instance) {
|
||||
throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");
|
||||
}
|
||||
function useHead(input, options = {}) {
|
||||
const head = options.head || /* @__PURE__ */ injectHead();
|
||||
return head.ssr ? head.push(input || {}, options) : clientUseHead(head, input, options);
|
||||
}
|
||||
function clientUseHead(head, input, options = {}) {
|
||||
const deactivated = ref(false);
|
||||
let entry;
|
||||
watchEffect(() => {
|
||||
const i = deactivated.value ? {} : walkResolver(input, VueResolver);
|
||||
if (entry) {
|
||||
entry.patch(i);
|
||||
} else {
|
||||
entry = head.push(i, options);
|
||||
}
|
||||
});
|
||||
const vm = getCurrentInstance();
|
||||
if (vm) {
|
||||
onBeforeUnmount(() => {
|
||||
entry.dispose();
|
||||
});
|
||||
onDeactivated(() => {
|
||||
deactivated.value = true;
|
||||
});
|
||||
onActivated(() => {
|
||||
deactivated.value = false;
|
||||
});
|
||||
}
|
||||
return entry;
|
||||
}
|
||||
function useSeoMeta(input = {}, options = {}) {
|
||||
const head = options.head || /* @__PURE__ */ injectHead();
|
||||
head.use(FlatMetaPlugin);
|
||||
const { title, titleTemplate, ...meta } = input;
|
||||
return useHead({
|
||||
title,
|
||||
titleTemplate,
|
||||
_flatMeta: meta
|
||||
}, options);
|
||||
}
|
||||
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function createHead(options = {}) {
|
||||
const head = createHead$1({
|
||||
@@ -45,7 +87,7 @@ function createHead(options = {}) {
|
||||
|
||||
const NUXT_RUNTIME_PAYLOAD_EXTRACTION = false;
|
||||
|
||||
const appHead = {"meta":[{"name":"viewport","content":"width=device-width, initial-scale=1"},{"charset":"utf-8"},{"name":"screen-orientation","content":"portrait"}],"link":[{"rel":"manifest","href":"/manifest.webmanifest"}],"style":[],"script":[],"noscript":[],"title":"Loading..."};
|
||||
const appHead = {"meta":[{"name":"viewport","content":"width=device-width, initial-scale=1"},{"charset":"utf-8"}],"link":[{"rel":"icon","type":"image/png","href":"/favicon.ico"}],"style":[],"script":[],"noscript":[],"title":"اپ کو (Appco) | آژانس دیجیتال مارکتینگ و بازاریابی آنلاین"};
|
||||
|
||||
const appRootTag = "div";
|
||||
|
||||
@@ -64,7 +106,7 @@ const appId = "nuxt-app";
|
||||
const APP_ROOT_OPEN_TAG = `<${appRootTag}${propsToString(appRootAttrs)}>`;
|
||||
const APP_ROOT_CLOSE_TAG = `</${appRootTag}>`;
|
||||
// @ts-expect-error file will be produced after app build
|
||||
const getServerEntry = () => import('../build/server.mjs').then(function (n) { return n.bJ; }).then((r) => r.default || r);
|
||||
const getServerEntry = () => import('../build/server.mjs').then((r) => r.default || r);
|
||||
// @ts-expect-error file will be produced after app build
|
||||
const getPrecomputedDependencies = () => import('../build/client.precomputed.mjs').then((r) => r.default || r).then((r) => typeof r === "function" ? r() : r);
|
||||
// -- SSR Renderer --
|
||||
@@ -189,7 +231,7 @@ const unheadOptions = {
|
||||
|
||||
function createSSRContext(event) {
|
||||
const ssrContext = {
|
||||
url: event.path,
|
||||
url: decodePath(event.path),
|
||||
event,
|
||||
runtimeConfig: useRuntimeConfig(event),
|
||||
noSSR: event.context.nuxt?.noSSR || (false),
|
||||
@@ -420,4 +462,10 @@ function renderHTMLDocument(html) {
|
||||
return "<!DOCTYPE html>" + `<html${joinAttrs(html.htmlAttrs)}>` + `<head>${joinTags(html.head)}</head>` + `<body${joinAttrs(html.bodyAttrs)}>${joinTags(html.bodyPrepend)}${joinTags(html.body)}${joinTags(html.bodyAppend)}</body>` + "</html>";
|
||||
}
|
||||
|
||||
export { renderer as default };
|
||||
const renderer$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
||||
__proto__: null,
|
||||
default: renderer
|
||||
}, Symbol.toStringTag, { value: 'Module' }));
|
||||
|
||||
export { useSeoMeta as a, headSymbol as h, renderer$1 as r, useHead as u };
|
||||
//# sourceMappingURL=renderer.mjs.map
|
||||
|
||||
Reference in New Issue
Block a user