eddev 0.2.66 → 0.2.67-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 -3
- package/admin/components/ImageWell.js +39 -51
- package/admin/defineField.d.ts +2 -2
- package/admin/defineWidget.d.ts +1 -1
- package/admin/defineWidget.js +2 -2
- package/admin/index.js +5 -1
- package/admin/installFieldTypes.js +26 -26
- package/admin/runWidgets.js +17 -28
- package/admin/selectMedia.d.ts +2 -2
- package/admin/selectMedia.js +1 -1
- package/blocks/ContentBlocks.d.ts +6 -6
- package/blocks/ContentBlocks.js +58 -66
- package/blocks/ErrorBoundaryEditor.d.ts +1 -1
- package/blocks/ErrorBoundaryEditor.js +16 -45
- package/blocks/ErrorBoundaryFrontend.d.ts +1 -1
- package/blocks/ErrorBoundaryFrontend.js +16 -45
- package/blocks/InspectorControls.d.ts +1 -1
- package/blocks/InspectorControls.js +3 -3
- package/blocks/blockAttributes.d.ts +2 -2
- package/blocks/blockAttributes.js +24 -44
- package/blocks/index.js +5 -1
- package/blocks/inlineEditing.d.ts +7 -7
- package/blocks/inlineEditing.js +36 -55
- package/blocks/installGutenbergHooks.js +48 -68
- package/build/babel/plugin-name-defined-components.js +15 -16
- package/build/build-favicon.js +11 -62
- package/build/clean.js +5 -52
- package/build/create-codegen-worker.js +78 -33
- package/build/create-serverless-dev-worker.js +61 -39
- package/build/create-webpack-worker.js +65 -33
- package/build/file-tree.d.ts +2 -2
- package/build/file-tree.js +12 -12
- package/build/get-webpack-config.js +341 -395
- package/build/graphql-codegen/graphql-codegen-files.js +31 -25
- package/build/graphql-codegen/graphql-codegen-no-duplicates.js +4 -4
- package/build/graphql-codegen/graphql-codegen-queries.js +102 -99
- package/build/manifests/manifest-blocks.d.ts +1 -1
- package/build/manifests/manifest-blocks.js +37 -29
- package/build/manifests/manifest-fields.d.ts +1 -1
- package/build/manifests/manifest-fields.js +23 -21
- package/build/manifests/manifest-views.d.ts +1 -1
- package/build/manifests/manifest-views.js +32 -25
- package/build/manifests/manifest-widgets.d.ts +1 -1
- package/build/manifests/manifest-widgets.js +22 -20
- package/build/manifests/manifest.d.ts +2 -2
- package/build/manifests/manifest.js +30 -90
- package/build/reporter.d.ts +1 -1
- package/build/reporter.js +29 -32
- package/build/serverless/create-next-app.d.ts +1 -1
- package/build/serverless/create-next-app.js +245 -467
- 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 +392 -507
- package/build/workers/serverless-worker-dev-script.js +4 -4
- package/build/workers/webpack-worker-script.js +89 -150
- package/cli/build.dev.d.ts +1 -1
- package/cli/build.dev.js +79 -126
- package/cli/build.prod.d.ts +1 -1
- package/cli/build.prod.js +42 -98
- package/cli/cli.js +16 -55
- package/cli/display/components/BundleDisplay.d.ts +1 -2
- package/cli/display/components/BundleDisplay.js +13 -24
- package/cli/display/components/CodegenDisplay.d.ts +1 -2
- package/cli/display/components/CodegenDisplay.js +14 -25
- package/cli/display/components/DevCLIDisplay.d.ts +2 -3
- package/cli/display/components/DevCLIDisplay.js +14 -25
- package/cli/display/components/Fullscreen.js +9 -20
- package/cli/display/components/ServerlessDisplay.d.ts +2 -3
- package/cli/display/components/ServerlessDisplay.js +15 -26
- package/cli/display/components/StatusIcon.d.ts +2 -3
- package/cli/display/components/StatusIcon.js +3 -3
- package/cli/preinstall.js +4 -5
- package/cli/setup.js +25 -73
- package/components/AdminBar.d.ts +1 -2
- package/components/AdminBar.js +37 -3
- package/components/BrowserRouter.d.ts +2 -2
- package/components/BrowserRouter.js +41 -54
- package/components/InlinePage.d.ts +2 -2
- package/components/InlinePage.js +17 -29
- package/components/NextRouter.d.ts +2 -2
- package/components/NextRouter.js +20 -29
- package/components/index.js +5 -1
- 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 +10 -13
- package/config/index.js +5 -1
- package/config/parse-config.js +1 -1
- package/config/print-zod-errors.js +3 -3
- package/dev-ui/components/BreakpointColumnHeader.d.ts +2 -3
- package/dev-ui/components/BreakpointColumnHeader.js +7 -18
- package/dev-ui/components/BreakpointIndicator.d.ts +1 -2
- package/dev-ui/components/BreakpointIndicator.js +25 -32
- package/dev-ui/components/DevUI.d.ts +1 -2
- package/dev-ui/components/DevUI.js +13 -13
- package/dev-ui/components/Launcher.d.ts +2 -2
- package/dev-ui/components/Launcher.js +13 -25
- 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 -3
- package/dev-ui/components/ResponsiveLerpControl.js +27 -38
- package/dev-ui/components/ResponsiveScaleEditor.d.ts +4 -5
- package/dev-ui/components/ResponsiveScaleEditor.js +64 -78
- 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 +8 -9
- package/dev-ui/components/atoms/NumberField.d.ts +2 -3
- package/dev-ui/components/atoms/NumberField.js +29 -42
- 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 +5 -16
- package/dev-ui/components/atoms/Tooltip.d.ts +2 -2
- package/dev-ui/components/atoms/Tooltip.js +8 -20
- package/dev-ui/components/panels/AppDataDebugger.d.ts +1 -2
- package/dev-ui/components/panels/AppDataDebugger.js +8 -19
- package/dev-ui/components/panels/ColorEditor.d.ts +1 -2
- package/dev-ui/components/panels/ColorEditor.js +35 -42
- package/dev-ui/components/panels/PageDataDebugger.d.ts +1 -2
- package/dev-ui/components/panels/PageDataDebugger.js +8 -20
- package/dev-ui/components/panels/QueryDebugger.d.ts +1 -2
- package/dev-ui/components/panels/QueryDebugger.js +12 -24
- package/dev-ui/components/panels/SpacingEditor.d.ts +1 -2
- package/dev-ui/components/panels/SpacingEditor.js +34 -48
- package/dev-ui/components/panels/TypographyEditor.d.ts +1 -2
- package/dev-ui/components/panels/TypographyEditor.js +38 -46
- package/dev-ui/hooks/useBreakpoint.d.ts +1 -1
- package/dev-ui/hooks/useBreakpoint.js +13 -13
- package/dev-ui/hooks/usePersistState.js +6 -7
- package/dev-ui/hooks/useStylesheet.js +6 -6
- package/dev-ui/icons.d.ts +15 -16
- package/dev-ui/icons.js +16 -27
- package/dev-ui/index.js +5 -1
- package/dev-ui/loader.d.ts +1 -2
- package/dev-ui/loader.js +13 -9
- package/dev-ui/panels.d.ts +2 -2
- package/dev-ui/panels.js +7 -7
- package/dev-ui/theme.d.ts +96 -70
- package/dev-ui/theme.js +3 -3
- package/dynamic/dynamic-component.d.ts +1 -10
- package/dynamic/dynamic-component.js +1 -1
- package/dynamic/index.js +5 -1
- package/entry/Root.d.ts +2 -3
- package/entry/Root.js +16 -26
- 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 +5 -1
- package/gravityforms/useGravityForm.d.ts +2 -2
- package/gravityforms/useGravityForm.js +126 -130
- package/hooks/index.js +5 -1
- package/hooks/queryUtils.d.ts +14 -14
- package/hooks/queryUtils.js +101 -192
- 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 +7 -7
- package/routing/index.js +5 -1
- package/routing/remoteProps.d.ts +1 -1
- package/routing/remoteProps.js +31 -72
- package/routing/routing.d.ts +15 -15
- package/routing/routing.js +108 -170
- package/routing/updateEditLink.js +1 -1
- package/serverless/define-api.d.ts +1 -1
- package/serverless/define-rpc-router.js +8 -4
- package/serverless/index.js +6 -2
- package/style/createStitches.d.ts +375 -783
- package/style/createStitches.js +164 -142
- package/style/index.js +5 -1
- package/tsconfig.json +1 -1
- package/utils/Observable.d.ts +2 -2
- package/utils/Observable.js +12 -15
- package/utils/getRepoName.js +3 -3
- package/utils/promptIfRepoNameIncorrect.js +18 -64
- 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 +19 -69
- package/utils/useObservable.js +3 -3
- package/views/index.js +5 -1
package/components/NextRouter.js
CHANGED
|
@@ -1,45 +1,36 @@
|
|
|
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
|
-
};
|
|
13
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
3
|
exports.NextRouter = void 0;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
function NextRouter(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
router_1.Router.events.on("
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const routing_1 = require("../routing");
|
|
6
|
+
const router_1 = require("next/router");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const hooks_1 = require("../hooks");
|
|
9
|
+
function NextRouter({ children, path, data }) {
|
|
10
|
+
const nextRoute = (0, router_1.useRouter)();
|
|
11
|
+
const setIsLoading = (0, hooks_1.usePageLoad)((s) => s.setIsLoading);
|
|
12
|
+
const route = {
|
|
13
|
+
...nextRoute,
|
|
14
|
+
pathname: nextRoute.asPath,
|
|
15
|
+
};
|
|
16
|
+
(0, react_1.useEffect)(() => {
|
|
17
|
+
router_1.Router.events.on("routeChangeStart", () => setIsLoading(true));
|
|
18
|
+
router_1.Router.events.on("routeChangeComplete", () => setIsLoading(false));
|
|
19
|
+
router_1.Router.events.on("routeChangeError", () => setIsLoading(false));
|
|
29
20
|
}, []);
|
|
30
|
-
return ((0, jsx_runtime_1.jsx)(routing_1.RouterRoot,
|
|
21
|
+
return ((0, jsx_runtime_1.jsx)(routing_1.RouterRoot, { url: nextRoute.asPath, data: data, onNavigateRequest: (url) => {
|
|
31
22
|
route.push(url);
|
|
32
23
|
// setPendingUrl({ popped: false, url })
|
|
33
|
-
}, onPreload:
|
|
24
|
+
}, onPreload: (url) => {
|
|
34
25
|
// if (isSameOrigin(url)) {
|
|
35
26
|
// fetchProps(url)
|
|
36
27
|
// }
|
|
37
|
-
}, onNavigated:
|
|
28
|
+
}, onNavigated: () => {
|
|
38
29
|
// if (pending && typeof pending.scrollPosition === "number") {
|
|
39
30
|
// setScrollPosition({ value: pending.scrollPosition })
|
|
40
31
|
// } else {
|
|
41
32
|
// setScrollPosition({ value: 0 })
|
|
42
33
|
// }
|
|
43
|
-
}
|
|
34
|
+
}, children: children }));
|
|
44
35
|
}
|
|
45
36
|
exports.NextRouter = NextRouter;
|
package/components/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
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
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/config/config-schema.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EDConfigSchema = void 0;
|
|
4
|
-
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
5
|
exports.EDConfigSchema = zod_1.z.object({
|
|
6
6
|
$schema: zod_1.z.string().optional(),
|
|
7
7
|
tracking: zod_1.z
|
|
@@ -4,14 +4,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.createConfigSchemaFile = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
const fs_1 = require("fs");
|
|
8
|
+
const zod_to_json_schema_1 = __importDefault(require("zod-to-json-schema"));
|
|
9
|
+
const config_schema_1 = require("./config-schema");
|
|
10
10
|
function createConfigSchemaFile(location) {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
const schema = (0, zod_to_json_schema_1.default)(config_schema_1.EDConfigSchema);
|
|
12
|
+
const content = JSON.stringify(schema, null, 2);
|
|
13
13
|
if ((0, fs_1.existsSync)(location)) {
|
|
14
|
-
|
|
14
|
+
const existingContent = (0, fs_1.readFileSync)(location).toString();
|
|
15
15
|
if (existingContent === content)
|
|
16
16
|
return;
|
|
17
17
|
}
|
package/config/get-config.js
CHANGED
|
@@ -1,22 +1,20 @@
|
|
|
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
|
-
|
|
9
|
-
var configFile = getEDConfigFile(dir);
|
|
4
|
+
const fs_1 = require("fs");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
const parse_config_1 = require("./parse-config");
|
|
7
|
+
function getEDConfig(dir = process.cwd()) {
|
|
8
|
+
const configFile = getEDConfigFile(dir);
|
|
10
9
|
if (!(0, fs_1.existsSync)(configFile)) {
|
|
11
|
-
throw new Error(
|
|
10
|
+
throw new Error(`No config file found at ${configFile}`);
|
|
12
11
|
}
|
|
13
|
-
|
|
12
|
+
const config = JSON.parse((0, fs_1.readFileSync)(configFile).toString());
|
|
14
13
|
return (0, parse_config_1.parseConfig)(config);
|
|
15
14
|
}
|
|
16
15
|
exports.getEDConfig = getEDConfig;
|
|
17
|
-
function getEDConfigUnwrapped(dir) {
|
|
18
|
-
|
|
19
|
-
var result = getEDConfig(dir);
|
|
16
|
+
function getEDConfigUnwrapped(dir = process.cwd()) {
|
|
17
|
+
const result = getEDConfig(dir);
|
|
20
18
|
if (result.success) {
|
|
21
19
|
return result.data;
|
|
22
20
|
}
|
|
@@ -25,8 +23,7 @@ function getEDConfigUnwrapped(dir) {
|
|
|
25
23
|
}
|
|
26
24
|
}
|
|
27
25
|
exports.getEDConfigUnwrapped = getEDConfigUnwrapped;
|
|
28
|
-
function getEDConfigFile(dir) {
|
|
29
|
-
if (dir === void 0) { dir = process.cwd(); }
|
|
26
|
+
function getEDConfigFile(dir = process.cwd()) {
|
|
30
27
|
return (0, path_1.join)(dir, "ed.config.json");
|
|
31
28
|
}
|
|
32
29
|
exports.getEDConfigFile = getEDConfigFile;
|
package/config/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
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
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
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
|
+
const 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
|
+
const 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(
|
|
11
|
-
console.log(
|
|
10
|
+
err.issues.forEach((issue) => {
|
|
11
|
+
console.log(`- ${issue.path.join(".")}: ${issue.message}`);
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
14
|
exports.printZodErrors = printZodErrors;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
declare type Props = {
|
|
1
|
+
type Props = {
|
|
3
2
|
lerpStart?: boolean;
|
|
4
3
|
lerps?: boolean;
|
|
5
4
|
name: string;
|
|
@@ -7,5 +6,5 @@ declare type Props = {
|
|
|
7
6
|
onLerpChange?(lerpStart: boolean): void;
|
|
8
7
|
onDefinedChange?(defined: boolean): void;
|
|
9
8
|
};
|
|
10
|
-
export declare function BreakpointColumnHeader(props: Props): JSX.Element;
|
|
9
|
+
export declare function BreakpointColumnHeader(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
11
10
|
export {};
|
|
@@ -1,31 +1,20 @@
|
|
|
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
|
-
};
|
|
13
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
3
|
exports.BreakpointColumnHeader = void 0;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const icons_1 = require("../icons");
|
|
6
|
+
const theme_1 = require("../theme");
|
|
7
|
+
const Text_1 = require("./atoms/Text");
|
|
19
8
|
function BreakpointColumnHeader(props) {
|
|
20
|
-
return ((0, jsx_runtime_1.jsxs)(Wrapper, { children: [(0, jsx_runtime_1.jsx)(Text_1.Text,
|
|
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: () => props.onDefinedChange?.(!props.defined), children: props.defined ? icons_1.checkFilled : icons_1.checkEmpty })] }));
|
|
21
10
|
}
|
|
22
11
|
exports.BreakpointColumnHeader = BreakpointColumnHeader;
|
|
23
|
-
|
|
12
|
+
const Wrapper = (0, theme_1.styled)("div", {
|
|
24
13
|
display: "flex",
|
|
25
14
|
width: "100%",
|
|
26
15
|
flexDirection: "column",
|
|
27
16
|
});
|
|
28
|
-
|
|
17
|
+
const ToggleButton = (0, theme_1.styled)("button", {
|
|
29
18
|
appearance: "none",
|
|
30
19
|
background: "transparent",
|
|
31
20
|
border: "0px",
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function BreakpointIndicator(): JSX.Element;
|
|
1
|
+
export declare function BreakpointIndicator(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,27 +1,16 @@
|
|
|
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
|
-
};
|
|
13
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
3
|
exports.BreakpointIndicator = void 0;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const useBreakpoint_1 = require("../hooks/useBreakpoint");
|
|
6
|
+
const usePersistState_1 = require("../hooks/usePersistState");
|
|
7
|
+
const theme_1 = require("../theme");
|
|
8
|
+
const Launcher_1 = require("./Launcher");
|
|
9
|
+
const Text_1 = require("./atoms/Text");
|
|
21
10
|
// @ts-ignore
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
11
|
+
const _theme_1 = require("@theme");
|
|
12
|
+
const Tooltip_1 = require("./atoms/Tooltip");
|
|
13
|
+
const colors = [
|
|
25
14
|
{ $$bg: "#ff5555", $$fg: "#ffffff" },
|
|
26
15
|
{ $$bg: "#55ff55", $$fg: "#000000" },
|
|
27
16
|
{ $$bg: "#5555ff", $$fg: "#ffffff" },
|
|
@@ -30,18 +19,22 @@ var colors = [
|
|
|
30
19
|
{ $$bg: "#55ffff", $$fg: "#000000" },
|
|
31
20
|
];
|
|
32
21
|
function BreakpointIndicator() {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
22
|
+
const bpState = (0, useBreakpoint_1.useBreakpoint)();
|
|
23
|
+
const maxSize = parseFloat(_theme_1.breakpoints[_theme_1.breakpoints.length - 1].min);
|
|
24
|
+
const [expanded, setExpanded] = (0, usePersistState_1.usePersistState)("breakpoint_indicator", false);
|
|
36
25
|
if (!expanded) {
|
|
37
|
-
return ((0, jsx_runtime_1.jsx)(Simple,
|
|
26
|
+
return ((0, jsx_runtime_1.jsx)(Simple, { onClick: () => setExpanded(true), css: colors[bpState.index % colors.length], children: (0, jsx_runtime_1.jsx)(Text_1.Text, { variant: "monoBold", children: bpState.name }) }));
|
|
38
27
|
}
|
|
39
|
-
return ((0, jsx_runtime_1.jsx)(Expanded,
|
|
40
|
-
return ((0, jsx_runtime_1.jsx)(Item,
|
|
41
|
-
|
|
28
|
+
return ((0, jsx_runtime_1.jsx)(Expanded, { onClick: () => setExpanded(false), children: (0, jsx_runtime_1.jsxs)(Items, { children: [_theme_1.breakpoints.map((bp, index) => {
|
|
29
|
+
return ((0, jsx_runtime_1.jsx)(Item, { css: {
|
|
30
|
+
...colors[index % colors.length],
|
|
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"] }) })] }) }));
|
|
42
35
|
}
|
|
43
36
|
exports.BreakpointIndicator = BreakpointIndicator;
|
|
44
|
-
|
|
37
|
+
const Expanded = (0, theme_1.styled)(Launcher_1.MenuItem, {
|
|
45
38
|
position: "relative",
|
|
46
39
|
width: "400px",
|
|
47
40
|
// height: "100%",
|
|
@@ -49,16 +42,16 @@ var Expanded = (0, theme_1.styled)(Launcher_1.MenuItem, {
|
|
|
49
42
|
$$bg: "black !important",
|
|
50
43
|
$$bgHover: "black !important",
|
|
51
44
|
});
|
|
52
|
-
|
|
45
|
+
const Simple = (0, theme_1.styled)(Launcher_1.MenuItem, {
|
|
53
46
|
$$bgHover: "$$bg !important",
|
|
54
47
|
});
|
|
55
|
-
|
|
48
|
+
const Items = (0, theme_1.styled)("div", {
|
|
56
49
|
position: "absolute",
|
|
57
50
|
inset: "2px 8px",
|
|
58
51
|
paddingBottom: "10px",
|
|
59
52
|
borderRadius: "100px",
|
|
60
53
|
});
|
|
61
|
-
|
|
54
|
+
const Item = (0, theme_1.styled)("div", {
|
|
62
55
|
position: "absolute",
|
|
63
56
|
top: 0,
|
|
64
57
|
left: "calc($$offset * 100%)",
|
|
@@ -103,7 +96,7 @@ var Item = (0, theme_1.styled)("div", {
|
|
|
103
96
|
},
|
|
104
97
|
},
|
|
105
98
|
});
|
|
106
|
-
|
|
99
|
+
const Indicator = (0, theme_1.styled)("div", {
|
|
107
100
|
position: "absolute",
|
|
108
101
|
bottom: 0,
|
|
109
102
|
left: "calc($$position * 100%)",
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export default function DevUI(): JSX.Element;
|
|
1
|
+
export default function DevUI(): import("react/jsx-runtime").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
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const usePersistState_1 = require("../hooks/usePersistState");
|
|
6
|
+
const panels_1 = require("../panels");
|
|
7
|
+
const theme_1 = require("../theme");
|
|
8
|
+
const BreakpointIndicator_1 = require("./BreakpointIndicator");
|
|
9
|
+
const 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:
|
|
11
|
+
const [open, setOpen] = (0, usePersistState_1.usePersistState)("launcher-is-open", false);
|
|
12
|
+
const [panel, setPanel] = (0, usePersistState_1.usePersistState)("panel", undefined);
|
|
13
|
+
const 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: (open, panel) => {
|
|
15
15
|
setOpen(open);
|
|
16
16
|
setPanel(panel);
|
|
17
|
-
}, extras: (0, jsx_runtime_1.jsx)(BreakpointIndicator_1.BreakpointIndicator, {}
|
|
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, {}) }))] }));
|
|
18
18
|
}
|
|
19
19
|
exports.default = DevUI;
|
|
20
|
-
|
|
20
|
+
const 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
|
-
|
|
3
|
+
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): JSX.Element;
|
|
9
|
+
export declare function Launcher(props: Props): import("react/jsx-runtime").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,33 +1,21 @@
|
|
|
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
|
-
};
|
|
13
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
3
|
exports.MenuItem = exports.Launcher = void 0;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const icons_1 = require("../icons");
|
|
6
|
+
const panels_1 = require("../panels");
|
|
7
|
+
const theme_1 = require("../theme");
|
|
8
|
+
const Button_1 = require("./atoms/Button");
|
|
20
9
|
function Launcher(props) {
|
|
21
|
-
return ((0, jsx_runtime_1.jsxs)(LauncherWrapper, { children: [(0, jsx_runtime_1.jsx)(LauncherButton,
|
|
10
|
+
return ((0, jsx_runtime_1.jsxs)(LauncherWrapper, { children: [(0, jsx_runtime_1.jsx)(LauncherButton, { onClick: (e) => {
|
|
22
11
|
props.onChange(!props.open, props.panel);
|
|
23
|
-
}
|
|
24
|
-
Object.entries(panels_1.DEV_UI_PANELS).map(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}), props.extras] }, void 0)] }, void 0));
|
|
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(([key, panel]) => {
|
|
14
|
+
return ((0, jsx_runtime_1.jsxs)(exports.MenuItem, { state: key === props.panel ? "active" : props.panel ? "inactive" : undefined, onClick: () => props.onChange(true, props.panel === key ? undefined : key), children: [panel.icon, panel.label] }, key));
|
|
15
|
+
}), props.extras] })] }));
|
|
28
16
|
}
|
|
29
17
|
exports.Launcher = Launcher;
|
|
30
|
-
|
|
18
|
+
const LauncherWrapper = (0, theme_1.styled)("div", {
|
|
31
19
|
position: "fixed",
|
|
32
20
|
bottom: "5px",
|
|
33
21
|
left: "5px",
|
|
@@ -38,7 +26,7 @@ var LauncherWrapper = (0, theme_1.styled)("div", {
|
|
|
38
26
|
$$height: "$space$buttonHeight",
|
|
39
27
|
userSelect: "none",
|
|
40
28
|
});
|
|
41
|
-
|
|
29
|
+
const LauncherButton = (0, theme_1.styled)("div", {
|
|
42
30
|
borderRadius: "100px",
|
|
43
31
|
width: "$$height",
|
|
44
32
|
height: "$$height",
|
|
@@ -60,7 +48,7 @@ var LauncherButton = (0, theme_1.styled)("div", {
|
|
|
60
48
|
},
|
|
61
49
|
cursor: "pointer",
|
|
62
50
|
});
|
|
63
|
-
|
|
51
|
+
const Menu = (0, theme_1.styled)("div", {
|
|
64
52
|
position: "absolute",
|
|
65
53
|
left: "calc($$height + 4px)",
|
|
66
54
|
bottom: 0,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { PropsWithChildren, ReactNode } from "react";
|
|
2
|
-
|
|
2
|
+
type Props = PropsWithChildren<{
|
|
3
3
|
padded?: boolean;
|
|
4
4
|
title?: string;
|
|
5
5
|
buttons?: ReactNode;
|
|
6
6
|
}>;
|
|
7
|
-
export declare function PanelWrapper(props: Props): JSX.Element;
|
|
7
|
+
export declare function PanelWrapper(props: Props): import("react/jsx-runtime").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
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const 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 }
|
|
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 })] }));
|
|
8
8
|
}
|
|
9
9
|
exports.PanelWrapper = PanelWrapper;
|
|
10
|
-
|
|
10
|
+
const Wrapper = (0, theme_1.styled)("div", {
|
|
11
11
|
backgroundColor: "$bg",
|
|
12
12
|
color: "$fg",
|
|
13
13
|
borderRadius: "$md",
|
|
@@ -16,19 +16,19 @@ var Wrapper = (0, theme_1.styled)("div", {
|
|
|
16
16
|
fontSize: "$md",
|
|
17
17
|
margin: "5px",
|
|
18
18
|
});
|
|
19
|
-
|
|
19
|
+
const 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
|
+
const Title = (0, theme_1.styled)("div", {
|
|
25
25
|
fontSize: "$lg",
|
|
26
26
|
flex: "1 1 auto",
|
|
27
27
|
});
|
|
28
|
-
|
|
28
|
+
const Contents = (0, theme_1.styled)("div", {
|
|
29
29
|
padding: "$2",
|
|
30
30
|
});
|
|
31
|
-
|
|
31
|
+
const Buttons = (0, theme_1.styled)("div", {
|
|
32
32
|
display: "flex",
|
|
33
33
|
alignItems: "center",
|
|
34
34
|
"> *": {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { ResponsiveAtomCalc } from "../../style";
|
|
3
|
-
|
|
2
|
+
type Props = {
|
|
4
3
|
data: ResponsiveAtomCalc[];
|
|
5
4
|
onToggleLerping?(breakpoint: string, enabled: boolean): void;
|
|
6
5
|
};
|
|
7
|
-
export declare function ResponsiveLerpControl(props: Props): JSX.Element;
|
|
6
|
+
export declare function ResponsiveLerpControl(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
8
7
|
export {};
|