@weaverse/hydrogen 5.8.0 → 5.8.1
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/dist/index.d.mts +11 -12
- package/dist/index.d.ts +11 -12
- package/dist/index.js +45 -41
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +46 -42
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -4,7 +4,8 @@ export { PositionInputValue, WeaverseImage, WeaverseVideo, isBrowser, isIframe,
|
|
|
4
4
|
import { PageType, InspectorGroup, SchemaType, ComponentPresets, SchemaValidationResult } from '@weaverse/schema';
|
|
5
5
|
export * from '@weaverse/schema';
|
|
6
6
|
export { BasicInput, HeadingInput, InputType, InspectorGroup, PageType, SchemaValidationIssue, SchemaValidationResult } from '@weaverse/schema';
|
|
7
|
-
import { createWithCache, I18nBase, HydrogenContext, HydrogenEnv } from '@shopify/hydrogen';
|
|
7
|
+
import { createWithCache, CachingStrategy, I18nBase, HydrogenContext, HydrogenEnv } from '@shopify/hydrogen';
|
|
8
|
+
export { CachingStrategy } from '@shopify/hydrogen';
|
|
8
9
|
import { LoaderFunctionArgs, AppLoadContext } from '@shopify/remix-oxygen';
|
|
9
10
|
import * as React$1 from 'react';
|
|
10
11
|
import { ComponentType, JSX, ForwardRefExoticComponent } from 'react';
|
|
@@ -164,21 +165,14 @@ declare class WeaverseClient {
|
|
|
164
165
|
private isLocalhost;
|
|
165
166
|
private getApiUrl;
|
|
166
167
|
fetchWithCache: <T = unknown>(url: string, options?: RequestInit & {
|
|
167
|
-
strategy?:
|
|
168
|
+
strategy?: CachingStrategy;
|
|
168
169
|
}) => Promise<T>;
|
|
169
|
-
loadThemeSettings: (strategy?:
|
|
170
|
+
loadThemeSettings: (strategy?: CachingStrategy) => Promise<ThemeSettingsResponse>;
|
|
170
171
|
generateFallbackPage: (message: string) => HydrogenPageData;
|
|
171
172
|
loadPage: (params?: LoadPageParams) => Promise<WeaverseLoaderData | null>;
|
|
172
173
|
execComponentLoader: (item: HydrogenComponentData) => Promise<HydrogenComponentData>;
|
|
173
174
|
}
|
|
174
175
|
|
|
175
|
-
type AllCacheOptions = {
|
|
176
|
-
mode?: 'must-revalidate' | 'no-cache' | 'no-store' | 'private' | 'public' | string;
|
|
177
|
-
maxAge?: number;
|
|
178
|
-
staleWhileRevalidate?: number;
|
|
179
|
-
sMaxAge?: number;
|
|
180
|
-
staleIfError?: number;
|
|
181
|
-
};
|
|
182
176
|
type ComponentLoaderArgs<T = any, _E = any> = {
|
|
183
177
|
data: T;
|
|
184
178
|
weaverse: WeaverseClient;
|
|
@@ -294,6 +288,11 @@ type HydrogenPageAssignment = {
|
|
|
294
288
|
type: PageType;
|
|
295
289
|
handle: string;
|
|
296
290
|
locale: string;
|
|
291
|
+
meta?: {
|
|
292
|
+
inherited: boolean;
|
|
293
|
+
sourceProjectId: string;
|
|
294
|
+
depth: number;
|
|
295
|
+
};
|
|
297
296
|
};
|
|
298
297
|
type WeaverseLoaderData = {
|
|
299
298
|
configs: Omit<WeaverseProjectConfigs, 'publicEnv'> & {
|
|
@@ -655,7 +654,7 @@ type LoadPageParams = {
|
|
|
655
654
|
* - Long-lived cache for static pages (1 hour+)
|
|
656
655
|
* - Short-lived cache for frequently updated content (5 minutes)
|
|
657
656
|
*/
|
|
658
|
-
strategy?:
|
|
657
|
+
strategy?: CachingStrategy;
|
|
659
658
|
/**
|
|
660
659
|
* Optional project override for this specific page load.
|
|
661
660
|
*
|
|
@@ -775,4 +774,4 @@ declare const IMAGES_PLACEHOLDERS: {
|
|
|
775
774
|
product_18: string;
|
|
776
775
|
};
|
|
777
776
|
|
|
778
|
-
export { type
|
|
777
|
+
export { type CacheResponseValidator, type ComponentLoaderArgs, type CreateHydrogenSchemaOptions, type DirectFetchResponse, type FetchProjectPayload, type FetchProjectRequestBody, type HydrogenComponent, type HydrogenComponentData, type HydrogenComponentPresets, type HydrogenComponentProps, type HydrogenComponentSchema, type HydrogenElement, type HydrogenPageAssignment, type HydrogenPageData, type HydrogenProjectType, type HydrogenSchemaValidationResult, type HydrogenThemeSchema, type HydrogenThemeSettings, IMAGES_PLACEHOLDERS, type LoadPageParams, type ProjectIdValidationResult, type ProjectIdValue, type PublicEnv, type RouteLoaderArgs, type ThemeSettingsResponse, type WeaverseArticle, type WeaverseBlog, WeaverseClient, type WeaverseClientArgs, type WeaverseCollection, type WeaverseDataContext, WeaverseError, WeaverseHydrogen, WeaverseHydrogenItem, type WeaverseHydrogenParams, WeaverseHydrogenRoot, type WeaverseI18n, type WeaverseInternal, type WeaverseLoaderData, type WeaverseLoaderRequestInfo, type WeaverseMetaObject, type WeaverseProduct, type WeaverseProjectConfigs, type WeaverseStudioQueries, type WithCacheFetchResponse, createWeaverseDataContext, defaultComponents, generateDataFromSchema, getPreviewData, getRequestQueries, getSelectedProductOptions, getWeaverseConfigs, hasError, isFetchProjectPayload, isProjectIdFunction, isThemeSettingsResponse, isValidHydrogenSchema, isWithCacheFetchResponse, registerComponent, useThemeSettings, useWeaverseDataContext, withWeaverse };
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,8 @@ export { PositionInputValue, WeaverseImage, WeaverseVideo, isBrowser, isIframe,
|
|
|
4
4
|
import { PageType, InspectorGroup, SchemaType, ComponentPresets, SchemaValidationResult } from '@weaverse/schema';
|
|
5
5
|
export * from '@weaverse/schema';
|
|
6
6
|
export { BasicInput, HeadingInput, InputType, InspectorGroup, PageType, SchemaValidationIssue, SchemaValidationResult } from '@weaverse/schema';
|
|
7
|
-
import { createWithCache, I18nBase, HydrogenContext, HydrogenEnv } from '@shopify/hydrogen';
|
|
7
|
+
import { createWithCache, CachingStrategy, I18nBase, HydrogenContext, HydrogenEnv } from '@shopify/hydrogen';
|
|
8
|
+
export { CachingStrategy } from '@shopify/hydrogen';
|
|
8
9
|
import { LoaderFunctionArgs, AppLoadContext } from '@shopify/remix-oxygen';
|
|
9
10
|
import * as React$1 from 'react';
|
|
10
11
|
import { ComponentType, JSX, ForwardRefExoticComponent } from 'react';
|
|
@@ -164,21 +165,14 @@ declare class WeaverseClient {
|
|
|
164
165
|
private isLocalhost;
|
|
165
166
|
private getApiUrl;
|
|
166
167
|
fetchWithCache: <T = unknown>(url: string, options?: RequestInit & {
|
|
167
|
-
strategy?:
|
|
168
|
+
strategy?: CachingStrategy;
|
|
168
169
|
}) => Promise<T>;
|
|
169
|
-
loadThemeSettings: (strategy?:
|
|
170
|
+
loadThemeSettings: (strategy?: CachingStrategy) => Promise<ThemeSettingsResponse>;
|
|
170
171
|
generateFallbackPage: (message: string) => HydrogenPageData;
|
|
171
172
|
loadPage: (params?: LoadPageParams) => Promise<WeaverseLoaderData | null>;
|
|
172
173
|
execComponentLoader: (item: HydrogenComponentData) => Promise<HydrogenComponentData>;
|
|
173
174
|
}
|
|
174
175
|
|
|
175
|
-
type AllCacheOptions = {
|
|
176
|
-
mode?: 'must-revalidate' | 'no-cache' | 'no-store' | 'private' | 'public' | string;
|
|
177
|
-
maxAge?: number;
|
|
178
|
-
staleWhileRevalidate?: number;
|
|
179
|
-
sMaxAge?: number;
|
|
180
|
-
staleIfError?: number;
|
|
181
|
-
};
|
|
182
176
|
type ComponentLoaderArgs<T = any, _E = any> = {
|
|
183
177
|
data: T;
|
|
184
178
|
weaverse: WeaverseClient;
|
|
@@ -294,6 +288,11 @@ type HydrogenPageAssignment = {
|
|
|
294
288
|
type: PageType;
|
|
295
289
|
handle: string;
|
|
296
290
|
locale: string;
|
|
291
|
+
meta?: {
|
|
292
|
+
inherited: boolean;
|
|
293
|
+
sourceProjectId: string;
|
|
294
|
+
depth: number;
|
|
295
|
+
};
|
|
297
296
|
};
|
|
298
297
|
type WeaverseLoaderData = {
|
|
299
298
|
configs: Omit<WeaverseProjectConfigs, 'publicEnv'> & {
|
|
@@ -655,7 +654,7 @@ type LoadPageParams = {
|
|
|
655
654
|
* - Long-lived cache for static pages (1 hour+)
|
|
656
655
|
* - Short-lived cache for frequently updated content (5 minutes)
|
|
657
656
|
*/
|
|
658
|
-
strategy?:
|
|
657
|
+
strategy?: CachingStrategy;
|
|
659
658
|
/**
|
|
660
659
|
* Optional project override for this specific page load.
|
|
661
660
|
*
|
|
@@ -775,4 +774,4 @@ declare const IMAGES_PLACEHOLDERS: {
|
|
|
775
774
|
product_18: string;
|
|
776
775
|
};
|
|
777
776
|
|
|
778
|
-
export { type
|
|
777
|
+
export { type CacheResponseValidator, type ComponentLoaderArgs, type CreateHydrogenSchemaOptions, type DirectFetchResponse, type FetchProjectPayload, type FetchProjectRequestBody, type HydrogenComponent, type HydrogenComponentData, type HydrogenComponentPresets, type HydrogenComponentProps, type HydrogenComponentSchema, type HydrogenElement, type HydrogenPageAssignment, type HydrogenPageData, type HydrogenProjectType, type HydrogenSchemaValidationResult, type HydrogenThemeSchema, type HydrogenThemeSettings, IMAGES_PLACEHOLDERS, type LoadPageParams, type ProjectIdValidationResult, type ProjectIdValue, type PublicEnv, type RouteLoaderArgs, type ThemeSettingsResponse, type WeaverseArticle, type WeaverseBlog, WeaverseClient, type WeaverseClientArgs, type WeaverseCollection, type WeaverseDataContext, WeaverseError, WeaverseHydrogen, WeaverseHydrogenItem, type WeaverseHydrogenParams, WeaverseHydrogenRoot, type WeaverseI18n, type WeaverseInternal, type WeaverseLoaderData, type WeaverseLoaderRequestInfo, type WeaverseMetaObject, type WeaverseProduct, type WeaverseProjectConfigs, type WeaverseStudioQueries, type WithCacheFetchResponse, createWeaverseDataContext, defaultComponents, generateDataFromSchema, getPreviewData, getRequestQueries, getSelectedProductOptions, getWeaverseConfigs, hasError, isFetchProjectPayload, isProjectIdFunction, isThemeSettingsResponse, isValidHydrogenSchema, isWithCacheFetchResponse, registerComponent, useThemeSettings, useWeaverseDataContext, withWeaverse };
|
package/dist/index.js
CHANGED
|
@@ -590,8 +590,11 @@ var WeaverseClient = class {
|
|
|
590
590
|
* Throws WeaverseError if projectId cannot be resolved.
|
|
591
591
|
*/
|
|
592
592
|
initializeConfigs(args) {
|
|
593
|
-
|
|
594
|
-
|
|
593
|
+
const baseConfigs = getWeaverseConfigs(
|
|
594
|
+
args.request,
|
|
595
|
+
args.env
|
|
596
|
+
);
|
|
597
|
+
const resolvedProjectId = this.resolveProjectIdSync(
|
|
595
598
|
args.projectId,
|
|
596
599
|
args.request,
|
|
597
600
|
args.env,
|
|
@@ -690,7 +693,7 @@ var WeaverseClient = class {
|
|
|
690
693
|
error: "Project ID cannot be empty"
|
|
691
694
|
};
|
|
692
695
|
}
|
|
693
|
-
|
|
696
|
+
const validPattern = /^[a-zA-Z0-9_-]+$/;
|
|
694
697
|
if (!validPattern.test(projectId)) {
|
|
695
698
|
return {
|
|
696
699
|
valid: false,
|
|
@@ -717,7 +720,7 @@ var WeaverseClient = class {
|
|
|
717
720
|
* Used for design mode and preview mode overrides.
|
|
718
721
|
*/
|
|
719
722
|
resolveFromQueryParams(request) {
|
|
720
|
-
|
|
723
|
+
const queries = getRequestQueries(request);
|
|
721
724
|
return queries.weaverseProjectId || null;
|
|
722
725
|
}
|
|
723
726
|
/**
|
|
@@ -735,7 +738,7 @@ var WeaverseClient = class {
|
|
|
735
738
|
);
|
|
736
739
|
}
|
|
737
740
|
try {
|
|
738
|
-
|
|
741
|
+
const result = projectId();
|
|
739
742
|
if (result instanceof Promise) {
|
|
740
743
|
throw new WeaverseError(
|
|
741
744
|
"Async projectId functions must be awaited before passing to WeaverseClient. Use: projectId: await getProjectAsync() instead of: projectId: getProjectAsync",
|
|
@@ -743,8 +746,8 @@ var WeaverseClient = class {
|
|
|
743
746
|
);
|
|
744
747
|
}
|
|
745
748
|
if (result && result.trim() !== "") {
|
|
746
|
-
|
|
747
|
-
|
|
749
|
+
const trimmed = result.trim();
|
|
750
|
+
const validation = this.validateProjectId(trimmed);
|
|
748
751
|
if (validation.valid) {
|
|
749
752
|
return trimmed;
|
|
750
753
|
}
|
|
@@ -773,11 +776,11 @@ var WeaverseClient = class {
|
|
|
773
776
|
if (typeof projectId !== "string") {
|
|
774
777
|
return null;
|
|
775
778
|
}
|
|
776
|
-
|
|
779
|
+
const trimmed = projectId.trim();
|
|
777
780
|
if (trimmed === "") {
|
|
778
781
|
return null;
|
|
779
782
|
}
|
|
780
|
-
|
|
783
|
+
const validation = this.validateProjectId(trimmed);
|
|
781
784
|
if (validation.valid) {
|
|
782
785
|
return trimmed;
|
|
783
786
|
}
|
|
@@ -790,7 +793,7 @@ var WeaverseClient = class {
|
|
|
790
793
|
* Priority 4: Resolve projectId from environment variables.
|
|
791
794
|
*/
|
|
792
795
|
resolveFromEnvironment(baseConfigs, request, env) {
|
|
793
|
-
|
|
796
|
+
const configs = baseConfigs || getWeaverseConfigs(request, env);
|
|
794
797
|
if (configs.projectId && configs.projectId.trim() !== "") {
|
|
795
798
|
return configs.projectId.trim();
|
|
796
799
|
}
|
|
@@ -802,18 +805,18 @@ var WeaverseClient = class {
|
|
|
802
805
|
* Includes 10-second timeout to prevent hanging requests.
|
|
803
806
|
*/
|
|
804
807
|
directFetch = async (url, options = {}, timeoutMs = this.fetchTimeoutMs) => {
|
|
805
|
-
|
|
806
|
-
|
|
808
|
+
const controller = new AbortController();
|
|
809
|
+
const timeoutId = setTimeout(
|
|
807
810
|
() => controller.abort(),
|
|
808
811
|
timeoutMs
|
|
809
812
|
);
|
|
810
813
|
try {
|
|
811
|
-
|
|
814
|
+
const response = await fetch(url, {
|
|
812
815
|
...options,
|
|
813
816
|
signal: controller.signal
|
|
814
817
|
});
|
|
815
818
|
if (!response.ok) {
|
|
816
|
-
|
|
819
|
+
const errorText = await response.text();
|
|
817
820
|
throw new WeaverseError(
|
|
818
821
|
`HTTP ${response.status}: ${response.statusText}`,
|
|
819
822
|
"FETCH_ERROR",
|
|
@@ -821,7 +824,7 @@ var WeaverseClient = class {
|
|
|
821
824
|
{ url, errorText }
|
|
822
825
|
);
|
|
823
826
|
}
|
|
824
|
-
|
|
827
|
+
const data = await response.json();
|
|
825
828
|
return { data, response };
|
|
826
829
|
} catch (err) {
|
|
827
830
|
if (err instanceof WeaverseError) {
|
|
@@ -849,7 +852,7 @@ var WeaverseClient = class {
|
|
|
849
852
|
};
|
|
850
853
|
// Helper method to detect if request is from localhost
|
|
851
854
|
isLocalhost() {
|
|
852
|
-
|
|
855
|
+
const hostname = this.parsedUrl.hostname;
|
|
853
856
|
return hostname === "localhost" || hostname === "127.0.0.1";
|
|
854
857
|
}
|
|
855
858
|
// Helper method for building API URLs consistently
|
|
@@ -861,7 +864,7 @@ var WeaverseClient = class {
|
|
|
861
864
|
return `${weaverseHost}/api/public/${endpoint}`;
|
|
862
865
|
}
|
|
863
866
|
fetchWithCache = async (url, options = {}) => {
|
|
864
|
-
const strategy = options.strategy ||
|
|
867
|
+
const strategy = options.strategy || hydrogen.CacheCustom(DEFAULT_CACHE_STRATEGY);
|
|
865
868
|
const cacheKey = [
|
|
866
869
|
"weaverse-fetch",
|
|
867
870
|
url,
|
|
@@ -885,15 +888,15 @@ var WeaverseClient = class {
|
|
|
885
888
|
return result.data;
|
|
886
889
|
};
|
|
887
890
|
loadThemeSettings = async (strategy) => {
|
|
888
|
-
|
|
891
|
+
const defaultThemeSettings = generateDataFromSchema(this.themeSchema);
|
|
889
892
|
try {
|
|
890
|
-
|
|
891
|
-
|
|
893
|
+
const { configs } = this;
|
|
894
|
+
const { projectId, isDesignMode } = configs;
|
|
892
895
|
if (!projectId) {
|
|
893
896
|
throw new Error("Missing Weaverse projectId!");
|
|
894
897
|
}
|
|
895
|
-
|
|
896
|
-
|
|
898
|
+
const url = this.getApiUrl("project_configs");
|
|
899
|
+
const body = JSON.stringify({ isDesignMode, projectId });
|
|
897
900
|
let data = await this.fetchWithCache(url, {
|
|
898
901
|
method: "POST",
|
|
899
902
|
strategy,
|
|
@@ -949,8 +952,8 @@ var WeaverseClient = class {
|
|
|
949
952
|
}
|
|
950
953
|
return data;
|
|
951
954
|
} catch (error) {
|
|
952
|
-
|
|
953
|
-
|
|
955
|
+
const errorMessage = "Unable to load theme settings";
|
|
956
|
+
const errorDetails = this.extractErrorMessage(error);
|
|
954
957
|
console.error(errorMessage, errorDetails);
|
|
955
958
|
return {
|
|
956
959
|
theme: defaultThemeSettings,
|
|
@@ -960,7 +963,7 @@ var WeaverseClient = class {
|
|
|
960
963
|
}
|
|
961
964
|
};
|
|
962
965
|
generateFallbackPage = (message) => {
|
|
963
|
-
|
|
966
|
+
const rootId = crypto.randomUUID();
|
|
964
967
|
return {
|
|
965
968
|
id: `fallback_page_${Date.now()}`,
|
|
966
969
|
rootId,
|
|
@@ -976,8 +979,8 @@ var WeaverseClient = class {
|
|
|
976
979
|
};
|
|
977
980
|
loadPage = async (params = {}) => {
|
|
978
981
|
try {
|
|
979
|
-
|
|
980
|
-
|
|
982
|
+
const { request, storefront, basePageRequestBody, basePageConfigs } = this;
|
|
983
|
+
const {
|
|
981
984
|
projectId: clientProjectId,
|
|
982
985
|
weaverseHost,
|
|
983
986
|
isPreviewMode,
|
|
@@ -990,7 +993,7 @@ var WeaverseClient = class {
|
|
|
990
993
|
);
|
|
991
994
|
return null;
|
|
992
995
|
}
|
|
993
|
-
|
|
996
|
+
const validation = this.validateProjectId(params.projectId);
|
|
994
997
|
if (!validation.valid) {
|
|
995
998
|
console.error(
|
|
996
999
|
`Route-level projectId validation failed: ${validation.error}`
|
|
@@ -998,22 +1001,22 @@ var WeaverseClient = class {
|
|
|
998
1001
|
return null;
|
|
999
1002
|
}
|
|
1000
1003
|
}
|
|
1001
|
-
|
|
1004
|
+
const effectiveProjectId = params.projectId || clientProjectId;
|
|
1002
1005
|
if (isPreviewMode) {
|
|
1003
1006
|
return getPreviewData(sectionType || "", this.components, weaverseHost);
|
|
1004
1007
|
}
|
|
1005
1008
|
if (!effectiveProjectId) {
|
|
1006
1009
|
throw new Error("Missing Weaverse projectId!");
|
|
1007
1010
|
}
|
|
1008
|
-
|
|
1009
|
-
|
|
1011
|
+
const { strategy, ...pageLoadParams } = params;
|
|
1012
|
+
const body = {
|
|
1010
1013
|
...basePageRequestBody,
|
|
1011
1014
|
projectId: effectiveProjectId,
|
|
1012
1015
|
// Use effective (potentially overridden) projectId
|
|
1013
1016
|
params: pageLoadParams,
|
|
1014
1017
|
url: request.url
|
|
1015
1018
|
};
|
|
1016
|
-
|
|
1019
|
+
const reqInit = {
|
|
1017
1020
|
method: "POST",
|
|
1018
1021
|
body: JSON.stringify(body),
|
|
1019
1022
|
headers: {
|
|
@@ -1022,14 +1025,15 @@ var WeaverseClient = class {
|
|
|
1022
1025
|
"Accept-Encoding": "gzip, deflate, br"
|
|
1023
1026
|
}
|
|
1024
1027
|
};
|
|
1025
|
-
|
|
1026
|
-
|
|
1028
|
+
const url = this.getApiUrl("project");
|
|
1029
|
+
const projectData = await this.fetchWithCache(url, {
|
|
1027
1030
|
...reqInit,
|
|
1028
1031
|
strategy
|
|
1029
1032
|
});
|
|
1030
1033
|
if (hasError(projectData)) {
|
|
1031
1034
|
throw new Error(projectData.error);
|
|
1032
1035
|
}
|
|
1036
|
+
console.log("projectData", projectData);
|
|
1033
1037
|
let page;
|
|
1034
1038
|
let project;
|
|
1035
1039
|
let pageAssignment;
|
|
@@ -1042,7 +1046,7 @@ var WeaverseClient = class {
|
|
|
1042
1046
|
"Invalid project data structure received from API, using fallback data",
|
|
1043
1047
|
{ projectId: effectiveProjectId }
|
|
1044
1048
|
);
|
|
1045
|
-
|
|
1049
|
+
const responseData = projectData;
|
|
1046
1050
|
page = responseData?.page;
|
|
1047
1051
|
project = responseData?.project;
|
|
1048
1052
|
pageAssignment = responseData?.pageAssignment;
|
|
@@ -1059,7 +1063,7 @@ var WeaverseClient = class {
|
|
|
1059
1063
|
page = this.generateFallbackPage("Please add new section to start.");
|
|
1060
1064
|
}
|
|
1061
1065
|
if (page?.items) {
|
|
1062
|
-
|
|
1066
|
+
const items = page.items;
|
|
1063
1067
|
page.items = await Promise.all(items.map(this.execComponentLoader));
|
|
1064
1068
|
}
|
|
1065
1069
|
return {
|
|
@@ -1077,8 +1081,8 @@ var WeaverseClient = class {
|
|
|
1077
1081
|
}
|
|
1078
1082
|
};
|
|
1079
1083
|
} catch (error) {
|
|
1080
|
-
|
|
1081
|
-
|
|
1084
|
+
const errorMessage = "\u274C Page load failed";
|
|
1085
|
+
const errorContext = {
|
|
1082
1086
|
url: this.request.url,
|
|
1083
1087
|
projectId: params.projectId || this.configs.projectId
|
|
1084
1088
|
};
|
|
@@ -1105,9 +1109,9 @@ var WeaverseClient = class {
|
|
|
1105
1109
|
}
|
|
1106
1110
|
};
|
|
1107
1111
|
execComponentLoader = async (item) => {
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1112
|
+
const { data = {}, type, id } = item;
|
|
1113
|
+
const component = this.componentsByType.get(type);
|
|
1114
|
+
const loader = component?.loader;
|
|
1111
1115
|
if (typeof loader === "function" && component) {
|
|
1112
1116
|
try {
|
|
1113
1117
|
return {
|