eddev 0.2.0-beta.12 → 0.2.0-beta.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/get-webpack-config.js +1 -0
- package/build/serverless/create-next-app.js +60 -56
- package/cli/cli.js +4 -4
- package/components/PageHead.d.ts +1 -0
- package/components/PageHead.js +2 -0
- package/components/PageMeta.d.ts +1 -0
- package/components/PageMeta.js +2 -0
- package/components/PageMeta.monolith.d.ts +1 -0
- package/components/PageMeta.monolith.js +2 -0
- package/components/ServerlessPageMeta.d.ts +1 -0
- package/components/ServerlessPageMeta.js +2 -0
- package/config/config-schema.d.ts +5 -0
- package/config/config-schema.js +1 -0
- package/config/get-config.d.ts +3 -0
- package/config/parse-config.d.ts +2 -0
- package/dev-ui/components/{BreakpointItemHeader.d.ts → BreakpointColumnHeader.d.ts} +0 -0
- package/dev-ui/components/{BreakpointItemHeader.js → BreakpointColumnHeader.js} +3 -6
- package/dev-ui/components/BreakpointIndicator.d.ts +2 -0
- package/dev-ui/components/BreakpointIndicator.js +138 -0
- package/dev-ui/components/DevUI.d.ts +1 -1
- package/dev-ui/components/DevUI.js +13 -4
- package/dev-ui/components/Launcher.d.ts +90 -1
- package/dev-ui/components/Launcher.js +12 -36
- package/dev-ui/components/PanelWrapper.d.ts +6 -2
- package/dev-ui/components/PanelWrapper.js +22 -6
- package/dev-ui/components/ResponsiveLerpControl.d.ts +8 -0
- package/dev-ui/components/ResponsiveLerpControl.js +177 -0
- package/dev-ui/components/ResponsiveScaleEditor.d.ts +26 -0
- package/dev-ui/components/ResponsiveScaleEditor.js +233 -0
- package/dev-ui/components/atoms/Button.d.ts +47 -0
- package/dev-ui/components/atoms/Button.js +67 -0
- package/dev-ui/components/atoms/Dropdown.d.ts +13 -0
- package/dev-ui/components/atoms/Dropdown.js +50 -0
- package/dev-ui/components/atoms/NumberField.d.ts +12 -0
- package/dev-ui/components/atoms/NumberField.js +111 -0
- package/dev-ui/components/atoms/Spacer.d.ts +42 -0
- package/dev-ui/components/atoms/Spacer.js +8 -0
- package/dev-ui/components/{Text.d.ts → atoms/Text.d.ts} +7 -1
- package/dev-ui/components/atoms/Text.js +39 -0
- package/dev-ui/components/atoms/ToggleButton.d.ts +8 -0
- package/dev-ui/components/atoms/ToggleButton.js +41 -0
- package/dev-ui/components/atoms/Tooltip.d.ts +9 -0
- package/dev-ui/components/atoms/Tooltip.js +66 -0
- package/dev-ui/components/panels/PageDataDebugger.d.ts +2 -0
- package/dev-ui/components/panels/PageDataDebugger.js +30 -0
- package/dev-ui/components/panels/SpacingEditor.js +65 -33
- package/dev-ui/components/panels/TypographyEditor.d.ts +2 -0
- package/dev-ui/components/panels/TypographyEditor.js +88 -0
- package/dev-ui/hooks/useBreakpoint.d.ts +11 -0
- package/dev-ui/hooks/useBreakpoint.js +59 -0
- package/dev-ui/hooks/usePersistState.js +9 -1
- package/dev-ui/hooks/useStylesheet.d.ts +4 -0
- package/dev-ui/hooks/useStylesheet.js +31 -0
- package/dev-ui/icons.d.ts +4 -0
- package/dev-ui/icons.js +5 -1
- package/dev-ui/index.d.ts +1 -1
- package/dev-ui/index.js +11 -3
- package/dev-ui/loader.d.ts +2 -0
- package/dev-ui/loader.js +42 -0
- package/dev-ui/panels.js +9 -7
- package/dev-ui/theme.d.ts +16 -0
- package/dev-ui/theme.js +7 -2
- package/dynamic/dynamic-component.d.ts +1 -0
- package/entry/Root.js +2 -2
- package/package.json +12 -1
- package/serverless/create-rpc-client.d.ts +6 -17
- package/serverless-template/_utils/PageMeta.tsx +44 -0
- package/serverless-template/_utils/fetch-wordpress-props.ts +10 -3
- package/serverless-template/_utils/fetch-wp.ts +16 -0
- package/serverless-template/global.d.ts +1 -0
- package/serverless-template/next.config.js +2 -0
- package/serverless-template/pages/_app.tsx +7 -0
- package/style/createStitches.d.ts +14 -5
- package/style/createStitches.js +15 -51
- package/utils/updateEnvFile.d.ts +1 -0
- package/utils/updateEnvFile.js +76 -0
- package/build/workers/serverless-worker-script.d.ts +0 -0
- package/build/workers/serverless-worker-script.js +0 -1
- package/dev-ui/components/BreakpointList.d.ts +0 -6
- package/dev-ui/components/BreakpointList.js +0 -38
- package/dev-ui/components/Pill.d.ts +0 -0
- package/dev-ui/components/Pill.js +0 -1
- package/dev-ui/components/SpacingEditor.d.ts +0 -2
- package/dev-ui/components/SpacingEditor.js +0 -10
- package/dev-ui/components/Text.js +0 -13
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Agent } from "https"
|
|
2
|
+
|
|
3
|
+
// Used to allow self-signed certificates
|
|
4
|
+
const agent = new Agent({
|
|
5
|
+
rejectUnauthorized: false,
|
|
6
|
+
})
|
|
7
|
+
|
|
8
|
+
export const fetchWP: typeof fetch = async (url, opts) => {
|
|
9
|
+
// TODO — basic auth via env variable
|
|
10
|
+
// https://stackoverflow.com/questions/43842793/basic-authentication-with-fetch
|
|
11
|
+
return fetch(url, {
|
|
12
|
+
...opts,
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
agent: url.includes("https") ? agent : undefined,
|
|
15
|
+
})
|
|
16
|
+
}
|
|
@@ -55,6 +55,8 @@ module.exports = (() => {
|
|
|
55
55
|
|
|
56
56
|
define.definitions["process.env.themePath"] = JSON.stringify(themePath)
|
|
57
57
|
define.definitions["process.themePath"] = JSON.stringify(themePath)
|
|
58
|
+
define.definitions["process.devUI"] = settings.devUI === "enabled"
|
|
59
|
+
define.definitions["process.serverlessEndpoint"] = JSON.stringify("/")
|
|
58
60
|
// config.plugins.push(
|
|
59
61
|
// new DefinePlugin({
|
|
60
62
|
// "process.serverless": "true",
|
|
@@ -5,6 +5,8 @@ import { NextRouter } from "eddev/components/NextRouter"
|
|
|
5
5
|
import { ServerlessAppDataProvider } from "eddev/utils/serverlessAppContext"
|
|
6
6
|
import { useMemo } from "react"
|
|
7
7
|
import { useRouter } from "next/router"
|
|
8
|
+
import { DevUILoader } from "eddev/dev-ui/loader"
|
|
9
|
+
import { PageMeta } from "../_utils/PageMeta"
|
|
8
10
|
|
|
9
11
|
function MyApp({ Component, pageProps }: AppProps) {
|
|
10
12
|
if (!pageProps.appData) return <div />
|
|
@@ -19,9 +21,14 @@ function MyApp({ Component, pageProps }: AppProps) {
|
|
|
19
21
|
|
|
20
22
|
const View = manifest[pageProps.view]
|
|
21
23
|
|
|
24
|
+
// console.log("PAGE", pageProps)
|
|
25
|
+
|
|
22
26
|
return (
|
|
23
27
|
<ServerlessAppDataProvider value={appData}>
|
|
24
28
|
<NextRouter data={pageProps} path={route.pathname}>
|
|
29
|
+
{pageProps?.meta?.head && <PageMeta {...pageProps?.meta?.head} />}
|
|
30
|
+
{pageProps?.meta?.footer && <PageMeta {...pageProps?.meta?.footer} />}
|
|
31
|
+
{process.devUI && <DevUILoader />}
|
|
25
32
|
<App>
|
|
26
33
|
<View {...viewProps} />
|
|
27
34
|
</App>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { DefaultThemeMap } from "@stitches/react";
|
|
2
3
|
import { ConfigType } from "@stitches/core/types/config";
|
|
3
4
|
import { Properties as CSS } from "csstype";
|
|
@@ -17,7 +18,7 @@ declare type TypographyConfig<Theme extends ConfigType.Theme<{}>, Media extends
|
|
|
17
18
|
lineHeight?: ResponsiveValue<Media, Theme["lineHeights"] extends {} ? `$${Extract<keyof Theme["lineHeights"], string>}` | CSS["lineHeight"] : CSS["lineHeight"]>;
|
|
18
19
|
};
|
|
19
20
|
};
|
|
20
|
-
declare type BreakpointArray = {
|
|
21
|
+
export declare type BreakpointArray = {
|
|
21
22
|
key: string;
|
|
22
23
|
min: string | null;
|
|
23
24
|
max: string | null;
|
|
@@ -46,6 +47,9 @@ declare type ResponsiveAtom = {
|
|
|
46
47
|
} & ({
|
|
47
48
|
type: "multiplier";
|
|
48
49
|
value: number;
|
|
50
|
+
} | {
|
|
51
|
+
type: "percent";
|
|
52
|
+
value: number;
|
|
49
53
|
} | {
|
|
50
54
|
type: "px";
|
|
51
55
|
value: number;
|
|
@@ -58,10 +62,11 @@ declare type ResponsiveAtom = {
|
|
|
58
62
|
} | {
|
|
59
63
|
type: "undefined";
|
|
60
64
|
});
|
|
61
|
-
declare type ResponsiveAtomCalc =
|
|
65
|
+
export declare type ResponsiveAtomCalc = ResponsiveAtom & {
|
|
62
66
|
defined: boolean;
|
|
63
67
|
breakpoint: string;
|
|
64
68
|
baseBreakpoint: string;
|
|
69
|
+
lastBreakpoint: string;
|
|
65
70
|
lerping?: {
|
|
66
71
|
fromBP: string | null;
|
|
67
72
|
toBP: string | null;
|
|
@@ -71,9 +76,13 @@ declare type ResponsiveAtomCalc = (ResponsiveAtom & {
|
|
|
71
76
|
maxValue: number;
|
|
72
77
|
};
|
|
73
78
|
concreteValue: number | null;
|
|
74
|
-
}
|
|
75
|
-
export declare function parseResponsiveObject(breakpoints: ReturnType<typeof parseBreakpoints>, object: any): ResponsiveAtomCalc;
|
|
76
|
-
export declare function getResponsiveObjectStyles(
|
|
79
|
+
};
|
|
80
|
+
export declare function parseResponsiveObject(breakpoints: ReturnType<typeof parseBreakpoints>, object: any): ResponsiveAtomCalc[];
|
|
81
|
+
export declare function getResponsiveObjectStyles(breakpoints: ReturnType<typeof parseBreakpoints>, object: any, varName: string, unit?: string): any[];
|
|
82
|
+
export declare function parseResponsiveTokens(theme: any, breakpoints: any): {
|
|
83
|
+
initialResponsive: any;
|
|
84
|
+
globalResponsive: any;
|
|
85
|
+
};
|
|
77
86
|
export declare function createStitches<Prefix extends string = "", Media extends {} = {}, Breakpoints extends (keyof Media)[] = [], Theme extends {} = {}, Responsive extends {} = {}, ThemeMap extends {} = DefaultThemeMap, Utils extends {} = {}, Typography extends {} = {}>(config: {
|
|
78
87
|
breakpoints: Breakpoints;
|
|
79
88
|
prefix?: ConfigType.Prefix<Prefix>;
|
package/style/createStitches.js
CHANGED
|
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.createStitches = exports.getResponsiveObjectStyles = exports.parseResponsiveObject = exports.parseBreakpoints = void 0;
|
|
14
|
+
exports.createStitches = exports.parseResponsiveTokens = exports.getResponsiveObjectStyles = exports.parseResponsiveObject = exports.parseBreakpoints = void 0;
|
|
15
15
|
var react_1 = require("@stitches/react");
|
|
16
16
|
var typeKeyMap = {
|
|
17
17
|
fontSize: "fontSizes",
|
|
@@ -146,11 +146,6 @@ function parseGrid(theme, media, grid) {
|
|
|
146
146
|
"--grid-margin": breakpoint.margin,
|
|
147
147
|
"--grid-col-width": "calc((var(--grid-inner-width) - (".concat(grid.columns - 1, " * var(--grid-gutter))) / ").concat(grid.columns, ")"),
|
|
148
148
|
};
|
|
149
|
-
// for (let i = 1; i < grid.columns; i++) {
|
|
150
|
-
// globalGrid[bpName][
|
|
151
|
-
// `--grid-${i}-cols`
|
|
152
|
-
// ] = `calc(var(--grid-col-width) * ${i} + var(--grid-gutter) * ${i - 1})`
|
|
153
|
-
// }
|
|
154
149
|
}
|
|
155
150
|
return { gridVariants: {}, globalGrid: globalGrid };
|
|
156
151
|
}
|
|
@@ -166,6 +161,13 @@ function parseResponsiveValue(val) {
|
|
|
166
161
|
value: parseFloat(val.replace(/^x/, "")),
|
|
167
162
|
};
|
|
168
163
|
}
|
|
164
|
+
else if (val.match(/^[0-9\.]+%$/)) {
|
|
165
|
+
return {
|
|
166
|
+
lerpStart: false,
|
|
167
|
+
type: "percent",
|
|
168
|
+
value: parseFloat(val.replace(/^x/, "")),
|
|
169
|
+
};
|
|
170
|
+
}
|
|
169
171
|
else if (val.match(/^[0-9\.]+px$/)) {
|
|
170
172
|
return {
|
|
171
173
|
lerpStart: false,
|
|
@@ -219,7 +221,10 @@ function parseResponsiveObject(breakpoints, object) {
|
|
|
219
221
|
else if (value.type === "multiplier") {
|
|
220
222
|
concreteValues[bp.key] = value.value * concreteValues[base];
|
|
221
223
|
}
|
|
222
|
-
|
|
224
|
+
else if (value.type === "percent") {
|
|
225
|
+
concreteValues[bp.key] = value.value;
|
|
226
|
+
}
|
|
227
|
+
result.push(__assign(__assign({}, value), { defined: defined, breakpoint: bp.key, lastBreakpoint: lastDefined, baseBreakpoint: base, lerping: lerpStart
|
|
223
228
|
? {
|
|
224
229
|
fromBP: lerpStart,
|
|
225
230
|
toBP: null,
|
|
@@ -242,7 +247,6 @@ function parseResponsiveObject(breakpoints, object) {
|
|
|
242
247
|
lastBreakpoint = bp.key;
|
|
243
248
|
}
|
|
244
249
|
}
|
|
245
|
-
console.log("Next BPs", nextBreakpoints);
|
|
246
250
|
result.forEach(function (item, i) {
|
|
247
251
|
if (item.lerping) {
|
|
248
252
|
item.lerping.toBP = nextBreakpoints[i];
|
|
@@ -268,14 +272,13 @@ function parseResponsiveObject(breakpoints, object) {
|
|
|
268
272
|
return result;
|
|
269
273
|
}
|
|
270
274
|
exports.parseResponsiveObject = parseResponsiveObject;
|
|
271
|
-
function getResponsiveObjectStyles(
|
|
275
|
+
function getResponsiveObjectStyles(breakpoints, object, varName, unit) {
|
|
272
276
|
var _a, _b;
|
|
273
277
|
var _c;
|
|
274
278
|
if (unit === void 0) { unit = "px"; }
|
|
275
279
|
// Prescale object
|
|
276
280
|
object = __assign({}, object);
|
|
277
281
|
var parsed = parseResponsiveObject(breakpoints, object);
|
|
278
|
-
// console.log("Result", object, parsed)
|
|
279
282
|
var globals = {};
|
|
280
283
|
for (var _i = 0, parsed_1 = parsed; _i < parsed_1.length; _i++) {
|
|
281
284
|
var atom = parsed_1[_i];
|
|
@@ -291,44 +294,6 @@ function getResponsiveObjectStyles(theme, breakpoints, object, varName, scale, u
|
|
|
291
294
|
_b);
|
|
292
295
|
}
|
|
293
296
|
}
|
|
294
|
-
// console.log("globals", globals)
|
|
295
|
-
// Util for grabbing the raw value of a token, for lerping
|
|
296
|
-
// const resolveValue = (value: any) => {
|
|
297
|
-
// if (typeof value === "string" && value.match(/^\$[a-z0-9\-\_]+$/) && scale) {
|
|
298
|
-
// // Single scale
|
|
299
|
-
// return theme[scale][value.replace("$", "")]
|
|
300
|
-
// } else if (typeof value === "number") {
|
|
301
|
-
// return value + "px"
|
|
302
|
-
// } else {
|
|
303
|
-
// return value
|
|
304
|
-
// }
|
|
305
|
-
// }
|
|
306
|
-
// const globals2: any = {}
|
|
307
|
-
// const initial: any = {}
|
|
308
|
-
// const entries = Object.entries(object)
|
|
309
|
-
// entries.forEach(([bpName, responsiveValue], i) => {
|
|
310
|
-
// globals2[bpName] = {}
|
|
311
|
-
// if (Array.isArray(responsiveValue)) {
|
|
312
|
-
// responsiveValue = responsiveValue[0]
|
|
313
|
-
// // An array in the format [value] signifies font locking between the current breakpoint and the next defined one
|
|
314
|
-
// const minSize = breakpoints.find((bp) => "@" + bp.key === bpName)?.min
|
|
315
|
-
// const nextBreakpoint = breakpoints.find((bp) => "@" + bp.key === entries[i + 1]?.[0])
|
|
316
|
-
// if (!nextBreakpoint)
|
|
317
|
-
// throw new Error(
|
|
318
|
-
// `Cannot create responsive '${varName}' at breakpoint '${bpName}', since it is the last-defined breakpoint. Your last size should be a string/number/token.`
|
|
319
|
-
// )
|
|
320
|
-
// const maxSize = nextBreakpoint.min
|
|
321
|
-
// let responsiveValue2 = (object as any)["@" + nextBreakpoint.key]
|
|
322
|
-
// if (Array.isArray(responsiveValue2)) responsiveValue2 = responsiveValue2[0]
|
|
323
|
-
// let size1 = resolveValue(responsiveValue)
|
|
324
|
-
// let size2 = resolveValue(responsiveValue2)
|
|
325
|
-
// responsiveValue = `calc(${size1} + (100vw - ${minSize}) / (${unitless(maxSize)} - ${unitless(
|
|
326
|
-
// minSize
|
|
327
|
-
// )}) * (${unitless(size2)} - ${unitless(size1)}))`
|
|
328
|
-
// }
|
|
329
|
-
// globals2[bpName][varName] = responsiveValue
|
|
330
|
-
// })
|
|
331
|
-
// console.log(globals, globals2)
|
|
332
297
|
return [globals, (_c = globals["@initial"]) === null || _c === void 0 ? void 0 : _c[varName]];
|
|
333
298
|
}
|
|
334
299
|
exports.getResponsiveObjectStyles = getResponsiveObjectStyles;
|
|
@@ -344,8 +309,7 @@ function parseResponsiveTokens(theme, breakpoints) {
|
|
|
344
309
|
for (var key in theme[scale]) {
|
|
345
310
|
var val = theme[scale][key];
|
|
346
311
|
if (val && typeof val === "object") {
|
|
347
|
-
var _a = getResponsiveObjectStyles(
|
|
348
|
-
console.log("TOKEN", tokenGlobals, initial);
|
|
312
|
+
var _a = getResponsiveObjectStyles(breakpoints, val, "--" + scale + "-" + key), tokenGlobals = _a[0], initial = _a[1];
|
|
349
313
|
for (var bp in tokenGlobals) {
|
|
350
314
|
globalResponsive[bp] = __assign(__assign({}, globalResponsive[bp]), tokenGlobals[bp]);
|
|
351
315
|
}
|
|
@@ -358,9 +322,9 @@ function parseResponsiveTokens(theme, breakpoints) {
|
|
|
358
322
|
}
|
|
359
323
|
return { initialResponsive: initialResponsive, globalResponsive: globalResponsive };
|
|
360
324
|
}
|
|
325
|
+
exports.parseResponsiveTokens = parseResponsiveTokens;
|
|
361
326
|
function createStitches(config) {
|
|
362
327
|
var breakpoints = parseBreakpoints(config.breakpoints, config.media);
|
|
363
|
-
console.log("PARSED BREAKPOINTS", breakpoints);
|
|
364
328
|
var _a = parseTypography(config.theme, breakpoints, config.typography), typeVariants = _a.typeVariants, globalTypography = _a.globalTypography;
|
|
365
329
|
var _b = parseGrid(config.theme, config.media, config.grid), gridVariants = _b.gridVariants, globalGrid = _b.globalGrid;
|
|
366
330
|
var _c = parseResponsiveTokens(config.responsive, breakpoints), initialResponsive = _c.initialResponsive, globalResponsive = _c.globalResponsive;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function updateEnvFile(data: Record<string, string | number>, directory?: string): Promise<void>;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.updateEnvFile = void 0;
|
|
40
|
+
var fs_1 = require("fs");
|
|
41
|
+
var promises_1 = require("fs/promises");
|
|
42
|
+
var path_1 = require("path");
|
|
43
|
+
function updateEnvFile(data, directory) {
|
|
44
|
+
if (directory === void 0) { directory = process.cwd(); }
|
|
45
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
46
|
+
var path, contents, lines, key;
|
|
47
|
+
return __generator(this, function (_a) {
|
|
48
|
+
switch (_a.label) {
|
|
49
|
+
case 0:
|
|
50
|
+
path = (0, path_1.join)(directory, ".env");
|
|
51
|
+
if (!(0, fs_1.existsSync)(path)) return [3 /*break*/, 3];
|
|
52
|
+
return [4 /*yield*/, (0, promises_1.readFile)(path, "utf8")];
|
|
53
|
+
case 1:
|
|
54
|
+
contents = (_a.sent()).toString();
|
|
55
|
+
lines = contents.split(/\n/g);
|
|
56
|
+
lines = lines.filter(function (line) {
|
|
57
|
+
for (var key in data) {
|
|
58
|
+
if (line.startsWith("".concat(key, "="))) {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return true;
|
|
63
|
+
});
|
|
64
|
+
for (key in data) {
|
|
65
|
+
lines.push("".concat(key, "=").concat(data[key]));
|
|
66
|
+
}
|
|
67
|
+
return [4 /*yield*/, (0, promises_1.writeFile)(path, lines.join("\n"))];
|
|
68
|
+
case 2:
|
|
69
|
+
_a.sent();
|
|
70
|
+
_a.label = 3;
|
|
71
|
+
case 3: return [2 /*return*/];
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
exports.updateEnvFile = updateEnvFile;
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1,38 +0,0 @@
|
|
|
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
|
-
});
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1,10 +0,0 @@
|
|
|
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;
|
|
@@ -1,13 +0,0 @@
|
|
|
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
|
-
});
|