@weavy/uikit-react 14.0.0 → 14.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changelog.md +6 -0
- package/dist/cjs/{types/client → client}/WeavyClient.d.ts +0 -0
- package/dist/cjs/{types/components → components}/Attachment.d.ts +0 -0
- package/dist/cjs/{types/components → components}/Avatar.d.ts +0 -0
- package/dist/cjs/{types/components → components}/Chat.d.ts +0 -0
- package/dist/cjs/{types/components → components}/Conversation.d.ts +0 -0
- package/dist/cjs/{types/components → components}/ConversationBadge.d.ts +0 -0
- package/dist/cjs/{types/components → components}/ConversationForm.d.ts +0 -0
- package/dist/cjs/{types/components → components}/ConversationList.d.ts +0 -0
- package/dist/cjs/{types/components → components}/ConversationListItem.d.ts +0 -0
- package/dist/cjs/{types/components → components}/File.d.ts +0 -0
- package/dist/cjs/{types/components → components}/FileBrowser.d.ts +0 -0
- package/dist/cjs/{types/components → components}/Image.d.ts +0 -0
- package/dist/cjs/{types/components → components}/Meeting.d.ts +0 -0
- package/dist/cjs/{types/components → components}/MeetingCard.d.ts +0 -0
- package/dist/cjs/{types/components → components}/Meetings.d.ts +0 -0
- package/dist/cjs/{types/components → components}/Message.d.ts +0 -0
- package/dist/cjs/{types/components → components}/Messages.d.ts +0 -0
- package/dist/cjs/{types/components → components}/Messenger.d.ts +0 -0
- package/dist/cjs/{types/components → components}/NewConversation.d.ts +0 -0
- package/dist/cjs/{types/components → components}/PdfViewer.d.ts +0 -0
- package/dist/cjs/{types/components → components}/Presence.d.ts +0 -0
- package/dist/cjs/{types/components → components}/Preview.d.ts +0 -0
- package/dist/cjs/{types/components → components}/Reactions.d.ts +0 -0
- package/dist/cjs/{types/components → components}/SearchUsers.d.ts +0 -0
- package/dist/cjs/{types/components → components}/SeenBy.d.ts +0 -0
- package/dist/cjs/{types/components → components}/Typing.d.ts +0 -0
- package/dist/cjs/{types/contexts → contexts}/MessengerContext.d.ts +0 -0
- package/dist/cjs/{types/contexts → contexts}/PreviewContext.d.ts +0 -0
- package/dist/cjs/{types/contexts → contexts}/UserContext.d.ts +0 -0
- package/dist/cjs/{types/contexts → contexts}/WeavyContext.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useBadge.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useChat.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useConversation.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useConversations.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useDebounce.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useEvents.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useFileUploader.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useMembers.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useMessages.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useMutateChat.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useMutateConversation.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useMutateConversationName.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useMutateDeleteReaction.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useMutateExternalBlobs.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useMutateMeeting.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useMutateMembers.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useMutateMessage.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useMutatePinned.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useMutateReaction.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useMutateRead.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useMutateRemoveMembers.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useMutateTyping.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/usePresence.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/usePreview.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useReactions.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useSearchUsers.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useThrottle.d.ts +0 -0
- package/dist/cjs/{types/hooks → hooks}/useUser.d.ts +0 -0
- package/dist/cjs/{types/index.d.ts → index.d.ts} +0 -0
- package/dist/cjs/index.js +6 -28
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/{types/Chat.d.ts → Chat.d.ts} +0 -0
- package/dist/cjs/types/{types/Conversation.d.ts → Conversation.d.ts} +0 -0
- package/dist/cjs/types/{types/ConversationListItem.d.ts → ConversationListItem.d.ts} +0 -0
- package/dist/cjs/types/{types/Message.d.ts → Message.d.ts} +0 -0
- package/dist/cjs/types/{types/Messenger.d.ts → Messenger.d.ts} +0 -0
- package/dist/cjs/types/{types/types.d.ts → types.d.ts} +0 -0
- package/dist/cjs/{types/ui → ui}/Button.d.ts +0 -0
- package/dist/cjs/{types/ui → ui}/Dropdown.d.ts +0 -0
- package/dist/cjs/{types/ui → ui}/Icon.d.ts +0 -0
- package/dist/cjs/{types/ui → ui}/Overlay.d.ts +0 -0
- package/dist/cjs/{types/ui → ui}/Spinner.d.ts +0 -0
- package/dist/cjs/{types/utils → utils}/fileUtilities.d.ts +0 -0
- package/dist/css/weavy-chat.css +9 -11
- package/dist/css/weavy-messenger.css +9 -11
- package/dist/css/weavy.css +9 -11
- package/dist/esm/{types/client → client}/WeavyClient.d.ts +0 -0
- package/dist/esm/{types/components → components}/Attachment.d.ts +0 -0
- package/dist/esm/{types/components → components}/Avatar.d.ts +0 -0
- package/dist/esm/{types/components → components}/Chat.d.ts +0 -0
- package/dist/esm/{types/components → components}/Conversation.d.ts +0 -0
- package/dist/esm/{types/components → components}/ConversationBadge.d.ts +0 -0
- package/dist/esm/{types/components → components}/ConversationForm.d.ts +0 -0
- package/dist/esm/{types/components → components}/ConversationList.d.ts +0 -0
- package/dist/esm/{types/components → components}/ConversationListItem.d.ts +0 -0
- package/dist/esm/{types/components → components}/File.d.ts +0 -0
- package/dist/esm/{types/components → components}/FileBrowser.d.ts +0 -0
- package/dist/esm/{types/components → components}/Image.d.ts +0 -0
- package/dist/esm/{types/components → components}/Meeting.d.ts +0 -0
- package/dist/esm/{types/components → components}/MeetingCard.d.ts +0 -0
- package/dist/esm/{types/components → components}/Meetings.d.ts +0 -0
- package/dist/esm/{types/components → components}/Message.d.ts +0 -0
- package/dist/esm/{types/components → components}/Messages.d.ts +0 -0
- package/dist/esm/{types/components → components}/Messenger.d.ts +0 -0
- package/dist/esm/{types/components → components}/NewConversation.d.ts +0 -0
- package/dist/esm/{types/components → components}/PdfViewer.d.ts +0 -0
- package/dist/esm/{types/components → components}/Presence.d.ts +0 -0
- package/dist/esm/{types/components → components}/Preview.d.ts +0 -0
- package/dist/esm/{types/components → components}/Reactions.d.ts +0 -0
- package/dist/esm/{types/components → components}/SearchUsers.d.ts +0 -0
- package/dist/esm/{types/components → components}/SeenBy.d.ts +0 -0
- package/dist/esm/{types/components → components}/Typing.d.ts +0 -0
- package/dist/esm/{types/contexts → contexts}/MessengerContext.d.ts +0 -0
- package/dist/esm/{types/contexts → contexts}/PreviewContext.d.ts +0 -0
- package/dist/esm/{types/contexts → contexts}/UserContext.d.ts +0 -0
- package/dist/esm/{types/contexts → contexts}/WeavyContext.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useBadge.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useChat.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useConversation.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useConversations.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useDebounce.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useEvents.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useFileUploader.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useMembers.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useMessages.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useMutateChat.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useMutateConversation.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useMutateConversationName.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useMutateDeleteReaction.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useMutateExternalBlobs.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useMutateMeeting.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useMutateMembers.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useMutateMessage.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useMutatePinned.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useMutateReaction.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useMutateRead.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useMutateRemoveMembers.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useMutateTyping.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/usePresence.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/usePreview.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useReactions.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useSearchUsers.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useThrottle.d.ts +0 -0
- package/dist/esm/{types/hooks → hooks}/useUser.d.ts +0 -0
- package/dist/esm/{types/index.d.ts → index.d.ts} +0 -0
- package/dist/esm/index.js +6 -28
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/{types/Chat.d.ts → Chat.d.ts} +0 -0
- package/dist/esm/types/{types/Conversation.d.ts → Conversation.d.ts} +0 -0
- package/dist/esm/types/{types/ConversationListItem.d.ts → ConversationListItem.d.ts} +0 -0
- package/dist/esm/types/{types/Message.d.ts → Message.d.ts} +0 -0
- package/dist/esm/types/{types/Messenger.d.ts → Messenger.d.ts} +0 -0
- package/dist/esm/types/{types/types.d.ts → types.d.ts} +0 -0
- package/dist/esm/{types/ui → ui}/Button.d.ts +0 -0
- package/dist/esm/{types/ui → ui}/Dropdown.d.ts +0 -0
- package/dist/esm/{types/ui → ui}/Icon.d.ts +0 -0
- package/dist/esm/{types/ui → ui}/Overlay.d.ts +0 -0
- package/dist/esm/{types/ui → ui}/Spinner.d.ts +0 -0
- package/dist/esm/{types/utils → utils}/fileUtilities.d.ts +0 -0
- package/package.json +17 -14
- package/{rollup.config.js → rollup.config.mjs} +10 -3
- package/src/components/ConversationListItem.tsx +23 -4
- package/src/components/Image.tsx +2 -1
- package/src/components/Message.tsx +1 -2
- package/src/scss/theme/_image-grid.scss +0 -2
- package/src/utils/infiniteScroll.js +1 -1
- package/src/utils/postal-parent.js +1 -1
- package/src/utils/scrollbarDetection.js +8 -5
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weavy/uikit-react",
|
|
3
|
-
"version": "14.0.
|
|
3
|
+
"version": "14.0.1",
|
|
4
4
|
"author": "Weavy",
|
|
5
5
|
"description": "React UI-kit for Weavy",
|
|
6
6
|
"homepage": "https://github.com/weavy/weavy-uikit-react",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"main": "dist/cjs/index.js",
|
|
9
9
|
"module": "dist/esm/index.js",
|
|
10
|
-
"types": "./dist/cjs/types/
|
|
10
|
+
"types": "./dist/cjs/types/types.d.ts",
|
|
11
11
|
"style": "dist/css/weavy-react.css",
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@rollup/plugin-commonjs": "^
|
|
14
|
-
"@rollup/plugin-node-resolve": "^
|
|
15
|
-
"@rollup/plugin-
|
|
13
|
+
"@rollup/plugin-commonjs": "^23.0.2",
|
|
14
|
+
"@rollup/plugin-node-resolve": "^15.0.1",
|
|
15
|
+
"@rollup/plugin-terser": "^0.1.0",
|
|
16
|
+
"@rollup/plugin-typescript": "^9.0.2",
|
|
16
17
|
"@types/lodash.debounce": "^4.0.7",
|
|
17
18
|
"@types/lodash.throttle": "^4.1.7",
|
|
18
|
-
"@types/react": "^18.0.
|
|
19
|
-
"@types/react-dom": "^18.0.
|
|
19
|
+
"@types/react": "^18.0.25",
|
|
20
|
+
"@types/react-dom": "^18.0.8",
|
|
20
21
|
"@types/react-modal": "^3.13.1",
|
|
21
22
|
"npm-run-all": "^4.1.5",
|
|
22
23
|
"rimraf": "^3.0.2",
|
|
23
|
-
"rollup": "^2.
|
|
24
|
-
"rollup-plugin-dts": "^
|
|
24
|
+
"rollup": "^3.2.5",
|
|
25
|
+
"rollup-plugin-dts": "^5.0.0",
|
|
25
26
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"typescript": "^4.6.4"
|
|
27
|
+
"sass": "^1.56.0",
|
|
28
|
+
"tslib": "^2.4.1",
|
|
29
|
+
"typescript": "^4.8.4"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"react": "^18.1.0",
|
|
@@ -47,11 +47,14 @@
|
|
|
47
47
|
"@microsoft/signalr": "^6.0.3",
|
|
48
48
|
"classnames": "^2.3.1",
|
|
49
49
|
"dayjs": "^1.11.1",
|
|
50
|
-
"emoji-toolkit": "^6.6.0",
|
|
51
50
|
"lodash.debounce": "^4.0.8",
|
|
52
51
|
"lodash.throttle": "^4.1.1",
|
|
53
52
|
"pdfjs-dist": "^2.16.105",
|
|
54
53
|
"react-modal": "^3.14.4",
|
|
55
54
|
"react-query": "^3.34.16"
|
|
55
|
+
},
|
|
56
|
+
"engines": {
|
|
57
|
+
"node": ">=18.0.0",
|
|
58
|
+
"npm": ">=8.0.0"
|
|
56
59
|
}
|
|
57
60
|
}
|
|
@@ -2,10 +2,17 @@ import resolve from "@rollup/plugin-node-resolve";
|
|
|
2
2
|
import commonjs from "@rollup/plugin-commonjs";
|
|
3
3
|
import typescript from "@rollup/plugin-typescript";
|
|
4
4
|
import dts from "rollup-plugin-dts";
|
|
5
|
-
import
|
|
5
|
+
import terser from "@rollup/plugin-terser";
|
|
6
6
|
import peerDepsExternal from 'rollup-plugin-peer-deps-external';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
//import packageJson from `./package.json` assert { type: `json` };
|
|
9
|
+
|
|
10
|
+
//const packageJson = require("./package.json");
|
|
11
|
+
const { default: packageJson } = await import("./package.json", {
|
|
12
|
+
assert: {
|
|
13
|
+
type: "json",
|
|
14
|
+
},
|
|
15
|
+
});
|
|
9
16
|
|
|
10
17
|
export default [
|
|
11
18
|
{
|
|
@@ -34,7 +41,7 @@ export default [
|
|
|
34
41
|
external: ["react", "react-dom"]
|
|
35
42
|
},
|
|
36
43
|
{
|
|
37
|
-
input: "dist/esm/
|
|
44
|
+
input: "dist/esm/index.d.ts",
|
|
38
45
|
output: [{ file: "dist/index.d.ts", format: "esm" }],
|
|
39
46
|
plugins: [dts()],
|
|
40
47
|
},
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React, { useCallback, useContext, useEffect } from 'react';
|
|
2
|
-
import joypixels from 'emoji-toolkit';
|
|
3
2
|
import dayjs from 'dayjs';
|
|
4
3
|
import { MessengerContext } from '../contexts/MessengerContext';
|
|
5
4
|
import { WeavyContext } from '../contexts/WeavyContext';
|
|
@@ -25,6 +24,26 @@ const ConversationListItem = ({ item, refetchConversations }: ConversationListIt
|
|
|
25
24
|
const removeMembers = useMutateRemoveMembers();
|
|
26
25
|
const date = dayjs.utc(item.last_message?.created_at).tz(dayjs.tz.guess());
|
|
27
26
|
|
|
27
|
+
|
|
28
|
+
// extract and keep all emojis
|
|
29
|
+
const emojiHtml = item.last_message?.html || '';
|
|
30
|
+
const emojiRegexp = /<img[^>]+wy-emoji.+>/g;
|
|
31
|
+
const emojiShortcodeRegexp = /title=\"(:[^:\s]+:)\"/;
|
|
32
|
+
const messageEmojis: { [index: string]: string } = {};
|
|
33
|
+
|
|
34
|
+
emojiHtml.match(emojiRegexp)?.forEach((imgEmoji) => {
|
|
35
|
+
let shortCode = imgEmoji.match(emojiShortcodeRegexp)![1];
|
|
36
|
+
|
|
37
|
+
if (shortCode) {
|
|
38
|
+
messageEmojis[shortCode] = imgEmoji;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
// replace text shortcodes with extracted emojis
|
|
43
|
+
const shortCodeRegexp = /:[^:\s]*(?:::[^:\s]*)*:/gi;
|
|
44
|
+
const itemSnippet = (item.last_message?.text || '').replace(shortCodeRegexp, (shortCode) => messageEmojis[shortCode]);
|
|
45
|
+
|
|
46
|
+
|
|
28
47
|
const ChatRoom = "edb400ac-839b-45a7-b2a8-6a01820d1c44";
|
|
29
48
|
|
|
30
49
|
const handleClick = (e: React.MouseEvent<HTMLDivElement>, id: any) => {
|
|
@@ -110,10 +129,10 @@ const ConversationListItem = ({ item, refetchConversations }: ConversationListIt
|
|
|
110
129
|
<div className="wy-item-text">
|
|
111
130
|
<Typing id={item.id} context="listitem">
|
|
112
131
|
|
|
113
|
-
{
|
|
114
|
-
<span className="wy-typing-hide" dangerouslySetInnerHTML={{ __html:
|
|
132
|
+
{itemSnippet &&
|
|
133
|
+
<span className="wy-typing-hide" dangerouslySetInnerHTML={{ __html: itemSnippet }}></span>
|
|
115
134
|
}
|
|
116
|
-
{!
|
|
135
|
+
{!itemSnippet &&
|
|
117
136
|
<span className="wy-typing-hide">
|
|
118
137
|
{item.last_message?.attachment_ids?.length > 0 &&
|
|
119
138
|
<Icon.UI name="attachment" size={1} />
|
package/src/components/Image.tsx
CHANGED
|
@@ -84,8 +84,9 @@ export const ImageGrid = ({ children, limit = 3}: ImageGridProps) => {
|
|
|
84
84
|
let lastChild = firstImages[firstImages.length - 1];
|
|
85
85
|
|
|
86
86
|
if (React.isValidElement(lastChild)) {
|
|
87
|
+
let lastChildProps: { more: number } = { more };
|
|
87
88
|
// Set more property on last image
|
|
88
|
-
firstImages[firstImages.length - 1] = React.cloneElement(lastChild,
|
|
89
|
+
firstImages[firstImages.length - 1] = React.cloneElement(lastChild, lastChildProps);
|
|
89
90
|
}
|
|
90
91
|
|
|
91
92
|
return (
|
|
@@ -3,7 +3,6 @@ import dayjs from 'dayjs';
|
|
|
3
3
|
import { MessageProps } from "../types/Message"
|
|
4
4
|
import Attachment from './Attachment';
|
|
5
5
|
import { ReactionsMenu, ReactionsList } from './Reactions';
|
|
6
|
-
import joypixels from 'emoji-toolkit';
|
|
7
6
|
import { Image, ImageGrid } from "./Image"
|
|
8
7
|
import SeenBy from './SeenBy';
|
|
9
8
|
import Avatar from "./Avatar";
|
|
@@ -53,7 +52,7 @@ const Message: FC<MessageProps> = ({ id, html, temp, me, avatar, name, created_a
|
|
|
53
52
|
)}
|
|
54
53
|
</ImageGrid>}
|
|
55
54
|
|
|
56
|
-
{html && <div className="wy-content" dangerouslySetInnerHTML={{ __html:
|
|
55
|
+
{html && <div className="wy-content" dangerouslySetInnerHTML={{ __html: html || "" }}></div>}
|
|
57
56
|
|
|
58
57
|
{meeting &&
|
|
59
58
|
<MeetingCard meeting={meeting} />
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @returns IntersectionObserver
|
|
7
7
|
*/
|
|
8
8
|
export function createScroller(observeElement, whenNext) {
|
|
9
|
-
console.log("creating regular scroller");
|
|
9
|
+
//console.log("creating regular scroller");
|
|
10
10
|
var parent = getScrollParent(observeElement);
|
|
11
11
|
|
|
12
12
|
// Disable scroll anchoring https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-anchor/Guide_to_scroll_anchoring
|
|
@@ -64,7 +64,7 @@ export function checkScrollbarAdjust(entries) {
|
|
|
64
64
|
for (var entry in entries) {
|
|
65
65
|
let target = entries[entry].target;
|
|
66
66
|
let targetStyle = getComputedStyle(target);
|
|
67
|
-
console.log("checking scrollbar adjust", target)
|
|
67
|
+
//console.log("checking scrollbar adjust", target)
|
|
68
68
|
if (target.dataset.adjustScrollbarTop !== undefined) {
|
|
69
69
|
scrollbarClassnameTarget.style.setProperty('--wy-scrollbar-adjust-top', targetStyle.height);
|
|
70
70
|
}
|
|
@@ -78,11 +78,11 @@ export function checkScrollbarAdjust(entries) {
|
|
|
78
78
|
* Creates a scrollbar adjustment observer.
|
|
79
79
|
*/
|
|
80
80
|
export function detectScrollbarAdjustments() {
|
|
81
|
-
console.log("detect scrollbar adjust");
|
|
81
|
+
//console.log("detect scrollbar adjust");
|
|
82
82
|
var adjustRO = new ResizeObserver(checkScrollbarAdjust);
|
|
83
83
|
|
|
84
84
|
const registerAdjustmentElements = () => {
|
|
85
|
-
console.log("register scrollbar adjust");
|
|
85
|
+
//console.log("register scrollbar adjust");
|
|
86
86
|
|
|
87
87
|
scrollbarClassnameTarget.style.removeProperty('--wy-scrollbar-adjust-top');
|
|
88
88
|
scrollbarClassnameTarget.style.removeProperty('--wy-scrollbar-adjust-bottom');
|
|
@@ -102,6 +102,9 @@ export function detectScrollbarAdjustments() {
|
|
|
102
102
|
requestAnimationFrame(registerAdjustmentElements);
|
|
103
103
|
setTimeout(registerAdjustmentElements, 5000);
|
|
104
104
|
|
|
105
|
-
var adjustMO = new MutationObserver(throttle(registerAdjustmentElements,
|
|
106
|
-
adjustMO.observe(scrollbarClassnameTarget
|
|
105
|
+
var adjustMO = new MutationObserver(throttle(registerAdjustmentElements, 100));
|
|
106
|
+
adjustMO.observe(scrollbarClassnameTarget, {
|
|
107
|
+
childList: true,
|
|
108
|
+
subtree: true
|
|
109
|
+
});
|
|
107
110
|
}
|