sanity 4.4.0-next.21 → 4.4.0-next.23
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/StructureToolProvider.js +20 -31
- package/lib/_chunks-cjs/StructureToolProvider.js.map +1 -1
- package/lib/_chunks-cjs/version.js +1 -1
- package/lib/_chunks-es/StructureToolProvider.mjs +20 -31
- package/lib/_chunks-es/StructureToolProvider.mjs.map +1 -1
- package/lib/_chunks-es/version.mjs +1 -1
- package/package.json +14 -14
@@ -385,19 +385,14 @@ class MenuItemGroupBuilder {
|
|
385
385
|
serialize(options = {
|
386
386
|
path: []
|
387
387
|
}) {
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
} = this;
|
393
|
-
if (!_id)
|
394
|
-
throw new SerializeError("`id` is required for a menu item group", options.path, options.index, _title).withHelpUrl(HELP_URL.ID_REQUIRED);
|
395
|
-
if (!_title)
|
396
|
-
throw new SerializeError("`title` is required for a menu item group", options.path, _id).withHelpUrl(HELP_URL.TITLE_REQUIRED);
|
388
|
+
if (!this._id)
|
389
|
+
throw new SerializeError("`id` is required for a menu item group", options.path, options.index, this._title).withHelpUrl(HELP_URL.ID_REQUIRED);
|
390
|
+
if (!this._title)
|
391
|
+
throw new SerializeError("`title` is required for a menu item group", options.path, this._id).withHelpUrl(HELP_URL.TITLE_REQUIRED);
|
397
392
|
return {
|
398
|
-
id: _id,
|
399
|
-
title: _title,
|
400
|
-
i18n: _i18n
|
393
|
+
id: this._id,
|
394
|
+
title: this._title,
|
395
|
+
i18n: this._i18n
|
401
396
|
};
|
402
397
|
}
|
403
398
|
}
|
@@ -1206,30 +1201,24 @@ class InitialValueTemplateItemBuilder {
|
|
1206
1201
|
} = {
|
1207
1202
|
path: []
|
1208
1203
|
}) {
|
1209
|
-
|
1210
|
-
spec,
|
1211
|
-
_context
|
1212
|
-
} = this, {
|
1213
|
-
templates
|
1214
|
-
} = _context;
|
1215
|
-
if (typeof spec.id != "string" || !spec.id)
|
1204
|
+
if (typeof this.spec.id != "string" || !this.spec.id)
|
1216
1205
|
throw new SerializeError("`id` is required for initial value template item nodes", path, index, hint).withHelpUrl(HELP_URL.ID_REQUIRED);
|
1217
|
-
if (!spec.templateId)
|
1218
|
-
throw new SerializeError("template id (`templateId`) is required for initial value template item nodes", path, spec.id, hint).withHelpUrl(HELP_URL.ID_REQUIRED);
|
1219
|
-
const template = templates.find((t) => t.id === spec.templateId);
|
1206
|
+
if (!this.spec.templateId)
|
1207
|
+
throw new SerializeError("template id (`templateId`) is required for initial value template item nodes", path, this.spec.id, hint).withHelpUrl(HELP_URL.ID_REQUIRED);
|
1208
|
+
const template = this._context.templates.find((t) => t.id === this.spec.templateId);
|
1220
1209
|
if (!template)
|
1221
|
-
throw new SerializeError("template id (`templateId`) is required for initial value template item nodes", path, spec.id, hint).withHelpUrl(HELP_URL.ID_REQUIRED);
|
1210
|
+
throw new SerializeError("template id (`templateId`) is required for initial value template item nodes", path, this.spec.id, hint).withHelpUrl(HELP_URL.ID_REQUIRED);
|
1222
1211
|
return {
|
1223
|
-
id: spec.id,
|
1224
|
-
templateId: spec.id,
|
1212
|
+
id: this.spec.id,
|
1213
|
+
templateId: this.spec.id,
|
1225
1214
|
schemaType: template.schemaType,
|
1226
1215
|
type: "initialValueTemplateItem",
|
1227
|
-
description: spec.description || template.description,
|
1228
|
-
title: spec.title || template.title,
|
1229
|
-
subtitle: spec.subtitle,
|
1230
|
-
icon: spec.icon || template.icon,
|
1231
|
-
initialDocumentId: spec.initialDocumentId,
|
1232
|
-
parameters: spec.parameters
|
1216
|
+
description: this.spec.description || template.description,
|
1217
|
+
title: this.spec.title || template.title,
|
1218
|
+
subtitle: this.spec.subtitle,
|
1219
|
+
icon: this.spec.icon || template.icon,
|
1220
|
+
initialDocumentId: this.spec.initialDocumentId,
|
1221
|
+
parameters: this.spec.parameters
|
1233
1222
|
};
|
1234
1223
|
}
|
1235
1224
|
/** Clone generic view builder (allows for options overriding)
|