@seedgrid/fe-components 2026.3.2-9 → 2026.3.3-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.
@@ -1 +1 @@
1
- {"version":3,"file":"SgPlayground.d.ts","sourceRoot":"","sources":["../../src/others/SgPlayground.tsx"],"names":[],"mappings":"AAiBA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IACxC,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,UAAU,GAAG,YAAY,GAAG,MAAM,CAAC;IAChD,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,uBAAuB,EAAE,CAAC;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CA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AAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,uBAAuB,EAAE,CAAC;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,GAAG,MAAM,CAAC;AACnF,MAAM,MAAM,uBAAuB,GAAG;IACpC,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,EAAE,OAAO,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAixBF,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC,iBAAiB,CAAC,2CAgbtE"}
@@ -15,9 +15,31 @@ const DEFAULT_SANDBOX_BASE_DEPENDENCIES = {
15
15
  "react-dom": "18.2.0"
16
16
  };
17
17
  const DEFAULT_SEEDGRID_RUNTIME_DEPENDENCIES = {
18
- "react-hook-form": "^7.0.0",
19
- "lucide-react": "^0.468.0"
18
+ "react-hook-form": "^7.0.0"
20
19
  };
20
+ // lucide-react is a heavy peer dep (~1400 icons). For non-full presets we shim it with
21
+ // a generic SVG placeholder to avoid OOM in the browser bundler.
22
+ const SANDPACK_LUCIDE_REACT_SHIM_INDEX_JS = `const React = require("react");
23
+ const Icon = function(props) {
24
+ return React.createElement("svg", {
25
+ xmlns: "http://www.w3.org/2000/svg",
26
+ width: props.size || props.width || 16,
27
+ height: props.size || props.height || 16,
28
+ viewBox: "0 0 24 24",
29
+ fill: "none",
30
+ stroke: props.color || "currentColor",
31
+ strokeWidth: props.strokeWidth || 2,
32
+ className: props.className
33
+ });
34
+ };
35
+ const proxy = new Proxy({}, {
36
+ get: function(_, key) {
37
+ if (key === "__esModule") return true;
38
+ return Icon;
39
+ }
40
+ });
41
+ module.exports = proxy;
42
+ `;
21
43
  const DEFAULT_SEEDGRID_EDITOR_DEPENDENCIES = {
22
44
  "@tiptap/core": "^2.9.1",
23
45
  "@tiptap/react": "^2.9.1",
@@ -785,11 +807,28 @@ export default function SgPlayground(props) {
785
807
  const shouldShimSandpackReact = includeSeedgridDependency && !includeSandpackReactDependency;
786
808
  const shouldShimTiptap = includeSeedgridDependency && !includeEditorDependencies;
787
809
  const shouldIncludeNodePolyfills = includeEditorDependencies;
810
+ // Shim lucide-react for all non-full presets to avoid OOM from bundling ~1400 icon components.
811
+ // Full preset gets the real package so icons render correctly.
812
+ const shouldShimLucide = includeSeedgridDependency && resolvedPreset !== "full" && !requestedDepKeys.includes("lucide-react");
788
813
  const files = {
789
814
  "/App.tsx": { code: appTsx, active: true },
790
815
  "/styles.css": { code: sandpackStylesCss || buildSandpackStylesCss({}, effectivePreviewPadding) }
791
816
  };
792
817
  if (includeSeedgridDependency) {
818
+ // Override @seedgrid/fe-components package.json to point at the pre-compiled sandbox bundle
819
+ // (dist/sandbox.cjs) instead of the tsc barrel file (dist/index.js).
820
+ // This makes the Sandpack bundler fetch and process ONE file instead of 200+ individual files,
821
+ // which dramatically reduces memory usage and eliminates "loading everything" on every run.
822
+ // Requires @seedgrid/fe-components to be built with: pnpm run build:sandbox
823
+ files["/node_modules/@seedgrid/fe-components/package.json"] = {
824
+ code: JSON.stringify({
825
+ name: "@seedgrid/fe-components",
826
+ version: "0.0.0-sandbox",
827
+ main: "dist/sandbox.cjs",
828
+ exports: { ".": { require: "./dist/sandbox.cjs", default: "./dist/sandbox.cjs" } }
829
+ }),
830
+ hidden: true
831
+ };
793
832
  // Compatibility shim for legacy @seedgrid/fe-components builds that still import "qrcode" (node-only path).
794
833
  files["/node_modules/qrcode/index.js"] = { code: SANDPACK_QRCODE_SHIM_INDEX_JS, hidden: true };
795
834
  // Sandpack runtime can evaluate JSON files as plain JS modules.
@@ -839,12 +878,12 @@ export default function SgPlayground(props) {
839
878
  code: SANDPACK_SEEDGRID_TEXT_EDITOR_SHIM_INDEX_JS,
840
879
  hidden: true
841
880
  };
842
- files["/node_modules/@seedgrid/fe-components/dist/inputs/SgTextEditor"] = {
881
+ files["/node_modules/@seedgrid/fe-components/dist/inputs/SgTextEditor.mjs"] = {
843
882
  code: SANDPACK_SEEDGRID_TEXT_EDITOR_SHIM_INDEX_JS,
844
883
  hidden: true
845
884
  };
846
- files["/node_modules/@seedgrid/fe-components/dist/inputs/SgTextEditor.mjs"] = {
847
- code: SANDPACK_SEEDGRID_TEXT_EDITOR_SHIM_INDEX_JS,
885
+ files["/node_modules/@tiptap/react/package.json"] = {
886
+ code: JSON.stringify({ name: "@tiptap/react", version: "0.0.0-shim", main: "index.js", module: "index.mjs" }),
848
887
  hidden: true
849
888
  };
850
889
  files["/node_modules/@tiptap/react/index.js"] = {
@@ -856,6 +895,10 @@ export default function SgPlayground(props) {
856
895
  hidden: true
857
896
  };
858
897
  for (const packageName of TIPTAP_SHIM_PACKAGES) {
898
+ files[`/node_modules/${packageName}/package.json`] = {
899
+ code: JSON.stringify({ name: packageName, version: "0.0.0-shim", main: "index.js", module: "index.mjs" }),
900
+ hidden: true
901
+ };
859
902
  files[`/node_modules/${packageName}/index.js`] = {
860
903
  code: SANDPACK_TIPTAP_EXTENSION_SHIM_INDEX_JS,
861
904
  hidden: true
@@ -866,9 +909,20 @@ export default function SgPlayground(props) {
866
909
  };
867
910
  }
868
911
  }
912
+ if (shouldShimLucide) {
913
+ files["/node_modules/lucide-react/package.json"] = {
914
+ code: JSON.stringify({ name: "lucide-react", version: "0.0.0-shim", main: "index.js" }),
915
+ hidden: true
916
+ };
917
+ files["/node_modules/lucide-react/index.js"] = {
918
+ code: SANDPACK_LUCIDE_REACT_SHIM_INDEX_JS,
919
+ hidden: true
920
+ };
921
+ }
869
922
  const deps = {
870
923
  ...DEFAULT_SANDBOX_BASE_DEPENDENCIES,
871
924
  ...(includeSeedgridDependency ? DEFAULT_SEEDGRID_RUNTIME_DEPENDENCIES : {}),
925
+ ...(includeSeedgridDependency && !shouldShimLucide ? { "lucide-react": "^0.468.0" } : {}),
872
926
  ...(includeEditorDependencies ? DEFAULT_SEEDGRID_EDITOR_DEPENDENCIES : {}),
873
927
  ...(includeSandpackReactDependency ? DEFAULT_SANDBOX_HOST_DEPENDENCIES : {}),
874
928
  ...(shouldIncludeNodePolyfills ? DEFAULT_SANDPACK_POLYFILLS : {}),
@@ -897,8 +951,8 @@ export default function SgPlayground(props) {
897
951
  bundlerTimeout: resolvedBundlerTimeoutMs,
898
952
  activeFile: "/App.tsx",
899
953
  visibleFiles: ["/App.tsx"],
900
- externalResources: SANDPACK_EXTERNAL_RESOURCES
901
- }), [resolvedBundlerTimeoutMs, resolvedBundlerURL]);
954
+ externalResources: includeSeedgridDependency ? SANDPACK_EXTERNAL_RESOURCES : []
955
+ }), [includeSeedgridDependency, resolvedBundlerTimeoutMs, resolvedBundlerURL]);
902
956
  const content = interactive ? (_jsx("div", { className: cn(withCard ? "" : "rounded-lg border border-border", withCard ? undefined : className), children: _jsxs(SandpackProvider, { template: "react-ts", files: files, customSetup: sandpackCustomSetup, options: sandpackOptions, children: [_jsx("style", { children: SANDPACK_HOST_STYLES_CSS }), _jsxs("div", { className: "flex items-center justify-between border-b border-border px-3 py-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [withCard ? null : _jsx("span", { className: "text-sm font-medium", children: title ?? "Example" }), _jsx("span", { className: "text-xs text-muted-foreground", children: codeContract === "renderBody" ? "editable snippet" : "editable App.tsx" })] }), _jsxs("div", { className: "flex items-center gap-2", children: [expandable ? (_jsx(SgButton, { appearance: "outline", size: "sm", onClick: () => setIsExpanded((prev) => !prev), children: isExpanded ? "Reduzir" : "Expandir" })) : null, _jsx(RunButton, { onRun: () => setActivePanel("preview") })] })] }), _jsxs("div", { className: "flex md:hidden border-b border-border", children: [_jsx("button", { type: "button", className: cn("flex-1 py-2 text-sm font-medium border-b-2 -mb-px transition-colors", activePanel === "code"
903
957
  ? "border-primary text-foreground"
904
958
  : "border-transparent text-muted-foreground hover:text-foreground"), onClick: () => setActivePanel("code"), children: "C\u00F3digo" }), _jsx("button", { type: "button", className: cn("flex-1 py-2 text-sm font-medium border-b-2 -mb-px transition-colors", activePanel === "preview"