eddev 0.2.67-beta1 → 0.3.0-beta1
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/admin/components/ImageWell.d.ts +2 -2
- package/admin/components/ImageWell.js +51 -39
- package/admin/defineField.d.ts +2 -2
- package/admin/defineWidget.d.ts +1 -1
- package/admin/defineWidget.js +2 -2
- package/admin/index.js +1 -5
- package/admin/installFieldTypes.js +26 -26
- package/admin/runWidgets.js +28 -17
- package/admin/selectMedia.d.ts +2 -2
- package/admin/selectMedia.js +1 -1
- package/blocks/ContentBlocks.d.ts +6 -6
- package/blocks/ContentBlocks.js +66 -58
- package/blocks/ErrorBoundaryEditor.d.ts +1 -1
- package/blocks/ErrorBoundaryEditor.js +45 -16
- package/blocks/ErrorBoundaryFrontend.d.ts +1 -1
- package/blocks/ErrorBoundaryFrontend.js +45 -16
- package/blocks/InspectorControls.d.ts +1 -1
- package/blocks/InspectorControls.js +3 -3
- package/blocks/blockAttributes.d.ts +2 -2
- package/blocks/blockAttributes.js +44 -24
- package/blocks/index.js +1 -5
- package/blocks/inlineEditing.d.ts +6 -6
- package/blocks/inlineEditing.js +55 -36
- package/blocks/installGutenbergHooks.js +68 -48
- package/build/babel/plugin-name-defined-components.js +16 -15
- package/build/build-favicon.js +62 -11
- package/build/clean.js +52 -5
- package/build/create-codegen-worker.js +33 -78
- package/build/create-serverless-dev-worker.js +39 -61
- package/build/create-webpack-worker.js +33 -65
- package/build/file-tree.d.ts +2 -2
- package/build/file-tree.js +12 -12
- package/build/get-webpack-config.js +395 -341
- package/build/graphql-codegen/graphql-codegen-files.js +25 -31
- package/build/graphql-codegen/graphql-codegen-no-duplicates.js +4 -4
- package/build/graphql-codegen/graphql-codegen-queries.js +99 -102
- package/build/manifests/manifest-blocks.d.ts +1 -1
- package/build/manifests/manifest-blocks.js +29 -37
- package/build/manifests/manifest-fields.d.ts +1 -1
- package/build/manifests/manifest-fields.js +21 -23
- package/build/manifests/manifest-views.d.ts +1 -1
- package/build/manifests/manifest-views.js +25 -32
- package/build/manifests/manifest-widgets.d.ts +1 -1
- package/build/manifests/manifest-widgets.js +20 -22
- package/build/manifests/manifest.d.ts +2 -2
- package/build/manifests/manifest.js +94 -30
- package/build/reporter.d.ts +1 -1
- package/build/reporter.js +32 -29
- package/build/serverless/create-next-app.d.ts +1 -1
- package/build/serverless/create-next-app.js +467 -245
- package/build/state/codegen-state.d.ts +4 -4
- package/build/state/compiler-state.d.ts +5 -5
- package/build/state/serverless-state.d.ts +3 -3
- package/build/workers/codegen-worker-script.js +519 -393
- package/build/workers/serverless-worker-dev-script.js +4 -4
- package/build/workers/webpack-worker-script.js +156 -90
- package/cli/build.dev.d.ts +1 -1
- package/cli/build.dev.js +126 -79
- package/cli/build.prod.d.ts +1 -1
- package/cli/build.prod.js +98 -42
- package/cli/cli.js +28 -19
- package/cli/display/components/BundleDisplay.d.ts +1 -1
- package/cli/display/components/BundleDisplay.js +24 -13
- package/cli/display/components/CodegenDisplay.d.ts +1 -1
- package/cli/display/components/CodegenDisplay.js +25 -14
- package/cli/display/components/DevCLIDisplay.d.ts +2 -2
- package/cli/display/components/DevCLIDisplay.js +25 -14
- package/cli/display/components/Fullscreen.js +20 -9
- package/cli/display/components/ServerlessDisplay.d.ts +2 -2
- package/cli/display/components/ServerlessDisplay.js +26 -15
- package/cli/display/components/StatusIcon.d.ts +2 -2
- package/cli/display/components/StatusIcon.js +3 -3
- package/cli/preinstall.js +5 -4
- package/cli/setup.js +73 -25
- package/components/AdminBar.d.ts +1 -1
- package/components/AdminBar.js +3 -37
- package/components/BrowserRouter.d.ts +2 -2
- package/components/BrowserRouter.js +54 -41
- package/components/InlinePage.d.ts +2 -2
- package/components/InlinePage.js +29 -17
- package/components/NextRouter.d.ts +2 -2
- package/components/NextRouter.js +29 -20
- package/components/index.js +1 -5
- package/config/config-schema.d.ts +1 -1
- package/config/config-schema.js +1 -1
- package/config/create-schema-file.js +6 -6
- package/config/get-config.js +13 -10
- package/config/index.js +1 -5
- package/config/parse-config.js +1 -1
- package/config/print-zod-errors.js +3 -3
- package/dev-ui/components/BreakpointColumnHeader.d.ts +2 -2
- package/dev-ui/components/BreakpointColumnHeader.js +18 -7
- package/dev-ui/components/BreakpointIndicator.d.ts +1 -1
- package/dev-ui/components/BreakpointIndicator.js +32 -25
- package/dev-ui/components/DevUI.d.ts +1 -1
- package/dev-ui/components/DevUI.js +13 -13
- package/dev-ui/components/Launcher.d.ts +2 -2
- package/dev-ui/components/Launcher.js +25 -13
- package/dev-ui/components/PanelWrapper.d.ts +2 -2
- package/dev-ui/components/PanelWrapper.js +8 -8
- package/dev-ui/components/ResponsiveLerpControl.d.ts +2 -2
- package/dev-ui/components/ResponsiveLerpControl.js +38 -27
- package/dev-ui/components/ResponsiveScaleEditor.d.ts +4 -4
- package/dev-ui/components/ResponsiveScaleEditor.js +78 -64
- package/dev-ui/components/atoms/Button.js +1 -1
- package/dev-ui/components/atoms/Dropdown.d.ts +3 -3
- package/dev-ui/components/atoms/Dropdown.js +9 -8
- package/dev-ui/components/atoms/NumberField.d.ts +2 -2
- package/dev-ui/components/atoms/NumberField.js +42 -29
- package/dev-ui/components/atoms/Spacer.js +1 -1
- package/dev-ui/components/atoms/Text.js +1 -1
- package/dev-ui/components/atoms/ToggleButton.d.ts +2 -2
- package/dev-ui/components/atoms/ToggleButton.js +16 -5
- package/dev-ui/components/atoms/Tooltip.d.ts +2 -2
- package/dev-ui/components/atoms/Tooltip.js +20 -8
- package/dev-ui/components/panels/AppDataDebugger.d.ts +1 -1
- package/dev-ui/components/panels/AppDataDebugger.js +19 -8
- package/dev-ui/components/panels/ColorEditor.d.ts +1 -1
- package/dev-ui/components/panels/ColorEditor.js +42 -35
- package/dev-ui/components/panels/PageDataDebugger.d.ts +1 -1
- package/dev-ui/components/panels/PageDataDebugger.js +20 -8
- package/dev-ui/components/panels/QueryDebugger.d.ts +1 -1
- package/dev-ui/components/panels/QueryDebugger.js +24 -12
- package/dev-ui/components/panels/SpacingEditor.d.ts +1 -1
- package/dev-ui/components/panels/SpacingEditor.js +48 -34
- package/dev-ui/components/panels/TypographyEditor.d.ts +1 -1
- package/dev-ui/components/panels/TypographyEditor.js +46 -38
- package/dev-ui/hooks/useBreakpoint.d.ts +1 -1
- package/dev-ui/hooks/useBreakpoint.js +13 -13
- package/dev-ui/hooks/usePersistState.js +7 -6
- package/dev-ui/hooks/useStylesheet.js +6 -6
- package/dev-ui/icons.d.ts +15 -15
- package/dev-ui/icons.js +27 -16
- package/dev-ui/index.js +1 -5
- package/dev-ui/loader.d.ts +1 -1
- package/dev-ui/loader.js +9 -13
- package/dev-ui/panels.d.ts +2 -2
- package/dev-ui/panels.js +7 -7
- package/dev-ui/theme.js +3 -3
- package/dynamic/dynamic-component.js +1 -1
- package/dynamic/index.js +1 -5
- package/entry/Root.d.ts +2 -2
- package/entry/Root.js +26 -16
- package/entry/entry.admin.dev.js +4 -4
- package/entry/entry.admin.prod.js +4 -4
- package/entry/entry.monolith.dev.js +5 -5
- package/entry/entry.monolith.prod.js +5 -5
- package/gravityforms/gravity-forms.d.ts +2 -2
- package/gravityforms/index.js +1 -5
- package/gravityforms/useGravityForm.d.ts +2 -2
- package/gravityforms/useGravityForm.js +130 -126
- package/hooks/index.js +1 -5
- package/hooks/queryUtils.d.ts +14 -14
- package/hooks/queryUtils.js +192 -101
- package/hooks/useAppData.d.ts +2 -2
- package/hooks/useAppData.js +9 -9
- package/hooks/usePageLoad.js +4 -4
- package/hooks/useQueryDebug.d.ts +1 -1
- package/hooks/useQueryDebug.js +7 -7
- package/hooks/useRPC.d.ts +4 -4
- package/hooks/useRPC.js +3 -3
- package/package.json +11 -11
- package/routing/index.js +1 -5
- package/routing/remoteProps.d.ts +1 -1
- package/routing/remoteProps.js +72 -31
- package/routing/routing.d.ts +25 -15
- package/routing/routing.js +200 -112
- package/routing/updateEditLink.js +1 -1
- package/serverless/define-api.d.ts +1 -1
- package/serverless/define-rpc-router.js +4 -8
- package/serverless/index.js +2 -6
- package/style/createStitches.js +142 -164
- package/style/index.js +1 -5
- package/tsconfig.json +1 -1
- package/utils/Observable.d.ts +2 -2
- package/utils/Observable.js +15 -12
- package/utils/getRepoName.js +3 -3
- package/utils/promptIfRepoNameIncorrect.js +64 -18
- package/utils/refreshOverlayInterop.js +1 -1
- package/utils/reportErrorStack.d.ts +1 -1
- package/utils/reportErrorStack.js +1 -1
- package/utils/serverlessAppContext.js +1 -1
- package/utils/updateEnvFile.js +69 -19
- package/utils/useObservable.js +3 -3
- package/views/index.js +1 -5
package/config/get-config.js
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getEDConfigFile = exports.getEDConfigUnwrapped = exports.getEDConfig = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
function getEDConfig(dir
|
|
8
|
-
|
|
4
|
+
var fs_1 = require("fs");
|
|
5
|
+
var path_1 = require("path");
|
|
6
|
+
var parse_config_1 = require("./parse-config");
|
|
7
|
+
function getEDConfig(dir) {
|
|
8
|
+
if (dir === void 0) { dir = process.cwd(); }
|
|
9
|
+
var configFile = getEDConfigFile(dir);
|
|
9
10
|
if (!(0, fs_1.existsSync)(configFile)) {
|
|
10
|
-
throw new Error(
|
|
11
|
+
throw new Error("No config file found at ".concat(configFile));
|
|
11
12
|
}
|
|
12
|
-
|
|
13
|
+
var config = JSON.parse((0, fs_1.readFileSync)(configFile).toString());
|
|
13
14
|
return (0, parse_config_1.parseConfig)(config);
|
|
14
15
|
}
|
|
15
16
|
exports.getEDConfig = getEDConfig;
|
|
16
|
-
function getEDConfigUnwrapped(dir
|
|
17
|
-
|
|
17
|
+
function getEDConfigUnwrapped(dir) {
|
|
18
|
+
if (dir === void 0) { dir = process.cwd(); }
|
|
19
|
+
var result = getEDConfig(dir);
|
|
18
20
|
if (result.success) {
|
|
19
21
|
return result.data;
|
|
20
22
|
}
|
|
@@ -23,7 +25,8 @@ function getEDConfigUnwrapped(dir = process.cwd()) {
|
|
|
23
25
|
}
|
|
24
26
|
}
|
|
25
27
|
exports.getEDConfigUnwrapped = getEDConfigUnwrapped;
|
|
26
|
-
function getEDConfigFile(dir
|
|
28
|
+
function getEDConfigFile(dir) {
|
|
29
|
+
if (dir === void 0) { dir = process.cwd(); }
|
|
27
30
|
return (0, path_1.join)(dir, "ed.config.json");
|
|
28
31
|
}
|
|
29
32
|
exports.getEDConfigFile = getEDConfigFile;
|
package/config/index.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
9
5
|
}) : (function(o, m, k, k2) {
|
|
10
6
|
if (k2 === undefined) k2 = k;
|
|
11
7
|
o[k2] = m[k];
|
package/config/parse-config.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseConfig = void 0;
|
|
4
|
-
|
|
4
|
+
var config_schema_1 = require("./config-schema");
|
|
5
5
|
function parseConfig(config) {
|
|
6
6
|
return config_schema_1.EDConfigSchema.safeParse(config);
|
|
7
7
|
}
|
|
@@ -4,11 +4,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.printZodErrors = void 0;
|
|
7
|
-
|
|
7
|
+
var chalk_1 = __importDefault(require("chalk"));
|
|
8
8
|
function printZodErrors(err) {
|
|
9
9
|
console.log(chalk_1.default.red("Error parsing ed.config.json:"));
|
|
10
|
-
err.issues.forEach((issue)
|
|
11
|
-
console.log(
|
|
10
|
+
err.issues.forEach(function (issue) {
|
|
11
|
+
console.log("- ".concat(issue.path.join("."), ": ").concat(issue.message));
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
14
|
exports.printZodErrors = printZodErrors;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type Props = {
|
|
1
|
+
declare type Props = {
|
|
2
2
|
lerpStart?: boolean;
|
|
3
3
|
lerps?: boolean;
|
|
4
4
|
name: string;
|
|
@@ -6,5 +6,5 @@ type Props = {
|
|
|
6
6
|
onLerpChange?(lerpStart: boolean): void;
|
|
7
7
|
onDefinedChange?(defined: boolean): void;
|
|
8
8
|
};
|
|
9
|
-
export declare function BreakpointColumnHeader(props: Props):
|
|
9
|
+
export declare function BreakpointColumnHeader(props: Props): JSX.Element;
|
|
10
10
|
export {};
|
|
@@ -1,20 +1,31 @@
|
|
|
1
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
|
+
};
|
|
2
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
14
|
exports.BreakpointColumnHeader = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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");
|
|
8
19
|
function BreakpointColumnHeader(props) {
|
|
9
|
-
return ((0, jsx_runtime_1.jsxs)(Wrapper, { children: [(0, jsx_runtime_1.jsx)(Text_1.Text, { align: "center", variant: "monoBold", children: props.name }), (0, jsx_runtime_1.jsx)(ToggleButton, { onClick: ()
|
|
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));
|
|
10
21
|
}
|
|
11
22
|
exports.BreakpointColumnHeader = BreakpointColumnHeader;
|
|
12
|
-
|
|
23
|
+
var Wrapper = (0, theme_1.styled)("div", {
|
|
13
24
|
display: "flex",
|
|
14
25
|
width: "100%",
|
|
15
26
|
flexDirection: "column",
|
|
16
27
|
});
|
|
17
|
-
|
|
28
|
+
var ToggleButton = (0, theme_1.styled)("button", {
|
|
18
29
|
appearance: "none",
|
|
19
30
|
background: "transparent",
|
|
20
31
|
border: "0px",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function BreakpointIndicator():
|
|
1
|
+
export declare function BreakpointIndicator(): JSX.Element;
|
|
@@ -1,16 +1,27 @@
|
|
|
1
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
|
+
};
|
|
2
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
14
|
exports.BreakpointIndicator = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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");
|
|
10
21
|
// @ts-ignore
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
22
|
+
var _theme_1 = require("@theme");
|
|
23
|
+
var Tooltip_1 = require("./atoms/Tooltip");
|
|
24
|
+
var colors = [
|
|
14
25
|
{ $$bg: "#ff5555", $$fg: "#ffffff" },
|
|
15
26
|
{ $$bg: "#55ff55", $$fg: "#000000" },
|
|
16
27
|
{ $$bg: "#5555ff", $$fg: "#ffffff" },
|
|
@@ -19,22 +30,18 @@ const colors = [
|
|
|
19
30
|
{ $$bg: "#55ffff", $$fg: "#000000" },
|
|
20
31
|
];
|
|
21
32
|
function BreakpointIndicator() {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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];
|
|
25
36
|
if (!expanded) {
|
|
26
|
-
return ((0, jsx_runtime_1.jsx)(Simple, { onClick: ()
|
|
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));
|
|
27
38
|
}
|
|
28
|
-
return ((0, jsx_runtime_1.jsx)(Expanded, { onClick: ()
|
|
29
|
-
return ((0, jsx_runtime_1.jsx)(Item, { css: {
|
|
30
|
-
|
|
31
|
-
$$offset: parseFloat(bp.min) / maxSize,
|
|
32
|
-
$$size: bp.max ? (parseFloat(bp.max) - parseFloat(bp.min)) / maxSize : 0,
|
|
33
|
-
}, last: index === _theme_1.breakpoints.length - 1, active: bpState.name === bp.key, children: (0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { label: `${bp.min} - ${bp.max || "∞"}`, nowrap: true, offset: 3, children: (0, jsx_runtime_1.jsx)(Text_1.Text, { variant: "monoTiny", align: "left", children: bp.key }) }) }, index));
|
|
34
|
-
}), (0, jsx_runtime_1.jsx)(Indicator, { style: { "--eddev--position": Math.min(1, bpState.width / maxSize) }, flipped: bpState.width > maxSize * 0.9, children: (0, jsx_runtime_1.jsxs)(Text_1.Text, { variant: "monoTiny", children: [bpState.width, "px"] }) })] }) }));
|
|
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));
|
|
35
42
|
}
|
|
36
43
|
exports.BreakpointIndicator = BreakpointIndicator;
|
|
37
|
-
|
|
44
|
+
var Expanded = (0, theme_1.styled)(Launcher_1.MenuItem, {
|
|
38
45
|
position: "relative",
|
|
39
46
|
width: "400px",
|
|
40
47
|
// height: "100%",
|
|
@@ -42,16 +49,16 @@ const Expanded = (0, theme_1.styled)(Launcher_1.MenuItem, {
|
|
|
42
49
|
$$bg: "black !important",
|
|
43
50
|
$$bgHover: "black !important",
|
|
44
51
|
});
|
|
45
|
-
|
|
52
|
+
var Simple = (0, theme_1.styled)(Launcher_1.MenuItem, {
|
|
46
53
|
$$bgHover: "$$bg !important",
|
|
47
54
|
});
|
|
48
|
-
|
|
55
|
+
var Items = (0, theme_1.styled)("div", {
|
|
49
56
|
position: "absolute",
|
|
50
57
|
inset: "2px 8px",
|
|
51
58
|
paddingBottom: "10px",
|
|
52
59
|
borderRadius: "100px",
|
|
53
60
|
});
|
|
54
|
-
|
|
61
|
+
var Item = (0, theme_1.styled)("div", {
|
|
55
62
|
position: "absolute",
|
|
56
63
|
top: 0,
|
|
57
64
|
left: "calc($$offset * 100%)",
|
|
@@ -96,7 +103,7 @@ const Item = (0, theme_1.styled)("div", {
|
|
|
96
103
|
},
|
|
97
104
|
},
|
|
98
105
|
});
|
|
99
|
-
|
|
106
|
+
var Indicator = (0, theme_1.styled)("div", {
|
|
100
107
|
position: "absolute",
|
|
101
108
|
bottom: 0,
|
|
102
109
|
left: "calc($$position * 100%)",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function DevUI():
|
|
1
|
+
export default function DevUI(): JSX.Element;
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
10
|
function DevUI() {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Launcher_1.Launcher, { panel: panel, open: open, onChange: (open, panel)
|
|
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
15
|
setOpen(open);
|
|
16
16
|
setPanel(panel);
|
|
17
|
-
}, extras: (0, jsx_runtime_1.jsx)(BreakpointIndicator_1.BreakpointIndicator, {}) }), open && PanelComponent && ((0, jsx_runtime_1.jsx)(PanelPosition, { children: (0, jsx_runtime_1.jsx)(PanelComponent, {}) }))] }));
|
|
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
19
|
exports.default = DevUI;
|
|
20
|
-
|
|
20
|
+
var PanelPosition = (0, theme_1.styled)("div", {
|
|
21
21
|
position: "fixed",
|
|
22
22
|
left: "0px",
|
|
23
23
|
bottom: "calc($space$buttonHeight + 5px)",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import { PanelID } from "../panels";
|
|
3
|
-
type Props = {
|
|
3
|
+
declare type Props = {
|
|
4
4
|
open: boolean;
|
|
5
5
|
panel: PanelID | undefined;
|
|
6
6
|
extras?: ReactNode;
|
|
7
7
|
onChange: (open: boolean, panel: PanelID | undefined) => void;
|
|
8
8
|
};
|
|
9
|
-
export declare function Launcher(props: Props):
|
|
9
|
+
export declare function Launcher(props: Props): JSX.Element;
|
|
10
10
|
export declare const MenuItem: import("@stitches/react/types/styled-component").StyledComponent<import("@stitches/react/types/styled-component").StyledComponent<"button", {
|
|
11
11
|
state?: "active" | "inactive" | undefined;
|
|
12
12
|
color?: "default" | "black" | undefined;
|
|
@@ -1,21 +1,33 @@
|
|
|
1
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
|
+
};
|
|
2
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
14
|
exports.MenuItem = exports.Launcher = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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");
|
|
9
20
|
function Launcher(props) {
|
|
10
|
-
return ((0, jsx_runtime_1.jsxs)(LauncherWrapper, { children: [(0, jsx_runtime_1.jsx)(LauncherButton, { onClick: (e)
|
|
21
|
+
return ((0, jsx_runtime_1.jsxs)(LauncherWrapper, { children: [(0, jsx_runtime_1.jsx)(LauncherButton, __assign({ onClick: function (e) {
|
|
11
22
|
props.onChange(!props.open, props.panel);
|
|
12
|
-
}, children: props.open ? icons_1.close : icons_1.bolt }), (0, jsx_runtime_1.jsxs)(Menu, { children: [props.open &&
|
|
13
|
-
Object.entries(panels_1.DEV_UI_PANELS).map((
|
|
14
|
-
|
|
15
|
-
|
|
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));
|
|
16
28
|
}
|
|
17
29
|
exports.Launcher = Launcher;
|
|
18
|
-
|
|
30
|
+
var LauncherWrapper = (0, theme_1.styled)("div", {
|
|
19
31
|
position: "fixed",
|
|
20
32
|
bottom: "5px",
|
|
21
33
|
left: "5px",
|
|
@@ -26,7 +38,7 @@ const LauncherWrapper = (0, theme_1.styled)("div", {
|
|
|
26
38
|
$$height: "$space$buttonHeight",
|
|
27
39
|
userSelect: "none",
|
|
28
40
|
});
|
|
29
|
-
|
|
41
|
+
var LauncherButton = (0, theme_1.styled)("div", {
|
|
30
42
|
borderRadius: "100px",
|
|
31
43
|
width: "$$height",
|
|
32
44
|
height: "$$height",
|
|
@@ -48,7 +60,7 @@ const LauncherButton = (0, theme_1.styled)("div", {
|
|
|
48
60
|
},
|
|
49
61
|
cursor: "pointer",
|
|
50
62
|
});
|
|
51
|
-
|
|
63
|
+
var Menu = (0, theme_1.styled)("div", {
|
|
52
64
|
position: "absolute",
|
|
53
65
|
left: "calc($$height + 4px)",
|
|
54
66
|
bottom: 0,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { PropsWithChildren, ReactNode } from "react";
|
|
2
|
-
type Props = PropsWithChildren<{
|
|
2
|
+
declare type Props = PropsWithChildren<{
|
|
3
3
|
padded?: boolean;
|
|
4
4
|
title?: string;
|
|
5
5
|
buttons?: ReactNode;
|
|
6
6
|
}>;
|
|
7
|
-
export declare function PanelWrapper(props: Props):
|
|
7
|
+
export declare function PanelWrapper(props: Props): JSX.Element;
|
|
8
8
|
export {};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PanelWrapper = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
var theme_1 = require("../theme");
|
|
6
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 }), " ", (0, jsx_runtime_1.jsx)(Buttons, { children: props.buttons })] }), (0, jsx_runtime_1.jsx)(Contents, { children: props.children })] }));
|
|
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
8
|
}
|
|
9
9
|
exports.PanelWrapper = PanelWrapper;
|
|
10
|
-
|
|
10
|
+
var Wrapper = (0, theme_1.styled)("div", {
|
|
11
11
|
backgroundColor: "$bg",
|
|
12
12
|
color: "$fg",
|
|
13
13
|
borderRadius: "$md",
|
|
@@ -16,19 +16,19 @@ const Wrapper = (0, theme_1.styled)("div", {
|
|
|
16
16
|
fontSize: "$md",
|
|
17
17
|
margin: "5px",
|
|
18
18
|
});
|
|
19
|
-
|
|
19
|
+
var Header = (0, theme_1.styled)("div", {
|
|
20
20
|
borderBottom: "1px solid $colors$bgHover",
|
|
21
21
|
padding: "$2",
|
|
22
22
|
display: "flex",
|
|
23
23
|
});
|
|
24
|
-
|
|
24
|
+
var Title = (0, theme_1.styled)("div", {
|
|
25
25
|
fontSize: "$lg",
|
|
26
26
|
flex: "1 1 auto",
|
|
27
27
|
});
|
|
28
|
-
|
|
28
|
+
var Contents = (0, theme_1.styled)("div", {
|
|
29
29
|
padding: "$2",
|
|
30
30
|
});
|
|
31
|
-
|
|
31
|
+
var Buttons = (0, theme_1.styled)("div", {
|
|
32
32
|
display: "flex",
|
|
33
33
|
alignItems: "center",
|
|
34
34
|
"> *": {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ResponsiveAtomCalc } from "../../style";
|
|
2
|
-
type Props = {
|
|
2
|
+
declare type Props = {
|
|
3
3
|
data: ResponsiveAtomCalc[];
|
|
4
4
|
onToggleLerping?(breakpoint: string, enabled: boolean): void;
|
|
5
5
|
};
|
|
6
|
-
export declare function ResponsiveLerpControl(props: Props):
|
|
6
|
+
export declare function ResponsiveLerpControl(props: Props): JSX.Element;
|
|
7
7
|
export {};
|
|
@@ -1,19 +1,30 @@
|
|
|
1
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
|
+
};
|
|
2
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
14
|
exports.ResponsiveLerpControl = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
15
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
var react_1 = require("react");
|
|
17
|
+
var icons_1 = require("../icons");
|
|
18
|
+
var theme_1 = require("../theme");
|
|
19
|
+
var Tooltip_1 = require("./atoms/Tooltip");
|
|
9
20
|
function ResponsiveLerpControl(props) {
|
|
10
|
-
|
|
11
|
-
return props.data.map((item)
|
|
21
|
+
var breakpoints = (0, react_1.useMemo)(function () {
|
|
22
|
+
return props.data.map(function (item) { return item.breakpoint; });
|
|
12
23
|
}, [props.data]);
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
props.data.forEach((item, i)
|
|
24
|
+
var ranges = (0, react_1.useMemo)(function () {
|
|
25
|
+
var ranges = [];
|
|
26
|
+
var currentRange = undefined;
|
|
27
|
+
props.data.forEach(function (item, i) {
|
|
17
28
|
if (!currentRange) {
|
|
18
29
|
currentRange = {
|
|
19
30
|
fromBP: item.breakpoint,
|
|
@@ -44,10 +55,10 @@ function ResponsiveLerpControl(props) {
|
|
|
44
55
|
});
|
|
45
56
|
return ranges;
|
|
46
57
|
}, [props.data]);
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
ranges.forEach((range)
|
|
58
|
+
var lerpablePoints = (0, react_1.useMemo)(function () {
|
|
59
|
+
var points = [];
|
|
60
|
+
var length = 0;
|
|
61
|
+
ranges.forEach(function (range) {
|
|
51
62
|
if (!range.isEnd && !range.isStart) {
|
|
52
63
|
points.push({ index: length + range.length / 2, bp: range.fromBP, lerping: range.lerped });
|
|
53
64
|
}
|
|
@@ -56,19 +67,19 @@ function ResponsiveLerpControl(props) {
|
|
|
56
67
|
return points;
|
|
57
68
|
}, [props.data, ranges]);
|
|
58
69
|
console.log("Ranges", ranges, lerpablePoints);
|
|
59
|
-
return ((0, jsx_runtime_1.jsxs)(Outer, { children: [ranges.map((item, i)
|
|
60
|
-
return ((0, jsx_runtime_1.jsx)(RangeItem, { css: { $$length: item.length }, children: (0, jsx_runtime_1.jsx)(RangeLine, { lerping: item.lerped, hasStart: !item.isStart, hasEnd: !item.isEnd }) }, i));
|
|
70
|
+
return ((0, jsx_runtime_1.jsxs)(Outer, { children: [ranges.map(function (item, i) {
|
|
71
|
+
return ((0, jsx_runtime_1.jsx)(RangeItem, __assign({ css: { $$length: item.length } }, { children: (0, jsx_runtime_1.jsx)(RangeLine, { lerping: item.lerped, hasStart: !item.isStart, hasEnd: !item.isEnd }, void 0) }), i));
|
|
61
72
|
}), props.onToggleLerping &&
|
|
62
|
-
lerpablePoints.map((item, i)
|
|
63
|
-
return ((0, jsx_runtime_1.jsx)(LerpButton, { onClick: ()
|
|
73
|
+
lerpablePoints.map(function (item, i) {
|
|
74
|
+
return ((0, jsx_runtime_1.jsx)(LerpButton, __assign({ onClick: function () {
|
|
64
75
|
if (props.onToggleLerping) {
|
|
65
76
|
props.onToggleLerping(item.bp, !item.lerping);
|
|
66
77
|
}
|
|
67
|
-
}, lerping: item.lerping, css: { $$pos: item.index / breakpoints.length }, children: (0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { label: item.lerping ? "Disable Lerping" : "Enable Lerping", nowrap: true, offset: 10, children: (0, jsx_runtime_1.jsx)(LerpButtonInner, { children: item.lerping ? icons_1.close : icons_1.line }) }) }, i));
|
|
68
|
-
})] }));
|
|
78
|
+
}, lerping: item.lerping, css: { $$pos: item.index / breakpoints.length } }, { children: (0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, __assign({ label: item.lerping ? "Disable Lerping" : "Enable Lerping", nowrap: true, offset: 10 }, { children: (0, jsx_runtime_1.jsx)(LerpButtonInner, { children: item.lerping ? icons_1.close : icons_1.line }, void 0) }), void 0) }), i));
|
|
79
|
+
})] }, void 0));
|
|
69
80
|
}
|
|
70
81
|
exports.ResponsiveLerpControl = ResponsiveLerpControl;
|
|
71
|
-
|
|
82
|
+
var Outer = (0, theme_1.styled)("div", {
|
|
72
83
|
width: "100%",
|
|
73
84
|
$$height: "16px",
|
|
74
85
|
height: "$$height",
|
|
@@ -76,18 +87,18 @@ const Outer = (0, theme_1.styled)("div", {
|
|
|
76
87
|
alignItems: "stretch",
|
|
77
88
|
position: "relative",
|
|
78
89
|
});
|
|
79
|
-
|
|
90
|
+
var RangeItem = (0, theme_1.styled)("div", {
|
|
80
91
|
flexGrow: "$$length",
|
|
81
92
|
position: "relative",
|
|
82
93
|
});
|
|
83
|
-
|
|
94
|
+
var RangeLine = (0, theme_1.styled)("div", {
|
|
84
95
|
position: "absolute",
|
|
85
96
|
left: "5px",
|
|
86
97
|
right: "5px",
|
|
87
98
|
top: "50%",
|
|
88
99
|
height: "3px",
|
|
89
100
|
transform: "translateY(-50%)",
|
|
90
|
-
background:
|
|
101
|
+
background: "linear-gradient(to right, $$color1, $$color2)",
|
|
91
102
|
$$segHeight: "8px",
|
|
92
103
|
$$color1: "#888888",
|
|
93
104
|
$$color2: "#888888",
|
|
@@ -124,7 +135,7 @@ const RangeLine = (0, theme_1.styled)("div", {
|
|
|
124
135
|
},
|
|
125
136
|
},
|
|
126
137
|
});
|
|
127
|
-
|
|
138
|
+
var LerpButton = (0, theme_1.styled)("div", {
|
|
128
139
|
position: "absolute",
|
|
129
140
|
left: "calc(100% * $$pos)",
|
|
130
141
|
top: "50%",
|
|
@@ -153,7 +164,7 @@ const LerpButton = (0, theme_1.styled)("div", {
|
|
|
153
164
|
},
|
|
154
165
|
},
|
|
155
166
|
});
|
|
156
|
-
|
|
167
|
+
var LerpButtonInner = (0, theme_1.styled)("div", {
|
|
157
168
|
"&:before": {
|
|
158
169
|
content: " ",
|
|
159
170
|
display: "block",
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { BreakpointArray } from "../../style";
|
|
2
2
|
export declare const RESPONSIVE_COLUMN_WIDTH = "110px";
|
|
3
3
|
export declare const RESPONSIVE_ROW_HEIGHT = "20px";
|
|
4
|
-
type ModeType = "px" | "multiplier" | "%" | "number";
|
|
5
|
-
type TokenData = {
|
|
4
|
+
declare type ModeType = "px" | "multiplier" | "%" | "number";
|
|
5
|
+
declare type TokenData = {
|
|
6
6
|
[token: string]: {
|
|
7
7
|
[breakpoint: string]: string | [string];
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
|
-
type Props = {
|
|
10
|
+
declare type Props = {
|
|
11
11
|
editableRange?: boolean;
|
|
12
12
|
editableValues?: boolean;
|
|
13
13
|
showBreakpointName?: boolean;
|
|
@@ -21,5 +21,5 @@ type Props = {
|
|
|
21
21
|
modes: ModeType[];
|
|
22
22
|
onChange(data: TokenData): void;
|
|
23
23
|
};
|
|
24
|
-
export declare function ResponsiveScaleEditor(props: Props):
|
|
24
|
+
export declare function ResponsiveScaleEditor(props: Props): JSX.Element;
|
|
25
25
|
export {};
|