@flexkit/studio 0.0.7 → 0.0.8

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/dist/nextjs.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { F as FlexkitHandlerContext, a as FlexkitHandlerResult, h as handleFlexkitRequest } from './core-handler-B07aYFJi.js';
1
+ export { F as FlexkitHandlerContext, a as FlexkitHandlerResult, h as handleFlexkitRequest } from './core-handler-XAVVKLhV.js';
2
2
 
3
3
  /**
4
4
  * Type definitions for the Next.js API handler
package/dist/nextjs.js CHANGED
@@ -1,23 +1,29 @@
1
1
  import {
2
2
  handleFlexkitRequest
3
- } from "./chunk-BUWJY7WB.js";
3
+ } from "./chunk-TL6JXN6O.js";
4
4
 
5
5
  // src/auth/nextjs-api.ts
6
6
  function resultToNextResponse(result, NextResponse) {
7
- const headers = { ...result.headers };
7
+ const responseHeaders = new Headers(result.headers);
8
8
  if (result.setCookie) {
9
- headers["Set-Cookie"] = result.setCookie;
9
+ responseHeaders.set("Set-Cookie", result.setCookie);
10
10
  }
11
11
  if (result.type === "redirect") {
12
12
  return new NextResponse("Redirecting...", {
13
13
  status: result.status,
14
- headers
14
+ headers: responseHeaders
15
15
  });
16
16
  }
17
17
  if (result.type === "text") {
18
18
  return new NextResponse(result.body, {
19
19
  status: result.status,
20
- headers
20
+ headers: responseHeaders
21
+ });
22
+ }
23
+ if (result.type === "response") {
24
+ return new NextResponse(result.body, {
25
+ status: result.status,
26
+ headers: responseHeaders
21
27
  });
22
28
  }
23
29
  return NextResponse.json(result.body, { status: result.status });
@@ -28,13 +34,15 @@ function createFlexkitApiHandler(dependencies) {
28
34
  const cookieStore = await cookies();
29
35
  const headersList = await headers();
30
36
  const sessionToken = cookieStore.get("sessionToken")?.value ?? "";
31
- const contentType = headersList.get("content-type");
37
+ const contentType = request.headers.get("content-type") ?? headersList.get("content-type");
32
38
  const { pathname, search } = request.nextUrl;
39
+ const requestHeaders = new Headers(request.headers);
40
+ if (!requestHeaders.has("Content-Type")) {
41
+ requestHeaders.set("Content-Type", contentType ?? "application/json");
42
+ }
33
43
  const standardRequest = new Request(request.url, {
34
44
  method: request.method,
35
- headers: {
36
- "Content-Type": contentType ?? "application/json"
37
- },
45
+ headers: requestHeaders,
38
46
  body: request.method !== "GET" && request.method !== "HEAD" ? request.body : void 0,
39
47
  // @ts-expect-error - duplex is required for streaming bodies
40
48
  duplex: "half"
@@ -1,4 +1,4 @@
1
- export { F as FlexkitHandlerContext, a as FlexkitHandlerResult, h as handleFlexkitRequest } from './core-handler-B07aYFJi.js';
1
+ export { F as FlexkitHandlerContext, a as FlexkitHandlerResult, h as handleFlexkitRequest } from './core-handler-XAVVKLhV.js';
2
2
 
3
3
  /**
4
4
  * Types for TanStack Start / Nitro / Vinxi event handling
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  handleFlexkitRequest
3
- } from "./chunk-BUWJY7WB.js";
3
+ } from "./chunk-TL6JXN6O.js";
4
4
 
5
5
  // src/auth/tanstack-start-api.ts
6
6
  function getCookieValue(cookieHeader, name) {
@@ -91,6 +91,13 @@ function createFlexkitTanStackHandler() {
91
91
  sessionToken,
92
92
  contentType
93
93
  });
94
+ if (result.type === "response") {
95
+ const headers2 = new Headers(result.headers);
96
+ if (result.setCookie) {
97
+ headers2.set("Set-Cookie", result.setCookie);
98
+ }
99
+ return new Response(result.body, { status: result.status, headers: headers2 });
100
+ }
94
101
  return applyResultToResponse(result, event);
95
102
  };
96
103
  }
@@ -126,6 +133,9 @@ function createFlexkitFetchHandler() {
126
133
  if (result.type === "text") {
127
134
  return new Response(result.body, { status: result.status, headers });
128
135
  }
136
+ if (result.type === "response") {
137
+ return new Response(result.body, { status: result.status, headers });
138
+ }
129
139
  headers.set("Content-Type", "application/json");
130
140
  return new Response(JSON.stringify(result.body), { status: result.status, headers });
131
141
  };
package/dist/ui.d.ts CHANGED
@@ -191,22 +191,22 @@ declare namespace CommandShortcut {
191
191
  declare const Label: React$1.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React$1.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: class_variance_authority_types.ClassProp | undefined) => string> & React$1.RefAttributes<HTMLLabelElement>>;
192
192
 
193
193
  declare function ResizablePanelGroup({ className, ...props }: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>): JSX.Element;
194
- declare const ResizablePanel: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<keyof HTMLElementTagNameMap>, "id" | "onResize"> & {
195
- className?: string | undefined;
194
+ declare const ResizablePanel: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLSpanElement | HTMLElement | HTMLObjectElement | HTMLParagraphElement | HTMLSelectElement | HTMLAnchorElement | HTMLButtonElement | HTMLDivElement | HTMLFormElement | HTMLHeadingElement | HTMLImageElement | HTMLInputElement | HTMLLabelElement | HTMLLIElement | HTMLOListElement | HTMLUListElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLCanvasElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLLegendElement | HTMLLinkElement | HTMLMapElement | HTMLMetaElement | HTMLMeterElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLPreElement | HTMLProgressElement | HTMLSlotElement | HTMLScriptElement | HTMLSourceElement | HTMLStyleElement | HTMLTableElement | HTMLTemplateElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTitleElement | HTMLTableRowElement | HTMLTrackElement | HTMLVideoElement | HTMLTableCaptionElement | HTMLMenuElement | HTMLPictureElement>, "id" | "onResize"> & {
195
+ className?: string;
196
196
  collapsedSize?: number | undefined;
197
197
  collapsible?: boolean | undefined;
198
198
  defaultSize?: number | undefined;
199
- id?: string | undefined;
199
+ id?: string;
200
200
  maxSize?: number | undefined;
201
201
  minSize?: number | undefined;
202
- onCollapse?: ResizablePrimitive.PanelOnCollapse | undefined;
203
- onExpand?: ResizablePrimitive.PanelOnExpand | undefined;
204
- onResize?: ResizablePrimitive.PanelOnResize | undefined;
205
- order?: number | undefined;
206
- style?: object | undefined;
202
+ onCollapse?: ResizablePrimitive.PanelOnCollapse;
203
+ onExpand?: ResizablePrimitive.PanelOnExpand;
204
+ onResize?: ResizablePrimitive.PanelOnResize;
205
+ order?: number;
206
+ style?: object;
207
207
  tagName?: keyof HTMLElementTagNameMap | undefined;
208
208
  } & {
209
- children?: React$1.ReactNode;
209
+ children?: React$1.ReactNode | undefined;
210
210
  } & React$1.RefAttributes<ResizablePrimitive.ImperativePanelHandle>>;
211
211
  declare function ResizableHandle({ withHandle, className, ...props }: React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {
212
212
  withHandle?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flexkit/studio",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "Flexkit Studio - Build custom internal tools like PIMs, CRMs, and ERPs with a flexible React UI and a graph-backed API",
5
5
  "keywords": [
6
6
  "flexkit",
@@ -67,13 +67,14 @@
67
67
  "react-dom": "^18.2.0",
68
68
  "tailwindcss": "3.4.10",
69
69
  "tailwindcss-animate": "1.0.7",
70
- "tsup": "8.5.0",
70
+ "tsup": "8.5.1",
71
71
  "typescript": "^5.3.3",
72
- "eslint-config-custom": "0.0.0",
73
72
  "tailwind-config": "0.0.1",
73
+ "eslint-config-custom": "0.0.0",
74
74
  "tsconfig": "0.0.0"
75
75
  },
76
76
  "dependencies": {
77
+ "@ai-sdk/react": "3.0.3",
77
78
  "@apollo/client": "4.0.9",
78
79
  "@hookform/resolvers": "^3.3.2",
79
80
  "@lexical/code": "^0.12.2",
@@ -112,7 +113,7 @@
112
113
  "bytes": "^3.1.2",
113
114
  "class-variance-authority": "^0.7.0",
114
115
  "clsx": "^2.0.0",
115
- "cmdk": "^1.0.0",
116
+ "cmdk": "^1.1.1",
116
117
  "date-fns": "4.1.0",
117
118
  "debug": "^4.3.4",
118
119
  "fuse.js": "7.0.0",
@@ -121,20 +122,21 @@
121
122
  "lowlight": "3.1.0",
122
123
  "lucide-react": "0.555.0",
123
124
  "next-themes": "^0.2.1",
124
- "novel": "0.5.0",
125
+ "novel": "1.0.2",
125
126
  "ramda": "^0.29.1",
126
- "react-day-picker": "8.10.1",
127
+ "react-day-picker": "^9.7.0",
127
128
  "react-file-icon": "1.6.0",
128
129
  "react-hook-form": "^7.47.0",
129
130
  "react-markdown": "9.0.1",
130
- "react-resizable-panels": "^1.0.6",
131
+ "react-resizable-panels": "^3.0.6",
131
132
  "react-router-dom": "^6.21.0",
132
133
  "sonner": "^1.4.3",
133
134
  "swr": "^2.2.4",
134
135
  "tailwind-merge": "^2.0.0",
136
+ "tiptap-markdown": "0.8.10",
135
137
  "use-debounce": "10.0.3",
136
138
  "uuid": "^9.0.1",
137
- "vaul": "^0.9.4",
139
+ "vaul": "1.1.2",
138
140
  "zod": "^3.22.4"
139
141
  },
140
142
  "peerDependencies": {
@@ -156,8 +158,8 @@
156
158
  "node": ">=20.9.0"
157
159
  },
158
160
  "scripts": {
159
- "build": "tailwindcss -i ./src/styles.css -o dist/index.css && tsup --config tsup.config.ts && tsup src/ssr.tsx src/nextjs.ts src/astro.ts src/tanstack-start.ts --format esm --dts --external react --external react-dom --no-config",
160
- "dev": "tailwindcss -i ./src/styles.css -o ./dist/index.css --watch & tsup --config tsup.config.ts --watch",
161
+ "build": "tailwindcss -i ./src/styles.css -o dist/index.css && tsup --config tsup.config.ts && tsup src/nextjs.ts src/astro.ts src/tanstack-start.ts --format esm --dts --external react --external react-dom --no-config",
162
+ "dev": "tailwindcss -i ./src/styles.css -o ./dist/index.css --watch & tsup --config tsup.config.ts --watch & tsup src/nextjs.ts src/astro.ts src/tanstack-start.ts --format esm --dts --external react --external react-dom --no-config --watch",
161
163
  "lint": "eslint \"src/**/*.ts*\"",
162
164
  "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
163
165
  "ui:add": "pnpm dlx shadcn@latest add"
@@ -1,2 +0,0 @@
1
- import'./index.css';import {generateText}from'@tiptap/core';import {TiptapLink,TiptapImage,TaskList,TaskItem,HorizontalRule,StarterKit,CodeBlockLowlight,Youtube,Twitter,Mathematics,CharacterCount,Placeholder,AIHighlight,TiptapUnderline,MarkdownExtension,HighlightExtension,TextStyle,Color,CustomKeymap,GlobalDragHandle}from'novel/extensions';import {UploadImagesPlugin}from'novel/plugins';import {cx}from'class-variance-authority';import {createLowlight,common}from'lowlight';import {jsx}from'react/jsx-runtime';var C=AIHighlight,I=Placeholder,B=TiptapLink.configure({HTMLAttributes:{class:cx("fk-text-muted-foreground fk-underline fk-underline-offset-[3px] hover:fk-text-primary fk-transition-colors fk-cursor-pointer")}}),v=TiptapImage.extend({addProseMirrorPlugins(){return [UploadImagesPlugin({imageClass:cx("fk-opacity-40 fk-rounded-lg fk-border fk-border-stone-200")})]}}).configure({allowBase64:true,HTMLAttributes:{class:cx("fk-rounded-lg fk-border fk-border-muted")}}),P=TaskList.configure({HTMLAttributes:{class:cx("fk-not-prose fk-pl-2 ")}}),z=TaskItem.configure({HTMLAttributes:{class:cx("fk-flex gap-2 fk-items-start fk-my-2")},nested:true}),K=HorizontalRule.configure({HTMLAttributes:{class:cx("mt-4 mb-6 border-t border-muted-foreground")}}),N=StarterKit.configure({bulletList:{HTMLAttributes:{class:cx("fk-list-disc fk-list-outside fk-leading-3 -fk-mt-2")}},orderedList:{HTMLAttributes:{class:cx("fk-list-decimal fk-list-outside fk-leading-3 -fk-mt-2")}},listItem:{HTMLAttributes:{class:cx("fk-leading-normal -fk-mb-2")}},blockquote:{HTMLAttributes:{class:cx("fk-border-l-4 fk-border-primary")}},codeBlock:false,code:{HTMLAttributes:{class:cx("fk-rounded-md fk-bg-muted fk-px-1.5 fk-py-1 fk-font-mono fk-font-medium"),spellcheck:"false"}},horizontalRule:false,dropcursor:{color:"#DBEAFE",width:4},gapcursor:false}),O=CodeBlockLowlight.configure({lowlight:createLowlight(common)}),R=Youtube.configure({HTMLAttributes:{class:cx("fk-rounded-lg fk-border fk-border-muted")},inline:false}),S=Twitter.configure({HTMLAttributes:{class:cx("fk-not-prose")},inline:false}),D=Mathematics.configure({HTMLAttributes:{class:cx("fk-text-foreground fk-rounded fk-p-1 hover:fk-bg-muted fk-cursor-pointer")},katexOptions:{throwOnError:false}}),G=CharacterCount.configure(),r=[N,I,B,v,P,z,K,C,O,R,S,D,G,TiptapUnderline,MarkdownExtension,HighlightExtension,TextStyle,Color,CustomKeymap,GlobalDragHandle];var s=100;function Z({value:o}){let e;try{e=generateText(JSON.parse(o),r).substring(0,s);}catch{e=o?.substring(0,s)??"";}return jsx("div",{className:"fk-truncate",children:e})}export{r as a,Z as b};//# sourceMappingURL=chunk-HZZZBJEZ.js.map
2
- //# sourceMappingURL=chunk-HZZZBJEZ.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/form/fields/editor/extensions.ts","../src/data-grid/preview-components/editor.tsx"],"names":["aiHighlight","AIHighlight","placeholder","Placeholder","tiptapLink","TiptapLink","cx","tiptapImage","TiptapImage","UploadImagesPlugin","taskList","TaskList","taskItem","TaskItem","horizontalRule","HorizontalRule","starterKit","StarterKit","codeBlockLowlight","CodeBlockLowlight","createLowlight","common","youtube","Youtube","twitter","Twitter","mathematics","Mathematics","characterCount","CharacterCount","defaultExtensions","TiptapUnderline","MarkdownExtension","HighlightExtension","TextStyle","Color","CustomKeymap","GlobalDragHandle","MAX_LENGTH","Editor","value","textValue","generateText","jsx"],"mappings":"ggBA4BA,IAAMA,CAAAA,CAAcC,YAEdC,CAAAA,CAAcC,WAAAA,CACdC,CAAAA,CAAaC,UAAAA,CAAW,UAAU,CACtC,cAAA,CAAgB,CACd,KAAA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,CAAC,KAAA,CAAA,CAAI,UAAU,aAAA,CAAe,QAAA,CAAAF,EAAU,CACjD","file":"chunk-HZZZBJEZ.js","sourcesContent":["import {\n AIHighlight,\n CharacterCount,\n CodeBlockLowlight,\n Color,\n CustomKeymap,\n GlobalDragHandle,\n HighlightExtension,\n HorizontalRule,\n MarkdownExtension,\n Placeholder,\n StarterKit,\n TaskItem,\n TaskList,\n TextStyle,\n TiptapImage,\n TiptapLink,\n TiptapUnderline,\n Twitter,\n Youtube,\n Mathematics,\n} from 'novel/extensions';\nimport { Extensions } from '@tiptap/core';\nimport { UploadImagesPlugin } from 'novel/plugins';\nimport { cx } from 'class-variance-authority';\nimport { common, createLowlight } from 'lowlight';\n\n//TODO I am using cx here to get tailwind autocomplete working, idk if someone else can write a regex to just capture the class key in objects\nconst aiHighlight = AIHighlight;\n//You can overwrite the placeholder with your own configuration\nconst placeholder = Placeholder;\nconst tiptapLink = TiptapLink.configure({\n HTMLAttributes: {\n 'class': cx(\n 'fk-text-muted-foreground fk-underline fk-underline-offset-[3px] hover:fk-text-primary fk-transition-colors fk-cursor-pointer'\n ),\n },\n});\n\nconst tiptapImage = TiptapImage.extend({\n addProseMirrorPlugins() {\n return [\n UploadImagesPlugin({\n imageClass: cx('fk-opacity-40 fk-rounded-lg fk-border fk-border-stone-200'),\n }),\n ];\n },\n}).configure({\n allowBase64: true,\n HTMLAttributes: {\n class: cx('fk-rounded-lg fk-border fk-border-muted'),\n },\n});\n\nconst taskList = TaskList.configure({\n HTMLAttributes: {\n class: cx('fk-not-prose fk-pl-2 '),\n },\n});\nconst taskItem = TaskItem.configure({\n HTMLAttributes: {\n 'class': cx('fk-flex gap-2 fk-items-start fk-my-2'),\n },\n nested: true,\n});\n\nconst horizontalRule = HorizontalRule.configure({\n HTMLAttributes: {\n 'class': cx('mt-4 mb-6 border-t border-muted-foreground'),\n },\n});\n\nconst starterKit = StarterKit.configure({\n bulletList: {\n HTMLAttributes: {\n 'class': cx('fk-list-disc fk-list-outside fk-leading-3 -fk-mt-2'),\n },\n },\n orderedList: {\n HTMLAttributes: {\n 'class': cx('fk-list-decimal fk-list-outside fk-leading-3 -fk-mt-2'),\n },\n },\n listItem: {\n HTMLAttributes: {\n 'class': cx('fk-leading-normal -fk-mb-2'),\n },\n },\n blockquote: {\n HTMLAttributes: {\n 'class': cx('fk-border-l-4 fk-border-primary'),\n },\n },\n codeBlock: false,\n code: {\n HTMLAttributes: {\n 'class': cx('fk-rounded-md fk-bg-muted fk-px-1.5 fk-py-1 fk-font-mono fk-font-medium'),\n spellcheck: 'false',\n },\n },\n horizontalRule: false,\n dropcursor: {\n color: '#DBEAFE',\n width: 4,\n },\n gapcursor: false,\n});\n\nconst codeBlockLowlight = CodeBlockLowlight.configure({\n // configure lowlight: common / all / use highlightJS in case there is a need to specify certain language grammars only\n // common: covers 37 language grammars which should be good enough in most cases\n lowlight: createLowlight(common),\n});\n\nconst youtube = Youtube.configure({\n HTMLAttributes: {\n 'class': cx('fk-rounded-lg fk-border fk-border-muted'),\n },\n inline: false,\n});\n\nconst twitter = Twitter.configure({\n HTMLAttributes: {\n 'class': cx('fk-not-prose'),\n },\n inline: false,\n});\n\nconst mathematics = Mathematics.configure({\n HTMLAttributes: {\n 'class': cx('fk-text-foreground fk-rounded fk-p-1 hover:fk-bg-muted fk-cursor-pointer'),\n },\n katexOptions: {\n throwOnError: false,\n },\n});\n\nconst characterCount = CharacterCount.configure();\n\nexport const defaultExtensions: Extensions = [\n starterKit,\n placeholder,\n tiptapLink,\n tiptapImage,\n taskList,\n taskItem,\n horizontalRule,\n aiHighlight,\n codeBlockLowlight,\n youtube,\n twitter,\n mathematics,\n characterCount,\n TiptapUnderline,\n MarkdownExtension,\n HighlightExtension,\n TextStyle,\n Color,\n CustomKeymap,\n GlobalDragHandle,\n];\n","import { generateText } from '@tiptap/core';\nimport { defaultExtensions } from '../../form/fields/editor/extensions';\n\nconst MAX_LENGTH = 100;\n\n/**\n * Renders a preview of the editor content.\n */\nexport function Editor({ value }: { value: string }) {\n let textValue;\n\n try {\n textValue = generateText(JSON.parse(value), defaultExtensions).substring(0, MAX_LENGTH);\n } catch (e) {\n textValue = value?.substring(0, MAX_LENGTH) ?? '';\n }\n\n return <div className=\"fk-truncate\">{textValue}</div>;\n}\n"]}
@@ -1,17 +0,0 @@
1
- interface FlexkitHandlerContext {
2
- request: Request;
3
- pathname: string;
4
- search: string;
5
- sessionToken: string;
6
- contentType: string | null;
7
- }
8
- interface FlexkitHandlerResult {
9
- type: 'json' | 'redirect' | 'text';
10
- status: number;
11
- body?: unknown;
12
- headers?: Record<string, string>;
13
- setCookie?: string;
14
- }
15
- declare function handleFlexkitRequest(ctx: FlexkitHandlerContext): Promise<FlexkitHandlerResult>;
16
-
17
- export { type FlexkitHandlerContext as F, type FlexkitHandlerResult as a, handleFlexkitRequest as h };
@@ -1,2 +0,0 @@
1
- import'./index.css';export{b as Editor}from'./chunk-HZZZBJEZ.js';//# sourceMappingURL=editor-VSCVCAL4.js.map
2
- //# sourceMappingURL=editor-VSCVCAL4.js.map