@seedgrid/fe-components 2026.3.3-9 → 2026.3.4-1

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.
@@ -59,11 +59,11 @@ const DEFAULT_SEEDGRID_EDITOR_DEPENDENCIES = {
59
59
  const DEFAULT_SANDBOX_HOST_DEPENDENCIES = {
60
60
  "@codesandbox/sandpack-react": "^2.20.0"
61
61
  };
62
- const DEFAULT_SANDPACK_POLYFILLS = {
63
- assert: "^2.1.0",
64
- process: "^0.11.10",
65
- util: "^0.12.5"
66
- };
62
+ // Keep this empty: editor runtime uses in-memory shims under /node_modules/*
63
+ // for assert/path/process/util/fs and node:* aliases.
64
+ // Installing npm polyfill packages here pulls deep transitive trees and may
65
+ // explode resolution inside Sandpack (e.g. dunder-proto/get, get-proto, etc).
66
+ const DEFAULT_SANDPACK_POLYFILLS = {};
67
67
  const TIPTAP_SHIM_PACKAGES = [
68
68
  "@tiptap/core",
69
69
  "@tiptap/pm",
@@ -101,6 +101,26 @@ const SANDPACK_MARKDOWN_IT_BIN_SHIM = `import markdownit from "../index.mjs";
101
101
  export default markdownit;
102
102
  export { markdownit };
103
103
  `;
104
+ const SANDPACK_MARKDOWN_IT_PACKAGE_JSON_SHIM = JSON.stringify({
105
+ name: "markdown-it",
106
+ version: "14.1.1-shim",
107
+ main: "dist/index.cjs.js",
108
+ module: "index.mjs",
109
+ exports: {
110
+ ".": {
111
+ import: "./index.mjs",
112
+ require: "./dist/index.cjs.js"
113
+ },
114
+ "./*": {
115
+ import: "./*",
116
+ require: "./*"
117
+ }
118
+ },
119
+ // Sandpack can accidentally prioritize `bin`; force it to a browser-safe module.
120
+ bin: {
121
+ "markdown-it": "dist/index.cjs.js"
122
+ }
123
+ });
104
124
  const SANDPACK_SANDBOX_SANDPACK_REACT_SHIM_INDEX_JS = `export const SandpackProvider = ({ children }) => children ?? null;
105
125
  export const SandpackCodeEditor = () => null;
106
126
  export const SandpackPreview = () => null;
@@ -302,6 +322,66 @@ if (typeof globalThis !== "undefined" && !globalThis.process) {
302
322
  module.exports = processShim;
303
323
  module.exports.default = processShim;
304
324
  `;
325
+ const SANDPACK_NODE_ASSERT_ALIAS_SHIM_INDEX_JS = `const assertShim = require("assert");
326
+ module.exports = assertShim;
327
+ module.exports.default = assertShim;
328
+ `;
329
+ const SANDPACK_NODE_UTIL_ALIAS_SHIM_INDEX_JS = `const utilShim = require("util");
330
+ module.exports = utilShim;
331
+ module.exports.default = utilShim;
332
+ `;
333
+ const SANDPACK_NODE_PATH_ALIAS_SHIM_INDEX_JS = `const pathShim = require("path");
334
+ module.exports = pathShim;
335
+ module.exports.default = pathShim;
336
+ `;
337
+ const SANDPACK_NODE_FS_ALIAS_SHIM_INDEX_JS = `const fsShim = require("fs");
338
+ module.exports = fsShim;
339
+ module.exports.default = fsShim;
340
+ `;
341
+ const SANDPACK_NODE_PROCESS_ALIAS_SHIM_INDEX_JS = `const processShim = require("process");
342
+ module.exports = processShim;
343
+ module.exports.default = processShim;
344
+ `;
345
+ const SANDPACK_NODE_FS_PROMISES_ALIAS_SHIM_INDEX_JS = `const fsShim = require("fs");
346
+ module.exports = fsShim.promises || {};
347
+ module.exports.default = module.exports;
348
+ `;
349
+ const SANDPACK_NODE_ASSERT_PACKAGE_JSON_SHIM = JSON.stringify({
350
+ name: "node:assert",
351
+ version: "0.0.0-shim",
352
+ main: "index.js",
353
+ module: "index.js"
354
+ });
355
+ const SANDPACK_NODE_UTIL_PACKAGE_JSON_SHIM = JSON.stringify({
356
+ name: "node:util",
357
+ version: "0.0.0-shim",
358
+ main: "index.js",
359
+ module: "index.js"
360
+ });
361
+ const SANDPACK_NODE_PATH_PACKAGE_JSON_SHIM = JSON.stringify({
362
+ name: "node:path",
363
+ version: "0.0.0-shim",
364
+ main: "index.js",
365
+ module: "index.js"
366
+ });
367
+ const SANDPACK_NODE_FS_PACKAGE_JSON_SHIM = JSON.stringify({
368
+ name: "node:fs",
369
+ version: "0.0.0-shim",
370
+ main: "index.js",
371
+ module: "index.js"
372
+ });
373
+ const SANDPACK_NODE_PROCESS_PACKAGE_JSON_SHIM = JSON.stringify({
374
+ name: "node:process",
375
+ version: "0.0.0-shim",
376
+ main: "index.js",
377
+ module: "index.js"
378
+ });
379
+ const SANDPACK_NODE_FS_PROMISES_PACKAGE_JSON_SHIM = JSON.stringify({
380
+ name: "node:fs/promises",
381
+ version: "0.0.0-shim",
382
+ main: "index.js",
383
+ module: "index.js"
384
+ });
305
385
  const SANDPACK_FALLBACK_THEME_VARS = {
306
386
  // shadcn/ui design tokens (HSL)
307
387
  "--background": "0 0% 100%",
@@ -944,6 +1024,13 @@ function RunButton({ onRun }) {
944
1024
  }, [onRun, running, sandpack]);
945
1025
  return (_jsx(SgButton, { severity: "primary", size: "sm", loading: running, onClick: handleRun, children: running ? "Running" : "Run" }));
946
1026
  }
1027
+ const COREJS_PROVIDER_WARNING_PREFIX = "Internal error in the corejs3 provider: unknown polyfill";
1028
+ function shouldSuppressCoreJsProviderWarning(args) {
1029
+ if (args.length === 0)
1030
+ return false;
1031
+ const firstArg = args[0];
1032
+ return typeof firstArg === "string" && firstArg.includes(COREJS_PROVIDER_WARNING_PREFIX);
1033
+ }
947
1034
  export default function SgPlayground(props) {
948
1035
  const { code, interactive = false, codeContract = "renderBody", preset = "auto", title, description, height = 360, expandedHeight = "70vh", expandable = true, resizable = true, resizeAxis = "vertical", previewPadding, className, dependencies, defaultImports, previewWrapperClassName = "h-[420px] rounded-xl border border-border bg-muted/30 p-3", seedgridDependency, bundlerURL, bundlerTimeoutMs, npmRegistries, withCard = true, collapsible = true, defaultOpen = true, cardId } = props;
949
1036
  const effectivePreviewPadding = normalizeCssSize(previewPadding ?? (codeContract === "appFile" ? 12 : 0));
@@ -990,14 +1077,14 @@ export default function SgPlayground(props) {
990
1077
  SgButton,
991
1078
  SgAutocomplete
992
1079
  } from "@seedgrid/fe-components";`;
993
- const appTsx = codeContract === "appFile"
1080
+ const appTsx = React.useMemo(() => codeContract === "appFile"
994
1081
  ? code
995
- : buildAppTsxFromRenderBody(code, seedgridDefaultImports, previewWrapperClassName);
1082
+ : buildAppTsxFromRenderBody(code, seedgridDefaultImports, previewWrapperClassName), [code, codeContract, previewWrapperClassName, seedgridDefaultImports]);
996
1083
  const resolvedSeedgridDependency = seedgridDependency ??
997
1084
  process.env.NEXT_PUBLIC_SANDPACK_SEEDGRID_DEPENDENCY ??
998
1085
  DEFAULT_SEEDGRID_DEPENDENCY;
999
- const requestedDeps = dependencies ?? {};
1000
- const requestedDepKeys = Object.keys(requestedDeps);
1086
+ const requestedDeps = React.useMemo(() => dependencies ?? {}, [dependencies]);
1087
+ const requestedDepKeys = React.useMemo(() => Object.keys(requestedDeps), [requestedDeps]);
1001
1088
  const resolvedBundlerURL = normalizeUrl(bundlerURL ?? process.env.NEXT_PUBLIC_SANDPACK_BUNDLER_URL, DEFAULT_SANDPACK_BUNDLER_URL);
1002
1089
  const resolvedBundlerTimeoutMs = normalizeTimeoutMs(bundlerTimeoutMs ??
1003
1090
  Number(process.env.NEXT_PUBLIC_SANDPACK_BUNDLER_TIMEOUT_MS ?? Number.NaN), DEFAULT_SANDPACK_BUNDLER_TIMEOUT_MS);
@@ -1045,134 +1132,260 @@ export default function SgPlayground(props) {
1045
1132
  // Shim lucide-react for all non-full presets to avoid OOM from bundling ~1400 icon components.
1046
1133
  // Full preset gets the real package so icons render correctly.
1047
1134
  const shouldShimLucide = includeSeedgridDependency && resolvedPreset !== "full" && !requestedDepKeys.includes("lucide-react");
1048
- const files = {
1049
- "/App.tsx": { code: appTsx, active: true },
1050
- "/styles.css": { code: sandpackStylesCss || buildSandpackStylesCss({}, effectivePreviewPadding) }
1051
- };
1052
- if (includeSeedgridDependency) {
1053
- // Intercept the package entry point and redirect to the pre-compiled sandbox bundle
1054
- // (dist/sandbox.cjs) instead of the tsc barrel file (dist/index.js).
1055
- // This makes the Sandpack bundler fetch and process ONE file instead of 200+ individual files.
1056
- // The real package.json from npm is left intact so version resolution works normally.
1057
- // Requires @seedgrid/fe-components to be built with: pnpm run build:sandbox
1058
- files["/node_modules/@seedgrid/fe-components/dist/index.js"] = {
1059
- code: `module.exports = require("./sandbox.cjs");`,
1060
- hidden: true
1061
- };
1062
- // Compatibility shim for legacy @seedgrid/fe-components builds that still import "qrcode" (node-only path).
1063
- files["/node_modules/qrcode/index.js"] = { code: SANDPACK_QRCODE_SHIM_INDEX_JS, hidden: true };
1064
- // Keep CRA's public/index.html entry path expected by the react/react-ts templates.
1065
- files["/public/index.html"] = { code: SANDPACK_TAILWIND_INDEX_HTML, hidden: true };
1066
- // Sandpack runtime can evaluate JSON files as plain JS modules.
1067
- // Provide CJS-compatible shims to keep @seedgrid/fe-components i18n/validators working.
1068
- // .json shims cover current npm versions; .js shims cover new versions after JSON→TypeScript conversion.
1069
- files["/node_modules/@seedgrid/fe-components/dist/i18n/pt-BR.json"] = {
1070
- code: SANDPACK_SEEDGRID_PT_BR_JSON_SHIM,
1071
- hidden: true
1072
- };
1073
- files["/node_modules/@seedgrid/fe-components/dist/i18n/pt-PT.json"] = {
1074
- code: SANDPACK_SEEDGRID_PT_PT_JSON_SHIM,
1075
- hidden: true
1076
- };
1077
- files["/node_modules/@seedgrid/fe-components/dist/i18n/en-US.json"] = {
1078
- code: SANDPACK_SEEDGRID_EN_US_JSON_SHIM,
1079
- hidden: true
1080
- };
1081
- files["/node_modules/@seedgrid/fe-components/dist/i18n/es.json"] = {
1082
- code: SANDPACK_SEEDGRID_ES_JSON_SHIM,
1083
- hidden: true
1084
- };
1085
- files["/node_modules/@seedgrid/fe-components/dist/blocked-email-domains.json"] = {
1086
- code: SANDPACK_SEEDGRID_BLOCKED_EMAIL_DOMAINS_JSON_SHIM,
1087
- hidden: true
1088
- };
1089
- files["/node_modules/@seedgrid/fe-components/dist/i18n/pt-BR.js"] = {
1090
- code: SANDPACK_SEEDGRID_LOCALE_JS_SHIM,
1091
- hidden: true
1092
- };
1093
- files["/node_modules/@seedgrid/fe-components/dist/i18n/pt-PT.js"] = {
1094
- code: SANDPACK_SEEDGRID_LOCALE_JS_SHIM,
1095
- hidden: true
1096
- };
1097
- files["/node_modules/@seedgrid/fe-components/dist/i18n/en-US.js"] = {
1098
- code: SANDPACK_SEEDGRID_LOCALE_JS_SHIM,
1099
- hidden: true
1100
- };
1101
- files["/node_modules/@seedgrid/fe-components/dist/i18n/es.js"] = {
1102
- code: SANDPACK_SEEDGRID_LOCALE_JS_SHIM,
1103
- hidden: true
1104
- };
1105
- files["/node_modules/@seedgrid/fe-components/dist/blocked-email-domains.js"] = {
1106
- code: SANDPACK_SEEDGRID_BLOCKED_EMAIL_JS_SHIM,
1107
- hidden: true
1108
- };
1109
- }
1110
- if (shouldIncludeNodePolyfills) {
1111
- // markdown-it CLI entry uses node:fs and breaks in browser runtime.
1112
- files["/node_modules/markdown-it/bin/markdown-it.mjs"] = {
1113
- code: SANDPACK_MARKDOWN_IT_BIN_SHIM,
1114
- hidden: true
1115
- };
1116
- // Node builtin compatibility shims used by transitive dependencies (e.g. argparse from markdown-it/tiptap).
1117
- files["/node_modules/assert/index.js"] = { code: SANDPACK_ASSERT_SHIM_INDEX_JS, hidden: true };
1118
- files["/node_modules/util/index.js"] = { code: SANDPACK_UTIL_SHIM_INDEX_JS, hidden: true };
1119
- files["/node_modules/path/index.js"] = { code: SANDPACK_PATH_SHIM_INDEX_JS, hidden: true };
1120
- files["/node_modules/fs/index.js"] = { code: SANDPACK_FS_SHIM_INDEX_JS, hidden: true };
1121
- files["/node_modules/process/index.js"] = { code: SANDPACK_PROCESS_SHIM_INDEX_JS, hidden: true };
1122
- }
1123
- if (shouldShimSandpackReact) {
1124
- files["/node_modules/@codesandbox/sandpack-react/index.js"] = {
1125
- code: SANDPACK_SANDBOX_SANDPACK_REACT_SHIM_INDEX_JS,
1126
- hidden: true
1127
- };
1128
- }
1129
- if (shouldShimTiptap) {
1130
- files["/node_modules/@seedgrid/fe-components/dist/inputs/SgTextEditor.js"] = {
1131
- code: SANDPACK_SEEDGRID_TEXT_EDITOR_SHIM_INDEX_JS,
1132
- hidden: true
1133
- };
1134
- files["/node_modules/@seedgrid/fe-components/dist/inputs/SgTextEditor.mjs"] = {
1135
- code: SANDPACK_SEEDGRID_TEXT_EDITOR_SHIM_INDEX_JS,
1136
- hidden: true
1135
+ React.useEffect(() => {
1136
+ if (!shouldIncludeNodePolyfills)
1137
+ return;
1138
+ if (typeof window === "undefined")
1139
+ return;
1140
+ const originalError = console.error;
1141
+ const originalWarn = console.warn;
1142
+ console.error = (...args) => {
1143
+ if (shouldSuppressCoreJsProviderWarning(args))
1144
+ return;
1145
+ originalError(...args);
1137
1146
  };
1138
- files["/node_modules/@tiptap/react/package.json"] = {
1139
- code: JSON.stringify({ name: "@tiptap/react", version: "0.0.0-shim", main: "index.js", module: "index.mjs" }),
1140
- hidden: true
1147
+ console.warn = (...args) => {
1148
+ if (shouldSuppressCoreJsProviderWarning(args))
1149
+ return;
1150
+ originalWarn(...args);
1141
1151
  };
1142
- files["/node_modules/@tiptap/react/index.js"] = {
1143
- code: SANDPACK_TIPTAP_REACT_SHIM_INDEX_JS,
1144
- hidden: true
1152
+ return () => {
1153
+ console.error = originalError;
1154
+ console.warn = originalWarn;
1145
1155
  };
1146
- files["/node_modules/@tiptap/react/index.mjs"] = {
1147
- code: SANDPACK_TIPTAP_REACT_SHIM_INDEX_JS,
1148
- hidden: true
1156
+ }, [shouldIncludeNodePolyfills]);
1157
+ const files = React.useMemo(() => {
1158
+ const nextFiles = {
1159
+ "/App.tsx": { code: appTsx, active: true },
1160
+ "/styles.css": { code: sandpackStylesCss || buildSandpackStylesCss({}, effectivePreviewPadding) }
1149
1161
  };
1150
- for (const packageName of TIPTAP_SHIM_PACKAGES) {
1151
- files[`/node_modules/${packageName}/package.json`] = {
1152
- code: JSON.stringify({ name: packageName, version: "0.0.0-shim", main: "index.js", module: "index.mjs" }),
1162
+ if (includeSeedgridDependency) {
1163
+ // Intercept the package entry point and redirect to the pre-compiled sandbox bundle
1164
+ // (dist/sandbox.cjs) instead of the tsc barrel file (dist/index.js).
1165
+ // This makes the Sandpack bundler fetch and process ONE file instead of 200+ individual files.
1166
+ // The real package.json from npm is left intact so version resolution works normally.
1167
+ // Requires @seedgrid/fe-components to be built with: pnpm run build:sandbox
1168
+ nextFiles["/node_modules/@seedgrid/fe-components/dist/index.js"] = {
1169
+ code: `module.exports = require("./sandbox.cjs");`,
1170
+ hidden: true
1171
+ };
1172
+ // Compatibility shim for legacy @seedgrid/fe-components builds that still import "qrcode" (node-only path).
1173
+ nextFiles["/node_modules/qrcode/index.js"] = { code: SANDPACK_QRCODE_SHIM_INDEX_JS, hidden: true };
1174
+ // Keep CRA's public/index.html entry path expected by the react/react-ts templates.
1175
+ nextFiles["/public/index.html"] = { code: SANDPACK_TAILWIND_INDEX_HTML, hidden: true };
1176
+ // Sandpack runtime can evaluate JSON files as plain JS modules.
1177
+ // Provide CJS-compatible shims to keep @seedgrid/fe-components i18n/validators working.
1178
+ // .json shims cover current npm versions; .js shims cover new versions after JSON→TypeScript conversion.
1179
+ nextFiles["/node_modules/@seedgrid/fe-components/dist/i18n/pt-BR.json"] = {
1180
+ code: SANDPACK_SEEDGRID_PT_BR_JSON_SHIM,
1181
+ hidden: true
1182
+ };
1183
+ nextFiles["/node_modules/@seedgrid/fe-components/dist/i18n/pt-PT.json"] = {
1184
+ code: SANDPACK_SEEDGRID_PT_PT_JSON_SHIM,
1185
+ hidden: true
1186
+ };
1187
+ nextFiles["/node_modules/@seedgrid/fe-components/dist/i18n/en-US.json"] = {
1188
+ code: SANDPACK_SEEDGRID_EN_US_JSON_SHIM,
1189
+ hidden: true
1190
+ };
1191
+ nextFiles["/node_modules/@seedgrid/fe-components/dist/i18n/es.json"] = {
1192
+ code: SANDPACK_SEEDGRID_ES_JSON_SHIM,
1193
+ hidden: true
1194
+ };
1195
+ nextFiles["/node_modules/@seedgrid/fe-components/dist/blocked-email-domains.json"] = {
1196
+ code: SANDPACK_SEEDGRID_BLOCKED_EMAIL_DOMAINS_JSON_SHIM,
1197
+ hidden: true
1198
+ };
1199
+ nextFiles["/node_modules/@seedgrid/fe-components/dist/i18n/pt-BR.js"] = {
1200
+ code: SANDPACK_SEEDGRID_LOCALE_JS_SHIM,
1201
+ hidden: true
1202
+ };
1203
+ nextFiles["/node_modules/@seedgrid/fe-components/dist/i18n/pt-PT.js"] = {
1204
+ code: SANDPACK_SEEDGRID_LOCALE_JS_SHIM,
1205
+ hidden: true
1206
+ };
1207
+ nextFiles["/node_modules/@seedgrid/fe-components/dist/i18n/en-US.js"] = {
1208
+ code: SANDPACK_SEEDGRID_LOCALE_JS_SHIM,
1153
1209
  hidden: true
1154
1210
  };
1155
- files[`/node_modules/${packageName}/index.js`] = {
1156
- code: SANDPACK_TIPTAP_EXTENSION_SHIM_INDEX_JS,
1211
+ nextFiles["/node_modules/@seedgrid/fe-components/dist/i18n/es.js"] = {
1212
+ code: SANDPACK_SEEDGRID_LOCALE_JS_SHIM,
1157
1213
  hidden: true
1158
1214
  };
1159
- files[`/node_modules/${packageName}/index.mjs`] = {
1160
- code: SANDPACK_TIPTAP_EXTENSION_SHIM_INDEX_JS,
1215
+ nextFiles["/node_modules/@seedgrid/fe-components/dist/blocked-email-domains.js"] = {
1216
+ code: SANDPACK_SEEDGRID_BLOCKED_EMAIL_JS_SHIM,
1161
1217
  hidden: true
1162
1218
  };
1163
1219
  }
1164
- }
1165
- if (shouldShimLucide) {
1166
- files["/node_modules/lucide-react/package.json"] = {
1167
- code: JSON.stringify({ name: "lucide-react", version: "0.0.0-shim", main: "index.js" }),
1168
- hidden: true
1169
- };
1170
- files["/node_modules/lucide-react/index.js"] = {
1171
- code: SANDPACK_LUCIDE_REACT_SHIM_INDEX_JS,
1172
- hidden: true
1173
- };
1174
- }
1175
- const deps = {
1220
+ if (shouldIncludeNodePolyfills) {
1221
+ const markdownItPackageShimPaths = [
1222
+ "/node_modules/markdown-it/package.json",
1223
+ "/node_modules/prosemirror-markdown/node_modules/markdown-it/package.json",
1224
+ "/node_modules/@tiptap/pm/node_modules/markdown-it/package.json",
1225
+ "/node_modules/@tiptap/pm/node_modules/prosemirror-markdown/node_modules/markdown-it/package.json"
1226
+ ];
1227
+ const markdownItBinShimPaths = [
1228
+ "/node_modules/markdown-it/bin/markdown-it.mjs",
1229
+ "/node_modules/prosemirror-markdown/node_modules/markdown-it/bin/markdown-it.mjs",
1230
+ "/node_modules/@tiptap/pm/node_modules/markdown-it/bin/markdown-it.mjs",
1231
+ "/node_modules/@tiptap/pm/node_modules/prosemirror-markdown/node_modules/markdown-it/bin/markdown-it.mjs"
1232
+ ];
1233
+ // Keep markdown-it package metadata browser-safe. In some Sandpack resolver paths,
1234
+ // `bin` can be chosen as entrypoint; forcing it to dist avoids node-only imports.
1235
+ for (const shimPath of markdownItPackageShimPaths) {
1236
+ nextFiles[shimPath] = {
1237
+ code: SANDPACK_MARKDOWN_IT_PACKAGE_JSON_SHIM,
1238
+ hidden: true
1239
+ };
1240
+ }
1241
+ // markdown-it CLI entry uses node:fs and breaks in browser runtime.
1242
+ for (const shimPath of markdownItBinShimPaths) {
1243
+ nextFiles[shimPath] = {
1244
+ code: SANDPACK_MARKDOWN_IT_BIN_SHIM,
1245
+ hidden: true
1246
+ };
1247
+ }
1248
+ // Node builtin compatibility shims used by transitive dependencies (e.g. argparse from markdown-it/tiptap).
1249
+ nextFiles["/node_modules/assert/package.json"] = {
1250
+ code: JSON.stringify({ name: "assert", version: "0.0.0-shim", main: "index.js" }),
1251
+ hidden: true
1252
+ };
1253
+ nextFiles["/node_modules/util/package.json"] = {
1254
+ code: JSON.stringify({ name: "util", version: "0.0.0-shim", main: "index.js" }),
1255
+ hidden: true
1256
+ };
1257
+ nextFiles["/node_modules/path/package.json"] = {
1258
+ code: JSON.stringify({ name: "path", version: "0.0.0-shim", main: "index.js" }),
1259
+ hidden: true
1260
+ };
1261
+ nextFiles["/node_modules/fs/package.json"] = {
1262
+ code: JSON.stringify({ name: "fs", version: "0.0.0-shim", main: "index.js" }),
1263
+ hidden: true
1264
+ };
1265
+ nextFiles["/node_modules/process/package.json"] = {
1266
+ code: JSON.stringify({ name: "process", version: "0.0.0-shim", main: "index.js" }),
1267
+ hidden: true
1268
+ };
1269
+ nextFiles["/node_modules/assert/index.js"] = { code: SANDPACK_ASSERT_SHIM_INDEX_JS, hidden: true };
1270
+ nextFiles["/node_modules/util/index.js"] = { code: SANDPACK_UTIL_SHIM_INDEX_JS, hidden: true };
1271
+ nextFiles["/node_modules/path/index.js"] = { code: SANDPACK_PATH_SHIM_INDEX_JS, hidden: true };
1272
+ nextFiles["/node_modules/fs/index.js"] = { code: SANDPACK_FS_SHIM_INDEX_JS, hidden: true };
1273
+ nextFiles["/node_modules/process/index.js"] = { code: SANDPACK_PROCESS_SHIM_INDEX_JS, hidden: true };
1274
+ // node:* specifiers are increasingly used by ESM packages.
1275
+ // Mirror aliases to the shims above so both `fs` and `node:fs` resolve.
1276
+ nextFiles["/node_modules/node:assert/package.json"] = {
1277
+ code: SANDPACK_NODE_ASSERT_PACKAGE_JSON_SHIM,
1278
+ hidden: true
1279
+ };
1280
+ nextFiles["/node_modules/node:assert/index.js"] = {
1281
+ code: SANDPACK_NODE_ASSERT_ALIAS_SHIM_INDEX_JS,
1282
+ hidden: true
1283
+ };
1284
+ nextFiles["/node_modules/node:util/package.json"] = {
1285
+ code: SANDPACK_NODE_UTIL_PACKAGE_JSON_SHIM,
1286
+ hidden: true
1287
+ };
1288
+ nextFiles["/node_modules/node:util/index.js"] = {
1289
+ code: SANDPACK_NODE_UTIL_ALIAS_SHIM_INDEX_JS,
1290
+ hidden: true
1291
+ };
1292
+ nextFiles["/node_modules/node:path/package.json"] = {
1293
+ code: SANDPACK_NODE_PATH_PACKAGE_JSON_SHIM,
1294
+ hidden: true
1295
+ };
1296
+ nextFiles["/node_modules/node:path/index.js"] = {
1297
+ code: SANDPACK_NODE_PATH_ALIAS_SHIM_INDEX_JS,
1298
+ hidden: true
1299
+ };
1300
+ nextFiles["/node_modules/node:fs/package.json"] = {
1301
+ code: SANDPACK_NODE_FS_PACKAGE_JSON_SHIM,
1302
+ hidden: true
1303
+ };
1304
+ nextFiles["/node_modules/node:fs/index.js"] = {
1305
+ code: SANDPACK_NODE_FS_ALIAS_SHIM_INDEX_JS,
1306
+ hidden: true
1307
+ };
1308
+ nextFiles["/node_modules/node:process/package.json"] = {
1309
+ code: SANDPACK_NODE_PROCESS_PACKAGE_JSON_SHIM,
1310
+ hidden: true
1311
+ };
1312
+ nextFiles["/node_modules/node:process/index.js"] = {
1313
+ code: SANDPACK_NODE_PROCESS_ALIAS_SHIM_INDEX_JS,
1314
+ hidden: true
1315
+ };
1316
+ nextFiles["/node_modules/node:fs/promises/package.json"] = {
1317
+ code: SANDPACK_NODE_FS_PROMISES_PACKAGE_JSON_SHIM,
1318
+ hidden: true
1319
+ };
1320
+ nextFiles["/node_modules/node:fs/promises/index.js"] = {
1321
+ code: SANDPACK_NODE_FS_PROMISES_ALIAS_SHIM_INDEX_JS,
1322
+ hidden: true
1323
+ };
1324
+ }
1325
+ if (shouldShimSandpackReact) {
1326
+ nextFiles["/node_modules/@codesandbox/sandpack-react/index.js"] = {
1327
+ code: SANDPACK_SANDBOX_SANDPACK_REACT_SHIM_INDEX_JS,
1328
+ hidden: true
1329
+ };
1330
+ }
1331
+ if (shouldShimTiptap) {
1332
+ nextFiles["/node_modules/@seedgrid/fe-components/dist/inputs/SgTextEditor.js"] = {
1333
+ code: SANDPACK_SEEDGRID_TEXT_EDITOR_SHIM_INDEX_JS,
1334
+ hidden: true
1335
+ };
1336
+ nextFiles["/node_modules/@seedgrid/fe-components/dist/inputs/SgTextEditor.mjs"] = {
1337
+ code: SANDPACK_SEEDGRID_TEXT_EDITOR_SHIM_INDEX_JS,
1338
+ hidden: true
1339
+ };
1340
+ nextFiles["/node_modules/@tiptap/react/package.json"] = {
1341
+ code: JSON.stringify({ name: "@tiptap/react", version: "0.0.0-shim", main: "index.js", module: "index.mjs" }),
1342
+ hidden: true
1343
+ };
1344
+ nextFiles["/node_modules/@tiptap/react/index.js"] = {
1345
+ code: SANDPACK_TIPTAP_REACT_SHIM_INDEX_JS,
1346
+ hidden: true
1347
+ };
1348
+ nextFiles["/node_modules/@tiptap/react/index.mjs"] = {
1349
+ code: SANDPACK_TIPTAP_REACT_SHIM_INDEX_JS,
1350
+ hidden: true
1351
+ };
1352
+ for (const packageName of TIPTAP_SHIM_PACKAGES) {
1353
+ nextFiles[`/node_modules/${packageName}/package.json`] = {
1354
+ code: JSON.stringify({ name: packageName, version: "0.0.0-shim", main: "index.js", module: "index.mjs" }),
1355
+ hidden: true
1356
+ };
1357
+ nextFiles[`/node_modules/${packageName}/index.js`] = {
1358
+ code: SANDPACK_TIPTAP_EXTENSION_SHIM_INDEX_JS,
1359
+ hidden: true
1360
+ };
1361
+ nextFiles[`/node_modules/${packageName}/index.mjs`] = {
1362
+ code: SANDPACK_TIPTAP_EXTENSION_SHIM_INDEX_JS,
1363
+ hidden: true
1364
+ };
1365
+ }
1366
+ }
1367
+ if (shouldShimLucide) {
1368
+ nextFiles["/node_modules/lucide-react/package.json"] = {
1369
+ code: JSON.stringify({ name: "lucide-react", version: "0.0.0-shim", main: "index.js" }),
1370
+ hidden: true
1371
+ };
1372
+ nextFiles["/node_modules/lucide-react/index.js"] = {
1373
+ code: SANDPACK_LUCIDE_REACT_SHIM_INDEX_JS,
1374
+ hidden: true
1375
+ };
1376
+ }
1377
+ return nextFiles;
1378
+ }, [
1379
+ appTsx,
1380
+ effectivePreviewPadding,
1381
+ includeSeedgridDependency,
1382
+ sandpackStylesCss,
1383
+ shouldIncludeNodePolyfills,
1384
+ shouldShimLucide,
1385
+ shouldShimSandpackReact,
1386
+ shouldShimTiptap
1387
+ ]);
1388
+ const deps = React.useMemo(() => ({
1176
1389
  ...DEFAULT_SANDBOX_BASE_DEPENDENCIES,
1177
1390
  ...(includeSeedgridDependency ? DEFAULT_SEEDGRID_RUNTIME_DEPENDENCIES : {}),
1178
1391
  ...(includeSeedgridDependency && !shouldShimLucide ? { "lucide-react": "^0.468.0" } : {}),
@@ -1181,7 +1394,15 @@ export default function SgPlayground(props) {
1181
1394
  ...(shouldIncludeNodePolyfills ? DEFAULT_SANDPACK_POLYFILLS : {}),
1182
1395
  ...(includeSeedgridDependency ? { "@seedgrid/fe-components": resolvedSeedgridDependency } : {}),
1183
1396
  ...requestedDeps
1184
- };
1397
+ }), [
1398
+ includeEditorDependencies,
1399
+ includeSandpackReactDependency,
1400
+ includeSeedgridDependency,
1401
+ requestedDeps,
1402
+ resolvedSeedgridDependency,
1403
+ shouldIncludeNodePolyfills,
1404
+ shouldShimLucide
1405
+ ]);
1185
1406
  const currentHeight = isExpanded ? expandedHeight : height;
1186
1407
  const resizeClass = !resizable
1187
1408
  ? undefined