@mongodb-js/compass-components 1.59.2 → 1.61.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 (138) hide show
  1. package/lib/components/accordion.d.ts.map +1 -1
  2. package/lib/components/accordion.js +3 -3
  3. package/lib/components/accordion.js.map +1 -1
  4. package/lib/components/actions/small-icon-button.js.map +1 -1
  5. package/lib/components/bson-value.d.ts.map +1 -1
  6. package/lib/components/bson-value.js +92 -3
  7. package/lib/components/bson-value.js.map +1 -1
  8. package/lib/components/compass-components-provider.d.ts +3 -1
  9. package/lib/components/compass-components-provider.d.ts.map +1 -1
  10. package/lib/components/compass-components-provider.js +18 -16
  11. package/lib/components/compass-components-provider.js.map +1 -1
  12. package/lib/components/context-menu.d.ts.map +1 -1
  13. package/lib/components/context-menu.js +6 -4
  14. package/lib/components/context-menu.js.map +1 -1
  15. package/lib/components/document-list/document-edit-actions-footer.d.ts +1 -1
  16. package/lib/components/document-list/document-edit-actions-footer.d.ts.map +1 -1
  17. package/lib/components/document-list/document-edit-actions-footer.js +28 -16
  18. package/lib/components/document-list/document-edit-actions-footer.js.map +1 -1
  19. package/lib/components/document-list/document.d.ts.map +1 -1
  20. package/lib/components/document-list/document.js +6 -14
  21. package/lib/components/document-list/document.js.map +1 -1
  22. package/lib/components/document-list/element.d.ts.map +1 -1
  23. package/lib/components/document-list/element.js +13 -14
  24. package/lib/components/document-list/element.js.map +1 -1
  25. package/lib/components/document-list/legacy-uuid-format-context.d.ts +4 -0
  26. package/lib/components/document-list/legacy-uuid-format-context.d.ts.map +1 -0
  27. package/lib/components/document-list/legacy-uuid-format-context.js +10 -0
  28. package/lib/components/document-list/legacy-uuid-format-context.js.map +1 -0
  29. package/lib/components/drawer-portal.d.ts.map +1 -1
  30. package/lib/components/drawer-portal.js +17 -7
  31. package/lib/components/drawer-portal.js.map +1 -1
  32. package/lib/components/file-picker-dialog.d.ts.map +1 -1
  33. package/lib/components/file-picker-dialog.js +10 -5
  34. package/lib/components/file-picker-dialog.js.map +1 -1
  35. package/lib/components/file-selector.d.ts.map +1 -1
  36. package/lib/components/file-selector.js +5 -3
  37. package/lib/components/file-selector.js.map +1 -1
  38. package/lib/components/guide-cue/guide-cue-service.d.ts +1 -1
  39. package/lib/components/guide-cue/guide-cue-service.d.ts.map +1 -1
  40. package/lib/components/guide-cue/guide-cue-service.js +1 -1
  41. package/lib/components/guide-cue/guide-cue-service.js.map +1 -1
  42. package/lib/components/guide-cue/guide-cue-storage.d.ts.map +1 -1
  43. package/lib/components/guide-cue/guide-cue-storage.js.map +1 -1
  44. package/lib/components/guide-cue/guide-cue.d.ts.map +1 -1
  45. package/lib/components/guide-cue/guide-cue.js +5 -4
  46. package/lib/components/guide-cue/guide-cue.js.map +1 -1
  47. package/lib/components/interactive-popover.d.ts.map +1 -1
  48. package/lib/components/interactive-popover.js +2 -0
  49. package/lib/components/interactive-popover.js.map +1 -1
  50. package/lib/components/leafygreen.d.ts +10 -7
  51. package/lib/components/leafygreen.d.ts.map +1 -1
  52. package/lib/components/leafygreen.js +15 -12
  53. package/lib/components/leafygreen.js.map +1 -1
  54. package/lib/components/loader.d.ts +7 -3
  55. package/lib/components/loader.d.ts.map +1 -1
  56. package/lib/components/loader.js +19 -2
  57. package/lib/components/loader.js.map +1 -1
  58. package/lib/components/modals/confirmation-modal.d.ts +3 -1
  59. package/lib/components/modals/confirmation-modal.d.ts.map +1 -1
  60. package/lib/components/modals/confirmation-modal.js.map +1 -1
  61. package/lib/components/modals/info-modal.js +1 -1
  62. package/lib/components/modals/info-modal.js.map +1 -1
  63. package/lib/components/modals/marketing-modal.d.ts +3 -1
  64. package/lib/components/modals/marketing-modal.d.ts.map +1 -1
  65. package/lib/components/modals/marketing-modal.js.map +1 -1
  66. package/lib/components/modals/modal-footer-button.js +3 -3
  67. package/lib/components/modals/modal-footer-button.js.map +1 -1
  68. package/lib/components/modals/modal.d.ts +1 -1
  69. package/lib/components/modals/modal.d.ts.map +1 -1
  70. package/lib/components/modals/modal.js +14 -25
  71. package/lib/components/modals/modal.js.map +1 -1
  72. package/lib/components/resize-handle.d.ts +6 -5
  73. package/lib/components/resize-handle.d.ts.map +1 -1
  74. package/lib/components/resize-handle.js +10 -10
  75. package/lib/components/resize-handle.js.map +1 -1
  76. package/lib/components/signal-popover.d.ts.map +1 -1
  77. package/lib/components/signal-popover.js +10 -7
  78. package/lib/components/signal-popover.js.map +1 -1
  79. package/lib/components/virtual-grid.d.ts.map +1 -1
  80. package/lib/components/virtual-grid.js +4 -1
  81. package/lib/components/virtual-grid.js.map +1 -1
  82. package/lib/components/workspace-container.d.ts.map +1 -1
  83. package/lib/components/workspace-container.js +7 -4
  84. package/lib/components/workspace-container.js.map +1 -1
  85. package/lib/components/workspace-tabs/workspace-tabs.d.ts.map +1 -1
  86. package/lib/components/workspace-tabs/workspace-tabs.js +4 -4
  87. package/lib/components/workspace-tabs/workspace-tabs.js.map +1 -1
  88. package/lib/hooks/use-confirmation.d.ts +1 -3
  89. package/lib/hooks/use-confirmation.d.ts.map +1 -1
  90. package/lib/hooks/use-confirmation.js +17 -9
  91. package/lib/hooks/use-confirmation.js.map +1 -1
  92. package/lib/hooks/use-current-value-ref.d.ts +10 -0
  93. package/lib/hooks/use-current-value-ref.d.ts.map +1 -0
  94. package/lib/hooks/use-current-value-ref.js +24 -0
  95. package/lib/hooks/use-current-value-ref.js.map +1 -0
  96. package/lib/hooks/use-error-details.d.ts.map +1 -1
  97. package/lib/hooks/use-error-details.js +1 -5
  98. package/lib/hooks/use-error-details.js.map +1 -1
  99. package/lib/hooks/use-focus-hover.d.ts +8 -7
  100. package/lib/hooks/use-focus-hover.d.ts.map +1 -1
  101. package/lib/hooks/use-focus-hover.js +15 -16
  102. package/lib/hooks/use-focus-hover.js.map +1 -1
  103. package/lib/hooks/use-formatted-date.d.ts.map +1 -1
  104. package/lib/hooks/use-formatted-date.js +4 -1
  105. package/lib/hooks/use-formatted-date.js.map +1 -1
  106. package/lib/hooks/use-initial-value.d.ts +10 -0
  107. package/lib/hooks/use-initial-value.d.ts.map +1 -0
  108. package/lib/hooks/use-initial-value.js +17 -0
  109. package/lib/hooks/use-initial-value.js.map +1 -0
  110. package/lib/hooks/use-persisted-state.js +1 -1
  111. package/lib/hooks/use-persisted-state.js.map +1 -1
  112. package/lib/hooks/use-scrollbars.d.ts +1 -1
  113. package/lib/hooks/use-scrollbars.d.ts.map +1 -1
  114. package/lib/hooks/use-scrollbars.js.map +1 -1
  115. package/lib/hooks/use-sync-state-on-prop-change.d.ts +12 -0
  116. package/lib/hooks/use-sync-state-on-prop-change.d.ts.map +1 -0
  117. package/lib/hooks/use-sync-state-on-prop-change.js +26 -0
  118. package/lib/hooks/use-sync-state-on-prop-change.js.map +1 -0
  119. package/lib/hooks/use-theme.d.ts +7 -6
  120. package/lib/hooks/use-theme.d.ts.map +1 -1
  121. package/lib/hooks/use-theme.js +7 -7
  122. package/lib/hooks/use-theme.js.map +1 -1
  123. package/lib/hooks/use-toast.d.ts.map +1 -1
  124. package/lib/hooks/use-toast.js +9 -8
  125. package/lib/hooks/use-toast.js.map +1 -1
  126. package/lib/index.d.ts +7 -4
  127. package/lib/index.d.ts.map +1 -1
  128. package/lib/index.js +13 -9
  129. package/lib/index.js.map +1 -1
  130. package/package.json +53 -51
  131. package/lib/components/content-with-fallback.d.ts +0 -18
  132. package/lib/components/content-with-fallback.d.ts.map +0 -1
  133. package/lib/components/content-with-fallback.js +0 -134
  134. package/lib/components/content-with-fallback.js.map +0 -1
  135. package/lib/components/document-list/use-previous.d.ts +0 -2
  136. package/lib/components/document-list/use-previous.d.ts.map +0 -1
  137. package/lib/components/document-list/use-previous.js +0 -12
  138. package/lib/components/document-list/use-previous.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mongodb-js/compass-components",
3
- "version": "1.59.2",
3
+ "version": "1.61.0",
4
4
  "description": "React Components used in Compass",
5
5
  "license": "SSPL",
6
6
  "main": "lib/index.js",
@@ -35,67 +35,69 @@
35
35
  "@dnd-kit/core": "^6.0.7",
36
36
  "@dnd-kit/sortable": "^7.0.2",
37
37
  "@dnd-kit/utilities": "^3.2.1",
38
- "@leafygreen-ui/avatar": "^3.1.5",
38
+ "@leafygreen-ui/avatar": "^3.2.0",
39
39
  "@leafygreen-ui/badge": "^10.2.3",
40
- "@leafygreen-ui/banner": "^10.2.3",
40
+ "@leafygreen-ui/banner": "^10.2.4",
41
41
  "@leafygreen-ui/button": "^25.1.3",
42
- "@leafygreen-ui/card": "^13.2.1",
43
- "@leafygreen-ui/checkbox": "^18.1.3",
44
- "@leafygreen-ui/chip": "^4.0.9",
45
- "@leafygreen-ui/code": "^20.2.3",
46
- "@leafygreen-ui/combobox": "^12.2.1",
47
- "@leafygreen-ui/confirmation-modal": "^8.0.0",
48
- "@leafygreen-ui/copyable": "^12.0.1",
49
- "@leafygreen-ui/drawer": "^5.1.3",
50
- "@leafygreen-ui/emotion": "^5.1.0",
51
- "@leafygreen-ui/guide-cue": "^8.1.1",
42
+ "@leafygreen-ui/card": "^13.3.0",
43
+ "@leafygreen-ui/checkbox": "^18.1.4",
44
+ "@leafygreen-ui/chip": "^4.0.10",
45
+ "@leafygreen-ui/code": "^20.2.5",
46
+ "@leafygreen-ui/combobox": "^12.3.0",
47
+ "@leafygreen-ui/confirmation-modal": "^10.3.0",
48
+ "@leafygreen-ui/copyable": "^12.0.2",
49
+ "@leafygreen-ui/drawer": "^5.2.1",
50
+ "@leafygreen-ui/emotion": "^5.2.0",
51
+ "@leafygreen-ui/guide-cue": "^8.2.0",
52
52
  "@leafygreen-ui/hooks": "^9.3.0",
53
- "@leafygreen-ui/icon": "^14.7.0",
54
- "@leafygreen-ui/icon-button": "^17.1.3",
55
- "@leafygreen-ui/info-sprinkle": "^5.0.9",
56
- "@leafygreen-ui/input-option": "^4.1.3",
53
+ "@leafygreen-ui/icon": "^14.8.0",
54
+ "@leafygreen-ui/icon-button": "^17.1.4",
55
+ "@leafygreen-ui/info-sprinkle": "^5.0.10",
56
+ "@leafygreen-ui/input-option": "^4.1.4",
57
57
  "@leafygreen-ui/leafygreen-provider": "^5.0.4",
58
58
  "@leafygreen-ui/logo": "^11.1.0",
59
- "@leafygreen-ui/marketing-modal": "^6.0.0",
60
- "@leafygreen-ui/menu": "^33.0.1",
61
- "@leafygreen-ui/modal": "^18.0.0",
59
+ "@leafygreen-ui/marketing-modal": "^8.1.7",
60
+ "@leafygreen-ui/menu": "^33.1.0",
61
+ "@leafygreen-ui/modal": "^21.0.0",
62
62
  "@leafygreen-ui/palette": "^5.0.2",
63
- "@leafygreen-ui/pipeline": "^8.0.8",
63
+ "@leafygreen-ui/pipeline": "^8.0.9",
64
64
  "@leafygreen-ui/polymorphic": "^3.1.0",
65
65
  "@leafygreen-ui/popover": "^14.3.1",
66
66
  "@leafygreen-ui/portal": "^7.1.0",
67
+ "@leafygreen-ui/progress-bar": "^1.0.7",
67
68
  "@leafygreen-ui/radio-box-group": "^15.0.10",
68
- "@leafygreen-ui/radio-group": "^13.0.10",
69
- "@leafygreen-ui/search-input": "^6.1.1",
70
- "@leafygreen-ui/segmented-control": "^11.0.11",
71
- "@leafygreen-ui/select": "^17.0.1",
72
- "@leafygreen-ui/skeleton-loader": "^3.0.9",
73
- "@leafygreen-ui/split-button": "^6.1.7",
74
- "@leafygreen-ui/table": "^15.2.1",
75
- "@leafygreen-ui/tabs": "^17.0.7",
76
- "@leafygreen-ui/text-area": "^12.1.3",
77
- "@leafygreen-ui/text-input": "^16.2.1",
78
- "@leafygreen-ui/toast": "^8.1.1",
79
- "@leafygreen-ui/toggle": "^12.1.3",
80
- "@leafygreen-ui/tokens": "^4.0.0",
81
- "@leafygreen-ui/tooltip": "^14.2.3",
82
- "@leafygreen-ui/typography": "^22.2.2",
83
- "@lg-chat/chat-window": "^4.1.5",
84
- "@lg-chat/input-bar": "^10.1.0",
85
- "@lg-chat/leafygreen-chat-provider": "^5.0.2",
86
- "@lg-chat/message": "^8.2.0",
87
- "@mongodb-js/compass-context-menu": "^0.3.1",
88
- "@mongodb-js/diagramming": "^2.2.1",
69
+ "@leafygreen-ui/radio-group": "^13.0.11",
70
+ "@leafygreen-ui/search-input": "^6.1.2",
71
+ "@leafygreen-ui/segmented-control": "^11.0.12",
72
+ "@leafygreen-ui/select": "^17.0.2",
73
+ "@leafygreen-ui/skeleton-loader": "^3.0.10",
74
+ "@leafygreen-ui/split-button": "^6.3.0",
75
+ "@leafygreen-ui/table": "^15.2.2",
76
+ "@leafygreen-ui/tabs": "^17.0.9",
77
+ "@leafygreen-ui/text-area": "^12.1.4",
78
+ "@leafygreen-ui/text-input": "^16.2.2",
79
+ "@leafygreen-ui/toast": "^8.1.2",
80
+ "@leafygreen-ui/toggle": "^12.1.4",
81
+ "@leafygreen-ui/tokens": "^4.2.1",
82
+ "@leafygreen-ui/tooltip": "^14.3.0",
83
+ "@leafygreen-ui/typography": "^22.2.3",
84
+ "@lg-chat/chat-window": "^6.0.0",
85
+ "@lg-chat/input-bar": "^12.1.0",
86
+ "@lg-chat/leafygreen-chat-provider": "^6.0.0",
87
+ "@lg-chat/message": "^10.1.1",
88
+ "@lg-chat/message-prompts": "^4.2.0",
89
+ "@mongodb-js/compass-context-menu": "^0.3.3",
90
+ "@mongodb-js/diagramming": "^2.3.1",
89
91
  "@react-aria/interactions": "^3.9.1",
90
92
  "@react-aria/utils": "^3.13.1",
91
93
  "@react-aria/visually-hidden": "^3.3.1",
92
94
  "bson": "^6.10.4",
93
95
  "focus-trap-react": "^9.0.2",
94
- "hadron-document": "^8.10.5",
95
- "hadron-type-checker": "^7.4.23",
96
+ "hadron-document": "^8.10.7",
97
+ "hadron-type-checker": "^7.4.25",
96
98
  "is-electron-renderer": "^2.0.1",
97
99
  "lodash": "^4.17.21",
98
- "mongodb-query-util": "^2.5.12",
100
+ "mongodb-query-util": "^2.5.14",
99
101
  "polished": "^4.2.2",
100
102
  "react": "^17.0.2",
101
103
  "react-dom": "^17.0.2",
@@ -106,12 +108,12 @@
106
108
  },
107
109
  "devDependencies": {
108
110
  "@emotion/css": "^11.13.5",
109
- "@leafygreen-ui/lib": "^15.6.2",
110
- "@mongodb-js/eslint-config-compass": "^1.4.12",
111
- "@mongodb-js/mocha-config-compass": "^1.7.2",
111
+ "@leafygreen-ui/lib": "^15.7.0",
112
+ "@mongodb-js/eslint-config-compass": "^1.4.14",
113
+ "@mongodb-js/mocha-config-compass": "^1.7.4",
112
114
  "@mongodb-js/prettier-config-compass": "^1.2.9",
113
- "@mongodb-js/testing-library-compass": "^1.4.0",
114
- "@mongodb-js/tsconfig-compass": "^1.2.12",
115
+ "@mongodb-js/testing-library-compass": "^1.4.2",
116
+ "@mongodb-js/tsconfig-compass": "^1.2.13",
115
117
  "@types/chai": "^4.2.21",
116
118
  "@types/chai-dom": "^0.0.10",
117
119
  "@types/mocha": "^9.0.0",
@@ -130,5 +132,5 @@
130
132
  "publishConfig": {
131
133
  "access": "public"
132
134
  },
133
- "gitHead": "0c77f94e4b5fdc7cced137413f5361f863adf7c3"
135
+ "gitHead": "accb077ba72adb432ec50d7a7919177e8f5a9faa"
134
136
  }
@@ -1,18 +0,0 @@
1
- import React from 'react';
2
- export declare const ContentWithFallback: React.FunctionComponent<{
3
- content(shouldRender: boolean, shouldAnimate: boolean): React.ReactElement | boolean | null;
4
- fallback(shouldRender: boolean): React.ReactElement | boolean | null;
5
- isContentReady: boolean;
6
- contentAfterFallbackTimeout?: number;
7
- fallbackTimeout?: number;
8
- }>;
9
- type FadeInPlaceholderProps = {
10
- isContentReady: boolean;
11
- content(): React.ReactElement | boolean | null;
12
- fallback(): React.ReactElement | boolean | null;
13
- contentContainerProps?: React.HTMLProps<HTMLDivElement>;
14
- fallbackContainerProps?: React.HTMLProps<HTMLDivElement>;
15
- };
16
- export declare const FadeInPlaceholder: React.FunctionComponent<FadeInPlaceholderProps & Omit<React.HTMLProps<HTMLDivElement>, keyof FadeInPlaceholderProps>>;
17
- export {};
18
- //# sourceMappingURL=content-with-fallback.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"content-with-fallback.d.ts","sourceRoot":"","sources":["../../src/components/content-with-fallback.tsx"],"names":[],"mappings":"AACA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAuDnD,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,iBAAiB,CAAC;IACxD,OAAO,CACL,YAAY,EAAE,OAAO,EACrB,aAAa,EAAE,OAAO,GACrB,KAAK,CAAC,YAAY,GAAG,OAAO,GAAG,IAAI,CAAC;IACvC,QAAQ,CAAC,YAAY,EAAE,OAAO,GAAG,KAAK,CAAC,YAAY,GAAG,OAAO,GAAG,IAAI,CAAC;IACrE,cAAc,EAAE,OAAO,CAAC;IACxB,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAqBA,CAAC;AAqCF,KAAK,sBAAsB,GAAG;IAC5B,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,IAAI,KAAK,CAAC,YAAY,GAAG,OAAO,GAAG,IAAI,CAAC;IAC/C,QAAQ,IAAI,KAAK,CAAC,YAAY,GAAG,OAAO,GAAG,IAAI,CAAC;IAChD,qBAAqB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IACxD,sBAAsB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;CAC1D,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,iBAAiB,CACrD,sBAAsB,GACpB,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,EAAE,MAAM,sBAAsB,CAAC,CA+CtE,CAAC"}
@@ -1,134 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.FadeInPlaceholder = exports.ContentWithFallback = void 0;
37
- /* eslint-disable react/prop-types */
38
- const react_1 = __importStar(require("react"));
39
- const emotion_1 = require("@leafygreen-ui/emotion");
40
- var RenderStatus;
41
- (function (RenderStatus) {
42
- RenderStatus["Nothing"] = "Nothing";
43
- RenderStatus["Fallback"] = "Fallback";
44
- RenderStatus["Content"] = "Content";
45
- // If content is appearing after fallback was displayed, we want to signal
46
- // this so that content might want to animate the transition
47
- RenderStatus["ContentAnimated"] = "ContentAnimated";
48
- })(RenderStatus || (RenderStatus = {}));
49
- function isContent(status) {
50
- return [RenderStatus.ContentAnimated, RenderStatus.Content].includes(status);
51
- }
52
- function useRenderWithFallback(isContentReady, { contentAfterFallbackTimeout = 200, fallbackTimeout = 30 } = {}) {
53
- const [renderStatus, setRenderStatus] = (0, react_1.useState)(isContentReady ? RenderStatus.Content : RenderStatus.Nothing);
54
- (0, react_1.useEffect)(() => {
55
- if (isContent(renderStatus)) {
56
- return;
57
- }
58
- if (isContentReady && renderStatus === RenderStatus.Nothing) {
59
- setRenderStatus(RenderStatus.Content);
60
- return;
61
- }
62
- if (isContentReady && renderStatus === RenderStatus.Fallback) {
63
- const timeout = setTimeout(() => {
64
- setRenderStatus(RenderStatus.ContentAnimated);
65
- }, contentAfterFallbackTimeout);
66
- return () => {
67
- clearTimeout(timeout);
68
- };
69
- }
70
- if (!isContentReady && renderStatus === RenderStatus.Nothing) {
71
- const timeout = setTimeout(() => {
72
- setRenderStatus(RenderStatus.Fallback);
73
- }, fallbackTimeout);
74
- return () => {
75
- clearTimeout(timeout);
76
- };
77
- }
78
- }, [
79
- renderStatus,
80
- isContentReady,
81
- contentAfterFallbackTimeout,
82
- fallbackTimeout,
83
- ]);
84
- return renderStatus;
85
- }
86
- const ContentWithFallback = ({ content, fallback, isContentReady, contentAfterFallbackTimeout, fallbackTimeout, }) => {
87
- const renderStatus = useRenderWithFallback(isContentReady, {
88
- contentAfterFallbackTimeout,
89
- fallbackTimeout,
90
- });
91
- return (react_1.default.createElement(react_1.default.Fragment, null,
92
- content(isContent(renderStatus), renderStatus === RenderStatus.ContentAnimated),
93
- fallback(renderStatus === RenderStatus.Fallback)));
94
- };
95
- exports.ContentWithFallback = ContentWithFallback;
96
- const contentWithFallbackContainer = (0, emotion_1.css)({
97
- position: 'relative',
98
- });
99
- const fadeInAnimation = (0, emotion_1.keyframes)({
100
- from: {
101
- opacity: 0,
102
- },
103
- to: {
104
- opacity: 1,
105
- },
106
- });
107
- const contentContainer = (0, emotion_1.css)({
108
- position: 'relative',
109
- });
110
- const contentContainerFadeIn = (0, emotion_1.css)({
111
- animation: `${fadeInAnimation} .16s ease-out`,
112
- });
113
- const fallbackContainer = (0, emotion_1.css)({
114
- position: 'absolute',
115
- top: 0,
116
- right: 0,
117
- bottom: 0,
118
- left: 0,
119
- pointerEvents: 'none',
120
- display: 'none',
121
- });
122
- const fallbackContainerVisible = (0, emotion_1.css)({
123
- display: 'block',
124
- });
125
- const FadeInPlaceholder = ({ content, fallback, isContentReady, contentContainerProps = {}, fallbackContainerProps = {}, className, ...props }) => {
126
- return (react_1.default.createElement("div", { className: (0, emotion_1.cx)(contentWithFallbackContainer, className), ...props },
127
- react_1.default.createElement(exports.ContentWithFallback, { isContentReady: isContentReady, content: (shouldRender, shouldAnimate) => {
128
- return (shouldRender && (react_1.default.createElement("div", { ...contentContainerProps, className: (0, emotion_1.cx)(contentContainer, shouldAnimate && contentContainerFadeIn, contentContainerProps.className) }, content())));
129
- }, fallback: (shouldRender) => {
130
- return (react_1.default.createElement("div", { ...fallbackContainerProps, className: (0, emotion_1.cx)(fallbackContainer, shouldRender && fallbackContainerVisible, fallbackContainerProps.className) }, fallback()));
131
- } })));
132
- };
133
- exports.FadeInPlaceholder = FadeInPlaceholder;
134
- //# sourceMappingURL=content-with-fallback.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"content-with-fallback.js","sourceRoot":"","sources":["../../src/components/content-with-fallback.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAqC;AACrC,+CAAmD;AACnD,oDAA4D;AAE5D,IAAK,YAOJ;AAPD,WAAK,YAAY;IACf,mCAAmB,CAAA;IACnB,qCAAqB,CAAA;IACrB,mCAAmB,CAAA;IACnB,0EAA0E;IAC1E,4DAA4D;IAC5D,mDAAmC,CAAA;AACrC,CAAC,EAPI,YAAY,KAAZ,YAAY,QAOhB;AACD,SAAS,SAAS,CAAC,MAAoB;IACrC,OAAO,CAAC,YAAY,CAAC,eAAe,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC/E,CAAC;AACD,SAAS,qBAAqB,CAC5B,cAAuB,EACvB,EAAE,2BAA2B,GAAG,GAAG,EAAE,eAAe,GAAG,EAAE,EAAE,GAAG,EAAE;IAEhE,MAAM,CAAC,YAAY,EAAE,eAAe,C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A,YAAE,EAAC,4BAA4B,EAAE,SAAS,CAAC,KAAM,KAAK;QACpE,8BAAC,2BAAmB,IAClB,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,CAAC,YAAY,EAAE,aAAa,EAAE,EAAE;gBACvC,OAAO,CACL,YAAY,IAAI,CACd,0CACM,qBAAqB,EACzB,SAAS,EAAE,IAAA,YAAE,EACX,gBAAgB,EAChB,aAAa,IAAI,sBAAsB,EACvC,qBAAqB,CAAC,SAAS,CAChC,IAEA,OAAO,EAAE,CACN,CACP,CACF,CAAC;YACJ,CAAC,EACD,QAAQ,EAAE,CAAC,YAAY,EAAE,EAAE;gBACzB,OAAO,CACL,0CACM,sBAAsB,EAC1B,SAAS,EAAE,IAAA,YAAE,EACX,iBAAiB,EACjB,YAAY,IAAI,wBAAwB,EACxC,sBAAsB,CAAC,SAAS,CACjC,IAEA,QAAQ,EAAE,CACP,CACP,CAAC;YACJ,CAAC,GACoB,CACnB,CACP,CAAC;AACJ,CAAC,CAAC;AAjDW,QAAA,iBAAiB,qBAiD5B"}
@@ -1,2 +0,0 @@
1
- export declare function usePrevious<T>(value: T): T | undefined;
2
- //# sourceMappingURL=use-previous.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-previous.d.ts","sourceRoot":"","sources":["../../../src/components/document-list/use-previous.tsx"],"names":[],"mappings":"AAEA,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS,CAMtD"}
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.usePrevious = usePrevious;
4
- const react_1 = require("react");
5
- function usePrevious(value) {
6
- const ref = (0, react_1.useRef)();
7
- (0, react_1.useEffect)(() => {
8
- ref.current = value;
9
- }, [value]);
10
- return ref.current;
11
- }
12
- //# sourceMappingURL=use-previous.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-previous.js","sourceRoot":"","sources":["../../../src/components/document-list/use-previous.tsx"],"names":[],"mappings":";;AAEA,kCAMC;AARD,iCAA0C;AAE1C,SAAgB,WAAW,CAAI,KAAQ;IACrC,MAAM,GAAG,GAAG,IAAA,cAAM,GAAiB,CAAC;IACpC,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC;IACtB,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IACZ,OAAO,GAAG,CAAC,OAAO,CAAC;AACrB,CAAC"}