@fibery/views 26.0.5 → 26.0.7

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 (231) hide show
  1. package/lib/_virtual/_rolldown/runtime.js +1 -2
  2. package/lib/errors.d.ts +1 -3
  3. package/lib/errors.js +1 -2
  4. package/lib/field-utils/avatar.d.ts +1 -3
  5. package/lib/field-utils/avatar.js +1 -2
  6. package/lib/field-utils/back-references.d.ts +1 -3
  7. package/lib/field-utils/back-references.js +1 -2
  8. package/lib/field-utils/comments.d.ts +1 -3
  9. package/lib/field-utils/comments.js +1 -2
  10. package/lib/field-utils/date-time.d.ts +1 -3
  11. package/lib/field-utils/date-time.js +1 -2
  12. package/lib/field-utils/enum-value.d.ts +1 -3
  13. package/lib/field-utils/enum-value.js +1 -2
  14. package/lib/field-utils/file.d.ts +1 -3
  15. package/lib/field-utils/file.js +1 -2
  16. package/lib/field-utils/icon.d.ts +1 -3
  17. package/lib/field-utils/icon.js +1 -2
  18. package/lib/field-utils/number.d.ts +1 -3
  19. package/lib/field-utils/number.js +5 -8
  20. package/lib/field-utils/reference-collection.d.ts +1 -3
  21. package/lib/field-utils/reference-collection.js +5 -7
  22. package/lib/field-utils/reference.d.ts +1 -3
  23. package/lib/field-utils/reference.js +3 -4
  24. package/lib/field-utils/relation-view.d.ts +1 -3
  25. package/lib/field-utils/relation-view.js +1 -2
  26. package/lib/field-utils/rich-text.d.ts +1 -3
  27. package/lib/field-utils/rich-text.js +1 -2
  28. package/lib/field-utils/text.d.ts +1 -3
  29. package/lib/field-utils/text.js +1 -2
  30. package/lib/field-utils/user-active.d.ts +1 -3
  31. package/lib/field-utils/user-active.js +1 -2
  32. package/lib/field-utils/user-role.d.ts +1 -3
  33. package/lib/field-utils/user-role.js +1 -2
  34. package/lib/field-utils/workflow.d.ts +1 -3
  35. package/lib/field-utils/workflow.js +1 -2
  36. package/lib/filter.d.ts +1 -3
  37. package/lib/index.d.ts +2 -4
  38. package/lib/index.js +2 -3
  39. package/lib/meta-validation.d.ts +1 -3
  40. package/lib/meta-validation.js +7 -12
  41. package/lib/private/board.d.ts +3 -4
  42. package/lib/private/board.js +6 -7
  43. package/lib/private/calendar.d.ts +1 -3
  44. package/lib/private/calendar.js +2 -3
  45. package/lib/private/feed.d.ts +1 -3
  46. package/lib/private/feed.js +2 -3
  47. package/lib/private/form.d.ts +1 -3
  48. package/lib/private/form.js +1 -2
  49. package/lib/private/map.d.ts +1 -3
  50. package/lib/private/map.js +2 -3
  51. package/lib/private/smart-folder.d.ts +1 -3
  52. package/lib/private/smart-folder.js +2 -3
  53. package/lib/private/timeline.d.ts +1 -3
  54. package/lib/private/timeline.js +7 -8
  55. package/lib/private/units.d.ts +1 -3
  56. package/lib/private/units.js +17 -2
  57. package/lib/private/utils.d.ts +1 -3
  58. package/lib/private/utils.js +3 -5
  59. package/lib/refs.d.ts +1 -3
  60. package/lib/unit-definitions/avatar-collection.d.ts +1 -3
  61. package/lib/unit-definitions/avatar-collection.js +1 -2
  62. package/lib/unit-definitions/avatar-input.d.ts +2 -4
  63. package/lib/unit-definitions/avatar-input.js +1 -2
  64. package/lib/unit-definitions/avatar.d.ts +2 -4
  65. package/lib/unit-definitions/avatar.js +1 -2
  66. package/lib/unit-definitions/back-references-list.d.ts +3 -5
  67. package/lib/unit-definitions/back-references-list.js +2 -3
  68. package/lib/unit-definitions/bool-checkbox.d.ts +2 -4
  69. package/lib/unit-definitions/bool-checkbox.js +2 -3
  70. package/lib/unit-definitions/bool.d.ts +2 -4
  71. package/lib/unit-definitions/bool.js +2 -3
  72. package/lib/unit-definitions/collection-count.d.ts +2 -4
  73. package/lib/unit-definitions/collection-count.js +1 -2
  74. package/lib/unit-definitions/color-input.d.ts +2 -4
  75. package/lib/unit-definitions/color-input.js +2 -3
  76. package/lib/unit-definitions/comments-list.d.ts +2 -4
  77. package/lib/unit-definitions/comments-list.js +2 -3
  78. package/lib/unit-definitions/date-range-combobox.d.ts +2 -4
  79. package/lib/unit-definitions/date-range-combobox.js +2 -3
  80. package/lib/unit-definitions/date-range.d.ts +2 -4
  81. package/lib/unit-definitions/date-range.js +2 -3
  82. package/lib/unit-definitions/date-time-combobox.d.ts +2 -4
  83. package/lib/unit-definitions/date-time-combobox.js +2 -3
  84. package/lib/unit-definitions/date.d.ts +2 -4
  85. package/lib/unit-definitions/date.js +2 -3
  86. package/lib/unit-definitions/email-input.d.ts +4 -6
  87. package/lib/unit-definitions/email-input.js +1 -2
  88. package/lib/unit-definitions/email.d.ts +3 -5
  89. package/lib/unit-definitions/email.js +1 -2
  90. package/lib/unit-definitions/emoji.d.ts +3 -5
  91. package/lib/unit-definitions/emoji.js +1 -2
  92. package/lib/unit-definitions/file-collection-count.d.ts +2 -4
  93. package/lib/unit-definitions/file-collection-count.js +2 -3
  94. package/lib/unit-definitions/file-compact-collection.d.ts +2 -4
  95. package/lib/unit-definitions/file-compact-collection.js +2 -3
  96. package/lib/unit-definitions/file-compact-reference.d.ts +1 -3
  97. package/lib/unit-definitions/file-compact-reference.js +1 -2
  98. package/lib/unit-definitions/file-reference.d.ts +2 -4
  99. package/lib/unit-definitions/file-reference.js +2 -3
  100. package/lib/unit-definitions/files-gallery.d.ts +2 -4
  101. package/lib/unit-definitions/files-gallery.js +2 -3
  102. package/lib/unit-definitions/files-l-list-item.d.ts +2 -4
  103. package/lib/unit-definitions/files-l-list-item.js +2 -3
  104. package/lib/unit-definitions/files-l-list.d.ts +2 -4
  105. package/lib/unit-definitions/files-l-list.js +2 -3
  106. package/lib/unit-definitions/files-list-item.d.ts +2 -4
  107. package/lib/unit-definitions/files-list-item.js +2 -3
  108. package/lib/unit-definitions/files-list.d.ts +2 -4
  109. package/lib/unit-definitions/files-list.js +2 -3
  110. package/lib/unit-definitions/geometry-preview.d.ts +3 -5
  111. package/lib/unit-definitions/geometry-preview.js +1 -2
  112. package/lib/unit-definitions/icon-button.d.ts +2 -4
  113. package/lib/unit-definitions/icon-button.js +2 -3
  114. package/lib/unit-definitions/icon-input.d.ts +4 -6
  115. package/lib/unit-definitions/icon-input.js +1 -2
  116. package/lib/unit-definitions/id.d.ts +1 -3
  117. package/lib/unit-definitions/id.js +1 -2
  118. package/lib/unit-definitions/index.d.ts +4 -3
  119. package/lib/unit-definitions/index.js +6 -5
  120. package/lib/unit-definitions/json-input.d.ts +2 -4
  121. package/lib/unit-definitions/json-input.js +2 -3
  122. package/lib/unit-definitions/json-preview.d.ts +26 -0
  123. package/lib/unit-definitions/json-preview.js +31 -0
  124. package/lib/unit-definitions/location-input.d.ts +3 -5
  125. package/lib/unit-definitions/location-input.js +1 -2
  126. package/lib/unit-definitions/location.d.ts +3 -5
  127. package/lib/unit-definitions/location.js +1 -2
  128. package/lib/unit-definitions/not-found.d.ts +1 -3
  129. package/lib/unit-definitions/not-found.js +0 -1
  130. package/lib/unit-definitions/number-input.d.ts +2 -4
  131. package/lib/unit-definitions/number-input.js +2 -3
  132. package/lib/unit-definitions/number.d.ts +1 -3
  133. package/lib/unit-definitions/number.js +1 -2
  134. package/lib/unit-definitions/phone-input.d.ts +4 -6
  135. package/lib/unit-definitions/phone-input.js +1 -2
  136. package/lib/unit-definitions/phone.d.ts +4 -6
  137. package/lib/unit-definitions/phone.js +1 -2
  138. package/lib/unit-definitions/progress-bar.d.ts +1 -3
  139. package/lib/unit-definitions/progress-bar.js +1 -2
  140. package/lib/unit-definitions/reference-collection-combobox.d.ts +2 -4
  141. package/lib/unit-definitions/reference-collection-combobox.js +2 -3
  142. package/lib/unit-definitions/reference-collection-list.d.ts +2 -4
  143. package/lib/unit-definitions/reference-collection-list.js +2 -3
  144. package/lib/unit-definitions/reference-collection-view.d.ts +2 -4
  145. package/lib/unit-definitions/reference-collection-view.js +2 -3
  146. package/lib/unit-definitions/reference-collection.d.ts +2 -4
  147. package/lib/unit-definitions/reference-collection.js +2 -3
  148. package/lib/unit-definitions/reference-combobox.d.ts +2 -4
  149. package/lib/unit-definitions/reference-combobox.js +2 -3
  150. package/lib/unit-definitions/reference-icon.d.ts +3 -5
  151. package/lib/unit-definitions/reference-icon.js +1 -2
  152. package/lib/unit-definitions/reference.d.ts +1 -3
  153. package/lib/unit-definitions/reference.js +1 -2
  154. package/lib/unit-definitions/rich-text-document.d.ts +2 -4
  155. package/lib/unit-definitions/rich-text-document.js +2 -3
  156. package/lib/unit-definitions/rich-text-snippet.d.ts +1 -3
  157. package/lib/unit-definitions/rich-text-snippet.js +1 -2
  158. package/lib/unit-definitions/single-location-preview.d.ts +3 -5
  159. package/lib/unit-definitions/single-location-preview.js +1 -2
  160. package/lib/unit-definitions/text-input.d.ts +2 -4
  161. package/lib/unit-definitions/text-input.js +2 -3
  162. package/lib/unit-definitions/text.d.ts +2 -4
  163. package/lib/unit-definitions/text.js +2 -3
  164. package/lib/unit-definitions/title-input.d.ts +1 -3
  165. package/lib/unit-definitions/title-input.js +1 -2
  166. package/lib/unit-definitions/title.d.ts +2 -4
  167. package/lib/unit-definitions/title.js +1 -2
  168. package/lib/unit-definitions/type-badge-abbr.d.ts +1 -3
  169. package/lib/unit-definitions/type-badge-abbr.js +1 -2
  170. package/lib/unit-definitions/type-badge.d.ts +1 -3
  171. package/lib/unit-definitions/type-badge.js +1 -2
  172. package/lib/unit-definitions/type-icon.d.ts +1 -3
  173. package/lib/unit-definitions/type-icon.js +1 -2
  174. package/lib/unit-definitions/url-input.d.ts +4 -6
  175. package/lib/unit-definitions/url-input.js +1 -2
  176. package/lib/unit-definitions/url.d.ts +3 -5
  177. package/lib/unit-definitions/url.js +1 -2
  178. package/lib/unit-definitions/user-button.d.ts +1 -3
  179. package/lib/unit-definitions/user-button.js +1 -2
  180. package/lib/unit-definitions/user-role-input.d.ts +3 -5
  181. package/lib/unit-definitions/user-role-input.js +1 -2
  182. package/lib/unit-definitions/user-role.d.ts +3 -5
  183. package/lib/unit-definitions/user-role.js +2 -3
  184. package/lib/unit-utils/access.d.ts +1 -3
  185. package/lib/unit-utils/access.js +1 -2
  186. package/lib/unit-utils/can-edit-field.d.ts +1 -3
  187. package/lib/unit-utils/can-edit-field.js +1 -2
  188. package/lib/unit-utils/common.d.ts +2 -4
  189. package/lib/unit-utils/common.js +1 -2
  190. package/lib/unit-utils/decimal.d.ts +0 -2
  191. package/lib/unit-utils/decimal.js +1 -2
  192. package/lib/unit-utils/dynamic-keys.d.ts +1 -3
  193. package/lib/unit-utils/dynamic-keys.js +1 -2
  194. package/lib/unit-utils/enums.d.ts +1 -3
  195. package/lib/unit-utils/enums.js +2 -3
  196. package/lib/unit-utils/formatters.d.ts +1 -3
  197. package/lib/unit-utils/formatters.js +2 -4
  198. package/lib/unit-utils/get-export-value.d.ts +1 -3
  199. package/lib/unit-utils/get-export-value.js +1 -2
  200. package/lib/unit-utils/get-field-label.d.ts +1 -3
  201. package/lib/unit-utils/get-field-label.js +1 -2
  202. package/lib/unit-utils/get-unmatched-unit-label.d.ts +1 -3
  203. package/lib/unit-utils/get-unmatched-unit-label.js +2 -4
  204. package/lib/unit-utils/wrap-normalized-in-expression.d.ts +1 -3
  205. package/lib/unit-utils/wrap-normalized-in-expression.js +1 -2
  206. package/lib/units/board.d.ts +1 -3
  207. package/lib/units/board.js +1 -2
  208. package/lib/units/canvas/all-units-data-definitions.d.ts +5 -5
  209. package/lib/units/canvas/all-units-data-definitions.js +6 -7
  210. package/lib/units/canvas/index.d.ts +0 -1
  211. package/lib/units/canvas/index.js +1 -2
  212. package/lib/units/canvas/type-badge-abbr.d.ts +1 -3
  213. package/lib/units/canvas/type-badge-abbr.js +1 -2
  214. package/lib/units/canvas/type-badge.d.ts +1 -3
  215. package/lib/units/canvas/type-badge.js +1 -2
  216. package/lib/units/default.d.ts +0 -1
  217. package/lib/units/default.js +1 -2
  218. package/lib/units/gallery.d.ts +0 -2
  219. package/lib/units/gallery.js +1 -2
  220. package/lib/units/gantt.d.ts +1 -3
  221. package/lib/units/gantt.js +1 -2
  222. package/lib/units/get-unit-definitions-for-view-type.d.ts +1 -3
  223. package/lib/units/get-unit-definitions-for-view-type.js +2 -3
  224. package/lib/units/grid.d.ts +1 -3
  225. package/lib/units/grid.js +8 -7
  226. package/lib/units/list.d.ts +1 -3
  227. package/lib/units/list.js +1 -2
  228. package/lib/units/make-factory.d.ts +1 -3
  229. package/lib/units/make-factory.js +21 -28
  230. package/lib/units/types.d.ts +2 -4
  231. package/package.json +7 -9
@@ -1,4 +1,4 @@
1
- //#region \0rolldown/runtime.js
1
+ // \0rolldown/runtime.js
2
2
  var __defProp = Object.defineProperty;
3
3
  var __exportAll = (all, no_symbols) => {
4
4
  let target = {};
@@ -9,5 +9,4 @@ var __exportAll = (all, no_symbols) => {
9
9
  if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
10
10
  return target;
11
11
  };
12
- //#endregion
13
12
  export { __exportAll };
package/lib/errors.d.ts CHANGED
@@ -1,3 +1 @@
1
- //#region src/errors.d.ts
2
- export declare class InvalidMetaError extends Error {}
3
- //#endregion
1
+ export declare class InvalidMetaError extends Error {}
package/lib/errors.js CHANGED
@@ -1,4 +1,3 @@
1
- //#region src/errors.ts
1
+ // src/errors.ts
2
2
  var InvalidMetaError = class extends Error {};
3
- //#endregion
4
3
  export { InvalidMetaError };
@@ -1,5 +1,4 @@
1
1
  import { FieldObject, TypeObject } from "@fibery/schema";
2
- //#region src/field-utils/avatar.d.ts
3
2
  export declare const AVATAR_MIXIN_NAME = "avatar/avatar-mixin";
4
3
  export declare const AVATAR_EXTENSION_FIELD = "avatar/avatars";
5
4
  export declare const isAvatarExtensionEnabledType: (typeObject: TypeObject) => boolean;
@@ -18,5 +17,4 @@ export declare const getAvatarSelectQuery: ({ typeObject }: {
18
17
  } | {
19
18
  "fibery/id"?: undefined;
20
19
  __NOTHING_INTERESTING__TitleField__?: undefined;
21
- };
22
- //#endregion
20
+ };
@@ -1,6 +1,6 @@
1
1
  import { truthy } from "@fibery/helpers/src/_";
2
2
  import { toSelectMapClause } from "@fibery/query-utils/src/select";
3
- //#region src/field-utils/avatar.ts
3
+ // src/field-utils/avatar.ts
4
4
  const AVATAR_MIXIN_NAME = "avatar/avatar-mixin";
5
5
  const AVATAR_EXTENSION_FIELD = "avatar/avatars";
6
6
  const isAvatarExtensionEnabledType = (typeObject) => {
@@ -31,5 +31,4 @@ const getAvatarSelectQuery = ({ typeObject }) => {
31
31
  };
32
32
  } else return {};
33
33
  };
34
- //#endregion
35
34
  export { AVATAR_EXTENSION_FIELD, AVATAR_MIXIN_NAME, getAvatarSelect, getAvatarSelectQuery, isAvatarExtensionEnabledType, isAvatarExtensionField };
@@ -1,6 +1,5 @@
1
1
  import { EntityId, FieldObject, TypeId, TypeObject } from "@fibery/schema";
2
2
  import { FiberyObject, Projection } from "@fibery/expression-utils/src/types";
3
- //#region src/field-utils/back-references.d.ts
4
3
  export declare const isReferenceExtensionField: (fieldObject: FieldObject) => boolean;
5
4
  export type EntityLinkProjection = FiberyObject & {
6
5
  "fibery/creation-date": string;
@@ -14,5 +13,4 @@ export type EntityLinkProjection = FiberyObject & {
14
13
  "fibery/id": string;
15
14
  } | null;
16
15
  };
17
- export declare const getEntityLinksListSelect: (typeObject: TypeObject) => Projection<EntityLinkProjection>;
18
- //#endregion
16
+ export declare const getEntityLinksListSelect: (typeObject: TypeObject) => Projection<EntityLinkProjection>;
@@ -1,4 +1,4 @@
1
- //#region src/field-utils/back-references.ts
1
+ // src/field-utils/back-references.ts
2
2
  const isReferenceExtensionField = (fieldObject) => fieldObject.type === "Collaboration~Documents/Reference";
3
3
  const getEntityLinksListSelect = (typeObject) => {
4
4
  return {
@@ -11,5 +11,4 @@ const getEntityLinksListSelect = (typeObject) => {
11
11
  "fibery/created-by": { "fibery/id": ["fibery/created-by", "fibery/id"] }
12
12
  };
13
13
  };
14
- //#endregion
15
14
  export { getEntityLinksListSelect, isReferenceExtensionField };
@@ -1,6 +1,5 @@
1
1
  import { accessCheckKey } from "../unit-utils/access.js";
2
2
  import { FieldObject, TypeObject } from "@fibery/schema";
3
- //#region src/field-utils/comments.d.ts
4
3
  export declare const isCommentExtensionField: (fieldObject: FieldObject) => boolean;
5
4
  export declare const getCommentsListSelect: (typeObject: TypeObject) => {
6
5
  "fibery/id": "fibery/id";
@@ -58,5 +57,4 @@ export declare const getQuerySelect: (fieldObject: FieldObject) => {
58
57
  "q/order-by": import("@fibery/schema").OrderBy | undefined;
59
58
  "q/limit": string;
60
59
  };
61
- };
62
- //#endregion
60
+ };
@@ -1,6 +1,6 @@
1
1
  import { accessCheckKey } from "../unit-utils/access.js";
2
2
  import { calculateDefaultOrderBy } from "@fibery/query-utils/src/query";
3
- //#region src/field-utils/comments.ts
3
+ // src/field-utils/comments.ts
4
4
  const isCommentExtensionField = (fieldObject) => fieldObject.name === "comments/comments";
5
5
  const getCommentsListSelect = (typeObject) => {
6
6
  return {
@@ -37,5 +37,4 @@ const getQuerySelect = (fieldObject) => {
37
37
  "q/limit": "q/no-limit"
38
38
  } };
39
39
  };
40
- //#endregion
41
40
  export { getCommentsListSelect, getQuerySelect, isCommentExtensionField };
@@ -1,5 +1,4 @@
1
1
  import { Moment, MomentInput, unitOfTime } from "moment/moment";
2
- //#region src/field-utils/date-time.d.ts
3
2
  export declare const parseDate: (isoDate: MomentInput) => Moment;
4
3
  export declare const serializeDate: (momentDate: Moment) => string;
5
4
  export declare const parseDateTime: (isoDateTime: MomentInput) => Moment;
@@ -12,5 +11,4 @@ export declare const parseEnd: ({ value, type, minimumDelta }: {
12
11
  value: MomentInput;
13
12
  type: string;
14
13
  minimumDelta?: [number, unitOfTime.DurationConstructor] | null;
15
- }) => Moment;
16
- //#endregion
14
+ }) => Moment;
@@ -1,7 +1,7 @@
1
1
  import { isDateTimeType, isDateType, isRangeType } from "@fibery/expression-utils/src/utils";
2
2
  import { NotImplementedError } from "@fibery/expression-utils/src/errors";
3
3
  import moment from "moment/moment.js";
4
- //#region src/field-utils/date-time.ts
4
+ // src/field-utils/date-time.ts
5
5
  const defaultDateDelta = [1, "day"];
6
6
  const defaultDateTimeDelta = [1, "second"];
7
7
  const parseDate = (isoDate) => {
@@ -29,5 +29,4 @@ const parseEnd = ({ value, type, minimumDelta = null }) => {
29
29
  if (isDateTimeType(type)) return parseDateTime(value).subtract(...minimumDelta || defaultDateTimeDelta).startOf("second");
30
30
  throw new NotImplementedError(type);
31
31
  };
32
- //#endregion
33
32
  export { parseDate, parseDateTime, parseEnd, parseStart, serializeDate, serializeDateTime };
@@ -1,6 +1,5 @@
1
1
  import { NumberFormat } from "./number.js";
2
2
  import { FieldObject, SpaceName, TypeObject } from "@fibery/schema";
3
- //#region src/field-utils/enum-value.d.ts
4
3
  export declare const enumNumberFieldName = "Value";
5
4
  export declare const getEnumNumberFieldName: (namespace: SpaceName) => string;
6
5
  export declare const defaultEnumNumberFieldMeta: {
@@ -11,5 +10,4 @@ export declare const defaultEnumNumberFieldMeta: {
11
10
  numberUseThousandSeparator: boolean;
12
11
  };
13
12
  export declare const getIsNumberFieldObjectTaken: (typeObject: TypeObject) => boolean;
14
- export declare const getNumberFieldObject: (typeObject: TypeObject) => FieldObject | undefined;
15
- //#endregion
13
+ export declare const getNumberFieldObject: (typeObject: TypeObject) => FieldObject | undefined;
@@ -1,5 +1,5 @@
1
1
  import "./number.js";
2
- //#region src/field-utils/enum-value.ts
2
+ // src/field-utils/enum-value.ts
3
3
  const enumNumberFieldName = "Value";
4
4
  const getEnumNumberFieldName = (namespace) => `${namespace}/${enumNumberFieldName}`;
5
5
  const defaultEnumNumberFieldMeta = {
@@ -22,5 +22,4 @@ const getNumberFieldObject = (typeObject) => {
22
22
  return fieldObject.nameParts.name === "Value" && isNumeric(fieldObject);
23
23
  });
24
24
  };
25
- //#endregion
26
25
  export { defaultEnumNumberFieldMeta, enumNumberFieldName, getEnumNumberFieldName, getIsNumberFieldObjectTaken, getNumberFieldObject };
@@ -1,6 +1,4 @@
1
1
  import { TypeObject } from "@fibery/schema";
2
- //#region src/field-utils/file.d.ts
3
2
  export declare const getFilesSelect: ({ typeObject }: {
4
3
  typeObject: TypeObject;
5
- }) => import("@fibery/schema").Select;
6
- //#endregion
4
+ }) => import("@fibery/schema").Select;
@@ -1,6 +1,6 @@
1
1
  import { truthy } from "@fibery/helpers/src/_";
2
2
  import { toSelectMapClause } from "@fibery/query-utils/src/select";
3
- //#region src/field-utils/file.ts
3
+ // src/field-utils/file.ts
4
4
  const getFilesSelect = ({ typeObject }) => toSelectMapClause([
5
5
  typeObject.idField,
6
6
  typeObject.titleField,
@@ -10,5 +10,4 @@ const getFilesSelect = ({ typeObject }) => toSelectMapClause([
10
10
  "fibery/secret",
11
11
  "fibery/rank"
12
12
  ].filter(truthy));
13
- //#endregion
14
13
  export { getFilesSelect };
@@ -1,5 +1,4 @@
1
1
  import { FieldObject, TypeObject } from "@fibery/schema";
2
- //#region src/field-utils/icon.d.ts
3
2
  export declare const ICON_MIXIN_NAME = "icon/icon-mixin";
4
3
  export declare const ICON_EXTENSION_FIELD = "icon/icon";
5
4
  export declare const isIconExtensionEnabledType: (typeObject: TypeObject) => boolean;
@@ -8,5 +7,4 @@ export declare const getEntityIconSelect: ({ typeObject }: {
8
7
  typeObject: TypeObject;
9
8
  }) => {
10
9
  [x: string]: import("@fibery/schema").FieldName;
11
- };
12
- //#endregion
10
+ };
@@ -1,4 +1,4 @@
1
- //#region src/field-utils/icon.ts
1
+ // src/field-utils/icon.ts
2
2
  const ICON_MIXIN_NAME = "icon/icon-mixin";
3
3
  const ICON_EXTENSION_FIELD = "icon/icon";
4
4
  const isIconExtensionEnabledType = (typeObject) => {
@@ -13,5 +13,4 @@ const getEntityIconSelect = ({ typeObject }) => {
13
13
  return { [fieldObject.name]: fieldObject.name };
14
14
  } else return {};
15
15
  };
16
- //#endregion
17
16
  export { ICON_EXTENSION_FIELD, ICON_MIXIN_NAME, getEntityIconSelect, isIconExtensionEnabledType, isIconExtensionField };
@@ -1,5 +1,4 @@
1
1
  import { FieldObject } from "@fibery/schema";
2
- //#region src/field-utils/number.d.ts
3
2
  export declare enum NumberFormat {
4
3
  NUMBER = "Number",
5
4
  MONEY = "Money",
@@ -29,5 +28,4 @@ export declare const parseNumberMeta: ({ rawNumberPrecision, rawNumberUnit, rawN
29
28
  rawNumberFormat: unknown;
30
29
  fieldType: string;
31
30
  }) => NumberFieldMeta;
32
- export declare const parseNumberFieldMeta: (fieldObject: FieldObject) => NumberFieldMeta;
33
- //#endregion
31
+ export declare const parseNumberFieldMeta: (fieldObject: FieldObject) => NumberFieldMeta;
@@ -1,6 +1,4 @@
1
- import curry from "lodash/curry.js";
2
- import flow from "lodash/flow.js";
3
- //#region src/field-utils/number.ts
1
+ // src/field-utils/number.ts
4
2
  let NumberFormat = /* @__PURE__ */ function(NumberFormat) {
5
3
  NumberFormat["NUMBER"] = "Number";
6
4
  NumberFormat["MONEY"] = "Money";
@@ -25,13 +23,13 @@ const getInitialNumberFieldMeta = () => {
25
23
  numberUseThousandSeparator: true
26
24
  };
27
25
  };
28
- const parsePrecisionWithBackwardCompatibility = (fieldType) => (rawNumberPrecision) => {
26
+ const parsePrecisionWithBackwardCompatibility = (fieldType, rawNumberPrecision) => {
29
27
  return fieldType === "fibery/int" ? 0 : Number(rawNumberPrecision) || 1;
30
28
  };
31
- const internalizePrecision = curry((numberFormat, numberPrecision) => {
29
+ const internalizePrecision = (numberFormat, numberPrecision) => {
32
30
  if (numberFormat === "Percent") return numberPrecision - 2;
33
31
  return numberPrecision;
34
- });
32
+ };
35
33
  const externalizePrecision = (numberFormat, numberPrecision) => {
36
34
  if (numberFormat === "Percent") return numberPrecision + 2;
37
35
  return numberPrecision;
@@ -43,7 +41,7 @@ const parseNumberMeta = ({ rawNumberPrecision, rawNumberUnit, rawNumberCurrencyC
43
41
  const numberFormat = getNumberFormatOrDefault(rawNumberFormat);
44
42
  return {
45
43
  numberFormat,
46
- numberPrecision: flow([parsePrecisionWithBackwardCompatibility(fieldType), internalizePrecision(numberFormat)])(rawNumberPrecision),
44
+ numberPrecision: internalizePrecision(numberFormat, parsePrecisionWithBackwardCompatibility(fieldType, rawNumberPrecision)),
47
45
  numberUnit: rawNumberUnit || null,
48
46
  numberCurrencyCode: numberFormat === "Money" ? rawNumberCurrencyCode : null,
49
47
  numberUseThousandSeparator: Boolean(rawNumberUseThousandSeparator)
@@ -60,5 +58,4 @@ const parseNumberFieldMeta = (fieldObject) => {
60
58
  fieldType: fieldObject.type
61
59
  });
62
60
  };
63
- //#endregion
64
61
  export { NumberFormat, externalizePrecision, getDefaultCurrencyCode, getDefaultPrecision, getInitialNumberFieldMeta, getNumberFormatOrDefault, parseNumberFieldMeta, parseNumberMeta };
@@ -1,6 +1,5 @@
1
1
  import { FieldObject } from "@fibery/schema";
2
2
  import { QueryLimit } from "@fibery/expression-utils/src/types";
3
- //#region src/field-utils/reference-collection.d.ts
4
3
  export declare const REFERENCE_COLLECTION_LIMIT = 1000;
5
4
  export declare const makeCollectionCountExpression: (field: string | string[]) => (string | string[])[];
6
5
  export declare const getCountKey: (field: string) => string;
@@ -11,5 +10,4 @@ export declare const calculateReferenceCollectionQuery: ({ fieldObjects, express
11
10
  fieldObjects: FieldObject[];
12
11
  expression: string[];
13
12
  limit: QueryLimit;
14
- }) => Record<string, unknown>;
15
- //#endregion
13
+ }) => Record<string, unknown>;
@@ -1,19 +1,18 @@
1
- import { getAvatarSelectQuery } from "./avatar.js";
2
- import { collectionCountKeyPrefix, makeDynamicKey } from "../unit-utils/dynamic-keys.js";
3
1
  import { generateAccessCheckQueryExpression } from "../unit-utils/access.js";
2
+ import { collectionCountKeyPrefix, makeDynamicKey } from "../unit-utils/dynamic-keys.js";
3
+ import { getEnumIconColorQuery } from "../unit-utils/enums.js";
4
+ import { getAvatarSelectQuery } from "./avatar.js";
4
5
  import { getFilesSelect } from "./file.js";
5
6
  import { getEntityIconSelect } from "./icon.js";
6
- import { getEnumIconColorQuery } from "../unit-utils/enums.js";
7
7
  import { truthy } from "@fibery/helpers/src/_";
8
8
  import { mergeDenormalizedSelects, toSelectMapClause } from "@fibery/query-utils/src/select";
9
- import last from "lodash/last.js";
10
- //#region src/field-utils/reference-collection.ts
9
+ // src/field-utils/reference-collection.ts
11
10
  const REFERENCE_COLLECTION_LIMIT = 1e3;
12
11
  const makeCollectionCountExpression = (field) => ["q/count", [...Array.isArray(field) ? field : [field], "fibery/id"]];
13
12
  const getCountKey = (field) => makeDynamicKey(collectionCountKeyPrefix, field);
14
13
  const getCollectionCountSelect = (field) => ({ [getCountKey(field)]: makeCollectionCountExpression(field) });
15
14
  const calculateReferenceCollectionQuery = ({ fieldObjects, expression, limit }) => {
16
- const fieldObject = last(fieldObjects);
15
+ const fieldObject = fieldObjects.at(-1);
17
16
  if (!fieldObject) return {};
18
17
  const collectionSubQuery = {
19
18
  "q/from": expression,
@@ -45,5 +44,4 @@ const calculateReferenceCollectionQuery = ({ fieldObjects, expression, limit })
45
44
  return { [field]: inner };
46
45
  }, collectionSubQuery);
47
46
  };
48
- //#endregion
49
47
  export { REFERENCE_COLLECTION_LIMIT, calculateReferenceCollectionQuery, getCollectionCountSelect, getCountKey, makeCollectionCountExpression };
@@ -1,9 +1,7 @@
1
1
  import { FieldObject, TypeObject } from "@fibery/schema";
2
2
  import { Select } from "@fibery/expression-utils/src/types";
3
3
  import { FieldExpression as FieldExpression$1 } from "@fibery/expression-utils";
4
- //#region src/field-utils/reference.d.ts
5
4
  export declare const getReferenceTypeSelectClause: ({ typeObject }: {
6
5
  typeObject: TypeObject;
7
6
  }, contextPath: FieldExpression$1) => Select;
8
- export declare const getReferenceFieldNormalizedSelectClause: (fieldObject: FieldObject, contextPath: FieldExpression$1) => any;
9
- //#endregion
7
+ export declare const getReferenceFieldNormalizedSelectClause: (fieldObject: FieldObject, contextPath: FieldExpression$1) => any;
@@ -1,13 +1,13 @@
1
- import { getAvatarSelectQuery } from "./avatar.js";
2
1
  import { generateAccessCheckQueryExpression } from "../unit-utils/access.js";
2
+ import { getEnumIconColorQuery } from "../unit-utils/enums.js";
3
+ import { getAvatarSelectQuery } from "./avatar.js";
3
4
  import { getFilesSelect } from "./file.js";
4
5
  import { getEntityIconSelect } from "./icon.js";
5
- import { getEnumIconColorQuery } from "../unit-utils/enums.js";
6
6
  import { getIsUserActiveSelect } from "./user-active.js";
7
7
  import { getIsFinalStateSelect } from "./workflow.js";
8
8
  import { truthy } from "@fibery/helpers/src/_";
9
9
  import { isSelectForMultiFieldKey, normalizeSelect, toSelectMapClause } from "@fibery/query-utils/src/select";
10
- //#region src/field-utils/reference.ts
10
+ // src/field-utils/reference.ts
11
11
  const getReferenceTypeSelectClause = ({ typeObject }, contextPath) => {
12
12
  return {
13
13
  ...toSelectMapClause([
@@ -52,5 +52,4 @@ const getReferenceFieldNormalizedSelectClause = (fieldObject, contextPath) => {
52
52
  return Object.fromEntries(pairs);
53
53
  } else return normalizeSelect(getReferenceTypeSelectClause({ typeObject }, contextPath));
54
54
  };
55
- //#endregion
56
55
  export { getReferenceFieldNormalizedSelectClause, getReferenceTypeSelectClause };
@@ -1,4 +1,2 @@
1
1
  import { FieldObject } from "@fibery/schema";
2
- //#region src/field-utils/relation-view.d.ts
3
- export declare const isRelationViewField: (fieldObject: FieldObject) => boolean;
4
- //#endregion
2
+ export declare const isRelationViewField: (fieldObject: FieldObject) => boolean;
@@ -1,7 +1,6 @@
1
- //#region src/field-utils/relation-view.ts
1
+ // src/field-utils/relation-view.ts
2
2
  const isRelationViewField = (fieldObject) => {
3
3
  if (fieldObject.typeObject.isPrimitive || !fieldObject.relation && !fieldObject.multiRelation || fieldObject.typeObject.isEnum) return false;
4
4
  return [":cardinality/one-to-many", ":cardinality/many-to-many"].includes(fieldObject.cardinality);
5
5
  };
6
- //#endregion
7
6
  export { isRelationViewField };
@@ -1,7 +1,6 @@
1
1
  import { ExpressionFieldUnit } from "../units/types.js";
2
2
  import { TypeObject } from "@fibery/schema";
3
3
  import { FieldExpression } from "@fibery/expression-utils/src/types";
4
- //#region src/field-utils/rich-text.d.ts
5
4
  export declare const hasAccessToSecretKey: string;
6
5
  export declare const getHasAccessToSecretExpr: (expression: FieldExpression) => (string | (string | import("@fibery/schema").MultiFieldAccess)[])[];
7
6
  export declare const getHasAccessToSecret: (expression: FieldExpression) => {
@@ -11,5 +10,4 @@ export declare function getRichTextQuerySelect({ typeObject, unit: { expression
11
10
  typeObject: TypeObject;
12
11
  unit: ExpressionFieldUnit;
13
12
  includeSnippet?: boolean;
14
- }): import("@fibery/schema").Select;
15
- //#endregion
13
+ }): import("@fibery/schema").Select;
@@ -1,7 +1,7 @@
1
1
  import { hasAccessToSecretKeyPrefix, makeDynamicKey } from "../unit-utils/dynamic-keys.js";
2
2
  import { getFieldObjectsByFieldExpression } from "@fibery/expression-utils/src/utils";
3
3
  import { denormalizeSelect, normalizeSelect, toSelectMapClause } from "@fibery/query-utils/src/select";
4
- //#region src/field-utils/rich-text.ts
4
+ // src/field-utils/rich-text.ts
5
5
  const hasAccessToSecretKey = makeDynamicKey(hasAccessToSecretKeyPrefix);
6
6
  const getHasAccessToSecretExpr = (expression) => ["q/access?", [...expression, "Collaboration~Documents/secret"]];
7
7
  const getHasAccessToSecret = (expression) => ({ [hasAccessToSecretKey]: getHasAccessToSecretExpr(expression) });
@@ -30,5 +30,4 @@ function getRichTextQuerySelect({ typeObject, unit: { expression }, includeSnipp
30
30
  }, innerNormalized);
31
31
  return denormalizeSelect(nested);
32
32
  }
33
- //#endregion
34
33
  export { getHasAccessToSecret, getHasAccessToSecretExpr, getRichTextQuerySelect, hasAccessToSecretKey };
@@ -1,4 +1,3 @@
1
- //#region src/field-utils/text.d.ts
2
1
  export declare const TextUIMetaKey = "ui/type";
3
2
  export declare const TextUIMeta: {
4
3
  Phone: string;
@@ -28,5 +27,4 @@ export declare const TextTypeToUiMeta: {
28
27
  };
29
28
  export declare const TextUiMetaToTextType: Record<string, string>;
30
29
  export declare const getTextType: (fieldMeta: Record<string, unknown>) => string;
31
- export declare const getTextTypeLabel: (textType: string) => string;
32
- //#endregion
30
+ export declare const getTextTypeLabel: (textType: string) => string;
@@ -1,4 +1,4 @@
1
- //#region src/field-utils/text.ts
1
+ // src/field-utils/text.ts
2
2
  const TextUIMetaKey = "ui/type";
3
3
  const TextUIMeta = {
4
4
  Phone: "phone",
@@ -36,5 +36,4 @@ const getTextTypeLabel = (textType) => {
36
36
  [TextTypes.CustomURL]: "URL"
37
37
  }[textType] || "Text";
38
38
  };
39
- //#endregion
40
39
  export { TextTypeToFiberyType, TextTypeToUiMeta, TextTypes, TextUIMeta, TextUIMetaKey, TextUiMetaToTextType, getTextType, getTextTypeLabel };
@@ -1,10 +1,8 @@
1
1
  import { TypeObject } from "@fibery/schema";
2
2
  import { FieldExpression } from "@fibery/expression-utils";
3
- //#region src/field-utils/user-active.d.ts
4
3
  export declare const getIsUserActiveSelect: ({ typeObject, contextPath }: {
5
4
  typeObject: TypeObject;
6
5
  contextPath?: FieldExpression;
7
6
  }) => {
8
7
  [x: string]: (string | (string | import("@fibery/schema").MultiFieldAccess)[])[];
9
- } | null;
10
- //#endregion
8
+ } | null;
@@ -1,6 +1,6 @@
1
1
  import { isUserActiveDynamicKeyPrefix, makeDynamicKey } from "../unit-utils/dynamic-keys.js";
2
2
  import { memoizeLeak, memoizeWeak } from "@fibery/helpers/src/_";
3
- //#region src/field-utils/user-active.ts
3
+ // src/field-utils/user-active.ts
4
4
  const noUserActiveQueryPredicate = () => null;
5
5
  const getIsUserActiveQueryPredicate = memoizeWeak((typeObject) => {
6
6
  if (typeObject.name !== "fibery/user") return noUserActiveQueryPredicate;
@@ -20,5 +20,4 @@ const getIsUserActiveSelect = ({ typeObject, contextPath = [] }) => {
20
20
  const isUserActiveQueryPredicate = getIsUserActiveQueryPredicate(typeObject)(contextPath);
21
21
  return isUserActiveQueryPredicate ? { [isUserActiveQueryPredicate.key]: isUserActiveQueryPredicate.expression } : null;
22
22
  };
23
- //#endregion
24
23
  export { getIsUserActiveSelect };
@@ -1,8 +1,6 @@
1
1
  import { FieldObject } from "@fibery/schema";
2
- //#region src/field-utils/user-role.d.ts
3
2
  export declare const isUserRoleField: (fieldObject: FieldObject) => boolean;
4
3
  export declare const getUserRoleByKey: (roleKey: string) => {
5
4
  key: string;
6
5
  label: string;
7
- } | undefined;
8
- //#endregion
6
+ } | undefined;
@@ -1,4 +1,4 @@
1
- //#region src/field-utils/user-role.ts
1
+ // src/field-utils/user-role.ts
2
2
  const roles = [
3
3
  {
4
4
  key: "role/admin",
@@ -19,5 +19,4 @@ const roles = [
19
19
  ];
20
20
  const isUserRoleField = (fieldObject) => fieldObject.holderType === "fibery/user" && fieldObject.name === "fibery/role";
21
21
  const getUserRoleByKey = (roleKey) => roles.find(({ key }) => key === roleKey);
22
- //#endregion
23
22
  export { getUserRoleByKey, isUserRoleField };
@@ -1,7 +1,6 @@
1
1
  import { TypeObject } from "@fibery/schema";
2
2
  import { FiberyObject } from "@fibery/expression-utils/src/types";
3
3
  import { FieldExpression as FieldExpression$1 } from "@fibery/expression-utils";
4
- //#region src/field-utils/workflow.d.ts
5
4
  export declare function isWorkflowType(typeObject: TypeObject): boolean;
6
5
  export declare const getWorkflowFieldObject: (typeObject: TypeObject) => import("@fibery/schema").FieldObject | undefined;
7
6
  export declare const getIsFinalStateSelect: ({ typeObject, contextPath }: {
@@ -20,5 +19,4 @@ export declare function getWorkflowTypeSelect(typeObject: TypeObject): {
20
19
  "workflow/Type": string[];
21
20
  } | {
22
21
  "workflow/Type"?: undefined;
23
- };
24
- //#endregion
22
+ };
@@ -1,6 +1,6 @@
1
1
  import { isFinalStateDynamicKeyPrefix, makeDynamicKey } from "../unit-utils/dynamic-keys.js";
2
2
  import { memoizeLeak, memoizeWeak } from "@fibery/helpers/src/_";
3
- //#region src/field-utils/workflow.ts
3
+ // src/field-utils/workflow.ts
4
4
  function isWorkflowType(typeObject) {
5
5
  return typeObject.isEnum && typeObject.nameParts.namespace === "workflow";
6
6
  }
@@ -47,5 +47,4 @@ function getWorkflowTypeSelect(typeObject) {
47
47
  if (isWorkflowType(typeObject)) return { "workflow/Type": ["workflow/Type"] };
48
48
  return {};
49
49
  }
50
- //#endregion
51
50
  export { getIsFinalStateSelect, getIsInFinalState, getWorkflowFieldObject, getWorkflowTypeSelect, isWorkflowType };
package/lib/filter.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { Expression } from "@fibery/expression-utils/src/types";
2
- //#region src/filter.d.ts
3
2
  export type LogicalOperator = "or" | "and";
4
3
  export type FilterValue = {
5
4
  /** q/where expression like ["=", ["kanban/name"], "$where1"] **/
@@ -25,5 +24,4 @@ export type FilterGroup = FilterBase & {
25
24
  kind: "group";
26
25
  operator: LogicalOperator;
27
26
  value: Array<FilterGroup | Filter>;
28
- };
29
- //#endregion
27
+ };
package/lib/index.d.ts CHANGED
@@ -1,11 +1,10 @@
1
- import { InvalidMetaError } from "./errors.js";
2
- import { Unit } from "./units/types.js";
3
1
  import { UnitDefinitions, ViewRecord } from "./private/utils.js";
2
+ import { Unit } from "./units/types.js";
4
3
  import { deleteExpressionWithNotFoundFieldsOrTypesInSmartFolder, replaceIdsWithNamesInSmartFolder, replaceNamesWithIdsInSmartFolder } from "./private/smart-folder.js";
4
+ import { InvalidMetaError } from "./errors.js";
5
5
  import { assertMetaValid, isMetaValid } from "./meta-validation.js";
6
6
  import { FieldObject, Schema } from "@fibery/schema";
7
7
  import { FieldExpression } from "@fibery/expression-utils/src/types";
8
- //#region src/index.d.ts
9
8
  export declare const getViewCardTypes: <From extends string>({ "fibery/meta": { items } }: {
10
9
  "fibery/meta": {
11
10
  items: {
@@ -66,5 +65,4 @@ export declare const replaceIdsWithNamesInView: <V extends ViewRecord>(schema: S
66
65
  * `./private/map`), `enableHideWhenEmptyForCheckedEditableUnits` (`./private/timeline`).
67
66
  */
68
67
  export declare const migrateHideWhenEmptyToUnitsLevel: <V extends ViewRecord>(view: V) => V;
69
- //#endregion
70
68
  export { InvalidMetaError, assertMetaValid, deleteExpressionWithNotFoundFieldsOrTypesInSmartFolder, isMetaValid, replaceIdsWithNamesInSmartFolder, replaceNamesWithIdsInSmartFolder };
package/lib/index.js CHANGED
@@ -1,4 +1,3 @@
1
- import { InvalidMetaError } from "./errors.js";
2
1
  import { collectGarbage as collectGarbage$1, deleteExpressionWithNotFoundOrInvalidFieldsOrTypesInBoardView, enableHideWhenEmptyForCheckedEditableUnits, enableHideWhenEmptyForCovers, fixContextExpressionWithBrokenPath as fixContextExpressionWithBrokenPath$1, fixUserSelectedUnitsInBoardView, replaceIdsWithNamesInBoardView, replaceNamesWithIdsInBoardView } from "./private/board.js";
3
2
  import { collectGarbage as collectGarbage$2, deleteExpressionWithNotFoundFieldsOrTypesInCalendarView, enableHideWhenEmptyForCheckedUnits, fixContextExpressionWithBrokenPath as fixContextExpressionWithBrokenPath$2, fixUserSelectedUnitsInCalendarView, replaceIdsWithNamesInCalendarView, replaceNamesWithIdsInCalendarView } from "./private/calendar.js";
4
3
  import { collectGarbage as collectGarbage$3, deleteExpressionWithNotFoundFieldsOrTypesInFeedView, enableHideWhenEmptyForCheckedUnits as enableHideWhenEmptyForCheckedUnits$1, fixContextExpressionWithBrokenPath as fixContextExpressionWithBrokenPath$3, fixUserSelectedUnitsInFeedView, replaceIdsWithNamesInFeedView, replaceNamesWithIdsInFeedView } from "./private/feed.js";
@@ -6,8 +5,9 @@ import { deleteExpressionWithNotFoundFieldsOrTypesInFormView, replaceIdsWithName
6
5
  import { collectGarbage as collectGarbage$4, deleteExpressionWithNotFoundFieldsOrTypesInMapView, enableHideWhenEmptyForCheckedUnits as enableHideWhenEmptyForCheckedUnits$2, fixContextExpressionWithBrokenPath as fixContextExpressionWithBrokenPath$4, fixUserSelectedUnitsInMapView, replaceIdsWithNamesInMapView, replaceNamesWithIdsInMapView } from "./private/map.js";
7
6
  import { collectGarbage as collectGarbage$5, deleteExpressionWithNotFoundFieldsOrTypesInSmartFolder, enableHideWhenEmptyForCheckedUnits as enableHideWhenEmptyForCheckedUnits$3, fixContextExpressionWithBrokenPath as fixContextExpressionWithBrokenPath$5, fixUserSelectedUnitsInSmartFolder, replaceIdsWithNamesInSmartFolder, replaceNamesWithIdsInSmartFolder } from "./private/smart-folder.js";
8
7
  import { collectGarbage as collectGarbage$6, deleteExpressionWithNotFoundFieldsOrTypesInGanttView, deleteExpressionWithNotFoundFieldsOrTypesInTimelineView, enableHideWhenEmptyForCheckedEditableUnits as enableHideWhenEmptyForCheckedEditableUnits$1, fixContextExpressionWithBrokenPath as fixContextExpressionWithBrokenPath$6, fixUserSelectedUnitsInTimelineView, replaceIdsWithNamesInTimelineView, replaceNamesWithIdsInTimelineView } from "./private/timeline.js";
8
+ import { InvalidMetaError } from "./errors.js";
9
9
  import { assertMetaValid, isMetaValid } from "./meta-validation.js";
10
- //#region src/index.ts
10
+ // src/index.ts
11
11
  const getViewCardTypes = ({ "fibery/meta": { items } }) => items.map(({ query: { "q/from": type } }) => type);
12
12
  const loose = (converter) => converter;
13
13
  const looseView = (converter) => converter;
@@ -175,5 +175,4 @@ const migrateHideWhenEmptyToUnitsLevel = (view) => {
175
175
  default: return result;
176
176
  }
177
177
  };
178
- //#endregion
179
178
  export { InvalidMetaError, assertMetaValid, collectGarbage, deleteExpressionWithNotFoundFieldsOrTypesInSmartFolder, deleteExpressionWithNotFoundFieldsOrTypesInView, fixContextExpressionWithBrokenPath, fixUserSelectedUnits, getViewCardTypes, isMetaValid, migrateHideWhenEmptyToUnitsLevel, replaceIdsWithNamesInSmartFolder, replaceIdsWithNamesInView, replaceNamesWithIdsInSmartFolder, replaceNamesWithIdsInView };
@@ -1,4 +1,3 @@
1
- //#region src/meta-validation.d.ts
2
1
  /**
3
2
  * Validates meta payload for the view of given type.
4
3
  * Throws `InvalidMeta` if meta is not valid.
@@ -8,5 +7,4 @@ export declare const assertMetaValid: (type: string, meta: unknown) => void;
8
7
  /**
9
8
  * Returns true if meta is valid for given view type.
10
9
  */
11
- export declare const isMetaValid: (type: string, meta: unknown) => boolean;
12
- //#endregion
10
+ export declare const isMetaValid: (type: string, meta: unknown) => boolean;
@@ -1,7 +1,6 @@
1
1
  import { InvalidMetaError } from "./errors.js";
2
- import { isRecord } from "@fibery/helpers/src/_";
3
- import get from "lodash/get.js";
4
- //#region src/meta-validation.ts
2
+ import { isEmptyObject, isObjectLike, isPlainObject } from "@fibery/helpers/src/object";
3
+ // src/meta-validation.ts
5
4
  /**
6
5
  * Validates meta payload for the view of given type.
7
6
  * Throws `InvalidMeta` if meta is not valid.
@@ -22,16 +21,15 @@ const isMetaValid = (type, meta) => {
22
21
  throw err;
23
22
  }
24
23
  };
25
- const isEmptyObject = (m) => isRecord(m) && Object.keys(m).length === 0;
26
24
  const genericValidator = (m) => {
27
25
  if (m === null) return;
28
- const items = get(m, "items");
26
+ const items = isPlainObject(m) ? m.items : void 0;
29
27
  if (!Array.isArray(items)) throw new InvalidMetaError("expected fibery/meta.items to be an array");
30
28
  };
31
29
  const validators = /* @__PURE__ */ new Map([
32
30
  ["document", (m) => {
33
- if (m === null || m === void 0 || isEmptyObject(m)) return;
34
- if (typeof get(m, "documentSecret") !== "string") throw new InvalidMetaError("expected fibery/meta.documentSecret to be a string");
31
+ if (m === null || m === void 0 || isObjectLike(m) && isEmptyObject(m)) return;
32
+ if (!isPlainObject(m) || typeof m.documentSecret !== "string") throw new InvalidMetaError("expected fibery/meta.documentSecret to be a string");
35
33
  }],
36
34
  ["vizydrop/chart", () => {}],
37
35
  ["form", () => {}],
@@ -39,15 +37,12 @@ const validators = /* @__PURE__ */ new Map([
39
37
  ["tlcanvas", () => {}],
40
38
  ["spreadsheet", () => {}],
41
39
  ["thread", (m) => {
42
- if (isEmptyObject(m)) return;
43
- const id = get(m, "id");
44
- const typeId = get(m, "typeId");
45
- if (typeof id !== "string" || typeof typeId !== "string") throw new InvalidMetaError("expected fibery/meta.id and fibery/meta.typeId to be strings");
40
+ if (isObjectLike(m) && isEmptyObject(m)) return;
41
+ if (!isPlainObject(m) || typeof m.id !== "string" || typeof m.typeId !== "string") throw new InvalidMetaError("expected fibery/meta.id and fibery/meta.typeId to be strings");
46
42
  }],
47
43
  ["dashboard", () => {}],
48
44
  ["embed", () => {}],
49
45
  ["page", () => {}],
50
46
  ["custom-app", () => {}]
51
47
  ]);
52
- //#endregion
53
48
  export { assertMetaValid, isMetaValid };