eddev 0.2.0-beta.12 → 0.2.0-beta.16
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/build/get-webpack-config.js +1 -0
- package/build/serverless/create-next-app.js +60 -56
- package/cli/cli.js +4 -4
- package/components/PageHead.d.ts +1 -0
- package/components/PageHead.js +2 -0
- package/components/PageMeta.d.ts +1 -0
- package/components/PageMeta.js +2 -0
- package/components/PageMeta.monolith.d.ts +1 -0
- package/components/PageMeta.monolith.js +2 -0
- package/components/ServerlessPageMeta.d.ts +1 -0
- package/components/ServerlessPageMeta.js +2 -0
- package/config/config-schema.d.ts +5 -0
- package/config/config-schema.js +1 -0
- package/config/get-config.d.ts +3 -0
- package/config/parse-config.d.ts +2 -0
- package/dev-ui/components/{BreakpointItemHeader.d.ts → BreakpointColumnHeader.d.ts} +0 -0
- package/dev-ui/components/{BreakpointItemHeader.js → BreakpointColumnHeader.js} +3 -6
- package/dev-ui/components/BreakpointIndicator.d.ts +2 -0
- package/dev-ui/components/BreakpointIndicator.js +138 -0
- package/dev-ui/components/DevUI.d.ts +1 -1
- package/dev-ui/components/DevUI.js +13 -4
- package/dev-ui/components/Launcher.d.ts +90 -1
- package/dev-ui/components/Launcher.js +12 -36
- package/dev-ui/components/PanelWrapper.d.ts +6 -2
- package/dev-ui/components/PanelWrapper.js +22 -6
- package/dev-ui/components/ResponsiveLerpControl.d.ts +8 -0
- package/dev-ui/components/ResponsiveLerpControl.js +177 -0
- package/dev-ui/components/ResponsiveScaleEditor.d.ts +26 -0
- package/dev-ui/components/ResponsiveScaleEditor.js +233 -0
- package/dev-ui/components/atoms/Button.d.ts +47 -0
- package/dev-ui/components/atoms/Button.js +67 -0
- package/dev-ui/components/atoms/Dropdown.d.ts +13 -0
- package/dev-ui/components/atoms/Dropdown.js +50 -0
- package/dev-ui/components/atoms/NumberField.d.ts +12 -0
- package/dev-ui/components/atoms/NumberField.js +111 -0
- package/dev-ui/components/atoms/Spacer.d.ts +42 -0
- package/dev-ui/components/atoms/Spacer.js +8 -0
- package/dev-ui/components/{Text.d.ts → atoms/Text.d.ts} +7 -1
- package/dev-ui/components/atoms/Text.js +39 -0
- package/dev-ui/components/atoms/ToggleButton.d.ts +8 -0
- package/dev-ui/components/atoms/ToggleButton.js +41 -0
- package/dev-ui/components/atoms/Tooltip.d.ts +9 -0
- package/dev-ui/components/atoms/Tooltip.js +66 -0
- package/dev-ui/components/panels/PageDataDebugger.d.ts +2 -0
- package/dev-ui/components/panels/PageDataDebugger.js +30 -0
- package/dev-ui/components/panels/SpacingEditor.js +65 -33
- package/dev-ui/components/panels/TypographyEditor.d.ts +2 -0
- package/dev-ui/components/panels/TypographyEditor.js +88 -0
- package/dev-ui/hooks/useBreakpoint.d.ts +11 -0
- package/dev-ui/hooks/useBreakpoint.js +59 -0
- package/dev-ui/hooks/usePersistState.js +9 -1
- package/dev-ui/hooks/useStylesheet.d.ts +4 -0
- package/dev-ui/hooks/useStylesheet.js +31 -0
- package/dev-ui/icons.d.ts +4 -0
- package/dev-ui/icons.js +5 -1
- package/dev-ui/index.d.ts +1 -1
- package/dev-ui/index.js +11 -3
- package/dev-ui/loader.d.ts +2 -0
- package/dev-ui/loader.js +42 -0
- package/dev-ui/panels.js +9 -7
- package/dev-ui/theme.d.ts +16 -0
- package/dev-ui/theme.js +7 -2
- package/dynamic/dynamic-component.d.ts +1 -0
- package/entry/Root.js +2 -2
- package/package.json +12 -1
- package/serverless/create-rpc-client.d.ts +6 -17
- package/serverless-template/_utils/PageMeta.tsx +44 -0
- package/serverless-template/_utils/fetch-wordpress-props.ts +10 -3
- package/serverless-template/_utils/fetch-wp.ts +16 -0
- package/serverless-template/global.d.ts +1 -0
- package/serverless-template/next.config.js +2 -0
- package/serverless-template/pages/_app.tsx +7 -0
- package/style/createStitches.d.ts +14 -5
- package/style/createStitches.js +15 -51
- package/utils/updateEnvFile.d.ts +1 -0
- package/utils/updateEnvFile.js +76 -0
- package/build/workers/serverless-worker-script.d.ts +0 -0
- package/build/workers/serverless-worker-script.js +0 -1
- package/dev-ui/components/BreakpointList.d.ts +0 -6
- package/dev-ui/components/BreakpointList.js +0 -38
- package/dev-ui/components/Pill.d.ts +0 -0
- package/dev-ui/components/Pill.js +0 -1
- package/dev-ui/components/SpacingEditor.d.ts +0 -2
- package/dev-ui/components/SpacingEditor.js +0 -10
- package/dev-ui/components/Text.js +0 -13
|
@@ -332,6 +332,7 @@ function getWebpackConfig(opts) {
|
|
|
332
332
|
DEFINES["process.BLOCK_MANIFEST_FILE"] = JSON.stringify(ALIAS["@manifest/blocks"]);
|
|
333
333
|
}
|
|
334
334
|
DEFINES["process.devUI"] = config.devUI === "enabled";
|
|
335
|
+
DEFINES["process.serverlessEndpoint"] = "window.SERVERLESS_ENDPOINT";
|
|
335
336
|
if (isBrowser) {
|
|
336
337
|
DEFINES["process.env.themePath"] = "window.THEME_PATH || ".concat(DEFINES["process.env.themePath"]);
|
|
337
338
|
}
|
|
@@ -88,6 +88,7 @@ var manifest_blocks_1 = require("../manifests/manifest-blocks");
|
|
|
88
88
|
var promises_1 = require("fs/promises");
|
|
89
89
|
var manifest_views_1 = require("../manifests/manifest-views");
|
|
90
90
|
var getRepoName_1 = require("../../utils/getRepoName");
|
|
91
|
+
var updateEnvFile_1 = require("../../utils/updateEnvFile");
|
|
91
92
|
function requireConfig(dir) {
|
|
92
93
|
var configPath = (0, path_1.resolve)(dir, "ed.config.json");
|
|
93
94
|
return require(configPath);
|
|
@@ -123,7 +124,7 @@ function createNextApp(opts) {
|
|
|
123
124
|
_b.sent();
|
|
124
125
|
_b.label = 5;
|
|
125
126
|
case 5:
|
|
126
|
-
if (!!isVercel) return [3 /*break*/,
|
|
127
|
+
if (!!isVercel) return [3 /*break*/, 10];
|
|
127
128
|
// Sync important files during development, as they change
|
|
128
129
|
return [4 /*yield*/, syncFiles(opts.baseDirectory, serverlessDirectory, __spreadArray([
|
|
129
130
|
"blocks/**/*",
|
|
@@ -152,40 +153,58 @@ function createNextApp(opts) {
|
|
|
152
153
|
// Also sync APIs into the APIs folder
|
|
153
154
|
_b.sent();
|
|
154
155
|
// And public folder
|
|
155
|
-
return [4 /*yield*/, syncFiles((0, path_1.join)(opts.baseDirectory, "assets"), (0, path_1.join)(serverlessDirectory, "public/wp-content/themes/".concat(repoName.repoName, "/assets")), ["**/*"])
|
|
156
|
+
return [4 /*yield*/, syncFiles((0, path_1.join)(opts.baseDirectory, "assets"), (0, path_1.join)(serverlessDirectory, "public/wp-content/themes/".concat(repoName.repoName, "/assets")), ["**/*"])
|
|
157
|
+
// Sync favicon
|
|
158
|
+
];
|
|
156
159
|
case 8:
|
|
157
160
|
// And public folder
|
|
158
161
|
_b.sent();
|
|
159
|
-
|
|
162
|
+
// Sync favicon
|
|
163
|
+
return [4 /*yield*/, syncFiles((0, path_1.join)(opts.baseDirectory), (0, path_1.join)(serverlessDirectory, "public/"), ["favicon.ico"])];
|
|
160
164
|
case 9:
|
|
161
|
-
|
|
165
|
+
// Sync favicon
|
|
166
|
+
_b.sent();
|
|
167
|
+
_b.label = 10;
|
|
168
|
+
case 10:
|
|
169
|
+
if (!!isVercel) return [3 /*break*/, 12];
|
|
162
170
|
sendSignal({ code: "packaging" });
|
|
163
171
|
return [4 /*yield*/, updatePackages(serverlessDirectory)];
|
|
164
|
-
case 10:
|
|
165
|
-
_b.sent();
|
|
166
|
-
_b.label = 11;
|
|
167
172
|
case 11:
|
|
173
|
+
_b.sent();
|
|
174
|
+
_b.label = 12;
|
|
175
|
+
case 12:
|
|
168
176
|
sendSignal({ code: "compiling" });
|
|
169
177
|
// Create manifests
|
|
170
|
-
initManifests(serverlessDirectory, opts.dev)
|
|
171
|
-
|
|
172
|
-
return [4 /*yield*/, getPort(3000)];
|
|
173
|
-
case 12:
|
|
174
|
-
port = _b.sent();
|
|
175
|
-
sendSignal({ code: "url", url: "http://127.0.0.1:".concat(port) });
|
|
176
|
-
return [4 /*yield*/, devNext(serverlessDirectory, port)
|
|
177
|
-
// await runScript(serverlessDirectory, "dev")
|
|
178
|
+
return [4 /*yield*/, initManifests(serverlessDirectory, opts.dev)
|
|
179
|
+
// Start
|
|
178
180
|
];
|
|
179
181
|
case 13:
|
|
182
|
+
// Create manifests
|
|
180
183
|
_b.sent();
|
|
181
|
-
return [3 /*break*/, 16];
|
|
184
|
+
if (!opts.dev) return [3 /*break*/, 16];
|
|
185
|
+
return [4 /*yield*/, getPort(3000)
|
|
186
|
+
// Write the endpoint URL to .env
|
|
187
|
+
];
|
|
182
188
|
case 14:
|
|
183
|
-
|
|
184
|
-
|
|
189
|
+
port = _b.sent();
|
|
190
|
+
// Write the endpoint URL to .env
|
|
191
|
+
(0, updateEnvFile_1.updateEnvFile)({
|
|
192
|
+
DEBUG_SERVERLESS_ENDPOINT: "http://localhost:".concat(port),
|
|
193
|
+
}, opts.baseDirectory);
|
|
194
|
+
sendSignal({ code: "url", url: "http://127.0.0.1:".concat(port) });
|
|
195
|
+
// await devNext(serverlessDirectory, port)
|
|
196
|
+
return [4 /*yield*/, runScript(serverlessDirectory, ["dev", "--port", String(port)])];
|
|
185
197
|
case 15:
|
|
198
|
+
// await devNext(serverlessDirectory, port)
|
|
199
|
+
_b.sent();
|
|
200
|
+
return [3 /*break*/, 18];
|
|
201
|
+
case 16:
|
|
202
|
+
if (!opts.build) return [3 /*break*/, 18];
|
|
203
|
+
return [4 /*yield*/, runScript(serverlessDirectory, ["build"])];
|
|
204
|
+
case 17:
|
|
186
205
|
_b.sent();
|
|
187
|
-
_b.label =
|
|
188
|
-
case
|
|
206
|
+
_b.label = 18;
|
|
207
|
+
case 18: return [2 /*return*/];
|
|
189
208
|
}
|
|
190
209
|
});
|
|
191
210
|
});
|
|
@@ -261,7 +280,7 @@ function updatePackagesFile(sourceFolder, targetFolder) {
|
|
|
261
280
|
targetPackageFile = (0, path_1.resolve)(targetFolder, "package.json");
|
|
262
281
|
sourcePackage = require(sourcePackageFile);
|
|
263
282
|
targetPackage = require(targetPackageFile);
|
|
264
|
-
mergedPackage = __assign(__assign({}, targetPackage), { dependencies: __assign(__assign({}, (
|
|
283
|
+
mergedPackage = __assign(__assign({}, targetPackage), { dependencies: __assign(__assign({}, (targetPackage.dependencies || {})), (sourcePackage.dependencies || {})), devDependencies: __assign(__assign({}, (targetPackage.devDependencies || {})), (sourcePackage.devDependencies || {})) });
|
|
265
284
|
(0, fs_extra_1.writeJSON)(targetPackageFile, mergedPackage, {
|
|
266
285
|
spaces: 2,
|
|
267
286
|
});
|
|
@@ -303,45 +322,30 @@ function syncFiles(sourceFolder, targetFolder, patterns) {
|
|
|
303
322
|
});
|
|
304
323
|
});
|
|
305
324
|
}
|
|
306
|
-
function devNext(dir, port) {
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
port: port,
|
|
326
|
-
});
|
|
327
|
-
handle = app.getRequestHandler();
|
|
328
|
-
app.prepare().then(function () {
|
|
329
|
-
console.log("http://127.0.0.1:".concat(port));
|
|
330
|
-
createServer(function (req, res) {
|
|
331
|
-
handle(req, res, parse(req.url || "", true));
|
|
332
|
-
}).listen(app.port);
|
|
333
|
-
});
|
|
334
|
-
return [2 /*return*/];
|
|
335
|
-
}
|
|
336
|
-
});
|
|
337
|
-
});
|
|
338
|
-
}
|
|
339
|
-
function runScript(dir, script) {
|
|
325
|
+
// async function devNext(dir: string, port: number) {
|
|
326
|
+
// const { createServer } = await import("http")
|
|
327
|
+
// const { parse } = await import("url")
|
|
328
|
+
// const { default: next } = await import("next")
|
|
329
|
+
// const app = next({
|
|
330
|
+
// dev: true,
|
|
331
|
+
// dir: dir,
|
|
332
|
+
// minimalMode: true,
|
|
333
|
+
// customServer: true,
|
|
334
|
+
// port: port,
|
|
335
|
+
// })
|
|
336
|
+
// const handle = app.getRequestHandler()
|
|
337
|
+
// app.prepare().then(() => {
|
|
338
|
+
// createServer((req, res) => {
|
|
339
|
+
// handle(req, res, parse(req.url || "", true))
|
|
340
|
+
// }).listen(app.port)
|
|
341
|
+
// })
|
|
342
|
+
// }
|
|
343
|
+
function runScript(dir, args) {
|
|
340
344
|
var _a, _b;
|
|
341
345
|
return __awaiter(this, void 0, void 0, function () {
|
|
342
346
|
var proc;
|
|
343
347
|
return __generator(this, function (_c) {
|
|
344
|
-
proc = (0, child_process_1.spawn)("yarn",
|
|
348
|
+
proc = (0, child_process_1.spawn)("yarn", args, {
|
|
345
349
|
cwd: dir,
|
|
346
350
|
});
|
|
347
351
|
(_a = proc.stdout) === null || _a === void 0 ? void 0 : _a.pipe(process.stdout);
|
package/cli/cli.js
CHANGED
|
@@ -38,8 +38,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
var commander_1 = require("commander");
|
|
40
40
|
var create_next_app_1 = require("../build/serverless/create-next-app");
|
|
41
|
-
var build_dev_1 = require("./build.dev");
|
|
42
|
-
var build_prod_1 = require("./build.prod");
|
|
43
41
|
var setup_1 = require("./setup");
|
|
44
42
|
var program = new commander_1.Command();
|
|
45
43
|
program.version("0.0.1");
|
|
@@ -51,7 +49,8 @@ program
|
|
|
51
49
|
.option("-m, --mode <mode>", 'Defaults to all modes, but use "frontend", "admin" or "codegen" to run in just one mode', undefined)
|
|
52
50
|
.option("--verbose", "Enables log retention", false)
|
|
53
51
|
.action(function (options) {
|
|
54
|
-
(
|
|
52
|
+
var devCommand = require("./build.dev").devCommand;
|
|
53
|
+
devCommand({
|
|
55
54
|
serverless: options.serverless,
|
|
56
55
|
mode: options.mode,
|
|
57
56
|
retainLog: options.verbose,
|
|
@@ -69,7 +68,8 @@ program
|
|
|
69
68
|
});
|
|
70
69
|
}
|
|
71
70
|
else {
|
|
72
|
-
(
|
|
71
|
+
var prodCommand = require("./build.prod").prodCommand;
|
|
72
|
+
prodCommand({
|
|
73
73
|
serverless: options.serverless,
|
|
74
74
|
});
|
|
75
75
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function PageMeta(): any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function PageMeta(): any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function PageMeta(): any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function PageMeta(): any;
|
|
@@ -8,6 +8,7 @@ export declare const EDConfigSchema: z.ZodObject<{
|
|
|
8
8
|
theme: z.ZodEnum<["proxy", "copy", "remote"]>;
|
|
9
9
|
devAssets: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
10
10
|
apiOnly: z.ZodOptional<z.ZodBoolean>;
|
|
11
|
+
endpoints: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
11
12
|
}, "strip", z.ZodTypeAny, {
|
|
12
13
|
devAssets?: string[] | undefined;
|
|
13
14
|
apiOnly?: boolean | undefined;
|
|
@@ -15,6 +16,7 @@ export declare const EDConfigSchema: z.ZodObject<{
|
|
|
15
16
|
uploads: "proxy" | "remote";
|
|
16
17
|
plugins: "proxy" | "remote";
|
|
17
18
|
theme: "copy" | "proxy" | "remote";
|
|
19
|
+
endpoints: Record<string, string>;
|
|
18
20
|
}, {
|
|
19
21
|
devAssets?: string[] | undefined;
|
|
20
22
|
apiOnly?: boolean | undefined;
|
|
@@ -22,6 +24,7 @@ export declare const EDConfigSchema: z.ZodObject<{
|
|
|
22
24
|
uploads: "proxy" | "remote";
|
|
23
25
|
plugins: "proxy" | "remote";
|
|
24
26
|
theme: "copy" | "proxy" | "remote";
|
|
27
|
+
endpoints: Record<string, string>;
|
|
25
28
|
}>>;
|
|
26
29
|
devUI: z.ZodEnum<["disabled", "enabled"]>;
|
|
27
30
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -33,6 +36,7 @@ export declare const EDConfigSchema: z.ZodObject<{
|
|
|
33
36
|
uploads: "proxy" | "remote";
|
|
34
37
|
plugins: "proxy" | "remote";
|
|
35
38
|
theme: "copy" | "proxy" | "remote";
|
|
39
|
+
endpoints: Record<string, string>;
|
|
36
40
|
} | undefined;
|
|
37
41
|
devUI: "disabled" | "enabled";
|
|
38
42
|
}, {
|
|
@@ -44,6 +48,7 @@ export declare const EDConfigSchema: z.ZodObject<{
|
|
|
44
48
|
uploads: "proxy" | "remote";
|
|
45
49
|
plugins: "proxy" | "remote";
|
|
46
50
|
theme: "copy" | "proxy" | "remote";
|
|
51
|
+
endpoints: Record<string, string>;
|
|
47
52
|
} | undefined;
|
|
48
53
|
devUI: "disabled" | "enabled";
|
|
49
54
|
}>;
|
package/config/config-schema.js
CHANGED
|
@@ -12,6 +12,7 @@ exports.EDConfigSchema = zod_1.z.object({
|
|
|
12
12
|
theme: zod_1.z.enum(["proxy", "copy", "remote"]),
|
|
13
13
|
devAssets: zod_1.z.array(zod_1.z.string()).optional(),
|
|
14
14
|
apiOnly: zod_1.z.boolean().optional(),
|
|
15
|
+
endpoints: zod_1.z.record(zod_1.z.string(), zod_1.z.string()),
|
|
15
16
|
})
|
|
16
17
|
.optional(),
|
|
17
18
|
devUI: zod_1.z.enum(["disabled", "enabled"]),
|
package/config/get-config.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export declare function getEDConfig(dir?: string): import("zod").SafeParseReturn
|
|
|
7
7
|
uploads: "proxy" | "remote";
|
|
8
8
|
plugins: "proxy" | "remote";
|
|
9
9
|
theme: "copy" | "proxy" | "remote";
|
|
10
|
+
endpoints: Record<string, string>;
|
|
10
11
|
} | undefined;
|
|
11
12
|
devUI: "disabled" | "enabled";
|
|
12
13
|
}, {
|
|
@@ -18,6 +19,7 @@ export declare function getEDConfig(dir?: string): import("zod").SafeParseReturn
|
|
|
18
19
|
uploads: "proxy" | "remote";
|
|
19
20
|
plugins: "proxy" | "remote";
|
|
20
21
|
theme: "copy" | "proxy" | "remote";
|
|
22
|
+
endpoints: Record<string, string>;
|
|
21
23
|
} | undefined;
|
|
22
24
|
devUI: "disabled" | "enabled";
|
|
23
25
|
}>;
|
|
@@ -30,6 +32,7 @@ export declare function getEDConfigUnwrapped(dir?: string): {
|
|
|
30
32
|
uploads: "proxy" | "remote";
|
|
31
33
|
plugins: "proxy" | "remote";
|
|
32
34
|
theme: "copy" | "proxy" | "remote";
|
|
35
|
+
endpoints: Record<string, string>;
|
|
33
36
|
} | undefined;
|
|
34
37
|
devUI: "disabled" | "enabled";
|
|
35
38
|
};
|
package/config/parse-config.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export declare function parseConfig(config: any): import("zod").SafeParseReturnT
|
|
|
7
7
|
uploads: "proxy" | "remote";
|
|
8
8
|
plugins: "proxy" | "remote";
|
|
9
9
|
theme: "copy" | "proxy" | "remote";
|
|
10
|
+
endpoints: Record<string, string>;
|
|
10
11
|
} | undefined;
|
|
11
12
|
devUI: "disabled" | "enabled";
|
|
12
13
|
}, {
|
|
@@ -18,6 +19,7 @@ export declare function parseConfig(config: any): import("zod").SafeParseReturnT
|
|
|
18
19
|
uploads: "proxy" | "remote";
|
|
19
20
|
plugins: "proxy" | "remote";
|
|
20
21
|
theme: "copy" | "proxy" | "remote";
|
|
22
|
+
endpoints: Record<string, string>;
|
|
21
23
|
} | undefined;
|
|
22
24
|
devUI: "disabled" | "enabled";
|
|
23
25
|
}>;
|
|
File without changes
|
|
@@ -15,8 +15,9 @@ exports.BreakpointColumnHeader = void 0;
|
|
|
15
15
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
16
|
var icons_1 = require("../icons");
|
|
17
17
|
var theme_1 = require("../theme");
|
|
18
|
+
var Text_1 = require("./atoms/Text");
|
|
18
19
|
function BreakpointColumnHeader(props) {
|
|
19
|
-
return ((0, jsx_runtime_1.jsxs)(Wrapper, { children: [(0, jsx_runtime_1.jsx)(
|
|
20
|
+
return ((0, jsx_runtime_1.jsxs)(Wrapper, { children: [(0, jsx_runtime_1.jsx)(Text_1.Text, __assign({ align: "center", variant: "monoBold" }, { children: props.name }), void 0), (0, jsx_runtime_1.jsx)(ToggleButton, __assign({ onClick: function () { var _a; return (_a = props.onDefinedChange) === null || _a === void 0 ? void 0 : _a.call(props, !props.defined); } }, { children: props.defined ? icons_1.checkFilled : icons_1.checkEmpty }), void 0)] }, void 0));
|
|
20
21
|
}
|
|
21
22
|
exports.BreakpointColumnHeader = BreakpointColumnHeader;
|
|
22
23
|
var Wrapper = (0, theme_1.styled)("div", {
|
|
@@ -33,6 +34,7 @@ var ToggleButton = (0, theme_1.styled)("button", {
|
|
|
33
34
|
display: "flex",
|
|
34
35
|
alignItems: "center",
|
|
35
36
|
justifyContent: "center",
|
|
37
|
+
color: "inherit",
|
|
36
38
|
"&:hover": {
|
|
37
39
|
// backgroundColor: "$bgHover",
|
|
38
40
|
},
|
|
@@ -43,8 +45,3 @@ var ToggleButton = (0, theme_1.styled)("button", {
|
|
|
43
45
|
display: "block",
|
|
44
46
|
},
|
|
45
47
|
});
|
|
46
|
-
var NameWrapper = (0, theme_1.styled)("div", {
|
|
47
|
-
fontFamily: "$body",
|
|
48
|
-
fontSize: "$sm",
|
|
49
|
-
textAlign: "center",
|
|
50
|
-
});
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.BreakpointIndicator = void 0;
|
|
15
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
var useBreakpoint_1 = require("../hooks/useBreakpoint");
|
|
17
|
+
var usePersistState_1 = require("../hooks/usePersistState");
|
|
18
|
+
var theme_1 = require("../theme");
|
|
19
|
+
var Launcher_1 = require("./Launcher");
|
|
20
|
+
var Text_1 = require("./atoms/Text");
|
|
21
|
+
// @ts-ignore
|
|
22
|
+
var _theme_1 = require("@theme");
|
|
23
|
+
var Tooltip_1 = require("./atoms/Tooltip");
|
|
24
|
+
var colors = [
|
|
25
|
+
{ $$bg: "#ff5555", $$fg: "#ffffff" },
|
|
26
|
+
{ $$bg: "#55ff55", $$fg: "#000000" },
|
|
27
|
+
{ $$bg: "#5555ff", $$fg: "#ffffff" },
|
|
28
|
+
{ $$bg: "#ff55ff", $$fg: "#ffffff" },
|
|
29
|
+
{ $$bg: "#ffff55", $$fg: "#000000" },
|
|
30
|
+
{ $$bg: "#55ffff", $$fg: "#000000" },
|
|
31
|
+
];
|
|
32
|
+
function BreakpointIndicator() {
|
|
33
|
+
var bpState = (0, useBreakpoint_1.useBreakpoint)();
|
|
34
|
+
var maxSize = parseFloat(_theme_1.breakpoints[_theme_1.breakpoints.length - 1].min);
|
|
35
|
+
var _a = (0, usePersistState_1.usePersistState)("breakpoint_indicator", false), expanded = _a[0], setExpanded = _a[1];
|
|
36
|
+
if (!expanded) {
|
|
37
|
+
return ((0, jsx_runtime_1.jsx)(Simple, __assign({ onClick: function () { return setExpanded(true); }, css: colors[bpState.index % colors.length] }, { children: (0, jsx_runtime_1.jsx)(Text_1.Text, __assign({ variant: "monoBold" }, { children: bpState.name }), void 0) }), void 0));
|
|
38
|
+
}
|
|
39
|
+
return ((0, jsx_runtime_1.jsx)(Expanded, __assign({ onClick: function () { return setExpanded(false); } }, { children: (0, jsx_runtime_1.jsxs)(Items, { children: [_theme_1.breakpoints.map(function (bp, index) {
|
|
40
|
+
return ((0, jsx_runtime_1.jsx)(Item, __assign({ css: __assign(__assign({}, colors[index % colors.length]), { $$offset: parseFloat(bp.min) / maxSize, $$size: bp.max ? (parseFloat(bp.max) - parseFloat(bp.min)) / maxSize : 0 }), last: index === _theme_1.breakpoints.length - 1, active: bpState.name === bp.key }, { children: (0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, __assign({ label: "".concat(bp.min, " - ").concat(bp.max || "∞"), nowrap: true, offset: 3 }, { children: (0, jsx_runtime_1.jsx)(Text_1.Text, __assign({ variant: "monoTiny", align: "left" }, { children: bp.key }), void 0) }), void 0) }), index));
|
|
41
|
+
}), (0, jsx_runtime_1.jsx)(Indicator, __assign({ style: { "--eddev--position": Math.min(1, bpState.width / maxSize) }, flipped: bpState.width > maxSize * 0.9 }, { children: (0, jsx_runtime_1.jsxs)(Text_1.Text, __assign({ variant: "monoTiny" }, { children: [bpState.width, "px"] }), void 0) }), void 0)] }, void 0) }), void 0));
|
|
42
|
+
}
|
|
43
|
+
exports.BreakpointIndicator = BreakpointIndicator;
|
|
44
|
+
var Expanded = (0, theme_1.styled)(Launcher_1.MenuItem, {
|
|
45
|
+
position: "relative",
|
|
46
|
+
width: "400px",
|
|
47
|
+
// height: "100%",
|
|
48
|
+
inset: 0,
|
|
49
|
+
$$bg: "black !important",
|
|
50
|
+
$$bgHover: "black !important",
|
|
51
|
+
});
|
|
52
|
+
var Simple = (0, theme_1.styled)(Launcher_1.MenuItem, {
|
|
53
|
+
$$bgHover: "$$bg !important",
|
|
54
|
+
});
|
|
55
|
+
var Items = (0, theme_1.styled)("div", {
|
|
56
|
+
position: "absolute",
|
|
57
|
+
inset: "2px 8px",
|
|
58
|
+
paddingBottom: "10px",
|
|
59
|
+
borderRadius: "100px",
|
|
60
|
+
});
|
|
61
|
+
var Item = (0, theme_1.styled)("div", {
|
|
62
|
+
position: "absolute",
|
|
63
|
+
top: 0,
|
|
64
|
+
left: "calc($$offset * 100%)",
|
|
65
|
+
width: "calc($$size * 100%)",
|
|
66
|
+
display: "flex",
|
|
67
|
+
flexDirection: "column",
|
|
68
|
+
alignItems: "stretch",
|
|
69
|
+
paddingLeft: 1,
|
|
70
|
+
paddingRight: 1,
|
|
71
|
+
paddingBottom: "2px",
|
|
72
|
+
color: "#c0c0c0",
|
|
73
|
+
"&:after": {
|
|
74
|
+
content: " ",
|
|
75
|
+
display: "block",
|
|
76
|
+
position: "absolute",
|
|
77
|
+
left: 1,
|
|
78
|
+
right: 1,
|
|
79
|
+
bottom: 0,
|
|
80
|
+
height: "2px",
|
|
81
|
+
backgroundColor: "$$bg",
|
|
82
|
+
borderRadius: "10px",
|
|
83
|
+
},
|
|
84
|
+
variants: {
|
|
85
|
+
last: {
|
|
86
|
+
true: {
|
|
87
|
+
flexGrow: "0",
|
|
88
|
+
paddingLeft: 0,
|
|
89
|
+
right: 0,
|
|
90
|
+
width: "auto",
|
|
91
|
+
backgroundColor: "transparent",
|
|
92
|
+
left: "auto",
|
|
93
|
+
"&:after": {
|
|
94
|
+
display: "none",
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
active: {
|
|
99
|
+
true: {
|
|
100
|
+
color: "$$bg",
|
|
101
|
+
fontWeight: "bold",
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
var Indicator = (0, theme_1.styled)("div", {
|
|
107
|
+
position: "absolute",
|
|
108
|
+
bottom: 0,
|
|
109
|
+
left: "calc($$position * 100%)",
|
|
110
|
+
height: "9px",
|
|
111
|
+
div: {
|
|
112
|
+
position: "absolute",
|
|
113
|
+
left: "5px",
|
|
114
|
+
},
|
|
115
|
+
"&:before": {
|
|
116
|
+
content: " ",
|
|
117
|
+
display: "block",
|
|
118
|
+
position: "absolute",
|
|
119
|
+
left: 0,
|
|
120
|
+
top: "3px",
|
|
121
|
+
width: 0,
|
|
122
|
+
height: 0,
|
|
123
|
+
borderStyle: "solid",
|
|
124
|
+
borderWidth: "0 3px 5.2px 3px",
|
|
125
|
+
borderColor: "transparent transparent white transparent",
|
|
126
|
+
transform: "translateX(-50%)",
|
|
127
|
+
},
|
|
128
|
+
variants: {
|
|
129
|
+
flipped: {
|
|
130
|
+
true: {
|
|
131
|
+
div: {
|
|
132
|
+
left: "auto",
|
|
133
|
+
right: "5px",
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export
|
|
2
|
+
export default function DevUI(): JSX.Element;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DevUI = void 0;
|
|
4
3
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
4
|
var react_1 = require("react");
|
|
6
5
|
var usePersistState_1 = require("../hooks/usePersistState");
|
|
7
6
|
var panels_1 = require("../panels");
|
|
7
|
+
var theme_1 = require("../theme");
|
|
8
|
+
var BreakpointIndicator_1 = require("./BreakpointIndicator");
|
|
8
9
|
var Launcher_1 = require("./Launcher");
|
|
9
|
-
var PanelWrapper_1 = require("./PanelWrapper");
|
|
10
10
|
function DevUI() {
|
|
11
11
|
var _a = (0, usePersistState_1.usePersistState)("launcher-is-open", false), open = _a[0], setOpen = _a[1];
|
|
12
12
|
var _b = (0, usePersistState_1.usePersistState)("panel", undefined), panel = _b[0], setPanel = _b[1];
|
|
@@ -14,6 +14,15 @@ function DevUI() {
|
|
|
14
14
|
return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Launcher_1.Launcher, { panel: panel, open: open, onChange: function (open, panel) {
|
|
15
15
|
setOpen(open);
|
|
16
16
|
setPanel(panel);
|
|
17
|
-
} }, void 0), open && PanelComponent && ((0, jsx_runtime_1.jsx)(
|
|
17
|
+
}, extras: (0, jsx_runtime_1.jsx)(BreakpointIndicator_1.BreakpointIndicator, {}, void 0) }, void 0), open && PanelComponent && ((0, jsx_runtime_1.jsx)(PanelPosition, { children: (0, jsx_runtime_1.jsx)(PanelComponent, {}, void 0) }, void 0))] }, void 0));
|
|
18
18
|
}
|
|
19
|
-
exports.
|
|
19
|
+
exports.default = DevUI;
|
|
20
|
+
var PanelPosition = (0, theme_1.styled)("div", {
|
|
21
|
+
position: "fixed",
|
|
22
|
+
left: "0px",
|
|
23
|
+
bottom: "calc($space$buttonHeight + 5px)",
|
|
24
|
+
zIndex: 10000000,
|
|
25
|
+
display: "flex",
|
|
26
|
+
alignItems: "flex-end",
|
|
27
|
+
justifyContent: "flex-end",
|
|
28
|
+
});
|
|
@@ -1,9 +1,98 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
2
|
import { PanelID } from "../panels";
|
|
3
3
|
declare type Props = {
|
|
4
4
|
open: boolean;
|
|
5
5
|
panel: PanelID | undefined;
|
|
6
|
+
extras?: ReactNode;
|
|
6
7
|
onChange: (open: boolean, panel: PanelID | undefined) => void;
|
|
7
8
|
};
|
|
8
9
|
export declare function Launcher(props: Props): JSX.Element;
|
|
10
|
+
export declare const MenuItem: import("@stitches/react/types/styled-component").StyledComponent<import("@stitches/react/types/styled-component").StyledComponent<"button", {
|
|
11
|
+
state?: "active" | "inactive" | undefined;
|
|
12
|
+
color?: "default" | "black" | undefined;
|
|
13
|
+
small?: boolean | "true" | undefined;
|
|
14
|
+
tiny?: boolean | "true" | undefined;
|
|
15
|
+
}, {}, import("@stitches/react/types/css-util").CSS<{}, {
|
|
16
|
+
space: {
|
|
17
|
+
smallButtonHeight: string;
|
|
18
|
+
buttonHeight: string;
|
|
19
|
+
0: string;
|
|
20
|
+
1: string;
|
|
21
|
+
2: string;
|
|
22
|
+
3: string;
|
|
23
|
+
4: string;
|
|
24
|
+
5: string;
|
|
25
|
+
6: string;
|
|
26
|
+
};
|
|
27
|
+
colors: {
|
|
28
|
+
bg: string;
|
|
29
|
+
bgHover: string;
|
|
30
|
+
bgHoverLight: string;
|
|
31
|
+
bgLine: string;
|
|
32
|
+
bgLineStrong: string;
|
|
33
|
+
button: string;
|
|
34
|
+
buttonHover: string;
|
|
35
|
+
fg: string;
|
|
36
|
+
fgFaded: string;
|
|
37
|
+
};
|
|
38
|
+
fontSizes: {
|
|
39
|
+
sm: string;
|
|
40
|
+
md: string;
|
|
41
|
+
lg: string;
|
|
42
|
+
xl: string;
|
|
43
|
+
};
|
|
44
|
+
fonts: {
|
|
45
|
+
body: string;
|
|
46
|
+
mono: string;
|
|
47
|
+
};
|
|
48
|
+
radii: {
|
|
49
|
+
sm: string;
|
|
50
|
+
md: string;
|
|
51
|
+
lg: string;
|
|
52
|
+
};
|
|
53
|
+
transitions: {
|
|
54
|
+
default: string;
|
|
55
|
+
};
|
|
56
|
+
}, import("@stitches/react/types/config").DefaultThemeMap, {}>>, {}, {}, import("@stitches/react/types/css-util").CSS<{}, {
|
|
57
|
+
space: {
|
|
58
|
+
smallButtonHeight: string;
|
|
59
|
+
buttonHeight: string;
|
|
60
|
+
0: string;
|
|
61
|
+
1: string;
|
|
62
|
+
2: string;
|
|
63
|
+
3: string;
|
|
64
|
+
4: string;
|
|
65
|
+
5: string;
|
|
66
|
+
6: string;
|
|
67
|
+
};
|
|
68
|
+
colors: {
|
|
69
|
+
bg: string;
|
|
70
|
+
bgHover: string;
|
|
71
|
+
bgHoverLight: string;
|
|
72
|
+
bgLine: string;
|
|
73
|
+
bgLineStrong: string;
|
|
74
|
+
button: string;
|
|
75
|
+
buttonHover: string;
|
|
76
|
+
fg: string;
|
|
77
|
+
fgFaded: string;
|
|
78
|
+
};
|
|
79
|
+
fontSizes: {
|
|
80
|
+
sm: string;
|
|
81
|
+
md: string;
|
|
82
|
+
lg: string;
|
|
83
|
+
xl: string;
|
|
84
|
+
};
|
|
85
|
+
fonts: {
|
|
86
|
+
body: string;
|
|
87
|
+
mono: string;
|
|
88
|
+
};
|
|
89
|
+
radii: {
|
|
90
|
+
sm: string;
|
|
91
|
+
md: string;
|
|
92
|
+
lg: string;
|
|
93
|
+
};
|
|
94
|
+
transitions: {
|
|
95
|
+
default: string;
|
|
96
|
+
};
|
|
97
|
+
}, import("@stitches/react/types/config").DefaultThemeMap, {}>>;
|
|
9
98
|
export {};
|