fix
All checks were successful
Build and Deploy Next.js + Nginx Docker Image / build-and-deploy (push) Successful in 50s
Build and Deploy Next.js + Nginx Docker Image / deploy (push) Successful in 6s

This commit is contained in:
Mohamadzadeh 2026-07-13 15:07:58 +03:30
parent 414a95a3bb
commit 0a14270aaa
2 changed files with 37 additions and 28 deletions

56
dist/remote-ui.js vendored
View File

@ -1,15 +1,15 @@
import { jsx as _ } from "react/jsx-runtime"; import { jsx as g } from "react/jsx-runtime";
import g, { useRef as u, useEffect as m } from "react"; import h, { useRef as u, useEffect as m } from "react";
import { createRoot as h } from "react-dom/client"; import { createRoot as _ } from "react-dom/client";
import { Badge as E, ChakraProvider as P } from "@chakra-ui/react"; import { Badge as E, ChakraProvider as P } from "@chakra-ui/react";
const p = "https://uikit.d.aiengines.ir/GBadge.js", d = "__UIKIT_REMOTE_DEPS__", s = "__UIKIT_REMOTE_CONFIG__", i = /* @__PURE__ */ new Map(); const R = "https://uikit.d.aiengines.ir/GBadge.js", d = "__UIKIT_REMOTE_DEPS__", f = "__UIKIT_REMOTE_CONFIG__", i = /* @__PURE__ */ new Map();
function w(e = {}) { function w(e = {}) {
if (typeof window > "u") return; if (typeof window > "u") return;
const r = window[d] || {}, o = window[s] || {}; const r = window[d] || {}, n = window[f] || {};
window[d] = { window[d] = {
...r, ...r,
React: e.React || r.React || g, React: e.React || r.React || h,
createRoot: e.createRoot || r.createRoot || h, createRoot: e.createRoot || r.createRoot || _,
ChakraProvider: e.ChakraProvider || r.ChakraProvider || P, ChakraProvider: e.ChakraProvider || r.ChakraProvider || P,
Badge: e.Badge || r.Badge || E, Badge: e.Badge || r.Badge || E,
theme: Object.prototype.hasOwnProperty.call(e, "theme") ? e.theme : r.theme, theme: Object.prototype.hasOwnProperty.call(e, "theme") ? e.theme : r.theme,
@ -17,17 +17,19 @@ function w(e = {}) {
...r.chakraProviderProps || {}, ...r.chakraProviderProps || {},
...e.chakraProviderProps || {} ...e.chakraProviderProps || {}
} }
}, window[s] = { }, window[f] = {
...o, ...n,
...e.remoteUrl ? { GBadgeUrl: e.remoteUrl } : {} ...e.remoteUrl ? { GBadgeUrl: e.remoteUrl } : {}
}; };
} }
function v() { function v() {
typeof window > "u" || window[d] || w(); if (typeof window > "u") return;
const e = window[d];
(!(e != null && e.React) || !(e != null && e.createRoot) || !(e != null && e.ChakraProvider) || !(e != null && e.Badge)) && w();
} }
function k() { function k() {
var e; var e;
return typeof window > "u" ? p : ((e = window[s]) == null ? void 0 : e.GBadgeUrl) || p; return typeof window > "u" ? R : ((e = window[f]) == null ? void 0 : e.GBadgeUrl) || R;
} }
function y() { function y() {
const e = k(); const e = k();
@ -52,33 +54,33 @@ function B(e) {
const T = ({ const T = ({
children: e, children: e,
remoteUrl: r, remoteUrl: r,
theme: o, theme: n,
chakraProviderProps: f, chakraProviderProps: s,
...R ...p
}) => { }) => {
const c = u(null), t = u(null), a = u(null); const a = u(null), t = u(null), c = u(null);
return a.current = { return c.current = {
...R, ...p,
children: B(e), children: B(e),
...o !== void 0 ? { theme: o } : {}, ...n !== void 0 ? { theme: n } : {},
...f ? { chakraProviderProps: f } : {} ...s ? { chakraProviderProps: s } : {}
}, m(() => { }, m(() => {
let l = !0; let l = !0;
return v(), r && w({ remoteUrl: r }), y().then(() => { return v(), r && w({ remoteUrl: r }), y().then(() => {
if (!l || !c.current) return; if (!l || !a.current) return;
const n = document.createElement("uikit-g-badge"); const o = document.createElement("uikit-g-badge");
n.componentProps = a.current, c.current.appendChild(n), t.current = n; o.componentProps = c.current, a.current.appendChild(o), t.current = o;
}).catch((n) => { }).catch((o) => {
console.error("[uikit/remote/ui] Failed to load GBadge:", n); console.error("[uikit/remote/ui] Failed to load GBadge:", o);
}), () => { }), () => {
l = !1, t.current && (t.current.remove(), t.current = null); l = !1, t.current && (t.current.remove(), t.current = null);
}; };
}, [r]), m(() => { }, [r]), m(() => {
t.current && (t.current.componentProps = a.current); t.current && (t.current.componentProps = c.current);
}), /* @__PURE__ */ _( }), /* @__PURE__ */ g(
"span", "span",
{ {
ref: c, ref: a,
style: { style: {
display: "contents" display: "contents"
} }

View File

@ -41,7 +41,14 @@ export function setupUikitRemoteDeps(options = {}) {
function ensureRemoteDeps() { function ensureRemoteDeps() {
if (typeof window === "undefined") return; if (typeof window === "undefined") return;
if (!window[REMOTE_DEPS_KEY]) { const deps = window[REMOTE_DEPS_KEY];
if (
!deps?.React ||
!deps?.createRoot ||
!deps?.ChakraProvider ||
!deps?.Badge
) {
setupUikitRemoteDeps(); setupUikitRemoteDeps();
} }
} }