codicent-app-sdk 0.3.38 → 0.3.39
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/README.md +53 -0
- package/dist/cjs/components/FileThumbnail.js +1 -1
- package/dist/cjs/components/MessageInput.d.ts.map +1 -1
- package/dist/cjs/components/MessageInput.js +1 -1
- package/dist/cjs/components/MessageInput.js.map +1 -1
- package/dist/cjs/components/Textarea.d.ts +1 -0
- package/dist/cjs/components/Textarea.d.ts.map +1 -1
- package/dist/cjs/components/Textarea.js.map +1 -1
- package/dist/cjs/hooks/useTemplateVariables.js +1 -1
- package/dist/cjs/hooks/useTemplateVariables.js.map +1 -1
- package/dist/esm/components/FileThumbnail.js +1 -1
- package/dist/esm/components/MessageInput.d.ts.map +1 -1
- package/dist/esm/components/MessageInput.js +1 -1
- package/dist/esm/components/MessageInput.js.map +1 -1
- package/dist/esm/components/Textarea.d.ts +1 -0
- package/dist/esm/components/Textarea.d.ts.map +1 -1
- package/dist/esm/components/Textarea.js.map +1 -1
- package/dist/esm/hooks/useTemplateVariables.js +1 -1
- package/dist/esm/hooks/useTemplateVariables.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
@@ -209,3 +209,56 @@ For full documentation, visit [our docs site](https://izaxon.github.io/codicent-
|
|
209
209
|
## License
|
210
210
|
|
211
211
|
MIT © Codicent Inside AB
|
212
|
+
|
213
|
+
---
|
214
|
+
|
215
|
+
## Fast Local SDK Testing Workflow
|
216
|
+
|
217
|
+
To quickly test changes in your local SDK with your app project, you can use npm link or a local file dependency. This avoids publishing to npm for every change.
|
218
|
+
|
219
|
+
### Option 1: Using `npm link`
|
220
|
+
|
221
|
+
1. **Build your SDK in watch mode (if needed):**
|
222
|
+
- If your SDK uses TypeScript or a bundler (like rollup), run it in watch mode so changes are rebuilt automatically.
|
223
|
+
```cmd
|
224
|
+
npm run build -- --watch
|
225
|
+
```
|
226
|
+
Or for TypeScript:
|
227
|
+
```cmd
|
228
|
+
npx tsc --watch
|
229
|
+
```
|
230
|
+
|
231
|
+
2. **Link your SDK globally:**
|
232
|
+
In your SDK root folder:
|
233
|
+
```cmd
|
234
|
+
npm link
|
235
|
+
```
|
236
|
+
|
237
|
+
3. **Link your SDK in your app project:**
|
238
|
+
In your app project folder (the one that uses the SDK):
|
239
|
+
```cmd
|
240
|
+
npm link codicent-app-sdk
|
241
|
+
```
|
242
|
+
(Replace `codicent-app-sdk` with the actual name in your SDK’s `package.json` if different.)
|
243
|
+
|
244
|
+
4. **Test changes instantly:**
|
245
|
+
Now, when you make changes to your SDK and rebuild, your app will use the updated local version immediately—no need to publish or reinstall from npm.
|
246
|
+
|
247
|
+
5. **Unlink when done:**
|
248
|
+
When you want to go back to using the npm-published version, run in your app project:
|
249
|
+
```cmd
|
250
|
+
npm uninstall codicent-app-sdk
|
251
|
+
npm install codicent-app-sdk
|
252
|
+
```
|
253
|
+
|
254
|
+
### Option 2: Using a Local File Dependency
|
255
|
+
|
256
|
+
1. In your app’s `package.json`, set the dependency to point to your local SDK folder:
|
257
|
+
```json
|
258
|
+
"dependencies": {
|
259
|
+
"codicent-app-sdk": "file:../codicent-app-sdk"
|
260
|
+
}
|
261
|
+
```
|
262
|
+
2. Run `npm install` in your app project.
|
263
|
+
|
264
|
+
---
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),o=require("../node_modules/@griffel/react/makeStyles.esm.js"),t=require("../node_modules/@fluentui/react-button/lib/components/Button/Button.js"),i=require("../node_modules/@fluentui/react-image/lib/components/Image/Image.js"),r=require("../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-6.js"),n=require("../node_modules/@fluentui/tokens/lib/tokens.js"),l=require("../node_modules/@fluentui/react-icons/lib/icons/chunk-1.js");const s=o.makeStyles({thumbnail:{width:"64px",height:"64px",borderRadius:n.tokens.borderRadiusMedium,backgroundColor:n.tokens.colorNeutralBackground2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",position:"relative",cursor:"pointer",flexShrink:0,flexGrow:0,margin:"4px","&:hover":{backgroundColor:n.tokens.colorNeutralBackground2Hover}},image:{width:"100%",height:"100%",objectFit:"cover",borderRadius:"inherit"},fileName:{position:"absolute",bottom:0,left:0,right:0,backgroundColor:"rgba(0, 0, 0, 0.6)",color:n.tokens.colorNeutralForegroundInverted,padding:"4px",fontSize:n.tokens.fontSizeBase200,textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",borderBottomLeftRadius:"inherit",borderBottomRightRadius:"inherit"},fileIcon:{fontSize:"32px",color:n.tokens.colorNeutralForeground2},deleteButton:{position:"absolute",top:"4px",right:"4px",minWidth:"20px",height:"20px",padding:"2px",backgroundColor:n.tokens.colorNeutralBackground1,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1,"&:hover":{backgroundColor:n.tokens.colorNeutralBackground1Hover}}});exports.FileThumbnail=({file:o,getImageUrl:n,onClick:a,onDelete:u,thumbnailSize:c})=>{const d=s();return e.jsxs("div",{className:d.thumbnail,onClick:a,title:o.filename,children:[u&&e.jsx(t.Button,{className:d.deleteButton,icon:e.jsx(l.DismissRegular,{}),appearance:"subtle",size:"small",onClick:e=>{e.stopPropagation(),u?.()},title:"Ta bort"}),o.contentType.startsWith("image")?e.jsx(i.Image,{className:d.image,src:`${n(o.id,c||200)}&width=${c}`,alt:o.filename}):e.jsx(r.DocumentData32Regular,{className:d.fileIcon}),e.jsx("div",{className:d.fileName,children:o.filename})]})};
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),o=require("../node_modules/@griffel/react/makeStyles.esm.js"),t=require("../node_modules/@fluentui/react-button/lib/components/Button/Button.js"),i=require("../node_modules/@fluentui/react-image/lib/components/Image/Image.js"),r=require("../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-6.js"),n=require("../node_modules/@fluentui/tokens/lib/tokens.js"),l=require("../node_modules/@fluentui/react-icons/lib/icons/chunk-1.js");const s=o.makeStyles({thumbnail:{width:"64px",height:"64px",borderRadius:n.tokens.borderRadiusMedium,backgroundColor:n.tokens.colorNeutralBackground2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",position:"relative",cursor:"pointer",flexShrink:0,flexGrow:0,margin:"4px","&:hover":{backgroundColor:n.tokens.colorNeutralBackground2Hover}},image:{width:"100%",height:"100%",objectFit:"cover",borderRadius:"inherit"},fileName:{position:"absolute",bottom:0,left:0,right:0,backgroundColor:"rgba(0, 0, 0, 0.6)",color:n.tokens.colorNeutralForegroundInverted,padding:"4px",fontSize:n.tokens.fontSizeBase200,textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",borderBottomLeftRadius:"inherit",borderBottomRightRadius:"inherit"},fileIcon:{fontSize:"32px",color:n.tokens.colorNeutralForeground2},deleteButton:{position:"absolute",top:"4px",right:"4px",minWidth:"20px",height:"20px",padding:"2px",backgroundColor:n.tokens.colorNeutralBackground1,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1,"&:hover":{backgroundColor:n.tokens.colorNeutralBackground1Hover}}});exports.FileThumbnail=({file:o,getImageUrl:n,onClick:a,onDelete:u,thumbnailSize:c})=>{const d=s();return e.jsxs("div",{className:d.thumbnail,onClick:a,title:o.filename,children:[u&&e.jsx(t.Button,{className:d.deleteButton,icon:e.jsx(l.DismissRegular,{}),appearance:"subtle",size:"small",onClick:e=>{e.stopPropagation(),u?.()},title:"Ta bort"}),o.contentType&&o.contentType.startsWith("image")?e.jsx(i.Image,{className:d.image,src:`${n(o.id,c||200)}&width=${c}`,alt:o.filename}):e.jsx(r.DocumentData32Regular,{className:d.fileIcon}),e.jsx("div",{className:d.fileName,children:o.filename})]})};
|
2
2
|
//# sourceMappingURL=FileThumbnail.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"MessageInput.d.ts","sourceRoot":"","sources":["../../../src/components/MessageInput.tsx"],"names":[],"mappings":"AAWA,OAAO,KAA6C,MAAM,OAAO,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AAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,gBAAgB,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,KAAK,IAAI,CAAC;IAClD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IACnB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;IAC5C,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IACvD,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACrC,oBAAoB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CACpD;AA+DD,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA0M7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react");require("../services/codicent.js"),require("./Markdown.js");var a=require("./Textarea.js"),t=require("./Button.js"),i=require("./Spinner.js");require("./TextHeader.js"),require("./TypingIndicator.js"),require("./Dialog.js"),require("./ChatInput.js"),require("./CombinedPlaceholderDialog.js"),require("./ChatMessage.js"),require("./Header.js");var s=require("../utils/MessageContent.js");require("../node_modules/tinycolor2/esm/tinycolor.js"),require("../_virtual/index.js");var o=require("../config/index.js");require("../lib/wavtools/lib/wav_packer.js"),require("../lib/wavtools/lib/analysis/audio_analysis.js"),require("../lib/wavtools/lib/wav_stream_player.js"),require("../lib/wavtools/lib/wav_recorder.js");var
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react");require("../services/codicent.js"),require("./Markdown.js");var a=require("./Textarea.js"),t=require("./Button.js"),i=require("./Spinner.js");require("./TextHeader.js"),require("./TypingIndicator.js"),require("./Dialog.js"),require("./ChatInput.js"),require("./CombinedPlaceholderDialog.js"),require("./ChatMessage.js"),require("./Header.js");var s=require("../utils/MessageContent.js");require("../node_modules/tinycolor2/esm/tinycolor.js"),require("../_virtual/index.js");var o=require("../config/index.js");require("../lib/wavtools/lib/wav_packer.js"),require("../lib/wavtools/lib/analysis/audio_analysis.js"),require("../lib/wavtools/lib/wav_stream_player.js"),require("../lib/wavtools/lib/wav_recorder.js");var n=require("./FileThumbnail.js");require("./UploadFile.js"),require("./SnapFooter.js"),require("./Profile.js"),require("./MessageItem.js"),require("./Content.js"),require("./AiInput.js"),require("./SearchBox.js"),require("./HtmlView.js"),require("./Footer.js"),require("./Page.js"),require("../pages/AppFrame.js"),require("../pages/Snap.js"),require("../pages/Search.js"),require("../pages/Login.js"),require("../pages/CrmPage.js"),require("../pages/ImageView.js"),require("../pages/FormInvite.js"),require("../pages/FormAccept.js"),require("../pages/Sales.js"),require("../stores/chatStore.js");var l=require("../hooks/useLocalization.js");require("../hooks/useAppStyles.js");var u=require("../hooks/useToaster.js"),c=require("../node_modules/@griffel/react/makeStyles.esm.js"),p=require("../node_modules/@fluentui/tokens/lib/tokens.js");const d=c.makeStyles({container:{display:"flex",padding:"8px",width:"100%",position:"relative"},textareaWrapper:{position:"relative",flexGrow:1,display:"flex",flexDirection:"column",maxWidth:"100%"},textarea:{width:"100%",paddingBottom:"40px"},actionButtonRow:{position:"absolute",left:"8px",bottom:"8px",right:"8px",zIndex:1,display:"flex",justifyContent:"space-between"},leftButtonGroup:{display:"flex",gap:"4px"},actionButton:{color:p.tokens.colorNeutralForeground2,"&:hover":{color:p.tokens.colorBrandBackground,backgroundColor:"transparent"}},fileList:{display:"flex",overflowX:"auto",overflowY:"hidden",scrollbarWidth:"thin",msOverflowStyle:"none",padding:"4px",margin:"0 -4px",maxWidth:"100%",boxSizing:"border-box","&::-webkit-scrollbar":{height:"6px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{backgroundColor:p.tokens.colorNeutralStroke1,borderRadius:"3px"}}});exports.default=({defaultText:c,onSend:p,onLocationChange:g,hasLocation:f,files:j=[],onFilesChange:m,onUploadFile:x,onUploadImage:q,onUploadCamera:h,getImageUrl:v,isUploading:b,rows:k,size:y,disableSend:S,placeholder:w,onChange:C,onImagePasted:B,onHandleDefaultFiles:T})=>{const[_,D]=r.useState(""),[F,N]=r.useState([]),I=d(),z=u.default(),{t:A}=l.default();r.useEffect((()=>{C?.(_)}),[_,C]),r.useEffect((()=>{const e=new s.default(c||"");D(e.content||""),N(e.tags||[]),e.files.length>0&&T?.(e.files)}),[c]);const E=async()=>{if(""===_.trim()&&0===j.length)return void z.notify(A("Meddelandet får inte vara tomt"),"","","error");const e=F.length>0?`#${F.join(" #")} `:"#log ";p(e+_),D("");const r=new s.default(c||"");N(r.tags||[]),m?.([])};return e.jsx("div",{className:I.container,onDrop:async e=>{if(e.preventDefault(),!m)return;const r=Array.from(e.dataTransfer.files);if(r.length>0)if(B&&r.every((e=>e.type&&e.type.startsWith("image/"))))for(const e of r)B(e);else m(r)},onDragOver:e=>{e.preventDefault()},children:e.jsxs("div",{className:I.textareaWrapper,children:[v&&j.length>0&&e.jsxs("div",{className:I.fileList,children:[j.map((r=>e.jsx(n.FileThumbnail,{file:r,getImageUrl:v,onDelete:()=>{return e=r.id,void m?.(j.filter((r=>r.id!==e)));var e}},r.id))),b&&e.jsx(i.Spinner,{})]}),e.jsx(a.Textarea,{size:"large",resize:"vertical",rows:k||7,value:_,onChange:e=>D(e.target.value),placeholder:w||A("Skriv vad du vill spara här..."),onKeyDown:e=>{!0!==S?"Enter"!==e.key||e.shiftKey||(e.preventDefault(),E()):"Enter"===e.key&&e.ctrlKey&&(e.preventDefault(),E())},onPaste:e=>{if(!m&&!B)return;const r=e.clipboardData.items;for(const a of r)if("file"===a.kind){const r=a.getAsFile();r&&(B&&r.type.startsWith("image/")?(e.preventDefault(),B(r)):m&&(e.preventDefault(),m([r])))}},className:I.textarea}),e.jsxs("div",{className:I.actionButtonRow,children:[e.jsxs("div",{className:I.leftButtonGroup,children:[x&&e.jsx(t.Button,{appearance:"transparent",icon:q?"AttachRegular":"AddRegular",size:"small",title:A("Lägg till fil"),onClick:x,className:I.actionButton}),q&&e.jsx(t.Button,{appearance:"transparent",icon:"ImageRegular",size:"small",title:A("Lägg till bild"),onClick:q,className:I.actionButton}),h&&e.jsx(t.Button,{appearance:"transparent",icon:"CameraRegular",size:"small",title:A("Ta kort"),onClick:h,className:I.actionButton}),g&&e.jsx(t.Button,{appearance:"transparent",icon:f?"LocationFilled":"LocationRegular",size:"small",title:A("Spara plats"),onClick:()=>g(!f),className:I.actionButton})]}),e.jsx(t.Button,{appearance:o.getConfigValue("SHOW_SAVE_BUTTON_TEXT")?"primary":"subtle",onClick:E,icon:"SendFilled",iconPosition:"before",title:A("Spara"),size:y||(o.getConfigValue("SHOW_SAVE_BUTTON_TEXT")?"small":"large"),children:o.getConfigValue("SHOW_SAVE_BUTTON_TEXT")&&e.jsx("span",{children:A("Spara")})})]})]})})};
|
2
2
|
//# sourceMappingURL=MessageInput.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"MessageInput.js","sources":["../../../../src/components/MessageInput.tsx"],"sourcesContent":[null],"names":["useStyles","makeStyles","container","display","padding","width"],"mappings":"kpDAqCeA,EAACC,EAAAA,WAAa,CAC3BC,UAAoB,CACrBC,QAAA,OA+DDC,
|
1
|
+
{"version":3,"file":"MessageInput.js","sources":["../../../../src/components/MessageInput.tsx"],"sourcesContent":[null],"names":["useStyles","makeStyles","container","display","padding","width"],"mappings":"kpDAqCeA,EAACC,EAAAA,WAAa,CAC3BC,UAAoB,CACrBC,QAAA,OA+DDC,cA4MAC,MAAe"}
|
@@ -10,6 +10,7 @@ export interface TextareaProps {
|
|
10
10
|
rows?: number;
|
11
11
|
className?: string;
|
12
12
|
onFocus?: (event: React.FocusEvent<HTMLTextAreaElement>) => void;
|
13
|
+
onPaste?: (event: React.ClipboardEvent<HTMLTextAreaElement>) => void;
|
13
14
|
}
|
14
15
|
export declare const Textarea: React.FC<TextareaProps>;
|
15
16
|
//# sourceMappingURL=Textarea.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../src/components/Textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,mBAAmB,CAAC,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACtF,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;IACtE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,UAAU,CAAC;IACrD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;
|
1
|
+
{"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../src/components/Textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,mBAAmB,CAAC,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACtF,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;IACtE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,UAAU,CAAC;IACrD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;IACjE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;CACtE;AAED,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAkB5C,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Textarea.js","sources":["../../../../src/components/Textarea.tsx"],"sourcesContent":[null],"names":["useStyles","makeStyles","textarea","width","minHeight","paddingBottom","value","onChange","size","props","classes","event","data"],"mappings":"+RAWOA,EAASC,EAAAA,WAAC,CACfC,SAAW,CACPC,MAAG,OACIC,UAAG,OACdC,cAAoB,2BAGN,EAAAC,QAAAC,WAAAC,UAAAC,MACd,MAASC,EAAGV,kGACM,CAAAW,EAAMC,
|
1
|
+
{"version":3,"file":"Textarea.js","sources":["../../../../src/components/Textarea.tsx"],"sourcesContent":[null],"names":["useStyles","makeStyles","textarea","width","minHeight","paddingBottom","value","onChange","size","props","classes","event","data","syntheticEvent"],"mappings":"+RAWOA,EAASC,EAAAA,WAAC,CACfC,SAAW,CACPC,MAAG,OACIC,UAAG,OACdC,cAAoB,2BAGN,EAAAC,QAAAC,WAAAC,UAAAC,MACd,MAASC,EAAGV,kGACM,CAAAW,EAAMC,KACxB,GAAQL,EAAU,CAGb,MAAAM,EAAgB"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";exports.useTemplateVariables=e=>({extractTemplateVariables:e=>Array.from(e.matchAll(/{{([^}]+)}}/gs)).map((e=>({name:e[1].trim(),value:""}))),replaceTemplateVariables:(e,a)=>{let l=e;return a.forEach((e=>{const a=e.name.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`{{${a}}}`,"g"),t=e.value.replace(/\n/g,"\n");l=l.replace(r,t)})),l},extractFilePlaceholders:e=>Array.from(e.matchAll(/\[\[(.*?)\]\]/g)).map((e=>({placeholder:e[0],description:e[1].trim()||"file"}))),replaceFilePlaceholders:(e,a)=>{let l=e;return a.forEach((({placeholder:e,fileId:a})=>{l=l.replace(e,a
|
1
|
+
"use strict";exports.useTemplateVariables=e=>({extractTemplateVariables:e=>Array.from(e.matchAll(/{{([^}]+)}}/gs)).map((e=>({name:e[1].trim(),value:""}))),replaceTemplateVariables:(e,a)=>{let l=e;return a.forEach((e=>{const a=e.name.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`{{${a}}}`,"g"),t=e.value.replace(/\n/g,"\n");l=l.replace(r,t)})),l},extractFilePlaceholders:e=>Array.from(e.matchAll(/\[\[(.*?)\]\]/g)).map((e=>({placeholder:e[0],description:e[1].trim()||"file"}))),replaceFilePlaceholders:(e,a)=>{let l=e;return a.forEach((({placeholder:e,fileId:a})=>{l=l.replace(e,a?`%23file:${a}`:"")})),l},handleSelectFiles:async a=>await Promise.all(Array.from(a).map((a=>{const l=new FormData;return l.append("file",a),e(a.name,l)})))});
|
2
2
|
//# sourceMappingURL=useTemplateVariables.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useTemplateVariables.js","sources":["../../../../src/hooks/useTemplateVariables.ts"],"sourcesContent":[null],"names":["uploadFile","async","files","Promise","all","Array","from","map","file","fileForm","FormData","append","name"],"mappings":"0CAAiCA,
|
1
|
+
{"version":3,"file":"useTemplateVariables.js","sources":["../../../../src/hooks/useTemplateVariables.ts"],"sourcesContent":[null],"names":["uploadFile","async","files","Promise","all","Array","from","map","file","fileForm","FormData","append","name"],"mappings":"0CAAiCA,4kBAClBC,MAAAC,SACCC,QAAAC,IAAAC,MAAAC,KAAAJ,GAAAK,KAAAC,IACf,MAAAC,EAAA,IAAAC,SAGY,SADmBC,OAAA,OAAAH,KACVA,EAAAI,KAAAH,EAAA"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{jsxs as e,jsx as o}from"react/jsx-runtime";import{makeStyles as t}from"../node_modules/@griffel/react/makeStyles.esm.js";import{Button as i}from"../node_modules/@fluentui/react-button/lib/components/Button/Button.js";import{Image as r}from"../node_modules/@fluentui/react-image/lib/components/Image/Image.js";import{DocumentData32Regular as n}from"../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-6.js";import{tokens as l}from"../node_modules/@fluentui/tokens/lib/tokens.js";import{DismissRegular as a}from"../node_modules/@fluentui/react-icons/lib/icons/chunk-1.js";const s=t({thumbnail:{width:"64px",height:"64px",borderRadius:l.borderRadiusMedium,backgroundColor:l.colorNeutralBackground2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",position:"relative",cursor:"pointer",flexShrink:0,flexGrow:0,margin:"4px","&:hover":{backgroundColor:l.colorNeutralBackground2Hover}},image:{width:"100%",height:"100%",objectFit:"cover",borderRadius:"inherit"},fileName:{position:"absolute",bottom:0,left:0,right:0,backgroundColor:"rgba(0, 0, 0, 0.6)",color:l.colorNeutralForegroundInverted,padding:"4px",fontSize:l.fontSizeBase200,textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",borderBottomLeftRadius:"inherit",borderBottomRightRadius:"inherit"},fileIcon:{fontSize:"32px",color:l.colorNeutralForeground2},deleteButton:{position:"absolute",top:"4px",right:"4px",minWidth:"20px",height:"20px",padding:"2px",backgroundColor:l.colorNeutralBackground1,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1,"&:hover":{backgroundColor:l.colorNeutralBackground1Hover}}}),c=({file:t,getImageUrl:l,onClick:c,onDelete:u,thumbnailSize:d})=>{const m=s();return e("div",{className:m.thumbnail,onClick:c,title:t.filename,children:[u&&o(i,{className:m.deleteButton,icon:o(a,{}),appearance:"subtle",size:"small",onClick:e=>{e.stopPropagation(),u?.()},title:"Ta bort"}),t.contentType.startsWith("image")?o(r,{className:m.image,src:`${l(t.id,d||200)}&width=${d}`,alt:t.filename}):o(n,{className:m.fileIcon}),o("div",{className:m.fileName,children:t.filename})]})};export{c as FileThumbnail};
|
1
|
+
import{jsxs as e,jsx as o}from"react/jsx-runtime";import{makeStyles as t}from"../node_modules/@griffel/react/makeStyles.esm.js";import{Button as i}from"../node_modules/@fluentui/react-button/lib/components/Button/Button.js";import{Image as r}from"../node_modules/@fluentui/react-image/lib/components/Image/Image.js";import{DocumentData32Regular as n}from"../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-6.js";import{tokens as l}from"../node_modules/@fluentui/tokens/lib/tokens.js";import{DismissRegular as a}from"../node_modules/@fluentui/react-icons/lib/icons/chunk-1.js";const s=t({thumbnail:{width:"64px",height:"64px",borderRadius:l.borderRadiusMedium,backgroundColor:l.colorNeutralBackground2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",position:"relative",cursor:"pointer",flexShrink:0,flexGrow:0,margin:"4px","&:hover":{backgroundColor:l.colorNeutralBackground2Hover}},image:{width:"100%",height:"100%",objectFit:"cover",borderRadius:"inherit"},fileName:{position:"absolute",bottom:0,left:0,right:0,backgroundColor:"rgba(0, 0, 0, 0.6)",color:l.colorNeutralForegroundInverted,padding:"4px",fontSize:l.fontSizeBase200,textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",borderBottomLeftRadius:"inherit",borderBottomRightRadius:"inherit"},fileIcon:{fontSize:"32px",color:l.colorNeutralForeground2},deleteButton:{position:"absolute",top:"4px",right:"4px",minWidth:"20px",height:"20px",padding:"2px",backgroundColor:l.colorNeutralBackground1,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1,"&:hover":{backgroundColor:l.colorNeutralBackground1Hover}}}),c=({file:t,getImageUrl:l,onClick:c,onDelete:u,thumbnailSize:d})=>{const m=s();return e("div",{className:m.thumbnail,onClick:c,title:t.filename,children:[u&&o(i,{className:m.deleteButton,icon:o(a,{}),appearance:"subtle",size:"small",onClick:e=>{e.stopPropagation(),u?.()},title:"Ta bort"}),t.contentType&&t.contentType.startsWith("image")?o(r,{className:m.image,src:`${l(t.id,d||200)}&width=${d}`,alt:t.filename}):o(n,{className:m.fileIcon}),o("div",{className:m.fileName,children:t.filename})]})};export{c as FileThumbnail};
|
2
2
|
//# sourceMappingURL=FileThumbnail.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"MessageInput.d.ts","sourceRoot":"","sources":["../../../src/components/MessageInput.tsx"],"names":[],"mappings":"AAWA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAQlE,UAAU,iBAAiB;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,gBAAgB,CAAC,EAAE,CAAC,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,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IACnB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;IAC5C,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IACvD,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACrC,oBAAoB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CACpD;AA+DD,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA0M7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{jsx as e,jsxs as
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useState as o,useEffect as a}from"react";import"../services/codicent.js";import"./Markdown.js";import{Textarea as r}from"./Textarea.js";import{Button as i}from"./Button.js";import{Spinner as s}from"./Spinner.js";import"./TextHeader.js";import"./TypingIndicator.js";import"./Dialog.js";import"./ChatInput.js";import"./CombinedPlaceholderDialog.js";import"./ChatMessage.js";import"./Header.js";import l from"../utils/MessageContent.js";import"../node_modules/tinycolor2/esm/tinycolor.js";import"../_virtual/index.js";import{getConfigValue as n}from"../config/index.js";import"../lib/wavtools/lib/wav_packer.js";import"../lib/wavtools/lib/analysis/audio_analysis.js";import"../lib/wavtools/lib/wav_stream_player.js";import"../lib/wavtools/lib/wav_recorder.js";import{FileThumbnail as p}from"./FileThumbnail.js";import"./UploadFile.js";import"./SnapFooter.js";import"./Profile.js";import"./MessageItem.js";import"./Content.js";import"./AiInput.js";import"./SearchBox.js";import"./HtmlView.js";import"./Footer.js";import"./Page.js";import"../pages/AppFrame.js";import"../pages/Snap.js";import"../pages/Search.js";import"../pages/Login.js";import"../pages/CrmPage.js";import"../pages/ImageView.js";import"../pages/FormInvite.js";import"../pages/FormAccept.js";import"../pages/Sales.js";import"../stores/chatStore.js";import m from"../hooks/useLocalization.js";import"../hooks/useAppStyles.js";import c from"../hooks/useToaster.js";import{makeStyles as d}from"../node_modules/@griffel/react/makeStyles.esm.js";import{tokens as g}from"../node_modules/@fluentui/tokens/lib/tokens.js";const f=d({container:{display:"flex",padding:"8px",width:"100%",position:"relative"},textareaWrapper:{position:"relative",flexGrow:1,display:"flex",flexDirection:"column",maxWidth:"100%"},textarea:{width:"100%",paddingBottom:"40px"},actionButtonRow:{position:"absolute",left:"8px",bottom:"8px",right:"8px",zIndex:1,display:"flex",justifyContent:"space-between"},leftButtonGroup:{display:"flex",gap:"4px"},actionButton:{color:g.colorNeutralForeground2,"&:hover":{color:g.colorBrandBackground,backgroundColor:"transparent"}},fileList:{display:"flex",overflowX:"auto",overflowY:"hidden",scrollbarWidth:"thin",msOverflowStyle:"none",padding:"4px",margin:"0 -4px",maxWidth:"100%",boxSizing:"border-box","&::-webkit-scrollbar":{height:"6px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{backgroundColor:g.colorNeutralStroke1,borderRadius:"3px"}}}),u=({defaultText:d,onSend:g,onLocationChange:u,hasLocation:j,files:h=[],onFilesChange:v,onUploadFile:b,onUploadImage:x,onUploadCamera:y,getImageUrl:k,isUploading:w,rows:S,size:C,disableSend:T,placeholder:_,onChange:B,onImagePasted:D,onHandleDefaultFiles:N})=>{const[F,I]=o(""),[z,A]=o([]),L=f(),U=c(),{t:W}=m();a((()=>{B?.(F)}),[F,B]),a((()=>{const e=new l(d||"");I(e.content||""),A(e.tags||[]),e.files.length>0&&N?.(e.files)}),[d]);const E=async()=>{if(""===F.trim()&&0===h.length)return void U.notify(W("Meddelandet får inte vara tomt"),"","","error");const e=z.length>0?`#${z.join(" #")} `:"#log ";g(e+F),I("");const t=new l(d||"");A(t.tags||[]),v?.([])};return e("div",{className:L.container,onDrop:async e=>{if(e.preventDefault(),!v)return;const t=Array.from(e.dataTransfer.files);if(t.length>0)if(D&&t.every((e=>e.type&&e.type.startsWith("image/"))))for(const e of t)D(e);else v(t)},onDragOver:e=>{e.preventDefault()},children:t("div",{className:L.textareaWrapper,children:[k&&h.length>0&&t("div",{className:L.fileList,children:[h.map((t=>e(p,{file:t,getImageUrl:k,onDelete:()=>{return e=t.id,void v?.(h.filter((t=>t.id!==e)));var e}},t.id))),w&&e(s,{})]}),e(r,{size:"large",resize:"vertical",rows:S||7,value:F,onChange:e=>I(e.target.value),placeholder:_||W("Skriv vad du vill spara här..."),onKeyDown:e=>{!0!==T?"Enter"!==e.key||e.shiftKey||(e.preventDefault(),E()):"Enter"===e.key&&e.ctrlKey&&(e.preventDefault(),E())},onPaste:e=>{if(!v&&!D)return;const t=e.clipboardData.items;for(const o of t)if("file"===o.kind){const t=o.getAsFile();t&&(D&&t.type.startsWith("image/")?(e.preventDefault(),D(t)):v&&(e.preventDefault(),v([t])))}},className:L.textarea}),t("div",{className:L.actionButtonRow,children:[t("div",{className:L.leftButtonGroup,children:[b&&e(i,{appearance:"transparent",icon:x?"AttachRegular":"AddRegular",size:"small",title:W("Lägg till fil"),onClick:b,className:L.actionButton}),x&&e(i,{appearance:"transparent",icon:"ImageRegular",size:"small",title:W("Lägg till bild"),onClick:x,className:L.actionButton}),y&&e(i,{appearance:"transparent",icon:"CameraRegular",size:"small",title:W("Ta kort"),onClick:y,className:L.actionButton}),u&&e(i,{appearance:"transparent",icon:j?"LocationFilled":"LocationRegular",size:"small",title:W("Spara plats"),onClick:()=>u(!j),className:L.actionButton})]}),e(i,{appearance:n("SHOW_SAVE_BUTTON_TEXT")?"primary":"subtle",onClick:E,icon:"SendFilled",iconPosition:"before",title:W("Spara"),size:C||(n("SHOW_SAVE_BUTTON_TEXT")?"small":"large"),children:n("SHOW_SAVE_BUTTON_TEXT")&&e("span",{children:W("Spara")})})]})]})})};export{u as default};
|
2
2
|
//# sourceMappingURL=MessageInput.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"MessageInput.js","sources":["../../../../src/components/MessageInput.tsx"],"sourcesContent":[null],"names":["useStyles","makeStyles","container","display","padding","width"],"mappings":"smDAqCeA,EAACC,EAAa,CAC3BC,UAAoB,CACrBC,QAAA,OA+DDC,
|
1
|
+
{"version":3,"file":"MessageInput.js","sources":["../../../../src/components/MessageInput.tsx"],"sourcesContent":[null],"names":["useStyles","makeStyles","container","display","padding","width"],"mappings":"smDAqCeA,EAACC,EAAa,CAC3BC,UAAoB,CACrBC,QAAA,OA+DDC,cA4MAC,MAAe"}
|
@@ -10,6 +10,7 @@ export interface TextareaProps {
|
|
10
10
|
rows?: number;
|
11
11
|
className?: string;
|
12
12
|
onFocus?: (event: React.FocusEvent<HTMLTextAreaElement>) => void;
|
13
|
+
onPaste?: (event: React.ClipboardEvent<HTMLTextAreaElement>) => void;
|
13
14
|
}
|
14
15
|
export declare const Textarea: React.FC<TextareaProps>;
|
15
16
|
//# sourceMappingURL=Textarea.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../src/components/Textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,KAAK,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SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;IACjE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;CACtE;AAED,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAkB5C,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Textarea.js","sources":["../../../../src/components/Textarea.tsx"],"sourcesContent":[null],"names":["useStyles","makeStyles","textarea","width","minHeight","paddingBottom","Textarea","value","onChange","size","props","classes","event","data"],"mappings":"gUAWOA,EAASC,EAAC,CACfC,SAAW,CACPC,MAAG,OACIC,UAAG,OACdC,cAAoB,UAGbC,EAAO,EAAAC,QAAAC,WAAAC,UAAAC,MACd,MAASC,EAAGX,2EACM,CAAAY,EAAMC,
|
1
|
+
{"version":3,"file":"Textarea.js","sources":["../../../../src/components/Textarea.tsx"],"sourcesContent":[null],"names":["useStyles","makeStyles","textarea","width","minHeight","paddingBottom","Textarea","value","onChange","size","props","classes","event","data","syntheticEvent"],"mappings":"gUAWOA,EAASC,EAAC,CACfC,SAAW,CACPC,MAAG,OACIC,UAAG,OACdC,cAAoB,UAGbC,EAAO,EAAAC,QAAAC,WAAAC,UAAAC,MACd,MAASC,EAAGX,2EACM,CAAAY,EAAMC,KACxB,GAAQL,EAAU,CAGb,MAAAM,EAAgB"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
const e=e=>({extractTemplateVariables:e=>Array.from(e.matchAll(/{{([^}]+)}}/gs)).map((e=>({name:e[1].trim(),value:""}))),replaceTemplateVariables:(e,a)=>{let l=e;return a.forEach((e=>{const a=e.name.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`{{${a}}}`,"g"),t=e.value.replace(/\n/g,"\n");l=l.replace(r,t)})),l},extractFilePlaceholders:e=>Array.from(e.matchAll(/\[\[(.*?)\]\]/g)).map((e=>({placeholder:e[0],description:e[1].trim()||"file"}))),replaceFilePlaceholders:(e,a)=>{let l=e;return a.forEach((({placeholder:e,fileId:a})=>{l=l.replace(e,a
|
1
|
+
const e=e=>({extractTemplateVariables:e=>Array.from(e.matchAll(/{{([^}]+)}}/gs)).map((e=>({name:e[1].trim(),value:""}))),replaceTemplateVariables:(e,a)=>{let l=e;return a.forEach((e=>{const a=e.name.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`{{${a}}}`,"g"),t=e.value.replace(/\n/g,"\n");l=l.replace(r,t)})),l},extractFilePlaceholders:e=>Array.from(e.matchAll(/\[\[(.*?)\]\]/g)).map((e=>({placeholder:e[0],description:e[1].trim()||"file"}))),replaceFilePlaceholders:(e,a)=>{let l=e;return a.forEach((({placeholder:e,fileId:a})=>{l=l.replace(e,a?`%23file:${a}`:"")})),l},handleSelectFiles:async a=>await Promise.all(Array.from(a).map((a=>{const l=new FormData;return l.append("file",a),e(a.name,l)})))});export{e as useTemplateVariables};
|
2
2
|
//# sourceMappingURL=useTemplateVariables.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useTemplateVariables.js","sources":["../../../../src/hooks/useTemplateVariables.ts"],"sourcesContent":[null],"names":["uploadFile","async","files","Promise","all","Array","from","map","file","fileForm","FormData","append","name"],"mappings":"QAAiCA,
|
1
|
+
{"version":3,"file":"useTemplateVariables.js","sources":["../../../../src/hooks/useTemplateVariables.ts"],"sourcesContent":[null],"names":["uploadFile","async","files","Promise","all","Array","from","map","file","fileForm","FormData","append","name"],"mappings":"QAAiCA,4kBAClBC,MAAAC,SACCC,QAAAC,IAAAC,MAAAC,KAAAJ,GAAAK,KAAAC,IACf,MAAAC,EAAA,IAAAC,SAGY,SADmBC,OAAA,OAAAH,KACVA,EAAAI,KAAAH,EAAA"}
|
package/dist/index.d.ts
CHANGED
@@ -123,6 +123,7 @@ interface TextareaProps {
|
|
123
123
|
rows?: number;
|
124
124
|
className?: string;
|
125
125
|
onFocus?: (event: React$1.FocusEvent<HTMLTextAreaElement>) => void;
|
126
|
+
onPaste?: (event: React$1.ClipboardEvent<HTMLTextAreaElement>) => void;
|
126
127
|
}
|
127
128
|
declare const Textarea: React$1.FC<TextareaProps>;
|
128
129
|
|