sanity 3.74.2-corel.18 → 3.74.2-coreui.20
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/lib/_chunks-cjs/runtime.js +8 -4
- package/lib/_chunks-cjs/runtime.js.map +1 -1
- package/lib/_chunks-cjs/version.js +1 -1
- package/lib/_chunks-es/version.mjs +1 -1
- package/lib/_legacy/version.esm.js +1 -1
- package/package.json +10 -11
- package/src/_internal/cli/server/renderDocument.tsx +12 -0
- package/src/_internal/cli/server/runtime.ts +13 -10
- package/src/_internal/cli/server/vite/plugin-sanity-build-entries.ts +14 -12
- package/dist/BroadcastDisplayedDocument-BHYI8o6u.mjs +0 -19
- package/dist/BroadcastDisplayedDocument-BHYI8o6u.mjs.map +0 -1
- package/dist/DisplayedDocumentBroadcaster-DfHPxc7C.mjs +0 -58
- package/dist/DisplayedDocumentBroadcaster-DfHPxc7C.mjs.map +0 -1
- package/dist/LiveQueries-sYvgBCKh.mjs +0 -267
- package/dist/LiveQueries-sYvgBCKh.mjs.map +0 -1
- package/dist/LoaderQueries-AQneabiG.mjs +0 -581
- package/dist/LoaderQueries-AQneabiG.mjs.map +0 -1
- package/dist/Observable-wwWYwtkh.mjs +0 -551
- package/dist/Observable-wwWYwtkh.mjs.map +0 -1
- package/dist/PostMessageDocuments-DLMdHDk6.mjs +0 -75
- package/dist/PostMessageDocuments-DLMdHDk6.mjs.map +0 -1
- package/dist/PostMessageFeatures-CazMQz3f.mjs +0 -21
- package/dist/PostMessageFeatures-CazMQz3f.mjs.map +0 -1
- package/dist/PostMessagePerspective-m4uZ6sI5.mjs +0 -23
- package/dist/PostMessagePerspective-m4uZ6sI5.mjs.map +0 -1
- package/dist/PostMessagePreviewSnapshots-Dr7CEAiM.mjs +0 -66
- package/dist/PostMessagePreviewSnapshots-Dr7CEAiM.mjs.map +0 -1
- package/dist/PostMessageRefreshMutations-CWb9UqSy.mjs +0 -66
- package/dist/PostMessageRefreshMutations-CWb9UqSy.mjs.map +0 -1
- package/dist/PostMessageSchema-BVFyZOH1.mjs +0 -514
- package/dist/PostMessageSchema-BVFyZOH1.mjs.map +0 -1
- package/dist/PostMessageTelemetry-CSluBvcC.mjs +0 -51
- package/dist/PostMessageTelemetry-CSluBvcC.mjs.map +0 -1
- package/dist/PresentationToolGrantsCheck-4zo266wj.mjs +0 -3919
- package/dist/PresentationToolGrantsCheck-4zo266wj.mjs.map +0 -1
- package/dist/QRCodeSVG-D6VfGEbM.mjs +0 -648
- package/dist/QRCodeSVG-D6VfGEbM.mjs.map +0 -1
- package/dist/SourceContext-T8zcpOpp.mjs +0 -33
- package/dist/SourceContext-T8zcpOpp.mjs.map +0 -1
- package/dist/StructureToolProvider-BMLps71e.mjs +0 -13815
- package/dist/StructureToolProvider-BMLps71e.mjs.map +0 -1
- package/dist/Subject-DP0DoUP_.mjs +0 -108
- package/dist/Subject-DP0DoUP_.mjs.map +0 -1
- package/dist/ViteDevServerStopped-DdibXNvO.mjs +0 -44
- package/dist/ViteDevServerStopped-DdibXNvO.mjs.map +0 -1
- package/dist/_createContext.mjs +0 -36
- package/dist/_createContext.mjs.map +0 -1
- package/dist/_singletons.mjs +0 -195
- package/dist/_singletons.mjs.map +0 -1
- package/dist/browser-BzDH2pyp.mjs +0 -455
- package/dist/browser-BzDH2pyp.mjs.map +0 -1
- package/dist/browser-DWCoWoiH.mjs +0 -3988
- package/dist/browser-DWCoWoiH.mjs.map +0 -1
- package/dist/debounceTime-BeoKrERE.mjs +0 -130
- package/dist/debounceTime-BeoKrERE.mjs.map +0 -1
- package/dist/desk.mjs +0 -52
- package/dist/desk.mjs.map +0 -1
- package/dist/first-Di4GZDIY.mjs +0 -42
- package/dist/first-Di4GZDIY.mjs.map +0 -1
- package/dist/get-psIoeD-z.mjs +0 -327
- package/dist/get-psIoeD-z.mjs.map +0 -1
- package/dist/hooks-4sgcd521.mjs +0 -90
- package/dist/hooks-4sgcd521.mjs.map +0 -1
- package/dist/index-9PJcXUTv.mjs +0 -87
- package/dist/index-9PJcXUTv.mjs.map +0 -1
- package/dist/index-ByFK-IwD.mjs +0 -528
- package/dist/index-ByFK-IwD.mjs.map +0 -1
- package/dist/index-C2OAo3To.mjs +0 -7079
- package/dist/index-C2OAo3To.mjs.map +0 -1
- package/dist/index-C3OvVLVP.mjs +0 -4636
- package/dist/index-C3OvVLVP.mjs.map +0 -1
- package/dist/index-DBPVDKJN.mjs +0 -1198
- package/dist/index-DBPVDKJN.mjs.map +0 -1
- package/dist/index-DkvUNBNf.mjs +0 -73
- package/dist/index-DkvUNBNf.mjs.map +0 -1
- package/dist/index-Sp9w8lMg.mjs +0 -118
- package/dist/index-Sp9w8lMg.mjs.map +0 -1
- package/dist/index.browser-BxT2qp9y.mjs +0 -104
- package/dist/index.browser-BxT2qp9y.mjs.map +0 -1
- package/dist/index.mjs +0 -129019
- package/dist/index.mjs.map +0 -1
- package/dist/isObservable-ByOheaM8.mjs +0 -8
- package/dist/isObservable-ByOheaM8.mjs.map +0 -1
- package/dist/never-ChKjLemk.mjs +0 -6
- package/dist/never-ChKjLemk.mjs.map +0 -1
- package/dist/pane-C4tskUPg.mjs +0 -5
- package/dist/pane-C4tskUPg.mjs.map +0 -1
- package/dist/pane-Dhx8FvsK.mjs +0 -5
- package/dist/pane-Dhx8FvsK.mjs.map +0 -1
- package/dist/presentation-CSS9GR9X.mjs +0 -984
- package/dist/presentation-CSS9GR9X.mjs.map +0 -1
- package/dist/presentation.mjs +0 -14
- package/dist/presentation.mjs.map +0 -1
- package/dist/resources-4cbq8YlR.mjs +0 -124
- package/dist/resources-4cbq8YlR.mjs.map +0 -1
- package/dist/resources-BVETz6Ur.mjs +0 -57
- package/dist/resources-BVETz6Ur.mjs.map +0 -1
- package/dist/resources-D4AaU75F.mjs +0 -434
- package/dist/resources-D4AaU75F.mjs.map +0 -1
- package/dist/resources-Dc-6ZcPg.mjs +0 -157
- package/dist/resources-Dc-6ZcPg.mjs.map +0 -1
- package/dist/resources-DgU0prBM.mjs +0 -179
- package/dist/resources-DgU0prBM.mjs.map +0 -1
- package/dist/resources-MD8RsYhH.mjs +0 -288
- package/dist/resources-MD8RsYhH.mjs.map +0 -1
- package/dist/router.mjs +0 -689
- package/dist/router.mjs.map +0 -1
- package/dist/share-bcOpIdQz.mjs +0 -71
- package/dist/share-bcOpIdQz.mjs.map +0 -1
- package/dist/shareReplay-Dj1O6fKV.mjs +0 -43
- package/dist/shareReplay-Dj1O6fKV.mjs.map +0 -1
- package/dist/stegaEncodeSourceMap-DXdUZQye.mjs +0 -342
- package/dist/stegaEncodeSourceMap-DXdUZQye.mjs.map +0 -1
- package/dist/structure.mjs +0 -56
- package/dist/structure.mjs.map +0 -1
- package/dist/takeUntil-CgZP1bze.mjs +0 -111
- package/dist/takeUntil-CgZP1bze.mjs.map +0 -1
- package/dist/v4-C78sE4Gb.mjs +0 -27082
- package/dist/v4-C78sE4Gb.mjs.map +0 -1
- package/dist/version-D7UZEoYI.mjs +0 -5
- package/dist/version-D7UZEoYI.mjs.map +0 -1
@@ -1,514 +0,0 @@
|
|
1
|
-
import { c as N, A as q } from "./presentation-CSS9GR9X.mjs";
|
2
|
-
import { b as U, c as C } from "./v4-C78sE4Gb.mjs";
|
3
|
-
import { memo as V, useEffect as k, createElement as P } from "react";
|
4
|
-
import { useWorkspace as B, useClient as L, getPublishedId as K } from "sanity";
|
5
|
-
import { renderToString as W } from "react-dom/server";
|
6
|
-
import { jsx as M } from "react/jsx-runtime";
|
7
|
-
import { ServerStyleSheet as z, StyleSheetManager as G } from "styled-components";
|
8
|
-
function H(n) {
|
9
|
-
const {
|
10
|
-
validation: e
|
11
|
-
} = n.type;
|
12
|
-
if (!e)
|
13
|
-
return !1;
|
14
|
-
const r = Array.isArray(e) ? e : [e];
|
15
|
-
for (const i of r) {
|
16
|
-
let f = !1;
|
17
|
-
const c = new Proxy({}, {
|
18
|
-
get: (g, d) => () => (d === "required" && (f = !0), c)
|
19
|
-
});
|
20
|
-
if (typeof i == "function" && (i(c), f) || typeof i == "object" && i !== null && "_required" in i && i._required === "required")
|
21
|
-
return !0;
|
22
|
-
}
|
23
|
-
return !1;
|
24
|
-
}
|
25
|
-
function v(n, e) {
|
26
|
-
let r = n;
|
27
|
-
for (; r; ) {
|
28
|
-
if (r.name === e || r.type && r.type.name === e)
|
29
|
-
return !0;
|
30
|
-
r = r.type;
|
31
|
-
}
|
32
|
-
return !1;
|
33
|
-
}
|
34
|
-
function J(n) {
|
35
|
-
return v(n, "object") || n.jsonType === "object" || "fields" in n;
|
36
|
-
}
|
37
|
-
function Q(n) {
|
38
|
-
return v(n, "array");
|
39
|
-
}
|
40
|
-
function F(n) {
|
41
|
-
return v(n, "reference");
|
42
|
-
}
|
43
|
-
function X(n) {
|
44
|
-
return v(n, "crossDatasetReference");
|
45
|
-
}
|
46
|
-
function Y(n) {
|
47
|
-
return v(n, "string");
|
48
|
-
}
|
49
|
-
function Z(n) {
|
50
|
-
return v(n, "number");
|
51
|
-
}
|
52
|
-
function $(n) {
|
53
|
-
let e = n;
|
54
|
-
for (; e; ) {
|
55
|
-
if (!e.type)
|
56
|
-
return e;
|
57
|
-
e = e.type;
|
58
|
-
}
|
59
|
-
}
|
60
|
-
function h(n) {
|
61
|
-
return "fields" in n ? n.type ? h(n.type).concat(n.fields) : n.fields : [];
|
62
|
-
}
|
63
|
-
function T(n) {
|
64
|
-
const e = /* @__PURE__ */ new Set();
|
65
|
-
function r(o, s) {
|
66
|
-
if (!e.has(o)) {
|
67
|
-
if (e.add(o), "fields" in o)
|
68
|
-
for (const l of h(o)) {
|
69
|
-
const t = $(l.type);
|
70
|
-
if (t.name === "document") {
|
71
|
-
s.add(t);
|
72
|
-
continue;
|
73
|
-
}
|
74
|
-
let u;
|
75
|
-
o.type.type ? u = l.type.type.name : "jsonType" in o.type && (u = l.type.jsonType), (u === "object" || u === "block") && (F(l.type) ? l.type.to.forEach((a) => s.add(a.type)) : s.add(l.type)), r(l.type, s);
|
76
|
-
}
|
77
|
-
else if ("of" in o)
|
78
|
-
for (const l of o.of)
|
79
|
-
r(l, s);
|
80
|
-
}
|
81
|
-
}
|
82
|
-
const i = /* @__PURE__ */ new Map();
|
83
|
-
n.getTypeNames().forEach((o) => {
|
84
|
-
const s = n.get(o);
|
85
|
-
if (s === void 0 || s.type === null)
|
86
|
-
return;
|
87
|
-
const l = /* @__PURE__ */ new Set();
|
88
|
-
r(s, l), i.set(s, l), e.clear();
|
89
|
-
});
|
90
|
-
const f = [], c = /* @__PURE__ */ new Set(), g = /* @__PURE__ */ new Set();
|
91
|
-
function d(o) {
|
92
|
-
if (g.has(o) || c.has(o))
|
93
|
-
return;
|
94
|
-
c.add(o);
|
95
|
-
const s = i.get(o);
|
96
|
-
s !== void 0 && s.forEach((l) => d(l)), c.delete(o), g.add(o), f.includes(o.name) || f.unshift(o.name);
|
97
|
-
}
|
98
|
-
for (const [o] of i)
|
99
|
-
d(o);
|
100
|
-
return f;
|
101
|
-
}
|
102
|
-
const ee = function(n) {
|
103
|
-
const e = N(6), {
|
104
|
-
schemaType: r,
|
105
|
-
theme: i
|
106
|
-
} = n, {
|
107
|
-
theme: f,
|
108
|
-
scheme: c,
|
109
|
-
tone: g
|
110
|
-
} = i;
|
111
|
-
let d;
|
112
|
-
e[0] === Symbol.for("react.memo_cache_sentinel") ? (d = new z(), e[0] = d) : d = e[0];
|
113
|
-
const o = d;
|
114
|
-
let s;
|
115
|
-
return e[1] !== r.icon || e[2] !== c || e[3] !== f || e[4] !== g ? (s = r.icon ? /* @__PURE__ */ M(G, { sheet: o.instance, children: /* @__PURE__ */ M(C, { theme: f, scheme: c, tone: g, children: P(r.icon) }) }) : null, e[1] = r.icon, e[2] = c, e[3] = f, e[4] = g, e[5] = s) : s = e[5], s;
|
116
|
-
}, te = (n) => ({
|
117
|
-
_id: {
|
118
|
-
type: "objectField",
|
119
|
-
name: "_id",
|
120
|
-
value: {
|
121
|
-
type: "string"
|
122
|
-
}
|
123
|
-
},
|
124
|
-
_type: {
|
125
|
-
type: "objectField",
|
126
|
-
name: "_type",
|
127
|
-
value: {
|
128
|
-
type: "string",
|
129
|
-
value: n
|
130
|
-
}
|
131
|
-
},
|
132
|
-
_createdAt: {
|
133
|
-
type: "objectField",
|
134
|
-
name: "_createdAt",
|
135
|
-
value: {
|
136
|
-
type: "string"
|
137
|
-
}
|
138
|
-
},
|
139
|
-
_updatedAt: {
|
140
|
-
type: "objectField",
|
141
|
-
name: "_updatedAt",
|
142
|
-
value: {
|
143
|
-
type: "string"
|
144
|
-
}
|
145
|
-
},
|
146
|
-
_rev: {
|
147
|
-
type: "objectField",
|
148
|
-
name: "_rev",
|
149
|
-
value: {
|
150
|
-
type: "string"
|
151
|
-
}
|
152
|
-
}
|
153
|
-
});
|
154
|
-
function ne(n) {
|
155
|
-
var r;
|
156
|
-
const e = (r = n.options) == null ? void 0 : r.list;
|
157
|
-
return e && Array.isArray(e) ? {
|
158
|
-
type: "union",
|
159
|
-
of: e.map((i) => ({
|
160
|
-
type: "string",
|
161
|
-
value: typeof i == "string" ? i : i.value
|
162
|
-
}))
|
163
|
-
} : {
|
164
|
-
type: "string"
|
165
|
-
};
|
166
|
-
}
|
167
|
-
function re(n) {
|
168
|
-
var r;
|
169
|
-
const e = (r = n.options) == null ? void 0 : r.list;
|
170
|
-
return e && Array.isArray(e) ? {
|
171
|
-
type: "union",
|
172
|
-
of: e.map((i) => ({
|
173
|
-
type: "number",
|
174
|
-
value: typeof i == "number" ? i : i.value
|
175
|
-
}))
|
176
|
-
} : {
|
177
|
-
type: "number"
|
178
|
-
};
|
179
|
-
}
|
180
|
-
function A(n, e = !1) {
|
181
|
-
const r = {
|
182
|
-
_ref: {
|
183
|
-
type: "objectField",
|
184
|
-
name: "_ref",
|
185
|
-
value: {
|
186
|
-
type: "string"
|
187
|
-
}
|
188
|
-
},
|
189
|
-
_type: {
|
190
|
-
type: "objectField",
|
191
|
-
name: "_type",
|
192
|
-
value: {
|
193
|
-
type: "string",
|
194
|
-
value: "reference"
|
195
|
-
}
|
196
|
-
},
|
197
|
-
_weak: {
|
198
|
-
type: "objectField",
|
199
|
-
name: "_weak",
|
200
|
-
value: {
|
201
|
-
type: "boolean"
|
202
|
-
},
|
203
|
-
optional: !0
|
204
|
-
}
|
205
|
-
};
|
206
|
-
return e && (r._key = {
|
207
|
-
type: "objectField",
|
208
|
-
name: "_key",
|
209
|
-
value: {
|
210
|
-
type: "string"
|
211
|
-
}
|
212
|
-
}), {
|
213
|
-
type: "object",
|
214
|
-
fields: r,
|
215
|
-
dereferencesTo: n
|
216
|
-
};
|
217
|
-
}
|
218
|
-
function ie(n) {
|
219
|
-
const e = oe(n);
|
220
|
-
return e.length === 1 ? A(e[0]) : {
|
221
|
-
type: "union",
|
222
|
-
of: e.map((r) => ({
|
223
|
-
type: "unionOption",
|
224
|
-
name: r,
|
225
|
-
value: A(r)
|
226
|
-
}))
|
227
|
-
};
|
228
|
-
}
|
229
|
-
function oe(n) {
|
230
|
-
const e = I(n);
|
231
|
-
return [.../* @__PURE__ */ new Set([...e.map((r) => r.name)])];
|
232
|
-
}
|
233
|
-
function I(n) {
|
234
|
-
const e = "to" in n ? n.to : [];
|
235
|
-
return "type" in n && F(n.type) ? [...I(n.type), ...e] : e;
|
236
|
-
}
|
237
|
-
const S = /* @__PURE__ */ new Map([["text", {
|
238
|
-
type: "string"
|
239
|
-
}], ["url", {
|
240
|
-
type: "string"
|
241
|
-
}], ["datetime", {
|
242
|
-
type: "string"
|
243
|
-
}], ["date", {
|
244
|
-
type: "string"
|
245
|
-
}], ["boolean", {
|
246
|
-
type: "boolean"
|
247
|
-
}], ["email", {
|
248
|
-
type: "string"
|
249
|
-
}]]);
|
250
|
-
function ue(n, e) {
|
251
|
-
const r = /* @__PURE__ */ new Set(), {
|
252
|
-
schema: i,
|
253
|
-
basePath: f
|
254
|
-
} = n;
|
255
|
-
return T(i).map((t) => {
|
256
|
-
const u = i.get(t);
|
257
|
-
if (u === void 0)
|
258
|
-
return;
|
259
|
-
const a = g(u);
|
260
|
-
if (a !== null)
|
261
|
-
return a.type === "type" && r.add(u), a;
|
262
|
-
}).filter((t) => t !== void 0);
|
263
|
-
function c(t) {
|
264
|
-
if (t.icon)
|
265
|
-
return W(P(ee, {
|
266
|
-
schemaType: t,
|
267
|
-
theme: e
|
268
|
-
}));
|
269
|
-
}
|
270
|
-
function g(t) {
|
271
|
-
let u;
|
272
|
-
if (t.type ? u = t.type.name : "jsonType" in t && (u = t.jsonType), u === "document") {
|
273
|
-
const y = d(t);
|
274
|
-
return y.type === "unknown" ? null : {
|
275
|
-
type: "document",
|
276
|
-
name: t.name,
|
277
|
-
title: typeof t.title == "string" ? t.title : void 0,
|
278
|
-
icon: c(t),
|
279
|
-
fields: {
|
280
|
-
...te(t.name),
|
281
|
-
...y.fields
|
282
|
-
}
|
283
|
-
};
|
284
|
-
}
|
285
|
-
const a = o(t);
|
286
|
-
return a.type === "unknown" ? null : a.type === "object" ? {
|
287
|
-
name: t.name,
|
288
|
-
type: "type",
|
289
|
-
value: {
|
290
|
-
type: "object",
|
291
|
-
fields: {
|
292
|
-
_type: {
|
293
|
-
type: "objectField",
|
294
|
-
name: "_type",
|
295
|
-
value: {
|
296
|
-
type: "string",
|
297
|
-
value: t.name
|
298
|
-
}
|
299
|
-
},
|
300
|
-
...a.fields
|
301
|
-
}
|
302
|
-
}
|
303
|
-
} : {
|
304
|
-
name: t.name,
|
305
|
-
title: typeof t.title == "string" ? t.title : void 0,
|
306
|
-
type: "type",
|
307
|
-
value: a
|
308
|
-
};
|
309
|
-
}
|
310
|
-
function d(t) {
|
311
|
-
const u = {};
|
312
|
-
for (const a of h(t)) {
|
313
|
-
const y = o(a.type);
|
314
|
-
y !== null && (u[a.name] = {
|
315
|
-
type: "objectField",
|
316
|
-
name: a.name,
|
317
|
-
title: typeof a.type.title == "string" ? a.type.title : void 0,
|
318
|
-
value: y,
|
319
|
-
optional: H(a) === !1
|
320
|
-
});
|
321
|
-
}
|
322
|
-
return {
|
323
|
-
type: "object",
|
324
|
-
fields: u
|
325
|
-
};
|
326
|
-
}
|
327
|
-
function o(t) {
|
328
|
-
var a, y, b, p;
|
329
|
-
if (((a = $(t)) == null ? void 0 : a.name) === "document")
|
330
|
-
return A(t.name);
|
331
|
-
if (r.has(t.type))
|
332
|
-
return {
|
333
|
-
type: "inline",
|
334
|
-
name: t.type.name
|
335
|
-
};
|
336
|
-
if (((b = (y = t.type) == null ? void 0 : y.type) == null ? void 0 : b.name) === "object")
|
337
|
-
return {
|
338
|
-
type: "inline",
|
339
|
-
name: t.type.name
|
340
|
-
};
|
341
|
-
if (Y(t))
|
342
|
-
return ne(t);
|
343
|
-
if (Z(t))
|
344
|
-
return re(t);
|
345
|
-
const u = S.get(((p = t.type) == null ? void 0 : p.name) || "");
|
346
|
-
if (u)
|
347
|
-
return u;
|
348
|
-
if (t.type && S.has(t.type.name))
|
349
|
-
return S.get(t.type.name);
|
350
|
-
if (X(t))
|
351
|
-
return {
|
352
|
-
type: "unknown"
|
353
|
-
};
|
354
|
-
if (F(t))
|
355
|
-
return ie(t);
|
356
|
-
if (Q(t))
|
357
|
-
return l(t);
|
358
|
-
if (J(t))
|
359
|
-
return d(t);
|
360
|
-
throw new Error(`Type "${t.name}" not found`);
|
361
|
-
}
|
362
|
-
function s(t, u) {
|
363
|
-
var b;
|
364
|
-
const {
|
365
|
-
options: a
|
366
|
-
} = t;
|
367
|
-
if (!a) return;
|
368
|
-
const y = {
|
369
|
-
...a
|
370
|
-
};
|
371
|
-
return a.insertMenu && (y.insertMenu = {
|
372
|
-
...a.insertMenu,
|
373
|
-
views: (b = a.insertMenu.views) == null ? void 0 : b.map((p) => p.name === "grid" ? {
|
374
|
-
name: "grid",
|
375
|
-
previewImageUrls: p.previewImageUrl ? u.reduce((m, {
|
376
|
-
name: _
|
377
|
-
}) => {
|
378
|
-
var w;
|
379
|
-
const j = (w = p.previewImageUrl) == null ? void 0 : w.call(p, _);
|
380
|
-
if (!j) return m;
|
381
|
-
try {
|
382
|
-
new URL(j), m[_] = j;
|
383
|
-
} catch {
|
384
|
-
m[_] = new URL(j, `${window.location.origin}${f ? `${f}/` : ""}`).toString();
|
385
|
-
}
|
386
|
-
return m;
|
387
|
-
}, {}) : void 0
|
388
|
-
} : p)
|
389
|
-
}), y;
|
390
|
-
}
|
391
|
-
function l(t) {
|
392
|
-
const u = [];
|
393
|
-
for (const p of t.of) {
|
394
|
-
let m = o(p);
|
395
|
-
const _ = {
|
396
|
-
type: "unionOption",
|
397
|
-
icon: c(p),
|
398
|
-
name: p.name,
|
399
|
-
title: typeof p.title == "string" ? p.title : void 0,
|
400
|
-
value: m
|
401
|
-
};
|
402
|
-
m.type === "inline" ? m = {
|
403
|
-
type: "object",
|
404
|
-
fields: {
|
405
|
-
_key: R()
|
406
|
-
},
|
407
|
-
rest: m
|
408
|
-
} : m.type === "object" && (m.rest = {
|
409
|
-
type: "object",
|
410
|
-
fields: {
|
411
|
-
_key: R()
|
412
|
-
}
|
413
|
-
}), _.value = m, u.push(_);
|
414
|
-
}
|
415
|
-
if (u.length === 0)
|
416
|
-
return {
|
417
|
-
type: "null"
|
418
|
-
};
|
419
|
-
if (u.length > 1)
|
420
|
-
return {
|
421
|
-
type: "union",
|
422
|
-
of: u,
|
423
|
-
options: s(t, u)
|
424
|
-
};
|
425
|
-
const {
|
426
|
-
name: a,
|
427
|
-
title: y,
|
428
|
-
value: b
|
429
|
-
} = u[0];
|
430
|
-
return {
|
431
|
-
type: "array",
|
432
|
-
of: {
|
433
|
-
type: "arrayItem",
|
434
|
-
name: a,
|
435
|
-
title: typeof y == "string" ? y : void 0,
|
436
|
-
value: b
|
437
|
-
}
|
438
|
-
};
|
439
|
-
}
|
440
|
-
}
|
441
|
-
function R() {
|
442
|
-
return {
|
443
|
-
type: "objectField",
|
444
|
-
name: "_key",
|
445
|
-
value: {
|
446
|
-
type: "string"
|
447
|
-
}
|
448
|
-
};
|
449
|
-
}
|
450
|
-
function ae(n) {
|
451
|
-
const e = n.reduce((r, {
|
452
|
-
id: i,
|
453
|
-
path: f
|
454
|
-
}) => (r[i] ? r[i].add(f) : r[i] = /* @__PURE__ */ new Set([f]), r), {});
|
455
|
-
return Object.entries(e);
|
456
|
-
}
|
457
|
-
function se(n) {
|
458
|
-
const e = N(11), {
|
459
|
-
comlink: r,
|
460
|
-
perspective: i
|
461
|
-
} = n, f = B(), c = U();
|
462
|
-
let g, d;
|
463
|
-
e[0] !== r || e[1] !== c || e[2] !== f ? (g = () => {
|
464
|
-
const u = ue(f, c);
|
465
|
-
return r.post("presentation/schema", {
|
466
|
-
schema: u
|
467
|
-
}), r.on("visual-editing/schema", () => ({
|
468
|
-
schema: u
|
469
|
-
}));
|
470
|
-
}, d = [r, c, f], e[0] = r, e[1] = c, e[2] = f, e[3] = g, e[4] = d) : (g = e[3], d = e[4]), k(g, d);
|
471
|
-
let o;
|
472
|
-
e[5] === Symbol.for("react.memo_cache_sentinel") ? (o = {
|
473
|
-
apiVersion: q
|
474
|
-
}, e[5] = o) : o = e[5];
|
475
|
-
const s = L(o);
|
476
|
-
let l, t;
|
477
|
-
return e[6] !== s || e[7] !== r || e[8] !== i ? (l = () => r.on("visual-editing/schema-union-types", async (u) => {
|
478
|
-
const a = ae(u.paths), y = await Promise.all(a.map(async (p) => {
|
479
|
-
const [m, _] = p, j = Array.from(_), w = `*[_id == $id][0]{${j.map(le).join(",")}}`, O = await s.fetch(w, {
|
480
|
-
id: K(m)
|
481
|
-
}, {
|
482
|
-
tag: "presentation-schema",
|
483
|
-
perspective: i
|
484
|
-
}), x = j.map((D, E) => ({
|
485
|
-
path: D,
|
486
|
-
type: O[E]
|
487
|
-
}));
|
488
|
-
return {
|
489
|
-
id: m,
|
490
|
-
paths: x
|
491
|
-
};
|
492
|
-
})), b = /* @__PURE__ */ new Map();
|
493
|
-
return y.forEach((p) => {
|
494
|
-
b.set(p.id, new Map(p.paths.map(fe)));
|
495
|
-
}), {
|
496
|
-
types: b
|
497
|
-
};
|
498
|
-
}), t = [r, s, i], e[6] = s, e[7] = r, e[8] = i, e[9] = l, e[10] = t) : (l = e[9], t = e[10]), k(l, t), null;
|
499
|
-
}
|
500
|
-
function fe(n) {
|
501
|
-
const {
|
502
|
-
path: e,
|
503
|
-
type: r
|
504
|
-
} = n;
|
505
|
-
return [e, r];
|
506
|
-
}
|
507
|
-
function le(n, e) {
|
508
|
-
return `"${e}": ${n}[0]._type`;
|
509
|
-
}
|
510
|
-
var _e = V(se);
|
511
|
-
export {
|
512
|
-
_e as default
|
513
|
-
};
|
514
|
-
//# sourceMappingURL=PostMessageSchema-BVFyZOH1.mjs.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"PostMessageSchema-BVFyZOH1.mjs","sources":["../../../node_modules/.pnpm/@sanity+presentation@1.19.14-release.0_@emotion+is-prop-valid@1.3.1_@sanity+color@3.0.6_debug_vqegs67ktulknun2leapg5jvli/node_modules/@sanity/presentation/dist/_chunks-es/PostMessageSchema.js"],"sourcesContent":["import { c } from \"react-compiler-runtime\";\nimport { ThemeProvider, useRootTheme } from \"@sanity/ui\";\nimport { createElement, memo, useEffect } from \"react\";\nimport { API_VERSION } from \"./index.js\";\nimport { useWorkspace, useClient, getPublishedId } from \"sanity\";\nimport { renderToString } from \"react-dom/server\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { ServerStyleSheet, StyleSheetManager } from \"styled-components\";\nfunction isFieldRequired(field) {\n const {\n validation\n } = field.type;\n if (!validation)\n return !1;\n const rules = Array.isArray(validation) ? validation : [validation];\n for (const rule of rules) {\n let required = !1;\n const proxy = new Proxy({}, {\n get: (target, methodName) => () => (methodName === \"required\" && (required = !0), proxy)\n });\n if (typeof rule == \"function\" && (rule(proxy), required) || typeof rule == \"object\" && rule !== null && \"_required\" in rule && rule._required === \"required\")\n return !0;\n }\n return !1;\n}\nfunction isType(typeDef, typeName) {\n let type = typeDef;\n for (; type; ) {\n if (type.name === typeName || type.type && type.type.name === typeName)\n return !0;\n type = type.type;\n }\n return !1;\n}\nfunction isObjectType(typeDef) {\n return isType(typeDef, \"object\") || typeDef.jsonType === \"object\" || \"fields\" in typeDef;\n}\nfunction isArrayType(typeDef) {\n return isType(typeDef, \"array\");\n}\nfunction isReferenceType(typeDef) {\n return isType(typeDef, \"reference\");\n}\nfunction isCrossDatasetReferenceType(typeDef) {\n return isType(typeDef, \"crossDatasetReference\");\n}\nfunction isStringType(typeDef) {\n return isType(typeDef, \"string\");\n}\nfunction isNumberType(typeDef) {\n return isType(typeDef, \"number\");\n}\nfunction lastType(typeDef) {\n let type = typeDef;\n for (; type; ) {\n if (!type.type)\n return type;\n type = type.type;\n }\n}\nfunction gatherFields(type) {\n return \"fields\" in type ? type.type ? gatherFields(type.type).concat(type.fields) : type.fields : [];\n}\nfunction sortByDependencies(compiledSchema) {\n const seen = /* @__PURE__ */ new Set();\n function walkDependencies(schemaType, dependencies) {\n if (!seen.has(schemaType)) {\n if (seen.add(schemaType), \"fields\" in schemaType)\n for (const field of gatherFields(schemaType)) {\n const last = lastType(field.type);\n if (last.name === \"document\") {\n dependencies.add(last);\n continue;\n }\n let schemaTypeName;\n schemaType.type.type ? schemaTypeName = field.type.type.name : \"jsonType\" in schemaType.type && (schemaTypeName = field.type.jsonType), (schemaTypeName === \"object\" || schemaTypeName === \"block\") && (isReferenceType(field.type) ? field.type.to.forEach((ref) => dependencies.add(ref.type)) : dependencies.add(field.type)), walkDependencies(field.type, dependencies);\n }\n else if (\"of\" in schemaType)\n for (const item of schemaType.of)\n walkDependencies(item, dependencies);\n }\n }\n const dependencyMap = /* @__PURE__ */ new Map();\n compiledSchema.getTypeNames().forEach((typeName) => {\n const schemaType = compiledSchema.get(typeName);\n if (schemaType === void 0 || schemaType.type === null)\n return;\n const dependencies = /* @__PURE__ */ new Set();\n walkDependencies(schemaType, dependencies), dependencyMap.set(schemaType, dependencies), seen.clear();\n });\n const typeNames = [], currentlyVisiting = /* @__PURE__ */ new Set(), visited = /* @__PURE__ */ new Set();\n function visit(type) {\n if (visited.has(type) || currentlyVisiting.has(type))\n return;\n currentlyVisiting.add(type);\n const deps = dependencyMap.get(type);\n deps !== void 0 && deps.forEach((dep) => visit(dep)), currentlyVisiting.delete(type), visited.add(type), typeNames.includes(type.name) || typeNames.unshift(type.name);\n }\n for (const [type] of dependencyMap)\n visit(type);\n return typeNames;\n}\nconst SchemaIcon = function(t0) {\n const $ = c(6), {\n schemaType,\n theme: themeContext\n } = t0, {\n theme,\n scheme,\n tone\n } = themeContext;\n let t1;\n $[0] === Symbol.for(\"react.memo_cache_sentinel\") ? (t1 = new ServerStyleSheet(), $[0] = t1) : t1 = $[0];\n const sheet = t1;\n let t2;\n return $[1] !== schemaType.icon || $[2] !== scheme || $[3] !== theme || $[4] !== tone ? (t2 = schemaType.icon ? /* @__PURE__ */ jsx(StyleSheetManager, { sheet: sheet.instance, children: /* @__PURE__ */ jsx(ThemeProvider, { theme, scheme, tone, children: createElement(schemaType.icon) }) }) : null, $[1] = schemaType.icon, $[2] = scheme, $[3] = theme, $[4] = tone, $[5] = t2) : t2 = $[5], t2;\n}, documentDefaultFields = (typeName) => ({\n _id: {\n type: \"objectField\",\n name: \"_id\",\n value: {\n type: \"string\"\n }\n },\n _type: {\n type: \"objectField\",\n name: \"_type\",\n value: {\n type: \"string\",\n value: typeName\n }\n },\n _createdAt: {\n type: \"objectField\",\n name: \"_createdAt\",\n value: {\n type: \"string\"\n }\n },\n _updatedAt: {\n type: \"objectField\",\n name: \"_updatedAt\",\n value: {\n type: \"string\"\n }\n },\n _rev: {\n type: \"objectField\",\n name: \"_rev\",\n value: {\n type: \"string\"\n }\n }\n});\nfunction createStringNodeDefintion(stringSchemaType) {\n const listOptions = stringSchemaType.options?.list;\n return listOptions && Array.isArray(listOptions) ? {\n type: \"union\",\n of: listOptions.map((v) => ({\n type: \"string\",\n value: typeof v == \"string\" ? v : v.value\n }))\n } : {\n type: \"string\"\n };\n}\nfunction createNumberNodeDefintion(numberSchemaType) {\n const listOptions = numberSchemaType.options?.list;\n return listOptions && Array.isArray(listOptions) ? {\n type: \"union\",\n of: listOptions.map((v) => ({\n type: \"number\",\n value: typeof v == \"number\" ? v : v.value\n }))\n } : {\n type: \"number\"\n };\n}\nfunction createReferenceNode(name, inArray = !1) {\n const fields = {\n _ref: {\n type: \"objectField\",\n name: \"_ref\",\n value: {\n type: \"string\"\n }\n },\n _type: {\n type: \"objectField\",\n name: \"_type\",\n value: {\n type: \"string\",\n value: \"reference\"\n }\n },\n _weak: {\n type: \"objectField\",\n name: \"_weak\",\n value: {\n type: \"boolean\"\n },\n optional: !0\n }\n };\n return inArray && (fields._key = {\n type: \"objectField\",\n name: \"_key\",\n value: {\n type: \"string\"\n }\n }), {\n type: \"object\",\n fields,\n dereferencesTo: name\n };\n}\nfunction createReferenceNodeDefintion(reference) {\n const references = gatherReferenceNames(reference);\n return references.length === 1 ? createReferenceNode(references[0]) : {\n type: \"union\",\n of: references.map((name) => ({\n type: \"unionOption\",\n name,\n value: createReferenceNode(name)\n }))\n };\n}\nfunction gatherReferenceNames(type) {\n const allReferences = gatherReferenceTypes(type);\n return [.../* @__PURE__ */ new Set([...allReferences.map((ref) => ref.name)])];\n}\nfunction gatherReferenceTypes(type) {\n const refTo = \"to\" in type ? type.to : [];\n return \"type\" in type && isReferenceType(type.type) ? [...gatherReferenceTypes(type.type), ...refTo] : refTo;\n}\nconst typesMap = /* @__PURE__ */ new Map([[\"text\", {\n type: \"string\"\n}], [\"url\", {\n type: \"string\"\n}], [\"datetime\", {\n type: \"string\"\n}], [\"date\", {\n type: \"string\"\n}], [\"boolean\", {\n type: \"boolean\"\n}], [\"email\", {\n type: \"string\"\n}]]);\nfunction extractSchema(workspace, theme) {\n const inlineFields = /* @__PURE__ */ new Set(), {\n schema: schemaDef,\n basePath\n } = workspace;\n return sortByDependencies(schemaDef).map((typeName) => {\n const schemaType = schemaDef.get(typeName);\n if (schemaType === void 0)\n return;\n const base = convertBaseType(schemaType);\n if (base !== null)\n return base.type === \"type\" && inlineFields.add(schemaType), base;\n }).filter((type) => type !== void 0);\n function extractIcon(schemaType) {\n if (schemaType.icon)\n return renderToString(createElement(SchemaIcon, {\n schemaType,\n theme\n }));\n }\n function convertBaseType(schemaType) {\n let typeName;\n if (schemaType.type ? typeName = schemaType.type.name : \"jsonType\" in schemaType && (typeName = schemaType.jsonType), typeName === \"document\") {\n const object = createObject(schemaType);\n return object.type === \"unknown\" ? null : {\n type: \"document\",\n name: schemaType.name,\n title: typeof schemaType.title == \"string\" ? schemaType.title : void 0,\n icon: extractIcon(schemaType),\n fields: {\n ...documentDefaultFields(schemaType.name),\n ...object.fields\n }\n };\n }\n const value = convertSchemaType(schemaType);\n return value.type === \"unknown\" ? null : value.type === \"object\" ? {\n name: schemaType.name,\n type: \"type\",\n value: {\n type: \"object\",\n fields: {\n _type: {\n type: \"objectField\",\n name: \"_type\",\n value: {\n type: \"string\",\n value: schemaType.name\n }\n },\n ...value.fields\n }\n }\n } : {\n name: schemaType.name,\n title: typeof schemaType.title == \"string\" ? schemaType.title : void 0,\n type: \"type\",\n value\n };\n }\n function createObject(schemaType) {\n const fields = {};\n for (const field of gatherFields(schemaType)) {\n const value = convertSchemaType(field.type);\n value !== null && (fields[field.name] = {\n type: \"objectField\",\n name: field.name,\n title: typeof field.type.title == \"string\" ? field.type.title : void 0,\n value,\n optional: isFieldRequired(field) === !1\n });\n }\n return {\n type: \"object\",\n fields\n };\n }\n function convertSchemaType(schemaType) {\n if (lastType(schemaType)?.name === \"document\")\n return createReferenceNode(schemaType.name);\n if (inlineFields.has(schemaType.type))\n return {\n type: \"inline\",\n name: schemaType.type.name\n };\n if (schemaType.type?.type?.name === \"object\")\n return {\n type: \"inline\",\n name: schemaType.type.name\n };\n if (isStringType(schemaType))\n return createStringNodeDefintion(schemaType);\n if (isNumberType(schemaType))\n return createNumberNodeDefintion(schemaType);\n const mapped = typesMap.get(schemaType.type?.name || \"\");\n if (mapped)\n return mapped;\n if (schemaType.type && typesMap.has(schemaType.type.name))\n return typesMap.get(schemaType.type.name);\n if (isCrossDatasetReferenceType(schemaType))\n return {\n type: \"unknown\"\n };\n if (isReferenceType(schemaType))\n return createReferenceNodeDefintion(schemaType);\n if (isArrayType(schemaType))\n return createArray(schemaType);\n if (isObjectType(schemaType))\n return createObject(schemaType);\n throw new Error(`Type \"${schemaType.name}\" not found`);\n }\n function createUnionNodeOptions(schemaType, of) {\n const {\n options\n } = schemaType;\n if (!options) return;\n const opts = {\n ...options\n };\n return options.insertMenu && (opts.insertMenu = {\n ...options.insertMenu,\n views: options.insertMenu.views?.map((view) => view.name === \"grid\" ? {\n name: \"grid\",\n previewImageUrls: view.previewImageUrl ? of.reduce((acc, {\n name\n }) => {\n const url = view.previewImageUrl?.(name);\n if (!url) return acc;\n try {\n new URL(url), acc[name] = url;\n } catch {\n acc[name] = new URL(url, `${window.location.origin}${basePath ? `${basePath}/` : \"\"}`).toString();\n }\n return acc;\n }, {}) : void 0\n } : view)\n }), opts;\n }\n function createArray(arraySchemaType) {\n const of = [];\n for (const item of arraySchemaType.of) {\n let field = convertSchemaType(item);\n const option = {\n type: \"unionOption\",\n icon: extractIcon(item),\n name: item.name,\n title: typeof item.title == \"string\" ? item.title : void 0,\n value: field\n };\n field.type === \"inline\" ? field = {\n type: \"object\",\n fields: {\n _key: createKeyField()\n },\n rest: field\n } : field.type === \"object\" && (field.rest = {\n type: \"object\",\n fields: {\n _key: createKeyField()\n }\n }), option.value = field, of.push(option);\n }\n if (of.length === 0)\n return {\n type: \"null\"\n };\n if (of.length > 1)\n return {\n type: \"union\",\n of,\n options: createUnionNodeOptions(arraySchemaType, of)\n };\n const {\n name,\n title,\n value\n } = of[0];\n return {\n type: \"array\",\n of: {\n type: \"arrayItem\",\n name,\n title: typeof title == \"string\" ? title : void 0,\n value\n }\n };\n }\n}\nfunction createKeyField() {\n return {\n type: \"objectField\",\n name: \"_key\",\n value: {\n type: \"string\"\n }\n };\n}\nfunction getDocumentPathArray(paths) {\n const documentPathMap = paths.reduce((acc, {\n id,\n path\n }) => (acc[id] ? acc[id].add(path) : acc[id] = /* @__PURE__ */ new Set([path]), acc), {});\n return Object.entries(documentPathMap);\n}\nfunction PostMessageSchema(props) {\n const $ = c(11), {\n comlink,\n perspective\n } = props, workspace = useWorkspace(), theme = useRootTheme();\n let t0, t1;\n $[0] !== comlink || $[1] !== theme || $[2] !== workspace ? (t0 = () => {\n const schema = extractSchema(workspace, theme);\n return comlink.post(\"presentation/schema\", {\n schema\n }), comlink.on(\"visual-editing/schema\", () => ({\n schema\n }));\n }, t1 = [comlink, theme, workspace], $[0] = comlink, $[1] = theme, $[2] = workspace, $[3] = t0, $[4] = t1) : (t0 = $[3], t1 = $[4]), useEffect(t0, t1);\n let t2;\n $[5] === Symbol.for(\"react.memo_cache_sentinel\") ? (t2 = {\n apiVersion: API_VERSION\n }, $[5] = t2) : t2 = $[5];\n const client = useClient(t2);\n let t3, t4;\n return $[6] !== client || $[7] !== comlink || $[8] !== perspective ? (t3 = () => comlink.on(\"visual-editing/schema-union-types\", async (data) => {\n const documentPathArray = getDocumentPathArray(data.paths), unionTypes = await Promise.all(documentPathArray.map(async (t5) => {\n const [id, paths] = t5, arr = Array.from(paths), query = `*[_id == $id][0]{${arr.map(_temp).join(\",\")}}`, result = await client.fetch(query, {\n id: getPublishedId(id)\n }, {\n tag: \"presentation-schema\",\n perspective\n }), mapped = arr.map((path_0, i_0) => ({\n path: path_0,\n type: result[i_0]\n }));\n return {\n id,\n paths: mapped\n };\n })), newState = /* @__PURE__ */ new Map();\n return unionTypes.forEach((action) => {\n newState.set(action.id, new Map(action.paths.map(_temp2)));\n }), {\n types: newState\n };\n }), t4 = [comlink, client, perspective], $[6] = client, $[7] = comlink, $[8] = perspective, $[9] = t3, $[10] = t4) : (t3 = $[9], t4 = $[10]), useEffect(t3, t4), null;\n}\nfunction _temp2(t0) {\n const {\n path: path_1,\n type\n } = t0;\n return [path_1, type];\n}\nfunction _temp(path, i) {\n return `\"${i}\": ${path}[0]._type`;\n}\nvar PostMessageSchema$1 = memo(PostMessageSchema);\nexport {\n PostMessageSchema$1 as default\n};\n//# sourceMappingURL=PostMessageSchema.js.map\n"],"names":["isFieldRequired","field","validation","rules","rule","required","proxy","target","methodName","isType","typeDef","typeName","type","isObjectType","isArrayType","isReferenceType","isCrossDatasetReferenceType","isStringType","isNumberType","lastType","gatherFields","sortByDependencies","compiledSchema","seen","walkDependencies","schemaType","dependencies","last","schemaTypeName","ref","item","dependencyMap","typeNames","currentlyVisiting","visited","visit","deps","dep","SchemaIcon","t0","$","c","themeContext","theme","scheme","tone","t1","ServerStyleSheet","sheet","t2","jsx","StyleSheetManager","ThemeProvider","createElement","documentDefaultFields","createStringNodeDefintion","stringSchemaType","listOptions","_a","v","createNumberNodeDefintion","numberSchemaType","createReferenceNode","name","inArray","fields","createReferenceNodeDefintion","reference","references","gatherReferenceNames","allReferences","gatherReferenceTypes","refTo","typesMap","extractSchema","workspace","inlineFields","schemaDef","basePath","base","convertBaseType","extractIcon","renderToString","object","createObject","value","convertSchemaType","_c","_b","mapped","_d","createArray","createUnionNodeOptions","of","options","opts","view","acc","url","arraySchemaType","option","createKeyField","title","getDocumentPathArray","paths","documentPathMap","id","path","PostMessageSchema","props","comlink","perspective","useWorkspace","useRootTheme","schema","useEffect","API_VERSION","client","useClient","t3","t4","data","documentPathArray","unionTypes","t5","arr","query","_temp","result","getPublishedId","path_0","i_0","newState","action","_temp2","path_1","i","PostMessageSchema$1","memo"],"mappings":";;;;;;;AAQA,SAASA,EAAgBC,GAAO;AAC9B,QAAM;AAAA,IACJ,YAAAC;AAAA,EACD,IAAGD,EAAM;AACV,MAAI,CAACC;AACH,WAAO;AACT,QAAMC,IAAQ,MAAM,QAAQD,CAAU,IAAIA,IAAa,CAACA,CAAU;AAClE,aAAWE,KAAQD,GAAO;AACxB,QAAIE,IAAW;AACf,UAAMC,IAAQ,IAAI,MAAM,IAAI;AAAA,MAC1B,KAAK,CAACC,GAAQC,MAAe,OAAOA,MAAe,eAAeH,IAAW,KAAKC;AAAA,IACxF,CAAK;AACD,QA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,MAAMF,EAAOG,CAAG;AAAA,MACxB,EAAQ;AACF,aAAO;AAAA,QACL,IAAAzB;AAAA,QACA,OAAOjB;AAAA,MACR;AAAA,IACP,CAAK,CAAC,GAAG2C,IAA2B,oBAAI,IAAK;AACzC,WAAOT,EAAW,QAAQ,CAACU,MAAW;AACpC,MAAAD,EAAS,IAAIC,EAAO,IAAI,IAAI,IAAIA,EAAO,MAAM,IAAIC,EAAM,CAAC,CAAC;AAAA,IAC/D,CAAK,GAAG;AAAA,MACF,OAAOF;AAAA,IACR;AAAA,EACL,CAAG,GAAGZ,IAAK,CAACV,GAASO,GAAQN,CAAW,GAAGvE,EAAE,CAAC,IAAI6E,GAAQ7E,EAAE,CAAC,IAAIsE,GAAStE,EAAE,CAAC,IAAIuE,GAAavE,EAAE,CAAC,IAAI+E,GAAI/E,EAAE,EAAE,IAAIgF,MAAOD,IAAK/E,EAAE,CAAC,GAAGgF,IAAKhF,EAAE,EAAE,IAAI2E,EAAUI,GAAIC,CAAE,GAAG;AACnK;AACA,SAASc,GAAO/F,GAAI;AAClB,QAAM;AAAA,IACJ,MAAMgG;AAAA,IACN,MAAA3H;AAAA,EACJ,IAAM2B;AACJ,SAAO,CAACgG,GAAQ3H,CAAI;AACtB;AACA,SAASmH,GAAMpB,GAAM6B,GAAG;AACtB,SAAO,IAAIA,CAAC,MAAM7B,CAAI;AACxB;AACG,IAAC8B,KAAsBC,EAAK9B,EAAiB;","x_google_ignoreList":[0]}
|
@@ -1,51 +0,0 @@
|
|
1
|
-
import { c as g } from "./presentation-CSS9GR9X.mjs";
|
2
|
-
import { createContext as m, memo as u, useEffect as i, useContext as f } from "react";
|
3
|
-
function p() {
|
4
|
-
const n = {
|
5
|
-
updateUserProperties() {
|
6
|
-
},
|
7
|
-
trace: e,
|
8
|
-
log: o
|
9
|
-
};
|
10
|
-
function e(r) {
|
11
|
-
return {
|
12
|
-
start() {
|
13
|
-
},
|
14
|
-
log(t) {
|
15
|
-
},
|
16
|
-
complete() {
|
17
|
-
},
|
18
|
-
newContext(t) {
|
19
|
-
return n;
|
20
|
-
},
|
21
|
-
error(t) {
|
22
|
-
},
|
23
|
-
await: (t) => t
|
24
|
-
};
|
25
|
-
}
|
26
|
-
function o(r, t) {
|
27
|
-
}
|
28
|
-
return n;
|
29
|
-
}
|
30
|
-
const y = p(), d = m(y);
|
31
|
-
function x() {
|
32
|
-
return f(d);
|
33
|
-
}
|
34
|
-
const T = (n) => {
|
35
|
-
const e = g(4), {
|
36
|
-
comlink: o
|
37
|
-
} = n, r = x();
|
38
|
-
let t, a;
|
39
|
-
return e[0] !== o || e[1] !== r ? (t = () => o.on("visual-editing/telemetry-log", async (c) => {
|
40
|
-
const {
|
41
|
-
event: s,
|
42
|
-
data: l
|
43
|
-
} = c;
|
44
|
-
l ? r.log(s, l) : r.log(s);
|
45
|
-
}), a = [o, r], e[0] = o, e[1] = r, e[2] = t, e[3] = a) : (t = e[2], a = e[3]), i(t, a), null;
|
46
|
-
};
|
47
|
-
var L = u(T);
|
48
|
-
export {
|
49
|
-
L as default
|
50
|
-
};
|
51
|
-
//# sourceMappingURL=PostMessageTelemetry-CSluBvcC.mjs.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"PostMessageTelemetry-CSluBvcC.mjs","sources":["../../../node_modules/.pnpm/@sanity+presentation@1.19.14-release.0_@emotion+is-prop-valid@1.3.1_@sanity+color@3.0.6_debug_vqegs67ktulknun2leapg5jvli/node_modules/@sanity/presentation/dist/_chunks-es/PostMessageTelemetry.js"],"sourcesContent":["import { c } from \"react-compiler-runtime\";\nimport { createContext, useContext, memo, useEffect } from \"react\";\nfunction createNoopLogger() {\n const logger = {\n updateUserProperties() {\n },\n trace,\n log\n };\n function trace(telemetryTrace) {\n return {\n start() {\n },\n log(data) {\n },\n complete() {\n },\n newContext(name) {\n return logger;\n },\n error(error) {\n },\n await: (promise) => promise\n };\n }\n function log(event, data) {\n }\n return logger;\n}\nconst noopLogger = createNoopLogger(), TelemetryLoggerContext = createContext(noopLogger);\nfunction useTelemetry() {\n return useContext(TelemetryLoggerContext);\n}\nconst PostMessageTelemetry = (props) => {\n const $ = c(4), {\n comlink\n } = props, telemetry = useTelemetry();\n let t0, t1;\n return $[0] !== comlink || $[1] !== telemetry ? (t0 = () => comlink.on(\"visual-editing/telemetry-log\", async (message) => {\n const {\n event,\n data\n } = message;\n data ? telemetry.log(event, data) : telemetry.log(event);\n }), t1 = [comlink, telemetry], $[0] = comlink, $[1] = telemetry, $[2] = t0, $[3] = t1) : (t0 = $[2], t1 = $[3]), useEffect(t0, t1), null;\n};\nvar PostMessageTelemetry$1 = memo(PostMessageTelemetry);\nexport {\n PostMessageTelemetry$1 as default\n};\n//# sourceMappingURL=PostMessageTelemetry.js.map\n"],"names":["createNoopLogger","logger","trace","log","telemetryTrace","data","name","error","promise","event","noopLogger","TelemetryLoggerContext","createContext","useTelemetry","useContext","PostMessageTelemetry","props","$","c","comlink","telemetry","t0","t1","message","useEffect","PostMessageTelemetry$1","memo"],"mappings":";;AAEA,SAASA,IAAmB;AAC1B,QAAMC,IAAS;AAAA,IACb,uBAAuB;AAAA,IACtB;AAAA,IACD,OAAAC;AAAA,IACA,KAAAC;AAAA,EACD;AACD,WAASD,EAAME,GAAgB;AAC7B,WAAO;AAAA,MACL,QAAQ;AAAA,MACP;AAAA,MACD,IAAIC,GAAM;AAAA,MACT;AAAA,MACD,WAAW;AAAA,MACV;AAAA,MACD,WAAWC,GAAM;AACf,eAAOL;AAAA,MACR;AAAA,MACD,MAAMM,GAAO;AAAA,MACZ;AAAA,MACD,OAAO,CAACC,MAAYA;AAAA,IACrB;AAAA,EACL;AACE,WAASL,EAAIM,GAAOJ,GAAM;AAAA,EAC5B;AACE,SAAOJ;AACT;AACA,MAAMS,IAAaV,EAAkB,GAAEW,IAAyBC,EAAcF,CAAU;AACxF,SAASG,IAAe;AACtB,SAAOC,EAAWH,CAAsB;AAC1C;AACA,MAAMI,IAAuB,CAACC,MAAU;AACtC,QAAMC,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