eddev 0.2.0-beta.11 → 0.2.0-beta.12
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/BreakpointItemHeader.d.ts +11 -0
- package/dev-ui/components/BreakpointItemHeader.js +50 -0
- package/dev-ui/components/BreakpointList.d.ts +6 -0
- package/dev-ui/components/BreakpointList.js +38 -0
- package/dev-ui/components/DevUI.d.ts +2 -0
- package/dev-ui/components/DevUI.js +19 -0
- package/dev-ui/components/Launcher.d.ts +9 -0
- package/dev-ui/components/Launcher.js +118 -0
- package/dev-ui/components/PanelWrapper.d.ts +4 -0
- package/dev-ui/components/PanelWrapper.js +21 -0
- package/dev-ui/components/Pill.d.ts +0 -0
- package/dev-ui/components/Pill.js +1 -0
- package/dev-ui/components/SpacingEditor.d.ts +2 -0
- package/dev-ui/components/SpacingEditor.js +10 -0
- package/dev-ui/components/Text.d.ts +39 -0
- package/dev-ui/components/Text.js +13 -0
- package/dev-ui/components/panels/SpacingEditor.d.ts +2 -0
- package/dev-ui/components/panels/SpacingEditor.js +56 -0
- package/dev-ui/hooks/usePersistState.d.ts +1 -0
- package/dev-ui/hooks/usePersistState.js +28 -0
- package/dev-ui/icons.d.ts +11 -0
- package/dev-ui/icons.js +25 -0
- package/dev-ui/index.d.ts +1 -0
- package/dev-ui/index.js +5 -0
- package/dev-ui/panels.d.ts +11 -0
- package/dev-ui/panels.js +31 -0
- package/dev-ui/theme.d.ts +135 -0
- package/dev-ui/theme.js +45 -0
- package/dynamic/dynamic-component.d.ts +0 -1
- package/entry/Root.js +6 -5
- package/package.json +1 -1
- package/serverless/create-rpc-client.d.ts +0 -1
- package/serverless-template/pages/_app.tsx +0 -2
- package/style/createStitches.d.ts +63 -2
- package/style/createStitches.js +182 -40
|
@@ -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,50 @@
|
|
|
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
|
+
function BreakpointColumnHeader(props) {
|
|
19
|
+
return ((0, jsx_runtime_1.jsxs)(Wrapper, { children: [(0, jsx_runtime_1.jsx)(NameWrapper, { 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.lerpStart ? icons_1.checkFilled : icons_1.checkEmpty }), 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
|
+
exports.BreakpointColumnHeader = BreakpointColumnHeader;
|
|
22
|
+
var Wrapper = (0, theme_1.styled)("div", {
|
|
23
|
+
display: "flex",
|
|
24
|
+
width: "100%",
|
|
25
|
+
flexDirection: "column",
|
|
26
|
+
});
|
|
27
|
+
var ToggleButton = (0, theme_1.styled)("button", {
|
|
28
|
+
appearance: "none",
|
|
29
|
+
background: "transparent",
|
|
30
|
+
border: "0px",
|
|
31
|
+
padding: "3px",
|
|
32
|
+
height: "auto",
|
|
33
|
+
display: "flex",
|
|
34
|
+
alignItems: "center",
|
|
35
|
+
justifyContent: "center",
|
|
36
|
+
"&:hover": {
|
|
37
|
+
// backgroundColor: "$bgHover",
|
|
38
|
+
},
|
|
39
|
+
svg: {
|
|
40
|
+
fill: "$fg",
|
|
41
|
+
width: "14px",
|
|
42
|
+
height: "14px",
|
|
43
|
+
display: "block",
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
var NameWrapper = (0, theme_1.styled)("div", {
|
|
47
|
+
fontFamily: "$body",
|
|
48
|
+
fontSize: "$sm",
|
|
49
|
+
textAlign: "center",
|
|
50
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
+
if (ar || !(i in from)) {
|
|
5
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
+
ar[i] = from[i];
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.BreakpointList = void 0;
|
|
13
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
14
|
+
// @ts-ignore
|
|
15
|
+
var _theme_1 = require("@theme");
|
|
16
|
+
var theme_1 = require("../theme");
|
|
17
|
+
function BreakpointList(props) {
|
|
18
|
+
var breakpoints = __spreadArray(["initial"], _theme_1.originalConfig.breakpoints, true);
|
|
19
|
+
return ((0, jsx_runtime_1.jsx)(Row, { children: breakpoints.map(function (breakpoint, index) {
|
|
20
|
+
return (0, jsx_runtime_1.jsx)(Cell, { children: props.renderBreakpoint(breakpoint, index) }, void 0);
|
|
21
|
+
}) }, void 0));
|
|
22
|
+
}
|
|
23
|
+
exports.BreakpointList = BreakpointList;
|
|
24
|
+
var Row = (0, theme_1.styled)("div", {
|
|
25
|
+
display: "flex",
|
|
26
|
+
});
|
|
27
|
+
var Cell = (0, theme_1.styled)("div", {
|
|
28
|
+
flex: "1 1 auto",
|
|
29
|
+
width: "100px",
|
|
30
|
+
display: "flex",
|
|
31
|
+
alignItems: "center",
|
|
32
|
+
justifyContent: "center",
|
|
33
|
+
borderLeft: "1px solid $colors$bgHoverLight",
|
|
34
|
+
borderBottom: "1px solid $colors$bgHoverLight",
|
|
35
|
+
"&:hover": {
|
|
36
|
+
// backgroundColor: "$bgHoverLight",
|
|
37
|
+
},
|
|
38
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DevUI = void 0;
|
|
4
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
var react_1 = require("react");
|
|
6
|
+
var usePersistState_1 = require("../hooks/usePersistState");
|
|
7
|
+
var panels_1 = require("../panels");
|
|
8
|
+
var Launcher_1 = require("./Launcher");
|
|
9
|
+
var PanelWrapper_1 = require("./PanelWrapper");
|
|
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
|
+
} }, void 0), open && PanelComponent && ((0, jsx_runtime_1.jsx)(PanelWrapper_1.PanelWrapper, { children: (0, jsx_runtime_1.jsx)(PanelComponent, {}, void 0) }, void 0))] }, void 0));
|
|
18
|
+
}
|
|
19
|
+
exports.DevUI = DevUI;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { PanelID } from "../panels";
|
|
3
|
+
declare type Props = {
|
|
4
|
+
open: boolean;
|
|
5
|
+
panel: PanelID | undefined;
|
|
6
|
+
onChange: (open: boolean, panel: PanelID | undefined) => void;
|
|
7
|
+
};
|
|
8
|
+
export declare function Launcher(props: Props): JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,118 @@
|
|
|
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.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
|
+
function Launcher(props) {
|
|
20
|
+
return ((0, jsx_runtime_1.jsxs)(LauncherWrapper, { children: [(0, jsx_runtime_1.jsx)(LauncherButton, __assign({ onClick: function (e) {
|
|
21
|
+
props.onChange(!props.open, props.panel);
|
|
22
|
+
} }, { children: props.open ? icons_1.close : icons_1.bolt }), void 0), (0, jsx_runtime_1.jsx)(Menu, __assign({ open: props.open }, { children: Object.entries(panels_1.DEV_UI_PANELS).map(function (_a) {
|
|
23
|
+
var key = _a[0], panel = _a[1];
|
|
24
|
+
return ((0, jsx_runtime_1.jsxs)(MenuItem, __assign({ state: key === props.panel ? "active" : props.panel ? "inactive" : undefined, onClick: function () { return props.onChange(true, key); } }, { children: [panel.icon, panel.label] }), key));
|
|
25
|
+
}) }), void 0)] }, void 0));
|
|
26
|
+
}
|
|
27
|
+
exports.Launcher = Launcher;
|
|
28
|
+
var LauncherWrapper = (0, theme_1.styled)("div", {
|
|
29
|
+
position: "fixed",
|
|
30
|
+
bottom: "5px",
|
|
31
|
+
left: "5px",
|
|
32
|
+
zIndex: 100000000,
|
|
33
|
+
fontFamily: "$body",
|
|
34
|
+
fontSize: "$md",
|
|
35
|
+
pointerEvents: "none",
|
|
36
|
+
$$height: "$space$buttonHeight",
|
|
37
|
+
userSelect: "none",
|
|
38
|
+
});
|
|
39
|
+
var LauncherButton = (0, theme_1.styled)("div", {
|
|
40
|
+
borderRadius: "100px",
|
|
41
|
+
width: "$$height",
|
|
42
|
+
height: "$$height",
|
|
43
|
+
bottom: "5px",
|
|
44
|
+
left: "5px",
|
|
45
|
+
background: "$bg",
|
|
46
|
+
display: "flex",
|
|
47
|
+
alignItems: "center",
|
|
48
|
+
justifyContent: "center",
|
|
49
|
+
pointerEvents: "all",
|
|
50
|
+
"&:hover": {
|
|
51
|
+
backgroundColor: "$bgHover",
|
|
52
|
+
},
|
|
53
|
+
svg: {
|
|
54
|
+
fill: "$fg",
|
|
55
|
+
display: "block",
|
|
56
|
+
width: "16px",
|
|
57
|
+
height: "16px",
|
|
58
|
+
},
|
|
59
|
+
cursor: "pointer",
|
|
60
|
+
});
|
|
61
|
+
var Menu = (0, theme_1.styled)("div", {
|
|
62
|
+
position: "absolute",
|
|
63
|
+
left: "calc($$height + 4px)",
|
|
64
|
+
bottom: 0,
|
|
65
|
+
display: "flex",
|
|
66
|
+
flexDirection: "row",
|
|
67
|
+
alignItems: "flex-start",
|
|
68
|
+
width: "calc(100vw - 40px)",
|
|
69
|
+
overflow: "auto",
|
|
70
|
+
"&::-webkit-scrollbar": {
|
|
71
|
+
width: 0,
|
|
72
|
+
height: 0,
|
|
73
|
+
background: "transparent",
|
|
74
|
+
},
|
|
75
|
+
variants: {
|
|
76
|
+
open: {
|
|
77
|
+
true: {
|
|
78
|
+
opacity: 1,
|
|
79
|
+
pointerEvents: "all",
|
|
80
|
+
},
|
|
81
|
+
false: {
|
|
82
|
+
opacity: 0,
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
var MenuItem = (0, theme_1.styled)("div", {
|
|
88
|
+
background: "$bg",
|
|
89
|
+
color: "$fg",
|
|
90
|
+
borderRadius: "100px",
|
|
91
|
+
whiteSpace: "nowrap",
|
|
92
|
+
marginRight: "4px",
|
|
93
|
+
padding: "4px 8px",
|
|
94
|
+
display: "flex",
|
|
95
|
+
alignItems: "center",
|
|
96
|
+
cursor: "pointer",
|
|
97
|
+
boxSizing: "border-box",
|
|
98
|
+
height: "$$height",
|
|
99
|
+
"&:hover": {
|
|
100
|
+
backgroundColor: "$bgHover",
|
|
101
|
+
color: "$fg",
|
|
102
|
+
},
|
|
103
|
+
svg: {
|
|
104
|
+
display: "block",
|
|
105
|
+
fill: "currentColor",
|
|
106
|
+
marginRight: "5px",
|
|
107
|
+
width: "14px",
|
|
108
|
+
height: "14px",
|
|
109
|
+
},
|
|
110
|
+
variants: {
|
|
111
|
+
state: {
|
|
112
|
+
active: {},
|
|
113
|
+
inactive: {
|
|
114
|
+
color: "$fgFaded",
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
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.jsx)(Wrapper, { children: props.children }, void 0);
|
|
8
|
+
}
|
|
9
|
+
exports.PanelWrapper = PanelWrapper;
|
|
10
|
+
var Wrapper = (0, theme_1.styled)("div", {
|
|
11
|
+
position: "fixed",
|
|
12
|
+
left: "5px",
|
|
13
|
+
bottom: "calc($space$buttonHeight + 10px)",
|
|
14
|
+
backgroundColor: "$bg",
|
|
15
|
+
color: "$fg",
|
|
16
|
+
borderRadius: "$sm",
|
|
17
|
+
maxWidth: "calc(100vw - 10px)",
|
|
18
|
+
fontFamily: "$body",
|
|
19
|
+
fontSize: "$md",
|
|
20
|
+
zIndex: 10000000,
|
|
21
|
+
});
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SpacingEditor = void 0;
|
|
4
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
var _theme_1 = require("@theme");
|
|
6
|
+
function SpacingEditor() {
|
|
7
|
+
console.log("CONFIG", _theme_1.config);
|
|
8
|
+
return (0, jsx_runtime_1.jsx)("div", { children: "Spacing" }, void 0);
|
|
9
|
+
}
|
|
10
|
+
exports.SpacingEditor = SpacingEditor;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export declare const Text: import("@stitches/react/types/styled-component").StyledComponent<"div", {
|
|
2
|
+
variant?: "h1" | undefined;
|
|
3
|
+
}, {}, import("@stitches/react/types/css-util").CSS<{}, {
|
|
4
|
+
space: {
|
|
5
|
+
buttonHeight: string;
|
|
6
|
+
0: string;
|
|
7
|
+
1: string;
|
|
8
|
+
2: string;
|
|
9
|
+
3: string;
|
|
10
|
+
4: string;
|
|
11
|
+
5: string;
|
|
12
|
+
6: string;
|
|
13
|
+
};
|
|
14
|
+
colors: {
|
|
15
|
+
bg: string;
|
|
16
|
+
bgHover: string;
|
|
17
|
+
bgHoverLight: string;
|
|
18
|
+
fg: string;
|
|
19
|
+
fgFaded: string;
|
|
20
|
+
};
|
|
21
|
+
fontSizes: {
|
|
22
|
+
sm: string;
|
|
23
|
+
md: string;
|
|
24
|
+
lg: string;
|
|
25
|
+
xl: string;
|
|
26
|
+
};
|
|
27
|
+
fonts: {
|
|
28
|
+
body: string;
|
|
29
|
+
mono: string;
|
|
30
|
+
};
|
|
31
|
+
radii: {
|
|
32
|
+
sm: string;
|
|
33
|
+
md: string;
|
|
34
|
+
lg: string;
|
|
35
|
+
};
|
|
36
|
+
transitions: {
|
|
37
|
+
default: string;
|
|
38
|
+
};
|
|
39
|
+
}, import("@stitches/react/types/config").DefaultThemeMap, {}>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Text = void 0;
|
|
4
|
+
var theme_1 = require("../theme");
|
|
5
|
+
exports.Text = (0, theme_1.styled)("div", {
|
|
6
|
+
variants: {
|
|
7
|
+
variant: {
|
|
8
|
+
h1: {
|
|
9
|
+
fontSize: "$xl",
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
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.SpacingEditor = void 0;
|
|
15
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
// @ts-ignore
|
|
17
|
+
var _theme_1 = require("@theme");
|
|
18
|
+
var react_1 = require("react");
|
|
19
|
+
var style_1 = require("../../../style");
|
|
20
|
+
var theme_1 = require("../../theme");
|
|
21
|
+
var BreakpointItemHeader_1 = require("../BreakpointItemHeader");
|
|
22
|
+
var BreakpointList_1 = require("../BreakpointList");
|
|
23
|
+
function SpacingEditor() {
|
|
24
|
+
// const [values, setValues] = usePersistState<ResponsiveSpace | undefined>("spacing", undefined)
|
|
25
|
+
var _a = (0, react_1.useState)(function () {
|
|
26
|
+
return __assign({}, _theme_1.originalConfig.responsive.space);
|
|
27
|
+
}), values = _a[0], setValues = _a[1];
|
|
28
|
+
console.log("CONFIG", _theme_1.originalConfig);
|
|
29
|
+
var parsedBreakpoints = (0, style_1.parseBreakpoints)(_theme_1.originalConfig.breakpoints, _theme_1.originalConfig.media);
|
|
30
|
+
console.log("A");
|
|
31
|
+
var info = (0, style_1.parseResponsiveObject)(parsedBreakpoints, values ? values[0] : {});
|
|
32
|
+
return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)(SpacingTable, { children: [(0, jsx_runtime_1.jsxs)(TableHeaderRow, { children: [(0, jsx_runtime_1.jsx)(TableCell, { children: "Token" }, void 0), (0, jsx_runtime_1.jsx)(TableCell, { children: (0, jsx_runtime_1.jsx)(BreakpointList_1.BreakpointList, { renderBreakpoint: function (bp, i) {
|
|
33
|
+
var bpInfo = info.find(function (item) { return item.breakpoint === bp; });
|
|
34
|
+
return (0, jsx_runtime_1.jsx)(BreakpointItemHeader_1.BreakpointColumnHeader, { name: bp, defined: !!(bpInfo === null || bpInfo === void 0 ? void 0 : bpInfo.defined) }, void 0);
|
|
35
|
+
} }, void 0) }, void 0)] }, void 0), Object.entries(values || {}).map(function (_a) {
|
|
36
|
+
var token = _a[0], value = _a[1];
|
|
37
|
+
console.log("B", token, value);
|
|
38
|
+
var info = (0, style_1.parseResponsiveObject)(parsedBreakpoints, value);
|
|
39
|
+
return ((0, jsx_runtime_1.jsxs)(TableRow, { children: [(0, jsx_runtime_1.jsx)(TableCell, { children: token }, void 0), (0, jsx_runtime_1.jsx)(TableCell, { children: (0, jsx_runtime_1.jsx)(BreakpointList_1.BreakpointList, { renderBreakpoint: function (bp, i) {
|
|
40
|
+
console.log("VALUE", value);
|
|
41
|
+
var bpInfo = info.find(function (item) { return item.breakpoint === bp; });
|
|
42
|
+
return value["@" + bp];
|
|
43
|
+
} }, void 0) }, void 0)] }, token));
|
|
44
|
+
})] }, void 0) }, void 0));
|
|
45
|
+
}
|
|
46
|
+
exports.SpacingEditor = SpacingEditor;
|
|
47
|
+
var SpacingTable = (0, theme_1.styled)("div", {
|
|
48
|
+
display: "table",
|
|
49
|
+
});
|
|
50
|
+
var TableRow = (0, theme_1.styled)("div", {
|
|
51
|
+
display: "table-row",
|
|
52
|
+
});
|
|
53
|
+
var TableHeaderRow = (0, theme_1.styled)(TableRow, {});
|
|
54
|
+
var TableCell = (0, theme_1.styled)("div", {
|
|
55
|
+
display: "table-cell",
|
|
56
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function usePersistState<T>(id: string, initial: T): [T, (value: T) => void];
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.usePersistState = void 0;
|
|
4
|
+
var react_1 = require("react");
|
|
5
|
+
var get = function (id, fallback) {
|
|
6
|
+
if (fallback === void 0) { fallback = undefined; }
|
|
7
|
+
var value = localStorage.getItem("devui_" + id);
|
|
8
|
+
if (value !== null) {
|
|
9
|
+
return JSON.parse(value);
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
return fallback;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
var set = function (id, value) {
|
|
16
|
+
localStorage.setItem("devui_" + id, JSON.stringify(value));
|
|
17
|
+
};
|
|
18
|
+
function usePersistState(id, initial) {
|
|
19
|
+
var _a = (0, react_1.useState)(function () { return get(id, initial); }), value = _a[0], setValue = _a[1];
|
|
20
|
+
return [
|
|
21
|
+
value,
|
|
22
|
+
function (value) {
|
|
23
|
+
set(id, value);
|
|
24
|
+
setValue(value);
|
|
25
|
+
},
|
|
26
|
+
];
|
|
27
|
+
}
|
|
28
|
+
exports.usePersistState = usePersistState;
|