@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
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { ReploError } from '../../chunk-DINTPZM2.mjs';
|
|
2
|
+
|
|
3
|
+
var InvalidAmountError = class extends ReploError {
|
|
4
|
+
};
|
|
5
|
+
var UnsupportedCurrencyError = class extends ReploError {
|
|
6
|
+
};
|
|
7
|
+
var STRIPE_EXPONENT_MISMATCH_CURRENCIES = /* @__PURE__ */ new Set([
|
|
8
|
+
"ISK",
|
|
9
|
+
"UGX",
|
|
10
|
+
"IQD",
|
|
11
|
+
"LYD",
|
|
12
|
+
"MGA",
|
|
13
|
+
"MRU"
|
|
14
|
+
]);
|
|
15
|
+
function stripeExponentDiffersFromIso(currencyCode) {
|
|
16
|
+
return STRIPE_EXPONENT_MISMATCH_CURRENCIES.has(currencyCode.toUpperCase());
|
|
17
|
+
}
|
|
18
|
+
function assertStripeExponentMatchesIso(currencyCode) {
|
|
19
|
+
if (stripeExponentDiffersFromIso(currencyCode)) {
|
|
20
|
+
throw new UnsupportedCurrencyError({
|
|
21
|
+
message: "Currency's ISO minor-unit exponent differs from Stripe's; not supported",
|
|
22
|
+
additionalData: { currencyCode: currencyCode.toUpperCase() }
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
var NON_TWO_DIGIT_MINOR_UNIT_EXPONENTS = {
|
|
27
|
+
BIF: 0,
|
|
28
|
+
CLP: 0,
|
|
29
|
+
DJF: 0,
|
|
30
|
+
GNF: 0,
|
|
31
|
+
ISK: 0,
|
|
32
|
+
JPY: 0,
|
|
33
|
+
KMF: 0,
|
|
34
|
+
KRW: 0,
|
|
35
|
+
PYG: 0,
|
|
36
|
+
RWF: 0,
|
|
37
|
+
UGX: 0,
|
|
38
|
+
UYI: 0,
|
|
39
|
+
VND: 0,
|
|
40
|
+
VUV: 0,
|
|
41
|
+
XAF: 0,
|
|
42
|
+
XAG: 0,
|
|
43
|
+
XAU: 0,
|
|
44
|
+
XBA: 0,
|
|
45
|
+
XBB: 0,
|
|
46
|
+
XBC: 0,
|
|
47
|
+
XBD: 0,
|
|
48
|
+
XDR: 0,
|
|
49
|
+
XOF: 0,
|
|
50
|
+
XPD: 0,
|
|
51
|
+
XPF: 0,
|
|
52
|
+
XPT: 0,
|
|
53
|
+
XSU: 0,
|
|
54
|
+
XTS: 0,
|
|
55
|
+
XUA: 0,
|
|
56
|
+
XXX: 0,
|
|
57
|
+
BHD: 3,
|
|
58
|
+
IQD: 3,
|
|
59
|
+
JOD: 3,
|
|
60
|
+
KWD: 3,
|
|
61
|
+
LYD: 3,
|
|
62
|
+
OMR: 3,
|
|
63
|
+
TND: 3,
|
|
64
|
+
CLF: 4,
|
|
65
|
+
UYW: 4
|
|
66
|
+
};
|
|
67
|
+
function currencyMinorUnitExponent(currencyCode) {
|
|
68
|
+
return NON_TWO_DIGIT_MINOR_UNIT_EXPONENTS[currencyCode.toUpperCase()] ?? 2;
|
|
69
|
+
}
|
|
70
|
+
function fromMajorUnitsToMinorUnits({
|
|
71
|
+
amount,
|
|
72
|
+
currencyCode
|
|
73
|
+
}) {
|
|
74
|
+
const majorUnits = typeof amount === "string" && amount.trim() === "" ? Number.NaN : Number(amount);
|
|
75
|
+
if (!Number.isFinite(majorUnits)) {
|
|
76
|
+
throw new InvalidAmountError({
|
|
77
|
+
message: "Money amount is not a finite number",
|
|
78
|
+
additionalData: { amount, currencyCode }
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
const scaled = majorUnits * 10 ** currencyMinorUnitExponent(currencyCode);
|
|
82
|
+
return Math.round(Number(scaled.toPrecision(15)));
|
|
83
|
+
}
|
|
84
|
+
function parseDecimalToMinorUnits({
|
|
85
|
+
value,
|
|
86
|
+
currencyCode
|
|
87
|
+
}) {
|
|
88
|
+
const trimmed = value?.trim();
|
|
89
|
+
if (!trimmed || !Number.isFinite(Number(trimmed))) {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
return fromMajorUnitsToMinorUnits({ amount: trimmed, currencyCode });
|
|
93
|
+
}
|
|
94
|
+
function fromMinorUnitsToMajorUnits({
|
|
95
|
+
amount,
|
|
96
|
+
currencyCode
|
|
97
|
+
}) {
|
|
98
|
+
return amount / 10 ** currencyMinorUnitExponent(currencyCode);
|
|
99
|
+
}
|
|
100
|
+
function fromMinorUnitsToMajorUnitsString({
|
|
101
|
+
amount,
|
|
102
|
+
currencyCode
|
|
103
|
+
}) {
|
|
104
|
+
return fromMinorUnitsToMajorUnits({ amount, currencyCode }).toFixed(
|
|
105
|
+
currencyMinorUnitExponent(currencyCode)
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
function formatAmount({
|
|
109
|
+
amount,
|
|
110
|
+
currencyCode,
|
|
111
|
+
locale
|
|
112
|
+
}) {
|
|
113
|
+
return new Intl.NumberFormat(locale ?? "en-US", {
|
|
114
|
+
style: "currency",
|
|
115
|
+
currency: currencyCode.toUpperCase()
|
|
116
|
+
}).format(fromMinorUnitsToMajorUnits({ amount, currencyCode }));
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export { InvalidAmountError, UnsupportedCurrencyError, assertStripeExponentMatchesIso, formatAmount, fromMajorUnitsToMinorUnits, fromMinorUnitsToMajorUnits, fromMinorUnitsToMajorUnitsString, parseDecimalToMinorUnits, stripeExponentDiffersFromIso };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Config to use for any standard error we throw in Replo
|
|
3
|
+
*/
|
|
4
|
+
export type ReploErrorConfig = {
|
|
5
|
+
/**
|
|
6
|
+
* Message of the error, used only internally. If not provided, defaults to
|
|
7
|
+
* the error's class name
|
|
8
|
+
*/
|
|
9
|
+
message?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Any additional data about the error, e.g. ids of content that was trying
|
|
12
|
+
* to be accessed, contextual variables, etc. This is included when the error
|
|
13
|
+
* is logged to Sentry, etc
|
|
14
|
+
*/
|
|
15
|
+
additionalData?: Record<string, unknown>;
|
|
16
|
+
/** Meta details for error reporting */
|
|
17
|
+
errorReportingDetails?: {
|
|
18
|
+
/**
|
|
19
|
+
* If true, tells Sentry that it should group this error differently when
|
|
20
|
+
* it happens on different endpoints ("transactions" in Sentry are endpoints)
|
|
21
|
+
*/
|
|
22
|
+
includeTransactionInFingerprint?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* If provided, these get added to the Sentry fingerprint for this error. Useful
|
|
25
|
+
* for when you want to modify the grouping of an error, especially for reusing
|
|
26
|
+
* errors in different places.
|
|
27
|
+
*/
|
|
28
|
+
customFingerprint?: string[];
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Original cause of the error (useful for if you need to catch and re-throw errors
|
|
32
|
+
* with more context). Will be reported in stacktraces, sentry, etc.
|
|
33
|
+
*/
|
|
34
|
+
cause?: unknown;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Base error that all errors in Replo inherit from
|
|
38
|
+
*/
|
|
39
|
+
export declare abstract class ReploError extends Error {
|
|
40
|
+
config: ReploErrorConfig;
|
|
41
|
+
id: string;
|
|
42
|
+
constructor(config: ReploErrorConfig);
|
|
43
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReploError } from "../
|
|
2
|
-
import
|
|
1
|
+
import { ReploError } from "../reploError";
|
|
2
|
+
import * as z from "zod";
|
|
3
3
|
export declare class RedirectRuleValidationError extends ReploError {
|
|
4
4
|
}
|
|
5
5
|
export declare const redirectStatusSchema: z.ZodUnion<readonly [z.ZodLiteral<301>, z.ZodLiteral<302>, z.ZodLiteral<307>, z.ZodLiteral<308>]>;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { getParamSegment, getRouteParams, hasRouteParam, matchSource } from '../../../chunk-VPEVERWE.mjs';
|
|
2
|
-
import { parseUrl } from '../../../chunk-
|
|
3
|
-
import '../../../chunk-
|
|
4
|
-
import { ReploError } from '../../../chunk-
|
|
5
|
-
import '../../../chunk-
|
|
6
|
-
import '
|
|
7
|
-
import '../../../chunk-FNTGY7I5.mjs';
|
|
8
|
-
import '../../../chunk-UJCSKKID.mjs';
|
|
9
|
-
import { z } from 'zod';
|
|
2
|
+
import { parseUrl } from '../../../chunk-YGLYUC6R.mjs';
|
|
3
|
+
import '../../../chunk-IQCJXNJU.mjs';
|
|
4
|
+
import { ReploError } from '../../../chunk-DINTPZM2.mjs';
|
|
5
|
+
import '../../../chunk-JELVREEB.mjs';
|
|
6
|
+
import * as z from 'zod';
|
|
10
7
|
|
|
11
8
|
var RedirectRuleValidationError = class extends ReploError {
|
|
12
9
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as z from "zod";
|
|
2
2
|
export declare const SELECT_MODE_SELECTABLE_ATTRIBUTE = "data-replo-selectable";
|
|
3
3
|
export declare const SELECT_MODE_SELECTABLE_PAYLOAD_ATTRIBUTE = "data-replo-selectable-payload";
|
|
4
4
|
export declare const displayModeSchema: z.ZodEnum<{
|
|
5
5
|
browse: "browse";
|
|
6
6
|
selection: "selection";
|
|
7
|
+
comment: "comment";
|
|
7
8
|
}>;
|
|
8
9
|
export declare const selectModeInlineTextStatusSchema: z.ZodNullable<z.ZodEnum<{
|
|
9
10
|
editable: "editable";
|
|
@@ -46,6 +47,17 @@ export declare const selectModeBoundingRectSchema: z.ZodObject<{
|
|
|
46
47
|
width: z.ZodNumber;
|
|
47
48
|
height: z.ZodNumber;
|
|
48
49
|
}, z.core.$strip>;
|
|
50
|
+
export declare const selectModeHoverRectSchema: z.ZodObject<{
|
|
51
|
+
x: z.ZodNumber;
|
|
52
|
+
y: z.ZodNumber;
|
|
53
|
+
left: z.ZodNumber;
|
|
54
|
+
top: z.ZodNumber;
|
|
55
|
+
right: z.ZodNumber;
|
|
56
|
+
bottom: z.ZodNumber;
|
|
57
|
+
width: z.ZodNumber;
|
|
58
|
+
height: z.ZodNumber;
|
|
59
|
+
isSection: z.ZodOptional<z.ZodBoolean>;
|
|
60
|
+
}, z.core.$strip>;
|
|
49
61
|
export declare const selectModeSelectionRectSchema: z.ZodObject<{
|
|
50
62
|
id: z.ZodString;
|
|
51
63
|
rect: z.ZodObject<{
|
|
@@ -98,12 +110,47 @@ export declare function transformPoint({ point, offset, scale, }: {
|
|
|
98
110
|
scale?: number;
|
|
99
111
|
}): SelectModeClickPosition;
|
|
100
112
|
export declare function getIframeOffset(iframe: HTMLIFrameElement | null): RectOffset;
|
|
113
|
+
export declare const selectModeImageScopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
114
|
+
kind: z.ZodLiteral<"all">;
|
|
115
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
116
|
+
kind: z.ZodLiteral<"media">;
|
|
117
|
+
media: z.ZodString;
|
|
118
|
+
}, z.core.$strip>], "kind">;
|
|
119
|
+
export declare const selectModeImageSourceSchema: z.ZodObject<{
|
|
120
|
+
srcSet: z.ZodString;
|
|
121
|
+
sizes: z.ZodString;
|
|
122
|
+
media: z.ZodString;
|
|
123
|
+
type: z.ZodString;
|
|
124
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
125
|
+
}, z.core.$strip>;
|
|
126
|
+
export declare const selectModeImageSchema: z.ZodObject<{
|
|
127
|
+
src: z.ZodString;
|
|
128
|
+
currentSrc: z.ZodString;
|
|
129
|
+
srcSet: z.ZodString;
|
|
130
|
+
sizes: z.ZodString;
|
|
131
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
132
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
133
|
+
srcSet: z.ZodString;
|
|
134
|
+
sizes: z.ZodString;
|
|
135
|
+
media: z.ZodString;
|
|
136
|
+
type: z.ZodString;
|
|
137
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
138
|
+
}, z.core.$strip>>;
|
|
139
|
+
}, z.core.$strip>;
|
|
140
|
+
export declare const selectModeVideoSchema: z.ZodObject<{
|
|
141
|
+
src: z.ZodString;
|
|
142
|
+
currentSrc: z.ZodString;
|
|
143
|
+
}, z.core.$strip>;
|
|
101
144
|
export declare const selectedElementSchema: z.ZodObject<{
|
|
102
145
|
kind: z.ZodLiteral<"react-element">;
|
|
103
146
|
selector: z.ZodString;
|
|
147
|
+
section: z.ZodOptional<z.ZodObject<{
|
|
148
|
+
selector: z.ZodString;
|
|
149
|
+
}, z.core.$strip>>;
|
|
104
150
|
tagName: z.ZodString;
|
|
105
151
|
elementType: z.ZodString;
|
|
106
152
|
textContent: z.ZodNullable<z.ZodString>;
|
|
153
|
+
sectionLabel: z.ZodOptional<z.ZodString>;
|
|
107
154
|
rect: z.ZodObject<{
|
|
108
155
|
x: z.ZodNumber;
|
|
109
156
|
y: z.ZodNumber;
|
|
@@ -120,6 +167,24 @@ export declare const selectedElementSchema: z.ZodObject<{
|
|
|
120
167
|
lineHeight: z.ZodNumber;
|
|
121
168
|
}, z.core.$strip>>;
|
|
122
169
|
outerHTML: z.ZodString;
|
|
170
|
+
image: z.ZodOptional<z.ZodObject<{
|
|
171
|
+
src: z.ZodString;
|
|
172
|
+
currentSrc: z.ZodString;
|
|
173
|
+
srcSet: z.ZodString;
|
|
174
|
+
sizes: z.ZodString;
|
|
175
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
176
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
177
|
+
srcSet: z.ZodString;
|
|
178
|
+
sizes: z.ZodString;
|
|
179
|
+
media: z.ZodString;
|
|
180
|
+
type: z.ZodString;
|
|
181
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
182
|
+
}, z.core.$strip>>;
|
|
183
|
+
}, z.core.$strip>>;
|
|
184
|
+
video: z.ZodOptional<z.ZodObject<{
|
|
185
|
+
src: z.ZodString;
|
|
186
|
+
currentSrc: z.ZodString;
|
|
187
|
+
}, z.core.$strip>>;
|
|
123
188
|
definedStyles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
124
189
|
property: z.ZodString;
|
|
125
190
|
variant: z.ZodNullable<z.ZodObject<{
|
|
@@ -133,6 +198,7 @@ export declare const selectedElementSchema: z.ZodObject<{
|
|
|
133
198
|
raw: z.ZodString;
|
|
134
199
|
resolved: z.ZodString;
|
|
135
200
|
}, z.core.$strip>>>;
|
|
201
|
+
authoredStyles: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
136
202
|
inheritedStyles: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
137
203
|
clickPosition: z.ZodObject<{
|
|
138
204
|
x: z.ZodNumber;
|
|
@@ -156,6 +222,34 @@ export declare const selectedElementSchema: z.ZodObject<{
|
|
|
156
222
|
props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
157
223
|
}, z.core.$strip>>>;
|
|
158
224
|
siblingSelectors: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
225
|
+
anchor: z.ZodOptional<z.ZodObject<{
|
|
226
|
+
type: z.ZodLiteral<"element">;
|
|
227
|
+
semanticSelector: z.ZodOptional<z.ZodString>;
|
|
228
|
+
selector: z.ZodString;
|
|
229
|
+
nthOfTypePath: z.ZodString;
|
|
230
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
231
|
+
filePath: z.ZodString;
|
|
232
|
+
componentChain: z.ZodArray<z.ZodString>;
|
|
233
|
+
line: z.ZodOptional<z.ZodNumber>;
|
|
234
|
+
col: z.ZodOptional<z.ZodNumber>;
|
|
235
|
+
}, z.core.$strip>>;
|
|
236
|
+
listKey: z.ZodOptional<z.ZodString>;
|
|
237
|
+
tagName: z.ZodString;
|
|
238
|
+
textPreview: z.ZodString;
|
|
239
|
+
quote: z.ZodOptional<z.ZodObject<{
|
|
240
|
+
exact: z.ZodString;
|
|
241
|
+
prefix: z.ZodString;
|
|
242
|
+
suffix: z.ZodString;
|
|
243
|
+
}, z.core.$strip>>;
|
|
244
|
+
offset: z.ZodObject<{
|
|
245
|
+
x: z.ZodNumber;
|
|
246
|
+
y: z.ZodNumber;
|
|
247
|
+
}, z.core.$strip>;
|
|
248
|
+
context: z.ZodOptional<z.ZodObject<{
|
|
249
|
+
url: z.ZodString;
|
|
250
|
+
locale: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
251
|
+
}, z.core.$strip>>;
|
|
252
|
+
}, z.core.$strip>>;
|
|
159
253
|
}, z.core.$strip>;
|
|
160
254
|
export declare const selectablePlanDataSchema: z.ZodObject<{
|
|
161
255
|
kind: z.ZodLiteral<"plan">;
|
|
@@ -174,20 +268,24 @@ export declare const selectablePlanDataSchema: z.ZodObject<{
|
|
|
174
268
|
}, z.core.$strip>;
|
|
175
269
|
export declare const selectablePlanPayloadSchema: z.ZodObject<{
|
|
176
270
|
kind: z.ZodLiteral<"plan">;
|
|
177
|
-
planId: z.ZodString;
|
|
178
271
|
label: z.ZodString;
|
|
272
|
+
planId: z.ZodString;
|
|
179
273
|
}, z.core.$strip>;
|
|
180
274
|
export declare const selectableDataPayloadSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
181
275
|
kind: z.ZodLiteral<"plan">;
|
|
182
|
-
planId: z.ZodString;
|
|
183
276
|
label: z.ZodString;
|
|
277
|
+
planId: z.ZodString;
|
|
184
278
|
}, z.core.$strip>], "kind">;
|
|
185
279
|
export declare const selectableDataSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
186
280
|
kind: z.ZodLiteral<"react-element">;
|
|
187
281
|
selector: z.ZodString;
|
|
282
|
+
section: z.ZodOptional<z.ZodObject<{
|
|
283
|
+
selector: z.ZodString;
|
|
284
|
+
}, z.core.$strip>>;
|
|
188
285
|
tagName: z.ZodString;
|
|
189
286
|
elementType: z.ZodString;
|
|
190
287
|
textContent: z.ZodNullable<z.ZodString>;
|
|
288
|
+
sectionLabel: z.ZodOptional<z.ZodString>;
|
|
191
289
|
rect: z.ZodObject<{
|
|
192
290
|
x: z.ZodNumber;
|
|
193
291
|
y: z.ZodNumber;
|
|
@@ -204,6 +302,24 @@ export declare const selectableDataSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
|
|
|
204
302
|
lineHeight: z.ZodNumber;
|
|
205
303
|
}, z.core.$strip>>;
|
|
206
304
|
outerHTML: z.ZodString;
|
|
305
|
+
image: z.ZodOptional<z.ZodObject<{
|
|
306
|
+
src: z.ZodString;
|
|
307
|
+
currentSrc: z.ZodString;
|
|
308
|
+
srcSet: z.ZodString;
|
|
309
|
+
sizes: z.ZodString;
|
|
310
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
311
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
312
|
+
srcSet: z.ZodString;
|
|
313
|
+
sizes: z.ZodString;
|
|
314
|
+
media: z.ZodString;
|
|
315
|
+
type: z.ZodString;
|
|
316
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
317
|
+
}, z.core.$strip>>;
|
|
318
|
+
}, z.core.$strip>>;
|
|
319
|
+
video: z.ZodOptional<z.ZodObject<{
|
|
320
|
+
src: z.ZodString;
|
|
321
|
+
currentSrc: z.ZodString;
|
|
322
|
+
}, z.core.$strip>>;
|
|
207
323
|
definedStyles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
208
324
|
property: z.ZodString;
|
|
209
325
|
variant: z.ZodNullable<z.ZodObject<{
|
|
@@ -217,6 +333,7 @@ export declare const selectableDataSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
|
|
|
217
333
|
raw: z.ZodString;
|
|
218
334
|
resolved: z.ZodString;
|
|
219
335
|
}, z.core.$strip>>>;
|
|
336
|
+
authoredStyles: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
220
337
|
inheritedStyles: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
221
338
|
clickPosition: z.ZodObject<{
|
|
222
339
|
x: z.ZodNumber;
|
|
@@ -240,6 +357,34 @@ export declare const selectableDataSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
|
|
|
240
357
|
props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
241
358
|
}, z.core.$strip>>>;
|
|
242
359
|
siblingSelectors: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
360
|
+
anchor: z.ZodOptional<z.ZodObject<{
|
|
361
|
+
type: z.ZodLiteral<"element">;
|
|
362
|
+
semanticSelector: z.ZodOptional<z.ZodString>;
|
|
363
|
+
selector: z.ZodString;
|
|
364
|
+
nthOfTypePath: z.ZodString;
|
|
365
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
366
|
+
filePath: z.ZodString;
|
|
367
|
+
componentChain: z.ZodArray<z.ZodString>;
|
|
368
|
+
line: z.ZodOptional<z.ZodNumber>;
|
|
369
|
+
col: z.ZodOptional<z.ZodNumber>;
|
|
370
|
+
}, z.core.$strip>>;
|
|
371
|
+
listKey: z.ZodOptional<z.ZodString>;
|
|
372
|
+
tagName: z.ZodString;
|
|
373
|
+
textPreview: z.ZodString;
|
|
374
|
+
quote: z.ZodOptional<z.ZodObject<{
|
|
375
|
+
exact: z.ZodString;
|
|
376
|
+
prefix: z.ZodString;
|
|
377
|
+
suffix: z.ZodString;
|
|
378
|
+
}, z.core.$strip>>;
|
|
379
|
+
offset: z.ZodObject<{
|
|
380
|
+
x: z.ZodNumber;
|
|
381
|
+
y: z.ZodNumber;
|
|
382
|
+
}, z.core.$strip>;
|
|
383
|
+
context: z.ZodOptional<z.ZodObject<{
|
|
384
|
+
url: z.ZodString;
|
|
385
|
+
locale: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
386
|
+
}, z.core.$strip>>;
|
|
387
|
+
}, z.core.$strip>>;
|
|
243
388
|
}, z.core.$strip>, z.ZodObject<{
|
|
244
389
|
kind: z.ZodLiteral<"plan">;
|
|
245
390
|
planId: z.ZodString;
|
|
@@ -259,6 +404,7 @@ export type SelectModeBoundingRect = z.infer<typeof selectModeBoundingRectSchema
|
|
|
259
404
|
export type SelectModeClickPosition = z.infer<typeof selectModeClickPositionSchema>;
|
|
260
405
|
export type SelectableData = z.infer<typeof selectableDataSchema>;
|
|
261
406
|
export type SelectableDataPayload = z.infer<typeof selectableDataPayloadSchema>;
|
|
407
|
+
export declare function isSelectedSection(data: SelectableData): boolean;
|
|
262
408
|
export declare function transformSelectedElement({ element, offset, scale, }: {
|
|
263
409
|
element: z.infer<typeof selectedElementSchema>;
|
|
264
410
|
offset: RectOffset;
|
|
@@ -270,11 +416,31 @@ export declare function transformSelectableData({ data, offset, }: {
|
|
|
270
416
|
}): SelectableData;
|
|
271
417
|
export declare function readSelectablePayload(rawPayload: string | null): {
|
|
272
418
|
kind: "plan";
|
|
273
|
-
planId: string;
|
|
274
419
|
label: string;
|
|
420
|
+
planId: string;
|
|
275
421
|
} | null;
|
|
276
422
|
export declare const selectModeOptimisticUpdatePayloadSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
423
|
+
kind: z.ZodLiteral<"image">;
|
|
424
|
+
image: z.ZodObject<{
|
|
425
|
+
src: z.ZodString;
|
|
426
|
+
currentSrc: z.ZodString;
|
|
427
|
+
srcSet: z.ZodString;
|
|
428
|
+
sizes: z.ZodString;
|
|
429
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
430
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
431
|
+
srcSet: z.ZodString;
|
|
432
|
+
sizes: z.ZodString;
|
|
433
|
+
media: z.ZodString;
|
|
434
|
+
type: z.ZodString;
|
|
435
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
436
|
+
}, z.core.$strip>>;
|
|
437
|
+
}, z.core.$strip>;
|
|
438
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
277
439
|
kind: z.ZodLiteral<"css">;
|
|
440
|
+
fontSource: z.ZodOptional<z.ZodEnum<{
|
|
441
|
+
google: "google";
|
|
442
|
+
site: "site";
|
|
443
|
+
}>>;
|
|
278
444
|
property: z.ZodString;
|
|
279
445
|
value: z.ZodNullable<z.ZodString>;
|
|
280
446
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -343,9 +509,13 @@ export declare const selectModeSelectionSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
343
509
|
data: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
344
510
|
kind: z.ZodLiteral<"react-element">;
|
|
345
511
|
selector: z.ZodString;
|
|
512
|
+
section: z.ZodOptional<z.ZodObject<{
|
|
513
|
+
selector: z.ZodString;
|
|
514
|
+
}, z.core.$strip>>;
|
|
346
515
|
tagName: z.ZodString;
|
|
347
516
|
elementType: z.ZodString;
|
|
348
517
|
textContent: z.ZodNullable<z.ZodString>;
|
|
518
|
+
sectionLabel: z.ZodOptional<z.ZodString>;
|
|
349
519
|
rect: z.ZodObject<{
|
|
350
520
|
x: z.ZodNumber;
|
|
351
521
|
y: z.ZodNumber;
|
|
@@ -362,6 +532,24 @@ export declare const selectModeSelectionSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
362
532
|
lineHeight: z.ZodNumber;
|
|
363
533
|
}, z.core.$strip>>;
|
|
364
534
|
outerHTML: z.ZodString;
|
|
535
|
+
image: z.ZodOptional<z.ZodObject<{
|
|
536
|
+
src: z.ZodString;
|
|
537
|
+
currentSrc: z.ZodString;
|
|
538
|
+
srcSet: z.ZodString;
|
|
539
|
+
sizes: z.ZodString;
|
|
540
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
541
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
542
|
+
srcSet: z.ZodString;
|
|
543
|
+
sizes: z.ZodString;
|
|
544
|
+
media: z.ZodString;
|
|
545
|
+
type: z.ZodString;
|
|
546
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
547
|
+
}, z.core.$strip>>;
|
|
548
|
+
}, z.core.$strip>>;
|
|
549
|
+
video: z.ZodOptional<z.ZodObject<{
|
|
550
|
+
src: z.ZodString;
|
|
551
|
+
currentSrc: z.ZodString;
|
|
552
|
+
}, z.core.$strip>>;
|
|
365
553
|
definedStyles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
366
554
|
property: z.ZodString;
|
|
367
555
|
variant: z.ZodNullable<z.ZodObject<{
|
|
@@ -375,6 +563,7 @@ export declare const selectModeSelectionSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
375
563
|
raw: z.ZodString;
|
|
376
564
|
resolved: z.ZodString;
|
|
377
565
|
}, z.core.$strip>>>;
|
|
566
|
+
authoredStyles: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
378
567
|
inheritedStyles: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
379
568
|
clickPosition: z.ZodObject<{
|
|
380
569
|
x: z.ZodNumber;
|
|
@@ -398,6 +587,34 @@ export declare const selectModeSelectionSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
398
587
|
props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
399
588
|
}, z.core.$strip>>>;
|
|
400
589
|
siblingSelectors: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
590
|
+
anchor: z.ZodOptional<z.ZodObject<{
|
|
591
|
+
type: z.ZodLiteral<"element">;
|
|
592
|
+
semanticSelector: z.ZodOptional<z.ZodString>;
|
|
593
|
+
selector: z.ZodString;
|
|
594
|
+
nthOfTypePath: z.ZodString;
|
|
595
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
596
|
+
filePath: z.ZodString;
|
|
597
|
+
componentChain: z.ZodArray<z.ZodString>;
|
|
598
|
+
line: z.ZodOptional<z.ZodNumber>;
|
|
599
|
+
col: z.ZodOptional<z.ZodNumber>;
|
|
600
|
+
}, z.core.$strip>>;
|
|
601
|
+
listKey: z.ZodOptional<z.ZodString>;
|
|
602
|
+
tagName: z.ZodString;
|
|
603
|
+
textPreview: z.ZodString;
|
|
604
|
+
quote: z.ZodOptional<z.ZodObject<{
|
|
605
|
+
exact: z.ZodString;
|
|
606
|
+
prefix: z.ZodString;
|
|
607
|
+
suffix: z.ZodString;
|
|
608
|
+
}, z.core.$strip>>;
|
|
609
|
+
offset: z.ZodObject<{
|
|
610
|
+
x: z.ZodNumber;
|
|
611
|
+
y: z.ZodNumber;
|
|
612
|
+
}, z.core.$strip>;
|
|
613
|
+
context: z.ZodOptional<z.ZodObject<{
|
|
614
|
+
url: z.ZodString;
|
|
615
|
+
locale: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
616
|
+
}, z.core.$strip>>;
|
|
617
|
+
}, z.core.$strip>>;
|
|
401
618
|
}, z.core.$strip>, z.ZodObject<{
|
|
402
619
|
kind: z.ZodLiteral<"plan">;
|
|
403
620
|
planId: z.ZodString;
|
|
@@ -428,9 +645,13 @@ export declare const selectModeSelectionSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
428
645
|
items: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
429
646
|
kind: z.ZodLiteral<"react-element">;
|
|
430
647
|
selector: z.ZodString;
|
|
648
|
+
section: z.ZodOptional<z.ZodObject<{
|
|
649
|
+
selector: z.ZodString;
|
|
650
|
+
}, z.core.$strip>>;
|
|
431
651
|
tagName: z.ZodString;
|
|
432
652
|
elementType: z.ZodString;
|
|
433
653
|
textContent: z.ZodNullable<z.ZodString>;
|
|
654
|
+
sectionLabel: z.ZodOptional<z.ZodString>;
|
|
434
655
|
rect: z.ZodObject<{
|
|
435
656
|
x: z.ZodNumber;
|
|
436
657
|
y: z.ZodNumber;
|
|
@@ -447,6 +668,24 @@ export declare const selectModeSelectionSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
447
668
|
lineHeight: z.ZodNumber;
|
|
448
669
|
}, z.core.$strip>>;
|
|
449
670
|
outerHTML: z.ZodString;
|
|
671
|
+
image: z.ZodOptional<z.ZodObject<{
|
|
672
|
+
src: z.ZodString;
|
|
673
|
+
currentSrc: z.ZodString;
|
|
674
|
+
srcSet: z.ZodString;
|
|
675
|
+
sizes: z.ZodString;
|
|
676
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
677
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
678
|
+
srcSet: z.ZodString;
|
|
679
|
+
sizes: z.ZodString;
|
|
680
|
+
media: z.ZodString;
|
|
681
|
+
type: z.ZodString;
|
|
682
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
683
|
+
}, z.core.$strip>>;
|
|
684
|
+
}, z.core.$strip>>;
|
|
685
|
+
video: z.ZodOptional<z.ZodObject<{
|
|
686
|
+
src: z.ZodString;
|
|
687
|
+
currentSrc: z.ZodString;
|
|
688
|
+
}, z.core.$strip>>;
|
|
450
689
|
definedStyles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
451
690
|
property: z.ZodString;
|
|
452
691
|
variant: z.ZodNullable<z.ZodObject<{
|
|
@@ -460,6 +699,7 @@ export declare const selectModeSelectionSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
460
699
|
raw: z.ZodString;
|
|
461
700
|
resolved: z.ZodString;
|
|
462
701
|
}, z.core.$strip>>>;
|
|
702
|
+
authoredStyles: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
463
703
|
inheritedStyles: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
464
704
|
clickPosition: z.ZodObject<{
|
|
465
705
|
x: z.ZodNumber;
|
|
@@ -483,6 +723,34 @@ export declare const selectModeSelectionSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
483
723
|
props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
484
724
|
}, z.core.$strip>>>;
|
|
485
725
|
siblingSelectors: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
726
|
+
anchor: z.ZodOptional<z.ZodObject<{
|
|
727
|
+
type: z.ZodLiteral<"element">;
|
|
728
|
+
semanticSelector: z.ZodOptional<z.ZodString>;
|
|
729
|
+
selector: z.ZodString;
|
|
730
|
+
nthOfTypePath: z.ZodString;
|
|
731
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
732
|
+
filePath: z.ZodString;
|
|
733
|
+
componentChain: z.ZodArray<z.ZodString>;
|
|
734
|
+
line: z.ZodOptional<z.ZodNumber>;
|
|
735
|
+
col: z.ZodOptional<z.ZodNumber>;
|
|
736
|
+
}, z.core.$strip>>;
|
|
737
|
+
listKey: z.ZodOptional<z.ZodString>;
|
|
738
|
+
tagName: z.ZodString;
|
|
739
|
+
textPreview: z.ZodString;
|
|
740
|
+
quote: z.ZodOptional<z.ZodObject<{
|
|
741
|
+
exact: z.ZodString;
|
|
742
|
+
prefix: z.ZodString;
|
|
743
|
+
suffix: z.ZodString;
|
|
744
|
+
}, z.core.$strip>>;
|
|
745
|
+
offset: z.ZodObject<{
|
|
746
|
+
x: z.ZodNumber;
|
|
747
|
+
y: z.ZodNumber;
|
|
748
|
+
}, z.core.$strip>;
|
|
749
|
+
context: z.ZodOptional<z.ZodObject<{
|
|
750
|
+
url: z.ZodString;
|
|
751
|
+
locale: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
752
|
+
}, z.core.$strip>>;
|
|
753
|
+
}, z.core.$strip>>;
|
|
486
754
|
}, z.core.$strip>, z.ZodObject<{
|
|
487
755
|
kind: z.ZodLiteral<"plan">;
|
|
488
756
|
planId: z.ZodString;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
export { SELECT_MODE_SELECTABLE_ATTRIBUTE, SELECT_MODE_SELECTABLE_PAYLOAD_ATTRIBUTE, displayModeSchema, getIframeOffset, readSelectablePayload, selectModeBoundingRectSchema, selectModeClickPositionSchema, selectModeDefinedStyleSchema, selectModeFiberChainEntrySchema, selectModeFormatCommandSchema, selectModeInlineTextStatusSchema, selectModeOptimisticUpdatePayloadSchema, selectModeSelectionRectSchema, selectModeSelectionSchema, selectModeSelectionTypeSchema, selectModeSourceLocationSchema, selectModeStyleAtRuleSchema, selectModeStyleVariantSchema, selectModeTextMetricsSchema, selectModeTiptapActiveMarksSchema, selectableDataPayloadSchema, selectableDataSchema, selectablePlanDataSchema, selectablePlanPayloadSchema, selectedElementSchema, transformPoint, transformRect, transformSelectableData, transformSelectedElement } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
4
|
-
import '../../chunk-
|
|
5
|
-
import '../../chunk-FNTGY7I5.mjs';
|
|
6
|
-
import '../../chunk-UJCSKKID.mjs';
|
|
1
|
+
export { SELECT_MODE_SELECTABLE_ATTRIBUTE, SELECT_MODE_SELECTABLE_PAYLOAD_ATTRIBUTE, displayModeSchema, getIframeOffset, isSelectedSection, readSelectablePayload, selectModeBoundingRectSchema, selectModeClickPositionSchema, selectModeDefinedStyleSchema, selectModeFiberChainEntrySchema, selectModeFormatCommandSchema, selectModeHoverRectSchema, selectModeImageSchema, selectModeImageScopeSchema, selectModeImageSourceSchema, selectModeInlineTextStatusSchema, selectModeOptimisticUpdatePayloadSchema, selectModeSelectionRectSchema, selectModeSelectionSchema, selectModeSelectionTypeSchema, selectModeSourceLocationSchema, selectModeStyleAtRuleSchema, selectModeStyleVariantSchema, selectModeTextMetricsSchema, selectModeTiptapActiveMarksSchema, selectModeVideoSchema, selectableDataPayloadSchema, selectableDataSchema, selectablePlanDataSchema, selectablePlanPayloadSchema, selectedElementSchema, transformPoint, transformRect, transformSelectableData, transformSelectedElement } from '../../chunk-CJIK4NVP.mjs';
|
|
2
|
+
import '../../chunk-PQEA6P4V.mjs';
|
|
3
|
+
import '../../chunk-B7XDEXPL.mjs';
|
|
4
|
+
import '../../chunk-JELVREEB.mjs';
|