eddev 0.2.0-beta.10 → 0.2.0-beta.14
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 +4 -1
- package/cli/cli.js +1 -1
- package/config/config-schema.d.ts +7 -22
- package/config/config-schema.js +1 -6
- package/config/get-config.d.ts +6 -15
- package/config/parse-config.d.ts +4 -10
- package/dev-ui/components/BreakpointColumnHeader.d.ts +11 -0
- package/dev-ui/components/BreakpointColumnHeader.js +47 -0
- package/dev-ui/components/BreakpointIndicator.d.ts +2 -0
- package/dev-ui/components/BreakpointIndicator.js +138 -0
- package/dev-ui/components/DevUI.d.ts +2 -0
- package/dev-ui/components/DevUI.js +28 -0
- package/dev-ui/components/Launcher.d.ts +98 -0
- package/dev-ui/components/Launcher.js +94 -0
- package/dev-ui/components/PanelWrapper.d.ts +8 -0
- package/dev-ui/components/PanelWrapper.js +37 -0
- 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/atoms/Text.d.ts +45 -0
- 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.d.ts +2 -0
- package/dev-ui/components/panels/SpacingEditor.js +88 -0
- 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.d.ts +1 -0
- package/dev-ui/hooks/usePersistState.js +33 -0
- package/dev-ui/hooks/useStylesheet.d.ts +4 -0
- package/dev-ui/hooks/useStylesheet.js +31 -0
- package/dev-ui/icons.d.ts +15 -0
- package/dev-ui/icons.js +29 -0
- package/dev-ui/index.d.ts +1 -0
- package/dev-ui/index.js +13 -0
- package/dev-ui/panels.d.ts +11 -0
- package/dev-ui/panels.js +33 -0
- package/dev-ui/theme.d.ts +151 -0
- package/dev-ui/theme.js +50 -0
- package/entry/Root.js +7 -5
- package/package.json +2 -1
- package/serverless-template/pages/_app.tsx +0 -2
- package/style/createStitches.d.ts +71 -1
- package/style/createStitches.js +151 -45
- package/utils/getRepoName.js +13 -5
- package/build/workers/serverless-worker-script.d.ts +0 -0
- package/build/workers/serverless-worker-script.js +0 -1
- package/serverless-template/package-lock.json +0 -641
|
@@ -77,13 +77,15 @@ var plugin_name_defined_components_1 = __importDefault(require("./babel/plugin-n
|
|
|
77
77
|
var manifest_blocks_1 = require("./manifests/manifest-blocks");
|
|
78
78
|
var manifest_fields_1 = require("./manifests/manifest-fields");
|
|
79
79
|
var manifest_views_1 = require("./manifests/manifest-views");
|
|
80
|
+
var get_config_1 = require("../config/get-config");
|
|
80
81
|
function getWebpackConfig(opts) {
|
|
81
82
|
return __awaiter(this, void 0, void 0, function () {
|
|
82
|
-
var compiling, ALIAS, ENTRY, PLUGINS, RULES, DEFINES, VIRTUAL_MODULES, EXTERNALS, virtualModules, isServerless, isBrowser, isSSR, isDev, entryDir, distSuffix, outputFolder, loadableManifestFile, writeVirtualModule, manifestLoaders, buildID;
|
|
83
|
+
var compiling, config, ALIAS, ENTRY, PLUGINS, RULES, DEFINES, VIRTUAL_MODULES, EXTERNALS, virtualModules, isServerless, isBrowser, isSSR, isDev, entryDir, distSuffix, outputFolder, loadableManifestFile, writeVirtualModule, manifestLoaders, buildID;
|
|
83
84
|
return __generator(this, function (_a) {
|
|
84
85
|
switch (_a.label) {
|
|
85
86
|
case 0:
|
|
86
87
|
compiling = false;
|
|
88
|
+
config = (0, get_config_1.getEDConfigUnwrapped)();
|
|
87
89
|
ALIAS = {};
|
|
88
90
|
ENTRY = {};
|
|
89
91
|
PLUGINS = [];
|
|
@@ -329,6 +331,7 @@ function getWebpackConfig(opts) {
|
|
|
329
331
|
if (isDev && opts.isAdmin) {
|
|
330
332
|
DEFINES["process.BLOCK_MANIFEST_FILE"] = JSON.stringify(ALIAS["@manifest/blocks"]);
|
|
331
333
|
}
|
|
334
|
+
DEFINES["process.devUI"] = config.devUI === "enabled";
|
|
332
335
|
if (isBrowser) {
|
|
333
336
|
DEFINES["process.env.themePath"] = "window.THEME_PATH || ".concat(DEFINES["process.env.themePath"]);
|
|
334
337
|
}
|
package/cli/cli.js
CHANGED
|
@@ -86,7 +86,7 @@ program
|
|
|
86
86
|
// })
|
|
87
87
|
program
|
|
88
88
|
.command("next")
|
|
89
|
-
.description("
|
|
89
|
+
.description("Run the serverless app in standalone mode")
|
|
90
90
|
.action(function (options) {
|
|
91
91
|
(0, create_next_app_1.createNextApp)({
|
|
92
92
|
baseDirectory: process.cwd(),
|
|
@@ -11,55 +11,40 @@ export declare const EDConfigSchema: z.ZodObject<{
|
|
|
11
11
|
}, "strip", z.ZodTypeAny, {
|
|
12
12
|
devAssets?: string[] | undefined;
|
|
13
13
|
apiOnly?: boolean | undefined;
|
|
14
|
-
plugins: "proxy" | "remote";
|
|
15
14
|
enabled: boolean;
|
|
16
15
|
uploads: "proxy" | "remote";
|
|
16
|
+
plugins: "proxy" | "remote";
|
|
17
17
|
theme: "copy" | "proxy" | "remote";
|
|
18
18
|
}, {
|
|
19
19
|
devAssets?: string[] | undefined;
|
|
20
20
|
apiOnly?: boolean | undefined;
|
|
21
|
-
plugins: "proxy" | "remote";
|
|
22
21
|
enabled: boolean;
|
|
23
22
|
uploads: "proxy" | "remote";
|
|
23
|
+
plugins: "proxy" | "remote";
|
|
24
24
|
theme: "copy" | "proxy" | "remote";
|
|
25
25
|
}>>;
|
|
26
|
-
|
|
27
|
-
icoSource: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
28
|
-
svg: z.ZodOptional<z.ZodString>;
|
|
29
|
-
}, "strip", z.ZodTypeAny, {
|
|
30
|
-
svg?: string | undefined;
|
|
31
|
-
icoSource?: string | string[] | undefined;
|
|
32
|
-
}, {
|
|
33
|
-
svg?: string | undefined;
|
|
34
|
-
icoSource?: string | string[] | undefined;
|
|
35
|
-
}>>;
|
|
26
|
+
devUI: z.ZodEnum<["disabled", "enabled"]>;
|
|
36
27
|
}, "strip", z.ZodTypeAny, {
|
|
37
28
|
$schema?: string | undefined;
|
|
38
29
|
serverless?: {
|
|
39
30
|
devAssets?: string[] | undefined;
|
|
40
31
|
apiOnly?: boolean | undefined;
|
|
41
|
-
plugins: "proxy" | "remote";
|
|
42
32
|
enabled: boolean;
|
|
43
33
|
uploads: "proxy" | "remote";
|
|
34
|
+
plugins: "proxy" | "remote";
|
|
44
35
|
theme: "copy" | "proxy" | "remote";
|
|
45
36
|
} | undefined;
|
|
46
|
-
|
|
47
|
-
svg?: string | undefined;
|
|
48
|
-
icoSource?: string | string[] | undefined;
|
|
49
|
-
} | undefined;
|
|
37
|
+
devUI: "disabled" | "enabled";
|
|
50
38
|
}, {
|
|
51
39
|
$schema?: string | undefined;
|
|
52
40
|
serverless?: {
|
|
53
41
|
devAssets?: string[] | undefined;
|
|
54
42
|
apiOnly?: boolean | undefined;
|
|
55
|
-
plugins: "proxy" | "remote";
|
|
56
43
|
enabled: boolean;
|
|
57
44
|
uploads: "proxy" | "remote";
|
|
45
|
+
plugins: "proxy" | "remote";
|
|
58
46
|
theme: "copy" | "proxy" | "remote";
|
|
59
47
|
} | undefined;
|
|
60
|
-
|
|
61
|
-
svg?: string | undefined;
|
|
62
|
-
icoSource?: string | string[] | undefined;
|
|
63
|
-
} | undefined;
|
|
48
|
+
devUI: "disabled" | "enabled";
|
|
64
49
|
}>;
|
|
65
50
|
export declare type EDConfig = z.infer<typeof EDConfigSchema>;
|
package/config/config-schema.js
CHANGED
|
@@ -14,10 +14,5 @@ exports.EDConfigSchema = zod_1.z.object({
|
|
|
14
14
|
apiOnly: zod_1.z.boolean().optional(),
|
|
15
15
|
})
|
|
16
16
|
.optional(),
|
|
17
|
-
|
|
18
|
-
.object({
|
|
19
|
-
icoSource: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
|
|
20
|
-
svg: zod_1.z.string().optional(),
|
|
21
|
-
})
|
|
22
|
-
.optional(),
|
|
17
|
+
devUI: zod_1.z.enum(["disabled", "enabled"]),
|
|
23
18
|
});
|
package/config/get-config.d.ts
CHANGED
|
@@ -3,43 +3,34 @@ export declare function getEDConfig(dir?: string): import("zod").SafeParseReturn
|
|
|
3
3
|
serverless?: {
|
|
4
4
|
devAssets?: string[] | undefined;
|
|
5
5
|
apiOnly?: boolean | undefined;
|
|
6
|
-
plugins: "proxy" | "remote";
|
|
7
6
|
enabled: boolean;
|
|
8
7
|
uploads: "proxy" | "remote";
|
|
8
|
+
plugins: "proxy" | "remote";
|
|
9
9
|
theme: "copy" | "proxy" | "remote";
|
|
10
10
|
} | undefined;
|
|
11
|
-
|
|
12
|
-
svg?: string | undefined;
|
|
13
|
-
icoSource?: string | string[] | undefined;
|
|
14
|
-
} | undefined;
|
|
11
|
+
devUI: "disabled" | "enabled";
|
|
15
12
|
}, {
|
|
16
13
|
$schema?: string | undefined;
|
|
17
14
|
serverless?: {
|
|
18
15
|
devAssets?: string[] | undefined;
|
|
19
16
|
apiOnly?: boolean | undefined;
|
|
20
|
-
plugins: "proxy" | "remote";
|
|
21
17
|
enabled: boolean;
|
|
22
18
|
uploads: "proxy" | "remote";
|
|
19
|
+
plugins: "proxy" | "remote";
|
|
23
20
|
theme: "copy" | "proxy" | "remote";
|
|
24
21
|
} | undefined;
|
|
25
|
-
|
|
26
|
-
svg?: string | undefined;
|
|
27
|
-
icoSource?: string | string[] | undefined;
|
|
28
|
-
} | undefined;
|
|
22
|
+
devUI: "disabled" | "enabled";
|
|
29
23
|
}>;
|
|
30
24
|
export declare function getEDConfigUnwrapped(dir?: string): {
|
|
31
25
|
$schema?: string | undefined;
|
|
32
26
|
serverless?: {
|
|
33
27
|
devAssets?: string[] | undefined;
|
|
34
28
|
apiOnly?: boolean | undefined;
|
|
35
|
-
plugins: "proxy" | "remote";
|
|
36
29
|
enabled: boolean;
|
|
37
30
|
uploads: "proxy" | "remote";
|
|
31
|
+
plugins: "proxy" | "remote";
|
|
38
32
|
theme: "copy" | "proxy" | "remote";
|
|
39
33
|
} | undefined;
|
|
40
|
-
|
|
41
|
-
svg?: string | undefined;
|
|
42
|
-
icoSource?: string | string[] | undefined;
|
|
43
|
-
} | undefined;
|
|
34
|
+
devUI: "disabled" | "enabled";
|
|
44
35
|
};
|
|
45
36
|
export declare function getEDConfigFile(dir?: string): string;
|
package/config/parse-config.d.ts
CHANGED
|
@@ -3,27 +3,21 @@ export declare function parseConfig(config: any): import("zod").SafeParseReturnT
|
|
|
3
3
|
serverless?: {
|
|
4
4
|
devAssets?: string[] | undefined;
|
|
5
5
|
apiOnly?: boolean | undefined;
|
|
6
|
-
plugins: "proxy" | "remote";
|
|
7
6
|
enabled: boolean;
|
|
8
7
|
uploads: "proxy" | "remote";
|
|
8
|
+
plugins: "proxy" | "remote";
|
|
9
9
|
theme: "copy" | "proxy" | "remote";
|
|
10
10
|
} | undefined;
|
|
11
|
-
|
|
12
|
-
svg?: string | undefined;
|
|
13
|
-
icoSource?: string | string[] | undefined;
|
|
14
|
-
} | undefined;
|
|
11
|
+
devUI: "disabled" | "enabled";
|
|
15
12
|
}, {
|
|
16
13
|
$schema?: string | undefined;
|
|
17
14
|
serverless?: {
|
|
18
15
|
devAssets?: string[] | undefined;
|
|
19
16
|
apiOnly?: boolean | undefined;
|
|
20
|
-
plugins: "proxy" | "remote";
|
|
21
17
|
enabled: boolean;
|
|
22
18
|
uploads: "proxy" | "remote";
|
|
19
|
+
plugins: "proxy" | "remote";
|
|
23
20
|
theme: "copy" | "proxy" | "remote";
|
|
24
21
|
} | undefined;
|
|
25
|
-
|
|
26
|
-
svg?: string | undefined;
|
|
27
|
-
icoSource?: string | string[] | undefined;
|
|
28
|
-
} | undefined;
|
|
22
|
+
devUI: "disabled" | "enabled";
|
|
29
23
|
}>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type Props = {
|
|
3
|
+
lerpStart?: boolean;
|
|
4
|
+
lerps?: boolean;
|
|
5
|
+
name: string;
|
|
6
|
+
defined: boolean;
|
|
7
|
+
onLerpChange?(lerpStart: boolean): void;
|
|
8
|
+
onDefinedChange?(defined: boolean): void;
|
|
9
|
+
};
|
|
10
|
+
export declare function BreakpointColumnHeader(props: Props): JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
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.BreakpointColumnHeader = void 0;
|
|
15
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
var icons_1 = require("../icons");
|
|
17
|
+
var theme_1 = require("../theme");
|
|
18
|
+
var Text_1 = require("./atoms/Text");
|
|
19
|
+
function BreakpointColumnHeader(props) {
|
|
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));
|
|
21
|
+
}
|
|
22
|
+
exports.BreakpointColumnHeader = BreakpointColumnHeader;
|
|
23
|
+
var Wrapper = (0, theme_1.styled)("div", {
|
|
24
|
+
display: "flex",
|
|
25
|
+
width: "100%",
|
|
26
|
+
flexDirection: "column",
|
|
27
|
+
});
|
|
28
|
+
var ToggleButton = (0, theme_1.styled)("button", {
|
|
29
|
+
appearance: "none",
|
|
30
|
+
background: "transparent",
|
|
31
|
+
border: "0px",
|
|
32
|
+
padding: "3px",
|
|
33
|
+
height: "auto",
|
|
34
|
+
display: "flex",
|
|
35
|
+
alignItems: "center",
|
|
36
|
+
justifyContent: "center",
|
|
37
|
+
color: "inherit",
|
|
38
|
+
"&:hover": {
|
|
39
|
+
// backgroundColor: "$bgHover",
|
|
40
|
+
},
|
|
41
|
+
svg: {
|
|
42
|
+
fill: "$fg",
|
|
43
|
+
width: "14px",
|
|
44
|
+
height: "14px",
|
|
45
|
+
display: "block",
|
|
46
|
+
},
|
|
47
|
+
});
|
|
@@ -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
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
var react_1 = require("react");
|
|
5
|
+
var usePersistState_1 = require("../hooks/usePersistState");
|
|
6
|
+
var panels_1 = require("../panels");
|
|
7
|
+
var theme_1 = require("../theme");
|
|
8
|
+
var BreakpointIndicator_1 = require("./BreakpointIndicator");
|
|
9
|
+
var Launcher_1 = require("./Launcher");
|
|
10
|
+
function DevUI() {
|
|
11
|
+
var _a = (0, usePersistState_1.usePersistState)("launcher-is-open", false), open = _a[0], setOpen = _a[1];
|
|
12
|
+
var _b = (0, usePersistState_1.usePersistState)("panel", undefined), panel = _b[0], setPanel = _b[1];
|
|
13
|
+
var PanelComponent = panel && panel in panels_1.DEV_UI_PANELS ? panels_1.DEV_UI_PANELS[panel].component : undefined;
|
|
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
|
+
setOpen(open);
|
|
16
|
+
setPanel(panel);
|
|
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
|
+
}
|
|
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
|
+
});
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { PanelID } from "../panels";
|
|
3
|
+
declare type Props = {
|
|
4
|
+
open: boolean;
|
|
5
|
+
panel: PanelID | undefined;
|
|
6
|
+
extras?: ReactNode;
|
|
7
|
+
onChange: (open: boolean, panel: PanelID | undefined) => void;
|
|
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, {}>>;
|
|
98
|
+
export {};
|
|
@@ -0,0 +1,94 @@
|
|
|
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.MenuItem = exports.Launcher = void 0;
|
|
15
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
var icons_1 = require("../icons");
|
|
17
|
+
var panels_1 = require("../panels");
|
|
18
|
+
var theme_1 = require("../theme");
|
|
19
|
+
var Button_1 = require("./atoms/Button");
|
|
20
|
+
function Launcher(props) {
|
|
21
|
+
return ((0, jsx_runtime_1.jsxs)(LauncherWrapper, { children: [(0, jsx_runtime_1.jsx)(LauncherButton, __assign({ onClick: function (e) {
|
|
22
|
+
props.onChange(!props.open, props.panel);
|
|
23
|
+
} }, { children: props.open ? icons_1.close : icons_1.bolt }), void 0), (0, jsx_runtime_1.jsxs)(Menu, { children: [props.open &&
|
|
24
|
+
Object.entries(panels_1.DEV_UI_PANELS).map(function (_a) {
|
|
25
|
+
var key = _a[0], panel = _a[1];
|
|
26
|
+
return ((0, jsx_runtime_1.jsxs)(exports.MenuItem, __assign({ state: key === props.panel ? "active" : props.panel ? "inactive" : undefined, onClick: function () { return props.onChange(true, props.panel === key ? undefined : key); } }, { children: [panel.icon, panel.label] }), key));
|
|
27
|
+
}), props.extras] }, void 0)] }, void 0));
|
|
28
|
+
}
|
|
29
|
+
exports.Launcher = Launcher;
|
|
30
|
+
var LauncherWrapper = (0, theme_1.styled)("div", {
|
|
31
|
+
position: "fixed",
|
|
32
|
+
bottom: "5px",
|
|
33
|
+
left: "5px",
|
|
34
|
+
zIndex: 100000000,
|
|
35
|
+
fontFamily: "$body",
|
|
36
|
+
fontSize: "$sm",
|
|
37
|
+
pointerEvents: "none",
|
|
38
|
+
$$height: "$space$buttonHeight",
|
|
39
|
+
userSelect: "none",
|
|
40
|
+
});
|
|
41
|
+
var LauncherButton = (0, theme_1.styled)("div", {
|
|
42
|
+
borderRadius: "100px",
|
|
43
|
+
width: "$$height",
|
|
44
|
+
height: "$$height",
|
|
45
|
+
bottom: "5px",
|
|
46
|
+
left: "5px",
|
|
47
|
+
background: "$bg",
|
|
48
|
+
display: "flex",
|
|
49
|
+
alignItems: "center",
|
|
50
|
+
justifyContent: "center",
|
|
51
|
+
pointerEvents: "all",
|
|
52
|
+
"&:hover": {
|
|
53
|
+
backgroundColor: "$bgHover",
|
|
54
|
+
},
|
|
55
|
+
svg: {
|
|
56
|
+
fill: "$fg",
|
|
57
|
+
display: "block",
|
|
58
|
+
width: "16px",
|
|
59
|
+
height: "16px",
|
|
60
|
+
},
|
|
61
|
+
cursor: "pointer",
|
|
62
|
+
});
|
|
63
|
+
var Menu = (0, theme_1.styled)("div", {
|
|
64
|
+
position: "absolute",
|
|
65
|
+
left: "calc($$height + 4px)",
|
|
66
|
+
bottom: 0,
|
|
67
|
+
display: "flex",
|
|
68
|
+
flexDirection: "row",
|
|
69
|
+
alignItems: "flex-start",
|
|
70
|
+
width: "calc(100vw - 40px)",
|
|
71
|
+
"&::-webkit-scrollbar": {
|
|
72
|
+
width: 0,
|
|
73
|
+
height: 0,
|
|
74
|
+
background: "transparent",
|
|
75
|
+
},
|
|
76
|
+
variants: {
|
|
77
|
+
open: {
|
|
78
|
+
true: {
|
|
79
|
+
opacity: 1,
|
|
80
|
+
pointerEvents: "all",
|
|
81
|
+
},
|
|
82
|
+
false: {
|
|
83
|
+
opacity: 0,
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
exports.MenuItem = (0, theme_1.styled)(Button_1.Button, {
|
|
89
|
+
marginRight: "4px",
|
|
90
|
+
defaultVariants: {
|
|
91
|
+
color: "dark",
|
|
92
|
+
},
|
|
93
|
+
flex: "0 0 auto",
|
|
94
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PanelWrapper = void 0;
|
|
4
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
var theme_1 = require("../theme");
|
|
6
|
+
function PanelWrapper(props) {
|
|
7
|
+
return ((0, jsx_runtime_1.jsxs)(Wrapper, { children: [(0, jsx_runtime_1.jsxs)(Header, { children: [props.title && (0, jsx_runtime_1.jsx)(Title, { children: props.title }, void 0), " ", (0, jsx_runtime_1.jsx)(Buttons, { children: props.buttons }, void 0)] }, void 0), (0, jsx_runtime_1.jsx)(Contents, { children: props.children }, void 0)] }, void 0));
|
|
8
|
+
}
|
|
9
|
+
exports.PanelWrapper = PanelWrapper;
|
|
10
|
+
var Wrapper = (0, theme_1.styled)("div", {
|
|
11
|
+
backgroundColor: "$bg",
|
|
12
|
+
color: "$fg",
|
|
13
|
+
borderRadius: "$md",
|
|
14
|
+
maxWidth: "calc(100vw - 10px)",
|
|
15
|
+
fontFamily: "$body",
|
|
16
|
+
fontSize: "$md",
|
|
17
|
+
margin: "5px",
|
|
18
|
+
});
|
|
19
|
+
var Header = (0, theme_1.styled)("div", {
|
|
20
|
+
borderBottom: "1px solid $colors$bgHover",
|
|
21
|
+
padding: "$2",
|
|
22
|
+
display: "flex",
|
|
23
|
+
});
|
|
24
|
+
var Title = (0, theme_1.styled)("div", {
|
|
25
|
+
fontSize: "$lg",
|
|
26
|
+
flex: "1 1 auto",
|
|
27
|
+
});
|
|
28
|
+
var Contents = (0, theme_1.styled)("div", {
|
|
29
|
+
padding: "$2",
|
|
30
|
+
});
|
|
31
|
+
var Buttons = (0, theme_1.styled)("div", {
|
|
32
|
+
display: "flex",
|
|
33
|
+
alignItems: "center",
|
|
34
|
+
"> *": {
|
|
35
|
+
marginLeft: "5px",
|
|
36
|
+
},
|
|
37
|
+
});
|