@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.
- package/lib/components/accordion.d.ts.map +1 -1
- package/lib/components/accordion.js +3 -3
- package/lib/components/accordion.js.map +1 -1
- package/lib/components/actions/small-icon-button.js.map +1 -1
- package/lib/components/bson-value.d.ts.map +1 -1
- package/lib/components/bson-value.js +92 -3
- package/lib/components/bson-value.js.map +1 -1
- package/lib/components/compass-components-provider.d.ts +3 -1
- package/lib/components/compass-components-provider.d.ts.map +1 -1
- package/lib/components/compass-components-provider.js +18 -16
- package/lib/components/compass-components-provider.js.map +1 -1
- package/lib/components/context-menu.d.ts.map +1 -1
- package/lib/components/context-menu.js +6 -4
- package/lib/components/context-menu.js.map +1 -1
- package/lib/components/document-list/document-edit-actions-footer.d.ts +1 -1
- package/lib/components/document-list/document-edit-actions-footer.d.ts.map +1 -1
- package/lib/components/document-list/document-edit-actions-footer.js +28 -16
- package/lib/components/document-list/document-edit-actions-footer.js.map +1 -1
- package/lib/components/document-list/document.d.ts.map +1 -1
- package/lib/components/document-list/document.js +6 -14
- package/lib/components/document-list/document.js.map +1 -1
- package/lib/components/document-list/element.d.ts.map +1 -1
- package/lib/components/document-list/element.js +13 -14
- package/lib/components/document-list/element.js.map +1 -1
- package/lib/components/document-list/legacy-uuid-format-context.d.ts +4 -0
- package/lib/components/document-list/legacy-uuid-format-context.d.ts.map +1 -0
- package/lib/components/document-list/legacy-uuid-format-context.js +10 -0
- package/lib/components/document-list/legacy-uuid-format-context.js.map +1 -0
- package/lib/components/drawer-portal.d.ts.map +1 -1
- package/lib/components/drawer-portal.js +17 -7
- package/lib/components/drawer-portal.js.map +1 -1
- package/lib/components/file-picker-dialog.d.ts.map +1 -1
- package/lib/components/file-picker-dialog.js +10 -5
- package/lib/components/file-picker-dialog.js.map +1 -1
- package/lib/components/file-selector.d.ts.map +1 -1
- package/lib/components/file-selector.js +5 -3
- package/lib/components/file-selector.js.map +1 -1
- package/lib/components/guide-cue/guide-cue-service.d.ts +1 -1
- package/lib/components/guide-cue/guide-cue-service.d.ts.map +1 -1
- package/lib/components/guide-cue/guide-cue-service.js +1 -1
- package/lib/components/guide-cue/guide-cue-service.js.map +1 -1
- package/lib/components/guide-cue/guide-cue-storage.d.ts.map +1 -1
- package/lib/components/guide-cue/guide-cue-storage.js.map +1 -1
- package/lib/components/guide-cue/guide-cue.d.ts.map +1 -1
- package/lib/components/guide-cue/guide-cue.js +5 -4
- package/lib/components/guide-cue/guide-cue.js.map +1 -1
- package/lib/components/interactive-popover.d.ts.map +1 -1
- package/lib/components/interactive-popover.js +2 -0
- package/lib/components/interactive-popover.js.map +1 -1
- package/lib/components/leafygreen.d.ts +10 -7
- package/lib/components/leafygreen.d.ts.map +1 -1
- package/lib/components/leafygreen.js +15 -12
- package/lib/components/leafygreen.js.map +1 -1
- package/lib/components/loader.d.ts +7 -3
- package/lib/components/loader.d.ts.map +1 -1
- package/lib/components/loader.js +19 -2
- package/lib/components/loader.js.map +1 -1
- package/lib/components/modals/confirmation-modal.d.ts +3 -1
- package/lib/components/modals/confirmation-modal.d.ts.map +1 -1
- package/lib/components/modals/confirmation-modal.js.map +1 -1
- package/lib/components/modals/info-modal.js +1 -1
- package/lib/components/modals/info-modal.js.map +1 -1
- package/lib/components/modals/marketing-modal.d.ts +3 -1
- package/lib/components/modals/marketing-modal.d.ts.map +1 -1
- package/lib/components/modals/marketing-modal.js.map +1 -1
- package/lib/components/modals/modal-footer-button.js +3 -3
- package/lib/components/modals/modal-footer-button.js.map +1 -1
- package/lib/components/modals/modal.d.ts +1 -1
- package/lib/components/modals/modal.d.ts.map +1 -1
- package/lib/components/modals/modal.js +14 -25
- package/lib/components/modals/modal.js.map +1 -1
- package/lib/components/resize-handle.d.ts +6 -5
- package/lib/components/resize-handle.d.ts.map +1 -1
- package/lib/components/resize-handle.js +10 -10
- package/lib/components/resize-handle.js.map +1 -1
- package/lib/components/signal-popover.d.ts.map +1 -1
- package/lib/components/signal-popover.js +10 -7
- package/lib/components/signal-popover.js.map +1 -1
- package/lib/components/virtual-grid.d.ts.map +1 -1
- package/lib/components/virtual-grid.js +4 -1
- package/lib/components/virtual-grid.js.map +1 -1
- package/lib/components/workspace-container.d.ts.map +1 -1
- package/lib/components/workspace-container.js +7 -4
- package/lib/components/workspace-container.js.map +1 -1
- package/lib/components/workspace-tabs/workspace-tabs.d.ts.map +1 -1
- package/lib/components/workspace-tabs/workspace-tabs.js +4 -4
- package/lib/components/workspace-tabs/workspace-tabs.js.map +1 -1
- package/lib/hooks/use-confirmation.d.ts +1 -3
- package/lib/hooks/use-confirmation.d.ts.map +1 -1
- package/lib/hooks/use-confirmation.js +17 -9
- package/lib/hooks/use-confirmation.js.map +1 -1
- package/lib/hooks/use-current-value-ref.d.ts +10 -0
- package/lib/hooks/use-current-value-ref.d.ts.map +1 -0
- package/lib/hooks/use-current-value-ref.js +24 -0
- package/lib/hooks/use-current-value-ref.js.map +1 -0
- package/lib/hooks/use-error-details.d.ts.map +1 -1
- package/lib/hooks/use-error-details.js +1 -5
- package/lib/hooks/use-error-details.js.map +1 -1
- package/lib/hooks/use-focus-hover.d.ts +8 -7
- package/lib/hooks/use-focus-hover.d.ts.map +1 -1
- package/lib/hooks/use-focus-hover.js +15 -16
- package/lib/hooks/use-focus-hover.js.map +1 -1
- package/lib/hooks/use-formatted-date.d.ts.map +1 -1
- package/lib/hooks/use-formatted-date.js +4 -1
- package/lib/hooks/use-formatted-date.js.map +1 -1
- package/lib/hooks/use-initial-value.d.ts +10 -0
- package/lib/hooks/use-initial-value.d.ts.map +1 -0
- package/lib/hooks/use-initial-value.js +17 -0
- package/lib/hooks/use-initial-value.js.map +1 -0
- package/lib/hooks/use-persisted-state.js +1 -1
- package/lib/hooks/use-persisted-state.js.map +1 -1
- package/lib/hooks/use-scrollbars.d.ts +1 -1
- package/lib/hooks/use-scrollbars.d.ts.map +1 -1
- package/lib/hooks/use-scrollbars.js.map +1 -1
- package/lib/hooks/use-sync-state-on-prop-change.d.ts +12 -0
- package/lib/hooks/use-sync-state-on-prop-change.d.ts.map +1 -0
- package/lib/hooks/use-sync-state-on-prop-change.js +26 -0
- package/lib/hooks/use-sync-state-on-prop-change.js.map +1 -0
- package/lib/hooks/use-theme.d.ts +7 -6
- package/lib/hooks/use-theme.d.ts.map +1 -1
- package/lib/hooks/use-theme.js +7 -7
- package/lib/hooks/use-theme.js.map +1 -1
- package/lib/hooks/use-toast.d.ts.map +1 -1
- package/lib/hooks/use-toast.js +9 -8
- package/lib/hooks/use-toast.js.map +1 -1
- package/lib/index.d.ts +7 -4
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +13 -9
- package/lib/index.js.map +1 -1
- package/package.json +53 -51
- package/lib/components/content-with-fallback.d.ts +0 -18
- package/lib/components/content-with-fallback.d.ts.map +0 -1
- package/lib/components/content-with-fallback.js +0 -134
- package/lib/components/content-with-fallback.js.map +0 -1
- package/lib/components/document-list/use-previous.d.ts +0 -2
- package/lib/components/document-list/use-previous.d.ts.map +0 -1
- package/lib/components/document-list/use-previous.js +0 -12
- 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.
|
|
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.
|
|
38
|
+
"@leafygreen-ui/avatar": "^3.2.0",
|
|
39
39
|
"@leafygreen-ui/badge": "^10.2.3",
|
|
40
|
-
"@leafygreen-ui/banner": "^10.2.
|
|
40
|
+
"@leafygreen-ui/banner": "^10.2.4",
|
|
41
41
|
"@leafygreen-ui/button": "^25.1.3",
|
|
42
|
-
"@leafygreen-ui/card": "^13.
|
|
43
|
-
"@leafygreen-ui/checkbox": "^18.1.
|
|
44
|
-
"@leafygreen-ui/chip": "^4.0.
|
|
45
|
-
"@leafygreen-ui/code": "^20.2.
|
|
46
|
-
"@leafygreen-ui/combobox": "^12.
|
|
47
|
-
"@leafygreen-ui/confirmation-modal": "^
|
|
48
|
-
"@leafygreen-ui/copyable": "^12.0.
|
|
49
|
-
"@leafygreen-ui/drawer": "^5.1
|
|
50
|
-
"@leafygreen-ui/emotion": "^5.
|
|
51
|
-
"@leafygreen-ui/guide-cue": "^8.
|
|
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.
|
|
54
|
-
"@leafygreen-ui/icon-button": "^17.1.
|
|
55
|
-
"@leafygreen-ui/info-sprinkle": "^5.0.
|
|
56
|
-
"@leafygreen-ui/input-option": "^4.1.
|
|
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": "^
|
|
60
|
-
"@leafygreen-ui/menu": "^33.0
|
|
61
|
-
"@leafygreen-ui/modal": "^
|
|
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.
|
|
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.
|
|
69
|
-
"@leafygreen-ui/search-input": "^6.1.
|
|
70
|
-
"@leafygreen-ui/segmented-control": "^11.0.
|
|
71
|
-
"@leafygreen-ui/select": "^17.0.
|
|
72
|
-
"@leafygreen-ui/skeleton-loader": "^3.0.
|
|
73
|
-
"@leafygreen-ui/split-button": "^6.
|
|
74
|
-
"@leafygreen-ui/table": "^15.2.
|
|
75
|
-
"@leafygreen-ui/tabs": "^17.0.
|
|
76
|
-
"@leafygreen-ui/text-area": "^12.1.
|
|
77
|
-
"@leafygreen-ui/text-input": "^16.2.
|
|
78
|
-
"@leafygreen-ui/toast": "^8.1.
|
|
79
|
-
"@leafygreen-ui/toggle": "^12.1.
|
|
80
|
-
"@leafygreen-ui/tokens": "^4.
|
|
81
|
-
"@leafygreen-ui/tooltip": "^14.
|
|
82
|
-
"@leafygreen-ui/typography": "^22.2.
|
|
83
|
-
"@lg-chat/chat-window": "^
|
|
84
|
-
"@lg-chat/input-bar": "^
|
|
85
|
-
"@lg-chat/leafygreen-chat-provider": "^
|
|
86
|
-
"@lg-chat/message": "^
|
|
87
|
-
"@
|
|
88
|
-
"@mongodb-js/
|
|
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.
|
|
95
|
-
"hadron-type-checker": "^7.4.
|
|
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.
|
|
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.
|
|
110
|
-
"@mongodb-js/eslint-config-compass": "^1.4.
|
|
111
|
-
"@mongodb-js/mocha-config-compass": "^1.7.
|
|
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.
|
|
114
|
-
"@mongodb-js/tsconfig-compass": "^1.2.
|
|
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": "
|
|
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":";;;;;;;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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"}
|