slice-machine-ui 2.16.2-alpha.lg-cr-types-update.4 → 2.16.2-alpha.xru-bug-report.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.
Files changed (62) hide show
  1. package/out/404.html +1 -1
  2. package/out/_next/static/8q2yFutD52CGaXBjZX6C_/_buildManifest.js +1 -0
  3. package/out/_next/static/chunks/268-6d5fc7642a1b87c8.js +1 -0
  4. package/out/_next/static/chunks/34-2911c905c8a6e9d9.js +1 -0
  5. package/out/_next/static/chunks/630-93339694ef30b82d.js +1 -0
  6. package/out/_next/static/chunks/867-8164160c810122c6.js +1 -0
  7. package/out/_next/static/chunks/882-28837678beff7e51.js +1 -0
  8. package/out/_next/static/chunks/895-8c214ba470a4e23c.js +1 -0
  9. package/out/_next/static/chunks/{main-c46f4dcf6e3174bd.js → main-1c0e53194ff2e726.js} +1 -1
  10. package/out/_next/static/chunks/pages/_app-ca94201d2943fc7b.js +657 -0
  11. package/out/_next/static/chunks/pages/changelog-80a618708f44f25f.js +1 -0
  12. package/out/_next/static/chunks/pages/changes-d40c17939854b984.js +1 -0
  13. package/out/_next/static/chunks/pages/custom-types/{[customTypeId]-a408f5a660e096a6.js → [customTypeId]-389d1b7a492fb3e7.js} +1 -1
  14. package/out/_next/static/chunks/pages/{custom-types-5acd56959b60346f.js → custom-types-2a5fd94ee42ba593.js} +1 -1
  15. package/out/_next/static/chunks/pages/{index-0d8cb369de720a35.js → index-02dd147957c8b40f.js} +1 -1
  16. package/out/_next/static/chunks/pages/labs-c6df252ea5d8fb6f.js +1 -0
  17. package/out/_next/static/chunks/pages/page-types/{[pageTypeId]-f5e851ebe35049a8.js → [pageTypeId]-3589bd1f9138a97b.js} +1 -1
  18. package/out/_next/static/chunks/pages/settings-170379902605f38a.js +1 -0
  19. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-063fa88ba75f483e.js +1 -0
  20. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-6de02b8ed13b680d.js +1 -0
  21. package/out/_next/static/chunks/pages/slices-071bb494907adf0f.js +1 -0
  22. package/out/_next/static/chunks/webpack-2f903acb0cccbf9e.js +1 -0
  23. package/out/_next/static/css/9c9a7de81f9ac811.css +1 -0
  24. package/out/changelog.html +1 -1
  25. package/out/changes.html +1 -1
  26. package/out/custom-types/[customTypeId].html +1 -1
  27. package/out/custom-types.html +1 -1
  28. package/out/index.html +1 -1
  29. package/out/labs.html +1 -1
  30. package/out/page-types/[pageTypeId].html +1 -1
  31. package/out/settings.html +1 -1
  32. package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
  33. package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
  34. package/out/slices.html +1 -1
  35. package/package.json +8 -8
  36. package/src/features/customTypes/customTypesTable/CustomTypesTable.tsx +4 -2
  37. package/src/features/customTypes/customTypesTable/{useCustomTypesAutoRevalidation.tsx → useCustomTypes.ts} +34 -1
  38. package/src/legacy/lib/models/common/widgets/ContentRelationship/Form.tsx +77 -35
  39. package/src/legacy/lib/models/common/widgets/ContentRelationship/index.ts +14 -44
  40. package/src/legacy/lib/models/common/widgets/Link/index.ts +1 -1
  41. package/out/_next/static/-EBzrfgGRyWk3MMsLeuP7/_buildManifest.js +0 -1
  42. package/out/_next/static/chunks/248-03446cd9e9f13730.js +0 -1
  43. package/out/_next/static/chunks/268-6a9214b97195af9c.js +0 -1
  44. package/out/_next/static/chunks/33641354.3864aefb6106ae71.js +0 -28
  45. package/out/_next/static/chunks/34-e684c5fd75cc9dd0.js +0 -1
  46. package/out/_next/static/chunks/630-a9927675acae2970.js +0 -1
  47. package/out/_next/static/chunks/647-7b9b5aa9468f9e4b.js +0 -1
  48. package/out/_next/static/chunks/882-53d88aa0b7e3ffeb.js +0 -1
  49. package/out/_next/static/chunks/pages/_app-c9e5b554f2a2b0cb.js +0 -708
  50. package/out/_next/static/chunks/pages/changelog-063c5e11dfc8fd55.js +0 -1
  51. package/out/_next/static/chunks/pages/changes-564336edb0ed18b0.js +0 -1
  52. package/out/_next/static/chunks/pages/labs-9630bfb1005be02b.js +0 -1
  53. package/out/_next/static/chunks/pages/settings-01f4aeb9112a1f87.js +0 -1
  54. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-5008e29008aa04f4.js +0 -1
  55. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-94c9cad9da2c3089.js +0 -1
  56. package/out/_next/static/chunks/pages/slices-4a60cd5f2c71327e.js +0 -1
  57. package/out/_next/static/chunks/webpack-b3522fdebabf510a.js +0 -1
  58. package/out/_next/static/css/cc9b10286400c2b9.css +0 -1
  59. package/src/features/builder/fields/ContentRelationshipFieldPicker.tsx +0 -1233
  60. package/src/features/customTypes/useCustomTypes.ts +0 -48
  61. package/src/utils/isValidObject.ts +0 -32
  62. /package/out/_next/static/{-EBzrfgGRyWk3MMsLeuP7 → 8q2yFutD52CGaXBjZX6C_}/_ssgManifest.js +0 -0
@@ -1,48 +0,0 @@
1
- import {
2
- revalidateData,
3
- updateData,
4
- useRequest,
5
- } from "@prismicio/editor-support/Suspense";
6
- import type { CustomType } from "@prismicio/types-internal/lib/customtypes";
7
- import type { CustomTypeFormat } from "@slicemachine/manager";
8
- import { useCallback } from "react";
9
-
10
- import { managerClient } from "@/managerClient";
11
-
12
- type UseCustomTypesReturnType = {
13
- customTypes: CustomType[];
14
- updateCustomTypes: (customTypes: CustomType[]) => void;
15
- };
16
-
17
- export function useCustomTypes(
18
- format?: CustomTypeFormat,
19
- ): UseCustomTypesReturnType {
20
- const updateCustomTypes = useCallback(
21
- (data: CustomType[]) => updateData(getCustomTypes, [format], data),
22
- [format],
23
- );
24
-
25
- return {
26
- customTypes: useRequest(getCustomTypes, [format]),
27
- updateCustomTypes,
28
- };
29
- }
30
-
31
- export async function getCustomTypes(
32
- format?: CustomTypeFormat,
33
- ): Promise<CustomType[]> {
34
- const { errors, models } = await managerClient.customTypes.readAllCustomTypes(
35
- format ? { format } : undefined,
36
- );
37
-
38
- if (errors.length > 0) {
39
- throw errors;
40
- }
41
-
42
- return models.map(({ model }) => model);
43
- }
44
-
45
- export function revalidateGetCustomTypes(format?: CustomTypeFormat) {
46
- void revalidateData(getCustomTypes, []);
47
- void revalidateData(getCustomTypes, [format]);
48
- }
@@ -1,32 +0,0 @@
1
- /**
2
- * Ensure that the value is an record/object with string keys and existing
3
- * properties. Accepts empty objects and objects created with
4
- * `Object.create(null)`.
5
- */
6
- export function isValidObject(
7
- value: unknown,
8
- ): value is Record<string, unknown> {
9
- if (typeof value !== "object" || value === null) return false;
10
-
11
- if (Array.isArray(value)) return false;
12
-
13
- if (
14
- value instanceof Date ||
15
- value instanceof RegExp ||
16
- value instanceof Error
17
- ) {
18
- return false;
19
- }
20
-
21
- // Check if all keys are strings and all values are valid
22
- for (const key in value) {
23
- if (
24
- typeof key !== "string" ||
25
- !Object.prototype.hasOwnProperty.call(value, key)
26
- ) {
27
- return false;
28
- }
29
- }
30
-
31
- return true;
32
- }