Quellcode durchsuchen

Merge branch 'release/1.5.0-pre-alpha.2'

lfabl vor 1 Woche
Ursprung
Commit
7b9bff3080

+ 0 - 11
example/src/index.tsx

@@ -15,17 +15,6 @@ import {
 import "moment/locale/tr";
 import moment from "moment";
 
-if (Platform.OS === "web" && typeof window !== "undefined") {
-    window.addEventListener("error", (e) => {
-        if (
-            e.message === "ResizeObserver loop limit exceeded" ||
-            e.message === "ResizeObserver loop completed with undelivered notifications."
-        ) {
-            e.stopImmediatePropagation();
-        }
-    });
-}
-
 let NCoreConfig: NCoreUIKitConfig = {
     projectThemes: defaultThemeJSON as NCoreUIKit.Palette,
     initialSelectedGapPropagation: "spacious",

+ 2 - 1
example/src/pages/components/userShortcut/index.tsx

@@ -46,7 +46,8 @@ const SPREAD_BEHAVIOURS_DATA = SPREAD_BEHAVIOURS.map((type) => ({
 
 const VARIANT_TYPES: Array<NonNullable<IUserShortcutProps["variant"]>> = [
     "default",
-    "compact"
+    "compact",
+    "drawer"
 ];
 
 const VARIANT_TYPES_DATA = VARIANT_TYPES.map((type) => ({

+ 2 - 2
example/web/webpack.config.js

@@ -76,8 +76,8 @@ let config = {
         client: {
             logging: "none",
             overlay: {
-                errors: true,
-                warnings: false
+                warnings: false,
+                errors: true
             }
         }
     },

+ 3 - 2
package.json

@@ -1,6 +1,6 @@
 {
     "name": "ncore-ui-kit",
-    "version": "1.5.0-pre-alpha.1",
+    "version": "1.5.0-pre-alpha.2",
     "description": "NİBGAT® | NCore - UI Kit for React-Native Mobile Apps.",
     "main": "./lib/module/index.js",
     "types": "./lib/typescript/src/index.d.ts",
@@ -53,8 +53,8 @@
     },
     "bin": {
         "ncore-setup": "./bin/setup.js",
-        "ncore-setup-web": "./bin/setup-web.js",
         "ncore-setup-mobile": "./bin/setup-mobile.js",
+        "ncore-setup-web": "./bin/setup-web.js",
         "ncore-type-kit": "./bin/type-kit.js"
     },
     "keywords": [
@@ -122,6 +122,7 @@
         "babel-plugin-react-native-web": "0.21.2",
         "babel-preset-expo": "56.0.15",
         "buffer": "^6.0.3",
+        "copy-webpack-plugin": "^14.0.0",
         "copyfiles": "2.4.1",
         "cross-env": "10.1.0",
         "del-cli": "6.0.0",

+ 3 - 2
src/components/userShortcut/index.tsx

@@ -108,6 +108,7 @@ const UserShortcut = ({
         isDisabled,
         maxWidth,
         radiuses,
+        variant,
         colors,
         spaces
     });
@@ -258,7 +259,7 @@ const UserShortcut = ({
             </View>;
         }
 
-        if(!isShowArrowButton) {
+        if(!isShowArrowButton || variant === "drawer") {
             return null;
         }
 
@@ -389,7 +390,7 @@ const UserShortcut = ({
 
                 if(onPress) onPress();
 
-                if(variant === "compact" && isShowArrowButton && !isNoSession) {
+                if((variant === "compact" || variant === "drawer") && isShowArrowButton && !isNoSession) {
                     setIsBottomSheetOpen(!isBottomSheetOpen);
                 }
             }}

+ 2 - 1
src/components/userShortcut/stylesheet.ts

@@ -57,15 +57,16 @@ export const useStyles = ({
     isDisabled,
     maxWidth,
     radiuses,
+    variant,
     colors,
     spaces
 }: UserShortcutDynamicStyleType) => {
     const styles = {
         container: {
             backgroundColor: backgroundColor === "transparent" ? "transparent" : colors.content.container[backgroundColor],
+            borderRadius: variant === "drawer" ? 0 : radiuses.md,
             paddingHorizontal: spaces.spacingMd,
             paddingVertical: spaces.spacingMd,
-            borderRadius: radiuses.md,
             gap: spaces.spacingSm,
             maxWidth
         } as Mutable<ViewStyle>,

+ 4 - 3
src/components/userShortcut/type.ts

@@ -15,6 +15,7 @@ export type UserShortcutDynamicStyleType = {
     backgroundColor: keyof NCoreUIKit.ContainerContentColors | "transparent";
     radiuses: NCoreUIKit.ActivePalette["radiuses"];
     spreadBehaviour?: UserShortcutSpreadBehaviour;
+    variant?: "default" | "compact" | "drawer";
     colors: NCoreUIKit.ActivePalette["colors"];
     spaces: NCoreUIKit.ActivePalette["spaces"];
     maxWidth?: DimensionValue;
@@ -33,9 +34,9 @@ interface IUserShortcutProps {
     style?: StyleProp<ViewStyle>[] | StyleProp<ViewStyle>;
     statusColor?: keyof NCoreUIKit.TextContentColors;
     spreadBehaviour?: UserShortcutSpreadBehaviour;
+    variant?: "default" | "compact" | "drawer";
     isShowLoginButtonWhenNoSession?: boolean;
     isWorkWithCoreComplex?: boolean;
-    variant?: "default" | "compact";
     isShowRegisterButton?: boolean;
     actionButtons?: IButtonProps[];
     isShowLogoutButton?: boolean;
@@ -43,11 +44,11 @@ interface IUserShortcutProps {
     isShowArrowButton?: boolean;
     avatarProps?: IAvatarProps;
     isSessionActive?: boolean;
-    maxWidth?: DimensionValue;
     onLoginPress?: () => void;
+    maxWidth?: DimensionValue;
     isDisabled?: boolean;
-    badges?: ReactNode[];
     onPress?: () => void;
+    badges?: ReactNode[];
     statusText?: string;
     subTitle?: string;
     title?: string;

+ 0 - 3
src/components/webScrollbar/index.tsx

@@ -54,7 +54,6 @@ const WebScrollbar = () => {
             #root *::-webkit-scrollbar-thumb,
             body *::-webkit-scrollbar-thumb,
             html *::-webkit-scrollbar-thumb {
-                transition: border 0.5s, border-radius 0.5s, background 0.5s, background-clip 0.5s;
                 border: ${borders.scrollBarThumb}px solid transparent !important;
                 background: ${colors.content.container.primary} !important;
                 border-radius: ${radiuses.scrollBarThumb}px !important;
@@ -64,7 +63,6 @@ const WebScrollbar = () => {
             #root *::-webkit-scrollbar-thumb:hover,
             body *::-webkit-scrollbar-thumb:hover,
             html *::-webkit-scrollbar-thumb:hover {
-                transition: border 0.5s, border-radius 0.5s, background 0.5s, background-clip 0.5s;
                 border: ${borders.scrollBarThumbHover}px solid transparent !important;
                 border-radius: ${radiuses.scrollBarThumbHover}px !important;
                 background: ${colors.content.container.primary} !important;
@@ -74,7 +72,6 @@ const WebScrollbar = () => {
             #root *::-webkit-scrollbar-thumb:active,
             body *::-webkit-scrollbar-thumb:active,
             html *::-webkit-scrollbar-thumb:active {
-                transition: border 0.5s, border-radius 0.5s, background 0.5s, background-clip 0.5s;
                 border: ${borders.scrollBarThumbActive}px solid transparent !important;
                 background: ${colors.content.container.emphasized} !important;
                 border-radius: ${radiuses.scrollBarThumbActive}px !important;

+ 3 - 5
src/core/contexts/coreComplex/cryptoPolyfill.ts

@@ -5,11 +5,9 @@ import {
 let cryptoModule: Record<string, unknown> = {};
 
 try {
-    const req = typeof require !== "undefined" ? require : undefined;
-
-    if (req) {
-        const cryptoStr = "crypto";
-        cryptoModule = (req as (id: string) => Record<string, unknown>)(cryptoStr);
+    if (typeof require !== "undefined") {
+        // eslint-disable-next-line @typescript-eslint/no-require-imports
+        cryptoModule = require("crypto");
     }
 } catch {
     cryptoModule = {};

+ 27 - 1
yarn.lock

@@ -7436,6 +7436,21 @@ __metadata:
   languageName: node
   linkType: hard
 
+"copy-webpack-plugin@npm:^14.0.0":
+  version: 14.0.0
+  resolution: "copy-webpack-plugin@npm:14.0.0"
+  dependencies:
+    glob-parent: "npm:^6.0.1"
+    normalize-path: "npm:^3.0.0"
+    schema-utils: "npm:^4.2.0"
+    serialize-javascript: "npm:^7.0.3"
+    tinyglobby: "npm:^0.2.12"
+  peerDependencies:
+    webpack: ^5.1.0
+  checksum: 10c0/1296bec96c9b7bb603c11aac95bc9580810e3f6be062044d2d4442c54d11ac5a0cd535e118fee6d65a83709a7a440e231686c0a2755f36df73061f7e4a0024d6
+  languageName: node
+  linkType: hard
+
 "copyfiles@npm:2.4.1":
   version: 2.4.1
   resolution: "copyfiles@npm:2.4.1"
@@ -10024,7 +10039,7 @@ __metadata:
   languageName: node
   linkType: hard
 
-"glob-parent@npm:^6.0.2":
+"glob-parent@npm:^6.0.1, glob-parent@npm:^6.0.2":
   version: 6.0.2
   resolution: "glob-parent@npm:6.0.2"
   dependencies:
@@ -13312,6 +13327,7 @@ __metadata:
     babel-plugin-react-native-web: "npm:0.21.2"
     babel-preset-expo: "npm:56.0.15"
     buffer: "npm:^6.0.3"
+    copy-webpack-plugin: "npm:^14.0.0"
     copyfiles: "npm:2.4.1"
     core-complex-client: "npm:1.0.19"
     cross-env: "npm:10.1.0"
@@ -13373,6 +13389,9 @@ __metadata:
     rrule: "*"
   bin:
     ncore-setup: ./bin/setup.js
+    ncore-setup-mobile: ./bin/setup-mobile.js
+    ncore-setup-web: ./bin/setup-web.js
+    ncore-type-kit: ./bin/type-kit.js
   languageName: unknown
   linkType: soft
 
@@ -15513,6 +15532,13 @@ __metadata:
   languageName: node
   linkType: hard
 
+"serialize-javascript@npm:^7.0.3":
+  version: 7.0.7
+  resolution: "serialize-javascript@npm:7.0.7"
+  checksum: 10c0/b8fb3de1484682e3bd7649e12e81ef119c9873537c07bf7ed8c8836fb30be6587679d7c18e445eb80e97c23c9df6390e4da65bef093f2d89fb6dfc10da991b6a
+  languageName: node
+  linkType: hard
+
 "serve-index@npm:^1.9.1":
   version: 1.9.2
   resolution: "serve-index@npm:1.9.2"