@cedarjs/web 6.0.0-canary.2780 → 6.0.0-canary.2782

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/dist/bins/cedar.js +14 -0
  2. package/dist/bins/cfw.js +14 -0
  3. package/dist/bins/cross-env.js +8 -0
  4. package/dist/bins/msw.js +6 -0
  5. package/dist/bins/redwood.js +14 -0
  6. package/dist/bins/storybook.js +27 -0
  7. package/dist/bins/tsc.js +8 -0
  8. package/dist/bundled/apollo-upload-client.js +2727 -1
  9. package/package.json +41 -110
  10. package/dist/cjs/apollo/ApolloProviderWithFetchConfig.d.ts +0 -15
  11. package/dist/cjs/apollo/ApolloProviderWithFetchConfig.d.ts.map +0 -1
  12. package/dist/cjs/apollo/ApolloProviderWithFetchConfig.js +0 -170
  13. package/dist/cjs/apollo/CedarApolloProvider.d.ts +0 -14
  14. package/dist/cjs/apollo/CedarApolloProvider.d.ts.map +0 -1
  15. package/dist/cjs/apollo/CedarApolloProvider.js +0 -69
  16. package/dist/cjs/apollo/ErrorBoundary.d.ts +0 -13
  17. package/dist/cjs/apollo/ErrorBoundary.d.ts.map +0 -1
  18. package/dist/cjs/apollo/ErrorBoundary.js +0 -47
  19. package/dist/cjs/apollo/apolloLinkTypes.d.ts +0 -60
  20. package/dist/cjs/apollo/apolloLinkTypes.d.ts.map +0 -1
  21. package/dist/cjs/apollo/apolloLinkTypes.js +0 -16
  22. package/dist/cjs/apollo/fragmentRegistry.d.ts +0 -68
  23. package/dist/cjs/apollo/fragmentRegistry.d.ts.map +0 -1
  24. package/dist/cjs/apollo/fragmentRegistry.js +0 -108
  25. package/dist/cjs/apollo/index.d.ts +0 -56
  26. package/dist/cjs/apollo/index.d.ts.map +0 -1
  27. package/dist/cjs/apollo/index.js +0 -39
  28. package/dist/cjs/apollo/links.d.ts +0 -26
  29. package/dist/cjs/apollo/links.d.ts.map +0 -1
  30. package/dist/cjs/apollo/links.js +0 -122
  31. package/dist/cjs/apollo/sseLink.d.ts +0 -26
  32. package/dist/cjs/apollo/sseLink.d.ts.map +0 -1
  33. package/dist/cjs/apollo/sseLink.js +0 -117
  34. package/dist/cjs/apollo/suspense.d.ts +0 -69
  35. package/dist/cjs/apollo/suspense.d.ts.map +0 -1
  36. package/dist/cjs/apollo/suspense.js +0 -118
  37. package/dist/cjs/apollo/useCache.d.ts +0 -20
  38. package/dist/cjs/apollo/useCache.d.ts.map +0 -1
  39. package/dist/cjs/apollo/useCache.js +0 -49
  40. package/dist/cjs/bins/cedar.d.ts +0 -9
  41. package/dist/cjs/bins/cedar.d.ts.map +0 -1
  42. package/dist/cjs/bins/cedar.js +0 -36
  43. package/dist/cjs/bins/cfw.d.ts +0 -3
  44. package/dist/cjs/bins/cfw.d.ts.map +0 -1
  45. package/dist/cjs/bins/cfw.js +0 -36
  46. package/dist/cjs/bins/cross-env.d.ts +0 -3
  47. package/dist/cjs/bins/cross-env.d.ts.map +0 -1
  48. package/dist/cjs/bins/cross-env.js +0 -30
  49. package/dist/cjs/bins/msw.d.ts +0 -3
  50. package/dist/cjs/bins/msw.d.ts.map +0 -1
  51. package/dist/cjs/bins/msw.js +0 -28
  52. package/dist/cjs/bins/redwood.d.ts +0 -9
  53. package/dist/cjs/bins/redwood.d.ts.map +0 -1
  54. package/dist/cjs/bins/redwood.js +0 -36
  55. package/dist/cjs/bins/storybook.d.ts +0 -3
  56. package/dist/cjs/bins/storybook.d.ts.map +0 -1
  57. package/dist/cjs/bins/storybook.js +0 -49
  58. package/dist/cjs/bins/tsc.d.ts +0 -3
  59. package/dist/cjs/bins/tsc.d.ts.map +0 -1
  60. package/dist/cjs/bins/tsc.js +0 -30
  61. package/dist/cjs/bundled/apollo-upload-client.d.ts +0 -3
  62. package/dist/cjs/bundled/apollo-upload-client.d.ts.map +0 -1
  63. package/dist/cjs/bundled/apollo-upload-client.js +0 -2753
  64. package/dist/cjs/components/DevFatalErrorPage.d.ts +0 -21
  65. package/dist/cjs/components/DevFatalErrorPage.d.ts.map +0 -1
  66. package/dist/cjs/components/DevFatalErrorPage.js +0 -552
  67. package/dist/cjs/components/FatalErrorBoundary.d.ts +0 -24
  68. package/dist/cjs/components/FatalErrorBoundary.d.ts.map +0 -1
  69. package/dist/cjs/components/FatalErrorBoundary.js +0 -63
  70. package/dist/cjs/components/FetchConfigProvider.d.ts +0 -26
  71. package/dist/cjs/components/FetchConfigProvider.d.ts.map +0 -1
  72. package/dist/cjs/components/FetchConfigProvider.js +0 -80
  73. package/dist/cjs/components/MetaTags.d.ts +0 -52
  74. package/dist/cjs/components/MetaTags.d.ts.map +0 -1
  75. package/dist/cjs/components/MetaTags.js +0 -68
  76. package/dist/cjs/components/Metadata.d.ts +0 -9
  77. package/dist/cjs/components/Metadata.d.ts.map +0 -1
  78. package/dist/cjs/components/Metadata.js +0 -94
  79. package/dist/cjs/components/PortalHead.d.ts +0 -4
  80. package/dist/cjs/components/PortalHead.d.ts.map +0 -1
  81. package/dist/cjs/components/PortalHead.js +0 -59
  82. package/dist/cjs/components/RedwoodProvider.d.ts +0 -9
  83. package/dist/cjs/components/RedwoodProvider.d.ts.map +0 -1
  84. package/dist/cjs/components/RedwoodProvider.js +0 -57
  85. package/dist/cjs/components/ServerInject.d.ts +0 -26
  86. package/dist/cjs/components/ServerInject.d.ts.map +0 -1
  87. package/dist/cjs/components/ServerInject.js +0 -75
  88. package/dist/cjs/components/cell/CellCacheContext.d.ts +0 -20
  89. package/dist/cjs/components/cell/CellCacheContext.d.ts.map +0 -1
  90. package/dist/cjs/components/cell/CellCacheContext.js +0 -53
  91. package/dist/cjs/components/cell/CellErrorBoundary.d.ts +0 -26
  92. package/dist/cjs/components/cell/CellErrorBoundary.d.ts.map +0 -1
  93. package/dist/cjs/components/cell/CellErrorBoundary.js +0 -66
  94. package/dist/cjs/components/cell/cellTypes.d.ts +0 -166
  95. package/dist/cjs/components/cell/cellTypes.d.ts.map +0 -1
  96. package/dist/cjs/components/cell/cellTypes.js +0 -16
  97. package/dist/cjs/components/cell/createCell.d.ts +0 -4
  98. package/dist/cjs/components/cell/createCell.d.ts.map +0 -1
  99. package/dist/cjs/components/cell/createCell.js +0 -185
  100. package/dist/cjs/components/cell/createFragmentCell.d.ts +0 -19
  101. package/dist/cjs/components/cell/createFragmentCell.d.ts.map +0 -1
  102. package/dist/cjs/components/cell/createFragmentCell.js +0 -107
  103. package/dist/cjs/components/cell/createServerCell.d.ts +0 -15
  104. package/dist/cjs/components/cell/createServerCell.d.ts.map +0 -1
  105. package/dist/cjs/components/cell/createServerCell.js +0 -91
  106. package/dist/cjs/components/cell/createSuspendingCell.d.ts +0 -11
  107. package/dist/cjs/components/cell/createSuspendingCell.d.ts.map +0 -1
  108. package/dist/cjs/components/cell/createSuspendingCell.js +0 -158
  109. package/dist/cjs/components/cell/isCellEmpty.d.ts +0 -41
  110. package/dist/cjs/components/cell/isCellEmpty.d.ts.map +0 -1
  111. package/dist/cjs/components/cell/isCellEmpty.js +0 -35
  112. package/dist/cjs/components/htmlTags.d.ts +0 -52
  113. package/dist/cjs/components/htmlTags.d.ts.map +0 -1
  114. package/dist/cjs/components/htmlTags.js +0 -88
  115. package/dist/cjs/config.d.ts +0 -2
  116. package/dist/cjs/config.d.ts.map +0 -1
  117. package/dist/cjs/config.js +0 -6
  118. package/dist/cjs/global.web-auto-imports.d.ts +0 -14
  119. package/dist/cjs/global.web-auto-imports.d.ts.map +0 -1
  120. package/dist/cjs/global.web-auto-imports.js +0 -1
  121. package/dist/cjs/graphql.d.ts +0 -23
  122. package/dist/cjs/graphql.d.ts.map +0 -1
  123. package/dist/cjs/graphql.js +0 -36
  124. package/dist/cjs/index.d.ts +0 -22
  125. package/dist/cjs/index.d.ts.map +0 -1
  126. package/dist/cjs/index.js +0 -73
  127. package/dist/cjs/package.json +0 -1
  128. package/dist/cjs/routeHooks.types.d.ts +0 -12
  129. package/dist/cjs/routeHooks.types.d.ts.map +0 -1
  130. package/dist/cjs/routeHooks.types.js +0 -16
  131. package/dist/cjs/server/MiddlewareRequest.d.ts +0 -28
  132. package/dist/cjs/server/MiddlewareRequest.d.ts.map +0 -1
  133. package/dist/cjs/server/MiddlewareRequest.js +0 -71
  134. package/dist/cjs/server/MiddlewareResponse.d.ts +0 -44
  135. package/dist/cjs/server/MiddlewareResponse.d.ts.map +0 -1
  136. package/dist/cjs/server/MiddlewareResponse.js +0 -130
  137. package/dist/cjs/server/middleware.d.ts +0 -17
  138. package/dist/cjs/server/middleware.d.ts.map +0 -1
  139. package/dist/cjs/server/middleware.js +0 -24
  140. package/dist/cjs/server/request.d.ts +0 -2
  141. package/dist/cjs/server/request.d.ts.map +0 -1
  142. package/dist/cjs/server/request.js +0 -34
  143. package/dist/cjs/streamUtils/useDocumentReady.d.ts +0 -11
  144. package/dist/cjs/streamUtils/useDocumentReady.d.ts.map +0 -1
  145. package/dist/cjs/streamUtils/useDocumentReady.js +0 -41
  146. package/dist/cjs/toast/index.d.ts +0 -3
  147. package/dist/cjs/toast/index.d.ts.map +0 -1
  148. package/dist/cjs/toast/index.js +0 -41
  149. package/dist/package.json +0 -1
@@ -1,21 +0,0 @@
1
- import React from 'react';
2
- import type { GraphQLFormattedError } from 'graphql';
3
- type RequestDetails = {
4
- query: string;
5
- operationName: string;
6
- operationKind: string;
7
- variables: any;
8
- };
9
- interface EnhancedGqlError extends GraphQLFormattedError {
10
- __RedwoodEnhancedError: RequestDetails;
11
- }
12
- type ErrorWithRequestMeta = Error & {
13
- mostRecentRequest?: RequestDetails;
14
- errors?: EnhancedGqlError[];
15
- mostRecentResponse?: any;
16
- };
17
- export declare const DevFatalErrorPage: (props: {
18
- error?: ErrorWithRequestMeta;
19
- }) => React.JSX.Element;
20
- export {};
21
- //# sourceMappingURL=DevFatalErrorPage.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DevFatalErrorPage.d.ts","sourceRoot":"","sources":["../../../src/components/DevFatalErrorPage.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAsC,MAAM,OAAO,CAAA;AAE1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAmBpD,KAAK,cAAc,GAAG;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,aAAa,EAAE,MAAM,CAAA;IACrB,aAAa,EAAE,MAAM,CAAA;IACrB,SAAS,EAAE,GAAG,CAAA;CACf,CAAA;AAED,UAAU,gBAAiB,SAAQ,qBAAqB;IACtD,sBAAsB,EAAE,cAAc,CAAA;CACvC;AAID,KAAK,oBAAoB,GAAG,KAAK,GAAG;IAClC,iBAAiB,CAAC,EAAE,cAAc,CAAA;IAClC,MAAM,CAAC,EAAE,gBAAgB,EAAE,CAAA;IAC3B,kBAAkB,CAAC,EAAE,GAAG,CAAA;CACzB,CAAA;AAiGD,eAAO,MAAM,iBAAiB,GAAI,OAAO;IAAE,KAAK,CAAC,EAAE,oBAAoB,CAAA;CAAE,sBA4FxE,CAAA"}
@@ -1,552 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var DevFatalErrorPage_exports = {};
30
- __export(DevFatalErrorPage_exports, {
31
- DevFatalErrorPage: () => DevFatalErrorPage
32
- });
33
- module.exports = __toCommonJS(DevFatalErrorPage_exports);
34
- var import_react = __toESM(require("react"), 1);
35
- var import_stacktracey = __toESM(require("stacktracey"), 1);
36
- let srcRoot = "";
37
- if (typeof RWJS_DEBUG_ENV !== "undefined") {
38
- srcRoot = RWJS_DEBUG_ENV?.RWJS_SRC_ROOT;
39
- }
40
- let appRoot;
41
- if (/^[A-Z]:\\/.test(srcRoot)) {
42
- appRoot = srcRoot.substring(3).replace(/\\/g, "/");
43
- } else {
44
- appRoot = srcRoot.substring(1);
45
- }
46
- function formatErrorForClipboard(err, stack, typeName, msg, errorWithMeta) {
47
- const lines = [];
48
- lines.push("=".repeat(80));
49
- lines.push("FATAL ERROR REPORT");
50
- lines.push("=".repeat(80));
51
- lines.push("");
52
- lines.push(`ERROR TYPE: ${typeName}`);
53
- lines.push(`ERROR MESSAGE: ${msg}`);
54
- lines.push("");
55
- const mostRecentRequest = errorWithMeta.mostRecentRequest || errorWithMeta.errors?.find((gqlErr) => gqlErr.__RedwoodEnhancedError)?.__RedwoodEnhancedError;
56
- if (mostRecentRequest) {
57
- lines.push("-".repeat(80));
58
- lines.push("REQUEST CONTEXT");
59
- lines.push("-".repeat(80));
60
- lines.push(`Operation: ${mostRecentRequest.operationName}`);
61
- lines.push(`Kind: ${mostRecentRequest.operationKind}`);
62
- lines.push("");
63
- lines.push("Variables:");
64
- try {
65
- lines.push(JSON.stringify(mostRecentRequest.variables, null, 2));
66
- } catch {
67
- lines.push("Unable to stringify variables");
68
- }
69
- lines.push("");
70
- lines.push("Query:");
71
- lines.push(mostRecentRequest.query);
72
- lines.push("");
73
- }
74
- if (errorWithMeta.mostRecentResponse) {
75
- lines.push("-".repeat(80));
76
- lines.push("RESPONSE CONTEXT");
77
- lines.push("-".repeat(80));
78
- try {
79
- lines.push(JSON.stringify(errorWithMeta.mostRecentResponse, null, 2));
80
- } catch {
81
- lines.push("Unable to stringify response");
82
- }
83
- lines.push("");
84
- }
85
- lines.push("-".repeat(80));
86
- lines.push("STACK TRACE");
87
- lines.push("-".repeat(80));
88
- stack.items.forEach((entry, i) => {
89
- const fileShort = entry.fileShort || "[Unknown]";
90
- const callee = entry.callee || "[Anonymous]";
91
- const line = entry.line || "?";
92
- const column = entry.column || "?";
93
- lines.push(`[${i}] ${fileShort}:${line}:${column} in ${callee}`);
94
- const sourceFile = entry.sourceFile;
95
- if (sourceFile?.lines && sourceFile.lines.length > 0) {
96
- const lineIndex = (entry.line || 1) - 1;
97
- const window = 2;
98
- const start = Math.max(0, lineIndex - window);
99
- const end = Math.min(sourceFile.lines.length, lineIndex + window + 1);
100
- lines.push(" Source context:");
101
- for (let idx = start; idx < end; idx++) {
102
- const marker = idx === lineIndex ? "> " : " ";
103
- lines.push(
104
- ` ${marker}${(idx + 1).toString().padStart(4)} | ${sourceFile.lines[idx]}`
105
- );
106
- }
107
- lines.push("");
108
- }
109
- });
110
- lines.push("");
111
- lines.push("=".repeat(80));
112
- return lines.join("\n");
113
- }
114
- const DevFatalErrorPage = (props) => {
115
- const [copyFeedback, setCopyFeedback] = (0, import_react.useState)("");
116
- const timeoutRef = (0, import_react.useRef)(null);
117
- (0, import_react.useEffect)(() => {
118
- return () => {
119
- if (timeoutRef.current) {
120
- clearTimeout(timeoutRef.current);
121
- }
122
- };
123
- }, []);
124
- if (!props.error) {
125
- return /* @__PURE__ */ import_react.default.createElement("h3", null, "Could not render the error page due to a missing error, please see the console for more details.");
126
- }
127
- const err = props.error;
128
- const stack = new import_stacktracey.default(err).withSources();
129
- const typeName = String(
130
- err["type"] || err.constructor?.name || typeof err
131
- );
132
- const msg = String(err?.message);
133
- const FileRef = stack.items[0] ? /* @__PURE__ */ import_react.default.createElement("a", { href: toVSCodeURL(stack.items[0]) }, stack.items[0].fileName) : null;
134
- const handleCopyAll = async () => {
135
- const errorText = formatErrorForClipboard(err, stack, typeName, msg, err);
136
- try {
137
- await navigator.clipboard.writeText(errorText);
138
- setCopyFeedback("\u2713 Copied to clipboard");
139
- timeoutRef.current = setTimeout(() => setCopyFeedback(""), 3e3);
140
- } catch (clipboardError) {
141
- setCopyFeedback("Failed to copy");
142
- timeoutRef.current = setTimeout(() => setCopyFeedback(""), 3e3);
143
- console.error("Failed to copy error to clipboard:", clipboardError);
144
- }
145
- };
146
- return /* @__PURE__ */ import_react.default.createElement("main", { className: "error-page" }, /* @__PURE__ */ import_react.default.createElement(
147
- "style",
148
- {
149
- dangerouslySetInnerHTML: {
150
- __html: css
151
- }
152
- }
153
- ), /* @__PURE__ */ import_react.default.createElement("nav", null, /* @__PURE__ */ import_react.default.createElement("h1", null, "A fatal runtime error occurred when rendering ", FileRef), /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(
154
- "button",
155
- {
156
- onClick: handleCopyAll,
157
- className: "copy-button",
158
- title: "Copy all error context to clipboard"
159
- },
160
- "\u{1F4CB} Copy All"
161
- ), copyFeedback && /* @__PURE__ */ import_react.default.createElement("span", { className: "copy-feedback" }, copyFeedback), "Get help via ", /* @__PURE__ */ import_react.default.createElement(Discord, null))), /* @__PURE__ */ import_react.default.createElement("section", { className: "panic-overlay" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "error" }, /* @__PURE__ */ import_react.default.createElement("h3", { className: "error-title" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "error-type" }, typeName), /* @__PURE__ */ import_react.default.createElement("span", { className: "error-message" }, prettyMessage(msg)))), /* @__PURE__ */ import_react.default.createElement(ResponseRequest, { error: props.error }), /* @__PURE__ */ import_react.default.createElement("div", { className: "error" }, /* @__PURE__ */ import_react.default.createElement("h3", { className: "section-title" }, "Stack Trace"), /* @__PURE__ */ import_react.default.createElement("div", { className: "error-stack" }, stack.items.map((entry, i) => /* @__PURE__ */ import_react.default.createElement(StackEntry, { key: i, entry, i, message: msg }))))));
162
- };
163
- function hideStackLine(fileReference) {
164
- return fileReference.length === 1 || fileReference.includes("node_modules/react-dom");
165
- }
166
- function StackEntry({
167
- entry,
168
- i
169
- }) {
170
- const { sourceFile = { lines: [] }, line, column, fileShort } = entry;
171
- const lineIndex = (line || 0) - 1;
172
- const maxLines = sourceFile.lines.length;
173
- const window = 4;
174
- let start = lineIndex - window, end = lineIndex + window + 2;
175
- if (start < 0) {
176
- end = Math.min(end - start, maxLines);
177
- start = 0;
178
- }
179
- if (end > maxLines) {
180
- start = Math.max(0, start - (end - maxLines));
181
- end = maxLines;
182
- }
183
- const lines = sourceFile.lines.slice(start, end);
184
- const lineNumberWidth = String(start + lines.length).length;
185
- const highlightIndex = (line || 0) - start - 1;
186
- const onLastLine = highlightIndex === lines.length - 1;
187
- const shortestPath = (path) => path.replace(appRoot || "", "");
188
- const expanded = !shouldHideEntry(entry, i);
189
- const clickable = lines.length;
190
- const LinkToVSCode = (props) => clickable ? /* @__PURE__ */ import_react.default.createElement("a", { href: toVSCodeURL(entry) }, props.children) : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, props.children);
191
- const fileReference = !lines.length ? "[System]" : shortestPath(fileShort);
192
- const rootClasses = [
193
- "stack-entry",
194
- !fileReference.includes("node_modules") && "cfw",
195
- i === 0 && " first",
196
- lines.length && "clickable"
197
- ].filter(Boolean);
198
- return hideStackLine(fileReference) ? /* @__PURE__ */ import_react.default.createElement("div", null) : /* @__PURE__ */ import_react.default.createElement(LinkToVSCode, null, /* @__PURE__ */ import_react.default.createElement("div", { className: rootClasses.join(" ") }, /* @__PURE__ */ import_react.default.createElement("div", { className: "file" }, fileReference + " in " + entry.callee), expanded && !!lines.length && /* @__PURE__ */ import_react.default.createElement("div", { className: "lines" + (onLastLine ? ".no-fade" : "") }, lines.map((text, i2) => {
199
- return /* @__PURE__ */ import_react.default.createElement(
200
- "div",
201
- {
202
- key: i2,
203
- className: "line" + (i2 === highlightIndex ? " line-hili" : "")
204
- },
205
- /* @__PURE__ */ import_react.default.createElement("span", { className: "line-number" }, String(start + i2 + 1).padStart(lineNumberWidth, " ")),
206
- /* @__PURE__ */ import_react.default.createElement("span", { className: "line-text" }, i2 === highlightIndex ? renderHighlightedLine(text, column || 0) : text)
207
- );
208
- }))));
209
- function renderHighlightedLine(text, column2) {
210
- const [before, after] = [text.slice(0, column2 - 1), text.slice(column2 - 1)];
211
- return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, before, /* @__PURE__ */ import_react.default.createElement("strong", null, after));
212
- }
213
- function shouldHideEntry(entry2, i2) {
214
- return (entry2.thirdParty || entry2["native"] || entry2.hide || entry2.fileShort.includes("node_modules")) && i2 !== 0;
215
- }
216
- }
217
- function toVSCodeURL(entry) {
218
- const scheme = typeof RWJS_DEBUG_ENV !== "undefined" && RWJS_DEBUG_ENV.REDWOOD_ENV_EDITOR || "vscode";
219
- return `${scheme}://file/${entry.fileShort}:${entry.line}:${entry.column}`;
220
- }
221
- function prettyMessage(msg) {
222
- return msg.replace("is not a function.", "is not a function.\n\n");
223
- }
224
- function ResponseRequest(props) {
225
- const [openQuery, setOpenQuery] = (0, import_react.useState)(false);
226
- const [openResponse, setOpenResponse] = (0, import_react.useState)(false);
227
- if (!props.error) {
228
- return null;
229
- }
230
- const mostRecentRequest = props.error.mostRecentRequest || props.error.errors?.find((gqlErr) => gqlErr.__RedwoodEnhancedError)?.__RedwoodEnhancedError;
231
- const mostRecentResponse = props.error.mostRecentResponse;
232
- return /* @__PURE__ */ import_react.default.createElement("div", { className: "request-response" }, mostRecentRequest ? /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("h4", null, "Request: ", mostRecentRequest.operationName), /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("h5", null, "Variables:"), /* @__PURE__ */ import_react.default.createElement("code", null, /* @__PURE__ */ import_react.default.createElement("pre", null, JSON.stringify(mostRecentRequest.variables, null, " ")))), /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("h5", null, "Query:"), /* @__PURE__ */ import_react.default.createElement("code", null, /* @__PURE__ */ import_react.default.createElement(
233
- "pre",
234
- {
235
- onClick: () => setOpenQuery(!openQuery),
236
- className: openQuery ? "open" : "preview"
237
- },
238
- mostRecentRequest.query
239
- )))) : null, mostRecentResponse ? /* @__PURE__ */ import_react.default.createElement("div", { className: "response" }, /* @__PURE__ */ import_react.default.createElement("h4", null, "Response"), /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("h5", null, "JSON:"), /* @__PURE__ */ import_react.default.createElement("code", null, /* @__PURE__ */ import_react.default.createElement(
240
- "pre",
241
- {
242
- onClick: () => setOpenResponse(!openResponse),
243
- className: openResponse ? "open" : "preview"
244
- },
245
- JSON.stringify(mostRecentResponse, null, " ")
246
- )))) : null);
247
- }
248
- const css = `
249
- body {
250
- background-color: rgb(253, 248, 246) !important;
251
- font-family: "Open Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
252
- }
253
-
254
- .panic-overlay {
255
- background-color: white;
256
- padding: 0 2.5em;
257
- }
258
-
259
- .panic-overlay strong {
260
- font-weight: bold;
261
- }
262
-
263
- main.error-page nav {
264
- display: flex;
265
- flex-direction: row;
266
- align: center;
267
- justify-content: space-between;
268
- padding: 1em 2.5em;
269
- }
270
-
271
- main.error-page nav h1 {
272
- color: black;
273
- margin: 0;
274
- padding: 0;
275
- font-size: 1.2em;
276
- font-weight: 400;
277
- opacity: 1;
278
- color: rgb(191, 71, 34);
279
- }
280
-
281
- main.error-page nav h1 a {
282
- color: black;
283
- text-decoration: underline;
284
- }
285
-
286
- main.error-page nav div {
287
- display: flex;
288
- align-items: center;
289
- line-height: 2em;
290
- }
291
-
292
- main.error-page nav div a {
293
- display: flex;
294
- margin: 0 0.3em;
295
- }
296
-
297
- main.error-page nav .copy-button {
298
- background-color: rgb(191, 71, 34);
299
- color: white;
300
- border: none;
301
- padding: 0.5em 1em;
302
- border-radius: 4px;
303
- cursor: pointer;
304
- font-size: 0.9em;
305
- margin-right: 1em;
306
- transition: background-color 0.2s;
307
- font-family: inherit;
308
- }
309
-
310
- main.error-page nav .copy-button:hover {
311
- background-color: rgb(200, 32, 32);
312
- }
313
-
314
- main.error-page nav .copy-feedback {
315
- color: rgb(191, 71, 34);
316
- font-weight: bold;
317
- margin-right: 1em;
318
- }
319
-
320
- main.error-page nav svg {
321
- width: 24px;
322
- height: 24px;
323
- fill: rgb(191, 71, 34);
324
- }
325
-
326
- main.error-page nav svg.discourse {
327
- height: 20px;
328
- width: 20px;
329
- }
330
-
331
- main.error-page nav svg:hover {
332
- fill: rgb(200, 32, 32);
333
- }
334
-
335
- .request-response div div code,
336
- .request-response div div pre {
337
- background-color: transparent !important;
338
- }
339
-
340
- .panic-overlay a {
341
- text-decoration: none;
342
- }
343
-
344
- .panic-overlay .error {
345
- padding: 3em 0;
346
- }
347
-
348
- .panic-overlay .error-title {
349
- display: flex;
350
- align-items: stretch;
351
- }
352
-
353
- .panic-overlay .error-type {
354
- min-height: 2.8em;
355
- display: flex !important;
356
- align-items: center;
357
- padding: 0 1em;
358
- background: rgb(195, 74, 37);
359
- color: white;
360
- margin-right: 2em;
361
- white-space: nowrap;
362
- text-align: center;
363
- }
364
-
365
- .panic-overlay .section-title {
366
- display: flex;
367
- align-items: center;
368
- padding: 1em 1em;
369
- background: rgb(195, 74, 37);
370
- color: white;
371
- font-size: 1.1em;
372
- font-weight: 600;
373
- margin: 2em 0 1em 0;
374
- }
375
-
376
- .panic-overlay .error-counter {
377
- color: white;
378
- opacity: 0.3;
379
- position: absolute;
380
- left: 0.8em;
381
- }
382
- .panic-overlay .error-message {
383
- display: flex !important;
384
- align-items: center;
385
- font-weight: 300;
386
- line-height: 1.1em;
387
- font-size: 2.8em;
388
- word-break: break-all;
389
- white-space: pre-wrap;
390
- }
391
- .panic-overlay .error-stack {
392
- margin-top: 2em;
393
- white-space: pre;
394
- padding-left: var(--left-pad);
395
- }
396
-
397
- .panic-overlay .stack-entry.clickable {
398
- cursor: pointer;
399
- }
400
-
401
- .panic-overlay .stack-entry {
402
- margin-left: 2.5em;
403
- }
404
-
405
- .panic-overlay .stack-entry.cfw {
406
- font-weight: bold;
407
- }
408
-
409
- .panic-overlay .stack-entry .file {
410
- color: rgb(195, 74, 37, 0.8);
411
- }
412
-
413
- .panic-overlay .stack-entry.first .file {
414
- font-weight: bold;
415
- color: rgb(200, 47, 47);
416
- }
417
-
418
- .panic-overlay .file strong {
419
- font-weight: normal;
420
- }
421
- .panic-overlay .file:before,
422
- .panic-overlay .more:before {
423
- content: "@ ";
424
- opacity: 0.5;
425
- margin-left: -1.25em;
426
- }
427
- .panic-overlay .more:before {
428
- content: "\u25B7 ";
429
- opacity: 0.5;
430
- }
431
- .panic-overlay .more {
432
- opacity: 0.25;
433
- color: black;
434
- font-size: 0.835em;
435
- cursor: pointer;
436
- text-align: center;
437
- display: none;
438
- }
439
- .panic-overlay .more em {
440
- font-style: normal;
441
- font-weight: normal;
442
- border-bottom: 1px dashed black;
443
- }
444
- .panic-overlay .collapsed .panic-overlay .more {
445
- display: block;
446
- }
447
- .panic-overlay .lines, .request-response code {
448
- color: rgb(187, 165, 165);
449
- font-size: 0.835em;
450
- margin-bottom: 2.5em;
451
- padding: 2rem;
452
- font-family: Menlo, Monaco, "Courier New", Courier, monospace;
453
- }
454
- .panic-overlay .lines:not(.panic-overlay .no-fade) {
455
- -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 75%, rgba(0, 0, 0, 0));
456
- mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 75%, rgba(0, 0, 0, 0));
457
- }
458
- .panic-overlay .line-number {
459
- padding-right: 1.5em;
460
- opacity: 0.5;
461
- }
462
- .panic-overlay .line-hili {
463
- background: rgb(253, 248, 246);
464
- color: #5f4545;
465
- }
466
- .panic-overlay .stack-entry:first-child .panic-overlay .line-hili strong {
467
- text-decoration: underline wavy #ff0040;
468
- }
469
- .panic-overlay .line-hili em {
470
- font-style: italic;
471
- color: rgb(195, 74, 37);
472
- font-size: 0.75em;
473
- margin-left: 2em;
474
- opacity: 0.25;
475
- position: relative;
476
- top: -0.115em;
477
- white-space: nowrap;
478
- }
479
- .panic-overlay .line-hili em:before {
480
- content: "\u2190 ";
481
- }
482
- .panic-overlay .no-source {
483
- font-style: italic;
484
- }
485
-
486
- .panic-overlay .request-response {
487
- margin-top: 2rem;
488
- display: flex;
489
- flex-direction: row;
490
- }
491
-
492
- .panic-overlay .request-response > div {
493
- flex: 1;
494
- }
495
-
496
- .panic-overlay .request-response .response {
497
- margin-left: 2rem;
498
- }
499
-
500
- .panic-overlay .request-response h4 {
501
- background-color: rgb(195, 74, 37);
502
- color: white;
503
- font-size: 1.5rem;
504
- padding: 0.2rem 1rem;
505
- }
506
-
507
- .panic-overlay .request-response > div > div {
508
- margin: 1rem 1rem;
509
- }
510
-
511
- .panic-overlay .request-response pre {
512
- background-color: rgb(253, 248, 246);
513
- padding: 1rem 1rem;
514
- color: black;
515
- }
516
-
517
- .panic-overlay .request-response pre.open {
518
- max-height: auto;
519
- }
520
-
521
- .panic-overlay .request-response pre.preview {
522
- max-height: 13.5rem;
523
- overflow-y: auto;
524
-
525
- -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 75%, rgba(0, 0, 0, 0));
526
- mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 75%, rgba(0, 0, 0, 0));
527
- }
528
-
529
- @media only screen and (max-width: 640px) {
530
- .panic-overlay {
531
- font-size: 15px;
532
- }
533
-
534
- .panic-overlay h1 {
535
- margin: 40px 0;
536
- }
537
- }
538
- @media only screen and (max-width: 500px) {
539
- .panic-overlay {
540
- font-size: 14px;
541
- }
542
-
543
- .panic-overlay h1 {
544
- margin: 30px 0;
545
- }
546
- }
547
- `;
548
- const Discord = () => /* @__PURE__ */ import_react.default.createElement("a", { href: "https://cedarjs.com/discord", title: "Go to CedarJS's Discord server" }, /* @__PURE__ */ import_react.default.createElement("svg", { viewBox: "0 0 36 36", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react.default.createElement("path", { d: "M29.9699 7.7544C27.1043 5.44752 22.5705 5.05656 22.3761 5.04288C22.2284 5.03072 22.0806 5.0648 21.9531 5.1404C21.8257 5.216 21.7249 5.32937 21.6647 5.4648C21.5783 5.65936 21.5049 5.85949 21.4451 6.06384C23.3409 6.38424 25.6694 7.02864 27.7761 8.33616C27.8565 8.38604 27.9262 8.45126 27.9814 8.52809C28.0366 8.60493 28.0761 8.69187 28.0976 8.78397C28.1192 8.87607 28.1224 8.97151 28.1071 9.06485C28.0917 9.15819 28.0582 9.24759 28.0083 9.32796C27.9584 9.40833 27.8932 9.47809 27.8164 9.53325C27.7395 9.58842 27.6526 9.62791 27.5605 9.64947C27.4684 9.67103 27.373 9.67424 27.2796 9.65892C27.1863 9.6436 27.0969 9.61004 27.0165 9.56016C23.3949 7.3116 18.8719 7.2 17.9999 7.2C17.1287 7.2 12.6028 7.31232 8.98338 9.55944C8.90301 9.60932 8.81361 9.64288 8.72027 9.6582C8.62693 9.67352 8.53149 9.67031 8.43939 9.64875C8.25339 9.6052 8.09231 9.48955 7.99158 9.32724C7.89085 9.16493 7.85873 8.96925 7.90227 8.78325C7.94582 8.59725 8.06147 8.43617 8.22378 8.33544C10.3305 7.03152 12.659 6.38424 14.5547 6.06672C14.4453 5.7096 14.3459 5.48424 14.3387 5.4648C14.2788 5.32841 14.1776 5.2143 14.0493 5.13859C13.921 5.06288 13.7721 5.0294 13.6238 5.04288C13.4294 5.05728 8.89554 5.44752 5.99034 7.78536C4.47474 9.18792 1.43994 17.3894 1.43994 24.48C1.43994 24.6067 1.47378 24.7277 1.5357 24.8371C3.62802 28.5163 9.3405 29.4775 10.6423 29.52H10.6646C10.7782 29.5203 10.8903 29.4937 10.9916 29.4424C11.093 29.3911 11.1808 29.3165 11.2478 29.2248L12.5632 27.4133C9.01146 26.4967 7.19706 24.9386 7.09338 24.8458C6.95017 24.7194 6.86303 24.5412 6.85115 24.3506C6.83927 24.1599 6.90361 23.9723 7.03002 23.8291C7.15643 23.6859 7.33456 23.5988 7.52522 23.5869C7.71588 23.575 7.90345 23.6394 8.04666 23.7658C8.08842 23.8054 11.4299 26.64 17.9999 26.64C24.5807 26.64 27.9223 23.7938 27.9561 23.7658C28.0998 23.6403 28.2874 23.5769 28.4777 23.5896C28.668 23.6023 28.8456 23.69 28.9713 23.8334C29.0335 23.9042 29.0812 23.9864 29.1117 24.0756C29.1421 24.1647 29.1546 24.259 29.1486 24.353C29.1426 24.447 29.1181 24.5389 29.0766 24.6235C29.035 24.708 28.9772 24.7836 28.9065 24.8458C28.8028 24.9386 26.9884 26.4967 23.4367 27.4133L24.7528 29.2248C24.8198 29.3164 24.9074 29.3909 25.0087 29.4422C25.1099 29.4935 25.2218 29.5202 25.3353 29.52H25.3569C26.6601 29.4775 32.3719 28.5156 34.4649 24.8371C34.5261 24.7277 34.5599 24.6067 34.5599 24.48C34.5599 17.3894 31.5251 9.18864 29.9699 7.7544V7.7544ZM13.3199 21.6C11.9275 21.6 10.7999 20.3112 10.7999 18.72C10.7999 17.1288 11.9275 15.84 13.3199 15.84C14.7124 15.84 15.8399 17.1288 15.8399 18.72C15.8399 20.3112 14.7124 21.6 13.3199 21.6ZM22.6799 21.6C21.2875 21.6 20.1599 20.3112 20.1599 18.72C20.1599 17.1288 21.2875 15.84 22.6799 15.84C24.0724 15.84 25.1999 17.1288 25.1999 18.72C25.1999 20.3112 24.0724 21.6 22.6799 21.6Z" })));
549
- // Annotate the CommonJS export names for ESM import in node:
550
- 0 && (module.exports = {
551
- DevFatalErrorPage
552
- });
@@ -1,24 +0,0 @@
1
- import React from 'react';
2
- type State = {
3
- hasError: boolean;
4
- error?: Error;
5
- };
6
- type PropsFatalErrorBoundary = {
7
- children?: React.ReactNode;
8
- page: React.ComponentType<{
9
- error?: Error;
10
- }>;
11
- };
12
- declare class FatalErrorBoundary extends React.Component<PropsFatalErrorBoundary, State> {
13
- state: {
14
- hasError: boolean;
15
- error: undefined;
16
- };
17
- static getDerivedStateFromError(error: Error): {
18
- hasError: boolean;
19
- error: Error;
20
- };
21
- render(): string | number | boolean | Iterable<React.ReactNode> | React.PromiseLikeOfReactNode | React.JSX.Element | null | undefined;
22
- }
23
- export { FatalErrorBoundary };
24
- //# sourceMappingURL=FatalErrorBoundary.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FatalErrorBoundary.d.ts","sourceRoot":"","sources":["../../../src/components/FatalErrorBoundary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,KAAK,KAAK,GAAG;IACX,QAAQ,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,CAAA;AAqBD,KAAK,uBAAuB,GAAG;IAC7B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,KAAK,CAAC,EAAE,KAAK,CAAA;KAAE,CAAC,CAAA;CAC7C,CAAA;AAED,cAAM,kBAAmB,SAAQ,KAAK,CAAC,SAAS,CAC9C,uBAAuB,EACvB,KAAK,CACN;IACC,KAAK;;;MAAwC;IAE7C,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK;;;;IAI5C,MAAM;CAYP;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAA"}
@@ -1,63 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var FatalErrorBoundary_exports = {};
30
- __export(FatalErrorBoundary_exports, {
31
- FatalErrorBoundary: () => FatalErrorBoundary
32
- });
33
- module.exports = __toCommonJS(FatalErrorBoundary_exports);
34
- var import_react = __toESM(require("react"), 1);
35
- class InfallibleErrorBoundary extends import_react.default.Component {
36
- state = { hasError: false };
37
- static getDerivedStateFromError() {
38
- return { hasError: true };
39
- }
40
- render() {
41
- if (this.state.hasError) {
42
- return /* @__PURE__ */ import_react.default.createElement("h1", null, "Something went wrong and we are unable to show this page.");
43
- }
44
- return this.props.children;
45
- }
46
- }
47
- class FatalErrorBoundary extends import_react.default.Component {
48
- state = { hasError: false, error: void 0 };
49
- static getDerivedStateFromError(error) {
50
- return { hasError: true, error };
51
- }
52
- render() {
53
- const { page: Page } = this.props;
54
- if (this.state.hasError) {
55
- return /* @__PURE__ */ import_react.default.createElement(InfallibleErrorBoundary, null, /* @__PURE__ */ import_react.default.createElement(Page, { error: this.state.error }));
56
- }
57
- return this.props.children;
58
- }
59
- }
60
- // Annotate the CommonJS export names for ESM import in node:
61
- 0 && (module.exports = {
62
- FatalErrorBoundary
63
- });