@replohq/canopy-sdk 0.12.0 → 0.14.0
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/_vendor/replo-utils/lib/errors.d.ts +83 -0
- package/_vendor/replo-utils/lib/fonts.mjs +2 -40
- package/_vendor/replo-utils/lib/json.mjs +1 -1
- package/_vendor/replo-utils/lib/misc.mjs +2 -2
- package/_vendor/schemas/agentTools/customIntegrations/loaders/levanta.d.ts +49 -0
- package/_vendor/schemas/agentTools/customIntegrations/loaders/levanta.mjs +36 -0
- package/_vendor/schemas/agentTools/customIntegrations/loaders/product.d.ts +340 -0
- package/_vendor/schemas/agentTools/customIntegrations/loaders/product.mjs +51 -0
- package/_vendor/schemas/agentTools/customIntegrations/loaders/yotpo.d.ts +37 -0
- package/_vendor/schemas/agentTools/customIntegrations/loaders/yotpo.mjs +37 -0
- package/{cart/cart-schema.js → _vendor/schemas/cart.mjs} +17 -26
- package/_vendor/schemas/designLibrary.d.ts +4 -4
- package/_vendor/schemas/errors.d.ts +438 -0
- package/_vendor/schemas/errors.mjs +932 -0
- package/_vendor/schemas/generated/errors.d.ts +61 -0
- package/_vendor/schemas/generated/selectMode.d.ts +102 -0
- package/{loaders/loader-keys.d.ts → _vendor/schemas/loaderKeys.d.ts} +4 -4
- package/{loaders/loader-keys.js → _vendor/schemas/loaderKeys.mjs} +7 -8
- package/_vendor/schemas/objectType.d.ts +1038 -0
- package/_vendor/schemas/objectType.mjs +2 -0
- package/_vendor/schemas/registry.d.ts +539 -0
- package/_vendor/schemas/sandboxFiles.d.ts +36 -0
- package/_vendor/schemas/savedStyles.d.ts +2 -2
- package/_vendor/schemas/selectMode.d.ts +471 -0
- package/_vendor/schemas/selectMode.mjs +120 -4
- package/_vendor/schemas/sellingPlan.d.ts +60 -0
- package/_vendor/schemas/sellingPlan.mjs +1 -0
- package/cart/buy-now-action.js +3 -3
- package/cart/buy-now-action.js.map +2 -2
- package/cart/cart-provider.js +2 -2
- package/cart/cart-provider.js.map +2 -2
- package/cart/cart-types.d.ts +2 -1
- package/cart/cart-types.js.map +2 -2
- package/cart/hooks/use-add-to-cart.js +1 -1
- package/cart/hooks/use-add-to-cart.js.map +2 -2
- package/cart/hooks/use-buy-now.js +2 -2
- package/cart/hooks/use-buy-now.js.map +2 -2
- package/cart/utils/variant-to-cart-line.d.ts +1 -2
- package/cart/utils/variant-to-cart-line.js.map +1 -1
- package/chunk-4XLTENDR.mjs +33 -0
- package/chunk-A7EUNWRQ.mjs +765 -0
- package/{chunk-ME5W2TJM.mjs → chunk-OCB5XQYL.mjs} +2 -2
- package/chunk-QFYIXADC.mjs +42 -0
- package/editor/LinkInterceptor.js +4 -0
- package/editor/LinkInterceptor.js.map +2 -2
- package/editor/select-mode/EditorSelection.js +74 -1
- package/editor/select-mode/EditorSelection.js.map +2 -2
- package/editor/select-mode/descriptor/elementDescriptor.d.ts +13 -2
- package/editor/select-mode/descriptor/elementDescriptor.js +19 -31
- package/editor/select-mode/descriptor/elementDescriptor.js.map +2 -2
- package/editor/select-mode/descriptor/styleExtraction.d.ts +3 -0
- package/editor/select-mode/descriptor/styleExtraction.js +271 -0
- package/editor/select-mode/descriptor/styleExtraction.js.map +7 -0
- package/editor/select-mode/displayModeStore.d.ts +10 -0
- package/editor/select-mode/displayModeStore.js +47 -0
- package/editor/select-mode/displayModeStore.js.map +7 -0
- package/editor/select-mode/fast-refresh-relay.d.ts +3 -0
- package/editor/select-mode/fast-refresh-relay.js +35 -0
- package/editor/select-mode/fast-refresh-relay.js.map +7 -0
- package/editor/select-mode/fiber.d.ts +17 -0
- package/editor/select-mode/fiber.js +103 -34
- package/editor/select-mode/fiber.js.map +2 -2
- package/editor/select-mode/hooks/useEditModeStateMachine.d.ts +20 -0
- package/editor/select-mode/hooks/useEditModeStateMachine.js +226 -0
- package/editor/select-mode/hooks/useEditModeStateMachine.js.map +7 -0
- package/editor/select-mode/hooks/useOptimisticOverrides.d.ts +20 -0
- package/editor/select-mode/hooks/useOptimisticOverrides.js +284 -0
- package/editor/select-mode/hooks/useOptimisticOverrides.js.map +7 -0
- package/editor/select-mode/hooks/useParentMessaging.d.ts +17 -2
- package/editor/select-mode/hooks/useParentMessaging.js +66 -1
- package/editor/select-mode/hooks/useParentMessaging.js.map +2 -2
- package/editor/select-mode/hooks/useSelectModeController.js +5 -6
- package/editor/select-mode/hooks/useSelectModeController.js.map +2 -2
- package/editor/select-mode/hooks/useSelectionHover.js +16 -1
- package/editor/select-mode/hooks/useSelectionHover.js.map +2 -2
- package/editor/select-mode/hooks/useSelectionInteractions.d.ts +7 -2
- package/editor/select-mode/hooks/useSelectionInteractions.js +57 -18
- package/editor/select-mode/hooks/useSelectionInteractions.js.map +2 -2
- package/editor/select-mode/hooks/useSiblingResolution.d.ts +6 -0
- package/editor/select-mode/hooks/useSiblingResolution.js +59 -0
- package/editor/select-mode/hooks/useSiblingResolution.js.map +7 -0
- package/editor/select-mode/inlineTextMarks.d.ts +6 -0
- package/editor/select-mode/inlineTextMarks.js +25 -0
- package/editor/select-mode/inlineTextMarks.js.map +7 -0
- package/editor/select-mode/interactions/selectionGeometry.js +4 -0
- package/editor/select-mode/interactions/selectionGeometry.js.map +2 -2
- package/editor/select-mode/selectionFrame.d.ts +5 -0
- package/editor/select-mode/selectionFrame.js +25 -1
- package/editor/select-mode/selectionFrame.js.map +2 -2
- package/editor/select-mode/symbolicate.js +32 -10
- package/editor/select-mode/symbolicate.js.map +2 -2
- package/editor/select-mode/tiptapInlineEditor.d.ts +23 -0
- package/editor/select-mode/tiptapInlineEditor.js +120 -0
- package/editor/select-mode/tiptapInlineEditor.js.map +7 -0
- package/gateways/canopy-api.d.ts +3 -3
- package/gateways/canopy-api.js +3 -3
- package/gateways/canopy-api.js.map +2 -2
- package/loaders/collection-loader.d.ts +1 -1
- package/loaders/collection-loader.js +1 -1
- package/loaders/collection-loader.js.map +2 -2
- package/loaders/collection-products-loader.d.ts +1 -1
- package/loaders/collection-products-loader.js +1 -1
- package/loaders/collection-products-loader.js.map +2 -2
- package/loaders/invoke-loader.d.ts +2 -2
- package/loaders/invoke-loader.js +2 -2
- package/loaders/invoke-loader.js.map +2 -2
- package/loaders/levanta-product-loader.d.ts +1 -1
- package/loaders/levanta-product-loader.js +1 -1
- package/loaders/levanta-product-loader.js.map +2 -2
- package/loaders/okendo-reviews-loader.js +1 -1
- package/loaders/okendo-reviews-loader.js.map +2 -2
- package/loaders/prefetch-loaders.d.ts +1 -1
- package/loaders/prefetch-loaders.js.map +1 -1
- package/loaders/product-loader.d.ts +1 -1
- package/loaders/product-loader.js +1 -1
- package/loaders/product-loader.js.map +2 -2
- package/loaders/rebuy-recommendations-loader.js +1 -1
- package/loaders/rebuy-recommendations-loader.js.map +2 -2
- package/loaders/yotpo-review-aggregate-loader.d.ts +1 -1
- package/loaders/yotpo-review-aggregate-loader.js +1 -1
- package/loaders/yotpo-review-aggregate-loader.js.map +2 -2
- package/loaders/yotpo-reviews-loader.d.ts +1 -1
- package/loaders/yotpo-reviews-loader.js +1 -1
- package/loaders/yotpo-reviews-loader.js.map +2 -2
- package/package.json +9 -1
- package/cart/cart-schema.js.map +0 -7
- package/lib/canopy-error.d.ts +0 -25
- package/lib/canopy-error.js +0 -24
- package/lib/canopy-error.js.map +0 -7
- package/loaders/loader-keys.js.map +0 -7
- package/loaders/loader-schemas.d.ts +0 -755
- package/loaders/loader-schemas.js +0 -257
- package/loaders/loader-schemas.js.map +0 -7
- package/{cart/cart-schema.d.ts → _vendor/schemas/cart.d.ts} +0 -0
- package/{chunk-NCKKAFF7.mjs → chunk-ILGEM42C.mjs} +7 -7
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export type ErrorUserFacingDetailsWithMessage = {
|
|
2
|
+
type: "toast" | "fullPageModal" | "shopifyStorePassword" | "billing.addPublishedElements" | "billing.addShopifyThemeProject" | "billing.addReploSite" | "agentBilling.shopifyThemeBuilder.publishedElements.exceeded" | "agentBilling.shopifyThemeBuilder.projects.exceeded" | "agentBilling.sites.exceeded" | "agentBilling.credits.exceeded" | "agentBilling.upgradeRequired";
|
|
3
|
+
message: string;
|
|
4
|
+
isRecoverable?: boolean;
|
|
5
|
+
detail?: string[] | string;
|
|
6
|
+
key: string;
|
|
7
|
+
usage?: {
|
|
8
|
+
current: number;
|
|
9
|
+
maximum: number;
|
|
10
|
+
};
|
|
11
|
+
plan?: string;
|
|
12
|
+
callToAction?: {
|
|
13
|
+
type: "reload";
|
|
14
|
+
} | {
|
|
15
|
+
type: "installApp";
|
|
16
|
+
} | {
|
|
17
|
+
type: "goToHomepage";
|
|
18
|
+
} | {
|
|
19
|
+
type: "navigateToProjectEditor";
|
|
20
|
+
} | {
|
|
21
|
+
type: "closeModal";
|
|
22
|
+
} | {
|
|
23
|
+
type: "navigateToLink";
|
|
24
|
+
link: {
|
|
25
|
+
type: "errors.wrongJsonExtension";
|
|
26
|
+
} | {
|
|
27
|
+
type: "errors.chunkingError";
|
|
28
|
+
} | {
|
|
29
|
+
type: "errors.indexBackupError";
|
|
30
|
+
} | {
|
|
31
|
+
type: "errors.shopifyIntegrationAlreadyAssigned";
|
|
32
|
+
} | {
|
|
33
|
+
type: "errors.shopifyIntegrationMissingAccessScopes";
|
|
34
|
+
url: string;
|
|
35
|
+
} | {
|
|
36
|
+
type: "customLink";
|
|
37
|
+
url: string;
|
|
38
|
+
} | {
|
|
39
|
+
type: "errors.projectConnectedToBillingIntegrationForShopifyWorkspace";
|
|
40
|
+
} | {
|
|
41
|
+
type: "errors.themeAssetSizeLimitExceeded";
|
|
42
|
+
} | {
|
|
43
|
+
type: "errors.themeTotalSizeLimitExceeded";
|
|
44
|
+
} | {
|
|
45
|
+
type: "errors.pageMetafieldDefinitionsChanged";
|
|
46
|
+
} | {
|
|
47
|
+
type: "settings.billing";
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
export type ErrorUserFacingDetails = ErrorUserFacingDetailsWithMessage | {
|
|
52
|
+
type: "uncommon_none";
|
|
53
|
+
key: string;
|
|
54
|
+
usage?: {
|
|
55
|
+
current: number;
|
|
56
|
+
maximum: number;
|
|
57
|
+
};
|
|
58
|
+
message?: string;
|
|
59
|
+
isRecoverable?: boolean;
|
|
60
|
+
detail?: string[] | string;
|
|
61
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export type DisplayMode = "browse" | "selection";
|
|
2
2
|
export type SelectModeSelectionType = "none" | "element" | "area" | "drag";
|
|
3
|
+
export type SelectModeInlineTextStatus = "editable" | "dynamic" | null;
|
|
3
4
|
export type SelectModeTextMetrics = {
|
|
4
5
|
tightWidth: number;
|
|
5
6
|
lineCount: number;
|
|
@@ -15,6 +16,14 @@ export type SelectModeSourceLocation = {
|
|
|
15
16
|
columnNumber?: number;
|
|
16
17
|
componentName?: string;
|
|
17
18
|
};
|
|
19
|
+
export type SelectModeFiberChainEntry = {
|
|
20
|
+
sourceLocation: SelectModeSourceLocation;
|
|
21
|
+
tagName?: string;
|
|
22
|
+
componentName?: string;
|
|
23
|
+
props?: {
|
|
24
|
+
[x: string]: unknown;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
18
27
|
export type SelectModeBoundingRect = {
|
|
19
28
|
x: number;
|
|
20
29
|
y: number;
|
|
@@ -29,6 +38,21 @@ export type SelectModeSelectionRect = {
|
|
|
29
38
|
id: string;
|
|
30
39
|
rect: SelectModeBoundingRect;
|
|
31
40
|
};
|
|
41
|
+
export type SelectModeStyleAtRule = {
|
|
42
|
+
type: string;
|
|
43
|
+
text: string;
|
|
44
|
+
};
|
|
45
|
+
export type SelectModeStyleVariant = {
|
|
46
|
+
atRules: SelectModeStyleAtRule[];
|
|
47
|
+
pseudo: string | null;
|
|
48
|
+
};
|
|
49
|
+
export type SelectModeDefinedStyle = {
|
|
50
|
+
property: string;
|
|
51
|
+
variant: SelectModeStyleVariant | null;
|
|
52
|
+
className: string | null;
|
|
53
|
+
raw: string;
|
|
54
|
+
resolved: string;
|
|
55
|
+
};
|
|
32
56
|
export type SelectedElement = {
|
|
33
57
|
kind: "react-element";
|
|
34
58
|
selector: string;
|
|
@@ -38,8 +62,14 @@ export type SelectedElement = {
|
|
|
38
62
|
rect: SelectModeBoundingRect;
|
|
39
63
|
textMetrics: SelectModeTextMetrics | null;
|
|
40
64
|
outerHTML: string;
|
|
65
|
+
definedStyles: SelectModeDefinedStyle[];
|
|
66
|
+
inheritedStyles: {
|
|
67
|
+
[x: string]: string;
|
|
68
|
+
};
|
|
41
69
|
clickPosition: SelectModeClickPosition;
|
|
42
70
|
sourceLocation?: SelectModeSourceLocation;
|
|
71
|
+
fiberChain: SelectModeFiberChainEntry[];
|
|
72
|
+
siblingSelectors: string[];
|
|
43
73
|
};
|
|
44
74
|
export type SelectablePlanData = {
|
|
45
75
|
kind: "plan";
|
|
@@ -54,6 +84,25 @@ export type SelectablePlanPayload = {
|
|
|
54
84
|
};
|
|
55
85
|
export type SelectableDataPayload = SelectablePlanPayload;
|
|
56
86
|
export type SelectableData = SelectedElement | SelectablePlanData;
|
|
87
|
+
export type SelectModeOptimisticUpdatePayload = {
|
|
88
|
+
kind: "css";
|
|
89
|
+
property: string;
|
|
90
|
+
value: string | null;
|
|
91
|
+
} | {
|
|
92
|
+
kind: "content";
|
|
93
|
+
innerHTML: string;
|
|
94
|
+
} | {
|
|
95
|
+
kind: "attribute";
|
|
96
|
+
name: string;
|
|
97
|
+
value: string;
|
|
98
|
+
};
|
|
99
|
+
export type SelectModeTiptapActiveMarks = {
|
|
100
|
+
bold: boolean;
|
|
101
|
+
italic: boolean;
|
|
102
|
+
underline: boolean;
|
|
103
|
+
strike: boolean;
|
|
104
|
+
};
|
|
105
|
+
export type SelectModeFormatCommand = "toggleBold" | "toggleItalic" | "toggleUnderline" | "toggleStrike";
|
|
57
106
|
export type SelectModeSelection = {
|
|
58
107
|
type: "none";
|
|
59
108
|
} | {
|
|
@@ -74,6 +123,37 @@ export type SelectModeParentMessage = {
|
|
|
74
123
|
} | {
|
|
75
124
|
type: "replo:select:setSelectionType";
|
|
76
125
|
selectionType: SelectModeSelectionType;
|
|
126
|
+
} | {
|
|
127
|
+
type: "replo:select:applyOptimisticUpdate";
|
|
128
|
+
editId: string;
|
|
129
|
+
payload: SelectModeOptimisticUpdatePayload;
|
|
130
|
+
targetMode: "primary" | "group";
|
|
131
|
+
} | {
|
|
132
|
+
type: "replo:select:markCommitted";
|
|
133
|
+
editId: string;
|
|
134
|
+
sessionId: string;
|
|
135
|
+
} | {
|
|
136
|
+
type: "replo:select:resolveSessionOverrides";
|
|
137
|
+
sessionId: string;
|
|
138
|
+
outcome: "persisted" | "failed";
|
|
139
|
+
} | {
|
|
140
|
+
type: "replo:select:revertOverride";
|
|
141
|
+
editId: string;
|
|
142
|
+
} | {
|
|
143
|
+
type: "replo:select:enterEditMode";
|
|
144
|
+
} | {
|
|
145
|
+
type: "replo:select:exitEditMode";
|
|
146
|
+
} | {
|
|
147
|
+
type: "replo:select:formatCommand";
|
|
148
|
+
command: SelectModeFormatCommand;
|
|
149
|
+
} | {
|
|
150
|
+
type: "replo:select:resolveEditRequest";
|
|
151
|
+
editId: string;
|
|
152
|
+
allowed: boolean;
|
|
153
|
+
} | {
|
|
154
|
+
type: "replo:select:requestSymbolicate";
|
|
155
|
+
requestId: string;
|
|
156
|
+
element: SelectedElement;
|
|
77
157
|
};
|
|
78
158
|
export type SelectModeIframeMessage = {
|
|
79
159
|
type: "replo:select:elementSelected";
|
|
@@ -98,4 +178,26 @@ export type SelectModeIframeMessage = {
|
|
|
98
178
|
type: "replo:select:areaSelected";
|
|
99
179
|
rect: SelectModeBoundingRect;
|
|
100
180
|
items: SelectableData[];
|
|
181
|
+
} | {
|
|
182
|
+
type: "replo:select:doubleClicked";
|
|
183
|
+
editId: string;
|
|
184
|
+
element: SelectedElement;
|
|
185
|
+
} | {
|
|
186
|
+
type: "replo:select:textCommitted";
|
|
187
|
+
editId: string;
|
|
188
|
+
html: string;
|
|
189
|
+
json: {
|
|
190
|
+
[x: string]: unknown;
|
|
191
|
+
};
|
|
192
|
+
originalInnerHTML: string;
|
|
193
|
+
} | {
|
|
194
|
+
type: "replo:select:editorStateUpdate";
|
|
195
|
+
activeMarks: SelectModeTiptapActiveMarks;
|
|
196
|
+
isEditing: boolean;
|
|
197
|
+
} | {
|
|
198
|
+
type: "replo:select:fastRefreshComplete";
|
|
199
|
+
} | {
|
|
200
|
+
type: "replo:select:symbolicateResult";
|
|
201
|
+
requestId: string;
|
|
202
|
+
element: SelectedElement;
|
|
101
203
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
/**
|
|
3
|
-
* Shared data-loader key constants.
|
|
4
|
-
* import from here so the strings are never duplicated
|
|
3
|
+
* Shared data-loader key constants. Both the integration registry and the
|
|
4
|
+
* dependency resolver import from here so the strings are never duplicated.
|
|
5
5
|
*
|
|
6
6
|
* These keys serve double duty: they identify which backend loader to invoke
|
|
7
|
-
* AND are used as React Query cache key prefixes. Loader components
|
|
8
|
-
* construct queryKey as `[loaderKey, args]`.
|
|
7
|
+
* AND are used as React Query cache key prefixes. Loader components
|
|
8
|
+
* internally construct queryKey as `[loaderKey, args]`.
|
|
9
9
|
*
|
|
10
10
|
* Naming convention: `<integration>.<objectType>` or
|
|
11
11
|
* `<integration>.<objectType>_<qualifier>`.
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
// ../schemas/loaderKeys.ts
|
|
4
|
+
var DATA_LOADER_KEYS = {
|
|
3
5
|
SHOPIFY_PRODUCT: "shopify_storefront.product",
|
|
4
6
|
SHOPIFY_COLLECTION: "shopify_storefront.collection",
|
|
5
7
|
SHOPIFY_COLLECTION_PRODUCTS: "shopify_storefront.collection_products",
|
|
@@ -14,9 +16,6 @@ const DATA_LOADER_KEYS = {
|
|
|
14
16
|
YOTPO_PRODUCT_REVIEWS: "yotpo.product_reviews",
|
|
15
17
|
YOTPO_PRODUCT_REVIEW_AGGREGATE: "yotpo.product_review_aggregate"
|
|
16
18
|
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
dataLoaderKeySchema
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=loader-keys.js.map
|
|
19
|
+
var dataLoaderKeySchema = z.enum(Object.values(DATA_LOADER_KEYS));
|
|
20
|
+
|
|
21
|
+
export { DATA_LOADER_KEYS, dataLoaderKeySchema };
|