@seedgrid/fe-playground 0.1.0 → 2026.3.19-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.
- package/README.md +78 -17
- package/dist/SgPlayground.js +340 -340
- package/package.json +49 -49
package/README.md
CHANGED
|
@@ -1,17 +1,78 @@
|
|
|
1
|
-
# @seedgrid/fe-playground
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
```
|
|
1
|
+
# @seedgrid/fe-playground
|
|
2
|
+
|
|
3
|
+
Wrapper leve em torno do `SgPlayground`, um componente baseado em Sandpack que combina editor, preview e runtime SeedGrid dentro de um card responsivo.
|
|
4
|
+
|
|
5
|
+
## Características
|
|
6
|
+
|
|
7
|
+
- Presets (`auto`, `basic`, `seedgrid`, `editor`, `full`) que ajustam dependências, shims e comportamento do bundler.
|
|
8
|
+
- Experiência integrada com botões e cartões SeedGrid (`SgButton`, `SgCard`), incluindo cabeçalho customizável e modos colapsáveis.
|
|
9
|
+
- Suporte a registries NPM privadas através de `npmRegistries`, controle de tamanho (`resizable`, `height`, `expandedHeight`) e carregamento automático de dependências (`seedgridDependency`).
|
|
10
|
+
- Ambiente seguro para bibliotecas pesadas: evita o download de lucide, markdown-it e qrcode quando o preset não exige.
|
|
11
|
+
- Hooks internos do Sandpack via `SandpackProvider`, `SandpackCodeEditor` e `SandpackPreview`.
|
|
12
|
+
|
|
13
|
+
## Instalação
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pnpm add @seedgrid/fe-playground @seedgrid/fe-components
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Como utilizar
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
import { SgPlayground } from "@seedgrid/fe-playground";
|
|
23
|
+
|
|
24
|
+
export function PlaygroundExample() {
|
|
25
|
+
return (
|
|
26
|
+
<SgPlayground
|
|
27
|
+
code={`<>Olá SeedGrid!</>`}
|
|
28
|
+
preset="seedgrid"
|
|
29
|
+
interactive
|
|
30
|
+
title="Experimentando componentes"
|
|
31
|
+
description="Duplo clique para editar o código do componente."
|
|
32
|
+
expandedHeight="500px"
|
|
33
|
+
resizable
|
|
34
|
+
previewPadding={24}
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Props em destaque
|
|
41
|
+
|
|
42
|
+
- `code`: string com JSX/TSX inicial.
|
|
43
|
+
- `preset`: escolhe configurações prontas (`auto`, `basic`, `seedgrid`, `editor`, `full`).
|
|
44
|
+
- `interactive`: ativa interação no preview.
|
|
45
|
+
- `dependencies`: adiciona dependências extras ao sandbox.
|
|
46
|
+
- `npmRegistries`: lista de registries private com `registryUrl`, `enabledScopes` e `registryAuthToken`.
|
|
47
|
+
- `expandable`, `collapsible`, `defaultOpen`: controla se o card inicia aberto e pode ser recolhido.
|
|
48
|
+
- `seedgridDependency`: força uma versão específica da runtime SeedGrid.
|
|
49
|
+
|
|
50
|
+
## Recursos
|
|
51
|
+
|
|
52
|
+
- [Sandpack React](https://sandpack.codesandbox.io) para editor + preview isolado.
|
|
53
|
+
- Fidelity SeedGrid com `SgButton`, `SgCard` e estilos compartilhados.
|
|
54
|
+
- Presets que simulam o ambiente dos componentes oficiais do design system.
|
|
55
|
+
|
|
56
|
+
## Exemplo avançado
|
|
57
|
+
|
|
58
|
+
```tsx
|
|
59
|
+
<SgPlayground
|
|
60
|
+
code={`<Badge label="Novo!" color="success" />`}
|
|
61
|
+
preset="full"
|
|
62
|
+
withCard
|
|
63
|
+
collapsible
|
|
64
|
+
defaultOpen={false}
|
|
65
|
+
npmRegistries={[
|
|
66
|
+
{
|
|
67
|
+
registryUrl: "https://registry.npmjs.org/",
|
|
68
|
+
enabledScopes: ["@seedgrid"],
|
|
69
|
+
limitToScopes: true
|
|
70
|
+
}
|
|
71
|
+
]}
|
|
72
|
+
dependencies={{
|
|
73
|
+
"@seedgrid/fe-components": "workspace:*",
|
|
74
|
+
"@seedgrid/fe-theme": "workspace:*"
|
|
75
|
+
}}
|
|
76
|
+
/>
|
|
77
|
+
```
|
|
78
|
+
|
package/dist/SgPlayground.js
CHANGED
|
@@ -18,26 +18,26 @@ const DEFAULT_SEEDGRID_RUNTIME_DEPENDENCIES = {
|
|
|
18
18
|
};
|
|
19
19
|
// lucide-react is a heavy peer dep (~1400 icons). For non-full presets we shim it with
|
|
20
20
|
// a generic SVG placeholder to avoid OOM in the browser bundler.
|
|
21
|
-
const SANDPACK_LUCIDE_REACT_SHIM_INDEX_JS = `const React = require("react");
|
|
22
|
-
const Icon = function(props) {
|
|
23
|
-
return React.createElement("svg", {
|
|
24
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
25
|
-
width: props.size || props.width || 16,
|
|
26
|
-
height: props.size || props.height || 16,
|
|
27
|
-
viewBox: "0 0 24 24",
|
|
28
|
-
fill: "none",
|
|
29
|
-
stroke: props.color || "currentColor",
|
|
30
|
-
strokeWidth: props.strokeWidth || 2,
|
|
31
|
-
className: props.className
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
const proxy = new Proxy({}, {
|
|
35
|
-
get: function(_, key) {
|
|
36
|
-
if (key === "__esModule") return true;
|
|
37
|
-
return Icon;
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
module.exports = proxy;
|
|
21
|
+
const SANDPACK_LUCIDE_REACT_SHIM_INDEX_JS = `const React = require("react");
|
|
22
|
+
const Icon = function(props) {
|
|
23
|
+
return React.createElement("svg", {
|
|
24
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
25
|
+
width: props.size || props.width || 16,
|
|
26
|
+
height: props.size || props.height || 16,
|
|
27
|
+
viewBox: "0 0 24 24",
|
|
28
|
+
fill: "none",
|
|
29
|
+
stroke: props.color || "currentColor",
|
|
30
|
+
strokeWidth: props.strokeWidth || 2,
|
|
31
|
+
className: props.className
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
const proxy = new Proxy({}, {
|
|
35
|
+
get: function(_, key) {
|
|
36
|
+
if (key === "__esModule") return true;
|
|
37
|
+
return Icon;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
module.exports = proxy;
|
|
41
41
|
`;
|
|
42
42
|
const DEFAULT_SEEDGRID_EDITOR_DEPENDENCIES = {
|
|
43
43
|
"@tiptap/core": "^2.9.1",
|
|
@@ -79,26 +79,26 @@ const TIPTAP_SHIM_PACKAGES = [
|
|
|
79
79
|
"@tiptap/extension-font-family"
|
|
80
80
|
];
|
|
81
81
|
const SANDPACK_EXTERNAL_RESOURCES = [];
|
|
82
|
-
const SANDPACK_QRCODE_SHIM_INDEX_JS = `const makeError = () =>
|
|
83
|
-
new Error(
|
|
84
|
-
"qrcode (node build) is not supported in Sandpack browser runtime. Update @seedgrid/fe-components to a browser-safe QR implementation."
|
|
85
|
-
);
|
|
86
|
-
|
|
87
|
-
const qrcodeShim = {
|
|
88
|
-
toDataURL() {
|
|
89
|
-
return Promise.reject(makeError());
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
export const toDataURL = (...args) => qrcodeShim.toDataURL(...args);
|
|
94
|
-
export default qrcodeShim;
|
|
82
|
+
const SANDPACK_QRCODE_SHIM_INDEX_JS = `const makeError = () =>
|
|
83
|
+
new Error(
|
|
84
|
+
"qrcode (node build) is not supported in Sandpack browser runtime. Update @seedgrid/fe-components to a browser-safe QR implementation."
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
const qrcodeShim = {
|
|
88
|
+
toDataURL() {
|
|
89
|
+
return Promise.reject(makeError());
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export const toDataURL = (...args) => qrcodeShim.toDataURL(...args);
|
|
94
|
+
export default qrcodeShim;
|
|
95
95
|
`;
|
|
96
|
-
const SANDPACK_MARKDOWN_IT_BIN_SHIM = `import markdownit from "../index.mjs";
|
|
97
|
-
|
|
98
|
-
// Browser-safe shim: Sandpack must not execute markdown-it CLI entrypoint.
|
|
99
|
-
// Re-export parser factory so accidental imports of the bin path remain harmless.
|
|
100
|
-
export default markdownit;
|
|
101
|
-
export { markdownit };
|
|
96
|
+
const SANDPACK_MARKDOWN_IT_BIN_SHIM = `import markdownit from "../index.mjs";
|
|
97
|
+
|
|
98
|
+
// Browser-safe shim: Sandpack must not execute markdown-it CLI entrypoint.
|
|
99
|
+
// Re-export parser factory so accidental imports of the bin path remain harmless.
|
|
100
|
+
export default markdownit;
|
|
101
|
+
export { markdownit };
|
|
102
102
|
`;
|
|
103
103
|
const SANDPACK_MARKDOWN_IT_PACKAGE_JSON_SHIM = JSON.stringify({
|
|
104
104
|
name: "markdown-it",
|
|
@@ -120,230 +120,230 @@ const SANDPACK_MARKDOWN_IT_PACKAGE_JSON_SHIM = JSON.stringify({
|
|
|
120
120
|
"markdown-it": "dist/index.cjs.js"
|
|
121
121
|
}
|
|
122
122
|
});
|
|
123
|
-
const SANDPACK_SANDBOX_SANDPACK_REACT_SHIM_INDEX_JS = `export const SandpackProvider = ({ children }) => children ?? null;
|
|
124
|
-
export const SandpackCodeEditor = () => null;
|
|
125
|
-
export const SandpackPreview = () => null;
|
|
126
|
-
export const useSandpack = () => ({
|
|
127
|
-
sandpack: {
|
|
128
|
-
activeFile: "/App.tsx",
|
|
129
|
-
files: { "/App.tsx": { code: "" } },
|
|
130
|
-
runSandpack: async () => {},
|
|
131
|
-
clients: {},
|
|
132
|
-
status: "idle"
|
|
133
|
-
},
|
|
134
|
-
dispatch: () => {},
|
|
135
|
-
listen: () => () => {}
|
|
136
|
-
});
|
|
137
|
-
export default {};
|
|
123
|
+
const SANDPACK_SANDBOX_SANDPACK_REACT_SHIM_INDEX_JS = `export const SandpackProvider = ({ children }) => children ?? null;
|
|
124
|
+
export const SandpackCodeEditor = () => null;
|
|
125
|
+
export const SandpackPreview = () => null;
|
|
126
|
+
export const useSandpack = () => ({
|
|
127
|
+
sandpack: {
|
|
128
|
+
activeFile: "/App.tsx",
|
|
129
|
+
files: { "/App.tsx": { code: "" } },
|
|
130
|
+
runSandpack: async () => {},
|
|
131
|
+
clients: {},
|
|
132
|
+
status: "idle"
|
|
133
|
+
},
|
|
134
|
+
dispatch: () => {},
|
|
135
|
+
listen: () => () => {}
|
|
136
|
+
});
|
|
137
|
+
export default {};
|
|
138
138
|
`;
|
|
139
|
-
const SANDPACK_TIPTAP_REACT_SHIM_INDEX_JS = `export const EditorContent = () => null;
|
|
140
|
-
export const BubbleMenu = () => null;
|
|
141
|
-
export const FloatingMenu = () => null;
|
|
142
|
-
export const useEditor = () => null;
|
|
143
|
-
export default {};
|
|
139
|
+
const SANDPACK_TIPTAP_REACT_SHIM_INDEX_JS = `export const EditorContent = () => null;
|
|
140
|
+
export const BubbleMenu = () => null;
|
|
141
|
+
export const FloatingMenu = () => null;
|
|
142
|
+
export const useEditor = () => null;
|
|
143
|
+
export default {};
|
|
144
144
|
`;
|
|
145
|
-
const SANDPACK_TIPTAP_EXTENSION_SHIM_INDEX_JS = `const extension = {
|
|
146
|
-
configure() {
|
|
147
|
-
return extension;
|
|
148
|
-
},
|
|
149
|
-
extend() {
|
|
150
|
-
return extension;
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
export default extension;
|
|
145
|
+
const SANDPACK_TIPTAP_EXTENSION_SHIM_INDEX_JS = `const extension = {
|
|
146
|
+
configure() {
|
|
147
|
+
return extension;
|
|
148
|
+
},
|
|
149
|
+
extend() {
|
|
150
|
+
return extension;
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
export default extension;
|
|
154
154
|
`;
|
|
155
|
-
const SANDPACK_SEEDGRID_TEXT_EDITOR_SHIM_INDEX_JS = `import * as React from "react";
|
|
156
|
-
|
|
157
|
-
export function SgTextEditor() {
|
|
158
|
-
return React.createElement(
|
|
159
|
-
"div",
|
|
160
|
-
{
|
|
161
|
-
style: {
|
|
162
|
-
padding: "0.75rem",
|
|
163
|
-
border: "1px solid #e4e4e7",
|
|
164
|
-
borderRadius: "0.5rem",
|
|
165
|
-
fontSize: "0.875rem",
|
|
166
|
-
color: "#6b7280",
|
|
167
|
-
background: "#f9fafb"
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
"SgTextEditor is disabled in this sandbox preset."
|
|
171
|
-
);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
export default SgTextEditor;
|
|
155
|
+
const SANDPACK_SEEDGRID_TEXT_EDITOR_SHIM_INDEX_JS = `import * as React from "react";
|
|
156
|
+
|
|
157
|
+
export function SgTextEditor() {
|
|
158
|
+
return React.createElement(
|
|
159
|
+
"div",
|
|
160
|
+
{
|
|
161
|
+
style: {
|
|
162
|
+
padding: "0.75rem",
|
|
163
|
+
border: "1px solid #e4e4e7",
|
|
164
|
+
borderRadius: "0.5rem",
|
|
165
|
+
fontSize: "0.875rem",
|
|
166
|
+
color: "#6b7280",
|
|
167
|
+
background: "#f9fafb"
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
"SgTextEditor is disabled in this sandbox preset."
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export default SgTextEditor;
|
|
175
175
|
`;
|
|
176
|
-
const SANDPACK_ASSERT_SHIM_INDEX_JS = `function fail(message) {
|
|
177
|
-
throw new Error(message || "Assertion failed");
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
function assert(value, message) {
|
|
181
|
-
if (!value) fail(message);
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
assert.ok = assert;
|
|
185
|
-
assert.equal = function equal(actual, expected, message) {
|
|
186
|
-
if (actual != expected) fail(message || "Expected values to be loosely equal");
|
|
187
|
-
};
|
|
188
|
-
assert.strictEqual = function strictEqual(actual, expected, message) {
|
|
189
|
-
if (actual !== expected) fail(message || "Expected values to be strictly equal");
|
|
190
|
-
};
|
|
191
|
-
assert.notEqual = function notEqual(actual, expected, message) {
|
|
192
|
-
if (actual == expected) fail(message || "Expected values to be different");
|
|
193
|
-
};
|
|
194
|
-
assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
|
|
195
|
-
if (actual === expected) fail(message || "Expected values to be different");
|
|
196
|
-
};
|
|
197
|
-
assert.deepEqual = function deepEqual(actual, expected, message) {
|
|
198
|
-
try {
|
|
199
|
-
if (JSON.stringify(actual) !== JSON.stringify(expected)) {
|
|
200
|
-
fail(message || "Expected values to be deeply equal");
|
|
201
|
-
}
|
|
202
|
-
} catch (_) {
|
|
203
|
-
if (actual !== expected) fail(message || "Expected values to be deeply equal");
|
|
204
|
-
}
|
|
205
|
-
};
|
|
206
|
-
assert.throws = function throwsAssertion(fn, message) {
|
|
207
|
-
var didThrow = false;
|
|
208
|
-
try { fn(); } catch (_) { didThrow = true; }
|
|
209
|
-
if (!didThrow) fail(message || "Expected function to throw");
|
|
210
|
-
};
|
|
211
|
-
assert.fail = fail;
|
|
212
|
-
|
|
213
|
-
module.exports = assert;
|
|
214
|
-
module.exports.default = assert;
|
|
176
|
+
const SANDPACK_ASSERT_SHIM_INDEX_JS = `function fail(message) {
|
|
177
|
+
throw new Error(message || "Assertion failed");
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
function assert(value, message) {
|
|
181
|
+
if (!value) fail(message);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
assert.ok = assert;
|
|
185
|
+
assert.equal = function equal(actual, expected, message) {
|
|
186
|
+
if (actual != expected) fail(message || "Expected values to be loosely equal");
|
|
187
|
+
};
|
|
188
|
+
assert.strictEqual = function strictEqual(actual, expected, message) {
|
|
189
|
+
if (actual !== expected) fail(message || "Expected values to be strictly equal");
|
|
190
|
+
};
|
|
191
|
+
assert.notEqual = function notEqual(actual, expected, message) {
|
|
192
|
+
if (actual == expected) fail(message || "Expected values to be different");
|
|
193
|
+
};
|
|
194
|
+
assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
|
|
195
|
+
if (actual === expected) fail(message || "Expected values to be different");
|
|
196
|
+
};
|
|
197
|
+
assert.deepEqual = function deepEqual(actual, expected, message) {
|
|
198
|
+
try {
|
|
199
|
+
if (JSON.stringify(actual) !== JSON.stringify(expected)) {
|
|
200
|
+
fail(message || "Expected values to be deeply equal");
|
|
201
|
+
}
|
|
202
|
+
} catch (_) {
|
|
203
|
+
if (actual !== expected) fail(message || "Expected values to be deeply equal");
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
assert.throws = function throwsAssertion(fn, message) {
|
|
207
|
+
var didThrow = false;
|
|
208
|
+
try { fn(); } catch (_) { didThrow = true; }
|
|
209
|
+
if (!didThrow) fail(message || "Expected function to throw");
|
|
210
|
+
};
|
|
211
|
+
assert.fail = fail;
|
|
212
|
+
|
|
213
|
+
module.exports = assert;
|
|
214
|
+
module.exports.default = assert;
|
|
215
215
|
`;
|
|
216
|
-
const SANDPACK_UTIL_SHIM_INDEX_JS = `const inspect = function inspect(value) {
|
|
217
|
-
try {
|
|
218
|
-
return JSON.stringify(value);
|
|
219
|
-
} catch (_) {
|
|
220
|
-
return String(value);
|
|
221
|
-
}
|
|
222
|
-
};
|
|
223
|
-
|
|
224
|
-
inspect.custom = typeof Symbol !== "undefined" && Symbol.for
|
|
225
|
-
? Symbol.for("nodejs.util.inspect.custom")
|
|
226
|
-
: "@@nodejs.util.inspect.custom";
|
|
227
|
-
|
|
228
|
-
function deprecate(fn, message) {
|
|
229
|
-
var warned = false;
|
|
230
|
-
return function deprecatedWrapper() {
|
|
231
|
-
if (!warned && typeof console !== "undefined" && typeof console.warn === "function") {
|
|
232
|
-
console.warn(message);
|
|
233
|
-
warned = true;
|
|
234
|
-
}
|
|
235
|
-
return fn.apply(this, arguments);
|
|
236
|
-
};
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
function format() {
|
|
240
|
-
return Array.prototype.map.call(arguments, function (item) {
|
|
241
|
-
return String(item);
|
|
242
|
-
}).join(" ");
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
const utilShim = { inspect, deprecate, format };
|
|
246
|
-
module.exports = utilShim;
|
|
247
|
-
module.exports.default = utilShim;
|
|
216
|
+
const SANDPACK_UTIL_SHIM_INDEX_JS = `const inspect = function inspect(value) {
|
|
217
|
+
try {
|
|
218
|
+
return JSON.stringify(value);
|
|
219
|
+
} catch (_) {
|
|
220
|
+
return String(value);
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
inspect.custom = typeof Symbol !== "undefined" && Symbol.for
|
|
225
|
+
? Symbol.for("nodejs.util.inspect.custom")
|
|
226
|
+
: "@@nodejs.util.inspect.custom";
|
|
227
|
+
|
|
228
|
+
function deprecate(fn, message) {
|
|
229
|
+
var warned = false;
|
|
230
|
+
return function deprecatedWrapper() {
|
|
231
|
+
if (!warned && typeof console !== "undefined" && typeof console.warn === "function") {
|
|
232
|
+
console.warn(message);
|
|
233
|
+
warned = true;
|
|
234
|
+
}
|
|
235
|
+
return fn.apply(this, arguments);
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
function format() {
|
|
240
|
+
return Array.prototype.map.call(arguments, function (item) {
|
|
241
|
+
return String(item);
|
|
242
|
+
}).join(" ");
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
const utilShim = { inspect, deprecate, format };
|
|
246
|
+
module.exports = utilShim;
|
|
247
|
+
module.exports.default = utilShim;
|
|
248
248
|
`;
|
|
249
|
-
const SANDPACK_PATH_SHIM_INDEX_JS = `function normalize(input) {
|
|
250
|
-
return String(input || "").replace(/\\\\/g, "/");
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
function basename(input) {
|
|
254
|
-
var text = normalize(input);
|
|
255
|
-
var pieces = text.split("/").filter(Boolean);
|
|
256
|
-
return pieces.length ? pieces[pieces.length - 1] : "";
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
function dirname(input) {
|
|
260
|
-
var text = normalize(input);
|
|
261
|
-
var index = text.lastIndexOf("/");
|
|
262
|
-
if (index <= 0) return ".";
|
|
263
|
-
return text.slice(0, index);
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
function join() {
|
|
267
|
-
return Array.prototype
|
|
268
|
-
.map.call(arguments, normalize)
|
|
269
|
-
.filter(Boolean)
|
|
270
|
-
.join("/")
|
|
271
|
-
.replace(/\\/{2,}/g, "/");
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
function resolve() {
|
|
275
|
-
return join.apply(null, arguments);
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
const pathShim = {
|
|
279
|
-
sep: "/",
|
|
280
|
-
delimiter: ":",
|
|
281
|
-
basename,
|
|
282
|
-
dirname,
|
|
283
|
-
join,
|
|
284
|
-
resolve,
|
|
285
|
-
normalize
|
|
286
|
-
};
|
|
287
|
-
|
|
288
|
-
module.exports = pathShim;
|
|
289
|
-
module.exports.default = pathShim;
|
|
249
|
+
const SANDPACK_PATH_SHIM_INDEX_JS = `function normalize(input) {
|
|
250
|
+
return String(input || "").replace(/\\\\/g, "/");
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
function basename(input) {
|
|
254
|
+
var text = normalize(input);
|
|
255
|
+
var pieces = text.split("/").filter(Boolean);
|
|
256
|
+
return pieces.length ? pieces[pieces.length - 1] : "";
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
function dirname(input) {
|
|
260
|
+
var text = normalize(input);
|
|
261
|
+
var index = text.lastIndexOf("/");
|
|
262
|
+
if (index <= 0) return ".";
|
|
263
|
+
return text.slice(0, index);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
function join() {
|
|
267
|
+
return Array.prototype
|
|
268
|
+
.map.call(arguments, normalize)
|
|
269
|
+
.filter(Boolean)
|
|
270
|
+
.join("/")
|
|
271
|
+
.replace(/\\/{2,}/g, "/");
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
function resolve() {
|
|
275
|
+
return join.apply(null, arguments);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
const pathShim = {
|
|
279
|
+
sep: "/",
|
|
280
|
+
delimiter: ":",
|
|
281
|
+
basename,
|
|
282
|
+
dirname,
|
|
283
|
+
join,
|
|
284
|
+
resolve,
|
|
285
|
+
normalize
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
module.exports = pathShim;
|
|
289
|
+
module.exports.default = pathShim;
|
|
290
290
|
`;
|
|
291
|
-
const SANDPACK_FS_SHIM_INDEX_JS = `function notSupported(name) {
|
|
292
|
-
throw new Error("fs." + name + " is not supported in Sandpack browser runtime.");
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
const fsShim = {
|
|
296
|
-
openSync: function openSync() { return notSupported("openSync"); },
|
|
297
|
-
createReadStream: function createReadStream() { return notSupported("createReadStream"); },
|
|
298
|
-
createWriteStream: function createWriteStream() { return notSupported("createWriteStream"); },
|
|
299
|
-
readFileSync: function readFileSync() { return notSupported("readFileSync"); }
|
|
300
|
-
};
|
|
301
|
-
|
|
302
|
-
module.exports = fsShim;
|
|
303
|
-
module.exports.default = fsShim;
|
|
291
|
+
const SANDPACK_FS_SHIM_INDEX_JS = `function notSupported(name) {
|
|
292
|
+
throw new Error("fs." + name + " is not supported in Sandpack browser runtime.");
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
const fsShim = {
|
|
296
|
+
openSync: function openSync() { return notSupported("openSync"); },
|
|
297
|
+
createReadStream: function createReadStream() { return notSupported("createReadStream"); },
|
|
298
|
+
createWriteStream: function createWriteStream() { return notSupported("createWriteStream"); },
|
|
299
|
+
readFileSync: function readFileSync() { return notSupported("readFileSync"); }
|
|
300
|
+
};
|
|
301
|
+
|
|
302
|
+
module.exports = fsShim;
|
|
303
|
+
module.exports.default = fsShim;
|
|
304
304
|
`;
|
|
305
|
-
const SANDPACK_PROCESS_SHIM_INDEX_JS = `const processShim = {
|
|
306
|
-
env: {},
|
|
307
|
-
argv: ["browser"],
|
|
308
|
-
stdout: { columns: 80 },
|
|
309
|
-
stderr: { columns: 80 },
|
|
310
|
-
cwd: function cwd() { return "/"; },
|
|
311
|
-
nextTick: function nextTick(fn) {
|
|
312
|
-
var args = Array.prototype.slice.call(arguments, 1);
|
|
313
|
-
return Promise.resolve().then(function () { return fn.apply(null, args); });
|
|
314
|
-
}
|
|
315
|
-
};
|
|
316
|
-
|
|
317
|
-
if (typeof globalThis !== "undefined" && !globalThis.process) {
|
|
318
|
-
globalThis.process = processShim;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
module.exports = processShim;
|
|
322
|
-
module.exports.default = processShim;
|
|
305
|
+
const SANDPACK_PROCESS_SHIM_INDEX_JS = `const processShim = {
|
|
306
|
+
env: {},
|
|
307
|
+
argv: ["browser"],
|
|
308
|
+
stdout: { columns: 80 },
|
|
309
|
+
stderr: { columns: 80 },
|
|
310
|
+
cwd: function cwd() { return "/"; },
|
|
311
|
+
nextTick: function nextTick(fn) {
|
|
312
|
+
var args = Array.prototype.slice.call(arguments, 1);
|
|
313
|
+
return Promise.resolve().then(function () { return fn.apply(null, args); });
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
if (typeof globalThis !== "undefined" && !globalThis.process) {
|
|
318
|
+
globalThis.process = processShim;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
module.exports = processShim;
|
|
322
|
+
module.exports.default = processShim;
|
|
323
323
|
`;
|
|
324
|
-
const SANDPACK_NODE_ASSERT_ALIAS_SHIM_INDEX_JS = `const assertShim = require("assert");
|
|
325
|
-
module.exports = assertShim;
|
|
326
|
-
module.exports.default = assertShim;
|
|
324
|
+
const SANDPACK_NODE_ASSERT_ALIAS_SHIM_INDEX_JS = `const assertShim = require("assert");
|
|
325
|
+
module.exports = assertShim;
|
|
326
|
+
module.exports.default = assertShim;
|
|
327
327
|
`;
|
|
328
|
-
const SANDPACK_NODE_UTIL_ALIAS_SHIM_INDEX_JS = `const utilShim = require("util");
|
|
329
|
-
module.exports = utilShim;
|
|
330
|
-
module.exports.default = utilShim;
|
|
328
|
+
const SANDPACK_NODE_UTIL_ALIAS_SHIM_INDEX_JS = `const utilShim = require("util");
|
|
329
|
+
module.exports = utilShim;
|
|
330
|
+
module.exports.default = utilShim;
|
|
331
331
|
`;
|
|
332
|
-
const SANDPACK_NODE_PATH_ALIAS_SHIM_INDEX_JS = `const pathShim = require("path");
|
|
333
|
-
module.exports = pathShim;
|
|
334
|
-
module.exports.default = pathShim;
|
|
332
|
+
const SANDPACK_NODE_PATH_ALIAS_SHIM_INDEX_JS = `const pathShim = require("path");
|
|
333
|
+
module.exports = pathShim;
|
|
334
|
+
module.exports.default = pathShim;
|
|
335
335
|
`;
|
|
336
|
-
const SANDPACK_NODE_FS_ALIAS_SHIM_INDEX_JS = `const fsShim = require("fs");
|
|
337
|
-
module.exports = fsShim;
|
|
338
|
-
module.exports.default = fsShim;
|
|
336
|
+
const SANDPACK_NODE_FS_ALIAS_SHIM_INDEX_JS = `const fsShim = require("fs");
|
|
337
|
+
module.exports = fsShim;
|
|
338
|
+
module.exports.default = fsShim;
|
|
339
339
|
`;
|
|
340
|
-
const SANDPACK_NODE_PROCESS_ALIAS_SHIM_INDEX_JS = `const processShim = require("process");
|
|
341
|
-
module.exports = processShim;
|
|
342
|
-
module.exports.default = processShim;
|
|
340
|
+
const SANDPACK_NODE_PROCESS_ALIAS_SHIM_INDEX_JS = `const processShim = require("process");
|
|
341
|
+
module.exports = processShim;
|
|
342
|
+
module.exports.default = processShim;
|
|
343
343
|
`;
|
|
344
|
-
const SANDPACK_NODE_FS_PROMISES_ALIAS_SHIM_INDEX_JS = `const fsShim = require("fs");
|
|
345
|
-
module.exports = fsShim.promises || {};
|
|
346
|
-
module.exports.default = module.exports;
|
|
344
|
+
const SANDPACK_NODE_FS_PROMISES_ALIAS_SHIM_INDEX_JS = `const fsShim = require("fs");
|
|
345
|
+
module.exports = fsShim.promises || {};
|
|
346
|
+
module.exports.default = module.exports;
|
|
347
347
|
`;
|
|
348
348
|
const SANDPACK_NODE_ASSERT_PACKAGE_JSON_SHIM = JSON.stringify({
|
|
349
349
|
name: "node:assert",
|
|
@@ -613,65 +613,65 @@ const SANDPACK_SG_VARS = [
|
|
|
613
613
|
"--sg-badge-hover-bg", "--sg-badge-hover-fg", "--sg-badge-hover-border",
|
|
614
614
|
"--sg-badge-ring", "--sg-badge-soft-bg", "--sg-badge-soft-fg",
|
|
615
615
|
];
|
|
616
|
-
const SANDPACK_BASE_STYLES_CSS = `* {
|
|
617
|
-
box-sizing: border-box;
|
|
618
|
-
}
|
|
619
|
-
|
|
620
|
-
html, body, #root {
|
|
621
|
-
margin: 0;
|
|
622
|
-
min-height: 100%;
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
#root {
|
|
626
|
-
padding: var(--sg-preview-padding, 0px);
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
body {
|
|
630
|
-
font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
|
|
631
|
-
background: rgb(var(--sg-bg, 255 255 255));
|
|
632
|
-
color: rgb(var(--sg-text, 11 11 12));
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
/* Classes with arbitrary values used by SeedGrid components */
|
|
636
|
-
.bg-\\[var\\(--sg-btn-bg\\)\\] { background-color: var(--sg-btn-bg); }
|
|
637
|
-
.text-\\[var\\(--sg-btn-fg\\)\\] { color: var(--sg-btn-fg); }
|
|
638
|
-
.border-\\[var\\(--sg-btn-border\\)\\] { border-color: var(--sg-btn-border); }
|
|
639
|
-
.hover\\:bg-\\[var\\(--sg-btn-hover-bg\\)\\]:hover { background-color: var(--sg-btn-hover-bg); }
|
|
640
|
-
.hover\\:text-\\[var\\(--sg-btn-hover-fg\\)\\]:hover { color: var(--sg-btn-hover-fg); }
|
|
641
|
-
.hover\\:border-\\[var\\(--sg-btn-hover-border\\)\\]:hover { border-color: var(--sg-btn-hover-border); }
|
|
642
|
-
.active\\:bg-\\[var\\(--sg-btn-active-bg\\)\\]:active { background-color: var(--sg-btn-active-bg); }
|
|
643
|
-
.focus-visible\\:ring-\\[var\\(--sg-btn-ring\\)\\]:focus-visible { box-shadow: 0 0 0 4px var(--sg-btn-ring); }
|
|
644
|
-
.hover\\:bg-\\[rgb\\(var\\(--sg-btn-tint\\)\\/0\\.12\\)\\]:hover { background-color: rgb(var(--sg-btn-tint) / 0.12); }
|
|
645
|
-
.active\\:bg-\\[rgb\\(var\\(--sg-btn-tint\\)\\/0\\.18\\)\\]:active { background-color: rgb(var(--sg-btn-tint) / 0.18); }
|
|
646
|
-
.hover\\:bg-\\[rgb\\(var\\(--sg-btn-tint\\)\\/0\\.10\\)\\]:hover { background-color: rgb(var(--sg-btn-tint) / 0.10); }
|
|
647
|
-
.active\\:bg-\\[rgb\\(var\\(--sg-btn-tint\\)\\/0\\.16\\)\\]:active { background-color: rgb(var(--sg-btn-tint) / 0.16); }
|
|
648
|
-
.transition-\\[background-color\\,color\\,border-color\\,box-shadow\\,transform\\] {
|
|
649
|
-
transition-property: background-color, color, border-color, box-shadow, transform;
|
|
650
|
-
}
|
|
651
|
-
.active\\:translate-y-\\[0\\.5px\\]:active { transform: translateY(0.5px); }
|
|
652
|
-
.size-4 { width: 1rem; height: 1rem; }
|
|
653
|
-
.size-5 { width: 1.25rem; height: 1.25rem; }
|
|
616
|
+
const SANDPACK_BASE_STYLES_CSS = `* {
|
|
617
|
+
box-sizing: border-box;
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
html, body, #root {
|
|
621
|
+
margin: 0;
|
|
622
|
+
min-height: 100%;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
#root {
|
|
626
|
+
padding: var(--sg-preview-padding, 0px);
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
body {
|
|
630
|
+
font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
|
|
631
|
+
background: rgb(var(--sg-bg, 255 255 255));
|
|
632
|
+
color: rgb(var(--sg-text, 11 11 12));
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
/* Classes with arbitrary values used by SeedGrid components */
|
|
636
|
+
.bg-\\[var\\(--sg-btn-bg\\)\\] { background-color: var(--sg-btn-bg); }
|
|
637
|
+
.text-\\[var\\(--sg-btn-fg\\)\\] { color: var(--sg-btn-fg); }
|
|
638
|
+
.border-\\[var\\(--sg-btn-border\\)\\] { border-color: var(--sg-btn-border); }
|
|
639
|
+
.hover\\:bg-\\[var\\(--sg-btn-hover-bg\\)\\]:hover { background-color: var(--sg-btn-hover-bg); }
|
|
640
|
+
.hover\\:text-\\[var\\(--sg-btn-hover-fg\\)\\]:hover { color: var(--sg-btn-hover-fg); }
|
|
641
|
+
.hover\\:border-\\[var\\(--sg-btn-hover-border\\)\\]:hover { border-color: var(--sg-btn-hover-border); }
|
|
642
|
+
.active\\:bg-\\[var\\(--sg-btn-active-bg\\)\\]:active { background-color: var(--sg-btn-active-bg); }
|
|
643
|
+
.focus-visible\\:ring-\\[var\\(--sg-btn-ring\\)\\]:focus-visible { box-shadow: 0 0 0 4px var(--sg-btn-ring); }
|
|
644
|
+
.hover\\:bg-\\[rgb\\(var\\(--sg-btn-tint\\)\\/0\\.12\\)\\]:hover { background-color: rgb(var(--sg-btn-tint) / 0.12); }
|
|
645
|
+
.active\\:bg-\\[rgb\\(var\\(--sg-btn-tint\\)\\/0\\.18\\)\\]:active { background-color: rgb(var(--sg-btn-tint) / 0.18); }
|
|
646
|
+
.hover\\:bg-\\[rgb\\(var\\(--sg-btn-tint\\)\\/0\\.10\\)\\]:hover { background-color: rgb(var(--sg-btn-tint) / 0.10); }
|
|
647
|
+
.active\\:bg-\\[rgb\\(var\\(--sg-btn-tint\\)\\/0\\.16\\)\\]:active { background-color: rgb(var(--sg-btn-tint) / 0.16); }
|
|
648
|
+
.transition-\\[background-color\\,color\\,border-color\\,box-shadow\\,transform\\] {
|
|
649
|
+
transition-property: background-color, color, border-color, box-shadow, transform;
|
|
650
|
+
}
|
|
651
|
+
.active\\:translate-y-\\[0\\.5px\\]:active { transform: translateY(0.5px); }
|
|
652
|
+
.size-4 { width: 1rem; height: 1rem; }
|
|
653
|
+
.size-5 { width: 1.25rem; height: 1.25rem; }
|
|
654
654
|
`;
|
|
655
|
-
const SANDPACK_HOST_STYLES_CSS = `
|
|
656
|
-
.sg-playground-preview .sp-cube-wrapper {
|
|
657
|
-
top: 8px !important;
|
|
658
|
-
right: 8px !important;
|
|
659
|
-
bottom: auto !important;
|
|
660
|
-
left: auto !important;
|
|
661
|
-
}
|
|
655
|
+
const SANDPACK_HOST_STYLES_CSS = `
|
|
656
|
+
.sg-playground-preview .sp-cube-wrapper {
|
|
657
|
+
top: 8px !important;
|
|
658
|
+
right: 8px !important;
|
|
659
|
+
bottom: auto !important;
|
|
660
|
+
left: auto !important;
|
|
661
|
+
}
|
|
662
662
|
`;
|
|
663
663
|
// Keep CRA's expected HTML entry file path for react/react-ts templates.
|
|
664
|
-
const SANDPACK_TAILWIND_INDEX_HTML = `<!DOCTYPE html>
|
|
665
|
-
<html lang="en">
|
|
666
|
-
<head>
|
|
667
|
-
<meta charset="UTF-8">
|
|
668
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
669
|
-
<title>Document</title>
|
|
670
|
-
</head>
|
|
671
|
-
<body>
|
|
672
|
-
<div id="root"></div>
|
|
673
|
-
</body>
|
|
674
|
-
</html>
|
|
664
|
+
const SANDPACK_TAILWIND_INDEX_HTML = `<!DOCTYPE html>
|
|
665
|
+
<html lang="en">
|
|
666
|
+
<head>
|
|
667
|
+
<meta charset="UTF-8">
|
|
668
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
669
|
+
<title>Document</title>
|
|
670
|
+
</head>
|
|
671
|
+
<body>
|
|
672
|
+
<div id="root"></div>
|
|
673
|
+
</body>
|
|
674
|
+
</html>
|
|
675
675
|
`;
|
|
676
676
|
function normalizeUrl(raw, fallback) {
|
|
677
677
|
const value = raw?.trim();
|
|
@@ -920,11 +920,11 @@ function buildSandpackStylesCss(themeVars, previewPadding, hostCss = "") {
|
|
|
920
920
|
.sort(([a], [b]) => a.localeCompare(b))
|
|
921
921
|
.map(([varName, value]) => ` ${varName}: ${value};`)
|
|
922
922
|
.join("\n");
|
|
923
|
-
return `:root {
|
|
924
|
-
${rootVars}
|
|
925
|
-
}
|
|
926
|
-
|
|
927
|
-
${SANDPACK_BASE_STYLES_CSS}
|
|
923
|
+
return `:root {
|
|
924
|
+
${rootVars}
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
${SANDPACK_BASE_STYLES_CSS}
|
|
928
928
|
${hostCss ? `\n\n${hostCss}` : ""}`;
|
|
929
929
|
}
|
|
930
930
|
function ReadonlyBlock({ code }) {
|
|
@@ -937,30 +937,30 @@ function buildAppTsxFromRenderBody(renderBody, defaultImports, wrapperClassName)
|
|
|
937
937
|
.map((line) => (line ? ` ${line}` : ""))
|
|
938
938
|
.join("\n");
|
|
939
939
|
if (!wrapperClassName) {
|
|
940
|
-
return `import * as React from "react";
|
|
941
|
-
${defaultImports}
|
|
942
|
-
|
|
943
|
-
export default function App() {
|
|
944
|
-
return (
|
|
945
|
-
<>
|
|
946
|
-
${body}
|
|
947
|
-
</>
|
|
948
|
-
);
|
|
949
|
-
}
|
|
940
|
+
return `import * as React from "react";
|
|
941
|
+
${defaultImports}
|
|
942
|
+
|
|
943
|
+
export default function App() {
|
|
944
|
+
return (
|
|
945
|
+
<>
|
|
946
|
+
${body}
|
|
947
|
+
</>
|
|
948
|
+
);
|
|
949
|
+
}
|
|
950
950
|
`;
|
|
951
951
|
}
|
|
952
|
-
return `import * as React from "react";
|
|
953
|
-
${defaultImports}
|
|
954
|
-
|
|
955
|
-
export default function App() {
|
|
956
|
-
return (
|
|
957
|
-
<div className="${wrapperClassName}">
|
|
958
|
-
<>
|
|
959
|
-
${body}
|
|
960
|
-
</>
|
|
961
|
-
</div>
|
|
962
|
-
);
|
|
963
|
-
}
|
|
952
|
+
return `import * as React from "react";
|
|
953
|
+
${defaultImports}
|
|
954
|
+
|
|
955
|
+
export default function App() {
|
|
956
|
+
return (
|
|
957
|
+
<div className="${wrapperClassName}">
|
|
958
|
+
<>
|
|
959
|
+
${body}
|
|
960
|
+
</>
|
|
961
|
+
</div>
|
|
962
|
+
);
|
|
963
|
+
}
|
|
964
964
|
`;
|
|
965
965
|
}
|
|
966
966
|
async function copyText(text) {
|
|
@@ -1090,14 +1090,14 @@ export default function SgPlayground(props) {
|
|
|
1090
1090
|
}
|
|
1091
1091
|
};
|
|
1092
1092
|
}, [effectivePreviewPadding]);
|
|
1093
|
-
const seedgridDefaultImports = defaultImports ?? `import {
|
|
1094
|
-
SgScreen,
|
|
1095
|
-
SgMainPanel,
|
|
1096
|
-
SgPanel,
|
|
1097
|
-
SgGrid,
|
|
1098
|
-
SgStack,
|
|
1099
|
-
SgButton,
|
|
1100
|
-
SgAutocomplete
|
|
1093
|
+
const seedgridDefaultImports = defaultImports ?? `import {
|
|
1094
|
+
SgScreen,
|
|
1095
|
+
SgMainPanel,
|
|
1096
|
+
SgPanel,
|
|
1097
|
+
SgGrid,
|
|
1098
|
+
SgStack,
|
|
1099
|
+
SgButton,
|
|
1100
|
+
SgAutocomplete
|
|
1101
1101
|
} from "@seedgrid/fe-components";`;
|
|
1102
1102
|
const appTsx = React.useMemo(() => codeContract === "appFile"
|
|
1103
1103
|
? code
|
package/package.json
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@seedgrid/fe-playground",
|
|
3
|
+
"version": "2026.3.19-1",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/SeedGrid/seedgrid-fe-components",
|
|
9
|
+
"directory": "packages/seedgrid-fe-playground"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/SeedGrid/seedgrid-fe-components/tree/main/packages/seedgrid-fe-playground",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/SeedGrid/seedgrid-fe-components/issues"
|
|
14
|
+
},
|
|
15
|
+
"main": "dist/index.js",
|
|
16
|
+
"types": "dist/index.d.ts",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"default": "./dist/index.js"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"sideEffects": false,
|
|
24
|
+
"files": [
|
|
25
|
+
"dist"
|
|
26
|
+
],
|
|
27
|
+
"scripts": {
|
|
28
|
+
"clean": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"",
|
|
29
|
+
"build": "pnpm run clean && tsc -p tsconfig.json",
|
|
30
|
+
"dev": "tsc -p tsconfig.json --watch --preserveWatchOutput",
|
|
31
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"@seedgrid/fe-components": "^0.2.10",
|
|
35
|
+
"react": "^18.2.0 || ^19.0.0",
|
|
36
|
+
"react-dom": "^18.2.0 || ^19.0.0"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@codesandbox/sandpack-react": "^2.20.0"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@seedgrid/fe-components": "workspace:*",
|
|
43
|
+
"@types/react": "^19.0.0",
|
|
44
|
+
"@types/react-dom": "^19.0.0",
|
|
45
|
+
"react": "19.0.0",
|
|
46
|
+
"react-dom": "19.0.0",
|
|
47
|
+
"typescript": "^5.5.4"
|
|
48
|
+
}
|
|
49
|
+
}
|