@fibery/views 18.0.4 → 19.0.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 (63) hide show
  1. package/lib/src/field-utils/reference-collection.d.ts +5 -10
  2. package/lib/src/field-utils/reference-collection.js +41 -19
  3. package/lib/src/field-utils/rich-text.d.ts +5 -4
  4. package/lib/src/field-utils/rich-text.js +22 -11
  5. package/lib/src/index.d.ts +28 -16
  6. package/lib/src/index.js +1 -1
  7. package/lib/src/private/board.d.ts +15 -11
  8. package/lib/src/private/board.js +8 -7
  9. package/lib/src/private/calendar.d.ts +14 -10
  10. package/lib/src/private/calendar.js +4 -3
  11. package/lib/src/private/feed.d.ts +14 -10
  12. package/lib/src/private/feed.js +4 -3
  13. package/lib/src/private/form.d.ts +25 -3
  14. package/lib/src/private/form.js +3 -3
  15. package/lib/src/private/map.d.ts +14 -10
  16. package/lib/src/private/map.js +4 -3
  17. package/lib/src/private/smart-folder.d.ts +23 -15
  18. package/lib/src/private/smart-folder.js +16 -13
  19. package/lib/src/private/timeline.d.ts +39 -10
  20. package/lib/src/private/timeline.js +8 -6
  21. package/lib/src/private/units.d.ts +10 -6
  22. package/lib/src/private/units.js +43 -22
  23. package/lib/src/private/utils.d.ts +64 -17
  24. package/lib/src/private/utils.js +26 -20
  25. package/lib/src/truthy.d.ts +1 -0
  26. package/lib/src/truthy.js +7 -0
  27. package/lib/src/unit-definitions/avatar-collection.js +24 -19
  28. package/lib/src/unit-definitions/avatar.js +23 -15
  29. package/lib/src/unit-definitions/collection-count.js +7 -7
  30. package/lib/src/unit-definitions/file-collection-count.js +9 -7
  31. package/lib/src/unit-definitions/file-compact-collection.js +9 -7
  32. package/lib/src/unit-definitions/file-compact-reference.js +5 -4
  33. package/lib/src/unit-definitions/file-reference.js +6 -4
  34. package/lib/src/unit-definitions/files-gallery.js +9 -7
  35. package/lib/src/unit-definitions/files-l-list-item.js +6 -4
  36. package/lib/src/unit-definitions/files-l-list.js +9 -7
  37. package/lib/src/unit-definitions/files-list-item.js +6 -4
  38. package/lib/src/unit-definitions/files-list.js +9 -7
  39. package/lib/src/unit-definitions/number.js +2 -4
  40. package/lib/src/unit-definitions/progress-bar.js +1 -4
  41. package/lib/src/unit-definitions/reference-collection.js +4 -3
  42. package/lib/src/unit-definitions/reference.js +17 -5
  43. package/lib/src/unit-definitions/rich-text-snippet.d.ts +1 -0
  44. package/lib/src/unit-definitions/rich-text-snippet.js +6 -11
  45. package/lib/src/unit-utils/decimal.js +10 -6
  46. package/lib/src/unit-utils/get-export-value.d.ts +1 -1
  47. package/lib/src/unit-utils/get-export-value.js +2 -1
  48. package/lib/src/unit-utils/get-field-label.js +2 -2
  49. package/lib/src/unit-utils/wrap-normalized-in-expression.d.ts +3 -0
  50. package/lib/src/unit-utils/wrap-normalized-in-expression.js +14 -0
  51. package/lib/src/units/board.d.ts +6 -3
  52. package/lib/src/units/canvas/index.d.ts +6 -3
  53. package/lib/src/units/default.d.ts +6 -3
  54. package/lib/src/units/gantt.d.ts +6 -3
  55. package/lib/src/units/grid.d.ts +6 -3
  56. package/lib/src/units/grid.js +4 -0
  57. package/lib/src/units/list.d.ts +6 -3
  58. package/lib/src/units/make-factory.d.ts +10 -9
  59. package/lib/src/units/make-factory.js +26 -10
  60. package/lib/src/units/types.d.ts +1 -1
  61. package/package.json +26 -26
  62. package/lib/jest.config.d.ts +0 -2
  63. package/lib/jest.config.js +0 -32
@@ -4,7 +4,7 @@ exports.getFieldLabel = void 0;
4
4
  const utils_1 = require("@fibery/expression-utils/src/utils");
5
5
  const getFieldLabel = ({ typeObject, unit }) => {
6
6
  const { expression } = unit;
7
- const fieldObject = (0, utils_1.getFieldObjectByFieldExpression)({ typeObject, expression });
8
- return fieldObject.title;
7
+ const fieldObjects = (0, utils_1.getFieldObjectsByFieldExpression)({ typeObject, expression });
8
+ return fieldObjects.map((fieldObject) => fieldObject.title).join(" -> ");
9
9
  };
10
10
  exports.getFieldLabel = getFieldLabel;
@@ -0,0 +1,3 @@
1
+ import { FieldObject } from "@fibery/schema";
2
+ import { FieldExpression } from "@fibery/expression-utils/src/types";
3
+ export declare const wrapNormalizedInExpression: (innerNormalized: Record<string, unknown>, fieldObjects: FieldObject[], expression: FieldExpression) => Record<string, unknown>;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.wrapNormalizedInExpression = void 0;
4
+ const wrapNormalizedInExpression = (innerNormalized, fieldObjects, expression) => [...expression].reverse().reduce((inner, field, reversedIndex) => {
5
+ const originalIndex = expression.length - 1 - reversedIndex;
6
+ const isTerminal = originalIndex === expression.length - 1;
7
+ if (!isTerminal) {
8
+ const { idField } = fieldObjects[originalIndex].typeObject;
9
+ const innerWithId = idField ? { [idField]: idField, ...inner } : inner;
10
+ return { [field]: innerWithId };
11
+ }
12
+ return { [field]: inner };
13
+ }, innerNormalized);
14
+ exports.wrapNormalizedInExpression = wrapNormalizedInExpression;
@@ -1,22 +1,25 @@
1
1
  import { TypeObject } from "@fibery/schema";
2
2
  export declare const getTypeUnits: () => import("./types").PureUnit[], getUnitName: (unit: import("./types").Unit) => string | null, getUnitsForType: (typeObject: TypeObject, options?: {
3
+ parentFieldObjects?: import("@fibery/schema").FieldObject[];
3
4
  showHiddenFields?: boolean;
4
5
  isSharingMode?: boolean;
5
6
  }) => {
6
7
  unit: import("./types").Unit;
7
8
  fieldObject: import("@fibery/schema").FieldObject;
8
9
  }[], getUnitsForField: (fieldObject: import("@fibery/schema").FieldObject, options?: {
10
+ parentFieldObjects?: import("@fibery/schema").FieldObject[];
9
11
  showHiddenFields?: boolean;
10
12
  isSharingMode?: boolean;
11
13
  }) => import("./types").Unit[], getUnitsForTypePerField: (typeObject: TypeObject, options?: {
14
+ parentFieldObjects?: import("@fibery/schema").FieldObject[];
12
15
  showHiddenFields?: boolean;
13
16
  isSharingMode?: boolean;
14
17
  }) => {
15
18
  fieldObject: import("@fibery/schema").FieldObject;
16
19
  units: import("./types").Unit[];
17
- }[], getUnitLabel: (fieldObject: import("@fibery/schema").FieldObject, unit: import("./types").Unit) => string, getHardcodedUnitsForView: (typeObject: TypeObject) => ({
20
+ }[], getUnitLabel: (typeObject: TypeObject, unit: import("./types").Unit) => string, getHardcodedUnitsForView: (typeObject: TypeObject) => ({
21
+ type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-range" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-collection" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
18
22
  expression: import("./types").UnitExpression;
19
- type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
20
23
  kind: "field";
21
24
  settings?: Record<string, unknown> | undefined;
22
25
  hideWhenEmpty?: boolean | undefined;
@@ -31,8 +34,8 @@ export declare const getTypeUnits: () => import("./types").PureUnit[], getUnitNa
31
34
  label: string;
32
35
  icon?: string | undefined;
33
36
  } | {
34
- expression?: import("./types").UnitExpression | undefined;
35
37
  type: "type-icon" | "type-badge" | "type-badge-abbr";
38
+ expression?: import("./types").UnitExpression | undefined;
36
39
  kind: "db";
37
40
  hideWhenEmpty?: boolean | undefined;
38
41
  })[], getCardUnitsSelect: ({ schema, typeObject, units }: {
@@ -1,25 +1,28 @@
1
1
  export declare const getTypeUnits: () => import("../types").PureUnit[], getUnitName: (unit: import("../types").Unit) => string | null, getUnitsForField: (fieldObject: import("@fibery/schema").FieldObject, options?: {
2
+ parentFieldObjects?: import("@fibery/schema").FieldObject[];
2
3
  showHiddenFields?: boolean;
3
4
  isSharingMode?: boolean;
4
5
  }) => import("../types").Unit[], getUnitsForType: (typeObject: import("@fibery/schema").TypeObject, options?: {
6
+ parentFieldObjects?: import("@fibery/schema").FieldObject[];
5
7
  showHiddenFields?: boolean;
6
8
  isSharingMode?: boolean;
7
9
  }) => {
8
10
  unit: import("../types").Unit;
9
11
  fieldObject: import("@fibery/schema").FieldObject;
10
12
  }[], getUnitsForTypePerField: (typeObject: import("@fibery/schema").TypeObject, options?: {
13
+ parentFieldObjects?: import("@fibery/schema").FieldObject[];
11
14
  showHiddenFields?: boolean;
12
15
  isSharingMode?: boolean;
13
16
  }) => {
14
17
  fieldObject: import("@fibery/schema").FieldObject;
15
18
  units: import("../types").Unit[];
16
- }[], getUnitLabel: (fieldObject: import("@fibery/schema").FieldObject, unit: import("../types").Unit) => string, getCardUnitsSelect: ({ schema, typeObject, units }: {
19
+ }[], getUnitLabel: (typeObject: import("@fibery/schema").TypeObject, unit: import("../types").Unit) => string, getCardUnitsSelect: ({ schema, typeObject, units }: {
17
20
  schema: import("@fibery/schema").Schema;
18
21
  typeObject: import("@fibery/schema").TypeObject;
19
22
  units: import("../types").Unit[];
20
23
  }) => any, getHardcodedUnitsForView: (typeObject: import("@fibery/schema").TypeObject) => ({
24
+ type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-range" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-collection" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
21
25
  expression: import("../types").UnitExpression;
22
- type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
23
26
  kind: "field";
24
27
  settings?: Record<string, unknown> | undefined;
25
28
  hideWhenEmpty?: boolean | undefined;
@@ -34,8 +37,8 @@ export declare const getTypeUnits: () => import("../types").PureUnit[], getUnitN
34
37
  label: string;
35
38
  icon?: string | undefined;
36
39
  } | {
37
- expression?: import("../types").UnitExpression | undefined;
38
40
  type: "type-icon" | "type-badge" | "type-badge-abbr";
41
+ expression?: import("../types").UnitExpression | undefined;
39
42
  kind: "db";
40
43
  hideWhenEmpty?: boolean | undefined;
41
44
  })[];
@@ -1,14 +1,17 @@
1
1
  import { TypeObject } from "@fibery/schema";
2
2
  export declare const getTypeUnits: () => import("./types").PureUnit[], getUnitName: (unit: import("./types").Unit) => string | null, getUnitsForType: (typeObject: TypeObject, options?: {
3
+ parentFieldObjects?: import("@fibery/schema").FieldObject[];
3
4
  showHiddenFields?: boolean;
4
5
  isSharingMode?: boolean;
5
6
  }) => {
6
7
  unit: import("./types").Unit;
7
8
  fieldObject: import("@fibery/schema").FieldObject;
8
9
  }[], getUnitsForField: (fieldObject: import("@fibery/schema").FieldObject, options?: {
10
+ parentFieldObjects?: import("@fibery/schema").FieldObject[];
9
11
  showHiddenFields?: boolean;
10
12
  isSharingMode?: boolean;
11
13
  }) => import("./types").Unit[], getUnitsForTypePerField: (typeObject: TypeObject, options?: {
14
+ parentFieldObjects?: import("@fibery/schema").FieldObject[];
12
15
  showHiddenFields?: boolean;
13
16
  isSharingMode?: boolean;
14
17
  }) => {
@@ -18,9 +21,9 @@ export declare const getTypeUnits: () => import("./types").PureUnit[], getUnitNa
18
21
  schema: import("@fibery/schema").Schema;
19
22
  typeObject: TypeObject;
20
23
  units: import("./types").Unit[];
21
- }) => any, getUnitLabel: (fieldObject: import("@fibery/schema").FieldObject, unit: import("./types").Unit) => string, getHardcodedUnitsForView: (typeObject: TypeObject) => ({
24
+ }) => any, getUnitLabel: (typeObject: TypeObject, unit: import("./types").Unit) => string, getHardcodedUnitsForView: (typeObject: TypeObject) => ({
25
+ type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-range" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-collection" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
22
26
  expression: import("./types").UnitExpression;
23
- type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
24
27
  kind: "field";
25
28
  settings?: Record<string, unknown> | undefined;
26
29
  hideWhenEmpty?: boolean | undefined;
@@ -35,8 +38,8 @@ export declare const getTypeUnits: () => import("./types").PureUnit[], getUnitNa
35
38
  label: string;
36
39
  icon?: string | undefined;
37
40
  } | {
38
- expression?: import("./types").UnitExpression | undefined;
39
41
  type: "type-icon" | "type-badge" | "type-badge-abbr";
42
+ expression?: import("./types").UnitExpression | undefined;
40
43
  kind: "db";
41
44
  hideWhenEmpty?: boolean | undefined;
42
45
  })[];
@@ -1,14 +1,17 @@
1
1
  import { TypeObject } from "@fibery/schema";
2
2
  export declare const getTypeUnits: () => import("./types").PureUnit[], getUnitName: (unit: import("./types").Unit) => string | null, getUnitsForType: (typeObject: TypeObject, options?: {
3
+ parentFieldObjects?: import("@fibery/schema").FieldObject[];
3
4
  showHiddenFields?: boolean;
4
5
  isSharingMode?: boolean;
5
6
  }) => {
6
7
  unit: import("./types").Unit;
7
8
  fieldObject: import("@fibery/schema").FieldObject;
8
9
  }[], getUnitsForField: (fieldObject: import("@fibery/schema").FieldObject, options?: {
10
+ parentFieldObjects?: import("@fibery/schema").FieldObject[];
9
11
  showHiddenFields?: boolean;
10
12
  isSharingMode?: boolean;
11
13
  }) => import("./types").Unit[], getUnitsForTypePerField: (typeObject: TypeObject, options?: {
14
+ parentFieldObjects?: import("@fibery/schema").FieldObject[];
12
15
  showHiddenFields?: boolean;
13
16
  isSharingMode?: boolean;
14
17
  }) => {
@@ -18,9 +21,9 @@ export declare const getTypeUnits: () => import("./types").PureUnit[], getUnitNa
18
21
  schema: import("@fibery/schema").Schema;
19
22
  typeObject: TypeObject;
20
23
  units: import("./types").Unit[];
21
- }) => any, getUnitLabel: (fieldObject: import("@fibery/schema").FieldObject, unit: import("./types").Unit) => string, getHardcodedUnitsForView: (typeObject: TypeObject) => ({
24
+ }) => any, getUnitLabel: (typeObject: TypeObject, unit: import("./types").Unit) => string, getHardcodedUnitsForView: (typeObject: TypeObject) => ({
25
+ type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-range" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-collection" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
22
26
  expression: import("./types").UnitExpression;
23
- type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
24
27
  kind: "field";
25
28
  settings?: Record<string, unknown> | undefined;
26
29
  hideWhenEmpty?: boolean | undefined;
@@ -35,8 +38,8 @@ export declare const getTypeUnits: () => import("./types").PureUnit[], getUnitNa
35
38
  label: string;
36
39
  icon?: string | undefined;
37
40
  } | {
38
- expression?: import("./types").UnitExpression | undefined;
39
41
  type: "type-icon" | "type-badge" | "type-badge-abbr";
42
+ expression?: import("./types").UnitExpression | undefined;
40
43
  kind: "db";
41
44
  hideWhenEmpty?: boolean | undefined;
42
45
  })[];
@@ -1,25 +1,28 @@
1
1
  export declare const getTypeUnits: () => import("./types").PureUnit[], getUnitName: (unit: import("./types").Unit) => string | null, getUnitsForType: (typeObject: import("@fibery/schema").TypeObject, options?: {
2
+ parentFieldObjects?: import("@fibery/schema").FieldObject[];
2
3
  showHiddenFields?: boolean;
3
4
  isSharingMode?: boolean;
4
5
  }) => {
5
6
  unit: import("./types").Unit;
6
7
  fieldObject: import("@fibery/schema").FieldObject;
7
8
  }[], getUnitsForField: (fieldObject: import("@fibery/schema").FieldObject, options?: {
9
+ parentFieldObjects?: import("@fibery/schema").FieldObject[];
8
10
  showHiddenFields?: boolean;
9
11
  isSharingMode?: boolean;
10
12
  }) => import("./types").Unit[], getUnitsForTypePerField: (typeObject: import("@fibery/schema").TypeObject, options?: {
13
+ parentFieldObjects?: import("@fibery/schema").FieldObject[];
11
14
  showHiddenFields?: boolean;
12
15
  isSharingMode?: boolean;
13
16
  }) => {
14
17
  fieldObject: import("@fibery/schema").FieldObject;
15
18
  units: import("./types").Unit[];
16
- }[], getUnitLabel: (fieldObject: import("@fibery/schema").FieldObject, unit: import("./types").Unit) => string, getCardUnitsSelect: ({ schema, typeObject, units }: {
19
+ }[], getUnitLabel: (typeObject: import("@fibery/schema").TypeObject, unit: import("./types").Unit) => string, getCardUnitsSelect: ({ schema, typeObject, units }: {
17
20
  schema: import("@fibery/schema").Schema;
18
21
  typeObject: import("@fibery/schema").TypeObject;
19
22
  units: import("./types").Unit[];
20
23
  }) => any, getHardcodedUnitsForView: (typeObject: import("@fibery/schema").TypeObject) => ({
24
+ type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-range" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-collection" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
21
25
  expression: import("./types").UnitExpression;
22
- type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
23
26
  kind: "field";
24
27
  settings?: Record<string, unknown> | undefined;
25
28
  hideWhenEmpty?: boolean | undefined;
@@ -34,8 +37,8 @@ export declare const getTypeUnits: () => import("./types").PureUnit[], getUnitNa
34
37
  label: string;
35
38
  icon?: string | undefined;
36
39
  } | {
37
- expression?: import("./types").UnitExpression | undefined;
38
40
  type: "type-icon" | "type-badge" | "type-badge-abbr";
41
+ expression?: import("./types").UnitExpression | undefined;
39
42
  kind: "db";
40
43
  hideWhenEmpty?: boolean | undefined;
41
44
  })[];
@@ -30,6 +30,8 @@ const url_1 = require("../unit-definitions/url");
30
30
  const user_button_1 = require("../unit-definitions/user-button");
31
31
  const user_role_1 = require("../unit-definitions/user-role");
32
32
  const file_collection_count_1 = require("../unit-definitions/file-collection-count");
33
+ const files_gallery_1 = require("../unit-definitions/files-gallery");
34
+ const file_reference_1 = require("@fibery/views/src/unit-definitions/file-reference");
33
35
  const allUnitDefinitions = {
34
36
  AvatarCollection: avatar_collection_1.AvatarCollection,
35
37
  Bool: bool_1.Bool,
@@ -58,6 +60,8 @@ const allUnitDefinitions = {
58
60
  IconButton: icon_button_1.IconButton,
59
61
  UserRole: user_role_1.UserRole,
60
62
  FileCollectionCount: file_collection_count_1.FileCollectionCount,
63
+ FilesGallery: files_gallery_1.FilesGallery,
64
+ FileReference: file_reference_1.FileReference,
61
65
  };
62
66
  _a = (0, make_factory_1.makeUnitDefinitionsFactory)(allUnitDefinitions), exports.getTypeUnits = _a.getTypeUnits, exports.getUnitName = _a.getUnitName, exports.getUnitsForType = _a.getUnitsForType, exports.getUnitsForField = _a.getUnitsForField, exports.getUnitsForTypePerField = _a.getUnitsForTypePerField, exports.getUnitLabel = _a.getUnitLabel, exports.getCardUnitsSelect = _a.getCardUnitsSelect, exports.getHardcodedUnitsForView = _a.getHardcodedUnitsForView;
63
67
  const getDefaultUnits = () => {
@@ -1,26 +1,29 @@
1
1
  import { TypeObject } from "@fibery/schema";
2
2
  export declare const getTypeUnits: () => import("./types").PureUnit[], getUnitName: (unit: import("./types").Unit) => string | null, getUnitsForType: (typeObject: TypeObject, options?: {
3
+ parentFieldObjects?: import("@fibery/schema").FieldObject[];
3
4
  showHiddenFields?: boolean;
4
5
  isSharingMode?: boolean;
5
6
  }) => {
6
7
  unit: import("./types").Unit;
7
8
  fieldObject: import("@fibery/schema").FieldObject;
8
9
  }[], getUnitsForField: (fieldObject: import("@fibery/schema").FieldObject, options?: {
10
+ parentFieldObjects?: import("@fibery/schema").FieldObject[];
9
11
  showHiddenFields?: boolean;
10
12
  isSharingMode?: boolean;
11
13
  }) => import("./types").Unit[], getUnitsForTypePerField: (typeObject: TypeObject, options?: {
14
+ parentFieldObjects?: import("@fibery/schema").FieldObject[];
12
15
  showHiddenFields?: boolean;
13
16
  isSharingMode?: boolean;
14
17
  }) => {
15
18
  fieldObject: import("@fibery/schema").FieldObject;
16
19
  units: import("./types").Unit[];
17
- }[], getUnitLabel: (fieldObject: import("@fibery/schema").FieldObject, unit: import("./types").Unit) => string, getCardUnitsSelect: ({ schema, typeObject, units }: {
20
+ }[], getUnitLabel: (typeObject: TypeObject, unit: import("./types").Unit) => string, getCardUnitsSelect: ({ schema, typeObject, units }: {
18
21
  schema: import("@fibery/schema").Schema;
19
22
  typeObject: TypeObject;
20
23
  units: import("./types").Unit[];
21
24
  }) => any, getHardcodedUnitsForView: (typeObject: TypeObject) => ({
25
+ type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-range" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-collection" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
22
26
  expression: import("./types").UnitExpression;
23
- type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
24
27
  kind: "field";
25
28
  settings?: Record<string, unknown> | undefined;
26
29
  hideWhenEmpty?: boolean | undefined;
@@ -35,8 +38,8 @@ export declare const getTypeUnits: () => import("./types").PureUnit[], getUnitNa
35
38
  label: string;
36
39
  icon?: string | undefined;
37
40
  } | {
38
- expression?: import("./types").UnitExpression | undefined;
39
41
  type: "type-icon" | "type-badge" | "type-badge-abbr";
42
+ expression?: import("./types").UnitExpression | undefined;
40
43
  kind: "db";
41
44
  hideWhenEmpty?: boolean | undefined;
42
45
  })[];
@@ -1,24 +1,25 @@
1
1
  import { FieldObject, Schema, TypeObject } from "@fibery/schema";
2
- import { ButtonUnit, DbUnit, FieldUnit, Unit, UnitDataDefinition } from "./types";
2
+ import { ButtonUnit, DbUnit, FieldUnit, Unit, UnitDataDefinition, UnitExpression } from "./types";
3
3
  type AnyUnitDataDefinition = UnitDataDefinition<FieldUnit> | UnitDataDefinition<DbUnit> | UnitDataDefinition<ButtonUnit>;
4
- type UnitFilterOptions = {
4
+ type UnitCreationOptions = {
5
+ parentFieldObjects?: FieldObject[];
5
6
  showHiddenFields?: boolean;
6
7
  isSharingMode?: boolean;
7
8
  };
8
9
  export declare const makeUnitDefinitionsFactory: (allUnitDefinitions: Record<string, AnyUnitDataDefinition>) => {
9
10
  getTypeUnits: () => import("./types").PureUnit[];
10
- getUnitsForType: (typeObject: TypeObject, options?: UnitFilterOptions) => {
11
+ getUnitsForType: (typeObject: TypeObject, options?: UnitCreationOptions) => {
11
12
  unit: Unit;
12
13
  fieldObject: FieldObject;
13
14
  }[];
14
- getUnitsForTypePerField: (typeObject: TypeObject, options?: UnitFilterOptions) => {
15
+ getUnitsForTypePerField: (typeObject: TypeObject, options?: UnitCreationOptions) => {
15
16
  fieldObject: FieldObject;
16
17
  units: Unit[];
17
18
  }[];
18
- getUnitsForField: (fieldObject: FieldObject, options?: UnitFilterOptions) => Unit[];
19
+ getUnitsForField: (fieldObject: FieldObject, options?: UnitCreationOptions) => Unit[];
19
20
  getHardcodedUnitsForView: (typeObject: TypeObject) => ({
20
- expression: import("./types").UnitExpression;
21
- type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
21
+ type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-range" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-collection" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
22
+ expression: UnitExpression;
22
23
  kind: "field";
23
24
  settings?: Record<string, unknown> | undefined;
24
25
  hideWhenEmpty?: boolean | undefined;
@@ -33,12 +34,12 @@ export declare const makeUnitDefinitionsFactory: (allUnitDefinitions: Record<str
33
34
  label: string;
34
35
  icon?: string | undefined;
35
36
  } | {
36
- expression?: import("./types").UnitExpression | undefined;
37
37
  type: "type-icon" | "type-badge" | "type-badge-abbr";
38
+ expression?: UnitExpression | undefined;
38
39
  kind: "db";
39
40
  hideWhenEmpty?: boolean | undefined;
40
41
  })[];
41
- getUnitLabel: (fieldObject: FieldObject, unit: Unit) => string;
42
+ getUnitLabel: (typeObject: TypeObject, unit: Unit) => string;
42
43
  getUnitName: (unit: Unit) => string | null;
43
44
  getCardUnitsSelect: ({ schema, typeObject, units }: {
44
45
  schema: Schema;
@@ -66,10 +66,18 @@ const makeUnitDefinitionsFactory = (allUnitDefinitions) => {
66
66
  const creator = unitsFactoryByBasicFieldType[fieldObject.type] || fallbackFieldCreator;
67
67
  return creator(fieldObject);
68
68
  },
69
- ":field/reference": (fieldObject) => {
69
+ ":field/reference": (fieldObject, options) => {
70
+ const parentFieldObjects = options.parentFieldObjects ?? [];
71
+ // Parent path goes through a collection — we can only render the collection as a result, and only via relation view
72
+ if (parentFieldObjects.some((f) => f.isCollection)) {
73
+ return options.isSharingMode ? [] : [ReferenceCollectionView];
74
+ }
70
75
  if (FileReference && FileCompactReference && fieldObject.typeObject.name === "fibery/file") {
71
76
  return [FileLListItem, FileCompactReference, FileListItem, FileReference].filter(Boolean);
72
77
  }
78
+ if (FileReference && fieldObject.typeObject.name === "fibery/file") {
79
+ return [Reference, FileReference].filter(Boolean);
80
+ }
73
81
  return [
74
82
  (0, avatar_1.isAvatarExtensionEnabledType)(fieldObject.typeObject) && Avatar,
75
83
  fieldObject.name === "workflow/state" && ReferenceIcon,
@@ -78,7 +86,12 @@ const makeUnitDefinitionsFactory = (allUnitDefinitions) => {
78
86
  ];
79
87
  },
80
88
  ":field/reference-collection": (fieldObject, options) => {
89
+ const parentFieldObjects = options.parentFieldObjects ?? [];
81
90
  const common = [CollectionCount, (0, avatar_1.isAvatarExtensionEnabledType)(fieldObject.typeObject) && AvatarCollection];
91
+ // Parent path goes through a collection — we can only render the collection as a result, and only via relation view
92
+ if (parentFieldObjects.some((f) => f.isCollection)) {
93
+ return options.isSharingMode ? [] : [ReferenceCollectionView];
94
+ }
82
95
  if ((0, relation_view_1.isRelationViewField)(fieldObject) && !options.isSharingMode) {
83
96
  return [...common, ReferenceCollection, ReferenceCollectionCombobox, ReferenceCollectionView];
84
97
  }
@@ -110,15 +123,18 @@ const makeUnitDefinitionsFactory = (allUnitDefinitions) => {
110
123
  },
111
124
  };
112
125
  const getUnitsForField = (fieldObject, options = {}) => {
113
- const makeUnit = (Unit) => Unit.makeUnit({ expression: [fieldObject.name] });
114
126
  const { showHiddenFields } = options;
115
- if (fieldObject.isPublicId) {
127
+ const parentFieldObjects = options.parentFieldObjects ?? [];
128
+ const parentExpression = parentFieldObjects.map((f) => f.name);
129
+ const makeUnit = (Unit) => Unit.makeUnit({ expression: [...parentExpression, fieldObject.name] });
130
+ const isTopLevel = parentFieldObjects.length === 0;
131
+ if (fieldObject.isPublicId && isTopLevel) {
116
132
  return [Id].filter(Boolean).map(makeUnit);
117
133
  }
118
- if (fieldObject.isTitle) {
134
+ if (fieldObject.isTitle && isTopLevel) {
119
135
  return [Title, TitleInput].filter(Boolean).map(makeUnit);
120
136
  }
121
- if ((0, avatar_1.isAvatarExtensionField)(fieldObject)) {
137
+ if ((0, avatar_1.isAvatarExtensionField)(fieldObject) && isTopLevel) {
122
138
  return [Avatar, AvatarInput].filter(Boolean).map(makeUnit);
123
139
  }
124
140
  if (fieldObject.type === "Collaboration~Documents/Document") {
@@ -188,12 +204,12 @@ const makeUnitDefinitionsFactory = (allUnitDefinitions) => {
188
204
  ].filter(Boolean);
189
205
  };
190
206
  const unitDefinitionsByTypeLookup = (0, mapValues_1.default)((0, groupBy_1.default)(allUnitDefinitions, (x) => x.type), (value) => (0, array_1.single)(value));
191
- const getUnitLabel = (fieldObject, unit) => {
207
+ const getUnitLabel = (typeObject, unit) => {
192
208
  const unitDefinition = unitDefinitionsByTypeLookup[unit.type];
193
209
  if (!unitDefinition) {
194
210
  return "";
195
211
  }
196
- return unitDefinition.getLabel({ typeObject: fieldObject.holderTypeObject, unit: unit });
212
+ return unitDefinition.getLabel({ typeObject, unit: unit });
197
213
  };
198
214
  const getUnitName = (unit) => {
199
215
  const unitDefinition = unitDefinitionsByTypeLookup[unit.type];
@@ -215,8 +231,8 @@ const makeUnitDefinitionsFactory = (allUnitDefinitions) => {
215
231
  .filter((unit) => {
216
232
  return ((0, common_1.isUnitEnabled)(unit) &&
217
233
  unit.kind !== "user-button" &&
218
- unit.expression?.[0] !== "documents/documents" &&
219
- unit.expression?.[0] !== "whiteboards/whiteboards");
234
+ !unit.expression?.includes("documents/documents") &&
235
+ !unit.expression?.includes("whiteboards/whiteboards"));
220
236
  })
221
237
  .map((unit) => {
222
238
  const unitExpressionErrors = (0, common_1.calculateUnitExpressionErrors)({ typeObject, unit });
@@ -224,7 +240,7 @@ const makeUnitDefinitionsFactory = (allUnitDefinitions) => {
224
240
  return {};
225
241
  }
226
242
  const UnitDefinition = getUnitDataDefinition(unit);
227
- const select = UnitDefinition.getQuerySelect({ schema, typeObject, unit: unit });
243
+ const select = UnitDefinition.getQuerySelect({ schema, typeObject, unit });
228
244
  (0, trace_1.assert)((0, isPlainObject_1.default)(select), "getQuerySelect must return object-shaped select");
229
245
  return select;
230
246
  });
@@ -24,7 +24,7 @@ export type DbUnit = {
24
24
  };
25
25
  export type FieldUnit = {
26
26
  kind: "field";
27
- type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
27
+ type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-range" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-collection" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
28
28
  expression: UnitExpression;
29
29
  checked?: boolean;
30
30
  settings?: Record<string, unknown>;
package/package.json CHANGED
@@ -1,69 +1,69 @@
1
1
  {
2
2
  "name": "@fibery/views",
3
- "version": "18.0.4",
3
+ "version": "19.0.1",
4
+ "private": false,
4
5
  "description": "Operations on view objects",
5
6
  "license": "UNLICENSED",
6
7
  "author": "Fibery",
7
- "main": "./lib/index.js",
8
- "types": "./lib/index.d.ts",
9
8
  "files": [
10
9
  "/lib"
11
10
  ],
12
- "private": false,
11
+ "main": "./lib/index.js",
13
12
  "exports": {
14
13
  ".": {
14
+ "@fibery/source": "./index.ts",
15
15
  "types": "./lib/index.d.ts",
16
16
  "default": "./lib/index.js"
17
17
  },
18
18
  "./src/*": {
19
+ "@fibery/source": {
20
+ "types": "./src/*.ts",
21
+ "default": "./src/*"
22
+ },
19
23
  "types": "./lib/src/*.d.ts",
20
24
  "default": "./lib/src/*.js"
21
25
  },
22
26
  "./src/unit-definitions": {
27
+ "@fibery/source": "./src/unit-definitions/index.ts",
23
28
  "types": "./lib/src/unit-definitions/index.d.ts",
24
29
  "default": "./lib/src/unit-definitions/index.js"
25
30
  },
26
31
  "./src/units/canvas": {
32
+ "@fibery/source": "./src/units/canvas/index.ts",
27
33
  "types": "./lib/src/units/canvas/index.d.ts",
28
34
  "default": "./lib/src/units/canvas/index.js"
29
35
  }
30
36
  },
31
- "fiberyDevExports": {
32
- ".": "./index.ts",
33
- "./src/*": "./src/*"
34
- },
35
37
  "dependencies": {
36
38
  "date-fns": "2.29.2",
37
39
  "lodash": "4.17.21",
38
40
  "moment": "2.29.4",
39
41
  "@fibery/context-filters": "1.1.4",
40
- "@fibery/query-utils": "1.1.4",
41
- "@fibery/expression-utils": "9.6.4",
42
- "@fibery/schema": "10.2.15",
43
- "@fibery/helpers": "2.0.0"
42
+ "@fibery/expression-utils": "9.7.1",
43
+ "@fibery/helpers": "2.0.1",
44
+ "@fibery/query-utils": "1.1.6",
45
+ "@fibery/schema": "10.2.16"
44
46
  },
45
47
  "devDependencies": {
46
48
  "@babel/core": "7.28.5",
47
- "@swc/jest": "0.2.39",
48
49
  "@types/lodash": "4.14.172",
49
50
  "immutability-helper": "2.4.0",
50
- "jest": "30.2.0",
51
- "jest-junit": "16.0.0",
52
- "typescript": "5.9.3",
53
- "@fibery/babel-preset": "7.4.2",
54
- "@fibery/eslint-config": "9.0.1"
51
+ "typescript": "6.0.1-rc",
52
+ "@fibery/babel-preset": "7.4.2"
55
53
  },
56
54
  "peerDependencies": {
57
- "@fibery/expression-utils": "^9.6.4",
58
- "@fibery/schema": "^10.2.15",
55
+ "@fibery/expression-utils": "^9.7.1",
56
+ "@fibery/schema": "^10.2.16",
59
57
  "immutability-helper": "^2.4.0",
60
58
  "lodash": "4.17.21"
61
59
  },
62
60
  "scripts": {
63
- "build": "rm -rf lib && pnpm exec tsc --project tsconfig.build.json",
64
- "test": "jest",
65
- "test:ci": "pnpm run test --reporters=default --reporters=jest-junit",
66
- "test:coverage": "pnpm run test --coverage --coverageDirectory=${JEST_COVERAGE_RESULT_DIR:-$(pwd)}/coverage/view --reporters=default --reporters=jest-junit",
67
- "lint": "eslint ."
68
- }
61
+ "build": "rm -rf lib && tsc --project tsconfig.build.json",
62
+ "test": "../../scripts/test.sh",
63
+ "test:ci": "../../scripts/test.sh --ci",
64
+ "test:coverage": "../../scripts/test.sh --ci --coverage",
65
+ "check": "../../scripts/check.sh",
66
+ "lint": "../../scripts/lint.sh"
67
+ },
68
+ "types": "./lib/index.d.ts"
69
69
  }
@@ -1,2 +0,0 @@
1
- declare const _exports: import("jest").Config;
2
- export = _exports;
@@ -1,32 +0,0 @@
1
- "use strict";
2
- /** @type {import('jest').Config} */
3
- module.exports = {
4
- testEnvironment: "node",
5
- coveragePathIgnorePatterns: ["/node_modules/"],
6
- collectCoverageFrom: ["src/**/*.{js,jsx,ts,tsx}", "!src/**/*.d.ts"],
7
- coverageReporters: ["text", "cobertura"],
8
- testPathIgnorePatterns: ["<rootDir>[/\\\\](build|docs|node_modules|scripts)[/\\\\]"],
9
- transform: {
10
- "^.+\\.(js|jsx|ts|tsx)$": [
11
- "@swc/jest",
12
- {
13
- jsc: {
14
- parser: {
15
- syntax: "typescript",
16
- tsx: true,
17
- decorators: true,
18
- dynamicImport: true,
19
- },
20
- transform: {
21
- react: {
22
- runtime: "automatic",
23
- },
24
- },
25
- },
26
- },
27
- ],
28
- },
29
- testEnvironmentOptions: {
30
- url: "http://localhost",
31
- },
32
- };