@prismicio/types-internal 2.0.0-alpha.2 → 2.0.0-alpha.3

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 (103) hide show
  1. package/package.json +1 -1
  2. package/lib/content/CustomType.d.ts +0 -2972
  3. package/lib/content/CustomType.js +0 -15
  4. package/lib/content/fields/nestable/FieldContent.d.ts +0 -32
  5. package/lib/content/fields/nestable/FieldContent.js +0 -37
  6. package/lib/content/fields/nestable/Image.d.ts +0 -103
  7. package/lib/content/fields/nestable/Image.js +0 -13
  8. package/lib/content/fields/nestable/RichTextContent.d.ts +0 -376
  9. package/lib/content/fields/nestable/RichTextContent.js +0 -16
  10. package/lib/content/fields/slices/CompositeSliceContent.d.ts +0 -677
  11. package/lib/content/fields/slices/CompositeSliceContent.js +0 -14
  12. package/lib/content/fields/slices/RepeatableContent.d.ts +0 -338
  13. package/lib/content/fields/slices/RepeatableContent.js +0 -16
  14. package/lib/content/fields/slices/SharedSliceContent.d.ts +0 -678
  15. package/lib/content/fields/slices/SharedSliceContent.js +0 -15
  16. package/lib/content/fields/slices/SimpleSliceContent.d.ts +0 -675
  17. package/lib/content/fields/slices/SimpleSliceContent.js +0 -8
  18. package/lib/customtypes/Comparators/Changes.d.ts +0 -17
  19. package/lib/customtypes/Comparators/Changes.js +0 -9
  20. package/lib/customtypes/Comparators/SharedSlice.d.ts +0 -679
  21. package/lib/customtypes/Comparators/SharedSlice.js +0 -55
  22. package/lib/customtypes/Comparators/Variation.d.ts +0 -662
  23. package/lib/customtypes/Comparators/Variation.js +0 -75
  24. package/lib/customtypes/Comparators/index.d.ts +0 -3
  25. package/lib/customtypes/Comparators/index.js +0 -6
  26. package/lib/customtypes/Format.d.ts +0 -4
  27. package/lib/customtypes/Format.js +0 -8
  28. package/lib/customtypes/comp/Changes.d.ts +0 -17
  29. package/lib/customtypes/comp/Changes.js +0 -9
  30. package/lib/customtypes/comp/SharedSlice.d.ts +0 -679
  31. package/lib/customtypes/comp/SharedSlice.js +0 -55
  32. package/lib/customtypes/comp/Variation.d.ts +0 -662
  33. package/lib/customtypes/comp/Variation.js +0 -76
  34. package/lib/customtypes/comp/index.d.ts +0 -3
  35. package/lib/customtypes/comp/index.js +0 -6
  36. package/lib/customtypes/utils/Comparator.d.ts +0 -1353
  37. package/lib/customtypes/utils/Comparator.js +0 -59
  38. package/lib/customtypes/utils/index.d.ts +0 -1
  39. package/lib/customtypes/utils/index.js +0 -4
  40. package/lib/customtypes/widgets/WidgetTypes.d.ts +0 -22
  41. package/lib/customtypes/widgets/WidgetTypes.js +0 -25
  42. package/lib/documents/DocumentData.d.ts +0 -6
  43. package/lib/documents/DocumentData.js +0 -15
  44. package/lib/documents/index.d.ts +0 -2
  45. package/lib/documents/index.js +0 -7
  46. package/lib/documents/widgets/EmptyContent.d.ts +0 -8
  47. package/lib/documents/widgets/EmptyContent.js +0 -9
  48. package/lib/documents/widgets/GroupContent.d.ts +0 -16
  49. package/lib/documents/widgets/GroupContent.js +0 -60
  50. package/lib/documents/widgets/SimpleWidgetContent.d.ts +0 -20
  51. package/lib/documents/widgets/SimpleWidgetContent.js +0 -75
  52. package/lib/documents/widgets/StaticWidgetContent.d.ts +0 -10
  53. package/lib/documents/widgets/StaticWidgetContent.js +0 -26
  54. package/lib/documents/widgets/UIDContent.d.ts +0 -7
  55. package/lib/documents/widgets/UIDContent.js +0 -10
  56. package/lib/documents/widgets/index.d.ts +0 -38
  57. package/lib/documents/widgets/index.js +0 -40
  58. package/lib/documents/widgets/nestable/BooleanContent.d.ts +0 -8
  59. package/lib/documents/widgets/nestable/BooleanContent.js +0 -11
  60. package/lib/documents/widgets/nestable/EmbedContent.d.ts +0 -42
  61. package/lib/documents/widgets/nestable/EmbedContent.js +0 -35
  62. package/lib/documents/widgets/nestable/FieldContent.d.ts +0 -13
  63. package/lib/documents/widgets/nestable/FieldContent.js +0 -37
  64. package/lib/documents/widgets/nestable/GeoPointContent.d.ts +0 -17
  65. package/lib/documents/widgets/nestable/GeoPointContent.js +0 -13
  66. package/lib/documents/widgets/nestable/ImageContent.d.ts +0 -127
  67. package/lib/documents/widgets/nestable/ImageContent.js +0 -41
  68. package/lib/documents/widgets/nestable/IntegrationFieldsContent.d.ts +0 -8
  69. package/lib/documents/widgets/nestable/IntegrationFieldsContent.js +0 -16
  70. package/lib/documents/widgets/nestable/Link/DocumentLink.d.ts +0 -12
  71. package/lib/documents/widgets/nestable/Link/DocumentLink.js +0 -13
  72. package/lib/documents/widgets/nestable/Link/ExternalLink.d.ts +0 -24
  73. package/lib/documents/widgets/nestable/Link/ExternalLink.js +0 -24
  74. package/lib/documents/widgets/nestable/Link/FileLink.d.ts +0 -22
  75. package/lib/documents/widgets/nestable/Link/FileLink.js +0 -25
  76. package/lib/documents/widgets/nestable/Link/ImageLink.d.ts +0 -28
  77. package/lib/documents/widgets/nestable/Link/ImageLink.js +0 -26
  78. package/lib/documents/widgets/nestable/Link/LinkContent.d.ts +0 -42
  79. package/lib/documents/widgets/nestable/Link/LinkContent.js +0 -17
  80. package/lib/documents/widgets/nestable/Link/index.d.ts +0 -90
  81. package/lib/documents/widgets/nestable/Link/index.js +0 -35
  82. package/lib/documents/widgets/nestable/SeparatorContent.d.ts +0 -11
  83. package/lib/documents/widgets/nestable/SeparatorContent.js +0 -15
  84. package/lib/documents/widgets/nestable/StructuredTextContent/Block.d.ts +0 -314
  85. package/lib/documents/widgets/nestable/StructuredTextContent/Block.js +0 -98
  86. package/lib/documents/widgets/nestable/StructuredTextContent/index.d.ts +0 -9
  87. package/lib/documents/widgets/nestable/StructuredTextContent/index.js +0 -14
  88. package/lib/documents/widgets/nestable/index.d.ts +0 -26
  89. package/lib/documents/widgets/nestable/index.js +0 -39
  90. package/lib/documents/widgets/slices/CompositeSliceContent.d.ts +0 -14
  91. package/lib/documents/widgets/slices/CompositeSliceContent.js +0 -52
  92. package/lib/documents/widgets/slices/SharedSliceContent.d.ts +0 -15
  93. package/lib/documents/widgets/slices/SharedSliceContent.js +0 -63
  94. package/lib/documents/widgets/slices/SimpleSliceContent.d.ts +0 -6
  95. package/lib/documents/widgets/slices/SimpleSliceContent.js +0 -6
  96. package/lib/documents/widgets/slices/SliceWidgetContent.d.ts +0 -8
  97. package/lib/documents/widgets/slices/SliceWidgetContent.js +0 -26
  98. package/lib/documents/widgets/slices/SlicesContent.d.ts +0 -17
  99. package/lib/documents/widgets/slices/SlicesContent.js +0 -52
  100. package/lib/documents/widgets/slices/index.d.ts +0 -5
  101. package/lib/documents/widgets/slices/index.js +0 -8
  102. package/lib/index.d.ts +0 -3
  103. package/lib/index.js +0 -7
@@ -1,76 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.VariationComparator = void 0;
4
- const utils_1 = require("../../utils");
5
- const Changes_1 = require("./Changes");
6
- function compareVariationMeta(variationA, variationB) {
7
- const zippedVariations = utils_1.Objects.zipObjects(variationA, variationB);
8
- return Object.entries(zippedVariations).reduce((acc, [key, value]) => {
9
- if (key === `primary` || key === 'items')
10
- return acc;
11
- if ((value === null || value === void 0 ? void 0 : value.left) === (value === null || value === void 0 ? void 0 : value.right))
12
- return acc;
13
- return { ...acc, [key]: value === null || value === void 0 ? void 0 : value.right };
14
- }, {});
15
- }
16
- function compareWidgets(widgetsA, widgetsB) {
17
- const zippedWidgets = utils_1.Objects.zipObjects(widgetsA, widgetsB);
18
- const diffWidgets = Object.entries(zippedWidgets).reduce((acc, [widgetKey, widgetValue]) => {
19
- if (JSON.stringify(widgetValue === null || widgetValue === void 0 ? void 0 : widgetValue.left) ===
20
- JSON.stringify(widgetValue === null || widgetValue === void 0 ? void 0 : widgetValue.right))
21
- return acc;
22
- const changes = (() => {
23
- if (!(widgetValue === null || widgetValue === void 0 ? void 0 : widgetValue.left) && !(widgetValue === null || widgetValue === void 0 ? void 0 : widgetValue.right))
24
- return;
25
- if ((widgetValue === null || widgetValue === void 0 ? void 0 : widgetValue.left) && !widgetValue.right)
26
- return {
27
- op: Changes_1.DiffOperation.Removed,
28
- };
29
- if (!(widgetValue === null || widgetValue === void 0 ? void 0 : widgetValue.left) && (widgetValue === null || widgetValue === void 0 ? void 0 : widgetValue.right))
30
- return {
31
- op: Changes_1.DiffOperation.Added,
32
- value: widgetValue.right,
33
- };
34
- return {
35
- op: Changes_1.DiffOperation.Updated,
36
- value: widgetValue.right,
37
- };
38
- })();
39
- if (!changes)
40
- return acc;
41
- return {
42
- ...acc,
43
- [widgetKey]: changes,
44
- };
45
- }, {});
46
- return utils_1.Objects.isNotEmpty(diffWidgets) ? diffWidgets : undefined;
47
- }
48
- exports.VariationComparator = {
49
- compare(variationA, variationB) {
50
- if (variationA && !variationB)
51
- return {
52
- op: Changes_1.DiffOperation.Removed,
53
- };
54
- if (!variationA && variationB) {
55
- return {
56
- op: Changes_1.DiffOperation.Added,
57
- value: variationB,
58
- };
59
- }
60
- const diffMeta = compareVariationMeta(variationA, variationB);
61
- const diffPrimary = compareWidgets(variationA === null || variationA === void 0 ? void 0 : variationA.primary, variationB === null || variationB === void 0 ? void 0 : variationB.primary);
62
- const diffItems = compareWidgets(variationA === null || variationA === void 0 ? void 0 : variationA.items, variationB === null || variationB === void 0 ? void 0 : variationB.items);
63
- const diffVariation = {
64
- ...diffMeta,
65
- ...(diffPrimary ? { primary: diffPrimary } : {}),
66
- ...(diffItems ? { items: diffItems } : {}),
67
- };
68
- if (utils_1.Objects.isNotEmpty(diffVariation)) {
69
- return {
70
- op: Changes_1.DiffOperation.Updated,
71
- value: diffVariation,
72
- };
73
- }
74
- return undefined;
75
- },
76
- };
@@ -1,3 +0,0 @@
1
- export * from './Changes';
2
- export * from './SharedSlice';
3
- export * from './Variation';
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- (0, tslib_1.__exportStar)(require("./Changes"), exports);
5
- (0, tslib_1.__exportStar)(require("./SharedSlice"), exports);
6
- (0, tslib_1.__exportStar)(require("./Variation"), exports);