@noya-app/noya-designsystem 0.1.59 → 0.1.60
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/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +6 -0
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -16
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -220,6 +220,7 @@ import { useEffect as useEffect3, useRef as useRef4 } from "react";
|
|
|
220
220
|
|
|
221
221
|
// ../noya-react-utils/src/hooks/useIsomorphicLayoutEffect.ts
|
|
222
222
|
import * as React5 from "react";
|
|
223
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React5.useLayoutEffect : React5.useEffect;
|
|
223
224
|
|
|
224
225
|
// ../noya-react-utils/src/hooks/useLateReference.ts
|
|
225
226
|
import { useCallback as useCallback5, useLayoutEffect as useLayoutEffect2, useRef as useRef5 } from "react";
|
|
@@ -296,12 +297,12 @@ import { isShallowEqual } from "@noya-app/noya-utils";
|
|
|
296
297
|
import { useRef as useRef7 } from "react";
|
|
297
298
|
|
|
298
299
|
// ../noya-react-utils/src/hooks/useStableCallback.ts
|
|
299
|
-
import { useCallback as useCallback9,
|
|
300
|
+
import { useCallback as useCallback9, useRef as useRef8 } from "react";
|
|
300
301
|
var noop2 = () => {
|
|
301
302
|
};
|
|
302
303
|
function useStableCallback(callback) {
|
|
303
304
|
const callbackRef = useRef8(callback || noop2);
|
|
304
|
-
|
|
305
|
+
useIsomorphicLayoutEffect(() => {
|
|
305
306
|
callbackRef.current = callback || noop2;
|
|
306
307
|
}, [callback]);
|
|
307
308
|
return useCallback9(
|
|
@@ -1065,7 +1066,7 @@ import React16, {
|
|
|
1065
1066
|
forwardRef as forwardRef7,
|
|
1066
1067
|
useCallback as useCallback11,
|
|
1067
1068
|
useEffect as useEffect10,
|
|
1068
|
-
useLayoutEffect as
|
|
1069
|
+
useLayoutEffect as useLayoutEffect3,
|
|
1069
1070
|
useRef as useRef10,
|
|
1070
1071
|
useState as useState11
|
|
1071
1072
|
} from "react";
|
|
@@ -1189,7 +1190,7 @@ var SubmittableTextInput = forwardRef7(function SubmittableTextInput2({
|
|
|
1189
1190
|
const userDidEdit = useRef10(false);
|
|
1190
1191
|
const isSubmitTriggeredByEscapeKey = useRef10(false);
|
|
1191
1192
|
const [internalValue, setInternalValue] = useState11("");
|
|
1192
|
-
|
|
1193
|
+
useLayoutEffect3(() => {
|
|
1193
1194
|
setInternalValue(value);
|
|
1194
1195
|
}, [value]);
|
|
1195
1196
|
const handleSubmit = useCallback11(() => {
|
|
@@ -3141,7 +3142,7 @@ import React34, {
|
|
|
3141
3142
|
isValidElement as isValidElement2,
|
|
3142
3143
|
useCallback as useCallback16,
|
|
3143
3144
|
useEffect as useEffect14,
|
|
3144
|
-
useLayoutEffect as
|
|
3145
|
+
useLayoutEffect as useLayoutEffect4,
|
|
3145
3146
|
useRef as useRef14,
|
|
3146
3147
|
useState as useState17
|
|
3147
3148
|
} from "react";
|
|
@@ -3181,7 +3182,7 @@ var PresenceChild = ({
|
|
|
3181
3182
|
willChange: "opacity",
|
|
3182
3183
|
backfaceVisibility: "hidden"
|
|
3183
3184
|
};
|
|
3184
|
-
|
|
3185
|
+
useLayoutEffect4(() => {
|
|
3185
3186
|
let rafId;
|
|
3186
3187
|
if (isPresent && animationState !== "entered") {
|
|
3187
3188
|
if (isInitialMount.current && skipInitialAnimation) {
|
|
@@ -4439,7 +4440,7 @@ import React49, {
|
|
|
4439
4440
|
useCallback as useCallback23,
|
|
4440
4441
|
useContext as useContext11,
|
|
4441
4442
|
useImperativeHandle as useImperativeHandle4,
|
|
4442
|
-
useLayoutEffect as
|
|
4443
|
+
useLayoutEffect as useLayoutEffect5,
|
|
4443
4444
|
useMemo as useMemo21,
|
|
4444
4445
|
useRef as useRef19
|
|
4445
4446
|
} from "react";
|
|
@@ -5158,7 +5159,7 @@ function ListViewEditableRowTitle({
|
|
|
5158
5159
|
onKeyDown
|
|
5159
5160
|
}) {
|
|
5160
5161
|
const inputRef = useRef19(null);
|
|
5161
|
-
|
|
5162
|
+
useLayoutEffect5(() => {
|
|
5162
5163
|
const element = inputRef.current;
|
|
5163
5164
|
if (!element || !autoFocus) return;
|
|
5164
5165
|
element.focus();
|
|
@@ -5482,7 +5483,7 @@ var VirtualizedListInner = forwardRefGeneric(function VirtualizedListInner2({
|
|
|
5482
5483
|
listRef.current?.scrollToItem(index);
|
|
5483
5484
|
}
|
|
5484
5485
|
}));
|
|
5485
|
-
|
|
5486
|
+
useLayoutEffect5(() => {
|
|
5486
5487
|
listRef.current?.resetAfterIndex(0);
|
|
5487
5488
|
}, [
|
|
5488
5489
|
// When items change, we need to re-render the virtualized list,
|
|
@@ -7954,14 +7955,14 @@ function useImageData(ref) {
|
|
|
7954
7955
|
}
|
|
7955
7956
|
|
|
7956
7957
|
// src/hooks/useObjectURL.ts
|
|
7957
|
-
import { useLayoutEffect as
|
|
7958
|
+
import { useLayoutEffect as useLayoutEffect6, useMemo as useMemo26 } from "react";
|
|
7958
7959
|
function useObjectURL(object) {
|
|
7959
7960
|
const objectURL = useMemo26(() => {
|
|
7960
7961
|
if (object instanceof Blob) return URL.createObjectURL(object);
|
|
7961
7962
|
const bytes = object instanceof Uint8Array ? object : object !== void 0 ? new Uint8Array(object) : new Uint8Array();
|
|
7962
7963
|
return URL.createObjectURL(new Blob([bytes]));
|
|
7963
7964
|
}, [object]);
|
|
7964
|
-
|
|
7965
|
+
useLayoutEffect6(() => {
|
|
7965
7966
|
return () => URL.revokeObjectURL(objectURL);
|
|
7966
7967
|
}, [objectURL]);
|
|
7967
7968
|
return objectURL;
|
|
@@ -12078,10 +12079,10 @@ function useWindowSize() {
|
|
|
12078
12079
|
}
|
|
12079
12080
|
|
|
12080
12081
|
// src/components/workspace/DrawerWorkspaceLayout.tsx
|
|
12081
|
-
import React87, { memo as memo36, useLayoutEffect as
|
|
12082
|
+
import React87, { memo as memo36, useLayoutEffect as useLayoutEffect9, useRef as useRef26, useState as useState30 } from "react";
|
|
12082
12083
|
|
|
12083
12084
|
// src/hooks/usePreservePanelSize.tsx
|
|
12084
|
-
import { useLayoutEffect as
|
|
12085
|
+
import { useLayoutEffect as useLayoutEffect8, useRef as useRef25 } from "react";
|
|
12085
12086
|
var EDITOR_PANEL_GROUP_ID = "editor-panel-group";
|
|
12086
12087
|
var LEFT_SIDEBAR_ID = "editor-left-sidebar";
|
|
12087
12088
|
var RIGHT_SIDEBAR_ID = "editor-right-sidebar";
|
|
@@ -12089,7 +12090,7 @@ var CONTENT_AREA_ID = "editor-content-area";
|
|
|
12089
12090
|
function usePreservePanelSize(panelGroupRef, setPanelLayoutState) {
|
|
12090
12091
|
const windowSize = useWindowSize();
|
|
12091
12092
|
const layoutRef = useRef25();
|
|
12092
|
-
|
|
12093
|
+
useLayoutEffect8(() => {
|
|
12093
12094
|
const panelGroup = document.querySelector(
|
|
12094
12095
|
`[data-panel-group-id="${EDITOR_PANEL_GROUP_ID}"]`
|
|
12095
12096
|
);
|
|
@@ -12132,7 +12133,7 @@ function usePreservePanelSize(panelGroupRef, setPanelLayoutState) {
|
|
|
12132
12133
|
panelGroupObserver.disconnect();
|
|
12133
12134
|
};
|
|
12134
12135
|
}, [panelGroupRef, setPanelLayoutState]);
|
|
12135
|
-
|
|
12136
|
+
useLayoutEffect8(() => {
|
|
12136
12137
|
if (!layoutRef.current) return;
|
|
12137
12138
|
const {
|
|
12138
12139
|
windowWidth: oldWindowWidth,
|
|
@@ -12229,7 +12230,7 @@ var DrawerWorkspaceLayout = memo36(function DrawerWorkspaceLayout2({
|
|
|
12229
12230
|
}) {
|
|
12230
12231
|
const portalContainer = useRef26(null);
|
|
12231
12232
|
const [mounted, setMounted] = useState30(false);
|
|
12232
|
-
|
|
12233
|
+
useLayoutEffect9(() => {
|
|
12233
12234
|
if (mounted) return;
|
|
12234
12235
|
setMounted(true);
|
|
12235
12236
|
handleChangeLayoutState({
|