@prismicio/types-internal 2.2.1-remove-import.alpha-1 → 2.2.1

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.
@@ -134,8 +134,9 @@ function traverseCompositeSliceContent({ path, sliceKey, sliceName, model, conte
134
134
  }
135
135
  exports.traverseCompositeSliceContent = traverseCompositeSliceContent;
136
136
  function migrateCompositeSlice(model, content) {
137
+ const [, sliceUUID] = content.key.split("$");
137
138
  return {
138
- key: content.key,
139
+ key: `${model.sliceName}$${sliceUUID}`,
139
140
  name: model.sliceName,
140
141
  maybeLabel: content.maybeLabel,
141
142
  widget: {
@@ -87,9 +87,11 @@ function traverseSimpleSliceContent({ path, sliceKey, sliceName, model, content,
87
87
  exports.traverseSimpleSliceContent = traverseSimpleSliceContent;
88
88
  function migrateSimpleSlice(model, content) {
89
89
  var _a;
90
+ const [, sliceUUID] = content.key.split("$");
91
+ const key = `${model.sliceName}$${sliceUUID}`;
90
92
  if (content.widget.__TYPE__ === "GroupContentType") {
91
93
  return {
92
- key: content.key,
94
+ key,
93
95
  name: model.sliceName,
94
96
  maybeLabel: content.maybeLabel,
95
97
  widget: {
@@ -111,7 +113,7 @@ function migrateSimpleSlice(model, content) {
111
113
  };
112
114
  }
113
115
  return {
114
- key: content.key,
116
+ key,
115
117
  name: model.sliceName,
116
118
  maybeLabel: content.maybeLabel,
117
119
  widget: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismicio/types-internal",
3
- "version": "2.2.1-remove-import.alpha-1",
3
+ "version": "2.2.1",
4
4
  "description": "Prismic types for Custom Types and Prismic Data",
5
5
  "keywords": [
6
6
  "typescript",
@@ -211,8 +211,9 @@ export function migrateCompositeSlice(
211
211
  model: VariationFields,
212
212
  content: CompositeSliceItemContent,
213
213
  ): SharedSliceItemContent {
214
+ const [, sliceUUID] = content.key.split("$")
214
215
  return {
215
- key: content.key,
216
+ key: `${model.sliceName}$${sliceUUID}`,
216
217
  name: model.sliceName,
217
218
  maybeLabel: content.maybeLabel,
218
219
  widget: {
@@ -135,9 +135,12 @@ export function migrateSimpleSlice(
135
135
  model: VariationFields,
136
136
  content: SimpleSliceItemContent,
137
137
  ): SharedSliceItemContent {
138
+ const [, sliceUUID] = content.key.split("$")
139
+ const key = `${model.sliceName}$${sliceUUID}`
140
+
138
141
  if (content.widget.__TYPE__ === "GroupContentType") {
139
142
  return {
140
- key: content.key,
143
+ key,
141
144
  name: model.sliceName,
142
145
  maybeLabel: content.maybeLabel,
143
146
  widget: {
@@ -161,7 +164,7 @@ export function migrateSimpleSlice(
161
164
  }
162
165
  }
163
166
  return {
164
- key: content.key,
167
+ key,
165
168
  name: model.sliceName,
166
169
  maybeLabel: content.maybeLabel,
167
170
  widget: {