From 20959c35809f0b8c701db72c5de83d743d61194e Mon Sep 17 00:00:00 2001 From: Benjamin Toby Date: Mon, 9 Dec 2024 16:50:52 +0100 Subject: [PATCH] Updates --- bun.lockb | Bin 75735 -> 76129 bytes components/lib/editors/AceEditor.tsx | 3 +-- components/lib/elements/Breadcrumbs.tsx | 2 +- components/lib/utils/fetch/fetchApi.ts | 3 +-- components/lib/utils/lower-to-title-case.ts | 9 +++++++++ package.json | 6 ++++-- 6 files changed, 16 insertions(+), 7 deletions(-) create mode 100644 components/lib/utils/lower-to-title-case.ts diff --git a/bun.lockb b/bun.lockb index a1f31799b8c2431623a65e8e24b7bdb94c8beca1..ae27f9d0352637f95d56e34dff86b915b2da0f19 100755 GIT binary patch delta 11504 zcmeHNd3a6N+TZKQiEMQU4as(p#2k?jCvif^Hcx44mY{|VM{*E}oKQnav~E?^#eG|) zEqeP^uV_=;6m3yztRXc9HO~^WYKxk_-@6CV`?&3Wp8Gw|_fOZ8-~O$44ewg(UGG|J z@0@jbkJp*~UUR}j#&+v<>T36pE>WxP(OX8&kM4Q3?YUzXad%5V@}2fG*0tQ%NJt#E z&rJx-4c)56jYkzp%KHfMO5g=x8Jz7(O36XogIX+)c8zCIYE@2>YCsM$xI9>ae8VD1 z0pP<1Zv^{8UIwlXo(J{=d(xA#vvQ%RlaD0TK|+0S5ZD_W2relvNwvW{4K4uJf;<;o z6Fk=7L16Ak2QW9>1k4Rq2Xljx!B@N`sT$-%25$m~aZf%+g!w&#XMouf+hK;v;2h5= zcQQIUh5j!5-Cn+uR1v8I!EC3`z|Vnuf-8XUpo$IrCdSF-#u)4}co3M&WmMJc^@hxL z&C2xTqfMDm{CakJ1oMj%mZ_8r-ONH^Pq%B@rJ=UV77(Zla!sEG=Y{|#cfVqzq zp`R^uAG3vd$jwX5%yEq#CrQ_kz!kp3D7gbw;3mu=hH>78%o7JQ=1j?FhgG*Fk8&uV7DhMZB%Bm zG_WD+VU6V3kiiWcM*@$yoFS(*(tDhoos{D8NYY8j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a&+6;54`lKS<>DQAH`Vxd=t4^;@6i-rFwSr&czQMB#ovkjl|NAm%K?^sz zQt2s01k&PD5#klvbxMgeFU2IKUb=hhm9!gLhnPN2uEBa7+*hLQhWe73_bV2Ae{!+; z>XN1995lF?B->dk)L0&y?Oj{uu&Vcc!?UFQzFgFFmJ6| z@O?Ayy|Yms1#1|yd0l3O^G;sGQhRr7bC^8`emRXkr`Qj4*00mtyfrQRixIEBXAz%6 zynItKu;UlYmF-_PMH^#NGOz30&J`c!x9D|5D+vp+!rVDZJKv0d zTs5!uJR#n!>hsIn?0+M;xr%~o64UUpGB5mmkQerk+$-sCp_Z`~Xdkmk;{s6qF?7~; z0_g!`sIw1W*dNe8Z$DTC%~$9@;eui}?+uOI+Ih&u_}WY8A1lFrnNGzQlt}ZQkn`Hw zLsjYqJz^2poh0)nQElVQ33oc}d>t*r_Gc{F;d!_w zAZR`|X)arMC!$C0M+siojqf`;&nM+#K$lS=y0$85+Pler3skZo^UGA~lhp8T(@w_= zAbUdI5}h(sozmsth#Gx>YFjF}7+1dW;+3Z5)pw7((bl{6g-PDR?~_e#Vn+ap#f$z4 Dee0Ld diff --git a/components/lib/editors/AceEditor.tsx b/components/lib/editors/AceEditor.tsx index f64cde0..f36739b 100755 --- a/components/lib/editors/AceEditor.tsx +++ b/components/lib/editors/AceEditor.tsx @@ -1,4 +1,3 @@ -import { AceEditorAcceptedModes } from "@/components/general/data/partials/EditDataListButton"; import React, { MutableRefObject } from "react"; import { twMerge } from "tailwind-merge"; @@ -9,7 +8,7 @@ export type AceEditorComponentType = { ctrlEnterFn?: (editor: AceAjax.Editor) => void; content?: string; placeholder?: string; - mode?: AceEditorAcceptedModes; + mode?: any; fontSize?: string; previewMode?: boolean; onChange?: (value: string) => void; diff --git a/components/lib/elements/Breadcrumbs.tsx b/components/lib/elements/Breadcrumbs.tsx index 4af8e57..75021f9 100755 --- a/components/lib/elements/Breadcrumbs.tsx +++ b/components/lib/elements/Breadcrumbs.tsx @@ -2,7 +2,7 @@ import React from "react"; import Link from "../layout/Link"; import Divider from "../layout/Divider"; import Row from "../layout/Row"; -import lowerToTitleCase from "@/server-client-shared/utils/lower-to-title-case"; +import lowerToTitleCase from "../utils/lower-to-title-case"; type LinkObject = { title: string; diff --git a/components/lib/utils/fetch/fetchApi.ts b/components/lib/utils/fetch/fetchApi.ts index bbdffa6..454c309 100755 --- a/components/lib/utils/fetch/fetchApi.ts +++ b/components/lib/utils/fetch/fetchApi.ts @@ -1,4 +1,3 @@ -import { AuthCsrfHeaderName } from "@/server-client-shared/types/admin/auth"; import _ from "lodash"; type FetchApiOptions = { @@ -18,7 +17,7 @@ type FetchApiOptions = { }; type FetchHeader = HeadersInit & { - [key in AuthCsrfHeaderName]?: string | null; + [key: string]: string | null; }; export type FetchApiReturn = { diff --git a/components/lib/utils/lower-to-title-case.ts b/components/lib/utils/lower-to-title-case.ts new file mode 100644 index 0000000..d979655 --- /dev/null +++ b/components/lib/utils/lower-to-title-case.ts @@ -0,0 +1,9 @@ +export default function lowerToTitleCase(str: string) { + return str + .replace(/_|-/g, " ") + .split(" ") + .map( + (word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase() + ) + .join(" "); +} diff --git a/package.json b/package.json index 12a73ac..0a3aa96 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ }, "dependencies": { "@moduletrace/datasquirel": "^2.7.4", + "lodash": "^4.17.21", "lucide-react": "^0.462.0", "next": "15.0.3", "react": "19.0.0-rc-66855b96-20241106", @@ -17,11 +18,12 @@ "tailwind-merge": "^2.5.5" }, "devDependencies": { - "typescript": "^5", + "@types/lodash": "^4.17.13", "@types/node": "^20", "@types/react": "^18", "@types/react-dom": "^18", "postcss": "^8", - "tailwindcss": "^3.4.1" + "tailwindcss": "^3.4.1", + "typescript": "^5" } }