@fibery/views 19.0.0 → 19.1.0

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 (195) hide show
  1. package/lib/src/errors.d.ts +2 -0
  2. package/lib/src/errors.js +6 -0
  3. package/lib/src/field-utils/avatar.d.ts +1 -1
  4. package/lib/src/field-utils/avatar.js +1 -1
  5. package/lib/src/field-utils/back-references.d.ts +1 -1
  6. package/lib/src/field-utils/comments.d.ts +1 -1
  7. package/lib/src/field-utils/date-time.d.ts +5 -5
  8. package/lib/src/field-utils/date-time.js +1 -1
  9. package/lib/src/field-utils/enum-value.d.ts +1 -1
  10. package/lib/src/field-utils/file.d.ts +1 -1
  11. package/lib/src/field-utils/file.js +1 -1
  12. package/lib/src/field-utils/icon.d.ts +1 -1
  13. package/lib/src/field-utils/number.d.ts +1 -1
  14. package/lib/src/field-utils/reference-collection.d.ts +2 -2
  15. package/lib/src/field-utils/reference-collection.js +4 -4
  16. package/lib/src/field-utils/reference.d.ts +2 -2
  17. package/lib/src/field-utils/reference.js +4 -4
  18. package/lib/src/field-utils/relation-view.d.ts +1 -1
  19. package/lib/src/field-utils/rich-text.d.ts +2 -2
  20. package/lib/src/field-utils/rich-text.js +1 -1
  21. package/lib/src/field-utils/text.d.ts +1 -1
  22. package/lib/src/field-utils/user-active.d.ts +2 -2
  23. package/lib/src/field-utils/user-role.d.ts +1 -1
  24. package/lib/src/field-utils/workflow.d.ts +2 -2
  25. package/lib/src/index.d.ts +30 -16
  26. package/lib/src/index.js +7 -2
  27. package/lib/src/meta-validation.d.ts +10 -0
  28. package/lib/src/meta-validation.js +78 -0
  29. package/lib/src/private/board.d.ts +15 -11
  30. package/lib/src/private/board.js +8 -7
  31. package/lib/src/private/calendar.d.ts +14 -10
  32. package/lib/src/private/calendar.js +4 -3
  33. package/lib/src/private/feed.d.ts +14 -10
  34. package/lib/src/private/feed.js +4 -3
  35. package/lib/src/private/form.d.ts +25 -3
  36. package/lib/src/private/form.js +3 -3
  37. package/lib/src/private/map.d.ts +14 -10
  38. package/lib/src/private/map.js +4 -3
  39. package/lib/src/private/smart-folder.d.ts +23 -15
  40. package/lib/src/private/smart-folder.js +16 -13
  41. package/lib/src/private/timeline.d.ts +39 -10
  42. package/lib/src/private/timeline.js +8 -6
  43. package/lib/src/private/units.d.ts +10 -6
  44. package/lib/src/private/units.js +32 -24
  45. package/lib/src/private/utils.d.ts +64 -17
  46. package/lib/src/private/utils.js +26 -20
  47. package/lib/src/truthy.d.ts +1 -0
  48. package/lib/src/truthy.js +7 -0
  49. package/lib/src/unit-definitions/avatar-collection.d.ts +1 -1
  50. package/lib/src/unit-definitions/avatar-collection.js +5 -10
  51. package/lib/src/unit-definitions/avatar-input.d.ts +1 -1
  52. package/lib/src/unit-definitions/avatar-input.js +1 -1
  53. package/lib/src/unit-definitions/avatar.d.ts +1 -1
  54. package/lib/src/unit-definitions/avatar.js +5 -7
  55. package/lib/src/unit-definitions/back-references-list.d.ts +1 -1
  56. package/lib/src/unit-definitions/back-references-list.js +3 -3
  57. package/lib/src/unit-definitions/bool-checkbox.d.ts +1 -1
  58. package/lib/src/unit-definitions/bool-checkbox.js +2 -2
  59. package/lib/src/unit-definitions/bool.d.ts +1 -1
  60. package/lib/src/unit-definitions/bool.js +1 -1
  61. package/lib/src/unit-definitions/collection-count.d.ts +1 -1
  62. package/lib/src/unit-definitions/collection-count.js +4 -2
  63. package/lib/src/unit-definitions/color-input.d.ts +1 -1
  64. package/lib/src/unit-definitions/color-input.js +1 -1
  65. package/lib/src/unit-definitions/comments-list.d.ts +1 -1
  66. package/lib/src/unit-definitions/comments-list.js +1 -1
  67. package/lib/src/unit-definitions/date-range-combobox.d.ts +1 -1
  68. package/lib/src/unit-definitions/date-range-combobox.js +1 -1
  69. package/lib/src/unit-definitions/date-range.d.ts +1 -1
  70. package/lib/src/unit-definitions/date-range.js +1 -1
  71. package/lib/src/unit-definitions/date-time-combobox.d.ts +1 -1
  72. package/lib/src/unit-definitions/date-time-combobox.js +2 -2
  73. package/lib/src/unit-definitions/date.d.ts +1 -1
  74. package/lib/src/unit-definitions/date.js +2 -2
  75. package/lib/src/unit-definitions/email-input.d.ts +1 -1
  76. package/lib/src/unit-definitions/email-input.js +1 -1
  77. package/lib/src/unit-definitions/email.d.ts +1 -1
  78. package/lib/src/unit-definitions/email.js +1 -1
  79. package/lib/src/unit-definitions/emoji.d.ts +1 -1
  80. package/lib/src/unit-definitions/emoji.js +1 -1
  81. package/lib/src/unit-definitions/file-collection-count.d.ts +1 -1
  82. package/lib/src/unit-definitions/file-collection-count.js +11 -9
  83. package/lib/src/unit-definitions/file-compact-collection.d.ts +1 -1
  84. package/lib/src/unit-definitions/file-compact-collection.js +11 -9
  85. package/lib/src/unit-definitions/file-compact-reference.d.ts +1 -1
  86. package/lib/src/unit-definitions/file-compact-reference.js +3 -12
  87. package/lib/src/unit-definitions/file-reference.d.ts +1 -1
  88. package/lib/src/unit-definitions/file-reference.js +8 -6
  89. package/lib/src/unit-definitions/files-gallery.d.ts +1 -1
  90. package/lib/src/unit-definitions/files-gallery.js +11 -9
  91. package/lib/src/unit-definitions/files-l-list-item.d.ts +1 -1
  92. package/lib/src/unit-definitions/files-l-list-item.js +8 -6
  93. package/lib/src/unit-definitions/files-l-list.d.ts +1 -1
  94. package/lib/src/unit-definitions/files-l-list.js +11 -9
  95. package/lib/src/unit-definitions/files-list-item.d.ts +1 -1
  96. package/lib/src/unit-definitions/files-list-item.js +8 -6
  97. package/lib/src/unit-definitions/files-list.d.ts +1 -1
  98. package/lib/src/unit-definitions/files-list.js +11 -9
  99. package/lib/src/unit-definitions/geometry-preview.d.ts +1 -1
  100. package/lib/src/unit-definitions/geometry-preview.js +1 -1
  101. package/lib/src/unit-definitions/icon-button.d.ts +1 -1
  102. package/lib/src/unit-definitions/icon-button.js +1 -1
  103. package/lib/src/unit-definitions/icon-input.d.ts +1 -1
  104. package/lib/src/unit-definitions/icon-input.js +1 -1
  105. package/lib/src/unit-definitions/id.d.ts +1 -1
  106. package/lib/src/unit-definitions/json-input.d.ts +1 -1
  107. package/lib/src/unit-definitions/json-input.js +1 -1
  108. package/lib/src/unit-definitions/location-input.d.ts +1 -1
  109. package/lib/src/unit-definitions/location-input.js +1 -1
  110. package/lib/src/unit-definitions/location.d.ts +1 -1
  111. package/lib/src/unit-definitions/location.js +1 -1
  112. package/lib/src/unit-definitions/not-found.d.ts +1 -1
  113. package/lib/src/unit-definitions/number-input.d.ts +1 -1
  114. package/lib/src/unit-definitions/number-input.js +2 -2
  115. package/lib/src/unit-definitions/number.d.ts +1 -1
  116. package/lib/src/unit-definitions/number.js +2 -4
  117. package/lib/src/unit-definitions/phone-input.d.ts +1 -1
  118. package/lib/src/unit-definitions/phone-input.js +1 -1
  119. package/lib/src/unit-definitions/phone.d.ts +1 -1
  120. package/lib/src/unit-definitions/phone.js +1 -1
  121. package/lib/src/unit-definitions/progress-bar.d.ts +1 -1
  122. package/lib/src/unit-definitions/progress-bar.js +1 -4
  123. package/lib/src/unit-definitions/reference-collection-combobox.d.ts +1 -1
  124. package/lib/src/unit-definitions/reference-collection-combobox.js +1 -1
  125. package/lib/src/unit-definitions/reference-collection-list.d.ts +1 -1
  126. package/lib/src/unit-definitions/reference-collection-list.js +1 -1
  127. package/lib/src/unit-definitions/reference-collection-view.d.ts +1 -1
  128. package/lib/src/unit-definitions/reference-collection-view.js +1 -1
  129. package/lib/src/unit-definitions/reference-collection.d.ts +1 -1
  130. package/lib/src/unit-definitions/reference-collection.js +3 -3
  131. package/lib/src/unit-definitions/reference-combobox.d.ts +1 -1
  132. package/lib/src/unit-definitions/reference-combobox.js +1 -1
  133. package/lib/src/unit-definitions/reference-icon.d.ts +1 -1
  134. package/lib/src/unit-definitions/reference-icon.js +1 -1
  135. package/lib/src/unit-definitions/reference.d.ts +1 -1
  136. package/lib/src/unit-definitions/reference.js +1 -1
  137. package/lib/src/unit-definitions/rich-text-document.d.ts +1 -1
  138. package/lib/src/unit-definitions/rich-text-document.js +2 -2
  139. package/lib/src/unit-definitions/rich-text-snippet.d.ts +2 -1
  140. package/lib/src/unit-definitions/rich-text-snippet.js +6 -11
  141. package/lib/src/unit-definitions/single-location-preview.d.ts +1 -1
  142. package/lib/src/unit-definitions/single-location-preview.js +1 -1
  143. package/lib/src/unit-definitions/text-input.d.ts +1 -1
  144. package/lib/src/unit-definitions/text-input.js +2 -2
  145. package/lib/src/unit-definitions/text.d.ts +1 -1
  146. package/lib/src/unit-definitions/text.js +2 -2
  147. package/lib/src/unit-definitions/title-input.d.ts +1 -1
  148. package/lib/src/unit-definitions/title.d.ts +1 -1
  149. package/lib/src/unit-definitions/type-badge-abbr.d.ts +1 -1
  150. package/lib/src/unit-definitions/type-badge.d.ts +1 -1
  151. package/lib/src/unit-definitions/type-icon.d.ts +1 -1
  152. package/lib/src/unit-definitions/url-input.d.ts +1 -1
  153. package/lib/src/unit-definitions/url-input.js +1 -1
  154. package/lib/src/unit-definitions/url.d.ts +1 -1
  155. package/lib/src/unit-definitions/url.js +1 -1
  156. package/lib/src/unit-definitions/user-button.d.ts +1 -1
  157. package/lib/src/unit-definitions/user-role-input.d.ts +1 -1
  158. package/lib/src/unit-definitions/user-role-input.js +1 -1
  159. package/lib/src/unit-definitions/user-role.d.ts +1 -1
  160. package/lib/src/unit-definitions/user-role.js +1 -1
  161. package/lib/src/unit-utils/access.d.ts +2 -2
  162. package/lib/src/unit-utils/can-edit-field.d.ts +2 -2
  163. package/lib/src/unit-utils/common.d.ts +3 -3
  164. package/lib/src/unit-utils/common.js +1 -1
  165. package/lib/src/unit-utils/enums.d.ts +2 -2
  166. package/lib/src/unit-utils/formatters.d.ts +2 -2
  167. package/lib/src/unit-utils/get-export-value.d.ts +4 -4
  168. package/lib/src/unit-utils/get-export-value.js +3 -3
  169. package/lib/src/unit-utils/get-field-label.d.ts +2 -2
  170. package/lib/src/unit-utils/get-unmatched-unit-label.d.ts +1 -1
  171. package/lib/src/unit-utils/schema.d.ts +1 -1
  172. package/lib/src/unit-utils/wrap-normalized-in-expression.d.ts +3 -0
  173. package/lib/src/unit-utils/wrap-normalized-in-expression.js +14 -0
  174. package/lib/src/units/board.d.ts +5 -5
  175. package/lib/src/units/board.js +1 -1
  176. package/lib/src/units/canvas/index.d.ts +4 -4
  177. package/lib/src/units/canvas/index.js +1 -1
  178. package/lib/src/units/canvas/type-badge-abbr.d.ts +1 -1
  179. package/lib/src/units/canvas/type-badge.d.ts +1 -1
  180. package/lib/src/units/default.d.ts +5 -5
  181. package/lib/src/units/default.js +1 -1
  182. package/lib/src/units/gallery.d.ts +1 -1
  183. package/lib/src/units/gantt.d.ts +5 -5
  184. package/lib/src/units/gantt.js +1 -1
  185. package/lib/src/units/get-unit-definitions-for-view-type.js +4 -4
  186. package/lib/src/units/grid.d.ts +4 -4
  187. package/lib/src/units/grid.js +7 -7
  188. package/lib/src/units/list.d.ts +5 -5
  189. package/lib/src/units/list.js +1 -1
  190. package/lib/src/units/make-factory.d.ts +4 -5
  191. package/lib/src/units/make-factory.js +26 -15
  192. package/lib/src/units/types.d.ts +5 -5
  193. package/package.json +18 -18
  194. package/lib/jest.config.cjs +0 -34
  195. package/lib/jest.config.d.cts +0 -3
@@ -1,16 +1,16 @@
1
1
  export declare const getTypeUnits: () => import("./types").PureUnit[], getUnitName: (unit: import("./types").Unit) => string | null, getUnitsForType: (typeObject: import("@fibery/schema").TypeObject, options?: {
2
- parentExpression?: import("@fibery/expression-utils").FieldExpression;
2
+ parentFieldObjects?: import("@fibery/schema").FieldObject[];
3
3
  showHiddenFields?: boolean;
4
4
  isSharingMode?: boolean;
5
5
  }) => {
6
6
  unit: import("./types").Unit;
7
7
  fieldObject: import("@fibery/schema").FieldObject;
8
8
  }[], getUnitsForField: (fieldObject: import("@fibery/schema").FieldObject, options?: {
9
- parentExpression?: import("@fibery/expression-utils").FieldExpression;
9
+ parentFieldObjects?: import("@fibery/schema").FieldObject[];
10
10
  showHiddenFields?: boolean;
11
11
  isSharingMode?: boolean;
12
12
  }) => import("./types").Unit[], getUnitsForTypePerField: (typeObject: import("@fibery/schema").TypeObject, options?: {
13
- parentExpression?: import("@fibery/expression-utils").FieldExpression;
13
+ parentFieldObjects?: import("@fibery/schema").FieldObject[];
14
14
  showHiddenFields?: boolean;
15
15
  isSharingMode?: boolean;
16
16
  }) => {
@@ -21,7 +21,7 @@ export declare const getTypeUnits: () => import("./types").PureUnit[], getUnitNa
21
21
  typeObject: import("@fibery/schema").TypeObject;
22
22
  units: import("./types").Unit[];
23
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-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
+ 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";
25
25
  expression: import("./types").UnitExpression;
26
26
  kind: "field";
27
27
  settings?: Record<string, unknown> | undefined;
@@ -2,36 +2,36 @@
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.getDefaultUnits = exports.getHardcodedUnitsForView = exports.getCardUnitsSelect = exports.getUnitLabel = exports.getUnitsForTypePerField = exports.getUnitsForField = exports.getUnitsForType = exports.getUnitName = exports.getTypeUnits = void 0;
5
- const make_factory_1 = require("./make-factory");
6
- const avatar_collection_1 = require("../unit-definitions/avatar-collection");
5
+ const file_reference_1 = require("@fibery/views/src/unit-definitions/file-reference");
7
6
  const avatar_1 = require("../unit-definitions/avatar");
7
+ const avatar_collection_1 = require("../unit-definitions/avatar-collection");
8
8
  const bool_1 = require("../unit-definitions/bool");
9
9
  const collection_count_1 = require("../unit-definitions/collection-count");
10
10
  const date_1 = require("../unit-definitions/date");
11
11
  const date_range_1 = require("../unit-definitions/date-range");
12
12
  const email_1 = require("../unit-definitions/email");
13
13
  const emoji_1 = require("../unit-definitions/emoji");
14
+ const file_collection_count_1 = require("../unit-definitions/file-collection-count");
15
+ const files_gallery_1 = require("../unit-definitions/files-gallery");
14
16
  const icon_button_1 = require("../unit-definitions/icon-button");
15
17
  const id_1 = require("../unit-definitions/id");
16
18
  const location_1 = require("../unit-definitions/location");
17
19
  const number_1 = require("../unit-definitions/number");
18
20
  const phone_1 = require("../unit-definitions/phone");
19
21
  const progress_bar_1 = require("../unit-definitions/progress-bar");
20
- const reference_collection_1 = require("../unit-definitions/reference-collection");
21
22
  const reference_1 = require("../unit-definitions/reference");
23
+ const reference_collection_1 = require("../unit-definitions/reference-collection");
22
24
  const reference_icon_1 = require("../unit-definitions/reference-icon");
23
25
  const rich_text_snippet_1 = require("../unit-definitions/rich-text-snippet");
24
26
  const text_1 = require("../unit-definitions/text");
25
27
  const title_1 = require("../unit-definitions/title");
26
- const type_badge_abbr_1 = require("../unit-definitions/type-badge-abbr");
27
28
  const type_badge_1 = require("../unit-definitions/type-badge");
29
+ const type_badge_abbr_1 = require("../unit-definitions/type-badge-abbr");
28
30
  const type_icon_1 = require("../unit-definitions/type-icon");
29
31
  const url_1 = require("../unit-definitions/url");
30
32
  const user_button_1 = require("../unit-definitions/user-button");
31
33
  const user_role_1 = require("../unit-definitions/user-role");
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");
34
+ const make_factory_1 = require("./make-factory");
35
35
  const allUnitDefinitions = {
36
36
  AvatarCollection: avatar_collection_1.AvatarCollection,
37
37
  Bool: bool_1.Bool,
@@ -1,17 +1,17 @@
1
- import { TypeObject } from "@fibery/schema";
1
+ import type { 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
- parentExpression?: import("@fibery/expression-utils").FieldExpression;
3
+ parentFieldObjects?: import("@fibery/schema").FieldObject[];
4
4
  showHiddenFields?: boolean;
5
5
  isSharingMode?: boolean;
6
6
  }) => {
7
7
  unit: import("./types").Unit;
8
8
  fieldObject: import("@fibery/schema").FieldObject;
9
9
  }[], getUnitsForField: (fieldObject: import("@fibery/schema").FieldObject, options?: {
10
- parentExpression?: import("@fibery/expression-utils").FieldExpression;
10
+ parentFieldObjects?: import("@fibery/schema").FieldObject[];
11
11
  showHiddenFields?: boolean;
12
12
  isSharingMode?: boolean;
13
13
  }) => import("./types").Unit[], getUnitsForTypePerField: (typeObject: TypeObject, options?: {
14
- parentExpression?: import("@fibery/expression-utils").FieldExpression;
14
+ parentFieldObjects?: import("@fibery/schema").FieldObject[];
15
15
  showHiddenFields?: boolean;
16
16
  isSharingMode?: boolean;
17
17
  }) => {
@@ -22,7 +22,7 @@ export declare const getTypeUnits: () => import("./types").PureUnit[], getUnitNa
22
22
  typeObject: TypeObject;
23
23
  units: import("./types").Unit[];
24
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-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";
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";
26
26
  expression: import("./types").UnitExpression;
27
27
  kind: "field";
28
28
  settings?: Record<string, unknown> | undefined;
@@ -36,8 +36,8 @@ var _a;
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
37
  exports.getDefaultUnits = exports.getHardcodedUnitsForView = exports.getCardUnitsSelect = exports.getUnitLabel = exports.getUnitsForTypePerField = exports.getUnitsForField = exports.getUnitsForType = exports.getUnitName = exports.getTypeUnits = void 0;
38
38
  const avatar_1 = require("../field-utils/avatar");
39
- const make_factory_1 = require("./make-factory");
40
39
  const allUnitDefinitions = __importStar(require("../unit-definitions"));
40
+ const make_factory_1 = require("./make-factory");
41
41
  _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;
42
42
  const getDefaultUnits = (typeObject) => {
43
43
  const { Title, Avatar } = allUnitDefinitions;
@@ -1,9 +1,8 @@
1
- import { FieldExpression } from "@fibery/expression-utils";
2
- import { FieldObject, Schema, TypeObject } from "@fibery/schema";
3
- import { ButtonUnit, DbUnit, FieldUnit, Unit, UnitDataDefinition, UnitExpression } from "./types";
1
+ import type { FieldObject, Schema, TypeObject } from "@fibery/schema";
2
+ import type { ButtonUnit, DbUnit, FieldUnit, Unit, UnitDataDefinition, UnitExpression } from "./types";
4
3
  type AnyUnitDataDefinition = UnitDataDefinition<FieldUnit> | UnitDataDefinition<DbUnit> | UnitDataDefinition<ButtonUnit>;
5
4
  type UnitCreationOptions = {
6
- parentExpression?: FieldExpression;
5
+ parentFieldObjects?: FieldObject[];
7
6
  showHiddenFields?: boolean;
8
7
  isSharingMode?: boolean;
9
8
  };
@@ -19,7 +18,7 @@ export declare const makeUnitDefinitionsFactory: (allUnitDefinitions: Record<str
19
18
  }[];
20
19
  getUnitsForField: (fieldObject: FieldObject, options?: UnitCreationOptions) => Unit[];
21
20
  getHardcodedUnitsForView: (typeObject: TypeObject) => ({
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";
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";
23
22
  expression: UnitExpression;
24
23
  kind: "field";
25
24
  settings?: Record<string, unknown> | undefined;
@@ -4,6 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.makeUnitDefinitionsFactory = void 0;
7
+ const array_1 = require("@fibery/helpers/utils/array");
8
+ const trace_1 = require("@fibery/helpers/utils/trace");
9
+ const select_1 = require("@fibery/query-utils/src/select");
7
10
  const compact_1 = __importDefault(require("lodash/compact"));
8
11
  const constant_1 = __importDefault(require("lodash/constant"));
9
12
  const flatMap_1 = __importDefault(require("lodash/flatMap"));
@@ -11,18 +14,15 @@ const groupBy_1 = __importDefault(require("lodash/groupBy"));
11
14
  const isPlainObject_1 = __importDefault(require("lodash/isPlainObject"));
12
15
  const mapValues_1 = __importDefault(require("lodash/mapValues"));
13
16
  const sortBy_1 = __importDefault(require("lodash/sortBy"));
14
- const trace_1 = require("@fibery/helpers/utils/trace");
15
- const number_1 = require("../field-utils/number");
16
- const text_1 = require("../field-utils/text");
17
17
  const avatar_1 = require("../field-utils/avatar");
18
- const comments_1 = require("../field-utils/comments");
19
18
  const back_references_1 = require("../field-utils/back-references");
19
+ const comments_1 = require("../field-utils/comments");
20
+ const number_1 = require("../field-utils/number");
20
21
  const relation_view_1 = require("../field-utils/relation-view");
21
- const select_1 = require("@fibery/query-utils/src/select");
22
- const common_1 = require("../unit-utils/common");
23
- const not_found_1 = require("../unit-definitions/not-found");
24
- const array_1 = require("@fibery/helpers/utils/array");
22
+ const text_1 = require("../field-utils/text");
25
23
  const user_role_1 = require("../field-utils/user-role");
24
+ const not_found_1 = require("../unit-definitions/not-found");
25
+ const common_1 = require("../unit-utils/common");
26
26
  const NoUnitsCreator = () => [];
27
27
  const makeUnitDefinitionsFactory = (allUnitDefinitions) => {
28
28
  const { BackReferencesList, Bool, BoolCheckbox, ColorInput, CommentsList, Text, TextInput, Email, EmailInput, Emoji, IconInput, JsonInput, Number, NumberInput, ProgressBar, ReferenceCombobox, ReferenceCollection, ReferenceCollectionList, ReferenceCollectionView, ReferenceCollectionCombobox, FileReference, FileCompactReference, FilesGallery, FileList, FileListItem, FileLList, FileLListItem, FileCollectionCount, FileCompactCollection, Date, DateTimeCombobox, DateRange, DateRangeCombobox, Avatar, AvatarCollection, AvatarInput, CollectionCount, Reference, ReferenceIcon, TypeIcon, TypeBadge, TypeBadgeAbbr, Title, TitleInput, Id, UserButton, Phone, PhoneInput, Location, LocationInput, SingleLocationPreview, GeometryPreview, RichText, RichTextSnippet, RichTextDocument, CommentsCollection, Url, UrlInput, UserRole, UserRoleInput, IconButton, } = allUnitDefinitions;
@@ -66,7 +66,12 @@ 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
  }
@@ -81,9 +86,13 @@ const makeUnitDefinitionsFactory = (allUnitDefinitions) => {
81
86
  ];
82
87
  },
83
88
  ":field/reference-collection": (fieldObject, options) => {
84
- const isTopLevel = (options.parentExpression?.length ?? 0) === 0;
89
+ const parentFieldObjects = options.parentFieldObjects ?? [];
85
90
  const common = [CollectionCount, (0, avatar_1.isAvatarExtensionEnabledType)(fieldObject.typeObject) && AvatarCollection];
86
- if ((0, relation_view_1.isRelationViewField)(fieldObject) && !options.isSharingMode && isTopLevel) {
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
+ }
95
+ if ((0, relation_view_1.isRelationViewField)(fieldObject) && !options.isSharingMode) {
87
96
  return [...common, ReferenceCollection, ReferenceCollectionCombobox, ReferenceCollectionView];
88
97
  }
89
98
  if ((0, back_references_1.isReferenceExtensionField)(fieldObject)) {
@@ -114,9 +123,11 @@ const makeUnitDefinitionsFactory = (allUnitDefinitions) => {
114
123
  },
115
124
  };
116
125
  const getUnitsForField = (fieldObject, options = {}) => {
117
- const { showHiddenFields, parentExpression = [] } = options;
126
+ const { showHiddenFields } = options;
127
+ const parentFieldObjects = options.parentFieldObjects ?? [];
128
+ const parentExpression = parentFieldObjects.map((f) => f.name);
118
129
  const makeUnit = (Unit) => Unit.makeUnit({ expression: [...parentExpression, fieldObject.name] });
119
- const isTopLevel = (options.parentExpression?.length ?? 0) === 0;
130
+ const isTopLevel = parentFieldObjects.length === 0;
120
131
  if (fieldObject.isPublicId && isTopLevel) {
121
132
  return [Id].filter(Boolean).map(makeUnit);
122
133
  }
@@ -220,8 +231,8 @@ const makeUnitDefinitionsFactory = (allUnitDefinitions) => {
220
231
  .filter((unit) => {
221
232
  return ((0, common_1.isUnitEnabled)(unit) &&
222
233
  unit.kind !== "user-button" &&
223
- unit.expression?.[0] !== "documents/documents" &&
224
- unit.expression?.[0] !== "whiteboards/whiteboards");
234
+ !unit.expression?.includes("documents/documents") &&
235
+ !unit.expression?.includes("whiteboards/whiteboards"));
225
236
  })
226
237
  .map((unit) => {
227
238
  const unitExpressionErrors = (0, common_1.calculateUnitExpressionErrors)({ typeObject, unit });
@@ -1,7 +1,7 @@
1
- import { Schema, TypeObject } from "@fibery/schema";
2
- import { NumberDisplaySettings } from "../field-utils/number";
3
- import { $TSFixMe } from "../tsfixme";
4
- import { FiberyObject } from "@fibery/expression-utils/src/types";
1
+ import type { FiberyObject } from "@fibery/expression-utils/src/types";
2
+ import type { Schema, TypeObject } from "@fibery/schema";
3
+ import type { NumberDisplaySettings } from "../field-utils/number";
4
+ import type { $TSFixMe } from "../tsfixme";
5
5
  export type ButtonUnit = {
6
6
  kind: "user-button";
7
7
  type: "user-button" | "icon-button";
@@ -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,6 +1,6 @@
1
1
  {
2
2
  "name": "@fibery/views",
3
- "version": "19.0.0",
3
+ "version": "19.1.0",
4
4
  "private": false,
5
5
  "description": "Operations on view objects",
6
6
  "license": "UNLICENSED",
@@ -11,23 +11,26 @@
11
11
  "main": "./lib/index.js",
12
12
  "exports": {
13
13
  ".": {
14
- "types": "./lib/index.d.ts",
15
14
  "@fibery/source": "./index.ts",
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
- "@fibery/source": "./src/*",
21
24
  "default": "./lib/src/*.js"
22
25
  },
23
26
  "./src/unit-definitions": {
24
- "types": "./lib/src/unit-definitions/index.d.ts",
25
27
  "@fibery/source": "./src/unit-definitions/index.ts",
28
+ "types": "./lib/src/unit-definitions/index.d.ts",
26
29
  "default": "./lib/src/unit-definitions/index.js"
27
30
  },
28
31
  "./src/units/canvas": {
29
- "types": "./lib/src/units/canvas/index.d.ts",
30
32
  "@fibery/source": "./src/units/canvas/index.ts",
33
+ "types": "./lib/src/units/canvas/index.d.ts",
31
34
  "default": "./lib/src/units/canvas/index.js"
32
35
  }
33
36
  },
@@ -36,32 +39,29 @@
36
39
  "lodash": "4.17.21",
37
40
  "moment": "2.29.4",
38
41
  "@fibery/context-filters": "1.1.4",
39
- "@fibery/expression-utils": "9.7.0",
40
- "@fibery/helpers": "2.0.0",
41
- "@fibery/query-utils": "1.1.5",
42
- "@fibery/schema": "10.2.15"
42
+ "@fibery/expression-utils": "9.7.1",
43
+ "@fibery/query-utils": "1.1.6",
44
+ "@fibery/schema": "10.2.16",
45
+ "@fibery/helpers": "2.0.1"
43
46
  },
44
47
  "devDependencies": {
45
48
  "@babel/core": "7.28.5",
46
- "@swc/jest": "0.2.39",
47
49
  "@types/lodash": "4.14.172",
48
50
  "immutability-helper": "2.4.0",
49
- "jest": "30.2.0",
50
- "jest-junit": "16.0.0",
51
- "typescript": "6.0.0-beta",
51
+ "typescript": "6.0.1-rc",
52
52
  "@fibery/babel-preset": "7.4.2"
53
53
  },
54
54
  "peerDependencies": {
55
- "@fibery/expression-utils": "^9.7.0",
56
- "@fibery/schema": "^10.2.15",
55
+ "@fibery/expression-utils": "^9.7.1",
56
+ "@fibery/schema": "^10.2.16",
57
57
  "immutability-helper": "^2.4.0",
58
58
  "lodash": "4.17.21"
59
59
  },
60
60
  "scripts": {
61
61
  "build": "rm -rf lib && tsc --project tsconfig.build.json",
62
- "test": "jest",
63
- "test:ci": "pnpm run test --reporters=default --reporters=jest-junit",
64
- "test:coverage": "pnpm run test --coverage --coverageDirectory=${JEST_COVERAGE_RESULT_DIR:-$(pwd)}/coverage/view --reporters=default --reporters=jest-junit",
62
+ "test": "../../scripts/test.sh",
63
+ "test:ci": "../../scripts/test.sh --ci",
64
+ "test:coverage": "../../scripts/test.sh --ci --coverage",
65
65
  "check": "../../scripts/check.sh",
66
66
  "lint": "../../scripts/lint.sh"
67
67
  },
@@ -1,34 +0,0 @@
1
- "use strict";
2
- /** @type {import('@jest/schemas').InitialOptions} */
3
- const config = {
4
- testEnvironment: "node",
5
- testEnvironmentOptions: {
6
- customExportConditions: ["@fibery/source"],
7
- url: "http://localhost",
8
- },
9
- coveragePathIgnorePatterns: ["/node_modules/"],
10
- collectCoverageFrom: ["src/**/*.{js,jsx,ts,tsx}", "!src/**/*.d.ts"],
11
- coverageReporters: ["text", "cobertura"],
12
- testPathIgnorePatterns: ["<rootDir>[/\\\\](build|docs|node_modules|scripts)[/\\\\]"],
13
- transform: {
14
- "^.+\\.(js|jsx|ts|tsx)$": [
15
- "@swc/jest",
16
- {
17
- jsc: {
18
- parser: {
19
- syntax: "typescript",
20
- tsx: true,
21
- decorators: true,
22
- dynamicImport: true,
23
- },
24
- transform: {
25
- react: {
26
- runtime: "automatic",
27
- },
28
- },
29
- },
30
- },
31
- ],
32
- },
33
- };
34
- module.exports = config;
@@ -1,3 +0,0 @@
1
- export = config;
2
- /** @type {import('@jest/schemas').InitialOptions} */
3
- declare const config: any;