main repo

This commit is contained in:
Basilosaurusrex
2025-11-24 18:09:40 +01:00
parent b636ee5e70
commit f027651f9b
34146 changed files with 4436636 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
import { ReactNode } from 'react';
import React from 'react';
export default function HotReload({ assetPrefix, children, }: {
assetPrefix: string;
children?: ReactNode;
}): React.JSX.Element;

View File

@@ -0,0 +1,402 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function() {
return HotReload;
}
});
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _stripansi = /*#__PURE__*/ _interop_require_default._(require("next/dist/compiled/strip-ansi"));
const _formatwebpackmessages = /*#__PURE__*/ _interop_require_default._(require("../../dev/error-overlay/format-webpack-messages"));
const _navigation = require("../navigation");
const _erroroverlayreducer = require("./internal/error-overlay-reducer");
const _parseStack = require("./internal/helpers/parseStack");
const _ReactDevOverlay = /*#__PURE__*/ _interop_require_default._(require("./internal/ReactDevOverlay"));
const _useerrorhandler = require("./internal/helpers/use-error-handler");
const _usewebsocket = require("./internal/helpers/use-websocket");
const _parsecomponentstack = require("./internal/helpers/parse-component-stack");
const _hotreloadertypes = require("../../../server/dev/hot-reloader-types");
let mostRecentCompilationHash = null;
let __nextDevClientId = Math.round(Math.random() * 100 + Date.now());
function onBeforeFastRefresh(dispatcher, hasUpdates) {
if (hasUpdates) {
dispatcher.onBeforeRefresh();
}
}
function onFastRefresh(dispatcher, hasUpdates) {
dispatcher.onBuildOk();
if (hasUpdates) {
dispatcher.onRefresh();
}
}
// There is a newer version of the code available.
function handleAvailableHash(hash) {
// Update last known compilation hash.
mostRecentCompilationHash = hash;
}
// Is there a newer version of this code available?
function isUpdateAvailable() {
/* globals __webpack_hash__ */ // __webpack_hash__ is the hash of the current compilation.
// It's a global variable injected by Webpack.
return mostRecentCompilationHash !== __webpack_hash__;
}
// Webpack disallows updates in other states.
function canApplyUpdates() {
// @ts-expect-error module.hot exists
return module.hot.status() === "idle";
}
function afterApplyUpdates(fn) {
if (canApplyUpdates()) {
fn();
} else {
function handler(status) {
if (status === "idle") {
// @ts-expect-error module.hot exists
module.hot.removeStatusHandler(handler);
fn();
}
}
// @ts-expect-error module.hot exists
module.hot.addStatusHandler(handler);
}
}
function performFullReload(err, sendMessage) {
const stackTrace = err && (err.stack && err.stack.split("\n").slice(0, 5).join("\n") || err.message || err + "");
sendMessage(JSON.stringify({
event: "client-full-reload",
stackTrace,
hadRuntimeError: !!_useerrorhandler.RuntimeErrorHandler.hadRuntimeError
}));
window.location.reload();
}
// Attempt to update code on the fly, fall back to a hard reload.
function tryApplyUpdates(onBeforeUpdate, onHotUpdateSuccess, sendMessage, dispatcher) {
if (!isUpdateAvailable() || !canApplyUpdates()) {
dispatcher.onBuildOk();
return;
}
function handleApplyUpdates(err, updatedModules) {
if (err || _useerrorhandler.RuntimeErrorHandler.hadRuntimeError || !updatedModules) {
if (err) {
console.warn("[Fast Refresh] performing full reload\n\n" + "Fast Refresh will perform a full reload when you edit a file that's imported by modules outside of the React rendering tree.\n" + "You might have a file which exports a React component but also exports a value that is imported by a non-React component file.\n" + "Consider migrating the non-React component export to a separate file and importing it into both files.\n\n" + "It is also possible the parent component of the component you edited is a class component, which disables Fast Refresh.\n" + "Fast Refresh requires at least one parent function component in your React tree.");
} else if (_useerrorhandler.RuntimeErrorHandler.hadRuntimeError) {
console.warn("[Fast Refresh] performing full reload because your application had an unrecoverable error");
}
performFullReload(err, sendMessage);
return;
}
const hasUpdates = Boolean(updatedModules.length);
if (typeof onHotUpdateSuccess === "function") {
// Maybe we want to do something.
onHotUpdateSuccess(hasUpdates);
}
if (isUpdateAvailable()) {
// While we were updating, there was a new update! Do it again.
tryApplyUpdates(hasUpdates ? ()=>{} : onBeforeUpdate, hasUpdates ? ()=>dispatcher.onBuildOk() : onHotUpdateSuccess, sendMessage, dispatcher);
} else {
dispatcher.onBuildOk();
if (process.env.__NEXT_TEST_MODE) {
afterApplyUpdates(()=>{
if (self.__NEXT_HMR_CB) {
self.__NEXT_HMR_CB();
self.__NEXT_HMR_CB = null;
}
});
}
}
}
// https://webpack.js.org/api/hot-module-replacement/#check
// @ts-expect-error module.hot exists
module.hot.check(/* autoApply */ false).then((updatedModules)=>{
if (!updatedModules) {
return null;
}
if (typeof onBeforeUpdate === "function") {
const hasUpdates = Boolean(updatedModules.length);
onBeforeUpdate(hasUpdates);
}
// https://webpack.js.org/api/hot-module-replacement/#apply
// @ts-expect-error module.hot exists
return module.hot.apply();
}).then((updatedModules)=>{
handleApplyUpdates(null, updatedModules);
}, (err)=>{
handleApplyUpdates(err, null);
});
}
function processMessage(obj, sendMessage, router, dispatcher) {
if (!("action" in obj)) {
return;
}
function handleErrors(errors) {
// "Massage" webpack messages.
const formatted = (0, _formatwebpackmessages.default)({
errors: errors,
warnings: []
});
// Only show the first error.
dispatcher.onBuildError(formatted.errors[0]);
// Also log them to the console.
for(let i = 0; i < formatted.errors.length; i++){
console.error((0, _stripansi.default)(formatted.errors[i]));
}
// Do not attempt to reload now.
// We will reload on next success instead.
if (process.env.__NEXT_TEST_MODE) {
if (self.__NEXT_HMR_CB) {
self.__NEXT_HMR_CB(formatted.errors[0]);
self.__NEXT_HMR_CB = null;
}
}
}
switch(obj.action){
case _hotreloadertypes.HMR_ACTIONS_SENT_TO_BROWSER.BUILDING:
{
console.log("[Fast Refresh] rebuilding");
break;
}
case _hotreloadertypes.HMR_ACTIONS_SENT_TO_BROWSER.BUILT:
case _hotreloadertypes.HMR_ACTIONS_SENT_TO_BROWSER.SYNC:
{
if (obj.hash) {
handleAvailableHash(obj.hash);
}
const { errors, warnings } = obj;
// Is undefined when it's a 'built' event
if ("versionInfo" in obj) {
dispatcher.onVersionInfo(obj.versionInfo);
}
const hasErrors = Boolean(errors && errors.length);
// Compilation with errors (e.g. syntax error or missing modules).
if (hasErrors) {
sendMessage(JSON.stringify({
event: "client-error",
errorCount: errors.length,
clientId: __nextDevClientId
}));
handleErrors(errors);
return;
}
const hasWarnings = Boolean(warnings && warnings.length);
if (hasWarnings) {
sendMessage(JSON.stringify({
event: "client-warning",
warningCount: warnings.length,
clientId: __nextDevClientId
}));
// Compilation with warnings (e.g. ESLint).
const isHotUpdate = obj.action !== _hotreloadertypes.HMR_ACTIONS_SENT_TO_BROWSER.SYNC;
// Print warnings to the console.
const formattedMessages = (0, _formatwebpackmessages.default)({
warnings: warnings,
errors: []
});
for(let i = 0; i < formattedMessages.warnings.length; i++){
if (i === 5) {
console.warn("There were more warnings in other files.\n" + "You can find a complete log in the terminal.");
break;
}
console.warn((0, _stripansi.default)(formattedMessages.warnings[i]));
}
// Attempt to apply hot updates or reload.
if (isHotUpdate) {
tryApplyUpdates(function onBeforeHotUpdate(hasUpdates) {
onBeforeFastRefresh(dispatcher, hasUpdates);
}, function onSuccessfulHotUpdate(hasUpdates) {
// Only dismiss it when we're sure it's a hot update.
// Otherwise it would flicker right before the reload.
onFastRefresh(dispatcher, hasUpdates);
}, sendMessage, dispatcher);
}
return;
}
sendMessage(JSON.stringify({
event: "client-success",
clientId: __nextDevClientId
}));
const isHotUpdate = obj.action !== _hotreloadertypes.HMR_ACTIONS_SENT_TO_BROWSER.SYNC && (!window.__NEXT_DATA__ || window.__NEXT_DATA__.page !== "/_error") && isUpdateAvailable();
// Attempt to apply hot updates or reload.
if (isHotUpdate) {
tryApplyUpdates(function onBeforeHotUpdate(hasUpdates) {
onBeforeFastRefresh(dispatcher, hasUpdates);
}, function onSuccessfulHotUpdate(hasUpdates) {
// Only dismiss it when we're sure it's a hot update.
// Otherwise it would flicker right before the reload.
onFastRefresh(dispatcher, hasUpdates);
}, sendMessage, dispatcher);
}
return;
}
// TODO-APP: make server component change more granular
case _hotreloadertypes.HMR_ACTIONS_SENT_TO_BROWSER.SERVER_COMPONENT_CHANGES:
{
sendMessage(JSON.stringify({
event: "server-component-reload-page",
clientId: __nextDevClientId
}));
if (_useerrorhandler.RuntimeErrorHandler.hadRuntimeError) {
return window.location.reload();
}
(0, _react.startTransition)(()=>{
// @ts-ignore it exists, it's just hidden
router.fastRefresh();
dispatcher.onRefresh();
});
if (process.env.__NEXT_TEST_MODE) {
if (self.__NEXT_HMR_CB) {
self.__NEXT_HMR_CB();
self.__NEXT_HMR_CB = null;
}
}
return;
}
case _hotreloadertypes.HMR_ACTIONS_SENT_TO_BROWSER.RELOAD_PAGE:
{
sendMessage(JSON.stringify({
event: "client-reload-page",
clientId: __nextDevClientId
}));
return window.location.reload();
}
case _hotreloadertypes.HMR_ACTIONS_SENT_TO_BROWSER.REMOVED_PAGE:
{
// TODO-APP: potentially only refresh if the currently viewed page was removed.
// @ts-ignore it exists, it's just hidden
router.fastRefresh();
return;
}
case _hotreloadertypes.HMR_ACTIONS_SENT_TO_BROWSER.ADDED_PAGE:
{
// TODO-APP: potentially only refresh if the currently viewed page was added.
// @ts-ignore it exists, it's just hidden
router.fastRefresh();
return;
}
case _hotreloadertypes.HMR_ACTIONS_SENT_TO_BROWSER.SERVER_ERROR:
{
const { errorJSON } = obj;
if (errorJSON) {
const { message, stack } = JSON.parse(errorJSON);
const error = new Error(message);
error.stack = stack;
handleErrors([
error
]);
}
return;
}
case _hotreloadertypes.HMR_ACTIONS_SENT_TO_BROWSER.DEV_PAGES_MANIFEST_UPDATE:
{
return;
}
default:
{
throw new Error("Unexpected action " + JSON.stringify(obj));
}
}
}
function HotReload(param) {
let { assetPrefix, children } = param;
const [state, dispatch] = (0, _react.useReducer)(_erroroverlayreducer.errorOverlayReducer, _erroroverlayreducer.INITIAL_OVERLAY_STATE);
const dispatcher = (0, _react.useMemo)(()=>{
return {
onBuildOk () {
dispatch({
type: _erroroverlayreducer.ACTION_BUILD_OK
});
},
onBuildError (message) {
dispatch({
type: _erroroverlayreducer.ACTION_BUILD_ERROR,
message
});
},
onBeforeRefresh () {
dispatch({
type: _erroroverlayreducer.ACTION_BEFORE_REFRESH
});
},
onRefresh () {
dispatch({
type: _erroroverlayreducer.ACTION_REFRESH
});
},
onVersionInfo (versionInfo) {
dispatch({
type: _erroroverlayreducer.ACTION_VERSION_INFO,
versionInfo
});
}
};
}, [
dispatch
]);
const handleOnUnhandledError = (0, _react.useCallback)((error)=>{
// Component stack is added to the error in use-error-handler in case there was a hydration errror
const componentStack = error._componentStack;
dispatch({
type: _erroroverlayreducer.ACTION_UNHANDLED_ERROR,
reason: error,
frames: (0, _parseStack.parseStack)(error.stack),
componentStackFrames: componentStack && (0, _parsecomponentstack.parseComponentStack)(componentStack)
});
}, []);
const handleOnUnhandledRejection = (0, _react.useCallback)((reason)=>{
dispatch({
type: _erroroverlayreducer.ACTION_UNHANDLED_REJECTION,
reason: reason,
frames: (0, _parseStack.parseStack)(reason.stack)
});
}, []);
const handleOnReactError = (0, _react.useCallback)(()=>{
_useerrorhandler.RuntimeErrorHandler.hadRuntimeError = true;
}, []);
(0, _useerrorhandler.useErrorHandler)(handleOnUnhandledError, handleOnUnhandledRejection);
const webSocketRef = (0, _usewebsocket.useWebsocket)(assetPrefix);
(0, _usewebsocket.useWebsocketPing)(webSocketRef);
const sendMessage = (0, _usewebsocket.useSendMessage)(webSocketRef);
const processTurbopackMessage = (0, _usewebsocket.useTurbopack)(sendMessage);
const router = (0, _navigation.useRouter)();
(0, _react.useEffect)(()=>{
const handler = (event)=>{
try {
const obj = JSON.parse(event.data);
const handledByTurbopack = processTurbopackMessage == null ? void 0 : processTurbopackMessage(obj);
if (!handledByTurbopack) {
processMessage(obj, sendMessage, router, dispatcher);
}
} catch (err) {
var _err_stack;
console.warn("[HMR] Invalid message: " + event.data + "\n" + ((_err_stack = err == null ? void 0 : err.stack) != null ? _err_stack : ""));
}
};
const websocket = webSocketRef.current;
if (websocket) {
websocket.addEventListener("message", handler);
}
return ()=>websocket && websocket.removeEventListener("message", handler);
}, [
sendMessage,
router,
webSocketRef,
dispatcher,
processTurbopackMessage
]);
return /*#__PURE__*/ _react.default.createElement(_ReactDevOverlay.default, {
onReactError: handleOnReactError,
state: state
}, children);
}
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=hot-reloader-client.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,19 @@
import * as React from 'react';
import { OverlayState } from './error-overlay-reducer';
import { SupportedErrorEvent } from './container/Errors';
interface ReactDevOverlayState {
reactError: SupportedErrorEvent | null;
}
declare class ReactDevOverlay extends React.PureComponent<{
state: OverlayState;
children: React.ReactNode;
onReactError: (error: Error) => void;
}, ReactDevOverlayState> {
state: {
reactError: null;
};
static getDerivedStateFromError(error: Error): ReactDevOverlayState;
componentDidCatch(componentErr: Error): void;
render(): React.JSX.Element;
}
export default ReactDevOverlay;

View File

@@ -0,0 +1,80 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function() {
return _default;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _erroroverlayreducer = require("./error-overlay-reducer");
const _ShadowPortal = require("./components/ShadowPortal");
const _BuildError = require("./container/BuildError");
const _Errors = require("./container/Errors");
const _RootLayoutError = require("./container/RootLayoutError");
const _parseStack = require("./helpers/parseStack");
const _Base = require("./styles/Base");
const _ComponentStyles = require("./styles/ComponentStyles");
const _CssReset = require("./styles/CssReset");
class ReactDevOverlay extends _react.PureComponent {
static getDerivedStateFromError(error) {
const e = error;
const event = {
type: _erroroverlayreducer.ACTION_UNHANDLED_ERROR,
reason: error,
frames: (0, _parseStack.parseStack)(e.stack)
};
const errorEvent = {
id: 0,
event
};
return {
reactError: errorEvent
};
}
componentDidCatch(componentErr) {
this.props.onReactError(componentErr);
}
render() {
const { state, children } = this.props;
const { reactError } = this.state;
const hasBuildError = state.buildError != null;
const hasRuntimeErrors = Boolean(state.errors.length);
const rootLayoutMissingTagsError = state.rootLayoutMissingTagsError;
const isMounted = hasBuildError || hasRuntimeErrors || reactError || rootLayoutMissingTagsError;
return /*#__PURE__*/ _react.createElement(_react.Fragment, null, reactError ? /*#__PURE__*/ _react.createElement("html", null, /*#__PURE__*/ _react.createElement("head", null), /*#__PURE__*/ _react.createElement("body", null)) : children, isMounted ? /*#__PURE__*/ _react.createElement(_ShadowPortal.ShadowPortal, null, /*#__PURE__*/ _react.createElement(_CssReset.CssReset, null), /*#__PURE__*/ _react.createElement(_Base.Base, null), /*#__PURE__*/ _react.createElement(_ComponentStyles.ComponentStyles, null), rootLayoutMissingTagsError ? /*#__PURE__*/ _react.createElement(_RootLayoutError.RootLayoutError, {
missingTags: rootLayoutMissingTagsError.missingTags
}) : hasBuildError ? /*#__PURE__*/ _react.createElement(_BuildError.BuildError, {
message: state.buildError,
versionInfo: state.versionInfo
}) : reactError ? /*#__PURE__*/ _react.createElement(_Errors.Errors, {
versionInfo: state.versionInfo,
initialDisplayState: "fullscreen",
errors: [
reactError
]
}) : hasRuntimeErrors ? /*#__PURE__*/ _react.createElement(_Errors.Errors, {
initialDisplayState: "minimized",
errors: state.errors,
versionInfo: state.versionInfo
}) : undefined) : undefined);
}
constructor(...args){
super(...args);
this.state = {
reactError: null
};
}
}
const _default = ReactDevOverlay;
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=ReactDevOverlay.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/client/components/react-dev-overlay/internal/ReactDevOverlay.tsx"],"names":["ReactDevOverlay","React","PureComponent","getDerivedStateFromError","error","e","event","type","ACTION_UNHANDLED_ERROR","reason","frames","parseStack","stack","errorEvent","id","reactError","componentDidCatch","componentErr","props","onReactError","render","state","children","hasBuildError","buildError","hasRuntimeErrors","Boolean","errors","length","rootLayoutMissingTagsError","isMounted","html","head","body","ShadowPortal","CssReset","Base","ComponentStyles","RootLayoutError","missingTags","BuildError","message","versionInfo","Errors","initialDisplayState","undefined"],"mappings":";;;;+BAyGA;;;eAAA;;;;iEAzGuB;qCAKhB;8BAEsB;4BACF;wBACiB;iCACZ;4BACL;sBACN;iCACW;0BACP;AAKzB,MAAMA,wBAAwBC,OAAMC,aAAa;IAU/C,OAAOC,yBAAyBC,KAAY,EAAwB;QAClE,MAAMC,IAAID;QACV,MAAME,QAA8B;YAClCC,MAAMC,2CAAsB;YAC5BC,QAAQL;YACRM,QAAQC,IAAAA,sBAAU,EAACN,EAAEO,KAAK;QAC5B;QACA,MAAMC,aAAkC;YACtCC,IAAI;YACJR;QACF;QACA,OAAO;YAAES,YAAYF;QAAW;IAClC;IAEAG,kBAAkBC,YAAmB,EAAE;QACrC,IAAI,CAACC,KAAK,CAACC,YAAY,CAACF;IAC1B;IAEAG,SAAS;QACP,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAG,IAAI,CAACJ,KAAK;QACtC,MAAM,EAAEH,UAAU,EAAE,GAAG,IAAI,CAACM,KAAK;QAEjC,MAAME,gBAAgBF,MAAMG,UAAU,IAAI;QAC1C,MAAMC,mBAAmBC,QAAQL,MAAMM,MAAM,CAACC,MAAM;QACpD,MAAMC,6BAA6BR,MAAMQ,0BAA0B;QACnE,MAAMC,YACJP,iBACAE,oBACAV,cACAc;QAEF,qBACE,4CACGd,2BACC,qBAACgB,4BACC,qBAACC,6BACD,qBAACC,iBAGHX,UAEDQ,0BACC,qBAACI,0BAAY,sBACX,qBAACC,kBAAQ,uBACT,qBAACC,UAAI,uBACL,qBAACC,gCAAe,SAEfR,2CACC,qBAACS,gCAAe;YACdC,aAAaV,2BAA2BU,WAAW;aAEnDhB,8BACF,qBAACiB,sBAAU;YACTC,SAASpB,MAAMG,UAAU;YACzBkB,aAAarB,MAAMqB,WAAW;aAE9B3B,2BACF,qBAAC4B,cAAM;YACLD,aAAarB,MAAMqB,WAAW;YAC9BE,qBAAoB;YACpBjB,QAAQ;gBAACZ;aAAW;aAEpBU,iCACF,qBAACkB,cAAM;YACLC,qBAAoB;YACpBjB,QAAQN,MAAMM,MAAM;YACpBe,aAAarB,MAAMqB,WAAW;aAE9BG,aAEJA;IAGV;;;aA3EAxB,QAAQ;YAAEN,YAAY;QAAK;;AA4E7B;MAEA,WAAef"}

View File

@@ -0,0 +1,7 @@
import * as React from 'react';
import { StackFrame } from 'next/dist/compiled/stacktrace-parser';
export type CodeFrameProps = {
stackFrame: StackFrame;
codeFrame: string;
};
export declare const CodeFrame: React.FC<CodeFrameProps>;

View File

@@ -0,0 +1,90 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "CodeFrame", {
enumerable: true,
get: function() {
return CodeFrame;
}
});
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _anser = /*#__PURE__*/ _interop_require_default._(require("next/dist/compiled/anser"));
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _stripansi = /*#__PURE__*/ _interop_require_default._(require("next/dist/compiled/strip-ansi"));
const _stackframe = require("../../helpers/stack-frame");
const _useopenineditor = require("../../helpers/use-open-in-editor");
const CodeFrame = function CodeFrame(param) {
let { stackFrame, codeFrame } = param;
// Strip leading spaces out of the code frame:
const formattedFrame = _react.useMemo(()=>{
const lines = codeFrame.split(/\r?\n/g);
const prefixLength = lines.map((line)=>/^>? +\d+ +\| [ ]+/.exec((0, _stripansi.default)(line)) === null ? null : /^>? +\d+ +\| ( *)/.exec((0, _stripansi.default)(line))).filter(Boolean).map((v)=>v.pop()).reduce((c, n)=>isNaN(c) ? n.length : Math.min(c, n.length), NaN);
if (prefixLength > 1) {
const p = " ".repeat(prefixLength);
return lines.map((line, a)=>~(a = line.indexOf("|")) ? line.substring(0, a) + line.substring(a).replace(p, "") : line).join("\n");
}
return lines.join("\n");
}, [
codeFrame
]);
const decoded = _react.useMemo(()=>{
return _anser.default.ansiToJson(formattedFrame, {
json: true,
use_classes: true,
remove_empty: true
});
}, [
formattedFrame
]);
const open = (0, _useopenineditor.useOpenInEditor)({
file: stackFrame.file,
lineNumber: stackFrame.lineNumber,
column: stackFrame.column
});
// TODO: make the caret absolute
return /*#__PURE__*/ _react.createElement("div", {
"data-nextjs-codeframe": true
}, /*#__PURE__*/ _react.createElement("div", null, /*#__PURE__*/ _react.createElement("p", {
role: "link",
onClick: open,
tabIndex: 1,
title: "Click to open in your editor"
}, /*#__PURE__*/ _react.createElement("span", null, (0, _stackframe.getFrameSource)(stackFrame), " @ ", stackFrame.methodName), /*#__PURE__*/ _react.createElement("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
fill: "none",
stroke: "currentColor",
strokeWidth: "2",
strokeLinecap: "round",
strokeLinejoin: "round"
}, /*#__PURE__*/ _react.createElement("path", {
d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"
}), /*#__PURE__*/ _react.createElement("polyline", {
points: "15 3 21 3 21 9"
}), /*#__PURE__*/ _react.createElement("line", {
x1: "10",
y1: "14",
x2: "21",
y2: "3"
})))), /*#__PURE__*/ _react.createElement("pre", null, decoded.map((entry, index)=>/*#__PURE__*/ _react.createElement("span", {
key: "frame-" + index,
style: {
color: entry.fg ? "var(--color-" + entry.fg + ")" : undefined,
...entry.decoration === "bold" ? {
fontWeight: 800
} : entry.decoration === "italic" ? {
fontStyle: "italic"
} : undefined
}
}, entry.content))));
};
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=CodeFrame.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../src/client/components/react-dev-overlay/internal/components/CodeFrame/CodeFrame.tsx"],"names":["CodeFrame","stackFrame","codeFrame","formattedFrame","React","useMemo","lines","split","prefixLength","map","line","exec","stripAnsi","filter","Boolean","v","pop","reduce","c","n","isNaN","length","Math","min","NaN","p","repeat","a","indexOf","substring","replace","join","decoded","Anser","ansiToJson","json","use_classes","remove_empty","open","useOpenInEditor","file","lineNumber","column","div","data-nextjs-codeframe","role","onClick","tabIndex","title","span","getFrameSource","methodName","svg","xmlns","viewBox","fill","stroke","strokeWidth","strokeLinecap","strokeLinejoin","path","d","polyline","points","x1","y1","x2","y2","pre","entry","index","key","style","color","fg","undefined","decoration","fontWeight","fontStyle","content"],"mappings":";;;;+BASaA;;;eAAAA;;;;;gEATK;iEACK;oEAED;4BACS;iCACC;AAIzB,MAAMA,YAAsC,SAASA,UAAU,KAGrE;IAHqE,IAAA,EACpEC,UAAU,EACVC,SAAS,EACV,GAHqE;IAIpE,8CAA8C;IAC9C,MAAMC,iBAAiBC,OAAMC,OAAO,CAAS;QAC3C,MAAMC,QAAQJ,UAAUK,KAAK,CAAC;QAC9B,MAAMC,eAAeF,MAClBG,GAAG,CAAC,CAACC,OACJ,oBAAoBC,IAAI,CAACC,IAAAA,kBAAS,EAACF,WAAW,OAC1C,OACA,oBAAoBC,IAAI,CAACC,IAAAA,kBAAS,EAACF,QAExCG,MAAM,CAACC,SACPL,GAAG,CAAC,CAACM,IAAMA,EAAGC,GAAG,IACjBC,MAAM,CAAC,CAACC,GAAGC,IAAOC,MAAMF,KAAKC,EAAEE,MAAM,GAAGC,KAAKC,GAAG,CAACL,GAAGC,EAAEE,MAAM,GAAIG;QAEnE,IAAIhB,eAAe,GAAG;YACpB,MAAMiB,IAAI,IAAIC,MAAM,CAAClB;YACrB,OAAOF,MACJG,GAAG,CAAC,CAACC,MAAMiB,IACV,CAAEA,CAAAA,IAAIjB,KAAKkB,OAAO,CAAC,IAAG,IAClBlB,KAAKmB,SAAS,CAAC,GAAGF,KAAKjB,KAAKmB,SAAS,CAACF,GAAGG,OAAO,CAACL,GAAG,MACpDf,MAELqB,IAAI,CAAC;QACV;QACA,OAAOzB,MAAMyB,IAAI,CAAC;IACpB,GAAG;QAAC7B;KAAU;IAEd,MAAM8B,UAAU5B,OAAMC,OAAO,CAAC;QAC5B,OAAO4B,cAAK,CAACC,UAAU,CAAC/B,gBAAgB;YACtCgC,MAAM;YACNC,aAAa;YACbC,cAAc;QAChB;IACF,GAAG;QAAClC;KAAe;IAEnB,MAAMmC,OAAOC,IAAAA,gCAAe,EAAC;QAC3BC,MAAMvC,WAAWuC,IAAI;QACrBC,YAAYxC,WAAWwC,UAAU;QACjCC,QAAQzC,WAAWyC,MAAM;IAC3B;IAEA,gCAAgC;IAChC,qBACE,qBAACC;QAAIC,yBAAAA;qBACH,qBAACD,2BACC,qBAAClB;QACCoB,MAAK;QACLC,SAASR;QACTS,UAAU;QACVC,OAAM;qBAEN,qBAACC,cACEC,IAAAA,0BAAc,EAACjD,aAAY,OAAIA,WAAWkD,UAAU,iBAEvD,qBAACC;QACCC,OAAM;QACNC,SAAQ;QACRC,MAAK;QACLC,QAAO;QACPC,aAAY;QACZC,eAAc;QACdC,gBAAe;qBAEf,qBAACC;QAAKC,GAAE;sBACR,qBAACC;QAASC,QAAO;sBACjB,qBAACrD;QAAKsD,IAAG;QAAKC,IAAG;QAAKC,IAAG;QAAKC,IAAG;yBAIvC,qBAACC,aACEpC,QAAQvB,GAAG,CAAC,CAAC4D,OAAOC,sBACnB,qBAACrB;YACCsB,KAAK,AAAC,WAAQD;YACdE,OAAO;gBACLC,OAAOJ,MAAMK,EAAE,GAAG,AAAC,iBAAcL,MAAMK,EAAE,GAAC,MAAKC;gBAC/C,GAAIN,MAAMO,UAAU,KAAK,SACrB;oBAAEC,YAAY;gBAAI,IAClBR,MAAMO,UAAU,KAAK,WACrB;oBAAEE,WAAW;gBAAS,IACtBH,SAAS;YACf;WAECN,MAAMU,OAAO;AAM1B"}

View File

@@ -0,0 +1 @@
export { CodeFrame } from './CodeFrame';

View File

@@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "CodeFrame", {
enumerable: true,
get: function() {
return _CodeFrame.CodeFrame;
}
});
const _CodeFrame = require("./CodeFrame");
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../src/client/components/react-dev-overlay/internal/components/CodeFrame/index.tsx"],"names":["CodeFrame"],"mappings":";;;;+BAASA;;;eAAAA,oBAAS;;;2BAAQ"}

View File

@@ -0,0 +1,2 @@
declare const styles: string;
export { styles };

View File

@@ -0,0 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "styles", {
enumerable: true,
get: function() {
return styles;
}
});
const _tagged_template_literal_loose = require("@swc/helpers/_/_tagged_template_literal_loose");
const _nooptemplate = require("../../helpers/noop-template");
function _templateObject() {
const data = _tagged_template_literal_loose._([
"\n [data-nextjs-codeframe] {\n overflow: auto;\n border-radius: var(--size-gap-half);\n background-color: var(--color-ansi-bg);\n color: var(--color-ansi-fg);\n }\n [data-nextjs-codeframe]::selection,\n [data-nextjs-codeframe] *::selection {\n background-color: var(--color-ansi-selection);\n }\n [data-nextjs-codeframe] * {\n color: inherit;\n background-color: transparent;\n font-family: var(--font-stack-monospace);\n }\n\n [data-nextjs-codeframe] > * {\n margin: 0;\n padding: calc(var(--size-gap) + var(--size-gap-half))\n calc(var(--size-gap-double) + var(--size-gap-half));\n }\n [data-nextjs-codeframe] > div {\n display: inline-block;\n width: auto;\n min-width: 100%;\n border-bottom: 1px solid var(--color-ansi-bright-black);\n }\n [data-nextjs-codeframe] > div > p {\n display: flex;\n align-items: center;\n justify-content: space-between;\n cursor: pointer;\n margin: 0;\n }\n [data-nextjs-codeframe] > div > p:hover {\n text-decoration: underline dotted;\n }\n [data-nextjs-codeframe] div > p > svg {\n width: auto;\n height: 1em;\n margin-left: 8px;\n }\n [data-nextjs-codeframe] div > pre {\n overflow: hidden;\n display: inline-block;\n }\n"
]);
_templateObject = function() {
return data;
};
return data;
}
const styles = (0, _nooptemplate.noop)(_templateObject());
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=styles.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../src/client/components/react-dev-overlay/internal/components/CodeFrame/styles.tsx"],"names":["styles","css"],"mappings":";;;;+BAmDSA;;;eAAAA;;;;8BAnDmB;;;;;;;;;;AAE5B,MAAMA,aAASC,kBAAG"}

View File

@@ -0,0 +1,10 @@
import * as React from 'react';
export type DialogProps = {
children?: React.ReactNode;
type: 'error' | 'warning';
'aria-labelledby': string;
'aria-describedby': string;
onClose?: (e: MouseEvent | TouchEvent) => void;
};
declare const Dialog: React.FC<DialogProps>;
export { Dialog };

View File

@@ -0,0 +1,78 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "Dialog", {
enumerable: true,
get: function() {
return Dialog;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _useonclickoutside = require("../../hooks/use-on-click-outside");
const Dialog = function Dialog(param) {
let { children, type, onClose, ...props } = param;
const [dialog, setDialog] = _react.useState(null);
const [role, setRole] = _react.useState(typeof document !== "undefined" && document.hasFocus() ? "dialog" : undefined);
const onDialog = _react.useCallback((node)=>{
setDialog(node);
}, []);
(0, _useonclickoutside.useOnClickOutside)(dialog, onClose);
// Make HTMLElements with `role=link` accessible to be triggered by the
// keyboard, i.e. [Enter].
_react.useEffect(()=>{
if (dialog == null) {
return;
}
const root = dialog.getRootNode();
// Always true, but we do this for TypeScript:
if (!(root instanceof ShadowRoot)) {
return;
}
const shadowRoot = root;
function handler(e) {
const el = shadowRoot.activeElement;
if (e.key === "Enter" && el instanceof HTMLElement && el.getAttribute("role") === "link") {
e.preventDefault();
e.stopPropagation();
el.click();
}
}
function handleFocus() {
// safari will force itself as the active application when a background page triggers any sort of autofocus
// this is a workaround to only set the dialog role if the document has focus
setRole(document.hasFocus() ? "dialog" : undefined);
}
shadowRoot.addEventListener("keydown", handler);
window.addEventListener("focus", handleFocus);
window.addEventListener("blur", handleFocus);
return ()=>{
shadowRoot.removeEventListener("keydown", handler);
window.removeEventListener("focus", handleFocus);
window.removeEventListener("blur", handleFocus);
};
}, [
dialog
]);
return /*#__PURE__*/ _react.createElement("div", {
ref: onDialog,
"data-nextjs-dialog": true,
tabIndex: -1,
role: role,
"aria-labelledby": props["aria-labelledby"],
"aria-describedby": props["aria-describedby"],
"aria-modal": "true"
}, /*#__PURE__*/ _react.createElement("div", {
"data-nextjs-dialog-banner": true,
className: "banner-" + type
}), children);
};
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=Dialog.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../src/client/components/react-dev-overlay/internal/components/Dialog/Dialog.tsx"],"names":["Dialog","children","type","onClose","props","dialog","setDialog","React","useState","role","setRole","document","hasFocus","undefined","onDialog","useCallback","node","useOnClickOutside","useEffect","root","getRootNode","ShadowRoot","shadowRoot","handler","e","el","activeElement","key","HTMLElement","getAttribute","preventDefault","stopPropagation","click","handleFocus","addEventListener","window","removeEventListener","div","ref","data-nextjs-dialog","tabIndex","aria-labelledby","aria-describedby","aria-modal","data-nextjs-dialog-banner","className"],"mappings":";;;;+BAuFSA;;;eAAAA;;;;iEAvFc;mCACW;AAUlC,MAAMA,SAAgC,SAASA,OAAO,KAKrD;IALqD,IAAA,EACpDC,QAAQ,EACRC,IAAI,EACJC,OAAO,EACP,GAAGC,OACJ,GALqD;IAMpD,MAAM,CAACC,QAAQC,UAAU,GAAGC,OAAMC,QAAQ,CAAwB;IAClE,MAAM,CAACC,MAAMC,QAAQ,GAAGH,OAAMC,QAAQ,CACpC,OAAOG,aAAa,eAAeA,SAASC,QAAQ,KAChD,WACAC;IAEN,MAAMC,WAAWP,OAAMQ,WAAW,CAAC,CAACC;QAClCV,UAAUU;IACZ,GAAG,EAAE;IACLC,IAAAA,oCAAiB,EAACZ,QAAQF;IAE1B,uEAAuE;IACvE,0BAA0B;IAC1BI,OAAMW,SAAS,CAAC;QACd,IAAIb,UAAU,MAAM;YAClB;QACF;QAEA,MAAMc,OAAOd,OAAOe,WAAW;QAC/B,8CAA8C;QAC9C,IAAI,CAAED,CAAAA,gBAAgBE,UAAS,GAAI;YACjC;QACF;QACA,MAAMC,aAAaH;QACnB,SAASI,QAAQC,CAAgB;YAC/B,MAAMC,KAAKH,WAAWI,aAAa;YACnC,IACEF,EAAEG,GAAG,KAAK,WACVF,cAAcG,eACdH,GAAGI,YAAY,CAAC,YAAY,QAC5B;gBACAL,EAAEM,cAAc;gBAChBN,EAAEO,eAAe;gBAEjBN,GAAGO,KAAK;YACV;QACF;QAEA,SAASC;YACP,2GAA2G;YAC3G,6EAA6E;YAC7EvB,QAAQC,SAASC,QAAQ,KAAK,WAAWC;QAC3C;QAEAS,WAAWY,gBAAgB,CAAC,WAAWX;QACvCY,OAAOD,gBAAgB,CAAC,SAASD;QACjCE,OAAOD,gBAAgB,CAAC,QAAQD;QAChC,OAAO;YACLX,WAAWc,mBAAmB,CAAC,WAAWb;YAC1CY,OAAOC,mBAAmB,CAAC,SAASH;YACpCE,OAAOC,mBAAmB,CAAC,QAAQH;QACrC;IACF,GAAG;QAAC5B;KAAO;IAEX,qBACE,qBAACgC;QACCC,KAAKxB;QACLyB,sBAAAA;QACAC,UAAU,CAAC;QACX/B,MAAMA;QACNgC,mBAAiBrC,KAAK,CAAC,kBAAkB;QACzCsC,oBAAkBtC,KAAK,CAAC,mBAAmB;QAC3CuC,cAAW;qBAEX,qBAACN;QAAIO,6BAAAA;QAA0BC,WAAW,AAAC,YAAS3C;QACnDD;AAGP"}

View File

@@ -0,0 +1,7 @@
import * as React from 'react';
export type DialogBodyProps = {
children?: React.ReactNode;
className?: string;
};
declare const DialogBody: React.FC<DialogBodyProps>;
export { DialogBody };

View File

@@ -0,0 +1,27 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "DialogBody", {
enumerable: true,
get: function() {
return DialogBody;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const DialogBody = function DialogBody(param) {
let { children, className } = param;
return /*#__PURE__*/ _react.createElement("div", {
"data-nextjs-dialog-body": true,
className: className
}, children);
};
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=DialogBody.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../src/client/components/react-dev-overlay/internal/components/Dialog/DialogBody.tsx"],"names":["DialogBody","children","className","div","data-nextjs-dialog-body"],"mappings":";;;;+BAkBSA;;;eAAAA;;;;iEAlBc;AAOvB,MAAMA,aAAwC,SAASA,WAAW,KAGjE;IAHiE,IAAA,EAChEC,QAAQ,EACRC,SAAS,EACV,GAHiE;IAIhE,qBACE,qBAACC;QAAIC,2BAAAA;QAAwBF,WAAWA;OACrCD;AAGP"}

View File

@@ -0,0 +1,7 @@
import * as React from 'react';
export type DialogContentProps = {
children?: React.ReactNode;
className?: string;
};
declare const DialogContent: React.FC<DialogContentProps>;
export { DialogContent };

View File

@@ -0,0 +1,27 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "DialogContent", {
enumerable: true,
get: function() {
return DialogContent;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const DialogContent = function DialogContent(param) {
let { children, className } = param;
return /*#__PURE__*/ _react.createElement("div", {
"data-nextjs-dialog-content": true,
className: className
}, children);
};
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=DialogContent.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../src/client/components/react-dev-overlay/internal/components/Dialog/DialogContent.tsx"],"names":["DialogContent","children","className","div","data-nextjs-dialog-content"],"mappings":";;;;+BAkBSA;;;eAAAA;;;;iEAlBc;AAOvB,MAAMA,gBAA8C,SAASA,cAAc,KAG1E;IAH0E,IAAA,EACzEC,QAAQ,EACRC,SAAS,EACV,GAH0E;IAIzE,qBACE,qBAACC;QAAIC,8BAAAA;QAA2BF,WAAWA;OACxCD;AAGP"}

View File

@@ -0,0 +1,7 @@
import * as React from 'react';
export type DialogHeaderProps = {
children?: React.ReactNode;
className?: string;
};
declare const DialogHeader: React.FC<DialogHeaderProps>;
export { DialogHeader };

View File

@@ -0,0 +1,27 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "DialogHeader", {
enumerable: true,
get: function() {
return DialogHeader;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const DialogHeader = function DialogHeader(param) {
let { children, className } = param;
return /*#__PURE__*/ _react.createElement("div", {
"data-nextjs-dialog-header": true,
className: className
}, children);
};
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=DialogHeader.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../src/client/components/react-dev-overlay/internal/components/Dialog/DialogHeader.tsx"],"names":["DialogHeader","children","className","div","data-nextjs-dialog-header"],"mappings":";;;;+BAkBSA;;;eAAAA;;;;iEAlBc;AAOvB,MAAMA,eAA4C,SAASA,aAAa,KAGvE;IAHuE,IAAA,EACtEC,QAAQ,EACRC,SAAS,EACV,GAHuE;IAItE,qBACE,qBAACC;QAAIC,6BAAAA;QAA0BF,WAAWA;OACvCD;AAGP"}

View File

@@ -0,0 +1,5 @@
export { Dialog } from './Dialog';
export { DialogBody } from './DialogBody';
export { DialogContent } from './DialogContent';
export { DialogHeader } from './DialogHeader';
export { styles } from './styles';

View File

@@ -0,0 +1,47 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
Dialog: null,
DialogBody: null,
DialogContent: null,
DialogHeader: null,
styles: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
Dialog: function() {
return _Dialog.Dialog;
},
DialogBody: function() {
return _DialogBody.DialogBody;
},
DialogContent: function() {
return _DialogContent.DialogContent;
},
DialogHeader: function() {
return _DialogHeader.DialogHeader;
},
styles: function() {
return _styles.styles;
}
});
const _Dialog = require("./Dialog");
const _DialogBody = require("./DialogBody");
const _DialogContent = require("./DialogContent");
const _DialogHeader = require("./DialogHeader");
const _styles = require("./styles");
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../src/client/components/react-dev-overlay/internal/components/Dialog/index.ts"],"names":["Dialog","DialogBody","DialogContent","DialogHeader","styles"],"mappings":";;;;;;;;;;;;;;;;;;IAASA,MAAM;eAANA,cAAM;;IACNC,UAAU;eAAVA,sBAAU;;IACVC,aAAa;eAAbA,4BAAa;;IACbC,YAAY;eAAZA,0BAAY;;IACZC,MAAM;eAANA,cAAM;;;wBAJQ;4BACI;+BACG;8BACD;wBACN"}

View File

@@ -0,0 +1,2 @@
declare const styles: string;
export { styles };

View File

@@ -0,0 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "styles", {
enumerable: true,
get: function() {
return styles;
}
});
const _tagged_template_literal_loose = require("@swc/helpers/_/_tagged_template_literal_loose");
const _nooptemplate = require("../../helpers/noop-template");
function _templateObject() {
const data = _tagged_template_literal_loose._([
"\n [data-nextjs-dialog] {\n display: flex;\n flex-direction: column;\n width: 100%;\n margin-right: auto;\n margin-left: auto;\n outline: none;\n background: white;\n border-radius: var(--size-gap);\n box-shadow: 0 var(--size-gap-half) var(--size-gap-double)\n rgba(0, 0, 0, 0.25);\n max-height: calc(100% - 56px);\n overflow-y: hidden;\n }\n\n @media (max-height: 812px) {\n [data-nextjs-dialog-overlay] {\n max-height: calc(100% - 15px);\n }\n }\n\n @media (min-width: 576px) {\n [data-nextjs-dialog] {\n max-width: 540px;\n box-shadow: 0 var(--size-gap) var(--size-gap-quad) rgba(0, 0, 0, 0.25);\n }\n }\n\n @media (min-width: 768px) {\n [data-nextjs-dialog] {\n max-width: 720px;\n }\n }\n\n @media (min-width: 992px) {\n [data-nextjs-dialog] {\n max-width: 960px;\n }\n }\n\n [data-nextjs-dialog-banner] {\n position: relative;\n }\n [data-nextjs-dialog-banner].banner-warning {\n border-color: var(--color-ansi-yellow);\n }\n [data-nextjs-dialog-banner].banner-error {\n border-color: var(--color-ansi-red);\n }\n\n [data-nextjs-dialog-banner]::after {\n z-index: 2;\n content: '';\n position: absolute;\n top: 0;\n right: 0;\n width: 100%;\n /* banner width: */\n border-top-width: var(--size-gap-half);\n border-bottom-width: 0;\n border-top-style: solid;\n border-bottom-style: solid;\n border-top-color: inherit;\n border-bottom-color: transparent;\n }\n\n [data-nextjs-dialog-content] {\n overflow-y: auto;\n border: none;\n margin: 0;\n /* calc(padding + banner width offset) */\n padding: calc(var(--size-gap-double) + var(--size-gap-half))\n var(--size-gap-double);\n height: 100%;\n display: flex;\n flex-direction: column;\n }\n [data-nextjs-dialog-content] > [data-nextjs-dialog-header] {\n flex-shrink: 0;\n margin-bottom: var(--size-gap-double);\n }\n [data-nextjs-dialog-content] > [data-nextjs-dialog-body] {\n position: relative;\n flex: 1 1 auto;\n }\n"
]);
_templateObject = function() {
return data;
};
return data;
}
const styles = (0, _nooptemplate.noop)(_templateObject());
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=styles.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../src/client/components/react-dev-overlay/internal/components/Dialog/styles.ts"],"names":["styles","css"],"mappings":";;;;+BA0FSA;;;eAAAA;;;;8BA1FmB;;;;;;;;;;AAE5B,MAAMA,aAASC,kBAAG"}

View File

@@ -0,0 +1,10 @@
import * as React from 'react';
export type LeftRightDialogHeaderProps = {
children?: React.ReactNode;
className?: string;
previous: (() => void) | null;
next: (() => void) | null;
close?: () => void;
};
declare const LeftRightDialogHeader: React.FC<LeftRightDialogHeaderProps>;
export { LeftRightDialogHeader };

View File

@@ -0,0 +1,151 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "LeftRightDialogHeader", {
enumerable: true,
get: function() {
return LeftRightDialogHeader;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _CloseIcon = require("../../icons/CloseIcon");
const LeftRightDialogHeader = function LeftRightDialogHeader(param) {
let { children, className, previous, next, close } = param;
const buttonLeft = _react.useRef(null);
const buttonRight = _react.useRef(null);
const buttonClose = _react.useRef(null);
const [nav, setNav] = _react.useState(null);
const onNav = _react.useCallback((el)=>{
setNav(el);
}, []);
_react.useEffect(()=>{
if (nav == null) {
return;
}
const root = nav.getRootNode();
const d = self.document;
function handler(e) {
if (e.key === "ArrowLeft") {
e.stopPropagation();
if (buttonLeft.current) {
buttonLeft.current.focus();
}
previous && previous();
} else if (e.key === "ArrowRight") {
e.stopPropagation();
if (buttonRight.current) {
buttonRight.current.focus();
}
next && next();
} else if (e.key === "Escape") {
e.stopPropagation();
if (root instanceof ShadowRoot) {
const a = root.activeElement;
if (a && a !== buttonClose.current && a instanceof HTMLElement) {
a.blur();
return;
}
}
if (close) {
close();
}
}
}
root.addEventListener("keydown", handler);
if (root !== d) {
d.addEventListener("keydown", handler);
}
return function() {
root.removeEventListener("keydown", handler);
if (root !== d) {
d.removeEventListener("keydown", handler);
}
};
}, [
close,
nav,
next,
previous
]);
// Unlock focus for browsers like Firefox, that break all user focus if the
// currently focused item becomes disabled.
_react.useEffect(()=>{
if (nav == null) {
return;
}
const root = nav.getRootNode();
// Always true, but we do this for TypeScript:
if (root instanceof ShadowRoot) {
const a = root.activeElement;
if (previous == null) {
if (buttonLeft.current && a === buttonLeft.current) {
buttonLeft.current.blur();
}
} else if (next == null) {
if (buttonRight.current && a === buttonRight.current) {
buttonRight.current.blur();
}
}
}
}, [
nav,
next,
previous
]);
return /*#__PURE__*/ _react.createElement("div", {
"data-nextjs-dialog-left-right": true,
className: className
}, /*#__PURE__*/ _react.createElement("nav", {
ref: onNav
}, /*#__PURE__*/ _react.createElement("button", {
ref: buttonLeft,
type: "button",
disabled: previous == null ? true : undefined,
"aria-disabled": previous == null ? true : undefined,
onClick: previous != null ? previous : undefined
}, /*#__PURE__*/ _react.createElement("svg", {
viewBox: "0 0 14 14",
fill: "none",
xmlns: "http://www.w3.org/2000/svg"
}, /*#__PURE__*/ _react.createElement("title", null, "previous"), /*#__PURE__*/ _react.createElement("path", {
d: "M6.99996 1.16666L1.16663 6.99999L6.99996 12.8333M12.8333 6.99999H1.99996H12.8333Z",
stroke: "currentColor",
strokeWidth: "2",
strokeLinecap: "round",
strokeLinejoin: "round"
}))), /*#__PURE__*/ _react.createElement("button", {
ref: buttonRight,
type: "button",
disabled: next == null ? true : undefined,
"aria-disabled": next == null ? true : undefined,
onClick: next != null ? next : undefined
}, /*#__PURE__*/ _react.createElement("svg", {
viewBox: "0 0 14 14",
fill: "none",
xmlns: "http://www.w3.org/2000/svg"
}, /*#__PURE__*/ _react.createElement("title", null, "next"), /*#__PURE__*/ _react.createElement("path", {
d: "M6.99996 1.16666L12.8333 6.99999L6.99996 12.8333M1.16663 6.99999H12H1.16663Z",
stroke: "currentColor",
strokeWidth: "2",
strokeLinecap: "round",
strokeLinejoin: "round"
}))), "\xa0", children), close ? /*#__PURE__*/ _react.createElement("button", {
"data-nextjs-errors-dialog-left-right-close-button": true,
ref: buttonClose,
type: "button",
onClick: close,
"aria-label": "Close"
}, /*#__PURE__*/ _react.createElement("span", {
"aria-hidden": "true"
}, /*#__PURE__*/ _react.createElement(_CloseIcon.CloseIcon, null))) : null);
};
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=LeftRightDialogHeader.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../src/client/components/react-dev-overlay/internal/components/LeftRightDialogHeader/LeftRightDialogHeader.tsx"],"names":["LeftRightDialogHeader","children","className","previous","next","close","buttonLeft","React","useRef","buttonRight","buttonClose","nav","setNav","useState","onNav","useCallback","el","useEffect","root","getRootNode","d","self","document","handler","e","key","stopPropagation","current","focus","ShadowRoot","a","activeElement","HTMLElement","blur","addEventListener","removeEventListener","div","data-nextjs-dialog-left-right","ref","button","type","disabled","undefined","aria-disabled","onClick","svg","viewBox","fill","xmlns","title","path","stroke","strokeWidth","strokeLinecap","strokeLinejoin","data-nextjs-errors-dialog-left-right-close-button","aria-label","span","aria-hidden","CloseIcon"],"mappings":";;;;+BAwKSA;;;eAAAA;;;;iEAxKc;2BACG;AAU1B,MAAMA,wBACJ,SAASA,sBAAsB,KAM9B;IAN8B,IAAA,EAC7BC,QAAQ,EACRC,SAAS,EACTC,QAAQ,EACRC,IAAI,EACJC,KAAK,EACN,GAN8B;IAO7B,MAAMC,aAAaC,OAAMC,MAAM,CAA2B;IAC1D,MAAMC,cAAcF,OAAMC,MAAM,CAA2B;IAC3D,MAAME,cAAcH,OAAMC,MAAM,CAA2B;IAE3D,MAAM,CAACG,KAAKC,OAAO,GAAGL,OAAMM,QAAQ,CAAqB;IACzD,MAAMC,QAAQP,OAAMQ,WAAW,CAAC,CAACC;QAC/BJ,OAAOI;IACT,GAAG,EAAE;IAELT,OAAMU,SAAS,CAAC;QACd,IAAIN,OAAO,MAAM;YACf;QACF;QAEA,MAAMO,OAAOP,IAAIQ,WAAW;QAC5B,MAAMC,IAAIC,KAAKC,QAAQ;QAEvB,SAASC,QAAQC,CAAgB;YAC/B,IAAIA,EAAEC,GAAG,KAAK,aAAa;gBACzBD,EAAEE,eAAe;gBACjB,IAAIpB,WAAWqB,OAAO,EAAE;oBACtBrB,WAAWqB,OAAO,CAACC,KAAK;gBAC1B;gBACAzB,YAAYA;YACd,OAAO,IAAIqB,EAAEC,GAAG,KAAK,cAAc;gBACjCD,EAAEE,eAAe;gBACjB,IAAIjB,YAAYkB,OAAO,EAAE;oBACvBlB,YAAYkB,OAAO,CAACC,KAAK;gBAC3B;gBACAxB,QAAQA;YACV,OAAO,IAAIoB,EAAEC,GAAG,KAAK,UAAU;gBAC7BD,EAAEE,eAAe;gBACjB,IAAIR,gBAAgBW,YAAY;oBAC9B,MAAMC,IAAIZ,KAAKa,aAAa;oBAC5B,IAAID,KAAKA,MAAMpB,YAAYiB,OAAO,IAAIG,aAAaE,aAAa;wBAC9DF,EAAEG,IAAI;wBACN;oBACF;gBACF;gBAEA,IAAI5B,OAAO;oBACTA;gBACF;YACF;QACF;QAEAa,KAAKgB,gBAAgB,CAAC,WAAWX;QACjC,IAAIL,SAASE,GAAG;YACdA,EAAEc,gBAAgB,CAAC,WAAWX;QAChC;QACA,OAAO;YACLL,KAAKiB,mBAAmB,CAAC,WAAWZ;YACpC,IAAIL,SAASE,GAAG;gBACdA,EAAEe,mBAAmB,CAAC,WAAWZ;YACnC;QACF;IACF,GAAG;QAAClB;QAAOM;QAAKP;QAAMD;KAAS;IAE/B,2EAA2E;IAC3E,2CAA2C;IAC3CI,OAAMU,SAAS,CAAC;QACd,IAAIN,OAAO,MAAM;YACf;QACF;QAEA,MAAMO,OAAOP,IAAIQ,WAAW;QAC5B,8CAA8C;QAC9C,IAAID,gBAAgBW,YAAY;YAC9B,MAAMC,IAAIZ,KAAKa,aAAa;YAE5B,IAAI5B,YAAY,MAAM;gBACpB,IAAIG,WAAWqB,OAAO,IAAIG,MAAMxB,WAAWqB,OAAO,EAAE;oBAClDrB,WAAWqB,OAAO,CAACM,IAAI;gBACzB;YACF,OAAO,IAAI7B,QAAQ,MAAM;gBACvB,IAAIK,YAAYkB,OAAO,IAAIG,MAAMrB,YAAYkB,OAAO,EAAE;oBACpDlB,YAAYkB,OAAO,CAACM,IAAI;gBAC1B;YACF;QACF;IACF,GAAG;QAACtB;QAAKP;QAAMD;KAAS;IAExB,qBACE,qBAACiC;QAAIC,iCAAAA;QAA8BnC,WAAWA;qBAC5C,qBAACS;QAAI2B,KAAKxB;qBACR,qBAACyB;QACCD,KAAKhC;QACLkC,MAAK;QACLC,UAAUtC,YAAY,OAAO,OAAOuC;QACpCC,iBAAexC,YAAY,OAAO,OAAOuC;QACzCE,SAASzC,mBAAAA,WAAYuC;qBAErB,qBAACG;QACCC,SAAQ;QACRC,MAAK;QACLC,OAAM;qBAEN,qBAACC,eAAM,2BACP,qBAACC;QACC9B,GAAE;QACF+B,QAAO;QACPC,aAAY;QACZC,eAAc;QACdC,gBAAe;wBAIrB,qBAACf;QACCD,KAAK7B;QACL+B,MAAK;QACLC,UAAUrC,QAAQ,OAAO,OAAOsC;QAChCC,iBAAevC,QAAQ,OAAO,OAAOsC;QACrCE,SAASxC,eAAAA,OAAQsC;qBAEjB,qBAACG;QACCC,SAAQ;QACRC,MAAK;QACLC,OAAM;qBAEN,qBAACC,eAAM,uBACP,qBAACC;QACC9B,GAAE;QACF+B,QAAO;QACPC,aAAY;QACZC,eAAc;QACdC,gBAAe;UAGZ,QAERrD,WAEFI,sBACC,qBAACkC;QACCgB,qDAAAA;QACAjB,KAAK5B;QACL8B,MAAK;QACLI,SAASvC;QACTmD,cAAW;qBAEX,qBAACC;QAAKC,eAAY;qBAChB,qBAACC,oBAAS,YAGZ;AAGV"}

View File

@@ -0,0 +1,2 @@
export { LeftRightDialogHeader } from './LeftRightDialogHeader';
export { styles } from './styles';

View File

@@ -0,0 +1,32 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
LeftRightDialogHeader: null,
styles: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
LeftRightDialogHeader: function() {
return _LeftRightDialogHeader.LeftRightDialogHeader;
},
styles: function() {
return _styles.styles;
}
});
const _LeftRightDialogHeader = require("./LeftRightDialogHeader");
const _styles = require("./styles");
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../src/client/components/react-dev-overlay/internal/components/LeftRightDialogHeader/index.ts"],"names":["LeftRightDialogHeader","styles"],"mappings":";;;;;;;;;;;;;;;IAASA,qBAAqB;eAArBA,4CAAqB;;IACrBC,MAAM;eAANA,cAAM;;;uCADuB;wBACf"}

View File

@@ -0,0 +1,2 @@
declare const styles: string;
export { styles };

View File

@@ -0,0 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "styles", {
enumerable: true,
get: function() {
return styles;
}
});
const _tagged_template_literal_loose = require("@swc/helpers/_/_tagged_template_literal_loose");
const _nooptemplate = require("../../helpers/noop-template");
function _templateObject() {
const data = _tagged_template_literal_loose._([
"\n [data-nextjs-dialog-left-right] {\n display: flex;\n flex-direction: row;\n align-content: center;\n align-items: center;\n justify-content: space-between;\n }\n [data-nextjs-dialog-left-right] > nav {\n flex: 1;\n display: flex;\n align-items: center;\n margin-right: var(--size-gap);\n }\n [data-nextjs-dialog-left-right] > nav > button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n\n width: calc(var(--size-gap-double) + var(--size-gap));\n height: calc(var(--size-gap-double) + var(--size-gap));\n font-size: 0;\n border: none;\n background-color: rgba(255, 85, 85, 0.1);\n color: var(--color-ansi-red);\n cursor: pointer;\n transition: background-color 0.25s ease;\n }\n [data-nextjs-dialog-left-right] > nav > button > svg {\n width: auto;\n height: calc(var(--size-gap) + var(--size-gap-half));\n }\n [data-nextjs-dialog-left-right] > nav > button:hover {\n background-color: rgba(255, 85, 85, 0.2);\n }\n [data-nextjs-dialog-left-right] > nav > button:disabled {\n background-color: rgba(255, 85, 85, 0.1);\n color: rgba(255, 85, 85, 0.4);\n cursor: not-allowed;\n }\n\n [data-nextjs-dialog-left-right] > nav > button:first-of-type {\n border-radius: var(--size-gap-half) 0 0 var(--size-gap-half);\n margin-right: 1px;\n }\n [data-nextjs-dialog-left-right] > nav > button:last-of-type {\n border-radius: 0 var(--size-gap-half) var(--size-gap-half) 0;\n }\n\n [data-nextjs-dialog-left-right] > button:last-of-type {\n border: 0;\n padding: 0;\n\n background-color: transparent;\n appearance: none;\n\n opacity: 0.4;\n transition: opacity 0.25s ease;\n }\n [data-nextjs-dialog-left-right] > button:last-of-type:hover {\n opacity: 0.7;\n }\n"
]);
_templateObject = function() {
return data;
};
return data;
}
const styles = (0, _nooptemplate.noop)(_templateObject());
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=styles.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../src/client/components/react-dev-overlay/internal/components/LeftRightDialogHeader/styles.ts"],"names":["styles","css"],"mappings":";;;;+BAkESA;;;eAAAA;;;;8BAlEmB;;;;;;;;;;AAE5B,MAAMA,aAASC,kBAAG"}

View File

@@ -0,0 +1,8 @@
import * as React from 'react';
export type OverlayProps = {
children?: React.ReactNode;
className?: string;
fixed?: boolean;
};
declare const Overlay: React.FC<OverlayProps>;
export { Overlay };

View File

@@ -0,0 +1,58 @@
// @ts-ignore
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "Overlay", {
enumerable: true,
get: function() {
return Overlay;
}
});
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _maintaintabfocus = /*#__PURE__*/ _interop_require_default._(require("./maintain--tab-focus"));
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _bodylocker = require("./body-locker");
const Overlay = function Overlay(param) {
let { className, children, fixed } = param;
_react.useEffect(()=>{
(0, _bodylocker.lock)();
return ()=>{
(0, _bodylocker.unlock)();
};
}, []);
const [overlay, setOverlay] = _react.useState(null);
const onOverlay = _react.useCallback((el)=>{
setOverlay(el);
}, []);
_react.useEffect(()=>{
if (overlay == null) {
return;
}
const handle2 = (0, _maintaintabfocus.default)({
context: overlay
});
return ()=>{
handle2.disengage();
};
}, [
overlay
]);
return /*#__PURE__*/ _react.createElement("div", {
"data-nextjs-dialog-overlay": true,
className: className,
ref: onOverlay
}, /*#__PURE__*/ _react.createElement("div", {
"data-nextjs-dialog-backdrop": true,
"data-nextjs-dialog-backdrop-fixed": fixed ? true : undefined
}), children);
};
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=Overlay.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../src/client/components/react-dev-overlay/internal/components/Overlay/Overlay.tsx"],"names":["Overlay","className","children","fixed","React","useEffect","lock","unlock","overlay","setOverlay","useState","onOverlay","useCallback","el","handle2","allyTrap","context","disengage","div","data-nextjs-dialog-overlay","ref","data-nextjs-dialog-backdrop","data-nextjs-dialog-backdrop-fixed","undefined"],"mappings":"AAAA,aAAa;;;;;+BAkDJA;;;eAAAA;;;;;2EAjDY;iEACE;4BACM;AAQ7B,MAAMA,UAAkC,SAASA,QAAQ,KAIxD;IAJwD,IAAA,EACvDC,SAAS,EACTC,QAAQ,EACRC,KAAK,EACN,GAJwD;IAKvDC,OAAMC,SAAS,CAAC;QACdC,IAAAA,gBAAI;QACJ,OAAO;YACLC,IAAAA,kBAAM;QACR;IACF,GAAG,EAAE;IAEL,MAAM,CAACC,SAASC,WAAW,GAAGL,OAAMM,QAAQ,CAAwB;IACpE,MAAMC,YAAYP,OAAMQ,WAAW,CAAC,CAACC;QACnCJ,WAAWI;IACb,GAAG,EAAE;IAELT,OAAMC,SAAS,CAAC;QACd,IAAIG,WAAW,MAAM;YACnB;QACF;QAEA,MAAMM,UAAUC,IAAAA,yBAAQ,EAAC;YAAEC,SAASR;QAAQ;QAC5C,OAAO;YACLM,QAAQG,SAAS;QACnB;IACF,GAAG;QAACT;KAAQ;IAEZ,qBACE,qBAACU;QAAIC,8BAAAA;QAA2BlB,WAAWA;QAAWmB,KAAKT;qBACzD,qBAACO;QACCG,+BAAAA;QACAC,qCAAmCnB,QAAQ,OAAOoB;QAEnDrB;AAGP"}

View File

@@ -0,0 +1,2 @@
export declare function lock(): void;
export declare function unlock(): void;

View File

@@ -0,0 +1,62 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
lock: null,
unlock: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
lock: function() {
return lock;
},
unlock: function() {
return unlock;
}
});
let previousBodyPaddingRight;
let previousBodyOverflowSetting;
let activeLocks = 0;
function lock() {
setTimeout(()=>{
if (activeLocks++ > 0) {
return;
}
const scrollBarGap = window.innerWidth - document.documentElement.clientWidth;
if (scrollBarGap > 0) {
previousBodyPaddingRight = document.body.style.paddingRight;
document.body.style.paddingRight = "" + scrollBarGap + "px";
}
previousBodyOverflowSetting = document.body.style.overflow;
document.body.style.overflow = "hidden";
});
}
function unlock() {
setTimeout(()=>{
if (activeLocks === 0 || --activeLocks !== 0) {
return;
}
if (previousBodyPaddingRight !== undefined) {
document.body.style.paddingRight = previousBodyPaddingRight;
previousBodyPaddingRight = undefined;
}
if (previousBodyOverflowSetting !== undefined) {
document.body.style.overflow = previousBodyOverflowSetting;
previousBodyOverflowSetting = undefined;
}
});
}
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=body-locker.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../src/client/components/react-dev-overlay/internal/components/Overlay/body-locker.ts"],"names":["lock","unlock","previousBodyPaddingRight","previousBodyOverflowSetting","activeLocks","setTimeout","scrollBarGap","window","innerWidth","document","documentElement","clientWidth","body","style","paddingRight","overflow","undefined"],"mappings":";;;;;;;;;;;;;;;IAKgBA,IAAI;eAAJA;;IAmBAC,MAAM;eAANA;;;AAxBhB,IAAIC;AACJ,IAAIC;AAEJ,IAAIC,cAAc;AAEX,SAASJ;IACdK,WAAW;QACT,IAAID,gBAAgB,GAAG;YACrB;QACF;QAEA,MAAME,eACJC,OAAOC,UAAU,GAAGC,SAASC,eAAe,CAACC,WAAW;QAE1D,IAAIL,eAAe,GAAG;YACpBJ,2BAA2BO,SAASG,IAAI,CAACC,KAAK,CAACC,YAAY;YAC3DL,SAASG,IAAI,CAACC,KAAK,CAACC,YAAY,GAAG,AAAC,KAAER,eAAa;QACrD;QAEAH,8BAA8BM,SAASG,IAAI,CAACC,KAAK,CAACE,QAAQ;QAC1DN,SAASG,IAAI,CAACC,KAAK,CAACE,QAAQ,GAAG;IACjC;AACF;AAEO,SAASd;IACdI,WAAW;QACT,IAAID,gBAAgB,KAAK,EAAEA,gBAAgB,GAAG;YAC5C;QACF;QAEA,IAAIF,6BAA6Bc,WAAW;YAC1CP,SAASG,IAAI,CAACC,KAAK,CAACC,YAAY,GAAGZ;YACnCA,2BAA2Bc;QAC7B;QAEA,IAAIb,gCAAgCa,WAAW;YAC7CP,SAASG,IAAI,CAACC,KAAK,CAACE,QAAQ,GAAGZ;YAC/BA,8BAA8Ba;QAChC;IACF;AACF"}

View File

@@ -0,0 +1 @@
export { Overlay } from './Overlay';

View File

@@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "Overlay", {
enumerable: true,
get: function() {
return _Overlay.Overlay;
}
});
const _Overlay = require("./Overlay");
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../src/client/components/react-dev-overlay/internal/components/Overlay/index.tsx"],"names":["Overlay"],"mappings":";;;;+BAASA;;;eAAAA,gBAAO;;;yBAAQ"}

View File

@@ -0,0 +1,5 @@
export default function ({ context }?: {
context: any;
}): {
disengage: () => void;
};

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
declare const styles: string;
export { styles };

View File

@@ -0,0 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "styles", {
enumerable: true,
get: function() {
return styles;
}
});
const _tagged_template_literal_loose = require("@swc/helpers/_/_tagged_template_literal_loose");
const _nooptemplate = require("../../helpers/noop-template");
function _templateObject() {
const data = _tagged_template_literal_loose._([
"\n [data-nextjs-dialog-overlay] {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n overflow: auto;\n z-index: 9000;\n\n display: flex;\n align-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10vh 15px 0;\n }\n\n @media (max-height: 812px) {\n [data-nextjs-dialog-overlay] {\n padding: 15px 15px 0;\n }\n }\n\n [data-nextjs-dialog-backdrop] {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n background-color: rgba(17, 17, 17, 0.2);\n pointer-events: all;\n z-index: -1;\n }\n\n [data-nextjs-dialog-backdrop-fixed] {\n cursor: not-allowed;\n -webkit-backdrop-filter: blur(8px);\n backdrop-filter: blur(8px);\n }\n"
]);
_templateObject = function() {
return data;
};
return data;
}
const styles = (0, _nooptemplate.noop)(_templateObject());
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=styles.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../src/client/components/react-dev-overlay/internal/components/Overlay/styles.tsx"],"names":["styles","css"],"mappings":";;;;+BA2CSA;;;eAAAA;;;;8BA3CmB;;;;;;;;;;AAE5B,MAAMA,aAASC,kBAAG"}

View File

@@ -0,0 +1,4 @@
import * as React from 'react';
export declare function ShadowPortal({ children }: {
children: React.ReactNode;
}): React.ReactPortal | null;

View File

@@ -0,0 +1,42 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "ShadowPortal", {
enumerable: true,
get: function() {
return ShadowPortal;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _reactdom = require("react-dom");
function ShadowPortal(param) {
let { children } = param;
let portalNode = _react.useRef(null);
let shadowNode = _react.useRef(null);
let [, forceUpdate] = _react.useState();
_react.useLayoutEffect(()=>{
const ownerDocument = document;
portalNode.current = ownerDocument.createElement("nextjs-portal");
shadowNode.current = portalNode.current.attachShadow({
mode: "open"
});
ownerDocument.body.appendChild(portalNode.current);
forceUpdate({});
return ()=>{
if (portalNode.current && portalNode.current.ownerDocument) {
portalNode.current.ownerDocument.body.removeChild(portalNode.current);
}
};
}, []);
return shadowNode.current ? /*#__PURE__*/ (0, _reactdom.createPortal)(children, shadowNode.current) : null;
}
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=ShadowPortal.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../src/client/components/react-dev-overlay/internal/components/ShadowPortal.tsx"],"names":["ShadowPortal","children","portalNode","React","useRef","shadowNode","forceUpdate","useState","useLayoutEffect","ownerDocument","document","current","createElement","attachShadow","mode","body","appendChild","removeChild","createPortal"],"mappings":";;;;+BAGgBA;;;eAAAA;;;;iEAHO;0BACM;AAEtB,SAASA,aAAa,KAA2C;IAA3C,IAAA,EAAEC,QAAQ,EAAiC,GAA3C;IAC3B,IAAIC,aAAaC,OAAMC,MAAM,CAAqB;IAClD,IAAIC,aAAaF,OAAMC,MAAM,CAAoB;IACjD,IAAI,GAAGE,YAAY,GAAGH,OAAMI,QAAQ;IAEpCJ,OAAMK,eAAe,CAAC;QACpB,MAAMC,gBAAgBC;QACtBR,WAAWS,OAAO,GAAGF,cAAcG,aAAa,CAAC;QACjDP,WAAWM,OAAO,GAAGT,WAAWS,OAAO,CAACE,YAAY,CAAC;YAAEC,MAAM;QAAO;QACpEL,cAAcM,IAAI,CAACC,WAAW,CAACd,WAAWS,OAAO;QACjDL,YAAY,CAAC;QACb,OAAO;YACL,IAAIJ,WAAWS,OAAO,IAAIT,WAAWS,OAAO,CAACF,aAAa,EAAE;gBAC1DP,WAAWS,OAAO,CAACF,aAAa,CAACM,IAAI,CAACE,WAAW,CAACf,WAAWS,OAAO;YACtE;QACF;IACF,GAAG,EAAE;IAEL,OAAON,WAAWM,OAAO,iBACrBO,IAAAA,sBAAY,EAACjB,UAAUI,WAAWM,OAAO,IACzC;AACN"}

View File

@@ -0,0 +1,11 @@
import React from 'react';
type EditorLinkProps = {
file: string;
isSourceFile: boolean;
location?: {
line: number;
column: number;
};
};
export declare function EditorLink({ file, isSourceFile, location }: EditorLinkProps): React.JSX.Element;
export {};

View File

@@ -0,0 +1,56 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "EditorLink", {
enumerable: true,
get: function() {
return EditorLink;
}
});
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
const _react = /*#__PURE__*/ _interop_require_default._(require("react"));
const _useopenineditor = require("../../helpers/use-open-in-editor");
function EditorLink(param) {
let { file, isSourceFile, location } = param;
var _location_line, _location_column;
const open = (0, _useopenineditor.useOpenInEditor)({
file,
lineNumber: (_location_line = location == null ? void 0 : location.line) != null ? _location_line : 1,
column: (_location_column = location == null ? void 0 : location.column) != null ? _location_column : 0
});
return /*#__PURE__*/ _react.default.createElement("div", {
"data-with-open-in-editor-link": true,
"data-with-open-in-editor-link-source-file": isSourceFile ? true : undefined,
"data-with-open-in-editor-link-import-trace": isSourceFile ? undefined : true,
tabIndex: 10,
role: "link",
onClick: open,
title: "Click to open in your editor"
}, file, location ? " (" + location.line + ":" + location.column + ")" : null, /*#__PURE__*/ _react.default.createElement("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
fill: "none",
stroke: "currentColor",
strokeWidth: "2",
strokeLinecap: "round",
strokeLinejoin: "round"
}, /*#__PURE__*/ _react.default.createElement("path", {
d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"
}), /*#__PURE__*/ _react.default.createElement("polyline", {
points: "15 3 21 3 21 9"
}), /*#__PURE__*/ _react.default.createElement("line", {
x1: "10",
y1: "14",
x2: "21",
y2: "3"
})));
}
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=EditorLink.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../src/client/components/react-dev-overlay/internal/components/Terminal/EditorLink.tsx"],"names":["EditorLink","file","isSourceFile","location","open","useOpenInEditor","lineNumber","line","column","div","data-with-open-in-editor-link","data-with-open-in-editor-link-source-file","undefined","data-with-open-in-editor-link-import-trace","tabIndex","role","onClick","title","svg","xmlns","viewBox","fill","stroke","strokeWidth","strokeLinecap","strokeLinejoin","path","d","polyline","points","x1","y1","x2","y2"],"mappings":";;;;+BAWgBA;;;eAAAA;;;;gEAXE;iCACc;AAUzB,SAASA,WAAW,KAAiD;IAAjD,IAAA,EAAEC,IAAI,EAAEC,YAAY,EAAEC,QAAQ,EAAmB,GAAjD;QAGXA,gBACJA;IAHV,MAAMC,OAAOC,IAAAA,gCAAe,EAAC;QAC3BJ;QACAK,YAAYH,CAAAA,iBAAAA,4BAAAA,SAAUI,IAAI,YAAdJ,iBAAkB;QAC9BK,QAAQL,CAAAA,mBAAAA,4BAAAA,SAAUK,MAAM,YAAhBL,mBAAoB;IAC9B;IAEA,qBACE,6BAACM;QACCC,iCAAAA;QACAC,6CACET,eAAe,OAAOU;QAExBC,8CACEX,eAAeU,YAAY;QAE7BE,UAAU;QACVC,MAAM;QACNC,SAASZ;QACTa,OAAO;OAENhB,MACAE,WAAW,AAAC,OAAIA,SAASI,IAAI,GAAC,MAAGJ,SAASK,MAAM,GAAC,MAAK,oBACvD,6BAACU;QACCC,OAAM;QACNC,SAAQ;QACRC,MAAK;QACLC,QAAO;QACPC,aAAY;QACZC,eAAc;QACdC,gBAAe;qBAEf,6BAACC;QAAKC,GAAE;sBACR,6BAACC;QAASC,QAAO;sBACjB,6BAACtB;QAAKuB,IAAG;QAAKC,IAAG;QAAKC,IAAG;QAAKC,IAAG;;AAIzC"}

View File

@@ -0,0 +1,5 @@
import * as React from 'react';
export type TerminalProps = {
content: string;
};
export declare const Terminal: React.FC<TerminalProps>;

View File

@@ -0,0 +1,100 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "Terminal", {
enumerable: true,
get: function() {
return Terminal;
}
});
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _anser = /*#__PURE__*/ _interop_require_default._(require("next/dist/compiled/anser"));
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _hotlinkedtext = require("../hot-linked-text");
const _EditorLink = require("./EditorLink");
function getFile(lines) {
const contentFileName = lines.shift();
if (!contentFileName) return null;
const [fileName, line, column] = contentFileName.split(":");
const parsedLine = Number(line);
const parsedColumn = Number(column);
const hasLocation = !Number.isNaN(parsedLine) && !Number.isNaN(parsedColumn);
return {
fileName: hasLocation ? fileName : contentFileName,
location: hasLocation ? {
line: parsedLine,
column: parsedColumn
} : undefined
};
}
function getImportTraceFiles(lines) {
if (lines.some((line)=>/ReactServerComponentsError:/.test(line)) || lines.some((line)=>/Import trace for requested module:/.test(line))) {
// Grab the lines at the end containing the files
const files = [];
while(/.+\..+/.test(lines[lines.length - 1]) && !lines[lines.length - 1].includes(":")){
const file = lines.pop().trim();
files.unshift(file);
}
return files;
}
return [];
}
function getEditorLinks(content) {
const lines = content.split("\n");
const file = getFile(lines);
const importTraceFiles = getImportTraceFiles(lines);
return {
file,
source: lines.join("\n"),
importTraceFiles
};
}
const Terminal = function Terminal(param) {
let { content } = param;
const { file, source, importTraceFiles } = _react.useMemo(()=>getEditorLinks(content), [
content
]);
const decoded = _react.useMemo(()=>{
return _anser.default.ansiToJson(source, {
json: true,
use_classes: true,
remove_empty: true
});
}, [
source
]);
return /*#__PURE__*/ _react.createElement("div", {
"data-nextjs-terminal": true
}, file && /*#__PURE__*/ _react.createElement(_EditorLink.EditorLink, {
isSourceFile: true,
key: file.fileName,
file: file.fileName,
location: file.location
}), /*#__PURE__*/ _react.createElement("pre", null, decoded.map((entry, index)=>/*#__PURE__*/ _react.createElement("span", {
key: "terminal-entry-" + index,
style: {
color: entry.fg ? "var(--color-" + entry.fg + ")" : undefined,
...entry.decoration === "bold" ? {
fontWeight: 800
} : entry.decoration === "italic" ? {
fontStyle: "italic"
} : undefined
}
}, /*#__PURE__*/ _react.createElement(_hotlinkedtext.HotlinkedText, {
text: entry.content
}))), importTraceFiles.map((importTraceFile)=>/*#__PURE__*/ _react.createElement(_EditorLink.EditorLink, {
isSourceFile: false,
key: importTraceFile,
file: importTraceFile
}))));
};
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=Terminal.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../src/client/components/react-dev-overlay/internal/components/Terminal/Terminal.tsx"],"names":["Terminal","getFile","lines","contentFileName","shift","fileName","line","column","split","parsedLine","Number","parsedColumn","hasLocation","isNaN","location","undefined","getImportTraceFiles","some","test","files","length","includes","file","pop","trim","unshift","getEditorLinks","content","importTraceFiles","source","join","React","useMemo","decoded","Anser","ansiToJson","json","use_classes","remove_empty","div","data-nextjs-terminal","EditorLink","isSourceFile","key","pre","map","entry","index","span","style","color","fg","decoration","fontWeight","fontStyle","HotlinkedText","text","importTraceFile"],"mappings":";;;;+BAwDaA;;;eAAAA;;;;;gEAxDK;iEACK;+BACO;4BACH;AAI3B,SAASC,QAAQC,KAAe;IAC9B,MAAMC,kBAAkBD,MAAME,KAAK;IACnC,IAAI,CAACD,iBAAiB,OAAO;IAC7B,MAAM,CAACE,UAAUC,MAAMC,OAAO,GAAGJ,gBAAgBK,KAAK,CAAC;IAEvD,MAAMC,aAAaC,OAAOJ;IAC1B,MAAMK,eAAeD,OAAOH;IAC5B,MAAMK,cAAc,CAACF,OAAOG,KAAK,CAACJ,eAAe,CAACC,OAAOG,KAAK,CAACF;IAE/D,OAAO;QACLN,UAAUO,cAAcP,WAAWF;QACnCW,UAAUF,cACN;YACEN,MAAMG;YACNF,QAAQI;QACV,IACAI;IACN;AACF;AAEA,SAASC,oBAAoBd,KAAe;IAC1C,IACEA,MAAMe,IAAI,CAAC,CAACX,OAAS,8BAA8BY,IAAI,CAACZ,UACxDJ,MAAMe,IAAI,CAAC,CAACX,OAAS,qCAAqCY,IAAI,CAACZ,QAC/D;QACA,iDAAiD;QACjD,MAAMa,QAAQ,EAAE;QAChB,MACE,SAASD,IAAI,CAAChB,KAAK,CAACA,MAAMkB,MAAM,GAAG,EAAE,KACrC,CAAClB,KAAK,CAACA,MAAMkB,MAAM,GAAG,EAAE,CAACC,QAAQ,CAAC,KAClC;YACA,MAAMC,OAAOpB,MAAMqB,GAAG,GAAIC,IAAI;YAC9BL,MAAMM,OAAO,CAACH;QAChB;QAEA,OAAOH;IACT;IAEA,OAAO,EAAE;AACX;AAEA,SAASO,eAAeC,OAAe;IACrC,MAAMzB,QAAQyB,QAAQnB,KAAK,CAAC;IAC5B,MAAMc,OAAOrB,QAAQC;IACrB,MAAM0B,mBAAmBZ,oBAAoBd;IAE7C,OAAO;QAAEoB;QAAMO,QAAQ3B,MAAM4B,IAAI,CAAC;QAAOF;IAAiB;AAC5D;AAEO,MAAM5B,WAAoC,SAASA,SAAS,KAElE;IAFkE,IAAA,EACjE2B,OAAO,EACR,GAFkE;IAGjE,MAAM,EAAEL,IAAI,EAAEO,MAAM,EAAED,gBAAgB,EAAE,GAAGG,OAAMC,OAAO,CACtD,IAAMN,eAAeC,UACrB;QAACA;KAAQ;IAGX,MAAMM,UAAUF,OAAMC,OAAO,CAAC;QAC5B,OAAOE,cAAK,CAACC,UAAU,CAACN,QAAQ;YAC9BO,MAAM;YACNC,aAAa;YACbC,cAAc;QAChB;IACF,GAAG;QAACT;KAAO;IAEX,qBACE,qBAACU;QAAIC,wBAAAA;OACFlB,sBACC,qBAACmB,sBAAU;QACTC,cAAAA;QACAC,KAAKrB,KAAKjB,QAAQ;QAClBiB,MAAMA,KAAKjB,QAAQ;QACnBS,UAAUQ,KAAKR,QAAQ;sBAG3B,qBAAC8B,aACEX,QAAQY,GAAG,CAAC,CAACC,OAAOC,sBACnB,qBAACC;YACCL,KAAK,AAAC,oBAAiBI;YACvBE,OAAO;gBACLC,OAAOJ,MAAMK,EAAE,GAAG,AAAC,iBAAcL,MAAMK,EAAE,GAAC,MAAKpC;gBAC/C,GAAI+B,MAAMM,UAAU,KAAK,SACrB;oBAAEC,YAAY;gBAAI,IAClBP,MAAMM,UAAU,KAAK,WACrB;oBAAEE,WAAW;gBAAS,IACtBvC,SAAS;YACf;yBAEA,qBAACwC,4BAAa;YAACC,MAAMV,MAAMnB,OAAO;cAGrCC,iBAAiBiB,GAAG,CAAC,CAACY,gCACrB,qBAAChB,sBAAU;YACTC,cAAc;YACdC,KAAKc;YACLnC,MAAMmC;;AAMlB"}

View File

@@ -0,0 +1 @@
export { Terminal } from './Terminal';

View File

@@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "Terminal", {
enumerable: true,
get: function() {
return _Terminal.Terminal;
}
});
const _Terminal = require("./Terminal");
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../src/client/components/react-dev-overlay/internal/components/Terminal/index.tsx"],"names":["Terminal"],"mappings":";;;;+BAASA;;;eAAAA,kBAAQ;;;0BAAQ"}

View File

@@ -0,0 +1,2 @@
declare const styles: string;
export { styles };

View File

@@ -0,0 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "styles", {
enumerable: true,
get: function() {
return styles;
}
});
const _tagged_template_literal_loose = require("@swc/helpers/_/_tagged_template_literal_loose");
const _nooptemplate = require("../../helpers/noop-template");
function _templateObject() {
const data = _tagged_template_literal_loose._([
"\n [data-nextjs-terminal] {\n border-radius: var(--size-gap-half);\n background-color: var(--color-ansi-bg);\n color: var(--color-ansi-fg);\n }\n [data-nextjs-terminal]::selection,\n [data-nextjs-terminal] *::selection {\n background-color: var(--color-ansi-selection);\n }\n [data-nextjs-terminal] * {\n color: inherit;\n background-color: transparent;\n font-family: var(--font-stack-monospace);\n }\n [data-nextjs-terminal] > * {\n margin: 0;\n padding: calc(var(--size-gap) + var(--size-gap-half))\n calc(var(--size-gap-double) + var(--size-gap-half));\n }\n\n [data-nextjs-terminal] pre {\n white-space: pre-wrap;\n word-break: break-word;\n }\n\n [data-with-open-in-editor-link] svg {\n width: auto;\n height: var(--size-font-small);\n margin-left: var(--size-gap);\n }\n [data-with-open-in-editor-link] {\n cursor: pointer;\n }\n [data-with-open-in-editor-link]:hover {\n text-decoration: underline dotted;\n }\n [data-with-open-in-editor-link-source-file] {\n border-bottom: 1px solid var(--color-ansi-bright-black);\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n [data-with-open-in-editor-link-import-trace] {\n margin-left: var(--size-gap-double);\n }\n [data-nextjs-terminal] a {\n color: inherit;\n }\n"
]);
_templateObject = function() {
return data;
};
return data;
}
const styles = (0, _nooptemplate.noop)(_templateObject());
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=styles.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../src/client/components/react-dev-overlay/internal/components/Terminal/styles.tsx"],"names":["styles","css"],"mappings":";;;;+BAqDSA;;;eAAAA;;;;8BArDmB;;;;;;;;;;AAE5B,MAAMA,aAASC,kBAAG"}

View File

@@ -0,0 +1,7 @@
import * as React from 'react';
export type ToastProps = {
children?: React.ReactNode;
onClick?: (ev: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
className?: string;
};
export declare const Toast: React.FC<ToastProps>;

View File

@@ -0,0 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "Toast", {
enumerable: true,
get: function() {
return Toast;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const Toast = function Toast(param) {
let { onClick, children, className } = param;
return /*#__PURE__*/ _react.createElement("div", {
"data-nextjs-toast": true,
onClick: onClick,
className: className
}, /*#__PURE__*/ _react.createElement("div", {
"data-nextjs-toast-wrapper": true
}, children));
};
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=Toast.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../src/client/components/react-dev-overlay/internal/components/Toast/Toast.tsx"],"names":["Toast","onClick","children","className","div","data-nextjs-toast","data-nextjs-toast-wrapper"],"mappings":";;;;+BAQaA;;;eAAAA;;;;iEARU;AAQhB,MAAMA,QAA8B,SAASA,MAAM,KAIzD;IAJyD,IAAA,EACxDC,OAAO,EACPC,QAAQ,EACRC,SAAS,EACV,GAJyD;IAKxD,qBACE,qBAACC;QAAIC,qBAAAA;QAAkBJ,SAASA;QAASE,WAAWA;qBAClD,qBAACC;QAAIE,6BAAAA;OAA2BJ;AAGtC"}

View File

@@ -0,0 +1,2 @@
export { styles } from './styles';
export { Toast } from './Toast';

View File

@@ -0,0 +1,32 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
styles: null,
Toast: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
styles: function() {
return _styles.styles;
},
Toast: function() {
return _Toast.Toast;
}
});
const _styles = require("./styles");
const _Toast = require("./Toast");
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../src/client/components/react-dev-overlay/internal/components/Toast/index.tsx"],"names":["styles","Toast"],"mappings":";;;;;;;;;;;;;;;IAASA,MAAM;eAANA,cAAM;;IACNC,KAAK;eAALA,YAAK;;;wBADS;uBACD"}

View File

@@ -0,0 +1,2 @@
declare const styles: string;
export { styles };

View File

@@ -0,0 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "styles", {
enumerable: true,
get: function() {
return styles;
}
});
const _tagged_template_literal_loose = require("@swc/helpers/_/_tagged_template_literal_loose");
const _nooptemplate = require("../../helpers/noop-template");
function _templateObject() {
const data = _tagged_template_literal_loose._([
"\n [data-nextjs-toast] {\n position: fixed;\n bottom: var(--size-gap-double);\n left: var(--size-gap-double);\n max-width: 420px;\n z-index: 9000;\n }\n\n @media (max-width: 440px) {\n [data-nextjs-toast] {\n max-width: 90vw;\n left: 5vw;\n }\n }\n\n [data-nextjs-toast-wrapper] {\n padding: 16px;\n border-radius: var(--size-gap-half);\n font-weight: 500;\n color: var(--color-ansi-bright-white);\n background-color: var(--color-ansi-red);\n box-shadow: 0px var(--size-gap-double) var(--size-gap-quad)\n rgba(0, 0, 0, 0.25);\n }\n"
]);
_templateObject = function() {
return data;
};
return data;
}
const styles = (0, _nooptemplate.noop)(_templateObject());
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=styles.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../src/client/components/react-dev-overlay/internal/components/Toast/styles.ts"],"names":["styles","css"],"mappings":";;;;+BA6BSA;;;eAAAA;;;;8BA7BmB;;;;;;;;;;AAE5B,MAAMA,aAASC,kBAAG"}

View File

@@ -0,0 +1,3 @@
import React from 'react';
import type { VersionInfo } from '../../../../../../server/dev/parse-version-info';
export declare function VersionStalenessInfo(props: VersionInfo): React.JSX.Element | null;

View File

@@ -0,0 +1,72 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "VersionStalenessInfo", {
enumerable: true,
get: function() {
return VersionStalenessInfo;
}
});
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
const _react = /*#__PURE__*/ _interop_require_default._(require("react"));
function VersionStalenessInfo(props) {
if (!props) return null;
const { staleness, installed, expected } = props;
let text = "";
let title = "";
let indicatorClass = "";
switch(staleness){
case "fresh":
text = "Next.js is up to date";
title = "Latest available version is detected (" + installed + ").";
indicatorClass = "fresh";
break;
case "stale-patch":
case "stale-minor":
text = "Next.js (" + installed + ") out of date";
title = "There is a newer version (" + expected + ") available, upgrade recommended! ";
indicatorClass = "stale";
break;
case "stale-major":
{
text = "Next.js (" + installed + ") is outdated";
title = "An outdated version detected (latest is " + expected + "), upgrade is highly recommended!";
indicatorClass = "outdated";
break;
}
case "stale-prerelease":
{
text = "Next.js (" + installed + ") is outdated";
title = "There is a newer canary version (" + expected + ") available, please upgrade! ";
indicatorClass = "stale";
break;
}
case "newer-than-npm":
case "unknown":
break;
default:
break;
}
if (!text) return null;
return /*#__PURE__*/ _react.default.createElement("small", {
className: "nextjs-container-build-error-version-status"
}, /*#__PURE__*/ _react.default.createElement("span", {
className: indicatorClass
}), /*#__PURE__*/ _react.default.createElement("small", {
className: "nextjs-container-build-error-version-status",
title: title
}, text), " ", staleness === "fresh" || staleness === "unknown" ? null : /*#__PURE__*/ _react.default.createElement("a", {
target: "_blank",
rel: "noopener noreferrer",
href: "https://nextjs.org/docs/messages/version-staleness"
}, "(learn more)"));
}
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=VersionStalenessInfo.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../src/client/components/react-dev-overlay/internal/components/VersionStalenessInfo/VersionStalenessInfo.tsx"],"names":["VersionStalenessInfo","props","staleness","installed","expected","text","title","indicatorClass","small","className","span","a","target","rel","href"],"mappings":";;;;+BAGgBA;;;eAAAA;;;;gEAHE;AAGX,SAASA,qBAAqBC,KAAkB;IACrD,IAAI,CAACA,OAAO,OAAO;IACnB,MAAM,EAAEC,SAAS,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGH;IAC3C,IAAII,OAAO;IACX,IAAIC,QAAQ;IACZ,IAAIC,iBAAiB;IACrB,OAAQL;QACN,KAAK;YACHG,OAAO;YACPC,QAAQ,AAAC,2CAAwCH,YAAU;YAC3DI,iBAAiB;YACjB;QACF,KAAK;QACL,KAAK;YACHF,OAAO,AAAC,cAAWF,YAAU;YAC7BG,QAAQ,AAAC,+BAA4BF,WAAS;YAC9CG,iBAAiB;YACjB;QACF,KAAK;YAAe;gBAClBF,OAAO,AAAC,cAAWF,YAAU;gBAC7BG,QAAQ,AAAC,6CAA0CF,WAAS;gBAC5DG,iBAAiB;gBACjB;YACF;QACA,KAAK;YAAoB;gBACvBF,OAAO,AAAC,cAAWF,YAAU;gBAC7BG,QAAQ,AAAC,sCAAmCF,WAAS;gBACrDG,iBAAiB;gBACjB;YACF;QACA,KAAK;QACL,KAAK;YACH;QACF;YACE;IACJ;IAEA,IAAI,CAACF,MAAM,OAAO;IAElB,qBACE,6BAACG;QAAMC,WAAU;qBACf,6BAACC;QAAKD,WAAWF;sBACjB,6BAACC;QACCC,WAAU;QACVH,OAAOA;OAEND,OACM,KACRH,cAAc,WAAWA,cAAc,YAAY,qBAClD,6BAACS;QACCC,QAAO;QACPC,KAAI;QACJC,MAAK;OACN;AAMT"}

View File

@@ -0,0 +1,2 @@
export { styles } from './styles';
export { VersionStalenessInfo } from './VersionStalenessInfo';

View File

@@ -0,0 +1,32 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
styles: null,
VersionStalenessInfo: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
styles: function() {
return _styles.styles;
},
VersionStalenessInfo: function() {
return _VersionStalenessInfo.VersionStalenessInfo;
}
});
const _styles = require("./styles");
const _VersionStalenessInfo = require("./VersionStalenessInfo");
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../src/client/components/react-dev-overlay/internal/components/VersionStalenessInfo/index.tsx"],"names":["styles","VersionStalenessInfo"],"mappings":";;;;;;;;;;;;;;;IAASA,MAAM;eAANA,cAAM;;IACNC,oBAAoB;eAApBA,0CAAoB;;;wBADN;sCACc"}

View File

@@ -0,0 +1,2 @@
declare const styles: string;
export { styles };

View File

@@ -0,0 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "styles", {
enumerable: true,
get: function() {
return styles;
}
});
const _tagged_template_literal_loose = require("@swc/helpers/_/_tagged_template_literal_loose");
const _nooptemplate = require("../../helpers/noop-template");
function _templateObject() {
const data = _tagged_template_literal_loose._([
"\n .nextjs-container-build-error-version-status {\n flex: 1;\n text-align: right;\n }\n .nextjs-container-build-error-version-status small {\n margin-left: var(--size-gap);\n font-size: var(--size-font-small);\n }\n .nextjs-container-build-error-version-status a {\n font-size: var(--size-font-small);\n }\n .nextjs-container-build-error-version-status span {\n display: inline-block;\n width: 10px;\n height: 10px;\n border-radius: 5px;\n background: var(--color-ansi-bright-black);\n }\n .nextjs-container-build-error-version-status span.fresh {\n background: var(--color-ansi-green);\n }\n .nextjs-container-build-error-version-status span.stale {\n background: var(--color-ansi-yellow);\n }\n .nextjs-container-build-error-version-status span.outdated {\n background: var(--color-ansi-red);\n }\n"
]);
_templateObject = function() {
return data;
};
return data;
}
const styles = (0, _nooptemplate.noop)(_templateObject());
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=styles.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../src/client/components/react-dev-overlay/internal/components/VersionStalenessInfo/styles.ts"],"names":["styles","css"],"mappings":";;;;+BAgCSA;;;eAAAA;;;;8BAhCmB;;;;;;;;;;AAE5B,MAAMA,aAASC,kBAAG"}

View File

@@ -0,0 +1,6 @@
/**
* Get sequences of words and whitespaces from a string.
*
* e.g. "Hello world \n\n" -> ["Hello", " ", "world", " \n\n"]
*/
export declare function getWordsAndWhitespaces(text: string): string[];

View File

@@ -0,0 +1,46 @@
// Returns true if the given character is a whitespace character, false otherwise.
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "getWordsAndWhitespaces", {
enumerable: true,
get: function() {
return getWordsAndWhitespaces;
}
});
function isWhitespace(char) {
return char === " " || char === "\n" || char === " " || char === "\r";
}
function getWordsAndWhitespaces(text) {
const wordsAndWhitespaces = [];
let current = "";
let currentIsWhitespace = false;
for (const char of text){
if (current.length === 0) {
current += char;
currentIsWhitespace = isWhitespace(char);
continue;
}
const nextIsWhitespace = isWhitespace(char);
if (currentIsWhitespace === nextIsWhitespace) {
current += char;
} else {
wordsAndWhitespaces.push(current);
current = char;
currentIsWhitespace = nextIsWhitespace;
}
}
if (current.length > 0) {
wordsAndWhitespaces.push(current);
}
return wordsAndWhitespaces;
}
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=get-words-and-whitespaces.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../src/client/components/react-dev-overlay/internal/components/hot-linked-text/get-words-and-whitespaces.ts"],"names":["getWordsAndWhitespaces","isWhitespace","char","text","wordsAndWhitespaces","current","currentIsWhitespace","length","nextIsWhitespace","push"],"mappings":"AAAA,kFAAkF;;;;;+BAUlEA;;;eAAAA;;;AAThB,SAASC,aAAaC,IAAY;IAChC,OAAOA,SAAS,OAAOA,SAAS,QAAQA,SAAS,OAAQA,SAAS;AACpE;AAOO,SAASF,uBAAuBG,IAAY;IACjD,MAAMC,sBAAgC,EAAE;IAExC,IAAIC,UAAU;IACd,IAAIC,sBAAsB;IAC1B,KAAK,MAAMJ,QAAQC,KAAM;QACvB,IAAIE,QAAQE,MAAM,KAAK,GAAG;YACxBF,WAAWH;YACXI,sBAAsBL,aAAaC;YACnC;QACF;QAEA,MAAMM,mBAAmBP,aAAaC;QACtC,IAAII,wBAAwBE,kBAAkB;YAC5CH,WAAWH;QACb,OAAO;YACLE,oBAAoBK,IAAI,CAACJ;YACzBA,UAAUH;YACVI,sBAAsBE;QACxB;IACF;IAEA,IAAIH,QAAQE,MAAM,GAAG,GAAG;QACtBH,oBAAoBK,IAAI,CAACJ;IAC3B;IAEA,OAAOD;AACT"}

View File

@@ -0,0 +1,4 @@
import React from 'react';
export declare const HotlinkedText: React.FC<{
text: string;
}>;

View File

@@ -0,0 +1,38 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "HotlinkedText", {
enumerable: true,
get: function() {
return HotlinkedText;
}
});
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
const _react = /*#__PURE__*/ _interop_require_default._(require("react"));
const _getwordsandwhitespaces = require("./get-words-and-whitespaces");
const linkRegex = /https?:\/\/[^\s/$.?#].[^\s"]*/i;
const HotlinkedText = function HotlinkedText(props) {
const { text } = props;
const wordsAndWhitespaces = (0, _getwordsandwhitespaces.getWordsAndWhitespaces)(text);
return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, linkRegex.test(text) ? wordsAndWhitespaces.map((word, index)=>{
if (linkRegex.test(word)) {
return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, {
key: "link-" + index
}, /*#__PURE__*/ _react.default.createElement("a", {
href: word
}, word));
}
return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, {
key: "text-" + index
}, word);
}) : text);
};
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../src/client/components/react-dev-overlay/internal/components/hot-linked-text/index.tsx"],"names":["HotlinkedText","linkRegex","props","text","wordsAndWhitespaces","getWordsAndWhitespaces","test","map","word","index","React","Fragment","key","a","href"],"mappings":";;;;+BAKaA;;;eAAAA;;;;gEALK;wCACqB;AAEvC,MAAMC,YAAY;AAEX,MAAMD,gBAER,SAASA,cAAcE,KAAK;IAC/B,MAAM,EAAEC,IAAI,EAAE,GAAGD;IAEjB,MAAME,sBAAsBC,IAAAA,8CAAsB,EAACF;IAEnD,qBACE,4DACGF,UAAUK,IAAI,CAACH,QACZC,oBAAoBG,GAAG,CAAC,CAACC,MAAMC;QAC7B,IAAIR,UAAUK,IAAI,CAACE,OAAO;YACxB,qBACE,6BAACE,cAAK,CAACC,QAAQ;gBAACC,KAAK,AAAC,UAAOH;6BAC3B,6BAACI;gBAAEC,MAAMN;eAAOA;QAGtB;QACA,qBAAO,6BAACE,cAAK,CAACC,QAAQ;YAACC,KAAK,AAAC,UAAOH;WAAUD;IAChD,KACAL;AAGV"}

View File

@@ -0,0 +1,8 @@
import * as React from 'react';
import type { VersionInfo } from '../../../../../server/dev/parse-version-info';
export type BuildErrorProps = {
message: string;
versionInfo?: VersionInfo;
};
export declare const BuildError: React.FC<BuildErrorProps>;
export declare const styles: string;

View File

@@ -0,0 +1,70 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
BuildError: null,
styles: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
BuildError: function() {
return BuildError;
},
styles: function() {
return styles;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _tagged_template_literal_loose = require("@swc/helpers/_/_tagged_template_literal_loose");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _Dialog = require("../components/Dialog");
const _Overlay = require("../components/Overlay");
const _Terminal = require("../components/Terminal");
const _VersionStalenessInfo = require("../components/VersionStalenessInfo");
const _nooptemplate = require("../helpers/noop-template");
function _templateObject() {
const data = _tagged_template_literal_loose._([
"\n .nextjs-container-build-error-header {\n display: flex;\n align-items: center;\n }\n .nextjs-container-build-error-header > h4 {\n line-height: 1.5;\n margin: 0;\n padding: 0;\n }\n\n .nextjs-container-build-error-body footer {\n margin-top: var(--size-gap);\n }\n .nextjs-container-build-error-body footer p {\n margin: 0;\n }\n\n .nextjs-container-build-error-body small {\n color: #757575;\n }\n"
]);
_templateObject = function() {
return data;
};
return data;
}
const BuildError = function BuildError(param) {
let { message, versionInfo } = param;
const noop = _react.useCallback(()=>{}, []);
return /*#__PURE__*/ _react.createElement(_Overlay.Overlay, {
fixed: true
}, /*#__PURE__*/ _react.createElement(_Dialog.Dialog, {
type: "error",
"aria-labelledby": "nextjs__container_build_error_label",
"aria-describedby": "nextjs__container_build_error_desc",
onClose: noop
}, /*#__PURE__*/ _react.createElement(_Dialog.DialogContent, null, /*#__PURE__*/ _react.createElement(_Dialog.DialogHeader, {
className: "nextjs-container-build-error-header"
}, /*#__PURE__*/ _react.createElement("h4", {
id: "nextjs__container_build_error_label"
}, "Failed to compile"), versionInfo ? /*#__PURE__*/ _react.createElement(_VersionStalenessInfo.VersionStalenessInfo, versionInfo) : null), /*#__PURE__*/ _react.createElement(_Dialog.DialogBody, {
className: "nextjs-container-build-error-body"
}, /*#__PURE__*/ _react.createElement(_Terminal.Terminal, {
content: message
}), /*#__PURE__*/ _react.createElement("footer", null, /*#__PURE__*/ _react.createElement("p", {
id: "nextjs__container_build_error_desc"
}, /*#__PURE__*/ _react.createElement("small", null, "This error occurred during the build process and can only be dismissed by fixing the error.")))))));
};
const styles = (0, _nooptemplate.noop)(_templateObject());
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=BuildError.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../src/client/components/react-dev-overlay/internal/container/BuildError.tsx"],"names":["BuildError","styles","message","versionInfo","noop","React","useCallback","Overlay","fixed","Dialog","type","aria-labelledby","aria-describedby","onClose","DialogContent","DialogHeader","className","h4","id","VersionStalenessInfo","DialogBody","Terminal","content","footer","p","small","css"],"mappings":";;;;;;;;;;;;;;;IAeaA,UAAU;eAAVA;;IAmCAC,MAAM;eAANA;;;;;iEAlDU;wBAOhB;yBACiB;0BACC;sCACY;8BACT;;;;;;;;;;AAIrB,MAAMD,aAAwC,SAASA,WAAW,KAGxE;IAHwE,IAAA,EACvEE,OAAO,EACPC,WAAW,EACZ,GAHwE;IAIvE,MAAMC,OAAOC,OAAMC,WAAW,CAAC,KAAO,GAAG,EAAE;IAC3C,qBACE,qBAACC,gBAAO;QAACC,OAAAA;qBACP,qBAACC,cAAM;QACLC,MAAK;QACLC,mBAAgB;QAChBC,oBAAiB;QACjBC,SAAST;qBAET,qBAACU,qBAAa,sBACZ,qBAACC,oBAAY;QAACC,WAAU;qBACtB,qBAACC;QAAGC,IAAG;OAAsC,sBAC5Cf,4BAAc,qBAACgB,0CAAoB,EAAKhB,eAAkB,qBAE7D,qBAACiB,kBAAU;QAACJ,WAAU;qBACpB,qBAACK,kBAAQ;QAACC,SAASpB;sBACnB,qBAACqB,8BACC,qBAACC;QAAEN,IAAG;qBACJ,qBAACO,eAAM;AAWvB;AAEO,MAAMxB,aAASyB,kBAAG"}

Some files were not shown because too many files have changed in this diff Show More