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.
Files changed (185) hide show
  1. package/admin/components/ImageWell.d.ts +2 -2
  2. package/admin/components/ImageWell.js +51 -39
  3. package/admin/defineField.d.ts +2 -2
  4. package/admin/defineWidget.d.ts +1 -1
  5. package/admin/defineWidget.js +2 -2
  6. package/admin/index.js +1 -5
  7. package/admin/installFieldTypes.js +26 -26
  8. package/admin/runWidgets.js +28 -17
  9. package/admin/selectMedia.d.ts +2 -2
  10. package/admin/selectMedia.js +1 -1
  11. package/blocks/ContentBlocks.d.ts +6 -6
  12. package/blocks/ContentBlocks.js +66 -58
  13. package/blocks/ErrorBoundaryEditor.d.ts +1 -1
  14. package/blocks/ErrorBoundaryEditor.js +45 -16
  15. package/blocks/ErrorBoundaryFrontend.d.ts +1 -1
  16. package/blocks/ErrorBoundaryFrontend.js +45 -16
  17. package/blocks/InspectorControls.d.ts +1 -1
  18. package/blocks/InspectorControls.js +3 -3
  19. package/blocks/blockAttributes.d.ts +2 -2
  20. package/blocks/blockAttributes.js +44 -24
  21. package/blocks/index.js +1 -5
  22. package/blocks/inlineEditing.d.ts +6 -6
  23. package/blocks/inlineEditing.js +55 -36
  24. package/blocks/installGutenbergHooks.js +68 -48
  25. package/build/babel/plugin-name-defined-components.js +16 -15
  26. package/build/build-favicon.js +62 -11
  27. package/build/clean.js +52 -5
  28. package/build/create-codegen-worker.js +33 -78
  29. package/build/create-serverless-dev-worker.js +39 -61
  30. package/build/create-webpack-worker.js +33 -65
  31. package/build/file-tree.d.ts +2 -2
  32. package/build/file-tree.js +12 -12
  33. package/build/get-webpack-config.js +395 -341
  34. package/build/graphql-codegen/graphql-codegen-files.js +25 -31
  35. package/build/graphql-codegen/graphql-codegen-no-duplicates.js +4 -4
  36. package/build/graphql-codegen/graphql-codegen-queries.js +99 -102
  37. package/build/manifests/manifest-blocks.d.ts +1 -1
  38. package/build/manifests/manifest-blocks.js +29 -37
  39. package/build/manifests/manifest-fields.d.ts +1 -1
  40. package/build/manifests/manifest-fields.js +21 -23
  41. package/build/manifests/manifest-views.d.ts +1 -1
  42. package/build/manifests/manifest-views.js +25 -32
  43. package/build/manifests/manifest-widgets.d.ts +1 -1
  44. package/build/manifests/manifest-widgets.js +20 -22
  45. package/build/manifests/manifest.d.ts +2 -2
  46. package/build/manifests/manifest.js +94 -30
  47. package/build/reporter.d.ts +1 -1
  48. package/build/reporter.js +32 -29
  49. package/build/serverless/create-next-app.d.ts +1 -1
  50. package/build/serverless/create-next-app.js +467 -245
  51. package/build/state/codegen-state.d.ts +4 -4
  52. package/build/state/compiler-state.d.ts +5 -5
  53. package/build/state/serverless-state.d.ts +3 -3
  54. package/build/workers/codegen-worker-script.js +519 -393
  55. package/build/workers/serverless-worker-dev-script.js +4 -4
  56. package/build/workers/webpack-worker-script.js +156 -90
  57. package/cli/build.dev.d.ts +1 -1
  58. package/cli/build.dev.js +126 -79
  59. package/cli/build.prod.d.ts +1 -1
  60. package/cli/build.prod.js +98 -42
  61. package/cli/cli.js +28 -19
  62. package/cli/display/components/BundleDisplay.d.ts +1 -1
  63. package/cli/display/components/BundleDisplay.js +24 -13
  64. package/cli/display/components/CodegenDisplay.d.ts +1 -1
  65. package/cli/display/components/CodegenDisplay.js +25 -14
  66. package/cli/display/components/DevCLIDisplay.d.ts +2 -2
  67. package/cli/display/components/DevCLIDisplay.js +25 -14
  68. package/cli/display/components/Fullscreen.js +20 -9
  69. package/cli/display/components/ServerlessDisplay.d.ts +2 -2
  70. package/cli/display/components/ServerlessDisplay.js +26 -15
  71. package/cli/display/components/StatusIcon.d.ts +2 -2
  72. package/cli/display/components/StatusIcon.js +3 -3
  73. package/cli/preinstall.js +5 -4
  74. package/cli/setup.js +73 -25
  75. package/components/AdminBar.d.ts +1 -1
  76. package/components/AdminBar.js +3 -37
  77. package/components/BrowserRouter.d.ts +2 -2
  78. package/components/BrowserRouter.js +54 -41
  79. package/components/InlinePage.d.ts +2 -2
  80. package/components/InlinePage.js +29 -17
  81. package/components/NextRouter.d.ts +2 -2
  82. package/components/NextRouter.js +29 -20
  83. package/components/index.js +1 -5
  84. package/config/config-schema.d.ts +1 -1
  85. package/config/config-schema.js +1 -1
  86. package/config/create-schema-file.js +6 -6
  87. package/config/get-config.js +13 -10
  88. package/config/index.js +1 -5
  89. package/config/parse-config.js +1 -1
  90. package/config/print-zod-errors.js +3 -3
  91. package/dev-ui/components/BreakpointColumnHeader.d.ts +2 -2
  92. package/dev-ui/components/BreakpointColumnHeader.js +18 -7
  93. package/dev-ui/components/BreakpointIndicator.d.ts +1 -1
  94. package/dev-ui/components/BreakpointIndicator.js +32 -25
  95. package/dev-ui/components/DevUI.d.ts +1 -1
  96. package/dev-ui/components/DevUI.js +13 -13
  97. package/dev-ui/components/Launcher.d.ts +2 -2
  98. package/dev-ui/components/Launcher.js +25 -13
  99. package/dev-ui/components/PanelWrapper.d.ts +2 -2
  100. package/dev-ui/components/PanelWrapper.js +8 -8
  101. package/dev-ui/components/ResponsiveLerpControl.d.ts +2 -2
  102. package/dev-ui/components/ResponsiveLerpControl.js +38 -27
  103. package/dev-ui/components/ResponsiveScaleEditor.d.ts +4 -4
  104. package/dev-ui/components/ResponsiveScaleEditor.js +78 -64
  105. package/dev-ui/components/atoms/Button.js +1 -1
  106. package/dev-ui/components/atoms/Dropdown.d.ts +3 -3
  107. package/dev-ui/components/atoms/Dropdown.js +9 -8
  108. package/dev-ui/components/atoms/NumberField.d.ts +2 -2
  109. package/dev-ui/components/atoms/NumberField.js +42 -29
  110. package/dev-ui/components/atoms/Spacer.js +1 -1
  111. package/dev-ui/components/atoms/Text.js +1 -1
  112. package/dev-ui/components/atoms/ToggleButton.d.ts +2 -2
  113. package/dev-ui/components/atoms/ToggleButton.js +16 -5
  114. package/dev-ui/components/atoms/Tooltip.d.ts +2 -2
  115. package/dev-ui/components/atoms/Tooltip.js +20 -8
  116. package/dev-ui/components/panels/AppDataDebugger.d.ts +1 -1
  117. package/dev-ui/components/panels/AppDataDebugger.js +19 -8
  118. package/dev-ui/components/panels/ColorEditor.d.ts +1 -1
  119. package/dev-ui/components/panels/ColorEditor.js +42 -35
  120. package/dev-ui/components/panels/PageDataDebugger.d.ts +1 -1
  121. package/dev-ui/components/panels/PageDataDebugger.js +20 -8
  122. package/dev-ui/components/panels/QueryDebugger.d.ts +1 -1
  123. package/dev-ui/components/panels/QueryDebugger.js +24 -12
  124. package/dev-ui/components/panels/SpacingEditor.d.ts +1 -1
  125. package/dev-ui/components/panels/SpacingEditor.js +48 -34
  126. package/dev-ui/components/panels/TypographyEditor.d.ts +1 -1
  127. package/dev-ui/components/panels/TypographyEditor.js +46 -38
  128. package/dev-ui/hooks/useBreakpoint.d.ts +1 -1
  129. package/dev-ui/hooks/useBreakpoint.js +13 -13
  130. package/dev-ui/hooks/usePersistState.js +7 -6
  131. package/dev-ui/hooks/useStylesheet.js +6 -6
  132. package/dev-ui/icons.d.ts +15 -15
  133. package/dev-ui/icons.js +27 -16
  134. package/dev-ui/index.js +1 -5
  135. package/dev-ui/loader.d.ts +1 -1
  136. package/dev-ui/loader.js +9 -13
  137. package/dev-ui/panels.d.ts +2 -2
  138. package/dev-ui/panels.js +7 -7
  139. package/dev-ui/theme.js +3 -3
  140. package/dynamic/dynamic-component.js +1 -1
  141. package/dynamic/index.js +1 -5
  142. package/entry/Root.d.ts +2 -2
  143. package/entry/Root.js +26 -16
  144. package/entry/entry.admin.dev.js +4 -4
  145. package/entry/entry.admin.prod.js +4 -4
  146. package/entry/entry.monolith.dev.js +5 -5
  147. package/entry/entry.monolith.prod.js +5 -5
  148. package/gravityforms/gravity-forms.d.ts +2 -2
  149. package/gravityforms/index.js +1 -5
  150. package/gravityforms/useGravityForm.d.ts +2 -2
  151. package/gravityforms/useGravityForm.js +130 -126
  152. package/hooks/index.js +1 -5
  153. package/hooks/queryUtils.d.ts +14 -14
  154. package/hooks/queryUtils.js +192 -101
  155. package/hooks/useAppData.d.ts +2 -2
  156. package/hooks/useAppData.js +9 -9
  157. package/hooks/usePageLoad.js +4 -4
  158. package/hooks/useQueryDebug.d.ts +1 -1
  159. package/hooks/useQueryDebug.js +7 -7
  160. package/hooks/useRPC.d.ts +4 -4
  161. package/hooks/useRPC.js +3 -3
  162. package/package.json +11 -11
  163. package/routing/index.js +1 -5
  164. package/routing/remoteProps.d.ts +1 -1
  165. package/routing/remoteProps.js +72 -31
  166. package/routing/routing.d.ts +25 -15
  167. package/routing/routing.js +200 -112
  168. package/routing/updateEditLink.js +1 -1
  169. package/serverless/define-api.d.ts +1 -1
  170. package/serverless/define-rpc-router.js +4 -8
  171. package/serverless/index.js +2 -6
  172. package/style/createStitches.js +142 -164
  173. package/style/index.js +1 -5
  174. package/tsconfig.json +1 -1
  175. package/utils/Observable.d.ts +2 -2
  176. package/utils/Observable.js +15 -12
  177. package/utils/getRepoName.js +3 -3
  178. package/utils/promptIfRepoNameIncorrect.js +64 -18
  179. package/utils/refreshOverlayInterop.js +1 -1
  180. package/utils/reportErrorStack.d.ts +1 -1
  181. package/utils/reportErrorStack.js +1 -1
  182. package/utils/serverlessAppContext.js +1 -1
  183. package/utils/updateEnvFile.js +69 -19
  184. package/utils/useObservable.js +3 -3
  185. package/views/index.js +1 -5
@@ -1,61 +1,102 @@
1
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
+ };
2
38
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
39
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
40
  };
5
41
  Object.defineProperty(exports, "__esModule", { value: true });
6
42
  exports.hasCachedProps = exports.fetchProps = exports.isSameOrigin = exports.setInitialProps = exports.parseURL = void 0;
7
- const url_parse_1 = __importDefault(require("url-parse"));
8
- const qs_1 = __importDefault(require("qs"));
9
- const pending = {};
10
- const cache = {};
43
+ var url_parse_1 = __importDefault(require("url-parse"));
44
+ var qs_1 = __importDefault(require("qs"));
45
+ var pending = {};
46
+ var cache = {};
11
47
  function parseURL(url) {
12
48
  return (0, url_parse_1.default)(url, qs_1.default.parse);
13
49
  }
14
50
  exports.parseURL = parseURL;
15
51
  function getRouteCacheKey(url) {
16
- const parsed = parseURL(url);
52
+ var parsed = parseURL(url);
17
53
  return parsed.pathname.replace(/\/$/, "");
18
54
  }
19
55
  function setInitialProps(url, data) {
20
- const cacheKey = getRouteCacheKey(url);
56
+ var cacheKey = getRouteCacheKey(url);
21
57
  cache[cacheKey] = data;
22
58
  }
23
59
  exports.setInitialProps = setInitialProps;
24
60
  function isSameOrigin(url) {
25
- const parsed = parseURL(url);
61
+ var parsed = parseURL(url);
26
62
  return parsed.origin === document.location.origin && !parsed.pathname.match(/\.[a-z0-9]$/i);
27
63
  }
28
64
  exports.isSameOrigin = isSameOrigin;
29
- async function fetchProps(url) {
30
- const parsed = parseURL(url);
31
- const cacheKey = getRouteCacheKey(url);
32
- // Cached value?
33
- if (cacheKey in cache)
34
- return Promise.resolve(cache[cacheKey]);
35
- if (cacheKey in pending)
36
- return pending[cacheKey];
37
- parsed.query["_props"] = "1";
38
- const requestUrl = parsed.toString();
39
- const promise = fetch(requestUrl)
40
- .then((response) => response.json())
41
- .then((data) => {
42
- if (data.redirect) {
43
- const redirect = data.redirect;
44
- return fetchProps(redirect).then((data) => {
45
- data.canonical = redirect;
65
+ function fetchProps(url) {
66
+ return __awaiter(this, void 0, void 0, function () {
67
+ var parsed, cacheKey, requestUrl, promise;
68
+ return __generator(this, function (_a) {
69
+ parsed = parseURL(url);
70
+ cacheKey = getRouteCacheKey(url);
71
+ // Cached value?
72
+ if (cacheKey in cache)
73
+ return [2 /*return*/, Promise.resolve(cache[cacheKey])];
74
+ if (cacheKey in pending)
75
+ return [2 /*return*/, pending[cacheKey]];
76
+ parsed.query["_props"] = "1";
77
+ requestUrl = parsed.toString();
78
+ promise = fetch(requestUrl)
79
+ .then(function (response) { return response.json(); })
80
+ .then(function (data) {
81
+ if (data.redirect) {
82
+ var redirect_1 = data.redirect;
83
+ return fetchProps(redirect_1).then(function (data) {
84
+ data.canonical = redirect_1;
85
+ return data;
86
+ });
87
+ }
88
+ delete pending[cacheKey];
89
+ cache[cacheKey] = data;
46
90
  return data;
47
91
  });
48
- }
49
- delete pending[cacheKey];
50
- cache[cacheKey] = data;
51
- return data;
92
+ pending[cacheKey] = promise;
93
+ return [2 /*return*/, promise];
94
+ });
52
95
  });
53
- pending[cacheKey] = promise;
54
- return promise;
55
96
  }
56
97
  exports.fetchProps = fetchProps;
57
98
  function hasCachedProps(url) {
58
- const cacheKey = getRouteCacheKey(url);
99
+ var cacheKey = getRouteCacheKey(url);
59
100
  // Cached value?
60
101
  return !!cache[cacheKey];
61
102
  }
@@ -2,23 +2,23 @@ import { ReactNode, PropsWithChildren } from "react";
2
2
  import { APropsWithoutRef } from "react-html-props";
3
3
  import URLParse from "url-parse";
4
4
  import { RouteData } from "./remoteProps";
5
- type RouteItem = URLParse<any> & {
5
+ declare type RouteItem = URLParse<any> & {
6
6
  data?: RouteData;
7
7
  };
8
- type AnyPromise = Promise<any>;
9
- type MatchResult = boolean | string;
10
- type RouteStatus = "leaving" | "parent-leaving" | "active" | "inactive";
11
- type RouteContextConfig = {
8
+ declare type AnyPromise = Promise<any>;
9
+ declare type MatchResult = boolean | string;
10
+ declare type RouteStatus = "leaving" | "parent-leaving" | "active" | "inactive";
11
+ declare type RouteContextConfig = {
12
12
  debugName?: string;
13
13
  match?(next: RouteItem): MatchResult;
14
14
  beforeLeave?(current: RouteItem, next: RouteItem, parentIsLeaving: boolean): AnyPromise | undefined;
15
15
  onChange?(route: RouteItem, status: RouteStatus): void;
16
16
  };
17
- type ContextSubscriber = (item: RouteItem, status: RouteStatus) => void;
18
- type ForkOptions = {
17
+ declare type ContextSubscriber = (item: RouteItem, status: RouteStatus) => void;
18
+ declare type ForkOptions = {
19
19
  isSwitch?: boolean;
20
20
  };
21
- type RouteContextType = {
21
+ declare type RouteContextType = {
22
22
  parent?: RouteContextType;
23
23
  status: RouteStatus;
24
24
  loading?: {
@@ -33,7 +33,15 @@ type RouteContextType = {
33
33
  propagateCandidate(next: RouteItem, prev: RouteItem): AnyPromise;
34
34
  propagateLeaving(current: RouteItem, next: RouteItem, parentLeaving: boolean): AnyPromise;
35
35
  getFirstMatch: (item: RouteItem) => RouteContextType | undefined;
36
+ /**
37
+ * Navigate to a specific page
38
+ * @param path The relative URL to navigate to
39
+ */
40
+ navigate: (path: string) => void;
41
+ preload: (path: string) => void;
42
+ /** @deprecated Use navigate() instead */
36
43
  onNavigate: (path: string) => void;
44
+ /** @deprecated Use preload() instead */
37
45
  onPreload: (path: string) => void;
38
46
  dispose: () => void;
39
47
  update: () => void;
@@ -44,12 +52,12 @@ type RouteContextType = {
44
52
  };
45
53
  export declare function useRoute(): RouteItem;
46
54
  export declare function useRouter(): RouteContextType | undefined;
47
- export type RouteProps = RouteContextConfig & {
55
+ export declare type RouteProps = RouteContextConfig & {
48
56
  children: ReactNode;
49
57
  };
50
- export declare function Route(props: RouteProps): import("react/jsx-runtime").JSX.Element | null;
58
+ export declare function Route(props: RouteProps): JSX.Element | null;
51
59
  export declare function createRouteItem(url: string, data: RouteData): RouteItem;
52
- type RouterRootProps = {
60
+ declare type RouterRootProps = {
53
61
  url: string;
54
62
  data: RouteData;
55
63
  children: ReactNode;
@@ -57,18 +65,20 @@ type RouterRootProps = {
57
65
  onPreload?: (url: string) => void;
58
66
  onNavigated?: (item: RouteItem) => void;
59
67
  };
60
- export declare function RouterRoot(props: RouterRootProps): import("react/jsx-runtime").JSX.Element;
61
- type SwitchProps = {
68
+ export declare function RouterRoot(props: RouterRootProps): JSX.Element;
69
+ declare type SwitchProps = {
62
70
  children: ReactNode | ReactNode[];
63
71
  };
64
72
  export declare const isInternalPageLink: (href: string) => boolean;
73
+ export declare const urlPathsMatch: (a: string, b: string) => boolean;
74
+ export declare const urlDescendentsMatch: (a: string, b: string) => boolean;
65
75
  export declare const Link: import("react").ForwardRefExoticComponent<APropsWithoutRef & {
66
76
  preload?: boolean | undefined;
67
77
  } & {
68
78
  className?: string | undefined;
69
79
  } & import("react").RefAttributes<HTMLAnchorElement>>;
70
- export declare function Switch({ children }: SwitchProps): import("react/jsx-runtime").JSX.Element;
80
+ export declare function Switch({ children }: SwitchProps): JSX.Element;
71
81
  export declare function RouteItemContext(props: PropsWithChildren<{
72
82
  route: RouteItem;
73
- }>): import("react/jsx-runtime").JSX.Element;
83
+ }>): JSX.Element;
74
84
  export {};