eddev 0.2.67-beta1 → 0.3.0-beta2
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 +12 -12
- 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
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.StatusIcon = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
var ink_1 = require("ink");
|
|
6
6
|
function StatusIcon(props) {
|
|
7
|
-
return ((0, jsx_runtime_1.jsx)(ink_1.Text, { children: props.icon === "tick" ? "✅" : props.icon === "error" ? "🚨" : props.icon === "loading" ? "🧠" : "💬" }));
|
|
7
|
+
return ((0, jsx_runtime_1.jsx)(ink_1.Text, { children: props.icon === "tick" ? "✅" : props.icon === "error" ? "🚨" : props.icon === "loading" ? "🧠" : "💬" }, void 0));
|
|
8
8
|
}
|
|
9
9
|
exports.StatusIcon = StatusIcon;
|
package/cli/preinstall.js
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.main = void 0;
|
|
4
|
-
|
|
4
|
+
var child_process_1 = require("child_process");
|
|
5
5
|
function main() {
|
|
6
|
+
var _a, _b;
|
|
6
7
|
if (process.env.VERCEL) {
|
|
7
8
|
// const pkgFile = join(process.cwd(), "package.json")
|
|
8
9
|
// const pkg = JSON.parse(readFileSync(pkgFile).toString()) as any
|
|
9
10
|
// pkg.devDependencies["next"] = "^12.1.0"
|
|
10
11
|
// writeFile(pkgFile, JSON.stringify(pkg, null, " "), () => {})
|
|
11
|
-
|
|
12
|
+
var proc = (0, child_process_1.spawn)("yarn", ["add", "--dev", "next@^12.1.6"], {
|
|
12
13
|
cwd: process.cwd(),
|
|
13
14
|
});
|
|
14
|
-
proc.stdout
|
|
15
|
-
proc.stderr
|
|
15
|
+
(_a = proc.stdout) === null || _a === void 0 ? void 0 : _a.pipe(process.stdout);
|
|
16
|
+
(_b = proc.stderr) === null || _b === void 0 ? void 0 : _b.pipe(process.stderr);
|
|
16
17
|
}
|
|
17
18
|
}
|
|
18
19
|
exports.main = main;
|
package/cli/setup.js
CHANGED
|
@@ -1,42 +1,90 @@
|
|
|
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.setupTheme = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
43
|
+
var getRepoName_1 = require("../utils/getRepoName");
|
|
44
|
+
var inquirer_1 = __importDefault(require("inquirer"));
|
|
45
|
+
var path_1 = __importDefault(require("path"));
|
|
46
|
+
var fs_1 = __importDefault(require("fs"));
|
|
47
|
+
function setupTheme() {
|
|
48
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
49
|
+
var repoName, styleFileName, packageFileName, result;
|
|
50
|
+
return __generator(this, function (_a) {
|
|
51
|
+
switch (_a.label) {
|
|
52
|
+
case 0: return [4 /*yield*/, (0, getRepoName_1.getRepoName)(process.cwd())];
|
|
53
|
+
case 1:
|
|
54
|
+
repoName = (_a.sent()).repoName;
|
|
55
|
+
if (!repoName) {
|
|
56
|
+
throw new Error("This theme does is not linked to Git repo. Cannot continue with setup");
|
|
57
|
+
}
|
|
58
|
+
styleFileName = path_1.default.resolve(process.cwd(), "style.css");
|
|
59
|
+
packageFileName = path_1.default.resolve(process.cwd(), "package.json");
|
|
60
|
+
return [4 /*yield*/, inquirer_1.default.prompt([
|
|
61
|
+
{
|
|
62
|
+
type: "text",
|
|
63
|
+
name: "themeTitle",
|
|
64
|
+
message: "Enter the website or theme title",
|
|
65
|
+
},
|
|
66
|
+
])];
|
|
67
|
+
case 2:
|
|
68
|
+
result = _a.sent();
|
|
69
|
+
updateStyleFile(styleFileName, {
|
|
70
|
+
themeTitle: result.themeTitle,
|
|
71
|
+
});
|
|
72
|
+
updatePackageFile(packageFileName, {
|
|
73
|
+
packageName: repoName,
|
|
74
|
+
});
|
|
75
|
+
return [2 /*return*/];
|
|
76
|
+
}
|
|
77
|
+
});
|
|
30
78
|
});
|
|
31
79
|
}
|
|
32
80
|
exports.setupTheme = setupTheme;
|
|
33
81
|
function updateStyleFile(file, opts) {
|
|
34
|
-
|
|
82
|
+
var contents = fs_1.default.readFileSync(file).toString();
|
|
35
83
|
contents = contents.replace(/(Theme Name:\s*)([^\n]+)/, "$1" + opts.themeTitle);
|
|
36
84
|
fs_1.default.writeFileSync(file, contents);
|
|
37
85
|
}
|
|
38
86
|
function updatePackageFile(file, opts) {
|
|
39
|
-
|
|
87
|
+
var packageData = JSON.parse(fs_1.default.readFileSync(file).toString());
|
|
40
88
|
packageData.name = opts.packageName;
|
|
41
89
|
fs_1.default.writeFileSync(file, JSON.stringify(packageData, null, " "));
|
|
42
90
|
}
|
package/components/AdminBar.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function AdminBar():
|
|
1
|
+
export declare function AdminBar(): JSX.Element;
|
package/components/AdminBar.js
CHANGED
|
@@ -1,43 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AdminBar = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
html,
|
|
7
|
-
html body,
|
|
8
|
-
* html body {
|
|
9
|
-
margin-top: 0 !important
|
|
10
|
-
}
|
|
11
|
-
html #wpadminbar{
|
|
12
|
-
opacity: 0;
|
|
13
|
-
-webkit-transition: all .3s ease;
|
|
14
|
-
transition: all .3s ease;
|
|
15
|
-
}
|
|
16
|
-
html #wpadminbar:hover{
|
|
17
|
-
opacity: 1;
|
|
18
|
-
}
|
|
19
|
-
html #wpadminbar{
|
|
20
|
-
top: -15px !important;
|
|
21
|
-
-webkit-transition-delay: 200ms;
|
|
22
|
-
transition-delay: 200ms;
|
|
23
|
-
}
|
|
24
|
-
html #wpadminbar:hover{
|
|
25
|
-
top: 0 !important
|
|
26
|
-
}
|
|
27
|
-
@media screen and (max-width: 782px){
|
|
28
|
-
html #wpadminbar{
|
|
29
|
-
top: -15px !important;
|
|
30
|
-
-webkit-transition-delay: 0;
|
|
31
|
-
transition-delay: 0;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
@media (max-width: 600px){
|
|
35
|
-
html #wpadminbar{
|
|
36
|
-
display: none !important;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
`;
|
|
4
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
var STYLE = "\n html,\n html body,\n * html body {\n margin-top: 0 !important\n }\n html #wpadminbar{\n opacity: 0;\n -webkit-transition: all .3s ease;\n transition: all .3s ease;\n }\n html #wpadminbar:hover{\n opacity: 1;\n }\n html #wpadminbar{\n top: -15px !important;\n -webkit-transition-delay: 200ms;\n transition-delay: 200ms;\n }\n html #wpadminbar:hover{\n top: 0 !important\n }\n @media screen and (max-width: 782px){\n html #wpadminbar{\n top: -15px !important;\n -webkit-transition-delay: 0;\n transition-delay: 0;\n }\n }\n @media (max-width: 600px){\n html #wpadminbar{\n display: none !important;\n }\n }\n";
|
|
40
6
|
function AdminBar() {
|
|
41
|
-
return (0, jsx_runtime_1.jsx)("style", { type: "text/css", dangerouslySetInnerHTML: { __html: STYLE } });
|
|
7
|
+
return (0, jsx_runtime_1.jsx)("style", { type: "text/css", dangerouslySetInnerHTML: { __html: STYLE } }, void 0);
|
|
42
8
|
}
|
|
43
9
|
exports.AdminBar = AdminBar;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
|
-
type Props = {
|
|
2
|
+
declare type Props = {
|
|
3
3
|
children: ReactNode;
|
|
4
4
|
};
|
|
5
|
-
export declare function BrowserRouter(props: Props):
|
|
5
|
+
export declare function BrowserRouter(props: Props): JSX.Element;
|
|
6
6
|
export {};
|
|
@@ -1,36 +1,47 @@
|
|
|
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
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
15
|
};
|
|
5
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
17
|
exports.BrowserRouter = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
18
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
var react_1 = require("react");
|
|
20
|
+
var remoteProps_1 = require("../routing/remoteProps");
|
|
21
|
+
var routing_1 = require("../routing");
|
|
11
22
|
// @ts-ignore
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
23
|
+
var views_1 = __importDefault(require("@manifest/views"));
|
|
24
|
+
var usePageLoad_1 = require("../hooks/usePageLoad");
|
|
25
|
+
var hooks_1 = require("../hooks");
|
|
26
|
+
var reportErrorStack_1 = require("../utils/reportErrorStack");
|
|
27
|
+
var updateEditLink_1 = require("../routing/updateEditLink");
|
|
28
|
+
var updateHeadTags_1 = require("../routing/updateHeadTags");
|
|
29
|
+
var useQueryDebug_1 = require("../hooks/useQueryDebug");
|
|
30
|
+
var hasPopulatedCache = false;
|
|
20
31
|
function BrowserRouter(props) {
|
|
21
|
-
|
|
22
|
-
|
|
32
|
+
var setAppData = (0, hooks_1.useAppDataStore)(function (s) { return s.setAppData; });
|
|
33
|
+
var _a = (0, react_1.useState)(function () {
|
|
23
34
|
setAppData(_PAGE_DATA.appData.data);
|
|
24
35
|
(0, useQueryDebug_1.setQueryDebug)(_PAGE_DATA.queryMonitor);
|
|
25
36
|
return {
|
|
26
37
|
url: document.location.href,
|
|
27
38
|
data: _PAGE_DATA,
|
|
28
39
|
};
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
(0, react_1.useEffect)(()
|
|
40
|
+
}), state = _a[0], setState = _a[1];
|
|
41
|
+
var url = state.url, data = state.data;
|
|
42
|
+
var _b = (0, react_1.useState)(null), pending = _b[0], setPendingUrl = _b[1];
|
|
43
|
+
var setIsLoading = (0, usePageLoad_1.usePageLoad)(function (s) { return s.setIsLoading; });
|
|
44
|
+
(0, react_1.useEffect)(function () {
|
|
34
45
|
if (data.errorStack) {
|
|
35
46
|
(0, reportErrorStack_1.reportErrorStack)(data.errorStack);
|
|
36
47
|
}
|
|
@@ -39,32 +50,34 @@ function BrowserRouter(props) {
|
|
|
39
50
|
hasPopulatedCache = true;
|
|
40
51
|
(0, remoteProps_1.setInitialProps)(url, data);
|
|
41
52
|
}
|
|
42
|
-
(0, react_1.useEffect)(()
|
|
53
|
+
(0, react_1.useEffect)(function () {
|
|
43
54
|
history.scrollRestoration = "manual";
|
|
44
55
|
}, []);
|
|
45
|
-
(0, react_1.useEffect)(()
|
|
46
|
-
|
|
47
|
-
|
|
56
|
+
(0, react_1.useEffect)(function () {
|
|
57
|
+
var handle = function (e) {
|
|
58
|
+
var _a;
|
|
59
|
+
setPendingUrl({ popped: true, url: document.location.href, scrollPosition: (_a = e.state) === null || _a === void 0 ? void 0 : _a.scrollPosition });
|
|
48
60
|
};
|
|
49
61
|
window.addEventListener("popstate", handle);
|
|
50
|
-
return ()
|
|
62
|
+
return function () {
|
|
51
63
|
window.removeEventListener("popstate", handle);
|
|
52
64
|
};
|
|
53
65
|
});
|
|
54
|
-
(0, react_1.useEffect)(()
|
|
66
|
+
(0, react_1.useEffect)(function () {
|
|
55
67
|
if (pending === null)
|
|
56
68
|
return;
|
|
57
|
-
|
|
69
|
+
var cancelled = false;
|
|
58
70
|
if (!(0, remoteProps_1.hasCachedProps)(pending.url)) {
|
|
59
71
|
setIsLoading(true);
|
|
60
72
|
}
|
|
61
|
-
(0, remoteProps_1.fetchProps)(pending.url).then((data)
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
73
|
+
(0, remoteProps_1.fetchProps)(pending.url).then(function (data) {
|
|
74
|
+
var view = views_1.default[data.view];
|
|
75
|
+
var nextUrl = data.canonical || pending.url;
|
|
76
|
+
var finish = function () {
|
|
77
|
+
var _a, _b;
|
|
65
78
|
setState({
|
|
66
79
|
url: nextUrl,
|
|
67
|
-
data,
|
|
80
|
+
data: data,
|
|
68
81
|
});
|
|
69
82
|
// setData(data)
|
|
70
83
|
if (data.queryMonitor) {
|
|
@@ -75,11 +88,11 @@ function BrowserRouter(props) {
|
|
|
75
88
|
}
|
|
76
89
|
if (data.editLink)
|
|
77
90
|
(0, updateEditLink_1.updateEditLink)(data.editLink);
|
|
78
|
-
if (data.meta
|
|
91
|
+
if ((_a = data.meta) === null || _a === void 0 ? void 0 : _a.head)
|
|
79
92
|
(0, updateHeadTags_1.updateHeadTags)(data.meta.head);
|
|
80
93
|
setIsLoading(false);
|
|
81
94
|
if (!pending.popped) {
|
|
82
|
-
history.replaceState({ scrollPosition: document.scrollingElement
|
|
95
|
+
history.replaceState({ scrollPosition: (_b = document.scrollingElement) === null || _b === void 0 ? void 0 : _b.scrollTop }, "", document.location.href);
|
|
83
96
|
history.pushState({}, "", nextUrl);
|
|
84
97
|
}
|
|
85
98
|
};
|
|
@@ -92,29 +105,29 @@ function BrowserRouter(props) {
|
|
|
92
105
|
}
|
|
93
106
|
}
|
|
94
107
|
});
|
|
95
|
-
return ()
|
|
108
|
+
return function () {
|
|
96
109
|
cancelled = true;
|
|
97
110
|
};
|
|
98
111
|
}, [pending]);
|
|
99
|
-
|
|
100
|
-
(0, react_1.useEffect)(()
|
|
112
|
+
var _c = (0, react_1.useState)({ value: null }), scrollPosition = _c[0], setScrollPosition = _c[1];
|
|
113
|
+
(0, react_1.useEffect)(function () {
|
|
101
114
|
if (document.scrollingElement && typeof scrollPosition.value === "number") {
|
|
102
115
|
document.scrollingElement.scrollTop = scrollPosition.value;
|
|
103
116
|
}
|
|
104
117
|
}, [scrollPosition]);
|
|
105
|
-
return ((0, jsx_runtime_1.jsx)(routing_1.RouterRoot, { url: url, data: data, onNavigateRequest: (url)
|
|
106
|
-
setPendingUrl({ popped: false, url });
|
|
107
|
-
}, onPreload: (url)
|
|
118
|
+
return ((0, jsx_runtime_1.jsx)(routing_1.RouterRoot, __assign({ url: url, data: data, onNavigateRequest: function (url) {
|
|
119
|
+
setPendingUrl({ popped: false, url: url });
|
|
120
|
+
}, onPreload: function (url) {
|
|
108
121
|
if ((0, remoteProps_1.isSameOrigin)(url)) {
|
|
109
122
|
(0, remoteProps_1.fetchProps)(url);
|
|
110
123
|
}
|
|
111
|
-
}, onNavigated: ()
|
|
124
|
+
}, onNavigated: function () {
|
|
112
125
|
if (pending && typeof pending.scrollPosition === "number") {
|
|
113
126
|
setScrollPosition({ value: pending.scrollPosition });
|
|
114
127
|
}
|
|
115
128
|
else {
|
|
116
129
|
setScrollPosition({ value: 0 });
|
|
117
130
|
}
|
|
118
|
-
}, children: props.children }));
|
|
131
|
+
} }, { children: props.children }), void 0));
|
|
119
132
|
}
|
|
120
133
|
exports.BrowserRouter = BrowserRouter;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactElement } from "react";
|
|
2
|
-
type Props = {
|
|
2
|
+
declare type Props = {
|
|
3
3
|
url: string;
|
|
4
4
|
fallback?: ReactElement;
|
|
5
5
|
};
|
|
@@ -7,5 +7,5 @@ type Props = {
|
|
|
7
7
|
* Renders an entire page view
|
|
8
8
|
* @param props
|
|
9
9
|
*/
|
|
10
|
-
export declare function InlinePage(props: Props):
|
|
10
|
+
export declare function InlinePage(props: Props): JSX.Element;
|
|
11
11
|
export {};
|
package/components/InlinePage.js
CHANGED
|
@@ -1,33 +1,45 @@
|
|
|
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
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
15
|
};
|
|
5
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
17
|
exports.InlinePage = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
18
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
var react_1 = require("react");
|
|
20
|
+
var remoteProps_1 = require("../routing/remoteProps");
|
|
21
|
+
var routing_1 = require("../routing");
|
|
11
22
|
// @ts-ignore
|
|
12
|
-
|
|
23
|
+
var views_1 = __importDefault(require("@manifest/views"));
|
|
13
24
|
/**
|
|
14
25
|
* Renders an entire page view
|
|
15
26
|
* @param props
|
|
16
27
|
*/
|
|
17
28
|
function InlinePage(props) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
(0, react_1.
|
|
29
|
+
var _a;
|
|
30
|
+
var _b = (0, react_1.useState)(undefined), data = _b[0], setData = _b[1];
|
|
31
|
+
var _c = (0, react_1.useState)(true), isLoading = _c[0], setIsLoading = _c[1];
|
|
32
|
+
var _d = (0, react_1.useState)([null]), Component = _d[0][0], setComponent = _d[1];
|
|
33
|
+
(0, react_1.useEffect)(function () {
|
|
22
34
|
if (!props.url)
|
|
23
35
|
return;
|
|
24
|
-
|
|
36
|
+
var cancelled = false;
|
|
25
37
|
if (!(0, remoteProps_1.hasCachedProps)(props.url)) {
|
|
26
38
|
setIsLoading(true);
|
|
27
39
|
}
|
|
28
|
-
(0, remoteProps_1.fetchProps)(props.url).then((data)
|
|
29
|
-
|
|
30
|
-
|
|
40
|
+
(0, remoteProps_1.fetchProps)(props.url).then(function (data) {
|
|
41
|
+
var view = views_1.default[data.view];
|
|
42
|
+
var finish = function () {
|
|
31
43
|
setData(data);
|
|
32
44
|
setIsLoading(false);
|
|
33
45
|
setComponent([view]);
|
|
@@ -41,18 +53,18 @@ function InlinePage(props) {
|
|
|
41
53
|
}
|
|
42
54
|
}
|
|
43
55
|
});
|
|
44
|
-
return ()
|
|
56
|
+
return function () {
|
|
45
57
|
cancelled = true;
|
|
46
58
|
};
|
|
47
59
|
}, [props.url]);
|
|
48
|
-
|
|
60
|
+
var routeItem = (0, react_1.useMemo)(function () {
|
|
49
61
|
return (0, routing_1.createRouteItem)(props.url, data);
|
|
50
62
|
}, [data, props.url]);
|
|
51
63
|
if (isLoading || !Component) {
|
|
52
|
-
return props.fallback || (0, jsx_runtime_1.jsx)(react_1.Fragment, {});
|
|
64
|
+
return props.fallback || (0, jsx_runtime_1.jsx)(react_1.Fragment, {}, void 0);
|
|
53
65
|
}
|
|
54
66
|
else {
|
|
55
|
-
return ((0, jsx_runtime_1.jsx)(routing_1.RouteItemContext, { route: routeItem, children: (0, jsx_runtime_1.jsx)(Component, {
|
|
67
|
+
return ((0, jsx_runtime_1.jsx)(routing_1.RouteItemContext, __assign({ route: routeItem }, { children: (0, jsx_runtime_1.jsx)(Component, __assign({}, (_a = data === null || data === void 0 ? void 0 : data.viewData) === null || _a === void 0 ? void 0 : _a.data), void 0) }), void 0));
|
|
56
68
|
}
|
|
57
69
|
}
|
|
58
70
|
exports.InlinePage = InlinePage;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import { RouteData } from "../routing/remoteProps";
|
|
3
|
-
type Props = {
|
|
3
|
+
declare type Props = {
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
path: string;
|
|
6
6
|
data: RouteData;
|
|
7
7
|
};
|
|
8
|
-
export declare function NextRouter({ children, path, data }: Props):
|
|
8
|
+
export declare function NextRouter({ children, path, data }: Props): JSX.Element;
|
|
9
9
|
export {};
|
package/components/NextRouter.js
CHANGED
|
@@ -1,36 +1,45 @@
|
|
|
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.NextRouter = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
function NextRouter(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
router_1.Router.events.on("
|
|
18
|
-
router_1.Router.events.on("routeChangeComplete", () => setIsLoading(false));
|
|
19
|
-
router_1.Router.events.on("routeChangeError", () => setIsLoading(false));
|
|
15
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
var routing_1 = require("../routing");
|
|
17
|
+
var router_1 = require("next/router");
|
|
18
|
+
var react_1 = require("react");
|
|
19
|
+
var hooks_1 = require("../hooks");
|
|
20
|
+
function NextRouter(_a) {
|
|
21
|
+
var children = _a.children, path = _a.path, data = _a.data;
|
|
22
|
+
var nextRoute = (0, router_1.useRouter)();
|
|
23
|
+
var setIsLoading = (0, hooks_1.usePageLoad)(function (s) { return s.setIsLoading; });
|
|
24
|
+
var route = __assign(__assign({}, nextRoute), { pathname: nextRoute.asPath });
|
|
25
|
+
(0, react_1.useEffect)(function () {
|
|
26
|
+
router_1.Router.events.on("routeChangeStart", function () { return setIsLoading(true); });
|
|
27
|
+
router_1.Router.events.on("routeChangeComplete", function () { return setIsLoading(false); });
|
|
28
|
+
router_1.Router.events.on("routeChangeError", function () { return setIsLoading(false); });
|
|
20
29
|
}, []);
|
|
21
|
-
return ((0, jsx_runtime_1.jsx)(routing_1.RouterRoot, { url: nextRoute.asPath, data: data, onNavigateRequest: (url)
|
|
30
|
+
return ((0, jsx_runtime_1.jsx)(routing_1.RouterRoot, __assign({ url: nextRoute.asPath, data: data, onNavigateRequest: function (url) {
|
|
22
31
|
route.push(url);
|
|
23
32
|
// setPendingUrl({ popped: false, url })
|
|
24
|
-
}, onPreload: (url)
|
|
33
|
+
}, onPreload: function (url) {
|
|
25
34
|
// if (isSameOrigin(url)) {
|
|
26
35
|
// fetchProps(url)
|
|
27
36
|
// }
|
|
28
|
-
}, onNavigated: ()
|
|
37
|
+
}, onNavigated: function () {
|
|
29
38
|
// if (pending && typeof pending.scrollPosition === "number") {
|
|
30
39
|
// setScrollPosition({ value: pending.scrollPosition })
|
|
31
40
|
// } else {
|
|
32
41
|
// setScrollPosition({ value: 0 })
|
|
33
42
|
// }
|
|
34
|
-
}, children: children }));
|
|
43
|
+
} }, { children: children }), void 0));
|
|
35
44
|
}
|
|
36
45
|
exports.NextRouter = NextRouter;
|
package/components/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/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
|
+
var 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
|
+
var fs_1 = require("fs");
|
|
8
|
+
var zod_to_json_schema_1 = __importDefault(require("zod-to-json-schema"));
|
|
9
|
+
var config_schema_1 = require("./config-schema");
|
|
10
10
|
function createConfigSchemaFile(location) {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
var schema = (0, zod_to_json_schema_1.default)(config_schema_1.EDConfigSchema);
|
|
12
|
+
var content = JSON.stringify(schema, null, 2);
|
|
13
13
|
if ((0, fs_1.existsSync)(location)) {
|
|
14
|
-
|
|
14
|
+
var existingContent = (0, fs_1.readFileSync)(location).toString();
|
|
15
15
|
if (existingContent === content)
|
|
16
16
|
return;
|
|
17
17
|
}
|