@sanity/cli 8.3.0 → 8.4.2

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.
Files changed (115) hide show
  1. package/dist/actions/build/buildApp.js +14 -7
  2. package/dist/actions/build/buildApp.js.map +1 -1
  3. package/dist/actions/build/buildStudio.js +3 -3
  4. package/dist/actions/build/buildStudio.js.map +1 -1
  5. package/dist/actions/deploy/deployApp.js +32 -25
  6. package/dist/actions/deploy/deployApp.js.map +1 -1
  7. package/dist/actions/deploy/deployStudio.js +2 -1
  8. package/dist/actions/deploy/deployStudio.js.map +1 -1
  9. package/dist/actions/deploy/deployStudioSchemasAndManifests.worker.js +2 -4
  10. package/dist/actions/deploy/deployStudioSchemasAndManifests.worker.js.map +1 -1
  11. package/dist/actions/deploy/deploymentPlan.js.map +1 -1
  12. package/dist/actions/dev/devAction.js +6 -4
  13. package/dist/actions/dev/devAction.js.map +1 -1
  14. package/dist/actions/dev/servers/getDevServerConfig.js +13 -6
  15. package/dist/actions/dev/servers/getDevServerConfig.js.map +1 -1
  16. package/dist/actions/dev/servers/startAppDevServer.js +4 -2
  17. package/dist/actions/dev/servers/startAppDevServer.js.map +1 -1
  18. package/dist/actions/graphql/gen1/generateTypeFilters.js +1 -2
  19. package/dist/actions/graphql/gen1/generateTypeFilters.js.map +1 -1
  20. package/dist/actions/graphql/resolveGraphQLApisFromWorkspaces.js +5 -2
  21. package/dist/actions/graphql/resolveGraphQLApisFromWorkspaces.js.map +1 -1
  22. package/dist/actions/init/templates/shopify.js +2 -1
  23. package/dist/actions/init/templates/shopify.js.map +1 -1
  24. package/dist/actions/manifest/extractManifest.js +5 -37
  25. package/dist/actions/manifest/extractManifest.js.map +1 -1
  26. package/dist/actions/manifest/extractStudioManifest.js +1 -1
  27. package/dist/actions/manifest/extractStudioManifest.js.map +1 -1
  28. package/dist/actions/preview/previewAction.js +1 -1
  29. package/dist/actions/preview/previewAction.js.map +1 -1
  30. package/dist/actions/schema/deleteSchemaAction.js +1 -1
  31. package/dist/actions/schema/deleteSchemaAction.js.map +1 -1
  32. package/dist/actions/schema/deploySchemas.js.map +1 -1
  33. package/dist/actions/schema/extractSanityWorkspace.worker.js +1 -1
  34. package/dist/actions/schema/extractSanityWorkspace.worker.js.map +1 -1
  35. package/dist/actions/schema/listSchemas.js +1 -1
  36. package/dist/actions/schema/listSchemas.js.map +1 -1
  37. package/dist/actions/schema/schemaTypeHelpers.js +5 -0
  38. package/dist/actions/schema/schemaTypeHelpers.js.map +1 -0
  39. package/dist/actions/schema/updateWorkspaceSchema.js +1 -1
  40. package/dist/actions/schema/updateWorkspaceSchema.js.map +1 -1
  41. package/dist/actions/schema/utils/schemaStoreValidation.js +2 -2
  42. package/dist/actions/schema/utils/schemaStoreValidation.js.map +1 -1
  43. package/dist/actions/schema/utils/workspaceSchemaId.js +1 -1
  44. package/dist/actions/schema/utils/workspaceSchemaId.js.map +1 -1
  45. package/dist/actions/versions/getFormatters.js +1 -2
  46. package/dist/actions/versions/getFormatters.js.map +1 -1
  47. package/dist/commands/documents/create.js +4 -4
  48. package/dist/commands/documents/create.js.map +1 -1
  49. package/dist/commands/hooks/logs.js +1 -2
  50. package/dist/commands/hooks/logs.js.map +1 -1
  51. package/dist/commands/projects/list.js +3 -5
  52. package/dist/commands/projects/list.js.map +1 -1
  53. package/dist/commands/undeploy.js +7 -5
  54. package/dist/commands/undeploy.js.map +1 -1
  55. package/dist/commands/users/list.js +3 -5
  56. package/dist/commands/users/list.js.map +1 -1
  57. package/dist/commands/versions.js +1 -2
  58. package/dist/commands/versions.js.map +1 -1
  59. package/dist/exports/_internal.d.ts +1 -67
  60. package/dist/exports/_internal.js +1 -1
  61. package/dist/exports/_internal.js.map +1 -1
  62. package/dist/exports/index.d.ts +2 -2
  63. package/dist/exports/index.js +2 -1
  64. package/dist/exports/index.js.map +1 -1
  65. package/dist/exports/runtime.d.ts +2 -2
  66. package/dist/exports/runtime.js +1 -1
  67. package/dist/exports/runtime.js.map +1 -1
  68. package/dist/generated/apiRoutes.js +4 -0
  69. package/dist/generated/apiRoutes.js.map +1 -1
  70. package/dist/prompts/selectMediaLibrary.js +2 -3
  71. package/dist/prompts/selectMediaLibrary.js.map +1 -1
  72. package/dist/services/mintProject.js +27 -14
  73. package/dist/services/mintProject.js.map +1 -1
  74. package/dist/services/schemas.js.map +1 -1
  75. package/dist/services/userApplications.js.map +1 -1
  76. package/dist/util/determineIsApp.js +1 -1
  77. package/dist/util/determineIsApp.js.map +1 -1
  78. package/dist/util/sortRowsByColumn.js +23 -0
  79. package/dist/util/sortRowsByColumn.js.map +1 -0
  80. package/oclif.manifest.json +353 -353
  81. package/package.json +7 -10
  82. package/dist/actions/manifest/blockTypeTransformer.js +0 -67
  83. package/dist/actions/manifest/blockTypeTransformer.js.map +0 -1
  84. package/dist/actions/manifest/extractCoreAppManifest.js +0 -111
  85. package/dist/actions/manifest/extractCoreAppManifest.js.map +0 -1
  86. package/dist/actions/manifest/extractManifest.worker.js +0 -30
  87. package/dist/actions/manifest/extractManifest.worker.js.map +0 -1
  88. package/dist/actions/manifest/extractWorkspaceManifest.js +0 -72
  89. package/dist/actions/manifest/extractWorkspaceManifest.js.map +0 -1
  90. package/dist/actions/manifest/iconResolver.js +0 -36
  91. package/dist/actions/manifest/iconResolver.js.map +0 -1
  92. package/dist/actions/manifest/purifyConfig.js +0 -307
  93. package/dist/actions/manifest/purifyConfig.js.map +0 -1
  94. package/dist/actions/manifest/referenceTransformer.js +0 -51
  95. package/dist/actions/manifest/referenceTransformer.js.map +0 -1
  96. package/dist/actions/manifest/resolveSchemaIcon.js +0 -43
  97. package/dist/actions/manifest/resolveSchemaIcon.js.map +0 -1
  98. package/dist/actions/manifest/sanitizeIcon.js +0 -13
  99. package/dist/actions/manifest/sanitizeIcon.js.map +0 -1
  100. package/dist/actions/manifest/schemaTypeHelpers.js +0 -110
  101. package/dist/actions/manifest/schemaTypeHelpers.js.map +0 -1
  102. package/dist/actions/manifest/schemaTypeTransformer.js +0 -169
  103. package/dist/actions/manifest/schemaTypeTransformer.js.map +0 -1
  104. package/dist/actions/manifest/transformerUtils.js +0 -40
  105. package/dist/actions/manifest/transformerUtils.js.map +0 -1
  106. package/dist/actions/manifest/types.js +0 -13
  107. package/dist/actions/manifest/types.js.map +0 -1
  108. package/dist/actions/manifest/validationTransformer.js +0 -84
  109. package/dist/actions/manifest/validationTransformer.js.map +0 -1
  110. package/dist/actions/manifest/writeManifestFile.js +0 -29
  111. package/dist/actions/manifest/writeManifestFile.js.map +0 -1
  112. package/dist/actions/manifest/writeWorkspaceFiles.js +0 -30
  113. package/dist/actions/manifest/writeWorkspaceFiles.js.map +0 -1
  114. package/dist/actions/schema/uploadSchemaToLexicon.js +0 -91
  115. package/dist/actions/schema/uploadSchemaToLexicon.js.map +0 -1
@@ -1,307 +0,0 @@
1
- /**
2
- * This file maintains our sanitization configuration for DOMPurify.
3
- * We use an allowlist for tags and attributes to ensure that only safe
4
- * elements and attributes are allowed.
5
- *
6
- * This is easier to loosen as specs develop & use-cases are discovered.
7
- */ ///////// Tags
8
- const HTML_TAGS = [
9
- 'img',
10
- 'style'
11
- ];
12
- const SVG_TAGS = [
13
- 'svg',
14
- 'a',
15
- 'altglyph',
16
- 'altglyphdef',
17
- 'altglyphitem',
18
- 'animatecolor',
19
- 'animatemotion',
20
- 'animatetransform',
21
- 'circle',
22
- 'clippath',
23
- 'defs',
24
- 'desc',
25
- 'ellipse',
26
- 'filter',
27
- 'font',
28
- 'g',
29
- 'glyph',
30
- 'glyphref',
31
- 'hkern',
32
- 'image',
33
- 'line',
34
- 'lineargradient',
35
- 'marker',
36
- 'mask',
37
- 'metadata',
38
- 'mpath',
39
- 'path',
40
- 'pattern',
41
- 'polygon',
42
- 'polyline',
43
- 'radialgradient',
44
- 'rect',
45
- 'stop',
46
- 'style',
47
- 'switch',
48
- 'symbol',
49
- 'text',
50
- 'textpath',
51
- 'title',
52
- 'tref',
53
- 'tspan',
54
- 'view',
55
- 'vkern'
56
- ];
57
- const SVG_FILTER_TAGS = [
58
- 'feBlend',
59
- 'feColorMatrix',
60
- 'feComponentTransfer',
61
- 'feComposite',
62
- 'feConvolveMatrix',
63
- 'feDiffuseLighting',
64
- 'feDisplacementMap',
65
- 'feDistantLight',
66
- 'feDropShadow',
67
- 'feFlood',
68
- 'feFuncA',
69
- 'feFuncB',
70
- 'feFuncG',
71
- 'feFuncR',
72
- 'feGaussianBlur',
73
- 'feImage',
74
- 'feMerge',
75
- 'feMergeNode',
76
- 'feMorphology',
77
- 'feOffset',
78
- 'fePointLight',
79
- 'feSpecularLighting',
80
- 'feSpotLight',
81
- 'feTile',
82
- 'feTurbulence'
83
- ];
84
- const ALLOWED_TAGS = [
85
- ...SVG_TAGS,
86
- ...HTML_TAGS,
87
- ...SVG_FILTER_TAGS
88
- ];
89
- ///////// Attributes
90
- const HTML_ATTRIBUTES = [
91
- 'alt',
92
- 'class',
93
- 'crossorigin',
94
- 'decoding',
95
- 'elementtiming',
96
- 'fetchpriority',
97
- 'height',
98
- 'loading',
99
- 'src',
100
- 'srcset',
101
- 'style',
102
- 'width'
103
- ];
104
- const SVG_ATTRIBUTES = [
105
- 'accent-height',
106
- 'accumulate',
107
- 'additive',
108
- 'alignment-baseline',
109
- 'amplitude',
110
- 'ascent',
111
- 'attributename',
112
- 'attributetype',
113
- 'azimuth',
114
- 'basefrequency',
115
- 'baseline-shift',
116
- 'begin',
117
- 'bias',
118
- 'by',
119
- 'class',
120
- 'clip',
121
- 'clippathunits',
122
- 'clip-path',
123
- 'clip-rule',
124
- 'color',
125
- 'color-interpolation',
126
- 'color-interpolation-filters',
127
- 'color-profile',
128
- 'color-rendering',
129
- 'cx',
130
- 'cy',
131
- 'd',
132
- 'dx',
133
- 'dy',
134
- 'diffuseconstant',
135
- 'direction',
136
- 'display',
137
- 'divisor',
138
- 'dur',
139
- 'edgemode',
140
- 'elevation',
141
- 'end',
142
- 'exponent',
143
- 'fill',
144
- 'fill-opacity',
145
- 'fill-rule',
146
- 'filter',
147
- 'filterunits',
148
- 'flood-color',
149
- 'flood-opacity',
150
- 'font-family',
151
- 'font-size',
152
- 'font-size-adjust',
153
- 'font-stretch',
154
- 'font-style',
155
- 'font-variant',
156
- 'font-weight',
157
- 'fx',
158
- 'fy',
159
- 'g1',
160
- 'g2',
161
- 'glyph-name',
162
- 'glyphref',
163
- 'gradientunits',
164
- 'gradienttransform',
165
- 'height',
166
- 'href',
167
- 'id',
168
- 'image-rendering',
169
- 'in',
170
- 'in2',
171
- 'intercept',
172
- 'k',
173
- 'k1',
174
- 'k2',
175
- 'k3',
176
- 'k4',
177
- 'kerning',
178
- 'keypoints',
179
- 'keysplines',
180
- 'keytimes',
181
- 'lang',
182
- 'lengthadjust',
183
- 'letter-spacing',
184
- 'kernelmatrix',
185
- 'kernelunitlength',
186
- 'lighting-color',
187
- 'local',
188
- 'marker-end',
189
- 'marker-mid',
190
- 'marker-start',
191
- 'markerheight',
192
- 'markerunits',
193
- 'markerwidth',
194
- 'maskcontentunits',
195
- 'maskunits',
196
- 'max',
197
- 'mask',
198
- 'media',
199
- 'method',
200
- 'mode',
201
- 'min',
202
- 'name',
203
- 'numoctaves',
204
- 'offset',
205
- 'operator',
206
- 'opacity',
207
- 'order',
208
- 'orient',
209
- 'orientation',
210
- 'origin',
211
- 'overflow',
212
- 'paint-order',
213
- 'path',
214
- 'pathlength',
215
- 'patterncontentunits',
216
- 'patterntransform',
217
- 'patternunits',
218
- 'points',
219
- 'preservealpha',
220
- 'preserveaspectratio',
221
- 'primitiveunits',
222
- 'r',
223
- 'rx',
224
- 'ry',
225
- 'radius',
226
- 'refx',
227
- 'refy',
228
- 'repeatcount',
229
- 'repeatdur',
230
- 'restart',
231
- 'result',
232
- 'rotate',
233
- 'scale',
234
- 'seed',
235
- 'shape-rendering',
236
- 'slope',
237
- 'specularconstant',
238
- 'specularexponent',
239
- 'spreadmethod',
240
- 'startoffset',
241
- 'stddeviation',
242
- 'stitchtiles',
243
- 'stop-color',
244
- 'stop-opacity',
245
- 'stroke-dasharray',
246
- 'stroke-dashoffset',
247
- 'stroke-linecap',
248
- 'stroke-linejoin',
249
- 'stroke-miterlimit',
250
- 'stroke-opacity',
251
- 'stroke',
252
- 'stroke-width',
253
- 'style',
254
- 'surfacescale',
255
- 'systemlanguage',
256
- 'tabindex',
257
- 'tablevalues',
258
- 'targetx',
259
- 'targety',
260
- 'transform',
261
- 'transform-origin',
262
- 'text-anchor',
263
- 'text-decoration',
264
- 'text-rendering',
265
- 'textlength',
266
- 'type',
267
- 'u1',
268
- 'u2',
269
- 'unicode',
270
- 'values',
271
- 'viewbox',
272
- 'visibility',
273
- 'version',
274
- 'vert-adv-y',
275
- 'vert-origin-x',
276
- 'vert-origin-y',
277
- 'width',
278
- 'word-spacing',
279
- 'wrap',
280
- 'writing-mode',
281
- 'xchannelselector',
282
- 'ychannelselector',
283
- 'x',
284
- 'x1',
285
- 'x2',
286
- 'xmlns',
287
- 'y',
288
- 'y1',
289
- 'y2',
290
- 'z',
291
- 'zoomandpan'
292
- ];
293
- const ALLOWED_ATTR = [
294
- ...SVG_ATTRIBUTES,
295
- ...HTML_ATTRIBUTES
296
- ];
297
- const config = {
298
- ALLOWED_ATTR,
299
- ALLOWED_TAGS,
300
- /**
301
- * Required to allow for the use of `style` tags,
302
- * namely rendering the style tags from `styled-components`
303
- */ FORCE_BODY: true
304
- };
305
- export { config };
306
-
307
- //# sourceMappingURL=purifyConfig.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/actions/manifest/purifyConfig.ts"],"sourcesContent":["import {type Config} from 'isomorphic-dompurify'\n\n/**\n * This file maintains our sanitization configuration for DOMPurify.\n * We use an allowlist for tags and attributes to ensure that only safe\n * elements and attributes are allowed.\n *\n * This is easier to loosen as specs develop & use-cases are discovered.\n */\n\n///////// Tags\n\nconst HTML_TAGS = ['img', 'style']\n\nconst SVG_TAGS = [\n 'svg',\n 'a',\n 'altglyph',\n 'altglyphdef',\n 'altglyphitem',\n 'animatecolor',\n 'animatemotion',\n 'animatetransform',\n 'circle',\n 'clippath',\n 'defs',\n 'desc',\n 'ellipse',\n 'filter',\n 'font',\n 'g',\n 'glyph',\n 'glyphref',\n 'hkern',\n 'image',\n 'line',\n 'lineargradient',\n 'marker',\n 'mask',\n 'metadata',\n 'mpath',\n 'path',\n 'pattern',\n 'polygon',\n 'polyline',\n 'radialgradient',\n 'rect',\n 'stop',\n 'style',\n 'switch',\n 'symbol',\n 'text',\n 'textpath',\n 'title',\n 'tref',\n 'tspan',\n 'view',\n 'vkern',\n] as const\n\nconst SVG_FILTER_TAGS = [\n 'feBlend',\n 'feColorMatrix',\n 'feComponentTransfer',\n 'feComposite',\n 'feConvolveMatrix',\n 'feDiffuseLighting',\n 'feDisplacementMap',\n 'feDistantLight',\n 'feDropShadow',\n 'feFlood',\n 'feFuncA',\n 'feFuncB',\n 'feFuncG',\n 'feFuncR',\n 'feGaussianBlur',\n 'feImage',\n 'feMerge',\n 'feMergeNode',\n 'feMorphology',\n 'feOffset',\n 'fePointLight',\n 'feSpecularLighting',\n 'feSpotLight',\n 'feTile',\n 'feTurbulence',\n] as const\n\nconst ALLOWED_TAGS: Config['ALLOWED_TAGS'] = [...SVG_TAGS, ...HTML_TAGS, ...SVG_FILTER_TAGS]\n\n///////// Attributes\n\nconst HTML_ATTRIBUTES = [\n 'alt',\n 'class',\n 'crossorigin',\n 'decoding',\n 'elementtiming',\n 'fetchpriority',\n 'height',\n 'loading',\n 'src',\n 'srcset',\n 'style',\n 'width',\n]\n\nconst SVG_ATTRIBUTES = [\n 'accent-height',\n 'accumulate',\n 'additive',\n 'alignment-baseline',\n 'amplitude',\n 'ascent',\n 'attributename',\n 'attributetype',\n 'azimuth',\n 'basefrequency',\n 'baseline-shift',\n 'begin',\n 'bias',\n 'by',\n 'class',\n 'clip',\n 'clippathunits',\n 'clip-path',\n 'clip-rule',\n 'color',\n 'color-interpolation',\n 'color-interpolation-filters',\n 'color-profile',\n 'color-rendering',\n 'cx',\n 'cy',\n 'd',\n 'dx',\n 'dy',\n 'diffuseconstant',\n 'direction',\n 'display',\n 'divisor',\n 'dur',\n 'edgemode',\n 'elevation',\n 'end',\n 'exponent',\n 'fill',\n 'fill-opacity',\n 'fill-rule',\n 'filter',\n 'filterunits',\n 'flood-color',\n 'flood-opacity',\n 'font-family',\n 'font-size',\n 'font-size-adjust',\n 'font-stretch',\n 'font-style',\n 'font-variant',\n 'font-weight',\n 'fx',\n 'fy',\n 'g1',\n 'g2',\n 'glyph-name',\n 'glyphref',\n 'gradientunits',\n 'gradienttransform',\n 'height',\n 'href',\n 'id',\n 'image-rendering',\n 'in',\n 'in2',\n 'intercept',\n 'k',\n 'k1',\n 'k2',\n 'k3',\n 'k4',\n 'kerning',\n 'keypoints',\n 'keysplines',\n 'keytimes',\n 'lang',\n 'lengthadjust',\n 'letter-spacing',\n 'kernelmatrix',\n 'kernelunitlength',\n 'lighting-color',\n 'local',\n 'marker-end',\n 'marker-mid',\n 'marker-start',\n 'markerheight',\n 'markerunits',\n 'markerwidth',\n 'maskcontentunits',\n 'maskunits',\n 'max',\n 'mask',\n 'media',\n 'method',\n 'mode',\n 'min',\n 'name',\n 'numoctaves',\n 'offset',\n 'operator',\n 'opacity',\n 'order',\n 'orient',\n 'orientation',\n 'origin',\n 'overflow',\n 'paint-order',\n 'path',\n 'pathlength',\n 'patterncontentunits',\n 'patterntransform',\n 'patternunits',\n 'points',\n 'preservealpha',\n 'preserveaspectratio',\n 'primitiveunits',\n 'r',\n 'rx',\n 'ry',\n 'radius',\n 'refx',\n 'refy',\n 'repeatcount',\n 'repeatdur',\n 'restart',\n 'result',\n 'rotate',\n 'scale',\n 'seed',\n 'shape-rendering',\n 'slope',\n 'specularconstant',\n 'specularexponent',\n 'spreadmethod',\n 'startoffset',\n 'stddeviation',\n 'stitchtiles',\n 'stop-color',\n 'stop-opacity',\n 'stroke-dasharray',\n 'stroke-dashoffset',\n 'stroke-linecap',\n 'stroke-linejoin',\n 'stroke-miterlimit',\n 'stroke-opacity',\n 'stroke',\n 'stroke-width',\n 'style',\n 'surfacescale',\n 'systemlanguage',\n 'tabindex',\n 'tablevalues',\n 'targetx',\n 'targety',\n 'transform',\n 'transform-origin',\n 'text-anchor',\n 'text-decoration',\n 'text-rendering',\n 'textlength',\n 'type',\n 'u1',\n 'u2',\n 'unicode',\n 'values',\n 'viewbox',\n 'visibility',\n 'version',\n 'vert-adv-y',\n 'vert-origin-x',\n 'vert-origin-y',\n 'width',\n 'word-spacing',\n 'wrap',\n 'writing-mode',\n 'xchannelselector',\n 'ychannelselector',\n 'x',\n 'x1',\n 'x2',\n 'xmlns',\n 'y',\n 'y1',\n 'y2',\n 'z',\n 'zoomandpan',\n] as const\n\nconst ALLOWED_ATTR: Config['ALLOWED_ATTR'] = [...SVG_ATTRIBUTES, ...HTML_ATTRIBUTES]\n\nconst config = {\n ALLOWED_ATTR,\n ALLOWED_TAGS,\n /**\n * Required to allow for the use of `style` tags,\n * namely rendering the style tags from `styled-components`\n */\n FORCE_BODY: true,\n} satisfies Config\n\nexport {config}\n"],"names":["HTML_TAGS","SVG_TAGS","SVG_FILTER_TAGS","ALLOWED_TAGS","HTML_ATTRIBUTES","SVG_ATTRIBUTES","ALLOWED_ATTR","config","FORCE_BODY"],"mappings":"AAEA;;;;;;CAMC,GAED,cAAc;AAEd,MAAMA,YAAY;IAAC;IAAO;CAAQ;AAElC,MAAMC,WAAW;IACf;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAED,MAAMC,kBAAkB;IACtB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAED,MAAMC,eAAuC;OAAIF;OAAaD;OAAcE;CAAgB;AAE5F,oBAAoB;AAEpB,MAAME,kBAAkB;IACtB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAED,MAAMC,iBAAiB;IACrB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAED,MAAMC,eAAuC;OAAID;OAAmBD;CAAgB;AAEpF,MAAMG,SAAS;IACbD;IACAH;IACA;;;GAGC,GACDK,YAAY;AACd;AAEA,SAAQD,MAAM,GAAC"}
@@ -1,51 +0,0 @@
1
- import { ensureCustomTitle } from './transformerUtils.js';
2
- /**
3
- * Transforms a reference schema type to its manifest representation
4
- */ export function transformReference(reference, retainCustomTypeProps) {
5
- return {
6
- to: (reference.to ?? []).map((type)=>{
7
- return {
8
- ...retainCustomTypeProps(type),
9
- type: type.name
10
- };
11
- })
12
- };
13
- }
14
- /**
15
- * Transforms a cross-dataset reference schema type to its manifest representation
16
- */ export function transformCrossDatasetReference(reference) {
17
- return {
18
- to: (reference.to ?? []).map((crossDataset)=>{
19
- const preview = crossDataset.preview?.select ? {
20
- preview: {
21
- select: crossDataset.preview.select
22
- }
23
- } : {};
24
- return {
25
- type: crossDataset.type,
26
- ...ensureCustomTitle(crossDataset.type, crossDataset.title),
27
- ...preview
28
- };
29
- })
30
- };
31
- }
32
- /**
33
- * Transforms a global document reference schema type to its manifest representation
34
- */ export function transformGlobalDocumentReference(reference) {
35
- return {
36
- to: (reference.to ?? []).map((crossDataset)=>{
37
- const preview = crossDataset.preview?.select ? {
38
- preview: {
39
- select: crossDataset.preview.select
40
- }
41
- } : {};
42
- return {
43
- type: crossDataset.type,
44
- ...ensureCustomTitle(crossDataset.type, crossDataset.title),
45
- ...preview
46
- };
47
- })
48
- };
49
- }
50
-
51
- //# sourceMappingURL=referenceTransformer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/actions/manifest/referenceTransformer.ts"],"sourcesContent":["import {\n type CrossDatasetReferenceSchemaType,\n type GlobalDocumentReferenceSchemaType,\n type ReferenceSchemaType,\n type SchemaType,\n} from '@sanity/types'\n\nimport {ensureCustomTitle, type SerializableProp} from './transformerUtils.js'\nimport {type ManifestSchemaType} from './types.js'\n\n/**\n * Transforms a reference schema type to its manifest representation\n */\nexport function transformReference(\n reference: ReferenceSchemaType,\n retainCustomTypeProps: (type: SchemaType) => Record<string, SerializableProp>,\n): Pick<ManifestSchemaType, 'to'> {\n return {\n to: (reference.to ?? []).map((type) => {\n return {\n ...retainCustomTypeProps(type),\n type: type.name,\n }\n }),\n }\n}\n\n/**\n * Transforms a cross-dataset reference schema type to its manifest representation\n */\nexport function transformCrossDatasetReference(\n reference: CrossDatasetReferenceSchemaType,\n): Pick<ManifestSchemaType, 'preview' | 'to'> {\n return {\n to: (reference.to ?? []).map((crossDataset) => {\n const preview = crossDataset.preview?.select\n ? {preview: {select: crossDataset.preview.select}}\n : {}\n return {\n type: crossDataset.type,\n ...ensureCustomTitle(crossDataset.type, crossDataset.title),\n ...preview,\n }\n }),\n }\n}\n\n/**\n * Transforms a global document reference schema type to its manifest representation\n */\nexport function transformGlobalDocumentReference(\n reference: GlobalDocumentReferenceSchemaType,\n): Pick<ManifestSchemaType, 'preview' | 'to'> {\n return {\n to: (reference.to ?? []).map((crossDataset) => {\n const preview = crossDataset.preview?.select\n ? {preview: {select: crossDataset.preview.select}}\n : {}\n return {\n type: crossDataset.type,\n ...ensureCustomTitle(crossDataset.type, crossDataset.title),\n ...preview,\n }\n }),\n }\n}\n"],"names":["ensureCustomTitle","transformReference","reference","retainCustomTypeProps","to","map","type","name","transformCrossDatasetReference","crossDataset","preview","select","title","transformGlobalDocumentReference"],"mappings":"AAOA,SAAQA,iBAAiB,QAA8B,wBAAuB;AAG9E;;CAEC,GACD,OAAO,SAASC,mBACdC,SAA8B,EAC9BC,qBAA6E;IAE7E,OAAO;QACLC,IAAI,AAACF,CAAAA,UAAUE,EAAE,IAAI,EAAE,AAAD,EAAGC,GAAG,CAAC,CAACC;YAC5B,OAAO;gBACL,GAAGH,sBAAsBG,KAAK;gBAC9BA,MAAMA,KAAKC,IAAI;YACjB;QACF;IACF;AACF;AAEA;;CAEC,GACD,OAAO,SAASC,+BACdN,SAA0C;IAE1C,OAAO;QACLE,IAAI,AAACF,CAAAA,UAAUE,EAAE,IAAI,EAAE,AAAD,EAAGC,GAAG,CAAC,CAACI;YAC5B,MAAMC,UAAUD,aAAaC,OAAO,EAAEC,SAClC;gBAACD,SAAS;oBAACC,QAAQF,aAAaC,OAAO,CAACC,MAAM;gBAAA;YAAC,IAC/C,CAAC;YACL,OAAO;gBACLL,MAAMG,aAAaH,IAAI;gBACvB,GAAGN,kBAAkBS,aAAaH,IAAI,EAAEG,aAAaG,KAAK,CAAC;gBAC3D,GAAGF,OAAO;YACZ;QACF;IACF;AACF;AAEA;;CAEC,GACD,OAAO,SAASG,iCACdX,SAA4C;IAE5C,OAAO;QACLE,IAAI,AAACF,CAAAA,UAAUE,EAAE,IAAI,EAAE,AAAD,EAAGC,GAAG,CAAC,CAACI;YAC5B,MAAMC,UAAUD,aAAaC,OAAO,EAAEC,SAClC;gBAACD,SAAS;oBAACC,QAAQF,aAAaC,OAAO,CAACC,MAAM;gBAAA;YAAC,IAC/C,CAAC;YACL,OAAO;gBACLL,MAAMG,aAAaH,IAAI;gBACvB,GAAGN,kBAAkBS,aAAaH,IAAI,EAAEG,aAAaG,KAAK,CAAC;gBAC3D,GAAGF,OAAO;YACZ;QACF;IACF;AACF"}
@@ -1,43 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { resolveLocalPackage, resolveLocalPackageFrom, resolveLocalPackagePath } from '@sanity/cli-core';
3
- import { isValidElement } from 'react';
4
- import { isValidElementType } from 'react-is';
5
- /**
6
- * Resolves all runtime dependencies from the studio's working directory and
7
- * returns a React element ready for synchronous server-side rendering.
8
- *
9
- * Dependencies like ThemeProvider and sanity components must share the same
10
- * React instance as the server renderer to avoid dual-React dispatcher issues,
11
- * so they are resolved from the studio's workDir rather than the CLI's own deps.
12
- *
13
- * `\@sanity/ui` is a transitive dependency of sanity and may not be directly
14
- * accessible from the project root in strict package managers (pnpm, Yarn PnP).
15
- * We resolve it relative to the sanity package's location in node_modules.
16
- *
17
- * This function is async, but the returned element is a plain synchronous
18
- * component - no async server components required. This keeps compatibility
19
- * with both React 18 and React 19.
20
- */ async function resolveSchemaIcon({ icon, subtitle = '', title, workDir }) {
21
- // Resolve @sanity/ui via sanity's location, since it's a transitive dep
22
- // that may not be directly accessible from the project root (pnpm strict mode)
23
- const sanityUrl = resolveLocalPackagePath('sanity', workDir);
24
- const [{ ThemeProvider }, { buildTheme }, normalizedIcon] = await Promise.all([
25
- resolveLocalPackageFrom('@sanity/ui', sanityUrl),
26
- resolveLocalPackageFrom('@sanity/ui/theme', sanityUrl),
27
- normalizeIcon(icon, title, subtitle, workDir)
28
- ]);
29
- const theme = buildTheme();
30
- return /*#__PURE__*/ _jsx(ThemeProvider, {
31
- theme: theme,
32
- children: normalizedIcon
33
- });
34
- }
35
- async function normalizeIcon(Icon, title, subtitle, workDir) {
36
- if (isValidElementType(Icon)) return /*#__PURE__*/ _jsx(Icon, {});
37
- if (/*#__PURE__*/ isValidElement(Icon)) return Icon;
38
- const { createDefaultIcon } = await resolveLocalPackage('sanity', workDir);
39
- return createDefaultIcon(title, subtitle);
40
- }
41
- export { resolveSchemaIcon };
42
-
43
- //# sourceMappingURL=resolveSchemaIcon.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/actions/manifest/resolveSchemaIcon.tsx"],"sourcesContent":["import {\n resolveLocalPackage,\n resolveLocalPackageFrom,\n resolveLocalPackagePath,\n} from '@sanity/cli-core'\nimport {type ComponentType, isValidElement, type ReactNode} from 'react'\nimport {isValidElementType} from 'react-is'\n\ninterface SchemaIconProps {\n title: string\n workDir: string\n\n icon?: ComponentType | ReactNode\n subtitle?: string\n}\n\n/**\n * Resolves all runtime dependencies from the studio's working directory and\n * returns a React element ready for synchronous server-side rendering.\n *\n * Dependencies like ThemeProvider and sanity components must share the same\n * React instance as the server renderer to avoid dual-React dispatcher issues,\n * so they are resolved from the studio's workDir rather than the CLI's own deps.\n *\n * `\\@sanity/ui` is a transitive dependency of sanity and may not be directly\n * accessible from the project root in strict package managers (pnpm, Yarn PnP).\n * We resolve it relative to the sanity package's location in node_modules.\n *\n * This function is async, but the returned element is a plain synchronous\n * component - no async server components required. This keeps compatibility\n * with both React 18 and React 19.\n */\nasync function resolveSchemaIcon({\n icon,\n subtitle = '',\n title,\n workDir,\n}: SchemaIconProps): Promise<React.JSX.Element> {\n // Resolve @sanity/ui via sanity's location, since it's a transitive dep\n // that may not be directly accessible from the project root (pnpm strict mode)\n const sanityUrl = resolveLocalPackagePath('sanity', workDir)\n const [{ThemeProvider}, {buildTheme}, normalizedIcon] = await Promise.all([\n resolveLocalPackageFrom<typeof import('@sanity/ui')>('@sanity/ui', sanityUrl),\n resolveLocalPackageFrom<typeof import('@sanity/ui/theme')>('@sanity/ui/theme', sanityUrl),\n normalizeIcon(icon, title, subtitle, workDir),\n ])\n const theme = buildTheme()\n\n return <ThemeProvider theme={theme}>{normalizedIcon}</ThemeProvider>\n}\n\nasync function normalizeIcon(\n Icon: ComponentType | ReactNode | undefined,\n title: string,\n subtitle: string,\n workDir: string,\n): Promise<React.JSX.Element> {\n if (isValidElementType(Icon)) return <Icon />\n if (isValidElement(Icon)) return Icon\n\n const {createDefaultIcon} = await resolveLocalPackage<typeof import('sanity')>('sanity', workDir)\n\n return createDefaultIcon(title, subtitle)\n}\n\nexport {resolveSchemaIcon}\nexport type {SchemaIconProps}\n"],"names":["resolveLocalPackage","resolveLocalPackageFrom","resolveLocalPackagePath","isValidElement","isValidElementType","resolveSchemaIcon","icon","subtitle","title","workDir","sanityUrl","ThemeProvider","buildTheme","normalizedIcon","Promise","all","normalizeIcon","theme","Icon","createDefaultIcon"],"mappings":";AAAA,SACEA,mBAAmB,EACnBC,uBAAuB,EACvBC,uBAAuB,QAClB,mBAAkB;AACzB,SAA4BC,cAAc,QAAuB,QAAO;AACxE,SAAQC,kBAAkB,QAAO,WAAU;AAU3C;;;;;;;;;;;;;;;CAeC,GACD,eAAeC,kBAAkB,EAC/BC,IAAI,EACJC,WAAW,EAAE,EACbC,KAAK,EACLC,OAAO,EACS;IAChB,wEAAwE;IACxE,+EAA+E;IAC/E,MAAMC,YAAYR,wBAAwB,UAAUO;IACpD,MAAM,CAAC,EAACE,aAAa,EAAC,EAAE,EAACC,UAAU,EAAC,EAAEC,eAAe,GAAG,MAAMC,QAAQC,GAAG,CAAC;QACxEd,wBAAqD,cAAcS;QACnET,wBAA2D,oBAAoBS;QAC/EM,cAAcV,MAAME,OAAOD,UAAUE;KACtC;IACD,MAAMQ,QAAQL;IAEd,qBAAO,KAACD;QAAcM,OAAOA;kBAAQJ;;AACvC;AAEA,eAAeG,cACbE,IAA2C,EAC3CV,KAAa,EACbD,QAAgB,EAChBE,OAAe;IAEf,IAAIL,mBAAmBc,OAAO,qBAAO,KAACA;IACtC,kBAAIf,eAAee,OAAO,OAAOA;IAEjC,MAAM,EAACC,iBAAiB,EAAC,GAAG,MAAMnB,oBAA6C,UAAUS;IAEzF,OAAOU,kBAAkBX,OAAOD;AAClC;AAEA,SAAQF,iBAAiB,GAAC"}
@@ -1,13 +0,0 @@
1
- import DOMPurify from 'isomorphic-dompurify';
2
- import { config } from './purifyConfig.js';
3
- /**
4
- * Sanitize icon markup against the manifest allowlist (see {@link config}).
5
- *
6
- * Shared by the studio manifest icon resolver and the core app manifest so
7
- * every icon we inline — whether rendered from a React component or read from
8
- * a file on disk — passes through the exact same trusted subset of SVG/HTML.
9
- */ export function sanitizeIcon(html) {
10
- return DOMPurify.sanitize(html.trim(), config);
11
- }
12
-
13
- //# sourceMappingURL=sanitizeIcon.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/actions/manifest/sanitizeIcon.ts"],"sourcesContent":["import DOMPurify from 'isomorphic-dompurify'\n\nimport {config} from './purifyConfig.js'\n\n/**\n * Sanitize icon markup against the manifest allowlist (see {@link config}).\n *\n * Shared by the studio manifest icon resolver and the core app manifest so\n * every icon we inline — whether rendered from a React component or read from\n * a file on disk — passes through the exact same trusted subset of SVG/HTML.\n */\nexport function sanitizeIcon(html: string): string {\n return DOMPurify.sanitize(html.trim(), config)\n}\n"],"names":["DOMPurify","config","sanitizeIcon","html","sanitize","trim"],"mappings":"AAAA,OAAOA,eAAe,uBAAsB;AAE5C,SAAQC,MAAM,QAAO,oBAAmB;AAExC;;;;;;CAMC,GACD,OAAO,SAASC,aAAaC,IAAY;IACvC,OAAOH,UAAUI,QAAQ,CAACD,KAAKE,IAAI,IAAIJ;AACzC"}
@@ -1,110 +0,0 @@
1
- const DEFAULT_IMAGE_FIELDS = new Set([
2
- 'asset',
3
- 'crop',
4
- 'hotspot',
5
- 'media'
6
- ]);
7
- const DEFAULT_FILE_FIELDS = new Set([
8
- 'asset',
9
- 'media'
10
- ]);
11
- const DEFAULT_GEOPOINT_FIELDS = new Set([
12
- 'alt',
13
- 'lat',
14
- 'lng'
15
- ]);
16
- const DEFAULT_SLUG_FIELDS = new Set([
17
- 'current',
18
- 'source'
19
- ]);
20
- export function getCustomFields(type) {
21
- const fields = type.fieldsets ? type.fieldsets.flatMap((fs)=>{
22
- if (fs.single) {
23
- return fs.field;
24
- }
25
- return fs.fields.map((field)=>({
26
- ...field,
27
- fieldset: fs.name
28
- }));
29
- }) : type.fields;
30
- if (isType(type, 'block')) {
31
- return [];
32
- }
33
- if (isType(type, 'slug')) {
34
- return fields.filter((f)=>!DEFAULT_SLUG_FIELDS.has(f.name));
35
- }
36
- if (isType(type, 'geopoint')) {
37
- return fields.filter((f)=>!DEFAULT_GEOPOINT_FIELDS.has(f.name));
38
- }
39
- if (isType(type, 'image')) {
40
- return fields.filter((f)=>!DEFAULT_IMAGE_FIELDS.has(f.name));
41
- }
42
- if (isType(type, 'file')) {
43
- return fields.filter((f)=>!DEFAULT_FILE_FIELDS.has(f.name));
44
- }
45
- return fields;
46
- }
47
- export function isReference(type) {
48
- return isType(type, 'reference');
49
- }
50
- export function isCrossDatasetReference(type) {
51
- return isType(type, 'crossDatasetReference');
52
- }
53
- export function isGlobalDocumentReference(type) {
54
- return isType(type, 'globalDocumentReference');
55
- }
56
- function isObjectField(maybeOjectField) {
57
- return typeof maybeOjectField === 'object' && maybeOjectField !== null && 'name' in maybeOjectField;
58
- }
59
- export function isCustomized(maybeCustomized) {
60
- const internalOwnProps = getSchemaTypeInternalOwnProps(maybeCustomized);
61
- const hasFieldsArray = isObjectField(maybeCustomized) && !isReference(maybeCustomized) && !isCrossDatasetReference(maybeCustomized) && !isGlobalDocumentReference(maybeCustomized) && 'fields' in maybeCustomized && Array.isArray(maybeCustomized.fields) && // needed to differentiate inline, named array object types from globally defined types
62
- // we only consider it customized if the _definition_ has fields declared
63
- // this holds for all customizable object-like types: object, document, image and file
64
- internalOwnProps?.fields;
65
- if (!hasFieldsArray) {
66
- return false;
67
- }
68
- const fields = getCustomFields(maybeCustomized);
69
- return fields.length > 0;
70
- }
71
- export function isType(schemaType, typeName) {
72
- if (schemaType.name === typeName) {
73
- return true;
74
- }
75
- if (!schemaType.type) {
76
- return false;
77
- }
78
- return isType(schemaType.type, typeName);
79
- }
80
- export function isDefined(value) {
81
- return value !== null && value !== undefined;
82
- }
83
- export function isRecord(value) {
84
- return !!value && typeof value === 'object';
85
- }
86
- export function isPrimitive(value) {
87
- return isString(value) || isBoolean(value) || isNumber(value);
88
- }
89
- export function isString(value) {
90
- return typeof value === 'string';
91
- }
92
- function isNumber(value) {
93
- return typeof value === 'number';
94
- }
95
- function isBoolean(value) {
96
- return typeof value === 'boolean';
97
- }
98
- /**
99
- * _internal_ownProps contains the _definition_ for the type.
100
- * Without it we cannot differentiate inline array item types from globally defined types in array.of
101
- */ function getSchemaTypeInternalOwnProps(type) {
102
- return type?._internal_ownProps;
103
- }
104
- /**
105
- * This allows us to differentiate inline array.of type definitions vs global type names on compiled schema types
106
- */ export function getDefinedTypeName(type) {
107
- return getSchemaTypeInternalOwnProps(type)?.type;
108
- }
109
-
110
- //# sourceMappingURL=schemaTypeHelpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/actions/manifest/schemaTypeHelpers.ts"],"sourcesContent":["import {\n type CrossDatasetReferenceSchemaType,\n type GlobalDocumentReferenceSchemaType,\n type ObjectField,\n type ObjectSchemaType,\n type ReferenceSchemaType,\n type SchemaType,\n} from '@sanity/types'\n\nconst DEFAULT_IMAGE_FIELDS = new Set(['asset', 'crop', 'hotspot', 'media'])\nconst DEFAULT_FILE_FIELDS = new Set(['asset', 'media'])\nconst DEFAULT_GEOPOINT_FIELDS = new Set(['alt', 'lat', 'lng'])\nconst DEFAULT_SLUG_FIELDS = new Set(['current', 'source'])\n\ntype InternalOwnProps = {fields?: unknown[]; name?: string; type?: string}\n\nexport function getCustomFields(type: ObjectSchemaType): (ObjectField & {fieldset?: string})[] {\n const fields = type.fieldsets\n ? type.fieldsets.flatMap((fs) => {\n if (fs.single) {\n return fs.field\n }\n return fs.fields.map((field) => ({\n ...field,\n fieldset: fs.name,\n }))\n })\n : type.fields\n\n if (isType(type, 'block')) {\n return []\n }\n if (isType(type, 'slug')) {\n return fields.filter((f) => !DEFAULT_SLUG_FIELDS.has(f.name))\n }\n if (isType(type, 'geopoint')) {\n return fields.filter((f) => !DEFAULT_GEOPOINT_FIELDS.has(f.name))\n }\n if (isType(type, 'image')) {\n return fields.filter((f) => !DEFAULT_IMAGE_FIELDS.has(f.name))\n }\n if (isType(type, 'file')) {\n return fields.filter((f) => !DEFAULT_FILE_FIELDS.has(f.name))\n }\n return fields\n}\n\nexport function isReference(type: SchemaType): type is ReferenceSchemaType {\n return isType(type, 'reference')\n}\n\nexport function isCrossDatasetReference(type: SchemaType): type is CrossDatasetReferenceSchemaType {\n return isType(type, 'crossDatasetReference')\n}\n\nexport function isGlobalDocumentReference(\n type: SchemaType,\n): type is GlobalDocumentReferenceSchemaType {\n return isType(type, 'globalDocumentReference')\n}\n\nfunction isObjectField(maybeOjectField: unknown): boolean {\n return (\n typeof maybeOjectField === 'object' && maybeOjectField !== null && 'name' in maybeOjectField\n )\n}\n\nexport function isCustomized(maybeCustomized: SchemaType): boolean {\n const internalOwnProps = getSchemaTypeInternalOwnProps(maybeCustomized)\n\n const hasFieldsArray =\n isObjectField(maybeCustomized) &&\n !isReference(maybeCustomized) &&\n !isCrossDatasetReference(maybeCustomized) &&\n !isGlobalDocumentReference(maybeCustomized) &&\n 'fields' in maybeCustomized &&\n Array.isArray(maybeCustomized.fields) &&\n // needed to differentiate inline, named array object types from globally defined types\n // we only consider it customized if the _definition_ has fields declared\n // this holds for all customizable object-like types: object, document, image and file\n internalOwnProps?.fields\n\n if (!hasFieldsArray) {\n return false\n }\n\n const fields = getCustomFields(maybeCustomized)\n return fields.length > 0\n}\n\nexport function isType(schemaType: SchemaType, typeName: string): boolean {\n if (schemaType.name === typeName) {\n return true\n }\n if (!schemaType.type) {\n return false\n }\n return isType(schemaType.type, typeName)\n}\n\nexport function isDefined<T>(value: T | null | undefined): value is T {\n return value !== null && value !== undefined\n}\n\nexport function isRecord(value: unknown): value is Record<string, unknown> {\n return !!value && typeof value === 'object'\n}\n\nexport function isPrimitive(value: unknown): value is boolean | number | string {\n return isString(value) || isBoolean(value) || isNumber(value)\n}\n\nexport function isString(value: unknown): value is string {\n return typeof value === 'string'\n}\n\nfunction isNumber(value: unknown): value is number {\n return typeof value === 'number'\n}\n\nfunction isBoolean(value: unknown): value is boolean {\n return typeof value === 'boolean'\n}\n\n/**\n * _internal_ownProps contains the _definition_ for the type.\n * Without it we cannot differentiate inline array item types from globally defined types in array.of\n */\nfunction getSchemaTypeInternalOwnProps(type: SchemaType): InternalOwnProps | undefined {\n return (type as {_internal_ownProps?: InternalOwnProps})?._internal_ownProps\n}\n\n/**\n * This allows us to differentiate inline array.of type definitions vs global type names on compiled schema types\n */\nexport function getDefinedTypeName(type: SchemaType): string | undefined {\n return getSchemaTypeInternalOwnProps(type)?.type\n}\n"],"names":["DEFAULT_IMAGE_FIELDS","Set","DEFAULT_FILE_FIELDS","DEFAULT_GEOPOINT_FIELDS","DEFAULT_SLUG_FIELDS","getCustomFields","type","fields","fieldsets","flatMap","fs","single","field","map","fieldset","name","isType","filter","f","has","isReference","isCrossDatasetReference","isGlobalDocumentReference","isObjectField","maybeOjectField","isCustomized","maybeCustomized","internalOwnProps","getSchemaTypeInternalOwnProps","hasFieldsArray","Array","isArray","length","schemaType","typeName","isDefined","value","undefined","isRecord","isPrimitive","isString","isBoolean","isNumber","_internal_ownProps","getDefinedTypeName"],"mappings":"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"}