@flexkit/studio 0.0.13 → 0.0.15

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.
Files changed (62) hide show
  1. package/dist/asset-65455B7V.js +2 -0
  2. package/dist/{asset-2IWHRTPZ.js.map → asset-65455B7V.js.map} +1 -1
  3. package/dist/boolean-3ZHXDPHB.js +2 -0
  4. package/dist/{boolean-OC4EQEDW.js.map → boolean-3ZHXDPHB.js.map} +1 -1
  5. package/dist/{chunk-HC5NUUAJ.js → chunk-6PYMDKS6.js} +2 -2
  6. package/dist/chunk-6PYMDKS6.js.map +1 -0
  7. package/dist/chunk-7DMOGZE6.js +2 -0
  8. package/dist/chunk-7DMOGZE6.js.map +1 -0
  9. package/dist/chunk-NJN7EGGK.js +2 -0
  10. package/dist/chunk-NJN7EGGK.js.map +1 -0
  11. package/dist/datetime-XX4YBITU.js +2 -0
  12. package/dist/{datetime-E36AZJZE.js.map → datetime-XX4YBITU.js.map} +1 -1
  13. package/dist/editor-F72NJQ25.js +2 -0
  14. package/dist/{editor-A6ZBSVFX.js.map → editor-F72NJQ25.js.map} +1 -1
  15. package/dist/icons.d.ts +1 -0
  16. package/dist/icons.js +2 -0
  17. package/dist/icons.js.map +1 -0
  18. package/dist/index.d.ts +2 -2
  19. package/dist/index.js +75 -75
  20. package/dist/index.js.map +1 -1
  21. package/dist/logo-LB22KTDD.js +3 -0
  22. package/dist/{logo-XE2KYB64.js.map → logo-LB22KTDD.js.map} +1 -1
  23. package/dist/project-selector-4G4WL2XQ.js +2 -0
  24. package/dist/{project-selector-EC52GCO3.js.map → project-selector-4G4WL2XQ.js.map} +1 -1
  25. package/dist/search-JJI6BIRU.js +2 -0
  26. package/dist/{search-ZSMT34RQ.js.map → search-JJI6BIRU.js.map} +1 -1
  27. package/dist/switch-FU7XZ34K.js +2 -0
  28. package/dist/{switch-RTOPEJUM.js.map → switch-FU7XZ34K.js.map} +1 -1
  29. package/dist/text-DFG6LLN6.js +2 -0
  30. package/dist/{text-4V63FVFM.js.map → text-DFG6LLN6.js.map} +1 -1
  31. package/dist/text-LNFBPXBT.js +2 -0
  32. package/dist/{text-6SMN3R4Y.js.map → text-LNFBPXBT.js.map} +1 -1
  33. package/dist/textarea-XFHA5IEI.js +2 -0
  34. package/dist/{textarea-EMZIRBVZ.js.map → textarea-XFHA5IEI.js.map} +1 -1
  35. package/dist/{types.d-CH6seXQw.d.ts → types.d-D7S0yibv.d.ts} +2 -2
  36. package/dist/ui.d.ts +2 -2
  37. package/dist/ui.js +1 -1
  38. package/dist/ui.js.map +1 -1
  39. package/dist/user-nav-5LW5USDZ.js +2 -0
  40. package/dist/{user-nav-ORQ6W5W3.js.map → user-nav-5LW5USDZ.js.map} +1 -1
  41. package/package.json +7 -3
  42. package/dist/asset-2IWHRTPZ.js +0 -2
  43. package/dist/boolean-OC4EQEDW.js +0 -2
  44. package/dist/chunk-HC5NUUAJ.js.map +0 -1
  45. package/dist/chunk-J63QWF2X.js +0 -14
  46. package/dist/chunk-J63QWF2X.js.map +0 -1
  47. package/dist/chunk-P745RJ7B.js +0 -2
  48. package/dist/chunk-P745RJ7B.js.map +0 -1
  49. package/dist/chunk-UKRYV5CE.js +0 -2
  50. package/dist/chunk-UKRYV5CE.js.map +0 -1
  51. package/dist/chunk-XSNFFA5W.js +0 -2
  52. package/dist/chunk-XSNFFA5W.js.map +0 -1
  53. package/dist/datetime-E36AZJZE.js +0 -2
  54. package/dist/editor-A6ZBSVFX.js +0 -2
  55. package/dist/logo-XE2KYB64.js +0 -3
  56. package/dist/project-selector-EC52GCO3.js +0 -2
  57. package/dist/search-ZSMT34RQ.js +0 -2
  58. package/dist/switch-RTOPEJUM.js +0 -2
  59. package/dist/text-4V63FVFM.js +0 -2
  60. package/dist/text-6SMN3R4Y.js +0 -2
  61. package/dist/textarea-EMZIRBVZ.js +0 -2
  62. package/dist/user-nav-ORQ6W5W3.js +0 -2
@@ -0,0 +1,2 @@
1
+ import'./index.css';export{a as Asset}from'./chunk-D5N42D57.js';import'./chunk-RMSYYUQM.js';import'./chunk-7YBJLUUE.js';import'./chunk-AXB7FQV2.js';//# sourceMappingURL=asset-65455B7V.js.map
2
+ //# sourceMappingURL=asset-65455B7V.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"asset-2IWHRTPZ.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"asset-65455B7V.js"}
@@ -0,0 +1,2 @@
1
+ import'./index.css';export{a as Boolean}from'./chunk-M6EIBKCQ.js';//# sourceMappingURL=boolean-3ZHXDPHB.js.map
2
+ //# sourceMappingURL=boolean-3ZHXDPHB.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"boolean-OC4EQEDW.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"boolean-3ZHXDPHB.js"}
@@ -1,2 +1,2 @@
1
- import'./index.css';import {generateText}from'@tiptap/core';import {TiptapLink,TiptapImage,UploadImagesPlugin,TaskList,TaskItem,HorizontalRule,StarterKit,CodeBlockLowlight,Youtube,Twitter,Mathematics,CharacterCount,Placeholder,AIHighlight,TiptapUnderline,HighlightExtension,TextStyle,Color,CustomKeymap,GlobalDragHandle}from'novel';import {Markdown}from'tiptap-markdown';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")}}),P=Markdown.configure({html:true,tightLists:true,tightListClass:"tight",bulletListMarker:"-",linkify:false,breaks:false,transformPastedText:false,transformCopiedText:false}),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")}}),z=TaskList.configure({HTMLAttributes:{class:cx("fk-not-prose fk-pl-2 ")}}),K=TaskItem.configure({HTMLAttributes:{class:cx("fk-flex gap-2 fk-items-start fk-my-2")},nested:true}),N=HorizontalRule.configure({HTMLAttributes:{class:cx("mt-4 mb-6 border-t border-muted-foreground")}}),O=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}),R=CodeBlockLowlight.configure({lowlight:createLowlight(common)}),S=Youtube.configure({HTMLAttributes:{class:cx("fk-rounded-lg fk-border fk-border-muted")},inline:false}),D=Twitter.configure({HTMLAttributes:{class:cx("fk-not-prose")},inline:false}),G=Mathematics.configure({HTMLAttributes:{class:cx("fk-text-foreground fk-rounded fk-p-1 hover:fk-bg-muted fk-cursor-pointer")},katexOptions:{throwOnError:false}}),U=CharacterCount.configure(),o=[O,I,B,v,z,K,N,C,R,S,D,G,U,TiptapUnderline,P,HighlightExtension,TextStyle,Color,CustomKeymap,GlobalDragHandle];var s=100;function $({value:r}){let e;try{e=generateText(JSON.parse(r),o).substring(0,s);}catch{e=r?.substring(0,s)??"";}return jsx("div",{className:"fk-truncate",children:e})}export{o as a,$ as b};//# sourceMappingURL=chunk-HC5NUUAJ.js.map
2
- //# sourceMappingURL=chunk-HC5NUUAJ.js.map
1
+ import'./index.css';import {generateText}from'@tiptap/core';import {TiptapLink,TiptapImage,UploadImagesPlugin,TaskList,TaskItem,HorizontalRule,StarterKit,CodeBlockLowlight,Youtube,Twitter,Mathematics,CharacterCount,Placeholder,AIHighlight,TiptapUnderline,HighlightExtension,TextStyle,Color,CustomKeymap,GlobalDragHandle}from'novel';import {Markdown}from'tiptap-markdown';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")}}),P=Markdown.configure({html:true,tightLists:true,tightListClass:"tight",bulletListMarker:"-",linkify:false,breaks:false,transformPastedText:false,transformCopiedText:false}),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")}}),z=TaskList.configure({HTMLAttributes:{class:cx("fk-not-prose fk-pl-2 ")}}),K=TaskItem.configure({HTMLAttributes:{class:cx("fk-flex gap-2 fk-items-start fk-my-2")},nested:true}),N=HorizontalRule.configure({HTMLAttributes:{class:cx("mt-4 mb-6 border-t border-muted-foreground")}}),O=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}),R=CodeBlockLowlight.configure({lowlight:createLowlight(common)}),S=Youtube.configure({HTMLAttributes:{class:cx("fk-rounded-lg fk-border fk-border-muted")},inline:false}),D=Twitter.configure({HTMLAttributes:{class:cx("fk-not-prose")},inline:false}),G=Mathematics.configure({HTMLAttributes:{class:cx("fk-text-foreground fk-rounded fk-p-1 hover:fk-bg-muted fk-cursor-pointer")},katexOptions:{throwOnError:false}}),U=CharacterCount.configure(),o=[O,I,B,v,z,K,N,C,R,S,D,G,U,TiptapUnderline,P,HighlightExtension,TextStyle,Color,CustomKeymap,GlobalDragHandle];var s=100;function Z({value:r}){let e;try{e=generateText(JSON.parse(r),o).substring(0,s);}catch{e=r?.substring(0,s)??"";}return jsx("div",{className:"fk-truncate",children:e})}export{o as a,Z as b};//# sourceMappingURL=chunk-6PYMDKS6.js.map
2
+ //# sourceMappingURL=chunk-6PYMDKS6.js.map
@@ -0,0 +1 @@
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","markdownExtension","Markdown","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","HighlightExtension","TextStyle","Color","CustomKeymap","GlobalDragHandle","MAX_LENGTH","Editor","value","textValue","generateText","jsx"],"mappings":"kfA2BMA,CAAAA,CAAcC,WAAAA,CAEdC,EAAcC,WAAAA,CACdC,CAAAA,CAAaC,WAAW,SAAA,CAAU,CACtC,eAAgB,CACd,KAAA,CAASC,GACP,8HACF,CACF,CACF,CAAC,CAAA,CAEKC,EAAoBC,QAAAA,CAAS,SAAA,CAAU,CAC3C,IAAA,CAAM,IAAA,CACN,WAAY,IAAA,CACZ,cAAA,CAAgB,QAChB,gBAAA,CAAkB,GAAA,CAClB,QAAS,KAAA,CACT,MAAA,CAAQ,KAAA,CACR,mBAAA,CAAqB,MACrB,mBAA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AAU,CACjD","file":"chunk-6PYMDKS6.js","sourcesContent":["import {\n AIHighlight,\n CharacterCount,\n CodeBlockLowlight,\n Color,\n CustomKeymap,\n GlobalDragHandle,\n HighlightExtension,\n HorizontalRule,\n Placeholder,\n StarterKit,\n TaskItem,\n TaskList,\n TextStyle,\n TiptapImage,\n TiptapLink,\n TiptapUnderline,\n Twitter,\n Youtube,\n Mathematics,\n UploadImagesPlugin,\n} from 'novel';\nimport { Markdown } from 'tiptap-markdown';\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 markdownExtension = Markdown.configure({\n html: true,\n tightLists: true,\n tightListClass: 'tight',\n bulletListMarker: '-',\n linkify: false,\n breaks: false,\n transformPastedText: false,\n transformCopiedText: false,\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: readonly unknown[] = [\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';\nimport { Extensions } from '@tiptap/core';\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 as Extensions).substring(0, MAX_LENGTH);\n } catch {\n textValue = value?.substring(0, MAX_LENGTH) ?? '';\n }\n\n return <div className=\"fk-truncate\">{textValue}</div>;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import'./index.css';import {c}from'./chunk-7YBJLUUE.js';import {createContext,useReducer,useContext,useMemo}from'react';import {jsx}from'react/jsx-runtime';import {path,has,find,propEq}from'ramda';import {useParams}from'react-router-dom';import k from'swr';var J="core.context.scope:",E={breadcrumbs:[],isRouteLoading:false,pageTitle:"",scope:"",relationships:{}},w=createContext(E),v=createContext(()=>{});function U(t,o){let{type:n,payload:e}=o;switch(n){case "setScope":return typeof localStorage<"u"&&e.projectId&&localStorage.setItem(`${J}${e.projectId}`,e.scope),{...t,scope:e.scope};case "setRelationship":return {...t,relationships:{...t.relationships,...e}};default:throw Error(`Unknown action: ${n}`)}}function Q({children:t}){let[o,n]=useReducer(U,E);return jsx(w.Provider,{value:o,children:jsx(v.Provider,{value:n,children:t})})}function I(){return useContext(w)}function Z(){return useContext(v)}var h={name:"_asset",plural:"_assets",menu:{hidden:true},attributes:[{name:"path",label:"Asset",scope:"global",options:{size:140},isEditable:true,dataType:"string",inputType:"text",previewType:"assetPreviewField",defaultValue:""},{name:"originalFilename",label:"Filename",scope:"global",options:{size:280},isEditable:true,dataType:"string",inputType:"text",previewType:"text",isPrimary:true,defaultValue:""},{name:"size",label:"Size",scope:"global",options:{size:120},isEditable:true,dataType:"int",inputType:"text",previewType:"text",defaultValue:""},{name:"width",label:"Width",scope:"global",options:{size:80},isEditable:true,dataType:"int",inputType:"text",previewType:"text",defaultValue:""},{name:"height",label:"Height",scope:"global",options:{size:80},isEditable:true,dataType:"int",inputType:"text",previewType:"text",defaultValue:""},{name:"mimeType",label:"Mime Type",scope:"global",options:{size:160},isEditable:true,dataType:"string",inputType:"text",previewType:"text",defaultValue:""},{name:"lqip",label:"lqip",scope:"global",isHidden:true,isEditable:true,dataType:"string",inputType:"text",previewType:"text",defaultValue:""},{name:"_updatedAt",label:"Last Updated",scope:"global",options:{size:140},isEditable:true,dataType:"string",inputType:"text",previewType:"text",defaultValue:""},{name:"tags",label:"Tags",scope:"relationship",dataType:"string",inputType:"relationship",defaultValue:"",previewType:"tags",options:{size:300},relationship:{mode:"multiple",field:"name",entity:"_tag"}}]};var T={name:"_tag",plural:"_tags",menu:{hidden:true},attributes:[{name:"name",label:"Tag Name",scope:"global",options:{size:220},isEditable:true,dataType:"string",inputType:"text",previewType:"text",isPrimary:true,defaultValue:""},{name:"_updatedAt",label:"Last Updated",scope:"global",options:{size:140},isEditable:true,dataType:"string",inputType:"text",previewType:"text",defaultValue:""},{name:"assets",label:"Assets",scope:"relationship",dataType:"string",inputType:"relationship",defaultValue:"",relationship:{mode:"multiple",field:"originalFilename",entity:"_asset"}}]};var N=createContext({contributions:{apps:[]},currentProjectId:void 0,currentProjectSchema:[],getContributionPointConfig:()=>[],plugins:[],projects:[]}),b=t=>Object.prototype.hasOwnProperty.call(t,"projectId"),C=t=>Object.prototype.hasOwnProperty.call(t,"contributes");function lt({config:t,children:o}){let{projectId:n}=useParams(),e=useMemo(()=>{let i=s=>[...s.filter(l=>l.name!==h.name&&l.name!==T.name),h,T];return t.map(s=>({...s,schema:i(s.schema)}))},[t]),r=useMemo(()=>m(["plugins"],e),[e]),u=useMemo(()=>m(["plugins"],e.filter(i=>i.projectId===n)),[e,n]),c=r.filter(i=>!b(i)&&C(i)),p=u.filter(i=>!b(i)&&C(i)),a=useMemo(()=>({contributions:{apps:x("apps",[],p)},currentProjectId:n,currentProjectSchema:e.find(i=>i.projectId===n)?.schema??[],getContributionPointConfig:(i,s=[])=>x(i,s,p),plugins:c,projects:r.filter(i=>b(i))}),[c,n,p,r]);return jsx(N.Provider,{value:{...a,contributions:{...a.contributions,apps:a.contributions.apps}},children:o})}function V(){return useContext(N)}function m(t,o){return Array.isArray(o)?o.reduce((n,e)=>path(t,e)?[...n,e,...m(t,path(t,e)??[])]:[...n,e],[]):[o]}function x(t,o=[],n){let e=["contributes",t,...o];return m(e.flat(),n).filter(r=>has("component",r))}function ut(t){let n=m(["plugins"],t).filter(e=>!b(e)&&C(e));return x("apps",[],n)}function bt(t,o){let{scope:n}=I(),{projects:e,currentProjectId:r}=V(),{schema:u,scopes:c$1}=find(propEq(r??"","projectId"))(e),p=c$1?.find(g=>g.isDefault)?.name??"default",a=o?.commonParams.q?JSON.stringify(o):null,{data:i,error:s,isLoading:d}=k(a,()=>fetch(c(t).search,{headers:{"Content-Type":"application/json"},body:JSON.stringify(o),method:"POST",mode:"cors"}).then(g=>g.json()));return {results:G(i?.results??[],t,u,n,p)??[],error:s,isLoading:d}}function B(t){return t.find(o=>o.isPrimary)?.name??t[0]?.name}function G(t,o,n,e,r){return t?.filter(u=>u?.hits?.length>0).map(u=>{let c=u,p=c.collection.replace(`${o}_`,"").replace(/_\d+$/,""),a=find(propEq(p,"plural"))(n);if(!a)return [];let i=B(a?.attributes??[]),s=a?.name??p;return c.hits.map(({document:d})=>{let l=d[i],F=(l&&typeof l!="string"?l[e]??l[r]:null)??d[i],L=Object.entries(d).reduce((O,[y,f])=>{if(y!==i&&y!=="id"&&y!=="_updatedAt"){let $=typeof f!="string"?f[e]??f[r]:f;O[y]=$;}return O},{});return {_id:d.id,_entityName:s,_entityNamePlural:p,[i]:F,...L}})}).flat()}export{J as a,Q as b,I as c,Z as d,h as e,T as f,lt as g,V as h,ut as i,bt as j};//# sourceMappingURL=chunk-7DMOGZE6.js.map
2
+ //# sourceMappingURL=chunk-7DMOGZE6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/core/app-context.tsx","../src/entities/assets-schema.ts","../src/entities/tags-schema.ts","../src/core/config/config-context.tsx","../src/core/use-search.tsx"],"names":["SCOPE_STORAGE_KEY","initialState","AppContext","createContext","AppDispatchContext","reducer","state","action","type","payload","AppProvider","children","dispatch","useReducer","jsx","useAppContext","useContext","useAppDispatch","assetSchema","tagSchema","ConfigContext","hasProjectIdProperty","configItem","hasContributesProperty","ConfigProvider","config","currentProjectId","useParams","enhancedConfig","useMemo","upsertReservedEntities","schema","entity","project","globalFlattenedConfig","flattenConfigByProperty","currentProjectFlattenedConfig","item","allPlugins","currentProjectPlugins","globalConfig","_getContributionPointConfig","contributionPoint","subPath","useConfig","property","acc","curr","path","pathArray","has","getApps","plugins","useSearch","projectId","searchRequest","scope","projects","scopes","find","propEq","defaultScope","s","swrKey","data","error","isLoading","useSWR","apiPaths","res","mapResults","getPrimaryAttributeName","schemaAttributes","attr","results","result","entityNamePlural","entitySchema","primaryAttributeName","entityName","document","primaryAttribute","primaryAttributeValue","attributes","key","value","scopedValue"],"mappings":"iQAMO,IAAMA,CAAAA,CAAoB,sBAE3BC,CAAAA,CAAe,CACnB,WAAA,CAAa,EAAC,CACd,cAAA,CAAgB,KAAA,CAChB,SAAA,CAAW,GACX,KAAA,CAAO,EAAA,CACP,aAAA,CAAe,EACjB,CAAA,CAEMC,CAAAA,CAAaC,aAAAA,CAA8BF,CAAY,CAAA,CAEvDG,CAAAA,CAAqBD,aAAAA,CAAgE,IAAM,CAEjG,CAAC,EAED,SAASE,EAAQC,CAAAA,CAAuBC,CAAAA,CAAgE,CACtG,GAAM,CAAE,IAAA,CAAAC,CAAAA,CAAM,OAAA,CAAAC,CAAQ,CAAA,CAAIF,CAAAA,CAE1B,OAAQC,CAAAA,EACN,KAAK,UAAA,CACH,OAAI,OAAO,YAAA,CAAiB,GAAA,EAAeC,CAAAA,CAAQ,SAAA,EACjD,YAAA,CAAa,OAAA,CAAQ,CAAA,EAAGT,CAAiB,GAAGS,CAAAA,CAAQ,SAAS,CAAA,CAAA,CAAIA,CAAAA,CAAQ,KAAK,CAAA,CAGzE,CACL,GAAGH,EACH,KAAA,CAAOG,CAAAA,CAAQ,KACjB,CAAA,CACF,KAAK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A0E,CAACsC,CAAAA,CAAKC,CAAK,CAAA,GAAM,CAC1F,GAAID,CAAAA,GAAQN,CAAAA,EAAwBM,CAAAA,GAAQ,IAAA,EAAQA,CAAAA,GAAQ,aAAc,CACxE,IAAME,CAAAA,CAAc,OAAOD,CAAAA,EAAU,QAAA,CAAYA,CAAAA,CAAM7B,CAAK,GAAK6B,CAAAA,CAAMxB,CAAY,CAAA,CAAKwB,CAAAA,CAExFvC,CAAAA,CAAIsC,CAAG,CAAA,CAAIE,EACb,CAEA,OAAOxC,CACT,CAAA,CACA,EACF,CAAA,CAEA,OAAO,CACL,IAAKkC,CAAAA,CAAS,EAAA,CACd,WAAA,CAAaD,CAAAA,CACb,iBAAA,CAAmBH,CAAAA,CACnB,CAACE,CAAoB,EAAGI,CAAAA,CACxB,GAAGC,CACL,CACF,CAAC,CACH,CAAC,CAAA,CACA,MACL","file":"chunk-7DMOGZE6.js","sourcesContent":["'use client';\n\nimport { createContext, useContext, useReducer } from 'react';\nimport type { Dispatch, ReactNode } from 'react';\nimport type { ActionSetRelationship, ActionSetScope, AppContextType } from './types';\n\nexport const SCOPE_STORAGE_KEY = 'core.context.scope:';\n\nconst initialState = {\n breadcrumbs: [],\n isRouteLoading: false,\n pageTitle: '',\n scope: '',\n relationships: {},\n};\n\nconst AppContext = createContext<AppContextType>(initialState);\n\nconst AppDispatchContext = createContext<Dispatch<ActionSetRelationship | ActionSetScope>>(() => {\n /* void */\n});\n\nfunction reducer(state: AppContextType, action: ActionSetRelationship | ActionSetScope): AppContextType {\n const { type, payload } = action;\n\n switch (type) {\n case 'setScope':\n if (typeof localStorage !== 'undefined' && payload.projectId) {\n localStorage.setItem(`${SCOPE_STORAGE_KEY}${payload.projectId}`, payload.scope);\n }\n\n return {\n ...state,\n scope: payload.scope,\n };\n case 'setRelationship':\n return {\n ...state,\n relationships: { ...state.relationships, ...payload },\n };\n default:\n throw Error(`Unknown action: ${type as string}`);\n }\n}\n\nexport function AppProvider({ children }: { children: ReactNode }): JSX.Element {\n const [state, dispatch] = useReducer(reducer, initialState);\n\n return (\n <AppContext.Provider value={state}>\n <AppDispatchContext.Provider value={dispatch}>{children}</AppDispatchContext.Provider>\n </AppContext.Provider>\n );\n}\n\nexport function useAppContext(): AppContextType {\n return useContext(AppContext);\n}\n\nexport function useAppDispatch(): Dispatch<ActionSetRelationship | ActionSetScope> {\n return useContext(AppDispatchContext);\n}\n","import type { Entity } from '../core/types';\n\nexport const assetSchema: Entity = {\n name: '_asset',\n plural: '_assets',\n menu: {\n hidden: true,\n },\n attributes: [\n {\n name: 'path',\n label: 'Asset',\n scope: 'global',\n options: {\n size: 140,\n },\n isEditable: true,\n dataType: 'string',\n inputType: 'text',\n previewType: 'assetPreviewField',\n defaultValue: '',\n },\n {\n name: 'originalFilename',\n label: 'Filename',\n scope: 'global',\n options: {\n size: 280,\n },\n isEditable: true,\n dataType: 'string',\n inputType: 'text',\n previewType: 'text',\n isPrimary: true,\n defaultValue: '',\n },\n {\n name: 'size',\n label: 'Size',\n scope: 'global',\n options: {\n size: 120,\n },\n isEditable: true,\n dataType: 'int',\n inputType: 'text',\n previewType: 'text',\n defaultValue: '',\n },\n {\n name: 'width',\n label: 'Width',\n scope: 'global',\n options: {\n size: 80,\n },\n isEditable: true,\n dataType: 'int',\n inputType: 'text',\n previewType: 'text',\n defaultValue: '',\n },\n {\n name: 'height',\n label: 'Height',\n scope: 'global',\n options: {\n size: 80,\n },\n isEditable: true,\n dataType: 'int',\n inputType: 'text',\n previewType: 'text',\n defaultValue: '',\n },\n {\n name: 'mimeType',\n label: 'Mime Type',\n scope: 'global',\n options: {\n size: 160,\n },\n isEditable: true,\n dataType: 'string',\n inputType: 'text',\n previewType: 'text',\n defaultValue: '',\n },\n {\n name: 'lqip',\n label: 'lqip',\n scope: 'global',\n isHidden: true,\n isEditable: true,\n dataType: 'string',\n inputType: 'text',\n previewType: 'text',\n defaultValue: '',\n },\n {\n name: '_updatedAt',\n label: 'Last Updated',\n scope: 'global',\n options: {\n size: 140,\n },\n isEditable: true,\n dataType: 'string',\n inputType: 'text',\n previewType: 'text',\n defaultValue: '',\n },\n {\n name: 'tags',\n label: 'Tags',\n scope: 'relationship',\n dataType: 'string',\n inputType: 'relationship',\n defaultValue: '',\n previewType: 'tags',\n options: {\n size: 300,\n },\n relationship: {\n mode: 'multiple',\n field: 'name',\n entity: '_tag',\n },\n },\n ],\n};\n","import type { Entity } from '../core/types';\n\nexport const tagSchema: Entity = {\n name: '_tag',\n plural: '_tags',\n menu: {\n hidden: true,\n },\n attributes: [\n {\n name: 'name',\n label: 'Tag Name',\n scope: 'global',\n options: {\n size: 220,\n },\n isEditable: true,\n dataType: 'string',\n inputType: 'text',\n previewType: 'text',\n isPrimary: true,\n defaultValue: '',\n },\n {\n name: '_updatedAt',\n label: 'Last Updated',\n scope: 'global',\n options: {\n size: 140,\n },\n isEditable: true,\n dataType: 'string',\n inputType: 'text',\n previewType: 'text',\n defaultValue: '',\n },\n {\n name: 'assets',\n label: 'Assets',\n scope: 'relationship',\n dataType: 'string',\n inputType: 'relationship',\n defaultValue: '',\n relationship: {\n mode: 'multiple',\n field: 'originalFilename',\n entity: '_asset',\n },\n },\n ],\n};\n","'use client';\n\nimport { createContext, useContext, useMemo } from 'react';\nimport { has, path } from 'ramda';\nimport { useParams } from 'react-router-dom';\nimport { assetSchema } from '../../entities/assets-schema';\nimport { tagSchema } from '../../entities/tags-schema';\nimport type { AppOptions, PluginOptions, ProjectOptions } from './types';\nimport type { Entity } from '../types';\n\ntype Contributes = NonNullable<PluginOptions['contributes']>;\nexport interface ConfigContext {\n contributions: {\n apps: AppOptions[] | [];\n };\n currentProjectId?: string;\n currentProjectSchema: Entity[];\n getContributionPointConfig: <T extends keyof Contributes>(\n contributionPoint: T,\n subPath?: string[]\n ) => Contributes[T][] | [];\n plugins: PluginOptions[];\n projects: ProjectOptions[];\n}\n\nconst ConfigContext = createContext<ConfigContext>({\n contributions: {\n apps: [],\n },\n currentProjectId: undefined,\n currentProjectSchema: [],\n getContributionPointConfig: () => [],\n plugins: [] as PluginOptions[],\n projects: [] as ProjectOptions[],\n});\nconst hasProjectIdProperty = (configItem: ProjectOptions | PluginOptions): boolean =>\n Object.prototype.hasOwnProperty.call(configItem, 'projectId');\nconst hasContributesProperty = (configItem: ProjectOptions | PluginOptions): boolean =>\n Object.prototype.hasOwnProperty.call(configItem, 'contributes');\n\nexport function ConfigProvider({\n config,\n children,\n}: {\n config: ProjectOptions[];\n children: React.ReactNode;\n}): JSX.Element {\n /**\n * Getting the projectId from the URL via react-router-dom's useParams hook triggers a rerender of this Context\n * every time the URL changes.\n */\n const { projectId: currentProjectId } = useParams<{ projectId: string }>();\n const enhancedConfig = useMemo(() => {\n const upsertReservedEntities = (schema: Entity[]): Entity[] => {\n const withoutReserved = schema.filter(\n (entity) => entity.name !== assetSchema.name && entity.name !== tagSchema.name\n );\n\n return [...withoutReserved, assetSchema, tagSchema];\n };\n\n return config.map((project) => ({\n ...project,\n schema: upsertReservedEntities(project.schema),\n }));\n }, [config]);\n\n const globalFlattenedConfig = useMemo(() => flattenConfigByProperty(['plugins'], enhancedConfig), [enhancedConfig]);\n const currentProjectFlattenedConfig = useMemo(\n () =>\n flattenConfigByProperty(\n ['plugins'],\n enhancedConfig.filter((item) => item.projectId === currentProjectId)\n ),\n [enhancedConfig, currentProjectId]\n );\n const allPlugins = globalFlattenedConfig.filter(\n (item: ProjectOptions | PluginOptions) => !hasProjectIdProperty(item) && hasContributesProperty(item)\n ) as PluginOptions[];\n const currentProjectPlugins = currentProjectFlattenedConfig.filter(\n (item: ProjectOptions | PluginOptions) => !hasProjectIdProperty(item) && hasContributesProperty(item)\n ) as PluginOptions[];\n\n const globalConfig = useMemo(\n () => ({\n contributions: {\n apps: _getContributionPointConfig('apps', [], currentProjectPlugins),\n },\n currentProjectId,\n currentProjectSchema: enhancedConfig.find((item) => item.projectId === currentProjectId)?.schema ?? [],\n getContributionPointConfig: <T extends keyof Contributes>(\n contributionPoint: T,\n subPath: string[] = []\n ): Contributes[T][] =>\n _getContributionPointConfig(contributionPoint, subPath, currentProjectPlugins) as Contributes[T][],\n plugins: allPlugins,\n projects: globalFlattenedConfig.filter((item: ProjectOptions | PluginOptions) =>\n hasProjectIdProperty(item)\n ) as ProjectOptions[],\n }),\n [allPlugins, currentProjectId, currentProjectPlugins, globalFlattenedConfig]\n );\n\n return (\n <ConfigContext.Provider\n value={{\n ...globalConfig,\n contributions: {\n ...globalConfig.contributions,\n apps: globalConfig.contributions.apps as AppOptions[] | [],\n },\n }}\n >\n {children}\n </ConfigContext.Provider>\n );\n}\n\nexport function useConfig(): ConfigContext {\n return useContext(ConfigContext);\n}\n\nfunction flattenConfigByProperty(\n property: string[],\n config: (ProjectOptions | PluginOptions)[]\n): (ProjectOptions | PluginOptions)[] | [] {\n if (!Array.isArray(config)) {\n return [config];\n }\n\n return config.reduce<(ProjectOptions | PluginOptions)[]>((acc, curr) => {\n if (path(property, curr)) {\n return [...acc, curr, ...flattenConfigByProperty(property, path(property, curr) ?? [])];\n }\n\n return [...acc, curr];\n }, []);\n}\n\nfunction _getContributionPointConfig<T extends keyof Contributes>(\n contributionPoint: T,\n subPath: string[] = [],\n config: PluginOptions[]\n): Contributes[T] {\n const pathArray = ['contributes', contributionPoint, ...subPath];\n\n return flattenConfigByProperty(pathArray.flat(), config).filter((item) => has('component', item)) as Contributes[T];\n}\n\nexport function getApps(config: ProjectOptions[]): AppOptions[] | [] {\n const flattenedConfig = flattenConfigByProperty(['plugins'], config);\n const plugins = flattenedConfig.filter(\n (item: ProjectOptions | PluginOptions) => !hasProjectIdProperty(item) && hasContributesProperty(item)\n ) as PluginOptions[];\n return _getContributionPointConfig('apps', [], plugins) as AppOptions[] | [];\n}\n","'use client';\n\nimport useSWR from 'swr';\nimport { find, propEq } from 'ramda';\nimport { apiPaths } from './api-paths';\nimport { useAppContext } from './app-context';\nimport { useConfig } from './config/config-context';\nimport type { SingleProject } from './config/types';\nimport type {\n Attribute,\n Entity,\n RawResultItem,\n RawSearchResultItems,\n SearchRequestProps,\n SearchResultItem,\n} from './types';\n\nexport function useSearch(\n projectId: string,\n searchRequest: SearchRequestProps | null\n): { results: SearchResultItem[] | []; error: Error; isLoading: boolean } {\n const { scope } = useAppContext();\n const { projects, currentProjectId } = useConfig();\n const { schema, scopes } = find(propEq(currentProjectId ?? '', 'projectId'))(projects) as SingleProject;\n const defaultScope = scopes?.find((s) => s.isDefault)?.name ?? 'default';\n const swrKey = searchRequest?.commonParams.q ? JSON.stringify(searchRequest) : null;\n const { data, error, isLoading } = useSWR(swrKey, () =>\n fetch(apiPaths(projectId).search, {\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(searchRequest),\n method: 'POST',\n mode: 'cors',\n }).then((res) => res.json() as Promise<{ results: RawSearchResultItems }>)\n );\n const results = mapResults(data?.results ?? [], projectId, schema, scope, defaultScope);\n\n return { results: results ?? [], error, isLoading };\n}\n\n/**\n * Find the name of the attribute of an entity with isPrimary === true.\n * The value of that attribute is returned as the value for the relationship attribute\n */\nfunction getPrimaryAttributeName(schemaAttributes: Attribute[]): string {\n return schemaAttributes.find((attr) => attr.isPrimary)?.name ?? schemaAttributes[0]?.name;\n}\n\nfunction mapResults(\n results: RawSearchResultItems | undefined,\n projectId: string,\n schema: Entity[],\n scope: string,\n defaultScope: string\n): SearchResultItem[] | undefined {\n return results\n ?.filter((result) => (result as RawResultItem)?.hits?.length > 0)\n .map((result) => {\n const item = result as RawResultItem;\n const entityNamePlural = item.collection.replace(`${projectId}_`, '').replace(/_\\d+$/, '');\n const entitySchema = find<Entity>(propEq(entityNamePlural, 'plural'))(schema);\n\n if (!entitySchema) {\n return [];\n }\n\n const primaryAttributeName = getPrimaryAttributeName(entitySchema?.attributes ?? []);\n const entityName = entitySchema?.name ?? entityNamePlural;\n\n // iterate over the hits and return an object with the primary attribute value first and then the rest of the attributes.\n return item.hits.map(({ document }) => {\n const primaryAttribute = document[primaryAttributeName];\n const scopedPrimaryAttribute =\n primaryAttribute && typeof primaryAttribute !== 'string'\n ? (primaryAttribute[scope] ?? primaryAttribute[defaultScope])\n : null;\n const primaryAttributeValue = scopedPrimaryAttribute ?? document[primaryAttributeName];\n const attributes = Object.entries(document).reduce(\n (acc: Omit<SearchResultItem, '_id' | '_entityName' | '_entityNamePlural'>, [key, value]) => {\n if (key !== primaryAttributeName && key !== 'id' && key !== '_updatedAt') {\n const scopedValue = typeof value !== 'string' ? (value[scope] ?? value[defaultScope]) : value;\n\n acc[key] = scopedValue;\n }\n\n return acc;\n },\n {}\n );\n\n return {\n _id: document.id,\n _entityName: entityName,\n _entityNamePlural: entityNamePlural,\n [primaryAttributeName]: primaryAttributeValue as string,\n ...attributes,\n };\n });\n })\n .flat();\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import'./index.css';import {c as c$1}from'./chunk-7YBJLUUE.js';import {createContext,useContext}from'react';import c from'swr';import {useParams}from'react-router-dom';import {jsx}from'react/jsx-runtime';function i(){let{projectId:e}=useParams(),{data:t,isLoading:o}=c(c$1(e??"").currentUser,u=>fetch(u,{mode:"cors",credentials:"include"}).then(n=>n.json()));return [o,{user:t,logout:async()=>{await fetch(c$1(e??"").logout("/studio"),{method:"POST",mode:"cors",credentials:"include"}),await fetch("/api/flexkit/logout",{method:"GET",credentials:"include"}),window.location.reload();}}]}var s=createContext([true,{user:null,logout:()=>Promise.resolve()}]);function P({children:e}){let[t,o]=i();return jsx(s.Provider,{value:[t,o],children:e})}function x(){return useContext(s)}export{P as a,x as b};//# sourceMappingURL=chunk-NJN7EGGK.js.map
2
+ //# sourceMappingURL=chunk-NJN7EGGK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/auth/use-auth-service.ts","../src/auth/auth-context.tsx"],"names":["useAuthService","projectId","useParams","user","isLoadingUser","useSWR","apiPaths","url","res","AuthContext","createContext","AuthProvider","children","isLoading","auth","jsx","useAuth","useContext"],"mappings":"4MAOe,SAARA,CAAAA,EAA+C,CACpD,GAAM,CAAE,SAAA,CAAAC,CA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'swr';\nimport { useParams } from 'react-router-dom';\nimport { apiPaths } from '../core/api-paths';\nimport type { AuthService, User } from './types';\n\nexport default function useAuthService(): AuthService {\n const { projectId } = useParams();\n const { data: user, isLoading: isLoadingUser } = useSWR(apiPaths(projectId ?? '').currentUser, (url: string) =>\n fetch(url, { mode: 'cors', credentials: 'include' }).then((res) => res.json() as Promise<User>)\n );\n const isLoading = isLoadingUser;\n\n return [\n isLoading,\n {\n user,\n logout: async () => {\n // wipe remote session\n await fetch(apiPaths(projectId ?? '').logout('/studio'), {\n method: 'POST',\n mode: 'cors',\n credentials: 'include',\n });\n\n // delete first-party auth cookie\n await fetch('/api/flexkit/logout', { method: 'GET', credentials: 'include' });\n\n window.location.reload();\n },\n },\n ];\n}\n","'use client';\n\nimport { createContext, useContext } from 'react';\nimport useAuthService from './use-auth-service';\nimport type { Auth, AuthService, User } from './types';\n\nconst AuthContext = createContext([\n true,\n {\n user: null as User | null,\n logout: () => Promise.resolve(),\n } as Auth,\n]);\n\nexport function AuthProvider({ children }: { children: React.ReactNode }): JSX.Element {\n const [isLoading, auth] = useAuthService();\n\n return <AuthContext.Provider value={[isLoading, auth]}>{children}</AuthContext.Provider>;\n}\n\nexport function useAuth(): AuthService {\n return useContext(AuthContext) as AuthService;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import'./index.css';export{a as DateTime}from'./chunk-5ES3TTSY.js';//# sourceMappingURL=datetime-XX4YBITU.js.map
2
+ //# sourceMappingURL=datetime-XX4YBITU.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"datetime-E36AZJZE.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"datetime-XX4YBITU.js"}
@@ -0,0 +1,2 @@
1
+ import'./index.css';export{b as Editor}from'./chunk-6PYMDKS6.js';//# sourceMappingURL=editor-F72NJQ25.js.map
2
+ //# sourceMappingURL=editor-F72NJQ25.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"editor-A6ZBSVFX.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"editor-F72NJQ25.js"}
@@ -0,0 +1 @@
1
+ export * from 'lucide-react';
package/dist/icons.js ADDED
@@ -0,0 +1,2 @@
1
+ import'./index.css';export*from'lucide-react';//# sourceMappingURL=icons.js.map
2
+ //# sourceMappingURL=icons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"icons.js","sourcesContent":[]}
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as React$1 from 'react';
2
2
  import React__default, { Dispatch, SetStateAction, UIEvent, ReactElement } from 'react';
3
- import { A as AppContextType, a as ActionSetRelationship, b as ActionSetScope, C as Config, c as AppOptions, E as Entity, P as PluginOptions, d as ProjectOptions, S as SearchRequestProps, e as SearchResultItem, U as UseEntityQueryParams, M as MappedEntityItem, F as FormEntityItem, I as ImageValue, f as Schema, g as EntityData, h as AttributeValue, i as Attribute, j as MultipleRelationshipConnection } from './types.d-CH6seXQw.js';
4
- export { D as DataType, n as FormFieldParams, k as FormFieldProps, o as FormFieldValue, L as LogoProps, m as ScopeType, l as SingleProject } from './types.d-CH6seXQw.js';
3
+ import { A as AppContextType, a as ActionSetRelationship, b as ActionSetScope, C as Config, c as AppOptions, E as Entity, P as PluginOptions, d as ProjectOptions, e as SearchRequestProps, f as SearchResultItem, U as UseEntityQueryParams, M as MappedEntityItem, F as FormEntityItem, I as ImageValue, g as Schema, h as EntityData, i as AttributeValue, j as Attribute, k as MultipleRelationshipConnection } from './types.d-D7S0yibv.js';
4
+ export { D as DataType, l as FormFieldParams, m as FormFieldProps, n as FormFieldValue, L as LogoProps, o as ScopeType, S as SingleProject } from './types.d-D7S0yibv.js';
5
5
  export { Outlet, useLocation, useParams } from 'react-router-dom';
6
6
  import { DocumentNode, ErrorLike } from '@apollo/client';
7
7
  export { gql } from '@apollo/client';