@replohq/canopy-sdk 3.0.5 → 3.0.7
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/crypto.d.ts +8 -0
- package/_vendor/replo-utils/lib/errors.d.ts +1 -0
- package/_vendor/replo-utils/lib/fonts.d.ts +12 -1
- package/_vendor/replo-utils/lib/fonts.mjs +61 -12
- package/_vendor/replo-utils/lib/geometry.mjs +0 -2
- package/_vendor/replo-utils/lib/json.d.ts +0 -4
- package/_vendor/replo-utils/lib/json.mjs +1 -4
- package/_vendor/replo-utils/lib/misc.d.ts +4 -0
- package/_vendor/replo-utils/lib/misc.mjs +2 -4
- package/_vendor/replo-utils/lib/posthogReplay.mjs +0 -2
- package/_vendor/replo-utils/lib/string.d.ts +0 -12
- package/_vendor/replo-utils/lib/url.d.ts +10 -3
- package/_vendor/replo-utils/lib/url.mjs +3 -4
- package/_vendor/replo-utils/react/use-iframe-rpc-channel.mjs +0 -1
- package/_vendor/schemas/agentBillingFeatureType.d.ts +1 -0
- package/_vendor/schemas/comments.d.ts +932 -0
- package/_vendor/schemas/designLibrary.d.ts +24 -1
- package/_vendor/schemas/designLibrary.mjs +76 -70
- package/_vendor/schemas/errors.d.ts +50 -45
- package/_vendor/schemas/generated/comments.d.ts +244 -0
- package/_vendor/schemas/generated/consent.d.ts +43 -2
- package/_vendor/schemas/generated/errors.d.ts +1 -0
- package/_vendor/schemas/generated/selectMode.d.ts +52 -1
- package/_vendor/schemas/generated/selectModeIframeRpc.d.ts +64 -8
- package/_vendor/schemas/iframeRpcChannel.d.ts +13 -1
- package/_vendor/schemas/iframeRpcChannel.mjs +202 -19
- package/_vendor/schemas/loaderKeys.mjs +2 -4
- package/_vendor/schemas/{money.d.ts → moneyFormat.d.ts} +11 -9
- package/_vendor/schemas/moneyFormat.mjs +119 -0
- package/_vendor/schemas/pageAnnotations.d.ts +1 -1
- package/_vendor/schemas/pageAnnotations.mjs +1 -2
- package/_vendor/schemas/reploError.d.ts +43 -0
- package/_vendor/schemas/routing/match.mjs +0 -1
- package/_vendor/schemas/routing/rules.d.ts +2 -2
- package/_vendor/schemas/routing/rules.mjs +5 -8
- package/_vendor/schemas/savedStyles.d.ts +1 -1
- package/_vendor/schemas/selectMode.d.ts +272 -4
- package/_vendor/schemas/selectMode.mjs +4 -6
- package/_vendor/schemas/selectModeIframeRpc.d.ts +802 -111
- package/_vendor/schemas/selectModeIframeRpc.mjs +142 -47
- package/chunk-B7XDEXPL.mjs +19 -0
- package/chunk-CJIK4NVP.mjs +547 -0
- package/chunk-DINTPZM2.mjs +71 -0
- package/{chunk-AKZNN7F2.mjs → chunk-IQCJXNJU.mjs} +1 -1
- package/{chunk-H36NDYLG.mjs → chunk-PQEA6P4V.mjs} +40 -3
- package/{chunk-3A2F6BOM.mjs → chunk-YGLYUC6R.mjs} +21 -8
- package/editor/select-mode/iframeRpcChannel.d.ts +4 -4
- package/lib/tombstone.js +2 -2
- package/money.d.ts +1 -1
- package/orders/order-status-schema.d.ts +3 -3
- package/package.json +2 -2
- package/_vendor/replo-utils/lib/object.d.ts +0 -31
- package/_vendor/schemas/money.mjs +0 -1937
- package/chunk-544ZM65A.mjs +0 -203
- package/chunk-HGXQNZW7.mjs +0 -38
- package/chunk-ILGEM42C.mjs +0 -21
- package/chunk-QPGBIWJK.mjs +0 -195
- package/chunk-UJCSKKID.mjs +0 -23
- /package/{chunk-FNTGY7I5.mjs → chunk-JELVREEB.mjs} +0 -0
|
@@ -12,6 +12,8 @@ export declare function randomBase64Url(byteLength: number): string;
|
|
|
12
12
|
* `crypto.getRandomValues`, which carries no such restriction.
|
|
13
13
|
*/
|
|
14
14
|
export declare function randomUUID(): string;
|
|
15
|
+
/** A v7 UUID: its first 48 bits are its creation time in Unix milliseconds, so such ids sort by age. */
|
|
16
|
+
export declare function timeOrderedUUID(): string;
|
|
15
17
|
/** Strings use UTF-8; binary inputs are hashed unchanged. */
|
|
16
18
|
export declare function sha256Hex(input: string | Parameters<typeof crypto.subtle.digest>[1]): Promise<string>;
|
|
17
19
|
export declare function constantTimeEqual({ left, right, }: {
|
|
@@ -22,3 +24,9 @@ export declare function getHmacSha256Hex({ rawBody, signingKey, }: {
|
|
|
22
24
|
rawBody: string;
|
|
23
25
|
signingKey: string;
|
|
24
26
|
}): Promise<string>;
|
|
27
|
+
export declare function isValidHmacSha256Hex({ rawBody, signingKey, signature, }: {
|
|
28
|
+
rawBody: string;
|
|
29
|
+
signingKey: string;
|
|
30
|
+
signature: string;
|
|
31
|
+
}): Promise<boolean>;
|
|
32
|
+
export declare function deterministicUUID(value: string): string;
|
|
@@ -80,4 +80,5 @@ export declare function isNetworkErrorMessage(message: string): boolean;
|
|
|
80
80
|
* fallback string or `String(error)`.
|
|
81
81
|
*/
|
|
82
82
|
export declare function getErrorMessage(error: unknown, fallback?: string): string;
|
|
83
|
+
export declare function appendErrorId(detail: string, errorId: string | null | undefined): string;
|
|
83
84
|
export {};
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
/** Known symbol assets are not text typefaces; unknown families stay eligible. */
|
|
2
2
|
export declare function isKnownSymbolFontFamily(family: string): boolean;
|
|
3
|
+
/** Words a family name carries for packaging rather than design: "Inter Display", "Avenir Web". */
|
|
4
|
+
export declare const FONT_DESCRIPTOR_WORDS: Set<string>;
|
|
5
|
+
/** Weight and style words a family name can carry: "Avenir Book", "Graphik Semibold". */
|
|
6
|
+
export declare const FONT_VARIANT_WORDS: Set<string>;
|
|
7
|
+
export declare const FONT_STYLE_WORDS: Set<string>;
|
|
8
|
+
export declare function stripCssQuotes(value: string): string;
|
|
9
|
+
/** "InterDisplay-Bold", "'Inter Display'" → "inter display bold", "inter display": camel case split, punctuation to spaces, lower case. */
|
|
10
|
+
export declare function normalizeFontFamilyName(value: string): string;
|
|
11
|
+
/** The key two family names share when they are the same typeface: Brand Studio's alias minus weight, style and packaging words ("Avenir Book" → "avenir"), stricter than the first-word alias. */
|
|
12
|
+
export declare function fontFamilyKey(family: string): string;
|
|
3
13
|
export declare function getTypographyFonts<FontType extends {
|
|
4
14
|
family: string;
|
|
5
15
|
faces: {
|
|
@@ -48,10 +58,11 @@ export declare function fontFormatFromMimeType(mimeType: string): string;
|
|
|
48
58
|
/**
|
|
49
59
|
* The @font-face rule that makes a custom family renderable from its asset URL.
|
|
50
60
|
*/
|
|
51
|
-
export declare function buildFontFaceCss({ family, faceUrl, format, weight, }: {
|
|
61
|
+
export declare function buildFontFaceCss({ family, faceUrl, format, weight, style, }: {
|
|
52
62
|
family: string;
|
|
53
63
|
faceUrl: string;
|
|
54
64
|
format: string;
|
|
55
65
|
weight?: number;
|
|
66
|
+
style?: "normal" | "italic";
|
|
56
67
|
}): string;
|
|
57
68
|
export declare const escapeFontFamilyName: (fontFamily: string) => string;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { upperFirst_default, toString_default } from '../../../chunk-
|
|
2
|
-
import '../../../chunk-
|
|
3
|
-
import '../../../chunk-UJCSKKID.mjs';
|
|
1
|
+
import { upperFirst_default, toString_default } from '../../../chunk-IQCJXNJU.mjs';
|
|
2
|
+
import '../../../chunk-JELVREEB.mjs';
|
|
4
3
|
|
|
5
4
|
function capitalize(string) {
|
|
6
5
|
return upperFirst_default(toString_default(string).toLowerCase());
|
|
@@ -13,6 +12,43 @@ function isKnownSymbolFontFamily(family) {
|
|
|
13
12
|
normalized.replace(/[\s_-]/gu, "")
|
|
14
13
|
);
|
|
15
14
|
}
|
|
15
|
+
var FONT_DESCRIPTOR_WORDS = /* @__PURE__ */ new Set([
|
|
16
|
+
"display",
|
|
17
|
+
"international",
|
|
18
|
+
"intl",
|
|
19
|
+
"m",
|
|
20
|
+
"text",
|
|
21
|
+
"web",
|
|
22
|
+
"webfont",
|
|
23
|
+
"webm"
|
|
24
|
+
]);
|
|
25
|
+
var FONT_VARIANT_WORDS = /* @__PURE__ */ new Set([
|
|
26
|
+
"black",
|
|
27
|
+
"bold",
|
|
28
|
+
"book",
|
|
29
|
+
"extrabold",
|
|
30
|
+
"italic",
|
|
31
|
+
"light",
|
|
32
|
+
"medium",
|
|
33
|
+
"regular",
|
|
34
|
+
"semibold",
|
|
35
|
+
"thin"
|
|
36
|
+
]);
|
|
37
|
+
var FONT_STYLE_WORDS = /* @__PURE__ */ new Set([
|
|
38
|
+
...FONT_DESCRIPTOR_WORDS,
|
|
39
|
+
...FONT_VARIANT_WORDS
|
|
40
|
+
]);
|
|
41
|
+
function stripCssQuotes(value) {
|
|
42
|
+
return value.trim().replace(/\\(["'])/gu, "$1").replace(/^["']|["']$/gu, "");
|
|
43
|
+
}
|
|
44
|
+
function normalizeFontFamilyName(value) {
|
|
45
|
+
return stripCssQuotes(value).replace(/([a-z])([A-Z])/gu, "$1 $2").replace(/([A-Z])([A-Z][a-z])/gu, "$1 $2").replace(/[^a-z0-9]+/giu, " ").trim().replace(/\s+/gu, " ").toLowerCase();
|
|
46
|
+
}
|
|
47
|
+
function fontFamilyKey(family) {
|
|
48
|
+
const words = normalizeFontFamilyName(family).split(" ").filter(Boolean);
|
|
49
|
+
const kept = words.filter((word) => !FONT_STYLE_WORDS.has(word));
|
|
50
|
+
return (kept.length > 0 ? kept : words).join(" ");
|
|
51
|
+
}
|
|
16
52
|
function getTypographyFonts(fonts) {
|
|
17
53
|
return fonts.filter((font) => {
|
|
18
54
|
return !isKnownSymbolFontFamily(font.family) && (font.faces.length === 0 || font.faces.some((face) => !isKnownSymbolFontFamily(face.cssFamily)));
|
|
@@ -61,16 +97,28 @@ function describeFontFile(fileName) {
|
|
|
61
97
|
}
|
|
62
98
|
function fontFormatFromExtension(extension) {
|
|
63
99
|
const normalized = extension.toLowerCase().replace(/^\./u, "");
|
|
64
|
-
if (normalized === "woff2")
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
if (normalized === "
|
|
100
|
+
if (normalized === "woff2") {
|
|
101
|
+
return "woff2";
|
|
102
|
+
}
|
|
103
|
+
if (normalized === "woff") {
|
|
104
|
+
return "woff";
|
|
105
|
+
}
|
|
106
|
+
if (normalized === "otf") {
|
|
107
|
+
return "opentype";
|
|
108
|
+
}
|
|
109
|
+
if (normalized === "ttf") {
|
|
110
|
+
return "truetype";
|
|
111
|
+
}
|
|
68
112
|
return "woff2";
|
|
69
113
|
}
|
|
70
114
|
function fontFormatFromMimeType(mimeType) {
|
|
71
115
|
const normalized = mimeType.toLowerCase();
|
|
72
|
-
if (normalized.includes("woff2"))
|
|
73
|
-
|
|
116
|
+
if (normalized.includes("woff2")) {
|
|
117
|
+
return "woff2";
|
|
118
|
+
}
|
|
119
|
+
if (normalized.includes("woff")) {
|
|
120
|
+
return "woff";
|
|
121
|
+
}
|
|
74
122
|
if (normalized.includes("otf") || normalized.includes("opentype")) {
|
|
75
123
|
return "opentype";
|
|
76
124
|
}
|
|
@@ -86,12 +134,13 @@ function buildFontFaceCss({
|
|
|
86
134
|
family,
|
|
87
135
|
faceUrl,
|
|
88
136
|
format,
|
|
89
|
-
weight = 400
|
|
137
|
+
weight = 400,
|
|
138
|
+
style = "normal"
|
|
90
139
|
}) {
|
|
91
|
-
return `@font-face{font-family:"${escapeCssString(family)}";font-weight:${weight};font-style
|
|
140
|
+
return `@font-face{font-family:"${escapeCssString(family)}";font-weight:${weight};font-style:${style};src:url("${escapeCssString(faceUrl)}") format("${escapeCssString(format)}");font-display:swap;}`;
|
|
92
141
|
}
|
|
93
142
|
var escapeFontFamilyName = (fontFamily) => {
|
|
94
143
|
return fontFamily.replace(/"/g, '\\"').replace(/'/g, "\\'");
|
|
95
144
|
};
|
|
96
145
|
|
|
97
|
-
export { buildFontFaceCss, buildGoogleFontsCssUrl, describeFontFile, escapeFontFamilyName, fontFormatFromExtension, fontFormatFromMimeType, fontNameToCssVariable, fontNameToVariableName, getTypographyFonts, isKnownSymbolFontFamily, quoteFontFamily, slugifyFontFamily };
|
|
146
|
+
export { FONT_DESCRIPTOR_WORDS, FONT_STYLE_WORDS, FONT_VARIANT_WORDS, buildFontFaceCss, buildGoogleFontsCssUrl, describeFontFile, escapeFontFamilyName, fontFamilyKey, fontFormatFromExtension, fontFormatFromMimeType, fontNameToCssVariable, fontNameToVariableName, getTypographyFonts, isKnownSymbolFontFamily, normalizeFontFamilyName, quoteFontFamily, slugifyFontFamily, stripCssQuotes };
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import '../../../chunk-UJCSKKID.mjs';
|
|
2
|
-
|
|
3
1
|
function isIntersecting(targetRect, destinationRect, { tolerance = 0 } = {}) {
|
|
4
2
|
return targetRect.left <= destinationRect.right + tolerance && targetRect.right >= destinationRect.left - tolerance && targetRect.top <= destinationRect.bottom + tolerance && targetRect.bottom >= destinationRect.top - tolerance;
|
|
5
3
|
}
|
|
@@ -1,6 +1,2 @@
|
|
|
1
1
|
export declare function parseJsonOrNull(json: string): unknown | null;
|
|
2
|
-
export declare function omitJsonObjectFieldsOrNull({ json, fields, }: {
|
|
3
|
-
json: string;
|
|
4
|
-
fields: string[];
|
|
5
|
-
}): string | null;
|
|
6
2
|
export declare function jsonStringifyOrNull(value: unknown): string | null;
|
|
@@ -1,4 +1 @@
|
|
|
1
|
-
export { jsonStringifyOrNull,
|
|
2
|
-
import '../../../chunk-ILGEM42C.mjs';
|
|
3
|
-
import '../../../chunk-FNTGY7I5.mjs';
|
|
4
|
-
import '../../../chunk-UJCSKKID.mjs';
|
|
1
|
+
export { jsonStringifyOrNull, parseJsonOrNull } from '../../../chunk-B7XDEXPL.mjs';
|
|
@@ -142,4 +142,8 @@ export declare function coerceNumberToString(value: string | number | null): str
|
|
|
142
142
|
*/
|
|
143
143
|
export declare function formatFileSize(byteCount: number, decimalPlaces?: number): string;
|
|
144
144
|
export declare const sleep: (ms: number) => Promise<unknown>;
|
|
145
|
+
export declare function sleepWithSignal({ delayMs, signal, }: {
|
|
146
|
+
delayMs: number;
|
|
147
|
+
signal: AbortSignal | null;
|
|
148
|
+
}): Promise<unknown>;
|
|
145
149
|
export declare function errorMessage(error: unknown): string;
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
export { coerceNumberToString, deepCloneAndMergeReplacingArrays, errorMessage, exhaustiveSwitch, formatFileSize, getFromRecordOrNull, hasOwnProperty, invariant, isEmpty, isFunction_default as isFunction, isNotNullish, isNullish, isPrimitive, mergeReplacingArrays, mergeReplacingObjects, noop, preventDefault, sleep, warning } from '../../../chunk-
|
|
2
|
-
|
|
3
|
-
import '../../../chunk-FNTGY7I5.mjs';
|
|
4
|
-
import '../../../chunk-UJCSKKID.mjs';
|
|
1
|
+
export { coerceNumberToString, deepCloneAndMergeReplacingArrays, errorMessage, exhaustiveSwitch, formatFileSize, getFromRecordOrNull, hasOwnProperty, invariant, isEmpty, isFunction_default as isFunction, isNotNullish, isNullish, isNumber_default as isNumber, isPrimitive, isString_default as isString, mergeReplacingArrays, mergeReplacingObjects, noop, preventDefault, sleep, sleepWithSignal, warning } from '../../../chunk-PQEA6P4V.mjs';
|
|
2
|
+
import '../../../chunk-JELVREEB.mjs';
|
|
@@ -22,18 +22,6 @@ export declare function formatWithCatN({ content, startLineNumber, }: {
|
|
|
22
22
|
* Escapes special regex characters in a string for use in RegExp constructor
|
|
23
23
|
*/
|
|
24
24
|
export declare function escapeRegExp(string: string): string;
|
|
25
|
-
/**
|
|
26
|
-
* Skill names are authored as kebab-case slugs in SKILL.md frontmatter
|
|
27
|
-
* ("site-management", "founder-review"). Anywhere we render the name to the
|
|
28
|
-
* user — skills app cards, the chat tool feed, the provisioning overlay — we
|
|
29
|
-
* run it through this so they see "Site Management", "Founder Review", etc.
|
|
30
|
-
* instead of the raw slug.
|
|
31
|
-
*
|
|
32
|
-
* Names that already look human-authored (any whitespace or any uppercase
|
|
33
|
-
* letter) are returned untouched, so a skill can opt out by writing
|
|
34
|
-
* `name: My Custom Skill` in frontmatter.
|
|
35
|
-
*/
|
|
36
|
-
export declare function prettifySkillName(name: string): string;
|
|
37
25
|
/**
|
|
38
26
|
* Safely decodes a URI component, returning the original value if decoding fails.
|
|
39
27
|
* Returns null if the input is null or undefined, preserving empty strings.
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
type UrlSearchParamValues = Record<string, string | number | boolean | string[] | null | undefined>;
|
|
1
2
|
/**
|
|
2
|
-
* Builds a URLSearchParams from a record, omitting undefined values.
|
|
3
|
-
* values are appended as repeated keys; scalars are stringified.
|
|
3
|
+
* Builds a URLSearchParams from a record, omitting null and undefined values.
|
|
4
|
+
* Array values are appended as repeated keys; scalars are stringified.
|
|
4
5
|
*/
|
|
5
|
-
export declare function buildUrlSearchParams(values:
|
|
6
|
+
export declare function buildUrlSearchParams(values: UrlSearchParamValues): URLSearchParams;
|
|
7
|
+
/**
|
|
8
|
+
* Appends a query string built by `buildUrlSearchParams` to a path, leaving
|
|
9
|
+
* the path bare when every value is omitted.
|
|
10
|
+
*/
|
|
11
|
+
export declare function pathWithSearchParams(path: string, values: UrlSearchParamValues): string;
|
|
6
12
|
export declare function isValidHttpUrl(url: string, options?: {
|
|
7
13
|
allowBlockedHostnames?: boolean;
|
|
8
14
|
allowedHostnames?: string[];
|
|
@@ -72,3 +78,4 @@ export declare function sanitizePublicHttpUrl(value: string | null, { preservePr
|
|
|
72
78
|
}): string | null;
|
|
73
79
|
export declare function isPublicHttpsUrl(value: string): boolean;
|
|
74
80
|
export declare function safeHost(url: string): string | null;
|
|
81
|
+
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export { buildUrlSearchParams, fileExtensionFromUrl, isPreviewInternalHostname, isPreviewOrigin, isPublicHttpsUrl, isValidHttpUrl, isValidRoutePath, normalizeCustomDomain, normalizeUrlIncludingProtocolRelative, normalizeUrlScheme, parseUrl, safeHost, sanitizePublicHttpUrl, truncateDomain } from '../../../chunk-
|
|
2
|
-
import '../../../chunk-
|
|
3
|
-
import '../../../chunk-
|
|
4
|
-
import '../../../chunk-UJCSKKID.mjs';
|
|
1
|
+
export { buildUrlSearchParams, fileExtensionFromUrl, isPreviewInternalHostname, isPreviewOrigin, isPublicHttpsUrl, isValidHttpUrl, isValidRoutePath, normalizeCustomDomain, normalizeUrlIncludingProtocolRelative, normalizeUrlScheme, parseUrl, pathWithSearchParams, safeHost, sanitizePublicHttpUrl, truncateDomain } from '../../../chunk-YGLYUC6R.mjs';
|
|
2
|
+
import '../../../chunk-IQCJXNJU.mjs';
|
|
3
|
+
import '../../../chunk-JELVREEB.mjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const FEATURE_TYPES: readonly ["credits", "shopifyThemeBuilder.publishedElements", "sites", "shopifyThemeBuilder.projects"];
|